mediatomb-0.12.1/0000775000076400007640000000000011357204745010557 500000000000000mediatomb-0.12.1/mediatomb.spec.in0000664000076400007640000001071111352702531013710 00000000000000%define name mediatomb %define version @VERSION@ %define release 1%{?dist} Version: %{version} Summary: MediaTomb - UPnP AV Mediaserver for Linux Name: %{name} Release: %{release} License: GPLv2 Group: Applications/Multimedia Source: http://downloads.sourceforge.net/mediatomb/%{name}-%{version}.tar.gz URL: http://mediatomb.cc Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: sqlite-devel, mysql-devel, libexif-devel, taglib-devel, file-devel, js-devel, zlib-devel Requires: mysql Requires(pre): shadow-utils Requires(post): /sbin/chkconfig Requires(preun): /sbin/chkconfig Requires(preun): /sbin/service %description MediaTomb is an open source (GPL) UPnP MediaServer with a nice web user interface, it allows you to stream your digital media through your home network and listen to/watch it on a variety of UPnP compatible devices. MediaTomb implements the UPnP MediaServer V 1.0 specification that can be found on http://www.upnp.org/. %prep %setup -q %build %configure --enable-taglib %{__make} %{?_smp_mflags} %install %{__rm} -rf $RPM_BUILD_ROOT %{__install} -p -D -m0755 scripts/mediatomb-service-fedora $RPM_BUILD_ROOT%{_initrddir}/mediatomb %{__install} -p -D -m0644 config/mediatomb-conf-fedora $RPM_BUILD_ROOT%{_sysconfdir}/mediatomb.conf make install DESTDIR=$RPM_BUILD_ROOT INSTALL="install -p" # make all files under %%_sysconfdir/mediatomb are owned by # this package %{__mkdir_p} $RPM_BUILD_ROOT%{_sysconfdir}/mediatomb touch $RPM_BUILD_ROOT%{_sysconfdir}/mediatomb/{config.xml,mediatomb.db,mediatomb.html} %{__mkdir_p} $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d %{__cat} > $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/%{name} << 'EOF' /var/log/mediatomb { create 644 root root monthly compress missingok } EOF %clean %{__rm} -rf $RPM_BUILD_ROOT %pre getent group mediatomb >/dev/null || groupadd -r mediatomb getent passwd mediatomb >/dev/null || \ useradd -r -g mediatomb -d %{_sysconfdir}/mediatomb -s /sbin/nologin \ -c "To run Mediatomb" mediatomb exit 0 %post /sbin/chkconfig --add mediatomb %preun if [ $1 = 0 ]; then /sbin/service mediatomb stop >/dev/null 2>&1 /sbin/chkconfig --del mediatomb fi %files %defattr(-,root,root,-) %doc README README.UTF_8 AUTHORS ChangeLog COPYING doc/doxygen.conf %doc doc/scripting.txt doc/scripting_utf8.txt %attr(-,mediatomb,mediatomb)%config(noreplace) %{_sysconfdir}/mediatomb.conf %attr(-,mediatomb,mediatomb)%dir %{_sysconfdir}/%{name}/ %attr(-,mediatomb,mediatomb)%ghost %{_sysconfdir}/%{name}/* %config(noreplace) %{_sysconfdir}/logrotate.d/%{name} %{_bindir}/mediatomb %{_datadir}/%{name}/* %{_mandir}/man1/* %{_initrddir}/mediatomb %changelog * Fri Jan 4 2008 Sergey Bostandzhyan 0.10.0-8 - Removed libextractor and enabled taglib instead of id3lib * Thu Jan 3 2008 Marc Wiriadisastra 0.10.0-7 - Added mysql-devel to build requires * Thu Jan 3 2008 Marc Wiriadisastra 0.10.0-6 - Cleaned up spec file * Wed Jan 2 2008 Marc Wiriadisastra 0.10.0-5 - Added mysql-libs for build requires instead of mysql-devel * Wed Jan 2 2008 Marc Wiriadisastra 0.10.0-4 - Actually added the patches to the file. - Added the ownership changes (Mamoru Tasaka) - Libextractor enabled * Wed Jan 2 2008 Marc Wiriadisastra 0.10.0-3 - Added patchs to patch ownership of /etc/mediatomb.conf and /etc/mediatomb - Adjusted pre and post scripts and add user and group mediatomb - Changed attributes so files are owned by mediatomb - Cleaned Requires and added two files for build-requires * Sun Dec 23 2007 Marc Wiriadisastra 0.10.0-2 - Altered spec file for inclusion into Fedora * Wed Jul 11 2007 Sergey Bostandzhyan 0.10.0-1 - Version is now filled in by the configure script. * Sun May 27 2007 Sergey Bostandzhyan 0.9.1-1 - updated the init script * Sun Mar 25 2007 Sergey Bostandzhyan 0.9.0-1 - Synced with the new script naming and adjusted for the release, added man page. * Mon Feb 26 2007 Sergey Bostandzhyan - Removed some files that were no longer needed. * Wed Sep 7 2005 Sergey Bostandzhyan - Removed some buildrequires, our configure script should handle different scenarios itself. * Wed Jun 15 2005 Sergey Bostandzhyan - Added init.d script + chkconfig * Thu Apr 14 2005 Sergey Bostandzhyan - Initial release mediatomb-0.12.1/COPYING0000664000076400007640000004336611351644367011550 00000000000000Note that the only valid version of the GPL for MediaTomb is this particular version of the license (ie v2, not v2.2 or v3.x or whatever), unless explicitly otherwise stated. GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Lesser General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS 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) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 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 Lesser General Public License instead of this License. mediatomb-0.12.1/ChangeLog0000664000076400007640000004425211357204646012260 00000000000000MediaTomb - UPnP AV Mediaserver. v0.12.1 08.04.2010 * fixed YouTube service support (got broken after they updated their website) * fixed a problem in soap response http headers (solves "access error" on Yamaha RX-V2065) * turned out the change log for 0.12.0 was not complete (various closed bugs were not mentioned) * fixed automatic id3lib detection when taglib is not available v0.12.0 25.03.2010 * added video thumbnail generation using libffmpegthumbnailer * added configure settings which allow to enable sqlite backups by default * added cross compile defaults for the inotify check to configure * added configure check for broken libmagic on Slackware * added libmp4v2 metadata handler to get tags and cover art from mp4 files * got rid of several compiler warnings * added storage cache * added storage insert buffering * fixed mysql "threads didn't exit" issue * implemented YouTube service support which allows to watch YouTube videos on your UPnP player (in combination with transcoding) * added fixes to allow PCM playback on the PS3 and other devices, thanks to mru for his findings. This allows streaming transcoded OGG and FLAC media to the PS3. * added option to enable tooltips for the web UI, thanks to cweiske for the patch * fixed bug #1986789 - Error when renaming a playlist container * added parameter -D/--debug (enable debug output) * closed feature request #1934646 - added parameter --version (prints version information * added parameter --compile-info (prints compile information) * fixed problem "Negative duration in .m3u files" (SF forum) * fixed bug #2078017 - Playlist inital import fails in autoscan directories * fixed bug #1890657 - transcoding tmp file using 2 // * fixed bug #1978210 - compile error with newer libcurl * fixed bug #1934649 - typo in --help text * fixed bugs #1986709 and #1996046 - cannot rename item with & in name * fixed bug #2122696 - build error with MySQL 5.1 * fixed bug #1973930 - Incorrect UPnP class assigned to Vorbis and Theora items * fixed bug #1934659 - unspecific error message when db is not available * fixed bug #2904448 - memset with number of bytes set to 0 in array.cc * added a "Directories" view in the default layout for Photos and Video, the feature is still somewhat experimental * added a feature that allows to mark played items * improved inotify check which was failing with 2.4 kernels * added support for lastfmlib, thanks to Dirk Vanden Boer vor the patch * increased buffer length for the exif field following the request from one of our users * fixed a problem where the upnp-string-limit function was not correctly truncating UTF-8 strings * fixed a bug where --enable-id3lib did not turn off the automatic enabling of taglib, which then resulted in an error message saying, that both libraries are enabled * implemented feature request #2833402 - ability to change ffmpegthumbnailer param "image quallity" * fixed bug #2783557 - Mediatomb always flags file as chunked output, thanks to Michael Guntsche * fixed bug #2804342 - wrong namespace in * added a fix for glibc 2.10, thanks to Honoome for the patch * added patches for NetBSD, thanks to Jared D. McNeill * fixed bug #2944701 Adding comment in config as last line yields segfault * fixed bug #2779907 SQLITE3: (1) cannot start a transaction within a transaction * fixed bug #2820213 build broken with libmp4v2-1.9.0 * fixed bug #2161155 inotify thread aborts * fixed bug #2011296 SVN rev 1844 doesn't show more than 10 files on PS3 * fixed bug #1988738 web ui docs miss note how to access web ui * fixed bug #1929230 invalid XML in UPNP messages * fixed bug #1865386 autoscan dir already exists error * implemented feature request #2313953 support for forked libmp4v2 project * implemented feature request #1955192 flag/mark watched video files * implemented feature request #1928580 better logging/tracing support * implemented feature request #1754010 m4a metadata extraction v0.11.0 01.03.2008 External transcoding support * implemented transcoding support that allows to plug in an arbitrary transcoding application * added fourcc detection for AVI files and transcoding options to limit transcoding to certain fourcc's * added new metadata extractor using ffmpeg, patch submitted by Ingo Preiml * added vorbis / theora detection for ogg containers, so video files should not end up in audio containers anymore * fixed bug where database-file option was still checked even when MySQL was selected in the configuration * fixed a bug where check of the home directory was enforced even if the configuration file was specified on command line * UTF-8 fix suggested by piman - taglib should handle UTF-8 correctly, so we will request an UTF-8 string from taglib and do not do the conversion ourselves * UTF-8 fix for libextractor, basically same as with TagLib * added default mapping for flv files since they are not correctly recognized by libmagic * fixed a bug where we could get crashed by a missing URL parameter sent to the UI * fixed 64bit related issues in the UPnP SDK * fixed a problem where ID3 tags were not detected with id3lib * fixed off by one errors in StringBuffer class, thanks to stigpo for the patch * fixed bug #1824216 - encoded URLs were not treated properly * made sure that log output is always flushed * made temporary directory configurable * using expat as XML parser * new XML generator - support for comments * changed layout of the storage configuration XML * added migration for old config.xml * speed up sqlite3 by setting synchronous=off by default * adding automatic database backup for sqlite3 * adding automatic backup restore on sqlite3 database corruption * fix permission problem - supplementary groups weren't set by initgroups() * fixed js (spidermonkey) related crashes * fix mysql reconnect issue - charset was lost after reconnect * added check to avoid coredump when max number of inotify watches has been reached * made sure that range requests specified as "bytes=0-" do not trigger a 416 response for media where the filesize is unknown * added fix for chunked encoding that was posted on the maemo forums * fixed configure to determine if iconv needs the const char cast or not (fixes OSX compilation problem) * added album art support for the PS3 * fixed a bug where path used by add container chain was not converted to UTF-8 * added patch for author and director extraction from id3 tags, submitted by Reinhard Enders * init script for fedora now uses the -e option instead of grepping for the IP (old variant only worked on systems with english language) * updated spec file with changes from Marc Wiriadisastra * we now are also providing the filesize along with the other metadata * added environment variables that can be used for additional server configuration (useful for directory independent NAS setups) * added comments and examples to the config.xml that is generated by the server * added patch from Gabriel Burca to extract keywords from id3 tags * added runtime inotify detection * added a workaround for the Noxon V1 which for some reasons sends us a double encoded ampersand XML sequences in the URL * implemented feature request #1771561, extension to mimetype mappings can now be case insensitive v0.10.0 11.07.2007 Playlist and inotify autoscan support. * MySQL database version pumped to 3 (MediaTomb will automatically update the database during the first launch) * Sqlite3 database version pumped to 2 (MediaTomb will automatically update the database during the first launch) * added support for inotify based autoscan * playlist support - parsing playlist via js is now possible * added network interface option * added workaround for a PS3 related problem, where sockets were left open (bug #1732412) * improved iconv handling of illegal characters * added character conversion safeguards to make sure that non UTF-8 strings do not make it into the database from js scripts * made character conversion functions available to js * added option to hide PC Directory from UPnP renderers * added album art support, album art is extracted from ID3 tags and offered to UPnP devices v0.9.1 28.05.2007 Playstation 3 support * added support for Playstation 3 * added command line option that allows to tell the server where to put the configuration upon first startup * fixed a fseeko-check related bug in configure * the configure script now honors the LDFLAGS while checking for sqlite3 * fixed wrong message printout in configure * PC Directory can now be renamed in the UI * fixed a bug in configure.ac, the --with-extractor-libs= parameter didn't work * fixed a MySQL related bug, if the path or filename contained non-UTF8 characters, the inserted strings weren't complete * circumvented a bug/feature of older MySQL versions, that caused the MySQL database creation script to fail * MySQL database version pumped to 2 (MediaTomb will automatically update the database during the first launch) v0.9.0 25.03.2007 Major rework * the UI was completely rewritten from scratch; it uses AJAX for all requests * integrated libupnp (http://pupnp.sf.net/) into our source tree * added largefile support * code has undergone some performance optimizations * fixed a bug where server did not shutdown while http download was in progress * all sqlite3 queries are now handled by a single, dedicated thread to make MediaTomb work with SQLite3 compiled with "--enable-threadsafe" * fixed a bug where setting -p 0 did not trigger automatic port selection if it had to override the value in config.xml * fixed bug 1425424 - crash on a bad config.xml - we did not handle the case where the tag was not present. Thanks to Nektarios K. Papadopoulos for the report and patch. * added configure option and adapted the code to completely supress all log output * added configure option and adapted the code to supress debug output * added taglib support, thanks to Benhur Stein for the patch. * bug 1524468 (startup in daemon mode fails) does no longer occur after the integration of libupnp 1.4.x sources * fixed bug 1292295 (string conversion was failing on 64bit platforms) * fixed issue with ContainerUpdateIDs (were not sent out along with accepted subscription) * fixed issue where some directories could not be browsed (filesystem browser). It turned out that we forgot to convert the filenames to UTF-8, as the result invalid characters made their way into the XML that was feeded to the browser. * improved illegal character conversion handling - in case iconv fails we will pad the rest of the name string with "?" and print out the failed name in the console. * we now try to determine the default import charsets by looking at the system locale. * implemented track number metadata extraction (feature request 1430799). track numbers are now extracted via id3lib/taglib and can also be used in the import script. import.js has been adapted to add tracknumbers to song names in the Album container. * added option to supress hidden files when browsing the filesystem * added X_MS_MediaReceiverRegistrar Service to allow future Xbox 360 support * added workarounds to enable Telegent TG100 avi playback * server can now be restarted by sending it a SIGHUP * the current configuration file will never be displayed in the UI and will never be added to the database - we do not want the user to accidentally share it on the network since it may contain security sensitive data * tomb-install is no longer needed, the server will automatically create a default ~/.mediatomb/config.xml file if there is none * the database tables will be created automatically if they don't exist * adapted configure script to correctly set flags for linkers that use the --as-needed option * the "PC Directory" isn't changeable via the UI anymore to ensure a correct view of the "PC Directory" * lookups in the database are now done with hashes, which should make many things faster, especially the adding * changed the database field "location" from varchar(255) to text to allow urls and locations of unlimited size * created a new theme for the UI * added support for "blind" .srt requests - some renderers like the DSM320 will blindly request the url provided via browse, replacing and found file extension with .srt, we will look for the .srt file in the directory where the original media is located, using the same filename, but with the .srt extension * created XML schema for "config.xml" to provide the possiblity of validating the configuration * added fallback if js is not available - there is a builtin feature to create a default virtual layout now; config.xml has got an option to select the virtual-layout type, it can be builting, js or disabled. * added charset option to the import script, it is not possible to specify the script encoding * we now validate filesystem, metadata and scripting charsets upon startup * added a special option that allows limiting title and description lengths in UPnP browse replies to a specified length; this was necessary to work around a bug in the TG100 that has problems browsing items where title length exceeds 101 characters. * import.js can now specify the upnp class of the last container in the chain * all items within a container which upnp class is set to object.container.album.musicAlbum will automatically be sorted by track number. * added option to configure the presentation URL to make it easier for NAS vendors to integrate the server into their web UI * made model number configurable v0.8.1 07.09.2005 * added "serve" directory, any files there can be downloaded like from a normal webserver * implemented keyword extraction for auxdata from libexif * implemented keyword extraction for auxdata from libextractor * added Exif metadata support for images via libexif. * added resolution attribute to image res tag * added bitrate and duration attribute to mp3 res tag (via id3lib) * added auxdata field for items, auxilary data can be extracted and used by import scripts. * added configuration options to specify which aux fields should be extracted and filled by the library. * added mysql support * refined configure script, almost all dependencies are now optional. * changed database, (not backward compatible again) * when an item is deleted all referenced items are deleted as well * added option to specify an alternative magic file v0.8.0 15.06.2005 Scripting/Virtual Server Layout * Server layout can now be defined using java script, default layout script is provided. * Added ID3 tag support. * Fixed various memory leaks. * Files in the Filesystem Browser are now sorted alphabetically. * Added extension to mime-type mappings to the configuration. * Added option to limit import by file extensions. * Added daemon mode as well as setuid/setgid options, init.d script included. * Fixed mime-type recognition when importing media (filemagic output is now parsed using regular expressions) * Introduced new log system. * Adding/Browsing/Removing media in the UI is now handled asynchroniously. * Added a command line option to import media upon server launch. * Added target directory option to tomb-install, cleaned up a few things. v0.7.1 17.04.2005 D-Link DSM-320 fix * Mappings of mime-types to upnp classes are now configurable. Actually this is how we solved the DSM-320 problem - they crashed if upnp class of items was different than what the DSM expected. * tomb-install now creates the database and configuration file from templates (was hardcoded); also sets the name of the server individually for each user (host / username) * Improved handling of configuration, if non critical options are missing we are now setting default values. v0.7 14.04.2005 First release * The changelog does not start at day 0, updates will be made starting from this release. mediatomb-0.12.1/artwork/0000775000076400007640000000000011357204751012245 500000000000000mediatomb-0.12.1/artwork/Makefile.am0000664000076400007640000000003211351644362014214 00000000000000EXTRA_DIST=mediatomb.xpm mediatomb-0.12.1/artwork/mediatomb.xpm0000664000076400007640000001507611351644362014665 00000000000000/* XPM */ static char *dummy[]={ "32 32 281 2", "Qt c None", "#p c #565656", ".A c #656565", "cw c #717171", ".z c #343434", "b3 c #555555", "b7 c #494949", ".2 c #4c4c4c", ".# c #565656", "cr c #595959", "bQ c #434343", "al c #494949", ".M c #3f3f3f", "a7 c #363636", ".U c #3a3a3a", "cv c #3b3b3b", "cq c #323232", "b8 c #2a2a2a", "bW c #282828", "cs c #282828", ".k c #343434", "cf c #2a2a2a", "a. c #292929", "cu c #2d2d2d", "ay c #343434", "ct c #333333", "b4 c #222222", "#d c #212121", "#H c #2c2c2c", "b0 c #222222", ".j c #262626", "aX c #353535", ".L c #1d1d1d", "cg c #232323", "bt c #282828", "#e c #2b2b2b", "aL c #252525", "aP c #1f1f1f", "bu c #252525", "cb c #1d1d1d", "bV c #1f1f1f", "#G c #1a1a1a", ".a c #242424", "bN c #1c1c1c", ".y c #1a1a1a", ".7 c #1b1b1b", "ca c #1e1e1e", ".T c #1c1c1c", "cp c #1a1a1a", "ak c #181818", ".B c #222222", "bM c #1c1c1c", ".1 c #1a1a1a", "bl c #181818", ".i c #1b1b1b", "#Y c #1d1d1d", ".8 c #1f1f1f", "ch c #181818", ".l c #1e1e1e", "bZ c #181818", ".b c #1c1c1c", "ce c #161616", "bm c #181818", "b6 c #181818", "ax c #151515", "b9 c #171717", "be c #141414", "b2 c #181818", "bR c #171717", ".h c #191919", "#q c #1d1d1d", ".N c #1d1d1d", "co c #141414", ".3 c #1c1c1c", ".c c #1a1a1a", "aK c #151515", "#X c #151515", "#o c #151515", "cc c #151515", "a6 c #161616", "ci c #141414", ".V c #1c1c1c", "a# c #1a1a1a", ".K c #171717", "bB c #161616", ".x c #171717", "aO c #131313", ".g c #171717", "aW c #121212", "bA c #141414", "bf c #181818", ".d c #181818", "b5 c #151515", "bX c #161616", "bP c #141414", ".f c #1b1b1b", "cn c #141414", ".e c #1c1c1c", "b1 c #161616", ".m c #1c1c1c", "c# c #131313", ".C c #1d1d1d", "cj c #151515", "am c #1e1e1e", "#c c #161616", "cd c #141414", ".S c #171717", "#f c #1f1f1f", "a8 c #1c1c1c", "cm c #161616", "#9 c #161616", "#I c #202020", "bU c #151515", "ck c #161616", ".6 c #181818", ".0 c #191919", "c. c #181818", ".w c #1c1c1c", "bs c #151515", "cl c #161616", "bY c #171717", "bL c #181818", "#F c #191919", "bk c #1b1b1b", "aj c #1c1c1c", "bv c #1d1d1d", ".J c #1e1e1e", "aY c #1f1f1f", "az c #202020", "aw c #212121", "aM c #222222", "bT c #232323", "aJ c #242424", ".n c #252525", ".v c #262626", "a5 c #272727", ".R c #282828", ".9 c #292929", "#b c #2a2a2a", "a4 c #2b2b2b", ".Z c #2c2c2c", ".D c #2d2d2d", ".u c #2e2e2e", ".o c #2f2f2f", ".Q c #303030", ".Y c #313131", ".I c #323232", ".P c #333333", ".t c #343434", ".p c #353535", ".s c #363636", ".r c #373737", ".q c #383838", ".H c #393939", ".G c #3a3a3a", ".E c #3b3b3b", ".F c #3c3c3c", ".O c #3d3d3d", ".X c #3e3e3e", ".W c #3f3f3f", ".5 c #404040", "aI c #414141", "#n c #424242", "#m c #434343", "bC c #444444", "#l c #454545", ".4 c #464646", "#Q c #494949", "bS c #4a4a4a", "#a c #4b4b4b", "#k c #4c4c4c", "aV c #4d4d4d", "#j c #4e4e4e", "#Z c #4f4f4f", "#J c #505050", "bh c #525252", "bb c #535353", "#w c #545454", "a2 c #555555", "aT c #565656", "ag c #575757", "at c #585858", "af c #595959", "#. c #5a5a5a", "as c #5b5b5b", "## c #5e5e5e", "a9 c #606060", "aZ c #616161", "#i c #626262", "#g c #636363", "aB c #646464", "#t c #656565", "#h c #666666", "#P c #676767", "#3 c #686868", "ao c #696969", "bg c #6d6d6d", "b# c #6e6e6e", "a0 c #6f6f6f", "aR c #707070", "aD c #717171", "bE c #727272", "aq c #737373", "bj c #767676", "bp c #777777", "#4 c #787878", "bd c #797979", "#R c #7a7a7a", "#x c #7b7b7b", "a1 c #7c7c7c", "aS c #7d7d7d", "aE c #7e7e7e", "bq c #828282", "ah c #848484", "aH c #868686", "aN c #878787", "aU c #888888", "aF c #898989", "au c #8a8a8a", "bF c #909090", "#E c #919191", "ba c #9a9a9a", "#8 c #9b9b9b", "ar c #9c9c9c", "#W c #9f9f9f", "ad c #a1a1a1", "b. c #a2a2a2", "aQ c #a3a3a3", "aC c #a4a4a4", "bH c #a6a6a6", "bK c #a8a8a8", "bo c #acacac", "bO c #afafaf", "#s c #b1b1b1", "#N c #b3b3b3", "#u c #b6b6b6", "ac c #b7b7b7", "#5 c #b8b8b8", "aa c #bcbcbc", "ap c #bfbfbf", "bw c #c2c2c2", "#6 c #c7c7c7", "aA c #c8c8c8", "an c #c9c9c9", "#v c #cbcbcb", "#O c #cecece", "#7 c #cfcfcf", "#r c #d0d0d0", "#K c #d1d1d1", "#0 c #d3d3d3", "bz c #d5d5d5", "bx c #d6d6d6", "by c #dcdcdc", "#D c #dedede", "ab c #e0e0e0", "bD c #e1e1e1", "#C c #e2e2e2", "bn c #e3e3e3", "#B c #e5e5e5", "#y c #e6e6e6", "bJ c #e7e7e7", "#A c #e8e8e8", "bI c #e9e9e9", "#z c #eaeaea", "br c #ededed", "bi c #efefef", "#S c #f1f1f1", "bc c #f2f2f2", "#V c #f3f3f3", "a3 c #f4f4f4", "bG c #f5f5f5", "ae c #f6f6f6", "#1 c #f7f7f7", "#U c #f8f8f8", "aG c #f9f9f9", "av c #fafafa", "ai c #fbfbfb", "#T c #fcfcfc", "#2 c #fdfdfd", "#M c #fefefe", "#L c #ffffff", "QtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQt", "QtQtQtQtQtQtQtQtQtQt.#.a.b.c.d.e.f.g.h.i.jQtQtQtQtQtQtQtQtQtQtQt", "QtQtQtQtQtQtQtQt.k.l.m.n.o.p.q.r.s.t.u.v.w.x.y.zQtQtQtQtQtQtQtQt", "QtQtQtQtQtQt.A.B.C.D.E.F.E.E.G.H.q.s.p.t.I.D.J.K.LQtQtQtQtQtQtQt", "QtQtQtQtQt.M.N.n.E.O.O.O.O.F.E.G.H.q.s.p.P.I.Q.R.S.TQtQtQtQtQtQt", "QtQtQtQt.U.V.u.O.O.W.W.X.X.O.O.F.G.H.q.s.t.P.Y.o.Z.0.1QtQtQtQtQt", "QtQtQt.2.3.o.X.F.4.F.W.5.W.W.X.O.E.G.H.r.p.P.I.Q.u.Z.6.7QtQtQtQt", "QtQtQt.8.9.X.W.F#.###a.F.W.5.W.X.F.E.H.q.s.t.I.Q.o.D#b#c#dQtQtQt", "QtQt#e#f.O.W.5.O#g#h#i###j#k.X.X.O.F.G.H#l#m#n.5.W.O.F.Z#o#pQtQt", "QtQt#q.P.X.W.5#j#r#s#h#t#u#v#w.E.O.F.E#x#y#z#A#B#C#D#E.t#F#GQtQt", "Qt#H#I.F.X.W#J#K#L#M#N#u#M#L#O#P#Q.G#R#S#L#L#T#U#V#W.P#b.n#XQtQt", "Qt#Y.D.F.X#Z#0#1#M#L#2#M#1#L#L#O#3#4#5#6#O#M#T#7#8.p.Z#b.9#9a.Qt", "Qta#.q.F.Oaa#Labac#M#L#Ladae#L#L#8afag#wah#Mai#R.u.u.Z#b.RajakQt", "alam.G.E.Oan#Labaoap#L#Laq#8#L#Laras#.atau#2av#x.o.D.Z#b.RawaxQt", "ayaz.H.G.FaA#LabaBaC#L#LaDaE#L#LarasafataF#TaGaHaI.I.Z#b.RaJaKQt", "aLaM.q.H.EaA#Lab#gaC#L#LaDaE#L#Lar#.afagaFai#UaN#j#a.W.Q.9.vaOQt", "aPaM.r.q.HaA#Lab#iaQ#L#LaRaS#L#L#8afagaTaUaGaeaNaV#k#m.t#b.naWQt", "aXaY.p.r.qaA#LabaZaQ#L#La0a1#L#L#8agaTa2aN#1a3aH#l.sa4.Ra5aJa6Qt", "a7a8.t.p.s#6#Laba9b.#L#Lb##x#L#LbaaTa2bbaNa3bcbd.D#b.9a5.vazbeQt", "Qtbf.I.t.p#6#Lab##ad#L#Lbgbd#L#Lba#wbbbhahbcbibja4.9.Ra5.nbkblQt", "Qtbm.9.I.H#O#Mbn#hbo#L#Lbpah#M#2b.bb#Q.qbqbibr#x#b.Ra5.v.nbsbtQt", "Qtbubv.Q#E#1aiaibw#S#2#2bxbyaiaG#zao.Qasbzbr#z#r#ka5.v.naMbAQtQt", "QtQtbBa4bC#O#1bDbE#NaGbcaubF#SbGaC.p.u.rbHbIbJbK.Q.v.naJbLbMQtQt", "QtQtbN.w.u#maaaZ#ka2bOau#Q.Hahb..p.D.D.Z.saCbK.Y.v.naJawbPbQQtQt", "QtQtQtbRaJ.D.s.obS#jbS.q.u.u.o.t.Z.Za4#b.9.P.Y.v.naJbTbUbVQtQtQt", "QtQtQtbWbX.va4.oaI.s.D.Z.Z.Z.Za4a4#b.9.R.Ra5.v.naJbTbYbZQtQtQtQt", "QtQtQtQtb0b1.n.Z.Z#b#b#b#b#b#b.9.9.R.Ra5.v.n.naJbTbLb2b3QtQtQtQt", "QtQtQtQtQtb4b5az.R.R.9.9.R.R.R.Ra5a5.v.v.naJbTawbsb6b7QtQtQtQtQt", "QtQtQtQtQtQtb8b9c.bTa5a5a5a5.v.v.v.n.naJaJbTbkc#caQtQtQtQtQtQtQt", "QtQtQtQtQtQtQtQtcbccbY.JaJ.n.n.naJaJbTaz#FcdcecfQtQtQtQtQtQtQtQt", "QtQtQtQtQtQtQtQtQtQtcgchcicjckclbscmcncocpcqQtQtQtQtQtQtQtQtQtQt", "QtQtQtQtQtQtQtQtQtQtQtQtQtcrcsctcucvcwQtQtQtQtQtQtQtQtQtQtQtQtQt"}; mediatomb-0.12.1/artwork/Makefile.in0000664000076400007640000003613111357204716014237 00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, # Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = artwork DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in 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) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/autoconfig.h \ $(top_builddir)/tombupnp/upnp/inc/upnpconfig.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ ATOMIC_OPTION_ENABLED = @ATOMIC_OPTION_ENABLED@ ATOMIC_OPTION_REQUESTED = @ATOMIC_OPTION_REQUESTED@ ATOMIC_X86_SINGLE_OPTION_ENABLED = @ATOMIC_X86_SINGLE_OPTION_ENABLED@ ATOMIC_X86_SINGLE_OPTION_REQUESTED = @ATOMIC_X86_SINGLE_OPTION_REQUESTED@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AVFORMAT_CFLAGS = @AVFORMAT_CFLAGS@ AVFORMAT_LDFLAGS = @AVFORMAT_LDFLAGS@ AVFORMAT_LIBS = @AVFORMAT_LIBS@ AVFORMAT_STATUS = @AVFORMAT_STATUS@ AVUTIL_LDFLAGS = @AVUTIL_LDFLAGS@ AVUTIL_LIBS = @AVUTIL_LIBS@ AVUTIL_STATUS = @AVUTIL_STATUS@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CURL_CFLAGS = @CURL_CFLAGS@ CURL_LIBS = @CURL_LIBS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DB_AUTOCREATE_OPTION_ENABLED = @DB_AUTOCREATE_OPTION_ENABLED@ DB_AUTOCREATE_OPTION_REQUESTED = @DB_AUTOCREATE_OPTION_REQUESTED@ DEBUG_LOG_OPTION_ENABLED = @DEBUG_LOG_OPTION_ENABLED@ DEBUG_LOG_OPTION_REQUESTED = @DEBUG_LOG_OPTION_REQUESTED@ DEBUG_MALLOC0_OPTION_ENABLED = @DEBUG_MALLOC0_OPTION_ENABLED@ DEBUG_MALLOC0_OPTION_REQUESTED = @DEBUG_MALLOC0_OPTION_REQUESTED@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ EXPAT_CFLAGS = @EXPAT_CFLAGS@ EXPAT_LDFLAGS = @EXPAT_LDFLAGS@ EXPAT_LIBS = @EXPAT_LIBS@ EXPAT_STATUS = @EXPAT_STATUS@ EXTERNAL_TRANSCODING_OPTION_ENABLED = @EXTERNAL_TRANSCODING_OPTION_ENABLED@ EXTERNAL_TRANSCODING_OPTION_REQUESTED = @EXTERNAL_TRANSCODING_OPTION_REQUESTED@ FFMPEGTHUMBNAILER_CFLAGS = @FFMPEGTHUMBNAILER_CFLAGS@ FFMPEGTHUMBNAILER_LDFLAGS = @FFMPEGTHUMBNAILER_LDFLAGS@ FFMPEGTHUMBNAILER_LIBS = @FFMPEGTHUMBNAILER_LIBS@ FFMPEGTHUMBNAILER_OPTION_ENABLED = @FFMPEGTHUMBNAILER_OPTION_ENABLED@ FFMPEGTHUMBNAILER_OPTION_REQUESTED = @FFMPEGTHUMBNAILER_OPTION_REQUESTED@ FFMPEGTHUMBNAILER_STATUS = @FFMPEGTHUMBNAILER_STATUS@ FFMPEG_CFLAGS = @FFMPEG_CFLAGS@ FFMPEG_LDFLAGS = @FFMPEG_LDFLAGS@ FFMPEG_LIBS = @FFMPEG_LIBS@ FFMPEG_OPTION_ENABLED = @FFMPEG_OPTION_ENABLED@ FFMPEG_OPTION_REQUESTED = @FFMPEG_OPTION_REQUESTED@ FSEEKO_CHECK_OPTION_ENABLED = @FSEEKO_CHECK_OPTION_ENABLED@ FSEEKO_CHECK_OPTION_REQUESTED = @FSEEKO_CHECK_OPTION_REQUESTED@ GREP = @GREP@ ICONV_CXXFLAGS = @ICONV_CXXFLAGS@ ICONV_LIBS = @ICONV_LIBS@ ICONV_LIB_OPTION_ENABLED = @ICONV_LIB_OPTION_ENABLED@ ICONV_LIB_OPTION_REQUESTED = @ICONV_LIB_OPTION_REQUESTED@ ID3LIB_CFLAGS = @ID3LIB_CFLAGS@ ID3LIB_LDFLAGS = @ID3LIB_LDFLAGS@ ID3LIB_LIBS = @ID3LIB_LIBS@ ID3LIB_OPTION_ENABLED = @ID3LIB_OPTION_ENABLED@ ID3LIB_OPTION_REQUESTED = @ID3LIB_OPTION_REQUESTED@ ID3LIB_STATUS = @ID3LIB_STATUS@ ID3LIB_VERSION = @ID3LIB_VERSION@ INOTIFY_CFLAGS = @INOTIFY_CFLAGS@ INOTIFY_OPTION_ENABLED = @INOTIFY_OPTION_ENABLED@ INOTIFY_OPTION_REQUESTED = @INOTIFY_OPTION_REQUESTED@ INOTIFY_STATUS = @INOTIFY_STATUS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ JS_CXXFLAGS = @JS_CXXFLAGS@ JS_LIBS = @JS_LIBS@ LASTFMLIB_CFLAGS = @LASTFMLIB_CFLAGS@ LASTFMLIB_LDFLAGS = @LASTFMLIB_LDFLAGS@ LASTFMLIB_LIBS = @LASTFMLIB_LIBS@ LASTFMLIB_OPTION_ENABLED = @LASTFMLIB_OPTION_ENABLED@ LASTFMLIB_OPTION_REQUESTED = @LASTFMLIB_OPTION_REQUESTED@ LASTFMLIB_STATUS = @LASTFMLIB_STATUS@ LDFLAGS = @LDFLAGS@ LIBEXIF_CFLAGS = @LIBEXIF_CFLAGS@ LIBEXIF_LDFLAGS = @LIBEXIF_LDFLAGS@ LIBEXIF_LIBS = @LIBEXIF_LIBS@ LIBEXIF_OPTION_ENABLED = @LIBEXIF_OPTION_ENABLED@ LIBEXIF_OPTION_REQUESTED = @LIBEXIF_OPTION_REQUESTED@ LIBEXIF_STATUS = @LIBEXIF_STATUS@ LIBEXTRACTOR_CFLAGS = @LIBEXTRACTOR_CFLAGS@ LIBEXTRACTOR_LIBS = @LIBEXTRACTOR_LIBS@ LIBEXTRACTOR_OPTION_ENABLED = @LIBEXTRACTOR_OPTION_ENABLED@ LIBEXTRACTOR_OPTION_REQUESTED = @LIBEXTRACTOR_OPTION_REQUESTED@ LIBEXTRACTOR_STATUS = @LIBEXTRACTOR_STATUS@ LIBEXTRACTOR_VERSION = @LIBEXTRACTOR_VERSION@ LIBMAGIC_CFLAGS = @LIBMAGIC_CFLAGS@ LIBMAGIC_LDFLAGS = @LIBMAGIC_LDFLAGS@ LIBMAGIC_LIBS = @LIBMAGIC_LIBS@ LIBMAGIC_OPTION_ENABLED = @LIBMAGIC_OPTION_ENABLED@ LIBMAGIC_OPTION_REQUESTED = @LIBMAGIC_OPTION_REQUESTED@ LIBMAGIC_STATUS = @LIBMAGIC_STATUS@ LIBMAGIC_VERSION = @LIBMAGIC_VERSION@ LIBMP4V2_CFLAGS = @LIBMP4V2_CFLAGS@ LIBMP4V2_LDFLAGS = @LIBMP4V2_LDFLAGS@ LIBMP4V2_LIBS = @LIBMP4V2_LIBS@ LIBMP4V2_OPTION_ENABLED = @LIBMP4V2_OPTION_ENABLED@ LIBMP4V2_OPTION_REQUESTED = @LIBMP4V2_OPTION_REQUESTED@ LIBMP4V2_STATUS = @LIBMP4V2_STATUS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LOG_OPTION_ENABLED = @LOG_OPTION_ENABLED@ LOG_OPTION_REQUESTED = @LOG_OPTION_REQUESTED@ LTLIBOBJS = @LTLIBOBJS@ LWRES_LIBS = @LWRES_LIBS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MRREG_SERVICE_OPTION_ENABLED = @MRREG_SERVICE_OPTION_ENABLED@ MRREG_SERVICE_OPTION_REQUESTED = @MRREG_SERVICE_OPTION_REQUESTED@ MT_SEARCHPATH = @MT_SEARCHPATH@ MT_SEARCHPATH_HEADERS = @MT_SEARCHPATH_HEADERS@ MT_SEARCHPATH_LIBS = @MT_SEARCHPATH_LIBS@ MT_SEARCHPATH_PROGS = @MT_SEARCHPATH_PROGS@ MYSQL_CFLAGS = @MYSQL_CFLAGS@ MYSQL_LIBS = @MYSQL_LIBS@ MYSQL_OPTION_ENABLED = @MYSQL_OPTION_ENABLED@ MYSQL_OPTION_REQUESTED = @MYSQL_OPTION_REQUESTED@ MYSQL_STATUS = @MYSQL_STATUS@ MYSQL_VERSION = @MYSQL_VERSION@ NSL_LIBS = @NSL_LIBS@ 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@ POW_LIB = @POW_LIB@ PROTOCOLINFO_EXTENSION_OPTION_ENABLED = @PROTOCOLINFO_EXTENSION_OPTION_ENABLED@ PROTOCOLINFO_EXTENSION_OPTION_REQUESTED = @PROTOCOLINFO_EXTENSION_OPTION_REQUESTED@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LDFLAGS = @PTHREAD_LDFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ PTHREAD_LIB_OPTION_ENABLED = @PTHREAD_LIB_OPTION_ENABLED@ PTHREAD_LIB_OPTION_REQUESTED = @PTHREAD_LIB_OPTION_REQUESTED@ PTHREAD_STATUS = @PTHREAD_STATUS@ RANLIB = @RANLIB@ RT_LDFLAGS = @RT_LDFLAGS@ RT_LIBS = @RT_LIBS@ RT_STATUS = @RT_STATUS@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SQLITE3_CFLAGS = @SQLITE3_CFLAGS@ SQLITE3_LDFLAGS = @SQLITE3_LDFLAGS@ SQLITE3_LIBS = @SQLITE3_LIBS@ SQLITE3_OPTION_ENABLED = @SQLITE3_OPTION_ENABLED@ SQLITE3_OPTION_REQUESTED = @SQLITE3_OPTION_REQUESTED@ SQLITE3_STATUS = @SQLITE3_STATUS@ SQLITE_BACKUP_DEFAULTS_OPTION_ENABLED = @SQLITE_BACKUP_DEFAULTS_OPTION_ENABLED@ SQLITE_BACKUP_DEFAULTS_OPTION_REQUESTED = @SQLITE_BACKUP_DEFAULTS_OPTION_REQUESTED@ STATIC_OPTION_ENABLED = @STATIC_OPTION_ENABLED@ STATIC_OPTION_REQUESTED = @STATIC_OPTION_REQUESTED@ STRIP = @STRIP@ TAGLIB_CFLAGS = @TAGLIB_CFLAGS@ TAGLIB_LIBS = @TAGLIB_LIBS@ TAGLIB_OPTION_ENABLED = @TAGLIB_OPTION_ENABLED@ TAGLIB_OPTION_REQUESTED = @TAGLIB_OPTION_REQUESTED@ TAGLIB_STATUS = @TAGLIB_STATUS@ TAGLIB_VERSION = @TAGLIB_VERSION@ TOMBDEBUG_OPTION_ENABLED = @TOMBDEBUG_OPTION_ENABLED@ TOMBDEBUG_OPTION_REQUESTED = @TOMBDEBUG_OPTION_REQUESTED@ UPNPDEBUG_OPTION_ENABLED = @UPNPDEBUG_OPTION_ENABLED@ UPNPDEBUG_OPTION_REQUESTED = @UPNPDEBUG_OPTION_REQUESTED@ VERSION = @VERSION@ YOUTUBE_OPTION_ENABLED = @YOUTUBE_OPTION_ENABLED@ YOUTUBE_OPTION_REQUESTED = @YOUTUBE_OPTION_REQUESTED@ ZLIB_CFLAGS = @ZLIB_CFLAGS@ ZLIB_LDFLAGS = @ZLIB_LDFLAGS@ ZLIB_LIBS = @ZLIB_LIBS@ ZLIB_OPTION_ENABLED = @ZLIB_OPTION_ENABLED@ ZLIB_OPTION_REQUESTED = @ZLIB_OPTION_REQUESTED@ ZLIB_STATUS = @ZLIB_STATUS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ acx_pthread_config = @acx_pthread_config@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ curlconfig = @curlconfig@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ mt_mysql_config = @mt_mysql_config@ mt_taglib_config = @mt_taglib_config@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ EXTRA_DIST = mediatomb.xpm all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu artwork/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu artwork/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: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(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) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic distclean \ distclean-generic distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-generic pdf pdf-am ps ps-am uninstall uninstall-am # 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: mediatomb-0.12.1/configure0000775000076400007640000507502311357204721012414 00000000000000#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.63 for MediaTomb 0.12.1. # # Report bugs to . # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, # 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac fi # PATH needs CR # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo if (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 { (exit 1); exit 1; } fi # Work around bugs in pre-3.0 UWIN ksh. for as_var in ENV MAIL MAILPATH do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi # Name of the executable. as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # CDPATH. $as_unset CDPATH if test "x$CONFIG_SHELL" = x; then if (eval ":") 2>/dev/null; then as_have_required=yes else as_have_required=no fi if test $as_have_required = yes && (eval ": (as_func_return () { (exit \$1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = \"\$1\" ); then : else exitcode=1 echo positional parameters were not saved. fi test \$exitcode = 0) || { (exit 1); exit 1; } ( as_lineno_1=\$LINENO as_lineno_2=\$LINENO test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" && test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; } ") 2> /dev/null; then : else as_candidate_shells= 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=. case $as_dir in /*) for as_base in sh bash ksh sh5; do as_candidate_shells="$as_candidate_shells $as_dir/$as_base" done;; esac done IFS=$as_save_IFS for as_shell in $as_candidate_shells $SHELL; do # Try only shells that exist, to save several forks. if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { ("$as_shell") 2> /dev/null <<\_ASEOF if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac fi : _ASEOF }; then CONFIG_SHELL=$as_shell as_have_required=yes if { "$as_shell" 2> /dev/null <<\_ASEOF if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac fi : (as_func_return () { (exit $1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = "$1" ); then : else exitcode=1 echo positional parameters were not saved. fi test $exitcode = 0) || { (exit 1); exit 1; } ( as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; } _ASEOF }; then break fi fi done if test "x$CONFIG_SHELL" != x; then for as_var in BASH_ENV ENV do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done export CONFIG_SHELL exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} fi if test $as_have_required = no; then echo This script requires a shell more modern than all the echo shells that I found on your system. Please install a echo modern shell, or manually run the script under such a echo shell if you do have one. { (exit 1); exit 1; } fi fi fi (eval "as_func_return () { (exit \$1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = \"\$1\" ); then : else exitcode=1 echo positional parameters were not saved. fi test \$exitcode = 0") || { echo No shell found that supports shell functions. echo Please tell bug-autoconf@gnu.org about your system, echo including any error possibly output before this message. echo This can help us improve future autoconf versions. echo Configuration will now proceed without shell functions. } as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { # 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 after each line using $LINENO; the second 'sed' # does the real work. The second script uses 'N' to pair each # line-number line with the line containing $LINENO, 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 # scripts with optimization help from Paolo Bonzini. Blame Lee # E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (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 sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in -n*) case `echo 'x\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. *) ECHO_C='\c';; esac;; *) ECHO_N='-n';; esac if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 7<&0 &1 # 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` # # Initializations. # ac_default_prefix=/usr/local ac_clean_files= ac_config_libobj_dir=. LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= SHELL=${CONFIG_SHELL-/bin/sh} # Identity of this package. PACKAGE_NAME='MediaTomb' PACKAGE_TARNAME='mediatomb' PACKAGE_VERSION='0.12.1' PACKAGE_STRING='MediaTomb 0.12.1' PACKAGE_BUGREPORT='jin@mediatomb.cc' ac_unique_file="src/common.h" # Factoring default headers for most tests. ac_includes_default="\ #include #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_STAT_H # include #endif #ifdef STDC_HEADERS # include # include #else # ifdef HAVE_STDLIB_H # include # endif #endif #ifdef HAVE_STRING_H # if !defined STDC_HEADERS && defined HAVE_MEMORY_H # include # endif # include #endif #ifdef HAVE_STRINGS_H # include #endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_STDINT_H # include #endif #ifdef HAVE_UNISTD_H # include #endif" ac_subst_vars='am__EXEEXT_FALSE am__EXEEXT_TRUE LTLIBOBJS DEBUG_LOG_OPTION_REQUESTED DEBUG_LOG_OPTION_ENABLED LOG_OPTION_REQUESTED LOG_OPTION_ENABLED UPNPDEBUG_OPTION_REQUESTED UPNPDEBUG_OPTION_ENABLED TOMBDEBUG_OPTION_REQUESTED TOMBDEBUG_OPTION_ENABLED INOTIFY_STATUS INOTIFY_CFLAGS INOTIFY_OPTION_REQUESTED INOTIFY_OPTION_ENABLED LIBMP4V2_LDFLAGS LIBMP4V2_LIBS LIBMP4V2_OPTION_REQUESTED LIBMP4V2_OPTION_ENABLED LIBMP4V2_STATUS LIBMP4V2_CFLAGS EXPAT_STATUS EXPAT_LDFLAGS EXPAT_LIBS EXPAT_CFLAGS LIBEXIF_STATUS LIBEXIF_CFLAGS LIBEXIF_LDFLAGS LIBEXIF_LIBS LIBEXIF_OPTION_REQUESTED LIBEXIF_OPTION_ENABLED LIBEXTRACTOR_STATUS LIBEXTRACTOR_VERSION LIBEXTRACTOR_LIBS LIBEXTRACTOR_CFLAGS LASTFMLIB_STATUS LASTFMLIB_CFLAGS LASTFMLIB_LDFLAGS LASTFMLIB_LIBS LASTFMLIB_OPTION_REQUESTED LASTFMLIB_OPTION_ENABLED FFMPEGTHUMBNAILER_STATUS FFMPEGTHUMBNAILER_CFLAGS FFMPEGTHUMBNAILER_LDFLAGS FFMPEGTHUMBNAILER_LIBS FFMPEGTHUMBNAILER_OPTION_REQUESTED FFMPEGTHUMBNAILER_OPTION_ENABLED FFMPEG_LIBS FFMPEG_LDFLAGS FFMPEG_CFLAGS AVUTIL_STATUS AVUTIL_LDFLAGS AVUTIL_LIBS AVFORMAT_LDFLAGS AVFORMAT_LIBS AVFORMAT_STATUS AVFORMAT_CFLAGS FFMPEG_OPTION_REQUESTED FFMPEG_OPTION_ENABLED LIBEXTRACTOR_OPTION_REQUESTED LIBEXTRACTOR_OPTION_ENABLED CURL_LIBS CURL_CFLAGS curlconfig ID3LIB_LDFLAGS ID3LIB_STATUS ID3LIB_VERSION ID3LIB_LIBS ID3LIB_CFLAGS TAGLIB_STATUS TAGLIB_VERSION TAGLIB_LIBS TAGLIB_CFLAGS mt_taglib_config TAGLIB_OPTION_REQUESTED TAGLIB_OPTION_ENABLED ID3LIB_OPTION_REQUESTED ID3LIB_OPTION_ENABLED LIBMAGIC_LDFLAGS LIBMAGIC_STATUS LIBMAGIC_VERSION LIBMAGIC_LIBS LIBMAGIC_CFLAGS LIBMAGIC_OPTION_REQUESTED LIBMAGIC_OPTION_ENABLED JS_LIBS JS_CXXFLAGS MYSQL_STATUS MYSQL_VERSION MYSQL_LIBS MYSQL_CFLAGS mt_mysql_config MYSQL_OPTION_REQUESTED MYSQL_OPTION_ENABLED SQLITE3_STATUS SQLITE3_CFLAGS SQLITE3_LDFLAGS SQLITE3_LIBS SQLITE3_OPTION_REQUESTED SQLITE3_OPTION_ENABLED ZLIB_STATUS ZLIB_CFLAGS ZLIB_LDFLAGS ZLIB_LIBS ZLIB_OPTION_REQUESTED ZLIB_OPTION_ENABLED RT_STATUS RT_LDFLAGS RT_LIBS PTHREAD_CFLAGS PTHREAD_CC acx_pthread_config PTHREAD_STATUS PTHREAD_LDFLAGS PTHREAD_LIBS NSL_LIBS LWRES_LIBS CXXCPP POW_LIB LIBOBJS ALLOCA ICONV_LIBS ICONV_CXXFLAGS EGREP GREP CPP RANLIB am__fastdepCC_FALSE am__fastdepCC_TRUE CCDEPMODE ac_ct_CC CFLAGS CC am__fastdepCXX_FALSE am__fastdepCXX_TRUE CXXDEPMODE AMDEPBACKSLASH AMDEP_FALSE AMDEP_TRUE am__quote am__include DEPDIR OBJEXT EXEEXT ac_ct_CXX CPPFLAGS LDFLAGS CXXFLAGS CXX FSEEKO_CHECK_OPTION_REQUESTED FSEEKO_CHECK_OPTION_ENABLED PROTOCOLINFO_EXTENSION_OPTION_REQUESTED PROTOCOLINFO_EXTENSION_OPTION_ENABLED SQLITE_BACKUP_DEFAULTS_OPTION_REQUESTED SQLITE_BACKUP_DEFAULTS_OPTION_ENABLED YOUTUBE_OPTION_REQUESTED YOUTUBE_OPTION_ENABLED EXTERNAL_TRANSCODING_OPTION_REQUESTED EXTERNAL_TRANSCODING_OPTION_ENABLED MRREG_SERVICE_OPTION_REQUESTED MRREG_SERVICE_OPTION_ENABLED ATOMIC_OPTION_REQUESTED ATOMIC_OPTION_ENABLED ATOMIC_X86_SINGLE_OPTION_REQUESTED ATOMIC_X86_SINGLE_OPTION_ENABLED ICONV_LIB_OPTION_REQUESTED ICONV_LIB_OPTION_ENABLED PTHREAD_LIB_OPTION_REQUESTED PTHREAD_LIB_OPTION_ENABLED DEBUG_MALLOC0_OPTION_REQUESTED DEBUG_MALLOC0_OPTION_ENABLED DB_AUTOCREATE_OPTION_REQUESTED DB_AUTOCREATE_OPTION_ENABLED STATIC_OPTION_REQUESTED STATIC_OPTION_ENABLED MT_SEARCHPATH_PROGS MT_SEARCHPATH_LIBS MT_SEARCHPATH_HEADERS MT_SEARCHPATH host_os host_vendor host_cpu host build_os build_vendor build_cpu build am__untar am__tar AMTAR am__leading_dot SET_MAKE AWK mkdir_p MKDIR_P INSTALL_STRIP_PROGRAM STRIP install_sh MAKEINFO AUTOHEADER AUTOMAKE AUTOCONF ACLOCAL VERSION PACKAGE CYGPATH_W am__isrc INSTALL_DATA INSTALL_SCRIPT INSTALL_PROGRAM target_alias host_alias build_alias LIBS ECHO_T ECHO_N ECHO_C DEFS mandir localedir libdir psdir pdfdir dvidir htmldir infodir docdir oldincludedir includedir localstatedir sharedstatedir sysconfdir datadir datarootdir libexecdir sbindir bindir program_transform_name prefix exec_prefix PACKAGE_BUGREPORT PACKAGE_STRING PACKAGE_VERSION PACKAGE_TARNAME PACKAGE_NAME PATH_SEPARATOR SHELL' ac_subst_files='' ac_user_opts=' enable_option_checking with_search with_js_h with_js_libs with_iconv_h with_iconv_libs enable_static enable_db_autocreate enable_debug_malloc0 enable_pthread_lib enable_iconv_lib enable_atomic_x86_single enable_atomic_pthread enable_atomic enable_sighup enable_mrreg_service enable_external_transcoding enable_youtube enable_sqlite_backup_defaults enable_protocolinfo_extension enable_curl with_curl_cfg enable_fseeko_check enable_dependency_tracking enable_largefile enable_rpl_malloc with_pthread_libs with_rt_libs enable_zlib with_zlib_h with_zlib_libs enable_sqlite3 with_sqlite3_h with_sqlite3_libs enable_mysql with_mysql_cfg enable_libjs enable_libmagic with_libmagic_h with_libmagic_libs enable_id3lib enable_taglib with_taglib_cfg with_id3lib_h with_id3lib_libs enable_libextractor enable_ffmpeg with_avformat_h with_avformat_libs with_avutil_libs enable_ffmpegthumbnailer with_ffmpegthumbnailer_h with_ffmpegthumbnailer_libs enable_lastfmlib with_lastfmlib_h with_lastfmlib_libs with_libextractor_h with_libextractor_libs enable_libexif with_libexif_h with_libexif_libs with_expat_h with_expat_libs with_libmp4v2_h enable_libmp4v2 with_libmp4v2_libs enable_inotify with_inotify_h enable_tombdebug enable_upnpdebug enable_log enable_debug_log ' ac_precious_vars='build_alias host_alias target_alias CXX CXXFLAGS LDFLAGS LIBS CPPFLAGS CCC CC CFLAGS CPP CXXCPP' # Initialize some variables set by options. ac_init_help= ac_init_version=false ac_unrecognized_opts= ac_unrecognized_sep= # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *) ac_optarg=yes ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ | --dataroo | --dataro | --datar) ac_prev=datarootdir ;; -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) datarootdir=$ac_optarg ;; -disable-* | --disable-*) ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && { $as_echo "$as_me: error: invalid feature name: $ac_useropt" >&2 { (exit 1); exit 1; }; } ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=no ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) docdir=$ac_optarg ;; -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) ac_prev=dvidir ;; -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) dvidir=$ac_optarg ;; -enable-* | --enable-*) ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && { $as_echo "$as_me: error: invalid feature name: $ac_useropt" >&2 { (exit 1); exit 1; }; } ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) ac_prev=htmldir ;; -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ | --ht=*) htmldir=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localedir | --localedir | --localedi | --localed | --locale) ac_prev=localedir ;; -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) localedir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) ac_prev=pdfdir ;; -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) pdfdir=$ac_optarg ;; -psdir | --psdir | --psdi | --psd | --ps) ac_prev=psdir ;; -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) psdir=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && { $as_echo "$as_me: error: invalid package name: $ac_useropt" >&2 { (exit 1); exit 1; }; } ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=\$ac_optarg ;; -without-* | --without-*) ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && { $as_echo "$as_me: error: invalid package name: $ac_useropt" >&2 { (exit 1); exit 1; }; } ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=no ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) { $as_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 && { $as_echo "$as_me: error: invalid variable name: $ac_envvar" >&2 { (exit 1); exit 1; }; } eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` { $as_echo "$as_me: error: missing argument to $ac_option" >&2 { (exit 1); exit 1; }; } fi if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; fatal) { $as_echo "$as_me: error: unrecognized options: $ac_unrecognized_opts" >&2 { (exit 1); exit 1; }; } ;; *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi # Check all directory arguments for consistency. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ libdir localedir mandir do eval ac_val=\$$ac_var # Remove trailing slashes. case $ac_val in */ ) ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` eval $ac_var=\$ac_val;; esac # Be sure to have absolute directory names. case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac { $as_echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; } 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 $as_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 ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || { $as_echo "$as_me: error: working directory cannot be determined" >&2 { (exit 1); exit 1; }; } test "X$ac_ls_di" = "X$ac_pwd_ls_di" || { $as_echo "$as_me: error: pwd does not report name of working directory" >&2 { (exit 1); exit 1; }; } # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then the parent directory. ac_confdir=`$as_dirname -- "$as_myself" || $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_myself" : 'X\(//\)[^/]' \| \ X"$as_myself" : 'X\(//\)$' \| \ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_myself" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` srcdir=$ac_confdir if test ! -r "$srcdir/$ac_unique_file"; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." { $as_echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 { (exit 1); exit 1; }; } fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || { $as_echo "$as_me: error: $ac_msg" >&2 { (exit 1); exit 1; }; } pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures MediaTomb 0.12.1 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/mediatomb] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF Program names: --program-prefix=PREFIX prepend PREFIX to installed program names --program-suffix=SUFFIX append SUFFIX to installed program names --program-transform-name=PROGRAM run sed PROGRAM on installed program names System types: --build=BUILD configure for building on BUILD [guessed] --host=HOST cross-compile to build programs to run on HOST [BUILD] _ACEOF fi if test -n "$ac_init_help"; then case $ac_init_help in short | recursive ) echo "Configuration of MediaTomb 0.12.1:";; esac cat <<\_ACEOF Optional Features: --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-static build a static version of MediaTomb --disable-db-autocreate automatic creation of the database --enable-debug-malloc0 only for debugging purposes: abort when we try to call malloc or realloc with a value of zero --enable-pthread-lib if this option is set we will try to link with -lpthread, else the flag for pthread will be autodetected --enable-iconv-lib if this option is set we will try to link with -liconv, else we will first try to use iconv built into glibc and only then search for libiconv --enable-atomic-x86-single use x86 singleprocessor code for atomic arithmetic operations, this will increase performance but you must not use the compiled binary on an SMP system. Doing so might result in crashes and unexpected behaviour --enable-atomic-pthread use pthreads for atomic arithmetic operations, this will deliver the worst performance but is the only portable option (default: automatic, depending on architecture --disable-atomic NEVER disable this! This is only for devel/debugging - disables all atomic arithmetics code --enable-sighup enable SIGHUP handling, by default this is only enabled for x86 platforms, consult the README for more information (default: auto) --enable-mrreg-service Enable the X_MS_MediaReceiverRegistrar UPnP service. This is for future XBox 360 support, other renderers will probably not need it --disable-external-transcoding external transcoding support --disable-youtube YouTube service support --enable-sqlite-backup-defaults enable sqlite database backup settings in config.xml by default --disable-protocolinfo-extension This is required for Playstation 3 support, it adds certain tags to the protocolInfo attribute --enable-curl Enable curl support (required for YouTube support, provides additional functionality for the external transcoding feature (default: auto) --disable-fseeko-check This is a workaround for a bug on some Debian distros, use this if configure fails complaining about off_t --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors --disable-largefile omit support for large files --disable-rpl-malloc disable redefinition of malloc to rpl_malloc and realloc to rpl_realloc. Use this if you are sure that you are compiling for the GNU C library (default: enabled) --disable-zlib zlib support required for automated database creation --disable-sqlite3 sqlite3 database supprot --disable-mysql mysql database support --enable-libjs compile with spidermonkey support (default: yes) --disable-libmagic filemagic for automatic mimetype recognition --disable-id3lib id3 metadata extraction with the help of id3lib --disable-taglib id3 metadata extraction with the help of taglib --enable-libextractor metadata extraction with the help of libextractor --disable-ffmpeg metadata extraction with the help of ffmpeg --disable-ffmpegthumbnailer compile with ffmpegthumbnailer support for video thumbnail generation --disable-lastfmlib compile with lastfmlib support for Last.fm scrobbling --disable-libexif compile with libexif for exif thumbnail and metadata extraction --disable-libmp4v2 libmp4v2 support for mp4 metadata extraction --disable-inotify inotify support for imporved autoscan --enable-tombdebug enable debug code for MediaTomb --enable-upnpdebug enable debug output for TombUPnP/libupnp --disable-log disable all console output --disable-debug-log compile without debug messages Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-search=DIR Additionally search for packages in DIR --with-js-h=DIR search for js (spidermonkey) headers in DIR --with-js-libs=DIR search for js (spidermonkey) libraries in DIR --with-iconv-h=DIR search for iconv headers in DIR --with-iconv-libs=DIR search for iconv libraries in DIR --with-curl-cfg=curl-config absolute path/name of curl-config --with-pthread-libs=DIR search for pthread libraries in DIR --with-rt-libs=DIR search for rt libraries in DIR --with-zlib-h=DIR search for zlib headers in DIR --with-zlib-libs=DIR search for zlib libraries in DIR --with-sqlite3-h=DIR search for sqlite3 headers in DIR --with-sqlite3-libs=DIR search for sqlite3 libraries in DIR --with-mysql-cfg=mysql_config absolute path/name of mysql_config --with-libmagic-h=DIR search for libmagic headers in DIR --with-libmagic-libs=DIR search for libmagic libraries in DIR --with-taglib-cfg=taglib-config absolute path/name of taglib-config --with-id3lib-h=DIR search for id3lib headers in DIR --with-id3lib-libs=DIR search for id3lib libraries in DIR --with-avformat-h=DIR search for avformat headers in DIR --with-avformat-libs=DIR search for avformat libraries in DIR --with-avutil-libs=DIR search for avutil libraries in DIR --with-ffmpegthumbnailer-h=DIR search for ffmpegthumbnailer headers in DIR --with-ffmpegthumbnailer-libs=DIR search for ffmpegthumbnailer libraries in DIR --with-lastfmlib-h=DIR search for lastfmlib headers in DIR --with-lastfmlib-libs=DIR search for lastfmlib libraries in DIR --with-libextractor-h=DIR search for libextractor headers in DIR --with-libextractor-libs=DIR search for libextractor libraries in DIR --with-libexif-h=DIR search for libexif headers in DIR --with-libexif-libs=DIR search for libexif libraries in DIR --with-expat-h=DIR search for expat headers in DIR --with-expat-libs=DIR search for expat libraries in DIR --with-libmp4v2-h=DIR search for libmp4v2 headers in DIR --with-libmp4v2-libs=DIR search for libmp4v2 libraries in DIR --with-inotify-h=DIR search for inotify headers in DIR Some influential environment variables: CXX C++ compiler command CXXFLAGS C++ compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory LIBS libraries to pass to the linker, e.g. -l CPPFLAGS C/C++/Objective C preprocessor flags, e.g. -I if you have headers in a nonstandard directory CC C compiler command CFLAGS C compiler flags CPP C preprocessor CXXCPP C++ preprocessor Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. Report bugs to . _ACEOF ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d "$ac_dir" || { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } # Check for guested configure. if test -f "$ac_srcdir/configure.gnu"; then echo && $SHELL "$ac_srcdir/configure.gnu" --help=recursive elif test -f "$ac_srcdir/configure"; then echo && $SHELL "$ac_srcdir/configure" --help=recursive else $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF MediaTomb configure 0.12.1 generated by GNU Autoconf 2.63 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit fi cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by MediaTomb $as_me 0.12.1, which was generated by GNU Autoconf 2.63. Invocation command line was $ $0 $@ _ACEOF exec 5>>config.log { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` /usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. $as_echo "PATH: $as_dir" done IFS=$as_save_IFS } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) 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_arg'" ;; 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: Use '\'' to represent an apostrophe within the trap. # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo cat <<\_ASBOX ## ---------------- ## ## Cache variables. ## ## ---------------- ## _ASBOX echo # The following way of writing the cache mishandles newlines in values, ( for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:$LINENO: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) $as_unset $ac_var ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( *${as_nl}ac_space=\ *) sed -n \ "s/'\''/'\''\\\\'\'''\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" ;; #( *) sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) echo cat <<\_ASBOX ## ----------------- ## ## Output variables. ## ## ----------------- ## _ASBOX echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then cat <<\_ASBOX ## ------------------- ## ## File substitutions. ## ## ------------------- ## _ASBOX echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then cat <<\_ASBOX ## ----------- ## ## confdefs.h. ## ## ----------- ## _ASBOX echo cat confdefs.h echo fi test "$ac_signal" != 0 && $as_echo "$as_me: caught signal $ac_signal" $as_echo "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h # 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 an explicitly selected file to automatically selected ones. ac_site_file1=NONE ac_site_file2=NONE if test -n "$CONFIG_SITE"; then ac_site_file1=$CONFIG_SITE elif test "x$prefix" != xNONE; then ac_site_file1=$prefix/share/config.site ac_site_file2=$prefix/etc/config.site else ac_site_file1=$ac_default_prefix/share/config.site ac_site_file2=$ac_default_prefix/etc/config.site fi for ac_site_file in "$ac_site_file1" "$ac_site_file2" do test "x$ac_site_file" = xNONE && continue if test -r "$ac_site_file"; then { $as_echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 $as_echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" 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 { $as_echo "$as_me:$LINENO: loading cache $cache_file" >&5 $as_echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { $as_echo "$as_me:$LINENO: creating cache $cache_file" >&5 $as_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 $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { $as_echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { $as_echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then # differences in whitespace do not lead to failure. ac_old_val_w=`echo x $ac_old_val` ac_new_val_w=`echo x $ac_new_val` if test "$ac_old_val_w" != "$ac_new_val_w"; then { $as_echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 $as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} ac_cache_corrupted=: else { $as_echo "$as_me:$LINENO: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 $as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} eval $ac_var=\$ac_old_val fi { $as_echo "$as_me:$LINENO: former value: \`$ac_old_val'" >&5 $as_echo "$as_me: former value: \`$ac_old_val'" >&2;} { $as_echo "$as_me:$LINENO: current value: \`$ac_new_val'" >&5 $as_echo "$as_me: current value: \`$ac_new_val'" >&2;} fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { $as_echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 $as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} { { $as_echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 $as_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_config_headers="$ac_config_headers autoconfig.h tombupnp/upnp/inc/upnpconfig.h" ac_aux_dir= for ac_dir in configure_aux "$srcdir"/configure_aux; do if test -f "$ac_dir/install-sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break elif test -f "$ac_dir/install.sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break elif test -f "$ac_dir/shtool"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then { { $as_echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in configure_aux \"$srcdir\"/configure_aux" >&5 $as_echo "$as_me: error: cannot find install-sh or install.sh in configure_aux \"$srcdir\"/configure_aux" >&2;} { (exit 1); exit 1; }; } fi # These three variables are undocumented and unsupported, # and are intended to be withdrawn in a future Autoconf release. # They can cause serious problems if a builder's source tree is in a directory # whose full name contains unusual characters. ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. am__api_version='1.11' # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. # Reject install programs that cannot install multiple files. { $as_echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 $as_echo_n "checking for a BSD-compatible install... " >&6; } if test -z "$INSTALL"; then if test "${ac_cv_path_install+set}" = set; then $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. # Account for people who put trailing slashes in PATH elements. case $as_dir/ in ./ | .// | /cC/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else rm -rf conftest.one conftest.two conftest.dir echo one > conftest.one echo two > conftest.two mkdir conftest.dir if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && test -s conftest.one && test -s conftest.two && test -s conftest.dir/conftest.one && test -s conftest.dir/conftest.two then ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi fi done done ;; esac done IFS=$as_save_IFS rm -rf conftest.one conftest.two conftest.dir fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. Don't cache a # value for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. INSTALL=$ac_install_sh fi fi { $as_echo "$as_me:$LINENO: result: $INSTALL" >&5 $as_echo "$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' { $as_echo "$as_me:$LINENO: checking whether build environment is sane" >&5 $as_echo_n "checking whether build environment is sane... " >&6; } # Just in case sleep 1 echo timestamp > conftest.file # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[\\\"\#\$\&\'\`$am_lf]*) { { $as_echo "$as_me:$LINENO: error: unsafe absolute working directory name" >&5 $as_echo "$as_me: error: unsafe absolute working directory name" >&2;} { (exit 1); exit 1; }; };; esac case $srcdir in *[\\\"\#\$\&\'\`$am_lf\ \ ]*) { { $as_echo "$as_me:$LINENO: error: unsafe srcdir value: \`$srcdir'" >&5 $as_echo "$as_me: error: unsafe srcdir value: \`$srcdir'" >&2;} { (exit 1); exit 1; }; };; esac # Do `set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( 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". { { $as_echo "$as_me:$LINENO: error: ls -t appears to fail. Make sure there is not a broken alias in your environment" >&5 $as_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 { { $as_echo "$as_me:$LINENO: error: newly created file is older than distributed files! Check your system clock" >&5 $as_echo "$as_me: error: newly created file is older than distributed files! Check your system clock" >&2;} { (exit 1); exit 1; }; } fi { $as_echo "$as_me:$LINENO: result: yes" >&5 $as_echo "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 $. # By default was `s,x,x', remove it if useless. ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` if test x"${MISSING+set}" != xset; then case $am_aux_dir in *\ * | *\ *) MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; *) MISSING="\${SHELL} $am_aux_dir/missing" ;; esac fi # Use eval to expand $SHELL if eval "$MISSING --run true"; then am_missing_run="$MISSING --run " else am_missing_run= { $as_echo "$as_me:$LINENO: WARNING: \`missing' script is too old or missing" >&5 $as_echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} fi if test x"${install_sh}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi # Installed binaries are usually stripped using `strip' when the user # run `make install-strip'. However `strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the `STRIP' environment variable to overrule this program. if test "$cross_compiling" != no; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_STRIP+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { $as_echo "$as_me:$LINENO: result: $STRIP" >&5 $as_echo "$STRIP" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_STRIP="strip" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { $as_echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 $as_echo "$ac_ct_STRIP" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" { $as_echo "$as_me:$LINENO: checking for a thread-safe mkdir -p" >&5 $as_echo_n "checking for a thread-safe mkdir -p... " >&6; } if test -z "$MKDIR_P"; then if test "${ac_cv_path_mkdir+set}" = set; then $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in mkdir gmkdir; do for ac_exec_ext in '' $ac_executable_extensions; do { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( 'mkdir (GNU coreutils) '* | \ 'mkdir (coreutils) '* | \ 'mkdir (fileutils) '4.1*) ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext break 3;; esac done done done IFS=$as_save_IFS fi if test "${ac_cv_path_mkdir+set}" = set; then MKDIR_P="$ac_cv_path_mkdir -p" else # As a last resort, use the slow shell script. Don't cache a # value for MKDIR_P within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. test -d ./--version && rmdir ./--version MKDIR_P="$ac_install_sh -d" fi fi { $as_echo "$as_me:$LINENO: result: $MKDIR_P" >&5 $as_echo "$MKDIR_P" >&6; } mkdir_p="$MKDIR_P" case $mkdir_p in [\\/$]* | ?:[\\/]*) ;; */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; esac for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_AWK+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_AWK="$ac_prog" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then { $as_echo "$as_me:$LINENO: result: $AWK" >&5 $as_echo "$AWK" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi test -n "$AWK" && break done { $as_echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } set x ${MAKE-make} ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 else cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF # GNU make sometimes prints "make[1]: Entering...", which would confuse us. case `${MAKE-make} -f conftest.make 2>/dev/null` in *@@@%%%=?*=@@@%%%*) eval ac_cv_prog_make_${ac_make}_set=yes;; *) eval ac_cv_prog_make_${ac_make}_set=no;; esac rm -f conftest.make fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then { $as_echo "$as_me:$LINENO: result: yes" >&5 $as_echo "yes" >&6; } SET_MAKE= else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." am__isrc=' -I$(srcdir)' # test to see if srcdir already configured if test -f $srcdir/config.status; then { { $as_echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5 $as_echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;} { (exit 1); exit 1; }; } fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi # Define the identity of the package. PACKAGE='mediatomb' VERSION='0.12.1' 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"} # 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 -' if test "x${prefix}" = "xNONE"; then prefix="${ac_default_prefix}" fi SEARCH_DIR="/usr/local" DARWIN_OS=0 CYGWIN_OS=0 FREEBSD_OS=0 OPENBSD_OS=0 LIBS_SAVE="$LIBS" # Make sure we can run config.sub. $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || { { $as_echo "$as_me:$LINENO: error: cannot run $SHELL $ac_aux_dir/config.sub" >&5 $as_echo "$as_me: error: cannot run $SHELL $ac_aux_dir/config.sub" >&2;} { (exit 1); exit 1; }; } { $as_echo "$as_me:$LINENO: checking build system type" >&5 $as_echo_n "checking build system type... " >&6; } if test "${ac_cv_build+set}" = set; then $as_echo_n "(cached) " >&6 else ac_build_alias=$build_alias test "x$ac_build_alias" = x && ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` test "x$ac_build_alias" = x && { { $as_echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5 $as_echo "$as_me: error: cannot guess build type; you must specify one" >&2;} { (exit 1); exit 1; }; } ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || { { $as_echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&5 $as_echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&2;} { (exit 1); exit 1; }; } fi { $as_echo "$as_me:$LINENO: result: $ac_cv_build" >&5 $as_echo "$ac_cv_build" >&6; } case $ac_cv_build in *-*-*) ;; *) { { $as_echo "$as_me:$LINENO: error: invalid value of canonical build" >&5 $as_echo "$as_me: error: invalid value of canonical build" >&2;} { (exit 1); exit 1; }; };; esac build=$ac_cv_build ac_save_IFS=$IFS; IFS='-' set x $ac_cv_build shift build_cpu=$1 build_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: build_os=$* IFS=$ac_save_IFS case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac { $as_echo "$as_me:$LINENO: checking host system type" >&5 $as_echo_n "checking host system type... " >&6; } if test "${ac_cv_host+set}" = set; then $as_echo_n "(cached) " >&6 else if test "x$host_alias" = x; then ac_cv_host=$ac_cv_build else ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || { { $as_echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&5 $as_echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&2;} { (exit 1); exit 1; }; } fi fi { $as_echo "$as_me:$LINENO: result: $ac_cv_host" >&5 $as_echo "$ac_cv_host" >&6; } case $ac_cv_host in *-*-*) ;; *) { { $as_echo "$as_me:$LINENO: error: invalid value of canonical host" >&5 $as_echo "$as_me: error: invalid value of canonical host" >&2;} { (exit 1); exit 1; }; };; esac host=$ac_cv_host ac_save_IFS=$IFS; IFS='-' set x $ac_cv_host shift host_cpu=$1 host_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: host_os=$* IFS=$ac_save_IFS case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac case $host in *-*-darwin*) DARWIN_OS=1 SEARCH_DIR="/opt/local" ;; *-*-solaris*) cat >>confdefs.h <<\_ACEOF #define SOLARIS 1 _ACEOF ;; *-*-cygwin*) CYGWIN_OS=1 ;; *-*-freebsd*) FREEBSD_OS=1 ;; *-*-openbsd*) OPENBSD_OS=1 ;; esac MT_SEARCHPATH="/usr/local" case $host in *-*-darwin*) MT_SEARCHPATH="/opt/local" ;; esac # Check whether --with-search was given. if test "${with_search+set}" = set; then withval=$with_search; MT_SEARCHPATH=$withval { $as_echo "$as_me:$LINENO: Will also search for packages in ${MT_SEARCHPATH}" >&5 $as_echo "$as_me: Will also search for packages in ${MT_SEARCHPATH}" >&6;} fi MT_SEARCHPATH_HEADERS="${MT_SEARCHPATH}/include" MT_SEARCHPATH_LIBS="${MT_SEARCHPATH}/lib" MT_SEARCHPATH_PROGS="${MT_SEARCHPATH}/bin" #AC_ARG_WITH(search, # AC_HELP_STRING([--with-search=DIR], [Additionally search for packages in DIR]), # [ # SEARCH_DIR=$withval # AC_MSG_NOTICE([Will also search for packages in $SEARCH_DIR]) # ] #) SEARCH_DIR_HEADERS="$SEARCH_DIR/include" SEARCH_DIR_LIBS="$SEARCH_DIR/lib" SEARCH_DIR_PROGS="$SEARCH_DIR/bin" # per package header and library search paths # Check whether --with-js-h was given. if test "${with_js_h+set}" = set; then withval=$with_js_h; JS_SEARCH_HEADERS="$withval" fi # Check whether --with-js-libs was given. if test "${with_js_libs+set}" = set; then withval=$with_js_libs; JS_SEARCH_LIBS="$withval" fi # Check whether --with-iconv-h was given. if test "${with_iconv_h+set}" = set; then withval=$with_iconv_h; ICONV_SEARCH_HEADERS="$withval" { $as_echo "$as_me:$LINENO: Will search for iconv headers in $withval" >&5 $as_echo "$as_me: Will search for iconv headers in $withval" >&6;} fi # Check whether --with-iconv-libs was given. if test "${with_iconv_libs+set}" = set; then withval=$with_iconv_libs; ICONV_SEARCH_LIBS="$withval" { $as_echo "$as_me:$LINENO: Will search for iconv libraries in $withval" >&5 $as_echo "$as_me: Will search for iconv libraries in $withval" >&6;} fi mt_static_option_enabled= mt_static_option_requested=no if test "xenable" = xdisable; then mt_static_option_enabled=yes else mt_static_option_enabled=no fi # Check whether --enable-static was given. if test "${enable_static+set}" = set; then enableval=$enable_static; mt_static_option_enabled=$enableval mt_static_option_requested=yes fi STATIC_OPTION_ENABLED=${mt_static_option_enabled} STATIC_OPTION_REQUESTED=${mt_static_option_requested} if test "x${mt_static_option_enabled}" = xyes; then CFLAGS="$CFLAGS -static" CXXFLAGS="$CXXFLAGS -static" { $as_echo "$as_me:$LINENO: Building a static executable." >&5 $as_echo "$as_me: Building a static executable." >&6;} fi mt_db_autocreate_option_enabled= mt_db_autocreate_option_requested=no if test "xdisable" = xdisable; then mt_db_autocreate_option_enabled=yes else mt_db_autocreate_option_enabled=no fi # Check whether --enable-db-autocreate was given. if test "${enable_db_autocreate+set}" = set; then enableval=$enable_db_autocreate; mt_db_autocreate_option_enabled=$enableval mt_db_autocreate_option_requested=yes fi DB_AUTOCREATE_OPTION_ENABLED=${mt_db_autocreate_option_enabled} DB_AUTOCREATE_OPTION_REQUESTED=${mt_db_autocreate_option_requested} mt_debug_malloc0_option_enabled= mt_debug_malloc0_option_requested=no if test "xenable" = xdisable; then mt_debug_malloc0_option_enabled=yes else mt_debug_malloc0_option_enabled=no fi # Check whether --enable-debug-malloc0 was given. if test "${enable_debug_malloc0+set}" = set; then enableval=$enable_debug_malloc0; mt_debug_malloc0_option_enabled=$enableval mt_debug_malloc0_option_requested=yes fi DEBUG_MALLOC0_OPTION_ENABLED=${mt_debug_malloc0_option_enabled} DEBUG_MALLOC0_OPTION_REQUESTED=${mt_debug_malloc0_option_requested} if test "x${mt_debug_malloc0_option_enabled}" = xyes; then cat >>confdefs.h <<\_ACEOF #define DEBUG_MALLOC_0 1 _ACEOF fi mt_pthread_lib_option_enabled= mt_pthread_lib_option_requested=no if test "xenable" = xdisable; then mt_pthread_lib_option_enabled=yes else mt_pthread_lib_option_enabled=no fi # Check whether --enable-pthread-lib was given. if test "${enable_pthread_lib+set}" = set; then enableval=$enable_pthread_lib; mt_pthread_lib_option_enabled=$enableval mt_pthread_lib_option_requested=yes fi PTHREAD_LIB_OPTION_ENABLED=${mt_pthread_lib_option_enabled} PTHREAD_LIB_OPTION_REQUESTED=${mt_pthread_lib_option_requested} mt_iconv_lib_option_enabled= mt_iconv_lib_option_requested=no if test "xenable" = xdisable; then mt_iconv_lib_option_enabled=yes else mt_iconv_lib_option_enabled=no fi # Check whether --enable-iconv-lib was given. if test "${enable_iconv_lib+set}" = set; then enableval=$enable_iconv_lib; mt_iconv_lib_option_enabled=$enableval mt_iconv_lib_option_requested=yes fi ICONV_LIB_OPTION_ENABLED=${mt_iconv_lib_option_enabled} ICONV_LIB_OPTION_REQUESTED=${mt_iconv_lib_option_requested} ATOMIC_X86_SMP=0 ATOMIC_X86_SMP_REQ=0 X86=0 case $host_cpu in *86) ATOMIC_X86_SMP=1 X86=1 ;; *86*64) ATOMIC_X86_SMP=1 X86=1 ;; esac ATOMIC_X86=0 mt_atomic_x86_single_option_enabled= mt_atomic_x86_single_option_requested=no if test "xenable" = xdisable; then mt_atomic_x86_single_option_enabled=yes else mt_atomic_x86_single_option_enabled=no fi # Check whether --enable-atomic-x86-single was given. if test "${enable_atomic_x86_single+set}" = set; then enableval=$enable_atomic_x86_single; mt_atomic_x86_single_option_enabled=$enableval mt_atomic_x86_single_option_requested=yes fi ATOMIC_X86_SINGLE_OPTION_ENABLED=${mt_atomic_x86_single_option_enabled} ATOMIC_X86_SINGLE_OPTION_REQUESTED=${mt_atomic_x86_single_option_requested} if test "x${mt_atomic_x86_single_option_enabled}" = xyes; then if test "$X86" -eq 1; then ATOMIC_X86=1 ATOMIC_X86_SMP=0 else { { $as_echo "$as_me:$LINENO: error: Tried to activate x86 specific option for a non x86 host!" >&5 $as_echo "$as_me: error: Tried to activate x86 specific option for a non x86 host!" >&2;} { (exit 1); exit 1; }; } fi fi # Check whether --enable-atomic-pthread was given. if test "${enable_atomic_pthread+set}" = set; then enableval=$enable_atomic_pthread; if test "x$enableval" = xyes; then if test "$ATOMIC_X86" -eq 1; then { { $as_echo "$as_me:$LINENO: error: You can not use atomic-x86-single and atomic-pthread code at the same time!" >&5 $as_echo "$as_me: error: You can not use atomic-x86-single and atomic-pthread code at the same time!" >&2;} { (exit 1); exit 1; }; } else ATOMIC_X86=0 ATOMIC_X86_SMP=0 fi fi fi mt_atomic_option_enabled= mt_atomic_option_requested=no if test "xdisable" = xdisable; then mt_atomic_option_enabled=yes else mt_atomic_option_enabled=no fi # Check whether --enable-atomic was given. if test "${enable_atomic+set}" = set; then enableval=$enable_atomic; mt_atomic_option_enabled=$enableval mt_atomic_option_requested=yes fi ATOMIC_OPTION_ENABLED=${mt_atomic_option_enabled} ATOMIC_OPTION_REQUESTED=${mt_atomic_option_requested} if test "x${mt_atomic_option_enabled}" = xyes; then : else ATOMIC_X86=0 ATOMIC_X86_SMP=0 { $as_echo "$as_me:$LINENO: WARNING: You disabled the use of atomic arithmetics! You have been warned!" >&5 $as_echo "$as_me: WARNING: You disabled the use of atomic arithmetics! You have been warned!" >&2;} cat >>confdefs.h <<\_ACEOF #define ATOMIC_TORTURE 1 _ACEOF fi if ((test $ATOMIC_X86_SMP -eq 1) && (test $ATOMIC_X86 -eq 1)); then { { $as_echo "$as_me:$LINENO: error: Cannot use atomic-x86-smp and atomic-x86 options at the same time!" >&5 $as_echo "$as_me: error: Cannot use atomic-x86-smp and atomic-x86 options at the same time!" >&2;} { (exit 1); exit 1; }; } fi if (((test $ATOMIC_X86_SMP -eq 1) || (test $ATOMIC_X86 -eq 1)) && (test "$X86" -eq 0)); then { { $as_echo "$as_me:$LINENO: error: Cannot use x86 specific code on a non a $host_cpu system!" >&5 $as_echo "$as_me: error: Cannot use x86 specific code on a non a $host_cpu system!" >&2;} { (exit 1); exit 1; }; } fi if test $ATOMIC_X86_SMP -eq 1; then cat >>confdefs.h <<\_ACEOF #define ATOMIC_X86_SMP 1 _ACEOF elif test $ATOMIC_X86 -eq 1; then cat >>confdefs.h <<\_ACEOF #define ATOMIC_X86 1 _ACEOF { $as_echo "$as_me:$LINENO: WARNING: You specified to use atomic arithmetics code for x86 single processor systems! The resulting binary must not be used on SMP machines!" >&5 $as_echo "$as_me: WARNING: You specified to use atomic arithmetics code for x86 single processor systems! The resulting binary must not be used on SMP machines!" >&2;} fi SIGHUP=0 if test $X86 -eq 1; then SIGHUP=1 fi # Check whether --enable-sighup was given. if test "${enable_sighup+set}" = set; then enableval=$enable_sighup; if test "x$enableval" = xno; then SIGHUP=0 else SIGHUP=1 fi fi if test $SIGHUP -eq 1; then cat >>confdefs.h <<\_ACEOF #define ENABLE_SIGHUP 1 _ACEOF fi mt_mrreg_service_option_enabled= mt_mrreg_service_option_requested=no if test "xenable" = xdisable; then mt_mrreg_service_option_enabled=yes else mt_mrreg_service_option_enabled=no fi # Check whether --enable-mrreg-service was given. if test "${enable_mrreg_service+set}" = set; then enableval=$enable_mrreg_service; mt_mrreg_service_option_enabled=$enableval mt_mrreg_service_option_requested=yes fi MRREG_SERVICE_OPTION_ENABLED=${mt_mrreg_service_option_enabled} MRREG_SERVICE_OPTION_REQUESTED=${mt_mrreg_service_option_requested} if test "x${mt_mrreg_service_option_enabled}" = xyes; then cat >>confdefs.h <<\_ACEOF #define ENABLE_MRREG 1 _ACEOF fi mt_external_transcoding_option_enabled= mt_external_transcoding_option_requested=no if test "xdisable" = xdisable; then mt_external_transcoding_option_enabled=yes else mt_external_transcoding_option_enabled=no fi # Check whether --enable-external-transcoding was given. if test "${enable_external_transcoding+set}" = set; then enableval=$enable_external_transcoding; mt_external_transcoding_option_enabled=$enableval mt_external_transcoding_option_requested=yes fi EXTERNAL_TRANSCODING_OPTION_ENABLED=${mt_external_transcoding_option_enabled} EXTERNAL_TRANSCODING_OPTION_REQUESTED=${mt_external_transcoding_option_requested} if test "x${mt_external_transcoding_option_enabled}" = xyes; then : else EXTERNAL_TRANSCODING_OPTION_ENABLED=disabled fi mt_youtube_option_enabled= mt_youtube_option_requested=no if test "xdisable" = xdisable; then mt_youtube_option_enabled=yes else mt_youtube_option_enabled=no fi # Check whether --enable-youtube was given. if test "${enable_youtube+set}" = set; then enableval=$enable_youtube; mt_youtube_option_enabled=$enableval mt_youtube_option_requested=yes fi YOUTUBE_OPTION_ENABLED=${mt_youtube_option_enabled} YOUTUBE_OPTION_REQUESTED=${mt_youtube_option_requested} if test "x${mt_youtube_option_enabled}" = xyes; then : else YOUTUBE_OPTION_ENABLED=disabled fi #MT_OPTION([weborama], [disable], # [Weborama service support], # [],[WEBORAMA_OPTION_ENABLED=disabled]) mt_sqlite_backup_defaults_option_enabled= mt_sqlite_backup_defaults_option_requested=no if test "xenable" = xdisable; then mt_sqlite_backup_defaults_option_enabled=yes else mt_sqlite_backup_defaults_option_enabled=no fi # Check whether --enable-sqlite-backup-defaults was given. if test "${enable_sqlite_backup_defaults+set}" = set; then enableval=$enable_sqlite_backup_defaults; mt_sqlite_backup_defaults_option_enabled=$enableval mt_sqlite_backup_defaults_option_requested=yes fi SQLITE_BACKUP_DEFAULTS_OPTION_ENABLED=${mt_sqlite_backup_defaults_option_enabled} SQLITE_BACKUP_DEFAULTS_OPTION_REQUESTED=${mt_sqlite_backup_defaults_option_requested} mt_protocolinfo_extension_option_enabled= mt_protocolinfo_extension_option_requested=no if test "xdisable" = xdisable; then mt_protocolinfo_extension_option_enabled=yes else mt_protocolinfo_extension_option_enabled=no fi # Check whether --enable-protocolinfo-extension was given. if test "${enable_protocolinfo_extension+set}" = set; then enableval=$enable_protocolinfo_extension; mt_protocolinfo_extension_option_enabled=$enableval mt_protocolinfo_extension_option_requested=yes fi PROTOCOLINFO_EXTENSION_OPTION_ENABLED=${mt_protocolinfo_extension_option_enabled} PROTOCOLINFO_EXTENSION_OPTION_REQUESTED=${mt_protocolinfo_extension_option_requested} if test "x${mt_protocolinfo_extension_option_enabled}" = xyes; then cat >>confdefs.h <<\_ACEOF #define EXTEND_PROTOCOLINFO 1 _ACEOF fi USE_CURL=1 CURL_REQUESTED=0 # Check whether --enable-curl was given. if test "${enable_curl+set}" = set; then enableval=$enable_curl; if test "x$enableval" = xno; then USE_CURL=0 CURL_REQUESTED=1 else CURL_REQUESTED=1 USE_CURL=1 fi fi # Check whether --with-curl-cfg was given. if test "${with_curl_cfg+set}" = set; then withval=$with_curl_cfg; CURL_SEARCH_CONFIG="$withval" { $as_echo "$as_me:$LINENO: Will search for curl-config in $withval" >&5 $as_echo "$as_me: Will search for curl-config in $withval" >&6;} fi mt_fseeko_check_option_enabled= mt_fseeko_check_option_requested=no if test "xdisable" = xdisable; then mt_fseeko_check_option_enabled=yes else mt_fseeko_check_option_enabled=no fi # Check whether --enable-fseeko-check was given. if test "${enable_fseeko_check+set}" = set; then enableval=$enable_fseeko_check; mt_fseeko_check_option_enabled=$enableval mt_fseeko_check_option_requested=yes fi FSEEKO_CHECK_OPTION_ENABLED=${mt_fseeko_check_option_enabled} FSEEKO_CHECK_OPTION_REQUESTED=${mt_fseeko_check_option_requested} ############################################################################### # The following block is derived from the configure.ac script from the # libupnp-1.3.1 package # (C) Copyright 2005-2006 Remi Turboult upnpmaj=0 upnpmin=4 upnppatch=1 cat >>confdefs.h <<_ACEOF #define UPNP_VERSION_STRING "$PACKAGE_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF #define UPNP_VERSION_MAJOR $upnpmaj _ACEOF cat >>confdefs.h <<_ACEOF #define UPNP_VERSION_MINOR $upnpmin _ACEOF cat >>confdefs.h <<_ACEOF #define UPNP_VERSION_PATCH $upnppatch _ACEOF ############################################################################### ac_ext=cpp 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 -z "$CXX"; then if test -n "$CCC"; then CXX=$CCC else if test -n "$ac_tool_prefix"; then for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe 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 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_CXX+set}" = set; then $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CXX=$ac_cv_prog_CXX if test -n "$CXX"; then { $as_echo "$as_me:$LINENO: result: $CXX" >&5 $as_echo "$CXX" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi test -n "$CXX" && break done fi if test -z "$CXX"; then ac_ct_CXX=$CXX for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe 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 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_CXX+set}" = set; then $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CXX="$ac_prog" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CXX=$ac_cv_prog_ac_ct_CXX if test -n "$ac_ct_CXX"; then { $as_echo "$as_me:$LINENO: result: $ac_ct_CXX" >&5 $as_echo "$ac_ct_CXX" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_CXX" && break done if test "x$ac_ct_CXX" = x; then CXX="g++" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CXX=$ac_ct_CXX fi fi fi fi # Provide some information about the compiler. $as_echo "$as_me:$LINENO: checking for C++ compiler version" >&5 set X $ac_compile ac_compiler=$2 { (ac_try="$ac_compiler --version >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compiler --version >&5") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -v >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compiler -v >&5") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -V >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compiler -V >&5") 2>&5 ac_status=$? $as_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.out.dSYM a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. { $as_echo "$as_me:$LINENO: checking for C++ compiler default output file name" >&5 $as_echo_n "checking for C++ compiler default output file name... " >&6; } ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # The possible output files: ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; * ) ac_rmfiles="$ac_rmfiles $ac_file";; esac done rm -f $ac_rmfiles if { (ac_try="$ac_link_default" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link_default") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. # So ignore a value of `no', otherwise this would lead to `EXEEXT = no' # in a Makefile. We should not override ac_cv_exeext if it was cached, # so that the user can short-circuit this test for compilers unknown to # Autoconf. for ac_file in $ac_files '' do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; then :; else ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi # We set ac_cv_exeext here because the later test for it is not # safe: cross compilers may not add the suffix if given an `-o' # argument, so we may need to know it at that point already. # Even if this section looks crufty: it has the advantage of # actually working. break;; * ) break;; esac done test "$ac_cv_exeext" = no && ac_cv_exeext= else ac_file='' fi { $as_echo "$as_me:$LINENO: result: $ac_file" >&5 $as_echo "$ac_file" >&6; } if test -z "$ac_file"; then $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { { $as_echo "$as_me:$LINENO: error: C++ compiler cannot create executables See \`config.log' for more details." >&5 $as_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 # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { $as_echo "$as_me:$LINENO: checking whether the C++ compiler works" >&5 $as_echo_n "checking whether the C++ compiler works... " >&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' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_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 { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { { $as_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 $as_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 { $as_echo "$as_me:$LINENO: result: yes" >&5 $as_echo "yes" >&6; } rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { $as_echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 $as_echo_n "checking whether we are cross compiling... " >&6; } { $as_echo "$as_me:$LINENO: result: $cross_compiling" >&5 $as_echo "$cross_compiling" >&6; } { $as_echo "$as_me:$LINENO: checking for suffix of executables" >&5 $as_echo_n "checking for suffix of executables... " >&6; } if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_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 | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { { $as_echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&5 $as_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 { $as_echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 $as_echo "$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT { $as_echo "$as_me:$LINENO: checking for suffix of object files" >&5 $as_echo_n "checking for suffix of object files... " >&6; } if test "${ac_cv_objext+set}" = set; then $as_echo_n "(cached) " >&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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { { $as_echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&5 $as_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 { $as_echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 $as_echo "$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { $as_echo "$as_me:$LINENO: checking whether we are using the GNU C++ compiler" >&5 $as_echo_n "checking whether we are using the GNU C++ compiler... " >&6; } if test "${ac_cv_cxx_compiler_gnu+set}" = set; then $as_echo_n "(cached) " >&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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_compiler_gnu=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_cxx_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:$LINENO: result: $ac_cv_cxx_compiler_gnu" >&5 $as_echo "$ac_cv_cxx_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GXX=yes else GXX= fi ac_test_CXXFLAGS=${CXXFLAGS+set} ac_save_CXXFLAGS=$CXXFLAGS { $as_echo "$as_me:$LINENO: checking whether $CXX accepts -g" >&5 $as_echo_n "checking whether $CXX accepts -g... " >&6; } if test "${ac_cv_prog_cxx_g+set}" = set; then $as_echo_n "(cached) " >&6 else ac_save_cxx_werror_flag=$ac_cxx_werror_flag ac_cxx_werror_flag=yes ac_cv_prog_cxx_g=no CXXFLAGS="-g" 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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cxx_g=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CXXFLAGS="" 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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cxx_werror_flag=$ac_save_cxx_werror_flag CXXFLAGS="-g" 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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cxx_g=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cxx_werror_flag=$ac_save_cxx_werror_flag fi { $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cxx_g" >&5 $as_echo "$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 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 this is the am__doit target .PHONY: am__doit END # If we don't find an include directive, just comment out the code. { $as_echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5 $as_echo_n "checking for style of include used by $am_make... " >&6; } am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # Ignore all kinds of additional output from `make'. case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=include am__quote= _am_result=GNU ;; esac # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=.include am__quote="\"" _am_result=BSD ;; esac fi { $as_echo "$as_me:$LINENO: result: $_am_result" >&5 $as_echo "$_am_result" >&6; } rm -f confinc confmf # Check whether --enable-dependency-tracking was given. if test "${enable_dependency_tracking+set}" = set; then enableval=$enable_dependency_tracking; fi if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' fi if test "x$enable_dependency_tracking" != xno; then AMDEP_TRUE= AMDEP_FALSE='#' else AMDEP_TRUE='#' AMDEP_FALSE= fi depcc="$CXX" am_compiler_list= { $as_echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } if test "${am_cv_CXX_dependencies_compiler_type+set}" = set; then $as_echo_n "(cached) " >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. 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 am__universal=false case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with # Solaris 8's {/usr,}/bin/sh. touch sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with `-c' and `-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle `-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # after this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvisualcpp | msvcmsys) # This compiler won't grok `-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CXX_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CXX_dependencies_compiler_type=none fi fi { $as_echo "$as_me:$LINENO: result: $am_cv_CXX_dependencies_compiler_type" >&5 $as_echo "$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 ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_CC+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}gcc" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:$LINENO: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="gcc" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_CC+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}cc" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:$LINENO: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_CC+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:$LINENO: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_CC+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:$LINENO: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="$ac_prog" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_CC" && break done if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { { $as_echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&5 $as_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. $as_echo "$as_me:$LINENO: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 { (ac_try="$ac_compiler --version >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compiler --version >&5") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -v >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compiler -v >&5") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -V >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compiler -V >&5") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { $as_echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; } if test "${ac_cv_c_compiler_gnu+set}" = set; then $as_echo_n "(cached) " >&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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_compiler_gnu=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 $as_echo "$ac_cv_c_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { $as_echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 $as_echo_n "checking whether $CC accepts -g... " >&6; } if test "${ac_cv_prog_cc_g+set}" = set; then $as_echo_n "(cached) " >&6 else ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat >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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CFLAGS="" 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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" 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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi { $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 $as_echo "$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi { $as_echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } if test "${ac_cv_prog_cc_c89+set}" = set; then $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=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 -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_c89=$ac_arg else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) { $as_echo "$as_me:$LINENO: result: none needed" >&5 $as_echo "none needed" >&6; } ;; xno) { $as_echo "$as_me:$LINENO: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 $as_echo "$ac_cv_prog_cc_c89" >&6; } ;; esac ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu depcc="$CC" am_compiler_list= { $as_echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then $as_echo_n "(cached) " >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CC_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi am__universal=false case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with # Solaris 8's {/usr,}/bin/sh. touch sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with `-c' and `-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle `-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # after this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvisualcpp | msvcmsys) # This compiler won't grok `-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CC_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CC_dependencies_compiler_type=none fi fi { $as_echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5 $as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then am__fastdepCC_TRUE= am__fastdepCC_FALSE='#' else am__fastdepCC_TRUE='#' am__fastdepCC_FALSE= fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_RANLIB+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then { $as_echo "$as_me:$LINENO: result: $RANLIB" >&5 $as_echo "$RANLIB" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_RANLIB"; then ac_ct_RANLIB=$RANLIB # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_RANLIB"; then ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_RANLIB="ranlib" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then { $as_echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5 $as_echo "$ac_ct_RANLIB" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_RANLIB" = x; then RANLIB=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac RANLIB=$ac_ct_RANLIB fi else RANLIB="$ac_cv_prog_RANLIB" fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 $as_echo_n "checking how to run the C preprocessor... " >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if test "${ac_cv_prog_CPP+set}" = set; then $as_echo_n "(cached) " >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >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 { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&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 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : else $as_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 nonexistent 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 { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&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 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then # Broken: success on invalid input. continue else $as_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 { $as_echo "$as_me:$LINENO: result: $CPP" >&5 $as_echo "$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >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 { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&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 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : else $as_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 nonexistent 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 { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&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 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then # Broken: success on invalid input. continue else $as_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 { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { { $as_echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&5 $as_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 { $as_echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5 $as_echo_n "checking for grep that handles long lines and -e... " >&6; } if test "${ac_cv_path_GREP+set}" = set; then $as_echo_n "(cached) " >&6 else if test -z "$GREP"; then ac_path_GREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in grep ggrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in *GNU*) ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'GREP' >> "conftest.nl" "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break ac_count=`expr $ac_count + 1` if test $ac_count -gt ${ac_path_GREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_GREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_GREP"; then { { $as_echo "$as_me:$LINENO: error: no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 $as_echo "$as_me: error: no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} { (exit 1); exit 1; }; } fi else ac_cv_path_GREP=$GREP fi fi { $as_echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5 $as_echo "$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" { $as_echo "$as_me:$LINENO: checking for egrep" >&5 $as_echo_n "checking for egrep... " >&6; } if test "${ac_cv_path_EGREP+set}" = set; then $as_echo_n "(cached) " >&6 else if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else if test -z "$EGREP"; then ac_path_EGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in egrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in *GNU*) ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'EGREP' >> "conftest.nl" "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break ac_count=`expr $ac_count + 1` if test $ac_count -gt ${ac_path_EGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_EGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_EGREP"; then { { $as_echo "$as_me:$LINENO: error: no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 $as_echo "$as_me: error: no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} { (exit 1); exit 1; }; } fi else ac_cv_path_EGREP=$EGREP fi fi fi { $as_echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5 $as_echo "$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" if test $ac_cv_c_compiler_gnu = yes; then { $as_echo "$as_me:$LINENO: checking whether $CC needs -traditional" >&5 $as_echo_n "checking whether $CC needs -traditional... " >&6; } if test "${ac_cv_prog_gcc_traditional+set}" = set; then $as_echo_n "(cached) " >&6 else ac_pattern="Autoconf.*'x'" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include Autoconf TIOCGETP _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "$ac_pattern" >/dev/null 2>&1; then ac_cv_prog_gcc_traditional=yes else ac_cv_prog_gcc_traditional=no fi rm -f conftest* if test $ac_cv_prog_gcc_traditional = no; then cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include Autoconf TCGETA _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "$ac_pattern" >/dev/null 2>&1; then ac_cv_prog_gcc_traditional=yes fi rm -f conftest* fi fi { $as_echo "$as_me:$LINENO: result: $ac_cv_prog_gcc_traditional" >&5 $as_echo "$ac_cv_prog_gcc_traditional" >&6; } if test $ac_cv_prog_gcc_traditional = yes; then CC="$CC -traditional" fi fi ac_header_dirent=no for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do as_ac_Header=`$as_echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh` { $as_echo "$as_me:$LINENO: checking for $ac_hdr that defines DIR" >&5 $as_echo_n "checking for $ac_hdr that defines DIR... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then eval "$as_ac_Header=yes" else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Header=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } as_val=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF #define `$as_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 { $as_echo "$as_me:$LINENO: checking for library containing opendir" >&5 $as_echo_n "checking for library containing opendir... " >&6; } if test "${ac_cv_search_opendir+set}" = set; then $as_echo_n "(cached) " >&6 else ac_func_search_save_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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char opendir (); int main () { return opendir (); ; return 0; } _ACEOF for ac_lib in '' dir; do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_search_opendir=$ac_res else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext if test "${ac_cv_search_opendir+set}" = set; then break fi done if test "${ac_cv_search_opendir+set}" = set; then : else ac_cv_search_opendir=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { $as_echo "$as_me:$LINENO: result: $ac_cv_search_opendir" >&5 $as_echo "$ac_cv_search_opendir" >&6; } ac_res=$ac_cv_search_opendir if test "$ac_res" != no; then test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi else { $as_echo "$as_me:$LINENO: checking for library containing opendir" >&5 $as_echo_n "checking for library containing opendir... " >&6; } if test "${ac_cv_search_opendir+set}" = set; then $as_echo_n "(cached) " >&6 else ac_func_search_save_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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char opendir (); int main () { return opendir (); ; return 0; } _ACEOF for ac_lib in '' x; do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_search_opendir=$ac_res else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext if test "${ac_cv_search_opendir+set}" = set; then break fi done if test "${ac_cv_search_opendir+set}" = set; then : else ac_cv_search_opendir=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { $as_echo "$as_me:$LINENO: result: $ac_cv_search_opendir" >&5 $as_echo "$ac_cv_search_opendir" >&6; } ac_res=$ac_cv_search_opendir if test "$ac_res" != no; then test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi fi { $as_echo "$as_me:$LINENO: checking for ANSI C header files" >&5 $as_echo_n "checking for ANSI C header files... " >&6; } if test "${ac_cv_header_stdc+set}" = set; then $as_echo_n "(cached) " >&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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_header_stdc=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_stdc=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat >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 #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) return 2; return 0; } _ACEOF rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else $as_echo "$as_me: program exited with status $ac_status" >&5 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_header_stdc=no fi rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi fi { $as_echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 $as_echo "$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then cat >>confdefs.h <<\_ACEOF #define STDC_HEADERS 1 _ACEOF fi { $as_echo "$as_me:$LINENO: checking for sys/wait.h that is POSIX.1 compatible" >&5 $as_echo_n "checking for sys/wait.h that is POSIX.1 compatible... " >&6; } if test "${ac_cv_header_sys_wait_h+set}" = set; then $as_echo_n "(cached) " >&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 #ifndef WEXITSTATUS # define WEXITSTATUS(stat_val) ((unsigned int) (stat_val) >> 8) #endif #ifndef WIFEXITED # define WIFEXITED(stat_val) (((stat_val) & 255) == 0) #endif int main () { int s; wait (&s); s = WIFEXITED (s) ? WEXITSTATUS (s) : 1; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_header_sys_wait_h=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_sys_wait_h=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:$LINENO: result: $ac_cv_header_sys_wait_h" >&5 $as_echo "$ac_cv_header_sys_wait_h" >&6; } if test $ac_cv_header_sys_wait_h = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_SYS_WAIT_H 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=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 $as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then eval "$as_ac_Header=yes" else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Header=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } as_val=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done { $as_echo "$as_me:$LINENO: checking for stdbool.h that conforms to C99" >&5 $as_echo_n "checking for stdbool.h that conforms to C99... " >&6; } if test "${ac_cv_header_stdbool_h+set}" = set; then $as_echo_n "(cached) " >&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 #ifndef bool "error: bool is not defined" #endif #ifndef false "error: false is not defined" #endif #if false "error: false is not 0" #endif #ifndef true "error: true is not defined" #endif #if true != 1 "error: true is not 1" #endif #ifndef __bool_true_false_are_defined "error: __bool_true_false_are_defined is not defined" #endif struct s { _Bool s: 1; _Bool t; } s; char a[true == 1 ? 1 : -1]; char b[false == 0 ? 1 : -1]; char c[__bool_true_false_are_defined == 1 ? 1 : -1]; char d[(bool) 0.5 == true ? 1 : -1]; bool e = &s; char f[(_Bool) 0.0 == false ? 1 : -1]; char g[true]; char h[sizeof (_Bool)]; char i[sizeof s.t]; enum { j = false, k = true, l = false * true, m = true * 256 }; /* The following fails for HP aC++/ANSI C B3910B A.05.55 [Dec 04 2003]. */ _Bool n[m]; char o[sizeof n == m * sizeof n[0] ? 1 : -1]; char p[-1 - (_Bool) 0 < 0 && -1 - (bool) 0 < 0 ? 1 : -1]; # if defined __xlc__ || defined __GNUC__ /* Catch a bug in IBM AIX xlc compiler version 6.0.0.0 reported by James Lemley on 2005-10-05; see http://lists.gnu.org/archive/html/bug-coreutils/2005-10/msg00086.html This test is not quite right, since xlc is allowed to reject this program, as the initializer for xlcbug is not one of the forms that C requires support for. However, doing the test right would require a runtime test, and that would make cross-compilation harder. Let us hope that IBM fixes the xlc bug, and also adds support for this kind of constant expression. In the meantime, this test will reject xlc, which is OK, since our stdbool.h substitute should suffice. We also test this with GCC, where it should work, to detect more quickly whether someone messes up the test in the future. */ char digs[] = "0123456789"; int xlcbug = 1 / (&(digs + 5)[-2 + (bool) 1] == &digs[4] ? 1 : -1); # endif /* Catch a bug in an HP-UX C compiler. See http://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html http://lists.gnu.org/archive/html/bug-coreutils/2005-11/msg00161.html */ _Bool q = true; _Bool *pq = &q; int main () { *pq |= q; *pq |= ! q; /* Refer to every declared value, to avoid compiler optimizations. */ return (!a + !b + !c + !d + !e + !f + !g + !h + !i + !!j + !k + !!l + !m + !n + !o + !p + !q + !pq); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_header_stdbool_h=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_stdbool_h=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:$LINENO: result: $ac_cv_header_stdbool_h" >&5 $as_echo "$ac_cv_header_stdbool_h" >&6; } { $as_echo "$as_me:$LINENO: checking for _Bool" >&5 $as_echo_n "checking for _Bool... " >&6; } if test "${ac_cv_type__Bool+set}" = set; then $as_echo_n "(cached) " >&6 else ac_cv_type__Bool=no 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 int main () { if (sizeof (_Bool)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then 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 int main () { if (sizeof ((_Bool))) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type__Bool=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:$LINENO: result: $ac_cv_type__Bool" >&5 $as_echo "$ac_cv_type__Bool" >&6; } if test "x$ac_cv_type__Bool" = x""yes; then cat >>confdefs.h <<_ACEOF #define HAVE__BOOL 1 _ACEOF fi if test $ac_cv_header_stdbool_h = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_STDBOOL_H 1 _ACEOF fi { $as_echo "$as_me:$LINENO: checking whether time.h and sys/time.h may both be included" >&5 $as_echo_n "checking whether time.h and sys/time.h may both be included... " >&6; } if test "${ac_cv_header_time+set}" = set; then $as_echo_n "(cached) " >&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 int main () { if ((struct tm *) 0) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_header_time=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_time=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:$LINENO: result: $ac_cv_header_time" >&5 $as_echo "$ac_cv_header_time" >&6; } if test $ac_cv_header_time = yes; then cat >>confdefs.h <<\_ACEOF #define TIME_WITH_SYS_TIME 1 _ACEOF fi { $as_echo "$as_me:$LINENO: checking whether stat file-mode macros are broken" >&5 $as_echo_n "checking whether stat file-mode macros are broken... " >&6; } if test "${ac_cv_header_stat_broken+set}" = set; then $as_echo_n "(cached) " >&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 #if defined S_ISBLK && defined S_IFDIR extern char c1[S_ISBLK (S_IFDIR) ? -1 : 1]; #endif #if defined S_ISBLK && defined S_IFCHR extern char c2[S_ISBLK (S_IFCHR) ? -1 : 1]; #endif #if defined S_ISLNK && defined S_IFREG extern char c3[S_ISLNK (S_IFREG) ? -1 : 1]; #endif #if defined S_ISSOCK && defined S_IFREG extern char c4[S_ISSOCK (S_IFREG) ? -1 : 1]; #endif _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_header_stat_broken=no else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_stat_broken=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:$LINENO: result: $ac_cv_header_stat_broken" >&5 $as_echo "$ac_cv_header_stat_broken" >&6; } if test $ac_cv_header_stat_broken = yes; then cat >>confdefs.h <<\_ACEOF #define STAT_MACROS_BROKEN 1 _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 if test "x$CC" != xcc; then { $as_echo "$as_me:$LINENO: checking whether $CC and cc understand -c and -o together" >&5 $as_echo_n "checking whether $CC and cc understand -c and -o together... " >&6; } else { $as_echo "$as_me:$LINENO: checking whether cc understands -c and -o together" >&5 $as_echo_n "checking whether cc understands -c and -o together... " >&6; } fi set dummy $CC; ac_cc=`$as_echo "$2" | sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'` if { as_var=ac_cv_prog_cc_${ac_cc}_c_o; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&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 # Make sure it works both with $CC and with simple cc. # We do the test twice because some compilers refuse to overwrite an # existing .o file with -o, though they will create one. ac_try='$CC -c conftest.$ac_ext -o conftest2.$ac_objext >&5' rm -f conftest2.* if { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && test -f conftest2.$ac_objext && { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then eval ac_cv_prog_cc_${ac_cc}_c_o=yes if test "x$CC" != xcc; then # Test first that cc exists at all. if { ac_try='cc -c conftest.$ac_ext >&5' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_try='cc -c conftest.$ac_ext -o conftest2.$ac_objext >&5' rm -f conftest2.* if { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && test -f conftest2.$ac_objext && { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # cc works too. : else # cc exists but doesn't like -o. eval ac_cv_prog_cc_${ac_cc}_c_o=no fi fi fi else eval ac_cv_prog_cc_${ac_cc}_c_o=no fi rm -f core conftest* fi if eval test \$ac_cv_prog_cc_${ac_cc}_c_o = yes; then { $as_echo "$as_me:$LINENO: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } cat >>confdefs.h <<\_ACEOF #define NO_MINUS_C_MINUS_O 1 _ACEOF fi # FIXME: we rely on the cache variable name because # there is no other way. set dummy $CC am_cc=`echo $2 | sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'` eval am_t=\$ac_cv_prog_cc_${am_cc}_c_o if test "$am_t" != yes; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__CC in this case, # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" CC="$am_aux_dir/compile $CC" fi for ac_header in time.h syslog.h stddef.h unistd.h arpa/inet.h fcntl.h do as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 $as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 $as_echo_n "checking $ac_header usability... " >&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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 $as_echo_n "checking $ac_header presence... " >&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 { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&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 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else $as_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 { $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 $as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 $as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------- ## ## Report this to jin@mediatomb.cc ## ## ------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 $as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi as_val=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF else { { $as_echo "$as_me:$LINENO: error: required header not found" >&5 $as_echo "$as_me: error: required header not found" >&2;} { (exit 1); exit 1; }; } fi done for ac_header in limits.h netdb.h netinet/in.h stdlib.h string.h sys/file.h do as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 $as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 $as_echo_n "checking $ac_header usability... " >&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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 $as_echo_n "checking $ac_header presence... " >&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 { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&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 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else $as_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 { $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 $as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 $as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------- ## ## Report this to jin@mediatomb.cc ## ## ------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 $as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi as_val=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF else { { $as_echo "$as_me:$LINENO: error: required header not found" >&5 $as_echo "$as_me: error: required header not found" >&2;} { (exit 1); exit 1; }; } fi done for ac_header in sys/ioctl.h sys/socket.h sys/time.h sys/types.h sys/wait.h do as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 $as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 $as_echo_n "checking $ac_header usability... " >&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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 $as_echo_n "checking $ac_header presence... " >&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 { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&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 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else $as_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 { $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 $as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 $as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------- ## ## Report this to jin@mediatomb.cc ## ## ------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 $as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi as_val=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF else { { $as_echo "$as_me:$LINENO: error: required header not found" >&5 $as_echo "$as_me: error: required header not found" >&2;} { (exit 1); exit 1; }; } fi done for ac_header in langinfo.h locale.h do as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 $as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 $as_echo_n "checking $ac_header usability... " >&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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 $as_echo_n "checking $ac_header presence... " >&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 { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&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 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else $as_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 { $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 $as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 $as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------- ## ## Report this to jin@mediatomb.cc ## ## ------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 $as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi as_val=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF else { $as_echo "$as_me:$LINENO: WARNING: Header that is required to retrieve system locale not found" >&5 $as_echo "$as_me: WARNING: Header that is required to retrieve system locale not found" >&2;} fi done for ac_header in sys/utsname.h do as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 $as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 $as_echo_n "checking $ac_header usability... " >&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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 $as_echo_n "checking $ac_header presence... " >&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 { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&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 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else $as_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 { $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 $as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 $as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------- ## ## Report this to jin@mediatomb.cc ## ## ------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 $as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi as_val=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in sched.h ctype.h do as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 $as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 $as_echo_n "checking $ac_header usability... " >&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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 $as_echo_n "checking $ac_header presence... " >&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 { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&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 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else $as_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 { $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 $as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 $as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------- ## ## Report this to jin@mediatomb.cc ## ## ------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 $as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi as_val=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_func in sched_getparam sched_setparam sched_get_priority_min sched_get_priority_max do as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` { $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 $as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $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 #endif int main () { return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then eval "$as_ac_var=yes" else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval 'as_val=${'$as_ac_var'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } as_val=`eval 'as_val=${'$as_ac_var'} $as_echo "$as_val"'` if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done for ac_func in mkdir do as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` { $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 $as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $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 #endif int main () { return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then eval "$as_ac_var=yes" else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval 'as_val=${'$as_ac_var'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } as_val=`eval 'as_val=${'$as_ac_var'} $as_echo "$as_val"'` if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF else { { $as_echo "$as_me:$LINENO: error: required function not found" >&5 $as_echo "$as_me: error: required function not found" >&2;} { (exit 1); exit 1; }; } fi done for ac_header in getopt.h do as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 $as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 $as_echo_n "checking $ac_header usability... " >&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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 $as_echo_n "checking $ac_header presence... " >&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 { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&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 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else $as_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 { $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 $as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 $as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------- ## ## Report this to jin@mediatomb.cc ## ## ------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 $as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi as_val=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF for ac_func in getopt_long do as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` { $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 $as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $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 #endif int main () { return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then eval "$as_ac_var=yes" else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval 'as_val=${'$as_ac_var'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } as_val=`eval 'as_val=${'$as_ac_var'} $as_echo "$as_val"'` if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF else { $as_echo "$as_me:$LINENO: WARNING: getopt_long not found - all command line options disabled" >&5 $as_echo "$as_me: WARNING: getopt_long not found - all command line options disabled" >&2;} fi done else { $as_echo "$as_me:$LINENO: WARNING: getopt.h not found - all command line options disabled" >&5 $as_echo "$as_me: WARNING: getopt.h not found - all command line options disabled" >&2;} fi done cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, we kill variables containing newlines. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. ( for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:$LINENO: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) $as_unset $ac_var ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes (double-quote # substitution turns \\\\ into \\, and sed turns \\ into \). sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then test "x$cache_file" != "x/dev/null" && { $as_echo "$as_me:$LINENO: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} cat confcache >$cache_file else { $as_echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache CPPFLAGS_SAVE="$CPPFLAGS" CFLAGS_SAVE="$CFLAGS" CXXFLAGS_SAVE="$CXXFLAGS" LDFLAGS_SAVE="$LDFLAGS" if test "x$EXTERNAL_TRANSCODING_OPTION_ENABLED" = xyes; then for ac_func in mkfifo do as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` { $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 $as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $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 #endif int main () { return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then eval "$as_ac_var=yes" else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval 'as_val=${'$as_ac_var'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } as_val=`eval 'as_val=${'$as_ac_var'} $as_echo "$as_val"'` if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF cat >>confdefs.h <<\_ACEOF #define EXTERNAL_TRANSCODING 1 _ACEOF else if test "x$EXTERNAL_TRANSCODING_OPTION_REQUESTED" = xyes; then { { $as_echo "$as_me:$LINENO: error: mkfifo is required by the external transcoding feature" >&5 $as_echo "$as_me: error: mkfifo is required by the external transcoding feature" >&2;} { (exit 1); exit 1; }; } else { $as_echo "$as_me:$LINENO: WARNING: mkfifo is required by the external transcoding feature" >&5 $as_echo "$as_me: WARNING: mkfifo is required by the external transcoding feature" >&2;} EXTERNAL_TRANSCODING_OPTION_ENABLED=disabled fi fi done fi ICONV_CXXFLAGS= ICONV_LIBS= if test -n "$ICONV_SEARCH_HEADERS"; then as_ac_Header=`$as_echo "ac_cv_header_$ICONV_SEARCH_HEADERS/iconv.h" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { $as_echo "$as_me:$LINENO: checking for $ICONV_SEARCH_HEADERS/iconv.h" >&5 $as_echo_n "checking for $ICONV_SEARCH_HEADERS/iconv.h... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:$LINENO: checking $ICONV_SEARCH_HEADERS/iconv.h usability" >&5 $as_echo_n "checking $ICONV_SEARCH_HEADERS/iconv.h usability... " >&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 <$ICONV_SEARCH_HEADERS/iconv.h> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:$LINENO: checking $ICONV_SEARCH_HEADERS/iconv.h presence" >&5 $as_echo_n "checking $ICONV_SEARCH_HEADERS/iconv.h presence... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ICONV_SEARCH_HEADERS/iconv.h> _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&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 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else $as_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 { $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { $as_echo "$as_me:$LINENO: WARNING: $ICONV_SEARCH_HEADERS/iconv.h: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $ICONV_SEARCH_HEADERS/iconv.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ICONV_SEARCH_HEADERS/iconv.h: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $ICONV_SEARCH_HEADERS/iconv.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { $as_echo "$as_me:$LINENO: WARNING: $ICONV_SEARCH_HEADERS/iconv.h: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $ICONV_SEARCH_HEADERS/iconv.h: present but cannot be compiled" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ICONV_SEARCH_HEADERS/iconv.h: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $ICONV_SEARCH_HEADERS/iconv.h: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ICONV_SEARCH_HEADERS/iconv.h: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $ICONV_SEARCH_HEADERS/iconv.h: see the Autoconf documentation" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ICONV_SEARCH_HEADERS/iconv.h: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $ICONV_SEARCH_HEADERS/iconv.h: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ICONV_SEARCH_HEADERS/iconv.h: proceeding with the preprocessor's result" >&5 $as_echo "$as_me: WARNING: $ICONV_SEARCH_HEADERS/iconv.h: proceeding with the preprocessor's result" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ICONV_SEARCH_HEADERS/iconv.h: in the future, the compiler will take precedence" >&5 $as_echo "$as_me: WARNING: $ICONV_SEARCH_HEADERS/iconv.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------- ## ## Report this to jin@mediatomb.cc ## ## ------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { $as_echo "$as_me:$LINENO: checking for $ICONV_SEARCH_HEADERS/iconv.h" >&5 $as_echo_n "checking for $ICONV_SEARCH_HEADERS/iconv.h... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi as_val=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` if test "x$as_val" = x""yes; then ICONV_CXXFLAGS="-I$ICONV_SEARCH_HEADERS" else { { $as_echo "$as_me:$LINENO: error: iconv.h not found in requested location $ICONV_SEARCH_HEADERS" >&5 $as_echo "$as_me: error: iconv.h not found in requested location $ICONV_SEARCH_HEADERS" >&2;} { (exit 1); exit 1; }; } fi else if test "${ac_cv_header_iconv_h+set}" = set; then { $as_echo "$as_me:$LINENO: checking for iconv.h" >&5 $as_echo_n "checking for iconv.h... " >&6; } if test "${ac_cv_header_iconv_h+set}" = set; then $as_echo_n "(cached) " >&6 fi { $as_echo "$as_me:$LINENO: result: $ac_cv_header_iconv_h" >&5 $as_echo "$ac_cv_header_iconv_h" >&6; } else # Is the header compilable? { $as_echo "$as_me:$LINENO: checking iconv.h usability" >&5 $as_echo_n "checking iconv.h usability... " >&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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:$LINENO: checking iconv.h presence" >&5 $as_echo_n "checking iconv.h presence... " >&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 { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&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 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else $as_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 { $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { $as_echo "$as_me:$LINENO: WARNING: iconv.h: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: iconv.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:$LINENO: WARNING: iconv.h: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: iconv.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { $as_echo "$as_me:$LINENO: WARNING: iconv.h: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: iconv.h: present but cannot be compiled" >&2;} { $as_echo "$as_me:$LINENO: WARNING: iconv.h: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: iconv.h: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:$LINENO: WARNING: iconv.h: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: iconv.h: see the Autoconf documentation" >&2;} { $as_echo "$as_me:$LINENO: WARNING: iconv.h: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: iconv.h: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:$LINENO: WARNING: iconv.h: proceeding with the preprocessor's result" >&5 $as_echo "$as_me: WARNING: iconv.h: proceeding with the preprocessor's result" >&2;} { $as_echo "$as_me:$LINENO: WARNING: iconv.h: in the future, the compiler will take precedence" >&5 $as_echo "$as_me: WARNING: iconv.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------- ## ## Report this to jin@mediatomb.cc ## ## ------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { $as_echo "$as_me:$LINENO: checking for iconv.h" >&5 $as_echo_n "checking for iconv.h... " >&6; } if test "${ac_cv_header_iconv_h+set}" = set; then $as_echo_n "(cached) " >&6 else ac_cv_header_iconv_h=$ac_header_preproc fi { $as_echo "$as_me:$LINENO: result: $ac_cv_header_iconv_h" >&5 $as_echo "$ac_cv_header_iconv_h" >&6; } fi if test "x$ac_cv_header_iconv_h" = x""yes; then ICONV_OK=yes else unset ac_cv_header_iconv_h if test "${ac_cv_header__usr_local_include_iconv_h+set}" = set; then { $as_echo "$as_me:$LINENO: checking for /usr/local/include/iconv.h" >&5 $as_echo_n "checking for /usr/local/include/iconv.h... " >&6; } if test "${ac_cv_header__usr_local_include_iconv_h+set}" = set; then $as_echo_n "(cached) " >&6 fi { $as_echo "$as_me:$LINENO: result: $ac_cv_header__usr_local_include_iconv_h" >&5 $as_echo "$ac_cv_header__usr_local_include_iconv_h" >&6; } else # Is the header compilable? { $as_echo "$as_me:$LINENO: checking /usr/local/include/iconv.h usability" >&5 $as_echo_n "checking /usr/local/include/iconv.h usability... " >&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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:$LINENO: checking /usr/local/include/iconv.h presence" >&5 $as_echo_n "checking /usr/local/include/iconv.h presence... " >&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 { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&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 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else $as_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 { $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { $as_echo "$as_me:$LINENO: WARNING: /usr/local/include/iconv.h: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: /usr/local/include/iconv.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:$LINENO: WARNING: /usr/local/include/iconv.h: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: /usr/local/include/iconv.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { $as_echo "$as_me:$LINENO: WARNING: /usr/local/include/iconv.h: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: /usr/local/include/iconv.h: present but cannot be compiled" >&2;} { $as_echo "$as_me:$LINENO: WARNING: /usr/local/include/iconv.h: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: /usr/local/include/iconv.h: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:$LINENO: WARNING: /usr/local/include/iconv.h: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: /usr/local/include/iconv.h: see the Autoconf documentation" >&2;} { $as_echo "$as_me:$LINENO: WARNING: /usr/local/include/iconv.h: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: /usr/local/include/iconv.h: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:$LINENO: WARNING: /usr/local/include/iconv.h: proceeding with the preprocessor's result" >&5 $as_echo "$as_me: WARNING: /usr/local/include/iconv.h: proceeding with the preprocessor's result" >&2;} { $as_echo "$as_me:$LINENO: WARNING: /usr/local/include/iconv.h: in the future, the compiler will take precedence" >&5 $as_echo "$as_me: WARNING: /usr/local/include/iconv.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------- ## ## Report this to jin@mediatomb.cc ## ## ------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { $as_echo "$as_me:$LINENO: checking for /usr/local/include/iconv.h" >&5 $as_echo_n "checking for /usr/local/include/iconv.h... " >&6; } if test "${ac_cv_header__usr_local_include_iconv_h+set}" = set; then $as_echo_n "(cached) " >&6 else ac_cv_header__usr_local_include_iconv_h=$ac_header_preproc fi { $as_echo "$as_me:$LINENO: result: $ac_cv_header__usr_local_include_iconv_h" >&5 $as_echo "$ac_cv_header__usr_local_include_iconv_h" >&6; } fi if test "x$ac_cv_header__usr_local_include_iconv_h" = x""yes; then ICONV_CXXFLAGS="-I/usr/local/include" if test -z "$ICONV_SEARCH_LIBS"; then LDFLAGS="-L/usr/local/lib" fi else unset ac_cv_header_iconv_h as_ac_Header=`$as_echo "ac_cv_header_$SEARCH_DIR_HEADERS/iconv.h" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { $as_echo "$as_me:$LINENO: checking for $SEARCH_DIR_HEADERS/iconv.h" >&5 $as_echo_n "checking for $SEARCH_DIR_HEADERS/iconv.h... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:$LINENO: checking $SEARCH_DIR_HEADERS/iconv.h usability" >&5 $as_echo_n "checking $SEARCH_DIR_HEADERS/iconv.h usability... " >&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 <$SEARCH_DIR_HEADERS/iconv.h> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:$LINENO: checking $SEARCH_DIR_HEADERS/iconv.h presence" >&5 $as_echo_n "checking $SEARCH_DIR_HEADERS/iconv.h presence... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$SEARCH_DIR_HEADERS/iconv.h> _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&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 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else $as_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 { $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { $as_echo "$as_me:$LINENO: WARNING: $SEARCH_DIR_HEADERS/iconv.h: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $SEARCH_DIR_HEADERS/iconv.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $SEARCH_DIR_HEADERS/iconv.h: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $SEARCH_DIR_HEADERS/iconv.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { $as_echo "$as_me:$LINENO: WARNING: $SEARCH_DIR_HEADERS/iconv.h: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $SEARCH_DIR_HEADERS/iconv.h: present but cannot be compiled" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $SEARCH_DIR_HEADERS/iconv.h: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $SEARCH_DIR_HEADERS/iconv.h: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $SEARCH_DIR_HEADERS/iconv.h: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $SEARCH_DIR_HEADERS/iconv.h: see the Autoconf documentation" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $SEARCH_DIR_HEADERS/iconv.h: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $SEARCH_DIR_HEADERS/iconv.h: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $SEARCH_DIR_HEADERS/iconv.h: proceeding with the preprocessor's result" >&5 $as_echo "$as_me: WARNING: $SEARCH_DIR_HEADERS/iconv.h: proceeding with the preprocessor's result" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $SEARCH_DIR_HEADERS/iconv.h: in the future, the compiler will take precedence" >&5 $as_echo "$as_me: WARNING: $SEARCH_DIR_HEADERS/iconv.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------- ## ## Report this to jin@mediatomb.cc ## ## ------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { $as_echo "$as_me:$LINENO: checking for $SEARCH_DIR_HEADERS/iconv.h" >&5 $as_echo_n "checking for $SEARCH_DIR_HEADERS/iconv.h... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi as_val=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` if test "x$as_val" = x""yes; then ICONV_CXXFLAGS="-I$SEARCH_DIR_HEADERS" if test -z "$ICONV_SEARCH_LIBS"; then LDFLAGS="-L$SEARCH_DIR_LIBS" fi else { { $as_echo "$as_me:$LINENO: error: required header iconv.h not found on your system" >&5 $as_echo "$as_me: error: required header iconv.h not found on your system" >&2;} { (exit 1); exit 1; }; } fi fi fi fi LIBICONV=0 if test -n "$ICONV_SEARCH_LIBS"; then if test "x$ICONV_LIB_OPTION_ENABLED" = xno; then LDFLAGS="-L$ICONV_SEARCH_LIBS" { $as_echo "$as_me:$LINENO: checking for iconv" >&5 $as_echo_n "checking for iconv... " >&6; } if test "${ac_cv_func_iconv+set}" = set; then $as_echo_n "(cached) " >&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 iconv to an innocuous variant, in case declares iconv. For example, HP-UX 11i declares gettimeofday. */ #define iconv innocuous_iconv /* System header to define __stub macros and hopefully few prototypes, which can conflict with char iconv (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef iconv /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char iconv (); /* 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_iconv || defined __stub___iconv choke me #endif int main () { return iconv (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_func_iconv=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_iconv=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi { $as_echo "$as_me:$LINENO: result: $ac_cv_func_iconv" >&5 $as_echo "$ac_cv_func_iconv" >&6; } if test "x$ac_cv_func_iconv" = x""yes; then ICONV_LIBS="-L$ICONV_SEARCH_LIBS" else LDFLAGS="-L$ICONV_SEARCH_LIBS -liconv" { $as_echo "$as_me:$LINENO: checking for iconv in -liconv" >&5 $as_echo_n "checking for iconv in -liconv... " >&6; } if test "${ac_cv_lib_iconv_iconv+set}" = set; then $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-liconv $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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char iconv (); int main () { return iconv (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_lib_iconv_iconv=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_iconv_iconv=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_iconv_iconv" >&5 $as_echo "$ac_cv_lib_iconv_iconv" >&6; } if test "x$ac_cv_lib_iconv_iconv" = x""yes; then ICONV_LIBS="-L$ICONV_SEARCH_LIBS -liconv" LIBICONV=1 else { $as_echo "$as_me:$LINENO: checking for libiconv in -liconv" >&5 $as_echo_n "checking for libiconv in -liconv... " >&6; } if test "${ac_cv_lib_iconv_libiconv+set}" = set; then $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-liconv $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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libiconv (); int main () { return libiconv (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_lib_iconv_libiconv=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_iconv_libiconv=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_iconv_libiconv" >&5 $as_echo "$ac_cv_lib_iconv_libiconv" >&6; } if test "x$ac_cv_lib_iconv_libiconv" = x""yes; then ICONV_LIBS="-L$ICONV_SEARCH_LIBS -liconv" LIBICONV=1 else { { $as_echo "$as_me:$LINENO: error: required library iconv not found in requested location $ICONV_SEARCH_LIBS" >&5 $as_echo "$as_me: error: required library iconv not found in requested location $ICONV_SEARCH_LIBS" >&2;} { (exit 1); exit 1; }; } fi fi fi else LDFLAGS="-L$ICONV_SEARCH_LIBS -liconv" { $as_echo "$as_me:$LINENO: checking for iconv in -liconv" >&5 $as_echo_n "checking for iconv in -liconv... " >&6; } if test "${ac_cv_lib_iconv_iconv+set}" = set; then $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-liconv $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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char iconv (); int main () { return iconv (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_lib_iconv_iconv=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_iconv_iconv=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_iconv_iconv" >&5 $as_echo "$ac_cv_lib_iconv_iconv" >&6; } if test "x$ac_cv_lib_iconv_iconv" = x""yes; then ICONV_LIBS="-L$ICONV_SEARCH_LIBS -liconv" LIBICONV=1 else { { $as_echo "$as_me:$LINENO: error: You specified to use libiconv but it was not found in the requested location $ICONV_SEARCH_LIBS" >&5 $as_echo "$as_me: error: You specified to use libiconv but it was not found in the requested location $ICONV_SEARCH_LIBS" >&2;} { (exit 1); exit 1; }; } fi fi else if test "x$ICONV_LIB_OPTION_ENABLED" = xno; then { $as_echo "$as_me:$LINENO: checking for iconv" >&5 $as_echo_n "checking for iconv... " >&6; } if test "${ac_cv_func_iconv+set}" = set; then $as_echo_n "(cached) " >&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 iconv to an innocuous variant, in case declares iconv. For example, HP-UX 11i declares gettimeofday. */ #define iconv innocuous_iconv /* System header to define __stub macros and hopefully few prototypes, which can conflict with char iconv (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef iconv /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char iconv (); /* 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_iconv || defined __stub___iconv choke me #endif int main () { return iconv (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_func_iconv=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_iconv=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi { $as_echo "$as_me:$LINENO: result: $ac_cv_func_iconv" >&5 $as_echo "$ac_cv_func_iconv" >&6; } if test "x$ac_cv_func_iconv" = x""yes; then ICONV_LIBS="$LDFLAGS" else LDFLAGS="$LDFLAGS -liconv" { $as_echo "$as_me:$LINENO: checking for iconv in -liconv" >&5 $as_echo_n "checking for iconv in -liconv... " >&6; } if test "${ac_cv_lib_iconv_iconv+set}" = set; then $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-liconv $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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char iconv (); int main () { return iconv (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_lib_iconv_iconv=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_iconv_iconv=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_iconv_iconv" >&5 $as_echo "$ac_cv_lib_iconv_iconv" >&6; } if test "x$ac_cv_lib_iconv_iconv" = x""yes; then ICONV_LIBS="$LDFLAGS" LIBICONV=1 else { $as_echo "$as_me:$LINENO: checking for libiconv in -liconv" >&5 $as_echo_n "checking for libiconv in -liconv... " >&6; } if test "${ac_cv_lib_iconv_libiconv+set}" = set; then $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-liconv $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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libiconv (); int main () { return libiconv (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_lib_iconv_libiconv=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_iconv_libiconv=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_iconv_libiconv" >&5 $as_echo "$ac_cv_lib_iconv_libiconv" >&6; } if test "x$ac_cv_lib_iconv_libiconv" = x""yes; then ICONV_LIBS="$LDFLAGS" LIBICONV=1 else { { $as_echo "$as_me:$LINENO: error: required library iconv not found on your system" >&5 $as_echo "$as_me: error: required library iconv not found on your system" >&2;} { (exit 1); exit 1; }; } fi fi fi else LDFLAGS="$LDFLAGS -liconv" { $as_echo "$as_me:$LINENO: checking for iconv in -liconv" >&5 $as_echo_n "checking for iconv in -liconv... " >&6; } if test "${ac_cv_lib_iconv_iconv+set}" = set; then $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-liconv $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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char iconv (); int main () { return iconv (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_lib_iconv_iconv=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_iconv_iconv=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_iconv_iconv" >&5 $as_echo "$ac_cv_lib_iconv_iconv" >&6; } if test "x$ac_cv_lib_iconv_iconv" = x""yes; then ICONV_LIBS="$LDFLAGS" LIBICONV=1 else { { $as_echo "$as_me:$LINENO: error: You specified to use libiconv but the library was not found" >&5 $as_echo "$as_me: error: You specified to use libiconv but the library was not found" >&2;} { (exit 1); exit 1; }; } fi fi fi if test $LIBICONV -eq 1; then cat >>confdefs.h <<\_ACEOF #define HAVE_LIBICONV 1 _ACEOF fi CFLAGS="$CFLAGS $ICONV_CXXFLAGS -Werror" { $as_echo "$as_me:$LINENO: checking if iconv declaration requires const char cast" >&5 $as_echo_n "checking if iconv declaration requires const char cast... " >&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 () { char **ptr = NULL; size_t len; iconv_t cd = NULL; (void)iconv(cd, ptr, &len, ptr, &len); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >>confdefs.h <<\_ACEOF #define ICONV_CONST 1 _ACEOF { $as_echo "$as_me:$LINENO: result: yes" >&5 $as_echo "yes" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext CFLAGS="$CFLAGS_SAVE" CXXFLAGS="$CXXFLAGS_SAVE" LDFLAGS="$LDFLAGS_SAVE" for ac_header in execinfo.h do as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 $as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 $as_echo_n "checking $ac_header usability... " >&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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 $as_echo_n "checking $ac_header presence... " >&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 { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&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 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else $as_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 { $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 $as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 $as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------- ## ## Report this to jin@mediatomb.cc ## ## ------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 $as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi as_val=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done { $as_echo "$as_me:$LINENO: checking for time_t" >&5 $as_echo_n "checking for time_t... " >&6; } if test "${ac_cv_type_time_t+set}" = set; then $as_echo_n "(cached) " >&6 else ac_cv_type_time_t=no 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 () { if (sizeof (time_t)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then 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 () { if (sizeof ((time_t))) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_time_t=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:$LINENO: result: $ac_cv_type_time_t" >&5 $as_echo "$ac_cv_type_time_t" >&6; } if test "x$ac_cv_type_time_t" = x""yes; then cat >>confdefs.h <<_ACEOF #define HAVE_TIME_T 1 _ACEOF fi cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, we kill variables containing newlines. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. ( for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:$LINENO: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) $as_unset $ac_var ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes (double-quote # substitution turns \\\\ into \\, and sed turns \\ into \). sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then test "x$cache_file" != "x/dev/null" && { $as_echo "$as_me:$LINENO: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} cat confcache >$cache_file else { $as_echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache # Check whether --enable-largefile was given. if test "${enable_largefile+set}" = set; then enableval=$enable_largefile; fi if test "$enable_largefile" != no; then { $as_echo "$as_me:$LINENO: checking for special C compiler options needed for large files" >&5 $as_echo_n "checking for special C compiler options needed for large files... " >&6; } if test "${ac_cv_sys_largefile_CC+set}" = set; then $as_echo_n "(cached) " >&6 else ac_cv_sys_largefile_CC=no if test "$GCC" != yes; then ac_save_CC=$CC while :; do # IRIX 6.2 and later do not support large files by default, # so use the C compiler's -n32 option if that helps. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include /* Check that off_t can represent 2**63 - 1 correctly. We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then break else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext CC="$CC -n32" rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_sys_largefile_CC=' -n32'; break else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext break done CC=$ac_save_CC rm -f conftest.$ac_ext fi fi { $as_echo "$as_me:$LINENO: result: $ac_cv_sys_largefile_CC" >&5 $as_echo "$ac_cv_sys_largefile_CC" >&6; } if test "$ac_cv_sys_largefile_CC" != no; then CC=$CC$ac_cv_sys_largefile_CC fi { $as_echo "$as_me:$LINENO: checking for _FILE_OFFSET_BITS value needed for large files" >&5 $as_echo_n "checking for _FILE_OFFSET_BITS value needed for large files... " >&6; } if test "${ac_cv_sys_file_offset_bits+set}" = set; then $as_echo_n "(cached) " >&6 else while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include /* Check that off_t can represent 2**63 - 1 correctly. We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_sys_file_offset_bits=no; break else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core 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. */ #define _FILE_OFFSET_BITS 64 #include /* Check that off_t can represent 2**63 - 1 correctly. We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_sys_file_offset_bits=64; break else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_sys_file_offset_bits=unknown break done fi { $as_echo "$as_me:$LINENO: result: $ac_cv_sys_file_offset_bits" >&5 $as_echo "$ac_cv_sys_file_offset_bits" >&6; } case $ac_cv_sys_file_offset_bits in #( no | unknown) ;; *) cat >>confdefs.h <<_ACEOF #define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits _ACEOF ;; esac rm -rf conftest* if test $ac_cv_sys_file_offset_bits = unknown; then { $as_echo "$as_me:$LINENO: checking for _LARGE_FILES value needed for large files" >&5 $as_echo_n "checking for _LARGE_FILES value needed for large files... " >&6; } if test "${ac_cv_sys_large_files+set}" = set; then $as_echo_n "(cached) " >&6 else while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include /* Check that off_t can represent 2**63 - 1 correctly. We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_sys_large_files=no; break else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core 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. */ #define _LARGE_FILES 1 #include /* Check that off_t can represent 2**63 - 1 correctly. We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_sys_large_files=1; break else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_sys_large_files=unknown break done fi { $as_echo "$as_me:$LINENO: result: $ac_cv_sys_large_files" >&5 $as_echo "$ac_cv_sys_large_files" >&6; } case $ac_cv_sys_large_files in #( no | unknown) ;; *) cat >>confdefs.h <<_ACEOF #define _LARGE_FILES $ac_cv_sys_large_files _ACEOF ;; esac rm -rf conftest* fi fi { $as_echo "$as_me:$LINENO: checking for off_t" >&5 $as_echo_n "checking for off_t... " >&6; } if test "${ac_cv_type_off_t+set}" = set; then $as_echo_n "(cached) " >&6 else ac_cv_type_off_t=no 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 int main () { if (sizeof (off_t)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then 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 int main () { if (sizeof ((off_t))) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_off_t=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:$LINENO: result: $ac_cv_type_off_t" >&5 $as_echo "$ac_cv_type_off_t" >&6; } if test "x$ac_cv_type_off_t" = x""yes; then : else cat >>confdefs.h <<_ACEOF #define off_t long int _ACEOF fi { $as_echo "$as_me:$LINENO: checking for size_t" >&5 $as_echo_n "checking for size_t... " >&6; } if test "${ac_cv_type_size_t+set}" = set; then $as_echo_n "(cached) " >&6 else ac_cv_type_size_t=no 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 int main () { if (sizeof (size_t)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then 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 int main () { if (sizeof ((size_t))) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_size_t=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5 $as_echo "$ac_cv_type_size_t" >&6; } if test "x$ac_cv_type_size_t" = x""yes; then : else cat >>confdefs.h <<_ACEOF #define size_t unsigned int _ACEOF fi #AC_CHECK_TYPES([ssize_t], [], [], [#include ]) if test "x$FSEEKO_CHECK_OPTION_ENABLED" = xyes; then { $as_echo "$as_me:$LINENO: checking for _LARGEFILE_SOURCE value needed for large files" >&5 $as_echo_n "checking for _LARGEFILE_SOURCE value needed for large files... " >&6; } if test "${ac_cv_sys_largefile_source+set}" = set; then $as_echo_n "(cached) " >&6 else while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include /* for off_t */ #include int main () { int (*fp) (FILE *, off_t, int) = fseeko; return fseeko (stdin, 0, 0) && fp (stdin, 0, 0); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_sys_largefile_source=no; break else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext 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. */ #define _LARGEFILE_SOURCE 1 #include /* for off_t */ #include int main () { int (*fp) (FILE *, off_t, int) = fseeko; return fseeko (stdin, 0, 0) && fp (stdin, 0, 0); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_sys_largefile_source=1; break else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext ac_cv_sys_largefile_source=unknown break done fi { $as_echo "$as_me:$LINENO: result: $ac_cv_sys_largefile_source" >&5 $as_echo "$ac_cv_sys_largefile_source" >&6; } case $ac_cv_sys_largefile_source in #( no | unknown) ;; *) cat >>confdefs.h <<_ACEOF #define _LARGEFILE_SOURCE $ac_cv_sys_largefile_source _ACEOF ;; esac rm -rf conftest* # We used to try defining _XOPEN_SOURCE=500 too, to work around a bug # in glibc 2.1.3, but that breaks too many other things. # If you want fseeko and ftello with glibc, upgrade to a fixed glibc. if test $ac_cv_sys_largefile_source != unknown; then cat >>confdefs.h <<\_ACEOF #define HAVE_FSEEKO 1 _ACEOF fi if test "$ac_cv_func_fseeko" = no || test "$ac_cv_sys_largefile_source" = unknown; then { $as_echo "$as_me:$LINENO: WARNING: fseeko has not been found on your system, will use fseek instead." >&5 $as_echo "$as_me: WARNING: fseeko has not been found on your system, will use fseek instead." >&2;} { $as_echo "$as_me:$LINENO: WARNING: This has not been tested, please report if you have any problems." >&5 $as_echo "$as_me: WARNING: This has not been tested, please report if you have any problems." >&2;} cat >>confdefs.h <<\_ACEOF #define fseeko fseek _ACEOF fi else { $as_echo "$as_me:$LINENO: WARNING: Skipping fseeko test! (requested by user)" >&5 $as_echo "$as_me: WARNING: Skipping fseeko test! (requested by user)" >&2;} fi # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { $as_echo "$as_me:$LINENO: checking size of off_t" >&5 $as_echo_n "checking size of off_t... " >&6; } if test "${ac_cv_sizeof_off_t+set}" = set; then $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. 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 int main () { static int test_array [1 - 2 * !(((long int) (sizeof (off_t))) >= 0)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=0 ac_mid=0 while :; do 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 int main () { static int test_array [1 - 2 * !(((long int) (sizeof (off_t))) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` if test $ac_lo -le $ac_mid; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid + 1` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 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 int main () { static int test_array [1 - 2 * !(((long int) (sizeof (off_t))) < 0)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=-1 ac_mid=-1 while :; do 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 int main () { static int test_array [1 - 2 * !(((long int) (sizeof (off_t))) >= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` if test $ac_mid -le $ac_hi; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` 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 int main () { static int test_array [1 - 2 * !(((long int) (sizeof (off_t))) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in ?*) ac_cv_sizeof_off_t=$ac_lo;; '') if test "$ac_cv_type_off_t" = yes; then { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (off_t) See \`config.log' for more details." >&5 $as_echo "$as_me: error: cannot compute sizeof (off_t) See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; }; } else ac_cv_sizeof_off_t=0 fi ;; esac 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 static long int longval () { return (long int) (sizeof (off_t)); } static unsigned long int ulongval () { return (long int) (sizeof (off_t)); } #include #include int main () { FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; if (((long int) (sizeof (off_t))) < 0) { long int i = longval (); if (i != ((long int) (sizeof (off_t)))) return 1; fprintf (f, "%ld", i); } else { unsigned long int i = ulongval (); if (i != ((long int) (sizeof (off_t)))) return 1; fprintf (f, "%lu", i); } /* Do not output a trailing newline, as this causes \r\n confusion on some platforms. */ return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_off_t=`cat conftest.val` else $as_echo "$as_me: program exited with status $ac_status" >&5 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) if test "$ac_cv_type_off_t" = yes; then { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (off_t) See \`config.log' for more details." >&5 $as_echo "$as_me: error: cannot compute sizeof (off_t) See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; }; } else ac_cv_sizeof_off_t=0 fi fi rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val fi { $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof_off_t" >&5 $as_echo "$ac_cv_sizeof_off_t" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_OFF_T $ac_cv_sizeof_off_t _ACEOF # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { $as_echo "$as_me:$LINENO: checking size of size_t" >&5 $as_echo_n "checking size of size_t... " >&6; } if test "${ac_cv_sizeof_size_t+set}" = set; then $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. 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 int main () { static int test_array [1 - 2 * !(((long int) (sizeof (size_t))) >= 0)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=0 ac_mid=0 while :; do 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 int main () { static int test_array [1 - 2 * !(((long int) (sizeof (size_t))) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` if test $ac_lo -le $ac_mid; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid + 1` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 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 int main () { static int test_array [1 - 2 * !(((long int) (sizeof (size_t))) < 0)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=-1 ac_mid=-1 while :; do 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 int main () { static int test_array [1 - 2 * !(((long int) (sizeof (size_t))) >= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` if test $ac_mid -le $ac_hi; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` 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 int main () { static int test_array [1 - 2 * !(((long int) (sizeof (size_t))) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in ?*) ac_cv_sizeof_size_t=$ac_lo;; '') if test "$ac_cv_type_size_t" = yes; then { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (size_t) See \`config.log' for more details." >&5 $as_echo "$as_me: error: cannot compute sizeof (size_t) See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; }; } else ac_cv_sizeof_size_t=0 fi ;; esac 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 static long int longval () { return (long int) (sizeof (size_t)); } static unsigned long int ulongval () { return (long int) (sizeof (size_t)); } #include #include int main () { FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; if (((long int) (sizeof (size_t))) < 0) { long int i = longval (); if (i != ((long int) (sizeof (size_t)))) return 1; fprintf (f, "%ld", i); } else { unsigned long int i = ulongval (); if (i != ((long int) (sizeof (size_t)))) return 1; fprintf (f, "%lu", i); } /* Do not output a trailing newline, as this causes \r\n confusion on some platforms. */ return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_size_t=`cat conftest.val` else $as_echo "$as_me: program exited with status $ac_status" >&5 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) if test "$ac_cv_type_size_t" = yes; then { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (size_t) See \`config.log' for more details." >&5 $as_echo "$as_me: error: cannot compute sizeof (size_t) See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; }; } else ac_cv_sizeof_size_t=0 fi fi rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val fi { $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof_size_t" >&5 $as_echo "$ac_cv_sizeof_size_t" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_SIZE_T $ac_cv_sizeof_size_t _ACEOF # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { $as_echo "$as_me:$LINENO: checking size of time_t" >&5 $as_echo_n "checking size of time_t... " >&6; } if test "${ac_cv_sizeof_time_t+set}" = set; then $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. 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 int main () { static int test_array [1 - 2 * !(((long int) (sizeof (time_t))) >= 0)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=0 ac_mid=0 while :; do 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 int main () { static int test_array [1 - 2 * !(((long int) (sizeof (time_t))) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` if test $ac_lo -le $ac_mid; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid + 1` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 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 int main () { static int test_array [1 - 2 * !(((long int) (sizeof (time_t))) < 0)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=-1 ac_mid=-1 while :; do 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 int main () { static int test_array [1 - 2 * !(((long int) (sizeof (time_t))) >= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` if test $ac_mid -le $ac_hi; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` 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 int main () { static int test_array [1 - 2 * !(((long int) (sizeof (time_t))) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in ?*) ac_cv_sizeof_time_t=$ac_lo;; '') if test "$ac_cv_type_time_t" = yes; then { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (time_t) See \`config.log' for more details." >&5 $as_echo "$as_me: error: cannot compute sizeof (time_t) See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; }; } else ac_cv_sizeof_time_t=0 fi ;; esac 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 static long int longval () { return (long int) (sizeof (time_t)); } static unsigned long int ulongval () { return (long int) (sizeof (time_t)); } #include #include int main () { FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; if (((long int) (sizeof (time_t))) < 0) { long int i = longval (); if (i != ((long int) (sizeof (time_t)))) return 1; fprintf (f, "%ld", i); } else { unsigned long int i = ulongval (); if (i != ((long int) (sizeof (time_t)))) return 1; fprintf (f, "%lu", i); } /* Do not output a trailing newline, as this causes \r\n confusion on some platforms. */ return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_time_t=`cat conftest.val` else $as_echo "$as_me: program exited with status $ac_status" >&5 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) if test "$ac_cv_type_time_t" = yes; then { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (time_t) See \`config.log' for more details." >&5 $as_echo "$as_me: error: cannot compute sizeof (time_t) See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; }; } else ac_cv_sizeof_time_t=0 fi fi rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val fi { $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof_time_t" >&5 $as_echo "$ac_cv_sizeof_time_t" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_TIME_T $ac_cv_sizeof_time_t _ACEOF # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { $as_echo "$as_me:$LINENO: checking size of unsigned int" >&5 $as_echo_n "checking size of unsigned int... " >&6; } if test "${ac_cv_sizeof_unsigned_int+set}" = set; then $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. 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 int main () { static int test_array [1 - 2 * !(((long int) (sizeof (unsigned int))) >= 0)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=0 ac_mid=0 while :; do 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 int main () { static int test_array [1 - 2 * !(((long int) (sizeof (unsigned int))) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` if test $ac_lo -le $ac_mid; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid + 1` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 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 int main () { static int test_array [1 - 2 * !(((long int) (sizeof (unsigned int))) < 0)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=-1 ac_mid=-1 while :; do 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 int main () { static int test_array [1 - 2 * !(((long int) (sizeof (unsigned int))) >= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` if test $ac_mid -le $ac_hi; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` 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 int main () { static int test_array [1 - 2 * !(((long int) (sizeof (unsigned int))) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in ?*) ac_cv_sizeof_unsigned_int=$ac_lo;; '') if test "$ac_cv_type_unsigned_int" = yes; then { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (unsigned int) See \`config.log' for more details." >&5 $as_echo "$as_me: error: cannot compute sizeof (unsigned int) See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; }; } else ac_cv_sizeof_unsigned_int=0 fi ;; esac 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 static long int longval () { return (long int) (sizeof (unsigned int)); } static unsigned long int ulongval () { return (long int) (sizeof (unsigned int)); } #include #include int main () { FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; if (((long int) (sizeof (unsigned int))) < 0) { long int i = longval (); if (i != ((long int) (sizeof (unsigned int)))) return 1; fprintf (f, "%ld", i); } else { unsigned long int i = ulongval (); if (i != ((long int) (sizeof (unsigned int)))) return 1; fprintf (f, "%lu", i); } /* Do not output a trailing newline, as this causes \r\n confusion on some platforms. */ return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_unsigned_int=`cat conftest.val` else $as_echo "$as_me: program exited with status $ac_status" >&5 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) if test "$ac_cv_type_unsigned_int" = yes; then { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (unsigned int) See \`config.log' for more details." >&5 $as_echo "$as_me: error: cannot compute sizeof (unsigned int) See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; }; } else ac_cv_sizeof_unsigned_int=0 fi fi rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val fi { $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof_unsigned_int" >&5 $as_echo "$ac_cv_sizeof_unsigned_int" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_UNSIGNED_INT $ac_cv_sizeof_unsigned_int _ACEOF # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { $as_echo "$as_me:$LINENO: checking size of unsigned long" >&5 $as_echo_n "checking size of unsigned long... " >&6; } if test "${ac_cv_sizeof_unsigned_long+set}" = set; then $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. 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 int main () { static int test_array [1 - 2 * !(((long int) (sizeof (unsigned long))) >= 0)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=0 ac_mid=0 while :; do 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 int main () { static int test_array [1 - 2 * !(((long int) (sizeof (unsigned long))) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` if test $ac_lo -le $ac_mid; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid + 1` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 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 int main () { static int test_array [1 - 2 * !(((long int) (sizeof (unsigned long))) < 0)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=-1 ac_mid=-1 while :; do 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 int main () { static int test_array [1 - 2 * !(((long int) (sizeof (unsigned long))) >= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` if test $ac_mid -le $ac_hi; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` 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 int main () { static int test_array [1 - 2 * !(((long int) (sizeof (unsigned long))) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in ?*) ac_cv_sizeof_unsigned_long=$ac_lo;; '') if test "$ac_cv_type_unsigned_long" = yes; then { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (unsigned long) See \`config.log' for more details." >&5 $as_echo "$as_me: error: cannot compute sizeof (unsigned long) See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; }; } else ac_cv_sizeof_unsigned_long=0 fi ;; esac 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 static long int longval () { return (long int) (sizeof (unsigned long)); } static unsigned long int ulongval () { return (long int) (sizeof (unsigned long)); } #include #include int main () { FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; if (((long int) (sizeof (unsigned long))) < 0) { long int i = longval (); if (i != ((long int) (sizeof (unsigned long)))) return 1; fprintf (f, "%ld", i); } else { unsigned long int i = ulongval (); if (i != ((long int) (sizeof (unsigned long)))) return 1; fprintf (f, "%lu", i); } /* Do not output a trailing newline, as this causes \r\n confusion on some platforms. */ return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_unsigned_long=`cat conftest.val` else $as_echo "$as_me: program exited with status $ac_status" >&5 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) if test "$ac_cv_type_unsigned_long" = yes; then { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (unsigned long) See \`config.log' for more details." >&5 $as_echo "$as_me: error: cannot compute sizeof (unsigned long) See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; }; } else ac_cv_sizeof_unsigned_long=0 fi fi rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val fi { $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof_unsigned_long" >&5 $as_echo "$ac_cv_sizeof_unsigned_long" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_UNSIGNED_LONG $ac_cv_sizeof_unsigned_long _ACEOF for ac_func in strtoll nl_langinfo setlocale do as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` { $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 $as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $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 #endif int main () { return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then eval "$as_ac_var=yes" else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval 'as_val=${'$as_ac_var'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } as_val=`eval 'as_val=${'$as_ac_var'} $as_echo "$as_val"'` if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done for ac_func in backtrace backtrace_symbols do as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` { $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 $as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $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 #endif int main () { return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then eval "$as_ac_var=yes" else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval 'as_val=${'$as_ac_var'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } as_val=`eval 'as_val=${'$as_ac_var'} $as_echo "$as_val"'` if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done # Checks for typedefs, structures, and compiler characteristics. { $as_echo "$as_me:$LINENO: checking for an ANSI C-conforming const" >&5 $as_echo_n "checking for an ANSI C-conforming const... " >&6; } if test "${ac_cv_c_const+set}" = set; then $as_echo_n "(cached) " >&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 cs; /* SunOS 4.1.1 cc rejects this. */ char const *const *pcpcc; char **ppc; /* NEC SVR4.0.2 mips cc rejects this. */ struct point {int x, y;}; static struct point const zero = {0,0}; /* AIX XL C 1.02.0.0 rejects this. It does not let you subtract one const X* pointer from another in an arm of an if-expression whose if-part is not a constant expression */ const char *g = "string"; pcpcc = &g + (g ? g-g : 0); /* HPUX 7.0 cc rejects these. */ ++pcpcc; ppc = (char**) pcpcc; pcpcc = (char const *const *) ppc; { /* SCO 3.2v4 cc rejects this. */ char *t; char const *s = 0 ? (char *) 0 : (char const *) 0; *t++ = 0; if (s) return 0; } { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ int x[] = {25, 17}; const int *foo = &x[0]; ++foo; } { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ typedef const int *iptr; iptr p = 0; ++p; } { /* AIX XL C 1.02.0.0 rejects this 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; if (!foo) return 0; } return !cs[0] && !zero.x; #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_c_const=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_c_const=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:$LINENO: result: $ac_cv_c_const" >&5 $as_echo "$ac_cv_c_const" >&6; } if test $ac_cv_c_const = no; then cat >>confdefs.h <<\_ACEOF #define const /**/ _ACEOF fi { $as_echo "$as_me:$LINENO: checking for inline" >&5 $as_echo_n "checking for inline... " >&6; } if test "${ac_cv_c_inline+set}" = set; then $as_echo_n "(cached) " >&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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_c_inline=$ac_kw else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext test "$ac_cv_c_inline" != no && break done fi { $as_echo "$as_me:$LINENO: result: $ac_cv_c_inline" >&5 $as_echo "$ac_cv_c_inline" >&6; } case $ac_cv_c_inline in inline | yes) ;; *) case $ac_cv_c_inline in no) ac_val=;; *) ac_val=$ac_cv_c_inline;; esac cat >>confdefs.h <<_ACEOF #ifndef __cplusplus #define inline $ac_val #endif _ACEOF ;; esac { $as_echo "$as_me:$LINENO: checking for working volatile" >&5 $as_echo_n "checking for working volatile... " >&6; } if test "${ac_cv_c_volatile+set}" = set; then $as_echo_n "(cached) " >&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 () { volatile int x; int * volatile y = (int *) 0; return !x && !y; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_c_volatile=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_c_volatile=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:$LINENO: result: $ac_cv_c_volatile" >&5 $as_echo "$ac_cv_c_volatile" >&6; } if test $ac_cv_c_volatile = no; then cat >>confdefs.h <<\_ACEOF #define volatile /**/ _ACEOF fi { $as_echo "$as_me:$LINENO: checking return type of signal handlers" >&5 $as_echo_n "checking return type of signal handlers... " >&6; } if test "${ac_cv_type_signal+set}" = set; then $as_echo_n "(cached) " >&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 int main () { return *(signal (0, 0)) (0) == 1; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_type_signal=int else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_signal=void fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:$LINENO: result: $ac_cv_type_signal" >&5 $as_echo "$ac_cv_type_signal" >&6; } cat >>confdefs.h <<_ACEOF #define RETSIGTYPE $ac_cv_type_signal _ACEOF { $as_echo "$as_me:$LINENO: checking for pid_t" >&5 $as_echo_n "checking for pid_t... " >&6; } if test "${ac_cv_type_pid_t+set}" = set; then $as_echo_n "(cached) " >&6 else ac_cv_type_pid_t=no 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 int main () { if (sizeof (pid_t)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then 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 int main () { if (sizeof ((pid_t))) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_pid_t=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:$LINENO: result: $ac_cv_type_pid_t" >&5 $as_echo "$ac_cv_type_pid_t" >&6; } if test "x$ac_cv_type_pid_t" = x""yes; then : else cat >>confdefs.h <<_ACEOF #define pid_t int _ACEOF fi { $as_echo "$as_me:$LINENO: checking for size_t" >&5 $as_echo_n "checking for size_t... " >&6; } if test "${ac_cv_type_size_t+set}" = set; then $as_echo_n "(cached) " >&6 else ac_cv_type_size_t=no 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 int main () { if (sizeof (size_t)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then 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 int main () { if (sizeof ((size_t))) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_size_t=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5 $as_echo "$ac_cv_type_size_t" >&6; } if test "x$ac_cv_type_size_t" = x""yes; then : else cat >>confdefs.h <<_ACEOF #define size_t unsigned int _ACEOF fi { $as_echo "$as_me:$LINENO: checking for int64_t" >&5 $as_echo_n "checking for int64_t... " >&6; } if test "${ac_cv_c_int64_t+set}" = set; then $as_echo_n "(cached) " >&6 else ac_cv_c_int64_t=no for ac_type in 'int64_t' 'int' 'long int' \ 'long long int' 'short int' 'signed char'; do 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 int main () { static int test_array [1 - 2 * !(0 < ($ac_type) (((($ac_type) 1 << (64 - 2)) - 1) * 2 + 1))]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then 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 int main () { static int test_array [1 - 2 * !(($ac_type) (((($ac_type) 1 << (64 - 2)) - 1) * 2 + 1) < ($ac_type) (((($ac_type) 1 << (64 - 2)) - 1) * 2 + 2))]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 case $ac_type in int64_t) ac_cv_c_int64_t=yes ;; *) ac_cv_c_int64_t=$ac_type ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext test "$ac_cv_c_int64_t" != no && break done fi { $as_echo "$as_me:$LINENO: result: $ac_cv_c_int64_t" >&5 $as_echo "$ac_cv_c_int64_t" >&6; } case $ac_cv_c_int64_t in #( no|yes) ;; #( *) cat >>confdefs.h <<_ACEOF #define int64_t $ac_cv_c_int64_t _ACEOF ;; esac { $as_echo "$as_me:$LINENO: checking for ssize_t" >&5 $as_echo_n "checking for ssize_t... " >&6; } if test "${ac_cv_type_ssize_t+set}" = set; then $as_echo_n "(cached) " >&6 else ac_cv_type_ssize_t=no 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 int main () { if (sizeof (ssize_t)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then 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 int main () { if (sizeof ((ssize_t))) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_ssize_t=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:$LINENO: result: $ac_cv_type_ssize_t" >&5 $as_echo "$ac_cv_type_ssize_t" >&6; } if test "x$ac_cv_type_ssize_t" = x""yes; then : else cat >>confdefs.h <<_ACEOF #define ssize_t int _ACEOF fi { $as_echo "$as_me:$LINENO: checking for uint32_t" >&5 $as_echo_n "checking for uint32_t... " >&6; } if test "${ac_cv_c_uint32_t+set}" = set; then $as_echo_n "(cached) " >&6 else ac_cv_c_uint32_t=no for ac_type in 'uint32_t' 'unsigned int' 'unsigned long int' \ 'unsigned long long int' 'unsigned short int' 'unsigned char'; do 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 int main () { static int test_array [1 - 2 * !(($ac_type) -1 >> (32 - 1) == 1)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then case $ac_type in uint32_t) ac_cv_c_uint32_t=yes ;; *) ac_cv_c_uint32_t=$ac_type ;; esac else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext test "$ac_cv_c_uint32_t" != no && break done fi { $as_echo "$as_me:$LINENO: result: $ac_cv_c_uint32_t" >&5 $as_echo "$ac_cv_c_uint32_t" >&6; } case $ac_cv_c_uint32_t in #( no|yes) ;; #( *) cat >>confdefs.h <<\_ACEOF #define _UINT32_T 1 _ACEOF cat >>confdefs.h <<_ACEOF #define uint32_t $ac_cv_c_uint32_t _ACEOF ;; esac { $as_echo "$as_me:$LINENO: checking whether struct tm is in sys/time.h or time.h" >&5 $as_echo_n "checking whether struct tm is in sys/time.h or time.h... " >&6; } if test "${ac_cv_struct_tm+set}" = set; then $as_echo_n "(cached) " >&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 int main () { struct tm tm; int *p = &tm.tm_sec; return !p; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_struct_tm=time.h else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_struct_tm=sys/time.h fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:$LINENO: result: $ac_cv_struct_tm" >&5 $as_echo "$ac_cv_struct_tm" >&6; } if test $ac_cv_struct_tm = sys/time.h; then cat >>confdefs.h <<\_ACEOF #define TM_IN_SYS_TIME 1 _ACEOF fi { $as_echo "$as_me:$LINENO: checking whether byte ordering is bigendian" >&5 $as_echo_n "checking whether byte ordering is bigendian... " >&6; } if test "${ac_cv_c_bigendian+set}" = set; then $as_echo_n "(cached) " >&6 else ac_cv_c_bigendian=unknown # See if we're dealing with a universal compiler. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifndef __APPLE_CC__ not a universal capable compiler #endif typedef int dummy; _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then # Check for potential -arch flags. It is not universal unless # there are some -arch flags. Note that *ppc* also matches # ppc64. This check is also rather less than ideal. case "${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS}" in #( *-arch*ppc*|*-arch*i386*|*-arch*x86_64*) ac_cv_c_bigendian=universal;; esac else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_c_bigendian = unknown; then # See if sys/param.h defines the BYTE_ORDER macro. cat >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 ! (defined BYTE_ORDER && defined BIG_ENDIAN \ && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \ && LITTLE_ENDIAN) bogus endian macros #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; 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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_c_bigendian=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_c_bigendian=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi if test $ac_cv_c_bigendian = unknown; then # See if defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris). cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { #if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN) bogus endian macros #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; 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 int main () { #ifndef _BIG_ENDIAN not big endian #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_c_bigendian=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_c_bigendian=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi if test $ac_cv_c_bigendian = unknown; then # Compile a test program. if test "$cross_compiling" = yes; then # Try to guess by grepping values from an object file. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ short int ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; short int ascii_ii[] = { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; int use_ascii (int i) { return ascii_mm[i] + ascii_ii[i]; } short int ebcdic_ii[] = { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; short int ebcdic_mm[] = { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; int use_ebcdic (int i) { return ebcdic_mm[i] + ebcdic_ii[i]; } extern int foo; int main () { return use_ascii (foo) == use_ebcdic (foo); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; 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 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core 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. */ $ac_includes_default int main () { /* Are we little or big endian? From Harbison&Steele. */ union { long int l; char c[sizeof (long int)]; } u; u.l = 1; return u.c[sizeof (long int) - 1] == 1; ; return 0; } _ACEOF rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_c_bigendian=no else $as_echo "$as_me: program exited with status $ac_status" >&5 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_c_bigendian=yes fi rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi fi { $as_echo "$as_me:$LINENO: result: $ac_cv_c_bigendian" >&5 $as_echo "$ac_cv_c_bigendian" >&6; } case $ac_cv_c_bigendian in #( yes) cat >>confdefs.h <<\_ACEOF #define WORDS_BIGENDIAN 1 _ACEOF ;; #( no) ;; #( universal) cat >>confdefs.h <<\_ACEOF #define AC_APPLE_UNIVERSAL_BUILD 1 _ACEOF ;; #( *) { { $as_echo "$as_me:$LINENO: error: unknown endianness presetting ac_cv_c_bigendian=no (or yes) will help" >&5 $as_echo "$as_me: error: unknown endianness presetting ac_cv_c_bigendian=no (or yes) will help" >&2;} { (exit 1); exit 1; }; } ;; esac { $as_echo "$as_me:$LINENO: checking whether LONG_MAX is declared" >&5 $as_echo_n "checking whether LONG_MAX is declared... " >&6; } if test "${ac_cv_have_decl_LONG_MAX+set}" = set; then $as_echo_n "(cached) " >&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 () { #ifndef LONG_MAX (void) LONG_MAX; #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_have_decl_LONG_MAX=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_have_decl_LONG_MAX=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_LONG_MAX" >&5 $as_echo "$ac_cv_have_decl_LONG_MAX" >&6; } if test "x$ac_cv_have_decl_LONG_MAX" = x""yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_LONG_MAX 1 _ACEOF have_long_max=1 fi { $as_echo "$as_me:$LINENO: checking whether LLONG_MAX is declared" >&5 $as_echo_n "checking whether LLONG_MAX is declared... " >&6; } if test "${ac_cv_have_decl_LLONG_MAX+set}" = set; then $as_echo_n "(cached) " >&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 () { #ifndef LLONG_MAX (void) LLONG_MAX; #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_have_decl_LLONG_MAX=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_have_decl_LLONG_MAX=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_LLONG_MAX" >&5 $as_echo "$ac_cv_have_decl_LLONG_MAX" >&6; } if test "x$ac_cv_have_decl_LLONG_MAX" = x""yes; then cat >>confdefs.h <<\_ACEOF #define MAXLLONG LLONG_MAX _ACEOF else { $as_echo "$as_me:$LINENO: checking whether __LONG_LONG_MAX__ is declared" >&5 $as_echo_n "checking whether __LONG_LONG_MAX__ is declared... " >&6; } if test "${ac_cv_have_decl___LONG_LONG_MAX__+set}" = set; then $as_echo_n "(cached) " >&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 () { #ifndef __LONG_LONG_MAX__ (void) __LONG_LONG_MAX__; #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_have_decl___LONG_LONG_MAX__=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_have_decl___LONG_LONG_MAX__=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl___LONG_LONG_MAX__" >&5 $as_echo "$ac_cv_have_decl___LONG_LONG_MAX__" >&6; } if test "x$ac_cv_have_decl___LONG_LONG_MAX__" = x""yes; then cat >>confdefs.h <<\_ACEOF #define MAXLLONG __LONG_LONG_MAX__ _ACEOF else if test "$have_long_max" -eq 1; then cat >>confdefs.h <<\_ACEOF #define MAXLLONG LONG_MAX _ACEOF fi fi fi # Check whether --enable-rpl-malloc was given. if test "${enable_rpl_malloc+set}" = set; then enableval=$enable_rpl_malloc; if test "x$enableval" = xno; then ac_cv_func_malloc_0_nonnull=yes ac_cv_func_realloc_0_nonnull=yes { $as_echo "$as_me:$LINENO: Disabling redefinition of malloc to rpl_malloc" >&5 $as_echo "$as_me: Disabling redefinition of malloc to rpl_malloc" >&6;} { $as_echo "$as_me:$LINENO: Disabling redefinition of realloc to rpl_realloc" >&5 $as_echo "$as_me: Disabling redefinition of realloc to rpl_realloc" >&6;} { $as_echo "$as_me:$LINENO: WARNING: Use this feature only if you are sure that you are building for GNU C!" >&5 $as_echo "$as_me: WARNING: Use this feature only if you are sure that you are building for GNU C!" >&2;} fi fi # Checks for library functions. # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works # for constant arguments. Useless! { $as_echo "$as_me:$LINENO: checking for working alloca.h" >&5 $as_echo_n "checking for working alloca.h... " >&6; } if test "${ac_cv_working_alloca_h+set}" = set; then $as_echo_n "(cached) " >&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 () { char *p = (char *) alloca (2 * sizeof (int)); if (p) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_working_alloca_h=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_working_alloca_h=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi { $as_echo "$as_me:$LINENO: result: $ac_cv_working_alloca_h" >&5 $as_echo "$ac_cv_working_alloca_h" >&6; } if test $ac_cv_working_alloca_h = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_ALLOCA_H 1 _ACEOF fi { $as_echo "$as_me:$LINENO: checking for alloca" >&5 $as_echo_n "checking for alloca... " >&6; } if test "${ac_cv_func_alloca_works+set}" = set; then $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __GNUC__ # define alloca __builtin_alloca #else # ifdef _MSC_VER # include # define alloca _alloca # else # ifdef HAVE_ALLOCA_H # include # else # ifdef _AIX #pragma alloca # else # ifndef alloca /* predefined by HP cc +Olibcalls */ char *alloca (); # endif # endif # endif # endif #endif int main () { char *p = (char *) alloca (1); if (p) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_func_alloca_works=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_alloca_works=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi { $as_echo "$as_me:$LINENO: result: $ac_cv_func_alloca_works" >&5 $as_echo "$ac_cv_func_alloca_works" >&6; } if test $ac_cv_func_alloca_works = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_ALLOCA 1 _ACEOF else # The SVR3 libPW and SVR4 libucb both contain incompatible functions # that cause trouble. Some versions do not even contain alloca or # contain a buggy version. If you still want to use their alloca, # use ar to extract alloca.o from them instead of compiling alloca.c. ALLOCA=\${LIBOBJDIR}alloca.$ac_objext cat >>confdefs.h <<\_ACEOF #define C_ALLOCA 1 _ACEOF { $as_echo "$as_me:$LINENO: checking whether \`alloca.c' needs Cray hooks" >&5 $as_echo_n "checking whether \`alloca.c' needs Cray hooks... " >&6; } if test "${ac_cv_os_cray+set}" = set; then $as_echo_n "(cached) " >&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 defined CRAY && ! defined CRAY2 webecray #else wenotbecray #endif _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "webecray" >/dev/null 2>&1; then ac_cv_os_cray=yes else ac_cv_os_cray=no fi rm -f conftest* fi { $as_echo "$as_me:$LINENO: result: $ac_cv_os_cray" >&5 $as_echo "$ac_cv_os_cray" >&6; } if test $ac_cv_os_cray = yes; then for ac_func in _getb67 GETB67 getb67; do as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` { $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 $as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $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 #endif int main () { return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then eval "$as_ac_var=yes" else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval 'as_val=${'$as_ac_var'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } as_val=`eval 'as_val=${'$as_ac_var'} $as_echo "$as_val"'` if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF #define CRAY_STACKSEG_END $ac_func _ACEOF break fi done fi { $as_echo "$as_me:$LINENO: checking stack direction for C alloca" >&5 $as_echo_n "checking stack direction for C alloca... " >&6; } if test "${ac_cv_c_stack_direction+set}" = set; then $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then ac_cv_c_stack_direction=0 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 int find_stack_direction () { static char *addr = 0; auto char dummy; if (addr == 0) { addr = &dummy; return find_stack_direction (); } else return (&dummy > addr) ? 1 : -1; } int main () { return find_stack_direction () < 0; } _ACEOF rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_c_stack_direction=1 else $as_echo "$as_me: program exited with status $ac_status" >&5 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_c_stack_direction=-1 fi rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi { $as_echo "$as_me:$LINENO: result: $ac_cv_c_stack_direction" >&5 $as_echo "$ac_cv_c_stack_direction" >&6; } cat >>confdefs.h <<_ACEOF #define STACK_DIRECTION $ac_cv_c_stack_direction _ACEOF fi { $as_echo "$as_me:$LINENO: checking whether closedir returns void" >&5 $as_echo_n "checking whether closedir returns void... " >&6; } if test "${ac_cv_func_closedir_void+set}" = set; then $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then ac_cv_func_closedir_void=yes 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_dirent> #ifndef __cplusplus int closedir (); #endif int main () { return closedir (opendir (".")) != 0; ; return 0; } _ACEOF rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_closedir_void=no else $as_echo "$as_me: program exited with status $ac_status" >&5 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_func_closedir_void=yes fi rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi { $as_echo "$as_me:$LINENO: result: $ac_cv_func_closedir_void" >&5 $as_echo "$ac_cv_func_closedir_void" >&6; } if test $ac_cv_func_closedir_void = yes; then cat >>confdefs.h <<\_ACEOF #define CLOSEDIR_VOID 1 _ACEOF fi { $as_echo "$as_me:$LINENO: checking for error_at_line" >&5 $as_echo_n "checking for error_at_line... " >&6; } if test "${ac_cv_lib_error_at_line+set}" = set; then $as_echo_n "(cached) " >&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 () { error_at_line (0, 0, "", 0, "an error occurred"); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_lib_error_at_line=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_error_at_line=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_error_at_line" >&5 $as_echo "$ac_cv_lib_error_at_line" >&6; } if test $ac_cv_lib_error_at_line = no; then case " $LIBOBJS " in *" error.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS error.$ac_objext" ;; esac fi for ac_header in vfork.h do as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 $as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 $as_echo_n "checking $ac_header usability... " >&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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 $as_echo_n "checking $ac_header presence... " >&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 { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&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 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else $as_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 { $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 $as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 $as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------- ## ## Report this to jin@mediatomb.cc ## ## ------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 $as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi as_val=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_func in fork vfork do as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` { $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 $as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $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 #endif int main () { return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then eval "$as_ac_var=yes" else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval 'as_val=${'$as_ac_var'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } as_val=`eval 'as_val=${'$as_ac_var'} $as_echo "$as_val"'` if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done if test "x$ac_cv_func_fork" = xyes; then { $as_echo "$as_me:$LINENO: checking for working fork" >&5 $as_echo_n "checking for working fork... " >&6; } if test "${ac_cv_func_fork_works+set}" = set; then $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then ac_cv_func_fork_works=cross 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 int main () { /* By Ruediger Kuhlmann. */ return fork () < 0; ; return 0; } _ACEOF rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_fork_works=yes else $as_echo "$as_me: program exited with status $ac_status" >&5 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_func_fork_works=no fi rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi { $as_echo "$as_me:$LINENO: result: $ac_cv_func_fork_works" >&5 $as_echo "$ac_cv_func_fork_works" >&6; } else ac_cv_func_fork_works=$ac_cv_func_fork fi if test "x$ac_cv_func_fork_works" = xcross; then case $host in *-*-amigaos* | *-*-msdosdjgpp*) # Override, as these systems have only a dummy fork() stub ac_cv_func_fork_works=no ;; *) ac_cv_func_fork_works=yes ;; esac { $as_echo "$as_me:$LINENO: WARNING: result $ac_cv_func_fork_works guessed because of cross compilation" >&5 $as_echo "$as_me: WARNING: result $ac_cv_func_fork_works guessed because of cross compilation" >&2;} fi ac_cv_func_vfork_works=$ac_cv_func_vfork if test "x$ac_cv_func_vfork" = xyes; then { $as_echo "$as_me:$LINENO: checking for working vfork" >&5 $as_echo_n "checking for working vfork... " >&6; } if test "${ac_cv_func_vfork_works+set}" = set; then $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then ac_cv_func_vfork_works=cross else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Thanks to Paul Eggert for this test. */ $ac_includes_default #include #ifdef HAVE_VFORK_H # include #endif /* On some sparc systems, changes by the child to local and incoming argument registers are propagated back to the parent. The compiler is told about this with #include , but some compilers (e.g. gcc -O) don't grok . Test for this by using a static variable whose address is put into a register that is clobbered by the vfork. */ static void #ifdef __cplusplus sparc_address_test (int arg) # else sparc_address_test (arg) int arg; #endif { static pid_t child; if (!child) { child = vfork (); if (child < 0) { perror ("vfork"); _exit(2); } if (!child) { arg = getpid(); write(-1, "", 0); _exit (arg); } } } int main () { pid_t parent = getpid (); pid_t child; sparc_address_test (0); child = vfork (); if (child == 0) { /* Here is another test for sparc vfork register problems. This test uses lots of local variables, at least as many local variables as main has allocated so far including compiler temporaries. 4 locals are enough for gcc 1.40.3 on a Solaris 4.1.3 sparc, but we use 8 to be safe. A buggy compiler should reuse the register of parent for one of the local variables, since it will think that parent can't possibly be used any more in this routine. Assigning to the local variable will thus munge parent in the parent process. */ pid_t p = getpid(), p1 = getpid(), p2 = getpid(), p3 = getpid(), p4 = getpid(), p5 = getpid(), p6 = getpid(), p7 = getpid(); /* Convince the compiler that p..p7 are live; otherwise, it might use the same hardware register for all 8 local variables. */ if (p != p1 || p != p2 || p != p3 || p != p4 || p != p5 || p != p6 || p != p7) _exit(1); /* On some systems (e.g. IRIX 3.3), vfork doesn't separate parent from child file descriptors. If the child closes a descriptor before it execs or exits, this munges the parent's descriptor as well. Test for this by closing stdout in the child. */ _exit(close(fileno(stdout)) != 0); } else { int status; struct stat st; while (wait(&status) != child) ; return ( /* Was there some problem with vforking? */ child < 0 /* Did the child fail? (This shouldn't happen.) */ || status /* Did the vfork/compiler bug occur? */ || parent != getpid() /* Did the file descriptor bug occur? */ || fstat(fileno(stdout), &st) != 0 ); } } _ACEOF rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_vfork_works=yes else $as_echo "$as_me: program exited with status $ac_status" >&5 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_func_vfork_works=no fi rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi { $as_echo "$as_me:$LINENO: result: $ac_cv_func_vfork_works" >&5 $as_echo "$ac_cv_func_vfork_works" >&6; } fi; if test "x$ac_cv_func_fork_works" = xcross; then ac_cv_func_vfork_works=$ac_cv_func_vfork { $as_echo "$as_me:$LINENO: WARNING: result $ac_cv_func_vfork_works guessed because of cross compilation" >&5 $as_echo "$as_me: WARNING: result $ac_cv_func_vfork_works guessed because of cross compilation" >&2;} fi if test "x$ac_cv_func_vfork_works" = xyes; then cat >>confdefs.h <<\_ACEOF #define HAVE_WORKING_VFORK 1 _ACEOF else cat >>confdefs.h <<\_ACEOF #define vfork fork _ACEOF fi if test "x$ac_cv_func_fork_works" = xyes; then cat >>confdefs.h <<\_ACEOF #define HAVE_WORKING_FORK 1 _ACEOF fi for ac_header in stdlib.h do as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 $as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 $as_echo_n "checking $ac_header usability... " >&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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 $as_echo_n "checking $ac_header presence... " >&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 { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&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 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else $as_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 { $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 $as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 $as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------- ## ## Report this to jin@mediatomb.cc ## ## ------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 $as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi as_val=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done { $as_echo "$as_me:$LINENO: checking for GNU libc compatible malloc" >&5 $as_echo_n "checking for GNU libc compatible malloc... " >&6; } if test "${ac_cv_func_malloc_0_nonnull+set}" = set; then $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then ac_cv_func_malloc_0_nonnull=no else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #if defined STDC_HEADERS || defined HAVE_STDLIB_H # include #else char *malloc (); #endif int main () { return ! malloc (0); ; return 0; } _ACEOF rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_malloc_0_nonnull=yes else $as_echo "$as_me: program exited with status $ac_status" >&5 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_func_malloc_0_nonnull=no fi rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi { $as_echo "$as_me:$LINENO: result: $ac_cv_func_malloc_0_nonnull" >&5 $as_echo "$ac_cv_func_malloc_0_nonnull" >&6; } if test $ac_cv_func_malloc_0_nonnull = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_MALLOC 1 _ACEOF else cat >>confdefs.h <<\_ACEOF #define HAVE_MALLOC 0 _ACEOF case " $LIBOBJS " in *" malloc.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS malloc.$ac_objext" ;; esac cat >>confdefs.h <<\_ACEOF #define malloc rpl_malloc _ACEOF fi { $as_echo "$as_me:$LINENO: checking for working memcmp" >&5 $as_echo_n "checking for working memcmp... " >&6; } if test "${ac_cv_func_memcmp_working+set}" = set; then $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then ac_cv_func_memcmp_working=no 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 int main () { /* Some versions of memcmp are not 8-bit clean. */ char c0 = '\100', c1 = '\200', c2 = '\201'; if (memcmp(&c0, &c2, 1) >= 0 || memcmp(&c1, &c2, 1) >= 0) return 1; /* The Next x86 OpenStep bug shows up only when comparing 16 bytes or more and with at least one buffer not starting on a 4-byte boundary. William Lewis provided this test program. */ { char foo[21]; char bar[21]; int i; for (i = 0; i < 4; i++) { char *a = foo + i; char *b = bar + i; strcpy (a, "--------01111111"); strcpy (b, "--------10000000"); if (memcmp (a, b, 16) >= 0) return 1; } return 0; } ; return 0; } _ACEOF rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_memcmp_working=yes else $as_echo "$as_me: program exited with status $ac_status" >&5 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_func_memcmp_working=no fi rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi { $as_echo "$as_me:$LINENO: result: $ac_cv_func_memcmp_working" >&5 $as_echo "$ac_cv_func_memcmp_working" >&6; } test $ac_cv_func_memcmp_working = no && case " $LIBOBJS " in *" memcmp.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS memcmp.$ac_objext" ;; esac for ac_header in stdlib.h do as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 $as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 $as_echo_n "checking $ac_header usability... " >&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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 $as_echo_n "checking $ac_header presence... " >&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 { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&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 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else $as_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 { $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 $as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 $as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------- ## ## Report this to jin@mediatomb.cc ## ## ------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 $as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi as_val=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done { $as_echo "$as_me:$LINENO: checking for GNU libc compatible realloc" >&5 $as_echo_n "checking for GNU libc compatible realloc... " >&6; } if test "${ac_cv_func_realloc_0_nonnull+set}" = set; then $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then ac_cv_func_realloc_0_nonnull=no else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #if defined STDC_HEADERS || defined HAVE_STDLIB_H # include #else char *realloc (); #endif int main () { return ! realloc (0, 0); ; return 0; } _ACEOF rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_realloc_0_nonnull=yes else $as_echo "$as_me: program exited with status $ac_status" >&5 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_func_realloc_0_nonnull=no fi rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi { $as_echo "$as_me:$LINENO: result: $ac_cv_func_realloc_0_nonnull" >&5 $as_echo "$ac_cv_func_realloc_0_nonnull" >&6; } if test $ac_cv_func_realloc_0_nonnull = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_REALLOC 1 _ACEOF else cat >>confdefs.h <<\_ACEOF #define HAVE_REALLOC 0 _ACEOF case " $LIBOBJS " in *" realloc.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS realloc.$ac_objext" ;; esac cat >>confdefs.h <<\_ACEOF #define realloc rpl_realloc _ACEOF fi for ac_header in sys/select.h sys/socket.h do as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 $as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 $as_echo_n "checking $ac_header usability... " >&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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 $as_echo_n "checking $ac_header presence... " >&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 { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&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 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else $as_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 { $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 $as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 $as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------- ## ## Report this to jin@mediatomb.cc ## ## ------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 $as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi as_val=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done { $as_echo "$as_me:$LINENO: checking types of arguments for select" >&5 $as_echo_n "checking types of arguments for select... " >&6; } if test "${ac_cv_func_select_args+set}" = set; then $as_echo_n "(cached) " >&6 else for ac_arg234 in 'fd_set *' 'int *' 'void *'; do for ac_arg1 in 'int' 'size_t' 'unsigned long int' 'unsigned int'; do for ac_arg5 in 'struct timeval *' 'const struct timeval *'; do 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 #ifdef HAVE_SYS_SELECT_H # include #endif #ifdef HAVE_SYS_SOCKET_H # include #endif int main () { extern int select ($ac_arg1, $ac_arg234, $ac_arg234, $ac_arg234, $ac_arg5); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_func_select_args="$ac_arg1,$ac_arg234,$ac_arg5"; break 3 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done done done # Provide a safe default value. : ${ac_cv_func_select_args='int,int *,struct timeval *'} fi { $as_echo "$as_me:$LINENO: result: $ac_cv_func_select_args" >&5 $as_echo "$ac_cv_func_select_args" >&6; } ac_save_IFS=$IFS; IFS=',' set dummy `echo "$ac_cv_func_select_args" | sed 's/\*/\*/g'` IFS=$ac_save_IFS shift cat >>confdefs.h <<_ACEOF #define SELECT_TYPE_ARG1 $1 _ACEOF cat >>confdefs.h <<_ACEOF #define SELECT_TYPE_ARG234 ($2) _ACEOF cat >>confdefs.h <<_ACEOF #define SELECT_TYPE_ARG5 ($3) _ACEOF rm -f conftest* { $as_echo "$as_me:$LINENO: checking whether lstat dereferences a symlink specified with a trailing slash" >&5 $as_echo_n "checking whether lstat dereferences a symlink specified with a trailing slash... " >&6; } if test "${ac_cv_func_lstat_dereferences_slashed_symlink+set}" = set; then $as_echo_n "(cached) " >&6 else rm -f conftest.sym conftest.file echo >conftest.file if test "$as_ln_s" = "ln -s" && ln -s conftest.file conftest.sym; then if test "$cross_compiling" = yes; then ac_cv_func_lstat_dereferences_slashed_symlink=no 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 int main () { struct stat sbuf; /* Linux will dereference the symlink and fail. That is better in the sense that it means we will not have to compile and use the lstat wrapper. */ return lstat ("conftest.sym/", &sbuf) == 0; ; return 0; } _ACEOF rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_lstat_dereferences_slashed_symlink=yes else $as_echo "$as_me: program exited with status $ac_status" >&5 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_func_lstat_dereferences_slashed_symlink=no fi rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi else # If the `ln -s' command failed, then we probably don't even # have an lstat function. ac_cv_func_lstat_dereferences_slashed_symlink=no fi rm -f conftest.sym conftest.file fi { $as_echo "$as_me:$LINENO: result: $ac_cv_func_lstat_dereferences_slashed_symlink" >&5 $as_echo "$ac_cv_func_lstat_dereferences_slashed_symlink" >&6; } test $ac_cv_func_lstat_dereferences_slashed_symlink = yes && cat >>confdefs.h <<_ACEOF #define LSTAT_FOLLOWS_SLASHED_SYMLINK 1 _ACEOF if test $ac_cv_func_lstat_dereferences_slashed_symlink = no; then case " $LIBOBJS " in *" lstat.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS lstat.$ac_objext" ;; esac fi { $as_echo "$as_me:$LINENO: checking whether stat accepts an empty string" >&5 $as_echo_n "checking whether stat accepts an empty string... " >&6; } if test "${ac_cv_func_stat_empty_string_bug+set}" = set; then $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then ac_cv_func_stat_empty_string_bug=yes 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 int main () { struct stat sbuf; return stat ("", &sbuf) == 0; ; return 0; } _ACEOF rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_stat_empty_string_bug=no else $as_echo "$as_me: program exited with status $ac_status" >&5 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_func_stat_empty_string_bug=yes fi rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi { $as_echo "$as_me:$LINENO: result: $ac_cv_func_stat_empty_string_bug" >&5 $as_echo "$ac_cv_func_stat_empty_string_bug" >&6; } if test $ac_cv_func_stat_empty_string_bug = yes; then case " $LIBOBJS " in *" stat.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS stat.$ac_objext" ;; esac cat >>confdefs.h <<_ACEOF #define HAVE_STAT_EMPTY_STRING_BUG 1 _ACEOF fi { $as_echo "$as_me:$LINENO: checking for working strtod" >&5 $as_echo_n "checking for working strtod... " >&6; } if test "${ac_cv_func_strtod+set}" = set; then $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then ac_cv_func_strtod=no 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 #ifndef strtod double strtod (); #endif int main() { { /* Some versions of Linux strtod mis-parse strings with leading '+'. */ char *string = " +69"; char *term; double value; value = strtod (string, &term); if (value != 69 || term != (string + 4)) return 1; } { /* Under Solaris 2.4, strtod returns the wrong value for the terminating character under some conditions. */ char *string = "NaN"; char *term; strtod (string, &term); if (term != string && *(term - 1) == 0) return 1; } return 0; } _ACEOF rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_strtod=yes else $as_echo "$as_me: program exited with status $ac_status" >&5 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_func_strtod=no fi rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi { $as_echo "$as_me:$LINENO: result: $ac_cv_func_strtod" >&5 $as_echo "$ac_cv_func_strtod" >&6; } if test $ac_cv_func_strtod = no; then case " $LIBOBJS " in *" strtod.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS strtod.$ac_objext" ;; esac { $as_echo "$as_me:$LINENO: checking for pow" >&5 $as_echo_n "checking for pow... " >&6; } if test "${ac_cv_func_pow+set}" = set; then $as_echo_n "(cached) " >&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 pow to an innocuous variant, in case declares pow. For example, HP-UX 11i declares gettimeofday. */ #define pow innocuous_pow /* System header to define __stub macros and hopefully few prototypes, which can conflict with char pow (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef pow /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char pow (); /* 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_pow || defined __stub___pow choke me #endif int main () { return pow (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_func_pow=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_pow=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi { $as_echo "$as_me:$LINENO: result: $ac_cv_func_pow" >&5 $as_echo "$ac_cv_func_pow" >&6; } if test $ac_cv_func_pow = no; then { $as_echo "$as_me:$LINENO: checking for pow in -lm" >&5 $as_echo_n "checking for pow in -lm... " >&6; } if test "${ac_cv_lib_m_pow+set}" = set; then $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lm $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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char pow (); int main () { return pow (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_lib_m_pow=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_m_pow=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_m_pow" >&5 $as_echo "$ac_cv_lib_m_pow" >&6; } if test "x$ac_cv_lib_m_pow" = x""yes; then POW_LIB=-lm else { $as_echo "$as_me:$LINENO: WARNING: cannot find library containing definition of pow" >&5 $as_echo "$as_me: WARNING: cannot find library containing definition of pow" >&2;} fi fi fi for ac_func in vprintf do as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` { $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 $as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $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 #endif int main () { return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then eval "$as_ac_var=yes" else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval 'as_val=${'$as_ac_var'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } as_val=`eval 'as_val=${'$as_ac_var'} $as_echo "$as_val"'` if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF { $as_echo "$as_me:$LINENO: checking for _doprnt" >&5 $as_echo_n "checking for _doprnt... " >&6; } if test "${ac_cv_func__doprnt+set}" = set; then $as_echo_n "(cached) " >&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 _doprnt to an innocuous variant, in case declares _doprnt. For example, HP-UX 11i declares gettimeofday. */ #define _doprnt innocuous__doprnt /* System header to define __stub macros and hopefully few prototypes, which can conflict with char _doprnt (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef _doprnt /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char _doprnt (); /* 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__doprnt || defined __stub____doprnt choke me #endif int main () { return _doprnt (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_func__doprnt=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func__doprnt=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi { $as_echo "$as_me:$LINENO: result: $ac_cv_func__doprnt" >&5 $as_echo "$ac_cv_func__doprnt" >&6; } if test "x$ac_cv_func__doprnt" = x""yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_DOPRNT 1 _ACEOF fi fi done { $as_echo "$as_me:$LINENO: checking whether strerror_r is declared" >&5 $as_echo_n "checking whether strerror_r is declared... " >&6; } if test "${ac_cv_have_decl_strerror_r+set}" = set; then $as_echo_n "(cached) " >&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 int main () { #ifndef strerror_r (void) strerror_r; #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_have_decl_strerror_r=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_have_decl_strerror_r=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_strerror_r" >&5 $as_echo "$ac_cv_have_decl_strerror_r" >&6; } if test "x$ac_cv_have_decl_strerror_r" = x""yes; then cat >>confdefs.h <<_ACEOF #define HAVE_DECL_STRERROR_R 1 _ACEOF else cat >>confdefs.h <<_ACEOF #define HAVE_DECL_STRERROR_R 0 _ACEOF fi for ac_func in strerror_r do as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` { $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 $as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $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 #endif int main () { return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then eval "$as_ac_var=yes" else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval 'as_val=${'$as_ac_var'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } as_val=`eval 'as_val=${'$as_ac_var'} $as_echo "$as_val"'` if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done { $as_echo "$as_me:$LINENO: checking whether strerror_r returns char *" >&5 $as_echo_n "checking whether strerror_r returns char *... " >&6; } if test "${ac_cv_func_strerror_r_char_p+set}" = set; then $as_echo_n "(cached) " >&6 else ac_cv_func_strerror_r_char_p=no if test $ac_cv_have_decl_strerror_r = yes; then 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 int main () { char buf[100]; char x = *strerror_r (0, buf, sizeof buf); char *p = strerror_r (0, buf, sizeof buf); return !p || x; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_func_strerror_r_char_p=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext else # strerror_r is not declared. Choose between # systems that have relatively inaccessible declarations for the # function. BeOS and DEC UNIX 4.0 fall in this category, but the # former has a strerror_r that returns char*, while the latter # has a strerror_r that returns `int'. # This test should segfault on the DEC system. 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. */ $ac_includes_default extern char *strerror_r (); int main () { char buf[100]; char x = *strerror_r (0, buf, sizeof buf); return ! isalpha (x); ; return 0; } _ACEOF rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_strerror_r_char_p=yes else $as_echo "$as_me: program exited with status $ac_status" >&5 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi fi { $as_echo "$as_me:$LINENO: result: $ac_cv_func_strerror_r_char_p" >&5 $as_echo "$ac_cv_func_strerror_r_char_p" >&6; } if test $ac_cv_func_strerror_r_char_p = yes; then cat >>confdefs.h <<\_ACEOF #define STRERROR_R_CHAR_P 1 _ACEOF fi for ac_func in strftime do as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` { $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 $as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $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 #endif int main () { return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then eval "$as_ac_var=yes" else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval 'as_val=${'$as_ac_var'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } as_val=`eval 'as_val=${'$as_ac_var'} $as_echo "$as_val"'` if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF else # strftime is in -lintl on SCO UNIX. { $as_echo "$as_me:$LINENO: checking for strftime in -lintl" >&5 $as_echo_n "checking for strftime in -lintl... " >&6; } if test "${ac_cv_lib_intl_strftime+set}" = set; then $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lintl $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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char strftime (); int main () { return strftime (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_lib_intl_strftime=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_intl_strftime=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_intl_strftime" >&5 $as_echo "$ac_cv_lib_intl_strftime" >&6; } if test "x$ac_cv_lib_intl_strftime" = x""yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_STRFTIME 1 _ACEOF LIBS="-lintl $LIBS" fi fi done ac_ext=cpp 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 for ac_func in gethostname gettimeofday localtime_r memmove memset do as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` { $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 $as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $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 #endif int main () { return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then eval "$as_ac_var=yes" else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval 'as_val=${'$as_ac_var'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } as_val=`eval 'as_val=${'$as_ac_var'} $as_echo "$as_val"'` if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF else { { $as_echo "$as_me:$LINENO: error: required library function not found" >&5 $as_echo "$as_me: error: required library function not found" >&2;} { (exit 1); exit 1; }; } fi done for ac_func in regcomp select strcasecmp strchr strdup strerror strncasecmp do as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` { $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 $as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $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 #endif int main () { return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then eval "$as_ac_var=yes" else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval 'as_val=${'$as_ac_var'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } as_val=`eval 'as_val=${'$as_ac_var'} $as_echo "$as_val"'` if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF else { { $as_echo "$as_me:$LINENO: error: required library function not found" >&5 $as_echo "$as_me: error: required library function not found" >&2;} { (exit 1); exit 1; }; } fi done for ac_func in strrchr strstr strtol strtoul uname do as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` { $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 $as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $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 #endif int main () { return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then eval "$as_ac_var=yes" else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval 'as_val=${'$as_ac_var'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } as_val=`eval 'as_val=${'$as_ac_var'} $as_echo "$as_val"'` if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF else { { $as_echo "$as_me:$LINENO: error: required library function not found" >&5 $as_echo "$as_me: error: required library function not found" >&2;} { (exit 1); exit 1; }; } fi done for ac_func in sigaction sigprocmask do as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` { $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 $as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $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 #endif int main () { return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then eval "$as_ac_var=yes" else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval 'as_val=${'$as_ac_var'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } as_val=`eval 'as_val=${'$as_ac_var'} $as_echo "$as_val"'` if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF else { { $as_echo "$as_me:$LINENO: error: required library function not found" >&5 $as_echo "$as_me: error: required library function not found" >&2;} { (exit 1); exit 1; }; } fi done for ac_func in ioctl tolower toupper do as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` { $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 $as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $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 #endif int main () { return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then eval "$as_ac_var=yes" else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval 'as_val=${'$as_ac_var'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } as_val=`eval 'as_val=${'$as_ac_var'} $as_echo "$as_val"'` if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF else { { $as_echo "$as_me:$LINENO: error: required library function not found" >&5 $as_echo "$as_me: error: required library function not found" >&2;} { (exit 1); exit 1; }; } fi done cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, we kill variables containing newlines. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. ( for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:$LINENO: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) $as_unset $ac_var ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes (double-quote # substitution turns \\\\ into \\, and sed turns \\ into \). sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then test "x$cache_file" != "x/dev/null" && { $as_echo "$as_me:$LINENO: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} cat confcache >$cache_file else { $as_echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache for ac_func in inet_ntoa do as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` { $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 $as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $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 #endif int main () { return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then eval "$as_ac_var=yes" else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval 'as_val=${'$as_ac_var'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } as_val=`eval 'as_val=${'$as_ac_var'} $as_echo "$as_val"'` if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF else { $as_echo "$as_me:$LINENO: checking for inet_ntoa in -lnsl" >&5 $as_echo_n "checking for inet_ntoa in -lnsl... " >&6; } if test "${ac_cv_lib_nsl_inet_ntoa+set}" = set; then $as_echo_n "(cached) " >&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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char inet_ntoa (); int main () { return inet_ntoa (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_lib_nsl_inet_ntoa=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_nsl_inet_ntoa=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_nsl_inet_ntoa" >&5 $as_echo "$ac_cv_lib_nsl_inet_ntoa" >&6; } if test "x$ac_cv_lib_nsl_inet_ntoa" = x""yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBNSL 1 _ACEOF LIBS="-lnsl $LIBS" else { { $as_echo "$as_me:$LINENO: error: required library function not found" >&5 $as_echo "$as_me: error: required library function not found" >&2;} { (exit 1); exit 1; }; } fi fi done for ac_func in socket do as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` { $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 $as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $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 #endif int main () { return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then eval "$as_ac_var=yes" else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval 'as_val=${'$as_ac_var'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } as_val=`eval 'as_val=${'$as_ac_var'} $as_echo "$as_val"'` if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF else { $as_echo "$as_me:$LINENO: checking for socket in -lsocket" >&5 $as_echo_n "checking for socket in -lsocket... " >&6; } if test "${ac_cv_lib_socket_socket+set}" = set; then $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsocket $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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char socket (); int main () { return socket (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_lib_socket_socket=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_socket_socket=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_socket_socket" >&5 $as_echo "$ac_cv_lib_socket_socket" >&6; } if test "x$ac_cv_lib_socket_socket" = x""yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBSOCKET 1 _ACEOF LIBS="-lsocket $LIBS" else { { $as_echo "$as_me:$LINENO: error: required library function not found" >&5 $as_echo "$as_me: error: required library function not found" >&2;} { (exit 1); exit 1; }; } fi fi done for ac_func in gethostbyname do as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` { $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 $as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $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 #endif int main () { return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then eval "$as_ac_var=yes" else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval 'as_val=${'$as_ac_var'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } as_val=`eval 'as_val=${'$as_ac_var'} $as_echo "$as_val"'` if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF else { $as_echo "$as_me:$LINENO: checking for gethostbyname in -lnsl" >&5 $as_echo_n "checking for gethostbyname in -lnsl... " >&6; } if test "${ac_cv_lib_nsl_gethostbyname+set}" = set; then $as_echo_n "(cached) " >&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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char gethostbyname (); int main () { return gethostbyname (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_lib_nsl_gethostbyname=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_nsl_gethostbyname=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_nsl_gethostbyname" >&5 $as_echo "$ac_cv_lib_nsl_gethostbyname" >&6; } if test "x$ac_cv_lib_nsl_gethostbyname" = x""yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBNSL 1 _ACEOF LIBS="-lnsl $LIBS" else { { $as_echo "$as_me:$LINENO: error: required library function not found" >&5 $as_echo "$as_me: error: required library function not found" >&2;} { (exit 1); exit 1; }; } fi fi done if test $DARWIN_OS -eq 1 ; then { $as_echo "$as_me:$LINENO: You are running OSX, assuming threadsafe gethostbyname version" >&5 $as_echo "$as_me: You are running OSX, assuming threadsafe gethostbyname version" >&6;} elif test $CYGWIN_OS -eq 1; then { $as_echo "$as_me:$LINENO: Your are building under Cygwin, assuming threadsafe gethostbyname implementation" >&5 $as_echo "$as_me: Your are building under Cygwin, assuming threadsafe gethostbyname implementation" >&6;} fi ac_ext=cpp 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 { $as_echo "$as_me:$LINENO: checking how to run the C++ preprocessor" >&5 $as_echo_n "checking how to run the C++ preprocessor... " >&6; } if test -z "$CXXCPP"; then if test "${ac_cv_prog_CXXCPP+set}" = set; then $as_echo_n "(cached) " >&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 { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&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 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || test ! -s conftest.err }; then : else $as_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 nonexistent 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 { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&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 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || test ! -s conftest.err }; then # Broken: success on invalid input. continue else $as_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 { $as_echo "$as_me:$LINENO: result: $CXXCPP" >&5 $as_echo "$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 { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&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 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || test ! -s conftest.err }; then : else $as_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 nonexistent 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 { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&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 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || test ! -s conftest.err }; then # Broken: success on invalid input. continue else $as_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 { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { { $as_echo "$as_me:$LINENO: error: C++ preprocessor \"$CXXCPP\" fails sanity check See \`config.log' for more details." >&5 $as_echo "$as_me: error: C++ preprocessor \"$CXXCPP\" fails sanity check See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; }; } fi ac_ext=cpp 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 for ac_func in gethostbyname_r do as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` { $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 $as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $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 #endif int main () { return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then eval "$as_ac_var=yes" else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval 'as_val=${'$as_ac_var'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } as_val=`eval 'as_val=${'$as_ac_var'} $as_echo "$as_val"'` if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF else for ac_header in lwres/netdb.h do as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 $as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 $as_echo_n "checking $ac_header usability... " >&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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 $as_echo_n "checking $ac_header presence... " >&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 { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&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 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else $as_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 { $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in yes:no: ) { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 $as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 $as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------- ## ## Report this to jin@mediatomb.cc ## ## ------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 $as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi as_val=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF { $as_echo "$as_me:$LINENO: checking for lwres_gethostbyname_r in -llwres" >&5 $as_echo_n "checking for lwres_gethostbyname_r in -llwres... " >&6; } if test "${ac_cv_lib_lwres_lwres_gethostbyname_r+set}" = set; then $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-llwres $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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char lwres_gethostbyname_r (); int main () { return lwres_gethostbyname_r (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_lib_lwres_lwres_gethostbyname_r=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_lwres_lwres_gethostbyname_r=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_lwres_lwres_gethostbyname_r" >&5 $as_echo "$ac_cv_lib_lwres_lwres_gethostbyname_r" >&6; } if test "x$ac_cv_lib_lwres_lwres_gethostbyname_r" = x""yes; then LWRES_LIBS="-llwres" cat >>confdefs.h <<\_ACEOF #define HAVE_LIBLWRES 1 _ACEOF else { { $as_echo "$as_me:$LINENO: error: required library function not found" >&5 $as_echo "$as_me: error: required library function not found" >&2;} { (exit 1); exit 1; }; } fi else if ((test $DARWIN_OS -eq 0) && (test $CYGWIN_OS -eq 0) && (test $OPENBSD_OS -eq 0)) ; then { { $as_echo "$as_me:$LINENO: error: required header not found" >&5 $as_echo "$as_me: error: required header not found" >&2;} { (exit 1); exit 1; }; } fi fi done fi done for ac_func in if_nameindex do as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` { $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 $as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $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 #endif int main () { return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then eval "$as_ac_var=yes" else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval 'as_val=${'$as_ac_var'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } as_val=`eval 'as_val=${'$as_ac_var'} $as_echo "$as_val"'` if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF else { $as_echo "$as_me:$LINENO: checking for if_nameindex in -lnsl" >&5 $as_echo_n "checking for if_nameindex in -lnsl... " >&6; } if test "${ac_cv_lib_nsl_if_nameindex+set}" = set; then $as_echo_n "(cached) " >&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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char if_nameindex (); int main () { return if_nameindex (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_lib_nsl_if_nameindex=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_nsl_if_nameindex=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_nsl_if_nameindex" >&5 $as_echo "$ac_cv_lib_nsl_if_nameindex" >&6; } if test "x$ac_cv_lib_nsl_if_nameindex" = x""yes; then NSL_LIBS="-lnsl" else if test $CYGWIN_OS -eq 0; then { { $as_echo "$as_me:$LINENO: error: required library function not found" >&5 $as_echo "$as_me: error: required library function not found" >&2;} { (exit 1); exit 1; }; } fi fi fi done for ac_func in if_freenameindex do as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` { $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 $as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $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 #endif int main () { return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then eval "$as_ac_var=yes" else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval 'as_val=${'$as_ac_var'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } as_val=`eval 'as_val=${'$as_ac_var'} $as_echo "$as_val"'` if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF else { $as_echo "$as_me:$LINENO: checking for if_freenameindex in -lnsl" >&5 $as_echo_n "checking for if_freenameindex in -lnsl... " >&6; } if test "${ac_cv_lib_nsl_if_freenameindex+set}" = set; then $as_echo_n "(cached) " >&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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char if_freenameindex (); int main () { return if_freenameindex (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_lib_nsl_if_freenameindex=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_nsl_if_freenameindex=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_nsl_if_freenameindex" >&5 $as_echo "$ac_cv_lib_nsl_if_freenameindex" >&6; } if test "x$ac_cv_lib_nsl_if_freenameindex" = x""yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBNSL 1 _ACEOF LIBS="-lnsl $LIBS" else if ((test $CYGWIN_OS -eq 0) && (test $OPENBSD_OS -eq 0)); then { { $as_echo "$as_me:$LINENO: error: required library function not found" >&5 $as_echo "$as_me: error: required library function not found" >&2;} { (exit 1); exit 1; }; } fi fi fi done # this is not optional, we need the device and the internal webserver cat >>confdefs.h <<\_ACEOF #define UPNP_HAVE_DEVICE 1 _ACEOF cat >>confdefs.h <<\_ACEOF #define UPNP_HAVE_WEBSERVER 1 _ACEOF ADD_PTHREAD_CFLAGS= # see acinclude.m4 for the definition of ACX_PTHREAD if test "x$PTHREAD_LIB_OPTION_ENABLED" = xyes; then mt_pthread_arg_default=yes mt_pthread_library_status=yes LIBS_SAVE=$LIBS LDFLAGS_SAVE=$LDFLAGS CFLAGS_SAVE=$CFLAGS CXXFLAGS_SAVE=$CXXFLAGS CPPFLAGS_SAVE=$CPPFLAGS # Check whether --with-pthread-libs was given. if test "${with_pthread_libs+set}" = set; then withval=$with_pthread_libs; mt_pthread_search_libs="$withval" { $as_echo "$as_me:$LINENO: Will search for pthread libs in $withval" >&5 $as_echo "$as_me: Will search for pthread libs in $withval" >&6;} fi if test "$mt_pthread_search_libs" ; then unset ac_cv_lib_pthread_pthread_create LDFLAGS="$LDFLAGS -L$mt_pthread_search_libs" { $as_echo "$as_me:$LINENO: checking for pthread_create in -lpthread" >&5 $as_echo_n "checking for pthread_create in -lpthread... " >&6; } if test "${ac_cv_lib_pthread_pthread_create+set}" = set; then $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lpthread $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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char pthread_create (); int main () { return pthread_create (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_lib_pthread_pthread_create=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_pthread_pthread_create=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_pthread_pthread_create" >&5 $as_echo "$ac_cv_lib_pthread_pthread_create" >&6; } if test "x$ac_cv_lib_pthread_pthread_create" = x""yes; then mt_pthread_libs="-lpthread" mt_pthread_ldflags="-L$mt_pthread_search_libs" else mt_pthread_library_status=missing if test "" = "pass"; then { $as_echo "$as_me:$LINENO: pthread library not found in requested location $mt_pthread_search_libs" >&5 $as_echo "$as_me: pthread library not found in requested location $mt_pthread_search_libs" >&6;} else { { $as_echo "$as_me:$LINENO: error: pthread library not found in requested location $mt_pthread_search_libs" >&5 $as_echo "$as_me: error: pthread library not found in requested location $mt_pthread_search_libs" >&2;} { (exit 1); exit 1; }; } fi fi else unset ac_cv_lib_pthread_pthread_create { $as_echo "$as_me:$LINENO: checking for pthread_create in -lpthread" >&5 $as_echo_n "checking for pthread_create in -lpthread... " >&6; } if test "${ac_cv_lib_pthread_pthread_create+set}" = set; then $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lpthread $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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char pthread_create (); int main () { return pthread_create (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_lib_pthread_pthread_create=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_pthread_pthread_create=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_pthread_pthread_create" >&5 $as_echo "$ac_cv_lib_pthread_pthread_create" >&6; } if test "x$ac_cv_lib_pthread_pthread_create" = x""yes; then mt_pthread_libs="-lpthread" else LDFLAGS="$LDFLAGS -L$MT_SEARCHPATH_LIBS" unset ac_cv_lib_pthread_pthread_create { $as_echo "$as_me:$LINENO: checking for pthread_create in -lpthread" >&5 $as_echo_n "checking for pthread_create in -lpthread... " >&6; } if test "${ac_cv_lib_pthread_pthread_create+set}" = set; then $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lpthread $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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char pthread_create (); int main () { return pthread_create (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_lib_pthread_pthread_create=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_pthread_pthread_create=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_pthread_pthread_create" >&5 $as_echo "$ac_cv_lib_pthread_pthread_create" >&6; } if test "x$ac_cv_lib_pthread_pthread_create" = x""yes; then mt_pthread_libs="-lpthread" mt_pthread_ldflags="-L$MT_SEARCHPATH_LIBS" else mt_pthread_library_status=missing fi fi fi if test "x$mt_pthread_library_status" != xyes; then mt_pthread_libs="" mt_pthread_ldflags="" fi LIBS=$LIBS_SAVE LDFLAGS=$LDFLAGS_SAVE CFLAGS=$CFLAGS_SAVE CXXFLAGS=$CXXFLAGS_SAVE CPPFLAGS=$CPPFLAGS_SAVE PTHREAD_LIBS=${mt_pthread_libs} PTHREAD_LDFLAGS=${mt_pthread_ldflags} PTHREAD_STATUS=${mt_pthread_library_status} if test "x$PTHREAD_STATUS" != xyes; then { { $as_echo "$as_me:$LINENO: error: pthread library not found, try running configure without the --enable-pthread-lib option" >&5 $as_echo "$as_me: error: pthread library not found, try running configure without the --enable-pthread-lib option" >&2;} { (exit 1); exit 1; }; } fi 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 acx_pthread_ok=no # We used to check for pthread.h first, but this fails if pthread.h # requires special compiler flags (e.g. on True64 or Sequent). # It gets checked for in the link test anyway. # First of all, check if the user has set any of the PTHREAD_LIBS, # etcetera environment variables, and if threads linking works using # them: if test x"$PTHREAD_LIBS$PTHREAD_CFLAGS" != x; then save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS $PTHREAD_CFLAGS" save_LIBS="$LIBS" LIBS="$PTHREAD_LIBS $LIBS" { $as_echo "$as_me:$LINENO: checking for pthread_join in LIBS=$PTHREAD_LIBS with CFLAGS=$PTHREAD_CFLAGS" >&5 $as_echo_n "checking for pthread_join in LIBS=$PTHREAD_LIBS with CFLAGS=$PTHREAD_CFLAGS... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char pthread_join (); int main () { return pthread_join (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then acx_pthread_ok=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext { $as_echo "$as_me:$LINENO: result: $acx_pthread_ok" >&5 $as_echo "$acx_pthread_ok" >&6; } if test x"$acx_pthread_ok" = xno; then PTHREAD_LIBS="" PTHREAD_CFLAGS="" fi LIBS="$save_LIBS" CFLAGS="$save_CFLAGS" fi # We must check for the threads library under a number of different # names; the ordering is very important because some systems # (e.g. DEC) have both -lpthread and -lpthreads, where one of the # libraries is broken (non-POSIX). # Create a list of thread flags to try. Items starting with a "-" are # C compiler flags, and other items are library names, except for "none" # which indicates that we try without any flags at all, and "pthread-config" # which is a program returning the flags for the Pth emulation library. acx_pthread_flags="pthreads none -Kthread -kthread lthread -pthread -pthreads -mthreads pthread --thread-safe -mt pthread-config" # The ordering *is* (sometimes) important. Some notes on the # individual items follow: # pthreads: AIX (must check this before -lpthread) # none: in case threads are in libc; should be tried before -Kthread and # other compiler flags to prevent continual compiler warnings # -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h) # -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able) # lthread: LinuxThreads port on FreeBSD (also preferred to -pthread) # -pthread: Linux/gcc (kernel threads), BSD/gcc (userland threads) # -pthreads: Solaris/gcc # -mthreads: Mingw32/gcc, Lynx/gcc # -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it # doesn't hurt to check since this sometimes defines pthreads too; # also defines -D_REENTRANT) # ... -mt is also the pthreads flag for HP/aCC # pthread: Linux, etcetera # --thread-safe: KAI C++ # pthread-config: use pthread-config program (for GNU Pth library) case "${host_cpu}-${host_os}" in *solaris*) # On Solaris (at least, for some versions), libc contains stubbed # (non-functional) versions of the pthreads routines, so link-based # tests will erroneously succeed. (We need to link with -pthreads/-mt/ # -lpthread.) (The stubs are missing pthread_cleanup_push, or rather # a function called by this macro, so we could check for that, but # who knows whether they'll stub that too in a future libc.) So, # we'll just look for -pthreads and -lpthread first: acx_pthread_flags="-pthreads pthread -mt -pthread $acx_pthread_flags" ;; esac if test x"$acx_pthread_ok" = xno; then for flag in $acx_pthread_flags; do case $flag in none) { $as_echo "$as_me:$LINENO: checking whether pthreads work without any flags" >&5 $as_echo_n "checking whether pthreads work without any flags... " >&6; } ;; -*) { $as_echo "$as_me:$LINENO: checking whether pthreads work with $flag" >&5 $as_echo_n "checking whether pthreads work with $flag... " >&6; } PTHREAD_CFLAGS="$flag" ;; pthread-config) # Extract the first word of "pthread-config", so it can be a program name with args. set dummy pthread-config; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_acx_pthread_config+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$acx_pthread_config"; then ac_cv_prog_acx_pthread_config="$acx_pthread_config" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_acx_pthread_config="yes" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_prog_acx_pthread_config" && ac_cv_prog_acx_pthread_config="no" fi fi acx_pthread_config=$ac_cv_prog_acx_pthread_config if test -n "$acx_pthread_config"; then { $as_echo "$as_me:$LINENO: result: $acx_pthread_config" >&5 $as_echo "$acx_pthread_config" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi if test x"$acx_pthread_config" = xno; then continue; fi PTHREAD_CFLAGS="`pthread-config --cflags`" PTHREAD_LIBS="`pthread-config --ldflags` `pthread-config --libs`" ;; *) { $as_echo "$as_me:$LINENO: checking for the pthreads library -l$flag" >&5 $as_echo_n "checking for the pthreads library -l$flag... " >&6; } PTHREAD_LIBS="-l$flag" ;; esac save_LIBS="$LIBS" save_CFLAGS="$CFLAGS" LIBS="$PTHREAD_LIBS $LIBS" CFLAGS="$CFLAGS $PTHREAD_CFLAGS" # Check for various functions. We must include pthread.h, # since some functions may be macros. (On the Sequent, we # need a special flag -Kthread to make this header compile.) # We check for pthread_join because it is in -lpthread on IRIX # while pthread_create is in libc. We check for pthread_attr_init # due to DEC craziness with -lpthreads. We check for # pthread_cleanup_push because it is one of the few pthread # functions on Solaris that doesn't have a non-functional libc stub. # We try pthread_create on general principles. 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 () { pthread_t th; pthread_join(th, 0); pthread_attr_init(0); pthread_cleanup_push(0, 0); pthread_create(0,0,0,0); pthread_cleanup_pop(0); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then acx_pthread_ok=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS="$save_LIBS" CFLAGS="$save_CFLAGS" { $as_echo "$as_me:$LINENO: result: $acx_pthread_ok" >&5 $as_echo "$acx_pthread_ok" >&6; } if test "x$acx_pthread_ok" = xyes; then break; fi PTHREAD_LIBS="" PTHREAD_CFLAGS="" done fi # Various other checks: if test "x$acx_pthread_ok" = xyes; then save_LIBS="$LIBS" LIBS="$PTHREAD_LIBS $LIBS" save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS $PTHREAD_CFLAGS" # Detect AIX lossage: JOINABLE attribute is called UNDETACHED. { $as_echo "$as_me:$LINENO: checking for joinable pthread attribute" >&5 $as_echo_n "checking for joinable pthread attribute... " >&6; } attr_name=unknown for attr in PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED; do 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 attr=$attr; return attr; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then attr_name=$attr; break else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext done { $as_echo "$as_me:$LINENO: result: $attr_name" >&5 $as_echo "$attr_name" >&6; } if test "$attr_name" != PTHREAD_CREATE_JOINABLE; then cat >>confdefs.h <<_ACEOF #define PTHREAD_CREATE_JOINABLE $attr_name _ACEOF fi { $as_echo "$as_me:$LINENO: checking if more special flags are required for pthreads" >&5 $as_echo_n "checking if more special flags are required for pthreads... " >&6; } flag=no case "${host_cpu}-${host_os}" in *-aix* | *-freebsd* | *-darwin*) flag="-D_THREAD_SAFE";; *solaris* | *-osf* | *-hpux*) flag="-D_REENTRANT";; esac { $as_echo "$as_me:$LINENO: result: ${flag}" >&5 $as_echo "${flag}" >&6; } if test "x$flag" != xno; then PTHREAD_CFLAGS="$flag $PTHREAD_CFLAGS" fi LIBS="$save_LIBS" CFLAGS="$save_CFLAGS" # More AIX lossage: must compile with xlc_r or cc_r if test x"$GCC" != xyes; then for ac_prog in xlc_r cc_r do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_PTHREAD_CC+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$PTHREAD_CC"; then ac_cv_prog_PTHREAD_CC="$PTHREAD_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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_PTHREAD_CC="$ac_prog" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi PTHREAD_CC=$ac_cv_prog_PTHREAD_CC if test -n "$PTHREAD_CC"; then { $as_echo "$as_me:$LINENO: result: $PTHREAD_CC" >&5 $as_echo "$PTHREAD_CC" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi test -n "$PTHREAD_CC" && break done test -n "$PTHREAD_CC" || PTHREAD_CC="${CC}" else PTHREAD_CC=$CC fi else PTHREAD_CC="$CC" fi # Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND: if test x"$acx_pthread_ok" = xyes; then cat >>confdefs.h <<\_ACEOF #define HAVE_PTHREAD 1 _ACEOF : else acx_pthread_ok=no { { $as_echo "$as_me:$LINENO: error: POSIX threads missing" >&5 $as_echo "$as_me: error: POSIX threads missing" >&2;} { (exit 1); exit 1; }; } fi ac_ext=cpp 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 $FREEBSD_OS -eq 1; then ADD_PTHREAD_CFLAGS="$PTHREAD_CFLAGS $PTHREAD_LIBS" fi if test "x$STATIC_OPTION_ENABLED" = xyes; then CFLAGS="$CFLAGS $PTHREAD_CFLAGS" LIBS="$LIBS $PTHREAD_LIBS" CFLAGS_SAVE="$CFLAGS_SAVE $PTHREAD_CFLAGS" LIBS_SAVE="$LIBS_SAVE $PTHREAD_LIBS" fi fi unset LIBS # we might need librt for sqlite mt_rt_arg_default=yes mt_rt_library_status=yes LIBS_SAVE=$LIBS LDFLAGS_SAVE=$LDFLAGS CFLAGS_SAVE=$CFLAGS CXXFLAGS_SAVE=$CXXFLAGS CPPFLAGS_SAVE=$CPPFLAGS # Check whether --with-rt-libs was given. if test "${with_rt_libs+set}" = set; then withval=$with_rt_libs; mt_rt_search_libs="$withval" { $as_echo "$as_me:$LINENO: Will search for rt libs in $withval" >&5 $as_echo "$as_me: Will search for rt libs in $withval" >&6;} fi if test "$mt_rt_search_libs" ; then unset ac_cv_lib_rt_clock_gettime LDFLAGS="$LDFLAGS -L$mt_rt_search_libs" { $as_echo "$as_me:$LINENO: checking for clock_gettime in -lrt" >&5 $as_echo_n "checking for clock_gettime in -lrt... " >&6; } if test "${ac_cv_lib_rt_clock_gettime+set}" = set; then $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lrt $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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char clock_gettime (); int main () { return clock_gettime (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_lib_rt_clock_gettime=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_rt_clock_gettime=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_rt_clock_gettime" >&5 $as_echo "$ac_cv_lib_rt_clock_gettime" >&6; } if test "x$ac_cv_lib_rt_clock_gettime" = x""yes; then mt_rt_libs="-lrt" mt_rt_ldflags="-L$mt_rt_search_libs" else mt_rt_library_status=missing if test "" = "pass"; then { $as_echo "$as_me:$LINENO: rt library not found in requested location $mt_rt_search_libs" >&5 $as_echo "$as_me: rt library not found in requested location $mt_rt_search_libs" >&6;} else { { $as_echo "$as_me:$LINENO: error: rt library not found in requested location $mt_rt_search_libs" >&5 $as_echo "$as_me: error: rt library not found in requested location $mt_rt_search_libs" >&2;} { (exit 1); exit 1; }; } fi fi else unset ac_cv_lib_rt_clock_gettime { $as_echo "$as_me:$LINENO: checking for clock_gettime in -lrt" >&5 $as_echo_n "checking for clock_gettime in -lrt... " >&6; } if test "${ac_cv_lib_rt_clock_gettime+set}" = set; then $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lrt $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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char clock_gettime (); int main () { return clock_gettime (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_lib_rt_clock_gettime=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_rt_clock_gettime=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_rt_clock_gettime" >&5 $as_echo "$ac_cv_lib_rt_clock_gettime" >&6; } if test "x$ac_cv_lib_rt_clock_gettime" = x""yes; then mt_rt_libs="-lrt" else LDFLAGS="$LDFLAGS -L$MT_SEARCHPATH_LIBS" unset ac_cv_lib_rt_clock_gettime { $as_echo "$as_me:$LINENO: checking for clock_gettime in -lrt" >&5 $as_echo_n "checking for clock_gettime in -lrt... " >&6; } if test "${ac_cv_lib_rt_clock_gettime+set}" = set; then $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lrt $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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char clock_gettime (); int main () { return clock_gettime (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_lib_rt_clock_gettime=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_rt_clock_gettime=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_rt_clock_gettime" >&5 $as_echo "$ac_cv_lib_rt_clock_gettime" >&6; } if test "x$ac_cv_lib_rt_clock_gettime" = x""yes; then mt_rt_libs="-lrt" mt_rt_ldflags="-L$MT_SEARCHPATH_LIBS" else mt_rt_library_status=missing fi fi fi if test "x$mt_rt_library_status" != xyes; then mt_rt_libs="" mt_rt_ldflags="" fi LIBS=$LIBS_SAVE LDFLAGS=$LDFLAGS_SAVE CFLAGS=$CFLAGS_SAVE CXXFLAGS=$CXXFLAGS_SAVE CPPFLAGS=$CPPFLAGS_SAVE RT_LIBS=${mt_rt_libs} RT_LDFLAGS=${mt_rt_ldflags} RT_STATUS=${mt_rt_library_status} if test "x$RT_STATUS" != xyes; then { $as_echo "$as_me:$LINENO: checking for clock_gettime" >&5 $as_echo_n "checking for clock_gettime... " >&6; } if test "${ac_cv_func_clock_gettime+set}" = set; then $as_echo_n "(cached) " >&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 clock_gettime to an innocuous variant, in case declares clock_gettime. For example, HP-UX 11i declares gettimeofday. */ #define clock_gettime innocuous_clock_gettime /* System header to define __stub macros and hopefully few prototypes, which can conflict with char clock_gettime (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef clock_gettime /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char clock_gettime (); /* 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_clock_gettime || defined __stub___clock_gettime choke me #endif int main () { return clock_gettime (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_func_clock_gettime=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_clock_gettime=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi { $as_echo "$as_me:$LINENO: result: $ac_cv_func_clock_gettime" >&5 $as_echo "$ac_cv_func_clock_gettime" >&6; } fi ############ zlib mt_zlib_status=yes mt_zlib_option_enabled= mt_zlib_option_requested=no if test "xdisable" = xdisable; then mt_zlib_option_enabled=yes else mt_zlib_option_enabled=no fi # Check whether --enable-zlib was given. if test "${enable_zlib+set}" = set; then enableval=$enable_zlib; mt_zlib_option_enabled=$enableval mt_zlib_option_requested=yes fi ZLIB_OPTION_ENABLED=${mt_zlib_option_enabled} ZLIB_OPTION_REQUESTED=${mt_zlib_option_requested} if test "x${ZLIB_OPTION_ENABLED}" = xyes; then LIBS_SAVE=$LIBS LDFLAGS_SAVE=$LDFLAGS CFLAGS_SAVE=$CFLAGS CXXFLAGS_SAVE=$CXXFLAGS CPPFLAGS_SAVE=$CPPFLAGS mt_zlib_header_status=yes # Check whether --with-zlib-h was given. if test "${with_zlib_h+set}" = set; then withval=$with_zlib_h; mt_zlib_search_headers="$withval" { $as_echo "$as_me:$LINENO: Will search for zlib headers in $withval" >&5 $as_echo "$as_me: Will search for zlib headers in $withval" >&6;} fi if test "$mt_zlib_search_headers" ; then unset ac_cv_header_zlib_h CFLAGS="$CFLAGS -I${mt_zlib_search_headers}" CXXFLAGS="$CXXFLAGS -I${mt_zlib_search_headers}" CPPFLAGS="$CPPFLAGS -I${mt_zlib_search_headers}" as_ac_Header=`$as_echo "ac_cv_header_$mt_zlib_search_headers/zlib.h" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { $as_echo "$as_me:$LINENO: checking for $mt_zlib_search_headers/zlib.h" >&5 $as_echo_n "checking for $mt_zlib_search_headers/zlib.h... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:$LINENO: checking $mt_zlib_search_headers/zlib.h usability" >&5 $as_echo_n "checking $mt_zlib_search_headers/zlib.h usability... " >&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 <$mt_zlib_search_headers/zlib.h> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:$LINENO: checking $mt_zlib_search_headers/zlib.h presence" >&5 $as_echo_n "checking $mt_zlib_search_headers/zlib.h presence... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$mt_zlib_search_headers/zlib.h> _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&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 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else $as_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 { $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in yes:no: ) { $as_echo "$as_me:$LINENO: WARNING: $mt_zlib_search_headers/zlib.h: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $mt_zlib_search_headers/zlib.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $mt_zlib_search_headers/zlib.h: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $mt_zlib_search_headers/zlib.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { $as_echo "$as_me:$LINENO: WARNING: $mt_zlib_search_headers/zlib.h: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $mt_zlib_search_headers/zlib.h: present but cannot be compiled" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $mt_zlib_search_headers/zlib.h: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $mt_zlib_search_headers/zlib.h: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $mt_zlib_search_headers/zlib.h: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $mt_zlib_search_headers/zlib.h: see the Autoconf documentation" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $mt_zlib_search_headers/zlib.h: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $mt_zlib_search_headers/zlib.h: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $mt_zlib_search_headers/zlib.h: proceeding with the preprocessor's result" >&5 $as_echo "$as_me: WARNING: $mt_zlib_search_headers/zlib.h: proceeding with the preprocessor's result" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $mt_zlib_search_headers/zlib.h: in the future, the compiler will take precedence" >&5 $as_echo "$as_me: WARNING: $mt_zlib_search_headers/zlib.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------- ## ## Report this to jin@mediatomb.cc ## ## ------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { $as_echo "$as_me:$LINENO: checking for $mt_zlib_search_headers/zlib.h" >&5 $as_echo_n "checking for $mt_zlib_search_headers/zlib.h... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi as_val=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` if test "x$as_val" = x""yes; then mt_zlib_cxxflags="-I${mt_zlib_search_headers}" else mt_zlib_header_status=missing if test "" = "pass"; then { $as_echo "$as_me:$LINENO: zlib headers not found in requested location $mt_zlib_search_headers" >&5 $as_echo "$as_me: zlib headers not found in requested location $mt_zlib_search_headers" >&6;} else { { $as_echo "$as_me:$LINENO: error: zlib headers not found in requested location $mt_zlib_search_headers" >&5 $as_echo "$as_me: error: zlib headers not found in requested location $mt_zlib_search_headers" >&2;} { (exit 1); exit 1; }; } fi fi else unset ac_cv_header_zlib_h if test "${ac_cv_header_zlib_h+set}" = set; then { $as_echo "$as_me:$LINENO: checking for zlib.h" >&5 $as_echo_n "checking for zlib.h... " >&6; } if test "${ac_cv_header_zlib_h+set}" = set; then $as_echo_n "(cached) " >&6 fi { $as_echo "$as_me:$LINENO: result: $ac_cv_header_zlib_h" >&5 $as_echo "$ac_cv_header_zlib_h" >&6; } else # Is the header compilable? { $as_echo "$as_me:$LINENO: checking zlib.h usability" >&5 $as_echo_n "checking zlib.h usability... " >&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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:$LINENO: checking zlib.h presence" >&5 $as_echo_n "checking zlib.h presence... " >&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 { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&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 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else $as_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 { $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in yes:no: ) { $as_echo "$as_me:$LINENO: WARNING: zlib.h: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: zlib.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:$LINENO: WARNING: zlib.h: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: zlib.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { $as_echo "$as_me:$LINENO: WARNING: zlib.h: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: zlib.h: present but cannot be compiled" >&2;} { $as_echo "$as_me:$LINENO: WARNING: zlib.h: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: zlib.h: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:$LINENO: WARNING: zlib.h: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: zlib.h: see the Autoconf documentation" >&2;} { $as_echo "$as_me:$LINENO: WARNING: zlib.h: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: zlib.h: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:$LINENO: WARNING: zlib.h: proceeding with the preprocessor's result" >&5 $as_echo "$as_me: WARNING: zlib.h: proceeding with the preprocessor's result" >&2;} { $as_echo "$as_me:$LINENO: WARNING: zlib.h: in the future, the compiler will take precedence" >&5 $as_echo "$as_me: WARNING: zlib.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------- ## ## Report this to jin@mediatomb.cc ## ## ------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { $as_echo "$as_me:$LINENO: checking for zlib.h" >&5 $as_echo_n "checking for zlib.h... " >&6; } if test "${ac_cv_header_zlib_h+set}" = set; then $as_echo_n "(cached) " >&6 else ac_cv_header_zlib_h=$ac_header_preproc fi { $as_echo "$as_me:$LINENO: result: $ac_cv_header_zlib_h" >&5 $as_echo "$ac_cv_header_zlib_h" >&6; } fi if test "x$ac_cv_header_zlib_h" = x""yes; then : else CFLAGS="$CFLAGS -I$MT_SEARCHPATH_HEADERS" CXXFLAGS="$CXXFLAGS -I$MT_SEARCHPATH_HEADERS" CPPFLAGS="$CPPFLAGS -I$MT_SEARCHPATH_HEADERS" unset ac_cv_header_zlib_h as_ac_Header=`$as_echo "ac_cv_header_$MT_SEARCHPATH_HEADERS/zlib.h" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { $as_echo "$as_me:$LINENO: checking for $MT_SEARCHPATH_HEADERS/zlib.h" >&5 $as_echo_n "checking for $MT_SEARCHPATH_HEADERS/zlib.h... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:$LINENO: checking $MT_SEARCHPATH_HEADERS/zlib.h usability" >&5 $as_echo_n "checking $MT_SEARCHPATH_HEADERS/zlib.h usability... " >&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 <$MT_SEARCHPATH_HEADERS/zlib.h> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:$LINENO: checking $MT_SEARCHPATH_HEADERS/zlib.h presence" >&5 $as_echo_n "checking $MT_SEARCHPATH_HEADERS/zlib.h presence... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$MT_SEARCHPATH_HEADERS/zlib.h> _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&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 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else $as_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 { $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in yes:no: ) { $as_echo "$as_me:$LINENO: WARNING: $MT_SEARCHPATH_HEADERS/zlib.h: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $MT_SEARCHPATH_HEADERS/zlib.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $MT_SEARCHPATH_HEADERS/zlib.h: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $MT_SEARCHPATH_HEADERS/zlib.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { $as_echo "$as_me:$LINENO: WARNING: $MT_SEARCHPATH_HEADERS/zlib.h: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $MT_SEARCHPATH_HEADERS/zlib.h: present but cannot be compiled" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $MT_SEARCHPATH_HEADERS/zlib.h: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $MT_SEARCHPATH_HEADERS/zlib.h: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $MT_SEARCHPATH_HEADERS/zlib.h: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $MT_SEARCHPATH_HEADERS/zlib.h: see the Autoconf documentation" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $MT_SEARCHPATH_HEADERS/zlib.h: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $MT_SEARCHPATH_HEADERS/zlib.h: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $MT_SEARCHPATH_HEADERS/zlib.h: proceeding with the preprocessor's result" >&5 $as_echo "$as_me: WARNING: $MT_SEARCHPATH_HEADERS/zlib.h: proceeding with the preprocessor's result" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $MT_SEARCHPATH_HEADERS/zlib.h: in the future, the compiler will take precedence" >&5 $as_echo "$as_me: WARNING: $MT_SEARCHPATH_HEADERS/zlib.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------- ## ## Report this to jin@mediatomb.cc ## ## ------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { $as_echo "$as_me:$LINENO: checking for $MT_SEARCHPATH_HEADERS/zlib.h" >&5 $as_echo_n "checking for $MT_SEARCHPATH_HEADERS/zlib.h... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi as_val=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` if test "x$as_val" = x""yes; then mt_zlib_cxxflags="-I${MT_SEARCHPATH_HEADERS}" else mt_zlib_header_status=missing fi fi fi if test "x$mt_zlib_header_status" != xyes; then mt_zlib_cxxflags="" fi LIBS=$LIBS_SAVE LDFLAGS=$LDFLAGS_SAVE CFLAGS=$CFLAGS_SAVE CXXFLAGS=$CXXFLAGS_SAVE CPPFLAGS=$CPPFLAGS_SAVE mt_zlib_package_status=${mt_zlib_header_status} if test "x$mt_zlib_package_status" = xyes; then mt_zlib_arg_default=yes mt_zlib_library_status=yes LIBS_SAVE=$LIBS LDFLAGS_SAVE=$LDFLAGS CFLAGS_SAVE=$CFLAGS CXXFLAGS_SAVE=$CXXFLAGS CPPFLAGS_SAVE=$CPPFLAGS # Check whether --with-zlib-libs was given. if test "${with_zlib_libs+set}" = set; then withval=$with_zlib_libs; mt_zlib_search_libs="$withval" { $as_echo "$as_me:$LINENO: Will search for zlib libs in $withval" >&5 $as_echo "$as_me: Will search for zlib libs in $withval" >&6;} fi if test "$mt_zlib_search_libs" ; then unset ac_cv_lib_z_uncompress LDFLAGS="$LDFLAGS -L$mt_zlib_search_libs" { $as_echo "$as_me:$LINENO: checking for uncompress in -lz" >&5 $as_echo_n "checking for uncompress in -lz... " >&6; } if test "${ac_cv_lib_z_uncompress+set}" = set; then $as_echo_n "(cached) " >&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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char uncompress (); int main () { return uncompress (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_lib_z_uncompress=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_z_uncompress=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_z_uncompress" >&5 $as_echo "$ac_cv_lib_z_uncompress" >&6; } if test "x$ac_cv_lib_z_uncompress" = x""yes; then mt_zlib_libs="-lz" mt_zlib_ldflags="-L$mt_zlib_search_libs" else mt_zlib_library_status=missing if test "" = "pass"; then { $as_echo "$as_me:$LINENO: zlib library not found in requested location $mt_zlib_search_libs" >&5 $as_echo "$as_me: zlib library not found in requested location $mt_zlib_search_libs" >&6;} else { { $as_echo "$as_me:$LINENO: error: zlib library not found in requested location $mt_zlib_search_libs" >&5 $as_echo "$as_me: error: zlib library not found in requested location $mt_zlib_search_libs" >&2;} { (exit 1); exit 1; }; } fi fi else unset ac_cv_lib_z_uncompress { $as_echo "$as_me:$LINENO: checking for uncompress in -lz" >&5 $as_echo_n "checking for uncompress in -lz... " >&6; } if test "${ac_cv_lib_z_uncompress+set}" = set; then $as_echo_n "(cached) " >&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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char uncompress (); int main () { return uncompress (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_lib_z_uncompress=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_z_uncompress=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_z_uncompress" >&5 $as_echo "$ac_cv_lib_z_uncompress" >&6; } if test "x$ac_cv_lib_z_uncompress" = x""yes; then mt_zlib_libs="-lz" else LDFLAGS="$LDFLAGS -L$MT_SEARCHPATH_LIBS" unset ac_cv_lib_z_uncompress { $as_echo "$as_me:$LINENO: checking for uncompress in -lz" >&5 $as_echo_n "checking for uncompress in -lz... " >&6; } if test "${ac_cv_lib_z_uncompress+set}" = set; then $as_echo_n "(cached) " >&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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char uncompress (); int main () { return uncompress (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_lib_z_uncompress=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_z_uncompress=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_z_uncompress" >&5 $as_echo "$ac_cv_lib_z_uncompress" >&6; } if test "x$ac_cv_lib_z_uncompress" = x""yes; then mt_zlib_libs="-lz" mt_zlib_ldflags="-L$MT_SEARCHPATH_LIBS" else mt_zlib_library_status=missing fi fi fi if test "x$mt_zlib_library_status" != xyes; then mt_zlib_libs="" mt_zlib_ldflags="" fi LIBS=$LIBS_SAVE LDFLAGS=$LDFLAGS_SAVE CFLAGS=$CFLAGS_SAVE CXXFLAGS=$CXXFLAGS_SAVE CPPFLAGS=$CPPFLAGS_SAVE mt_zlib_package_status=${mt_zlib_library_status} fi if test "x$mt_zlib_package_status" = xyes; then ZLIB_CFLAGS=${mt_zlib_cxxflags} ZLIB_LIBS=${mt_zlib_libs} ZLIB_LDFLAGS=${mt_zlib_ldflags} fi mt_zlib_status=${mt_zlib_package_status} else mt_zlib_status=disabled fi if ((test "x${ZLIB_OPTION_ENABLED}" = xyes) && (test "x${ZLIB_OPTION_REQUESTED}" = xyes) && (test "x$mt_zlib_status" != xyes) && (test "" != "pass")); then { { $as_echo "$as_me:$LINENO: error: unable to configure zlib support" >&5 $as_echo "$as_me: error: unable to configure zlib support" >&2;} { (exit 1); exit 1; }; } fi if test "x$mt_zlib_status" = xyes; then cat >>confdefs.h <<\_ACEOF #define HAVE_ZLIB 1 _ACEOF fi ZLIB_STATUS=${mt_zlib_status} if test "x$ZLIB_STATUS" = xyes; then if test "x$DB_AUTOCREATE_OPTION_ENABLED" = xyes; then cat >>confdefs.h <<\_ACEOF #define AUTO_CREATE_DATABASE 1 _ACEOF fi else if test "x$DB_AUTOCREATE_OPTION_ENABLED" = xyes; then if test "x$DB_AUTOCREATE_OPTION_REQUESTED" = xyes; then { { $as_echo "$as_me:$LINENO: error: Automatic database creation not possible due to missing zlib headers/libraries" >&5 $as_echo "$as_me: error: Automatic database creation not possible due to missing zlib headers/libraries" >&2;} { (exit 1); exit 1; }; } else { $as_echo "$as_me:$LINENO: WARNING: Automatic database creation not possible due to missing zlib headers/libraries" >&5 $as_echo "$as_me: WARNING: Automatic database creation not possible due to missing zlib headers/libraries" >&2;} DB_AUTOCREATE_OPTION_ENABLED=disabled fi fi fi cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, we kill variables containing newlines. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. ( for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:$LINENO: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) $as_unset $ac_var ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes (double-quote # substitution turns \\\\ into \\, and sed turns \\ into \). sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then test "x$cache_file" != "x/dev/null" && { $as_echo "$as_me:$LINENO: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} cat confcache >$cache_file else { $as_echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache ######### SQLite3 if test "x$RT_STATUS" = xyes; then LDFLAGS="$LDFLAGS $RT_LDFLAGS $RT_LIBS" fi mt_sqlite3_status=yes mt_sqlite3_option_enabled= mt_sqlite3_option_requested=no if test "xdisable" = xdisable; then mt_sqlite3_option_enabled=yes else mt_sqlite3_option_enabled=no fi # Check whether --enable-sqlite3 was given. if test "${enable_sqlite3+set}" = set; then enableval=$enable_sqlite3; mt_sqlite3_option_enabled=$enableval mt_sqlite3_option_requested=yes fi SQLITE3_OPTION_ENABLED=${mt_sqlite3_option_enabled} SQLITE3_OPTION_REQUESTED=${mt_sqlite3_option_requested} if test "x${SQLITE3_OPTION_ENABLED}" = xyes; then LIBS_SAVE=$LIBS LDFLAGS_SAVE=$LDFLAGS CFLAGS_SAVE=$CFLAGS CXXFLAGS_SAVE=$CXXFLAGS CPPFLAGS_SAVE=$CPPFLAGS mt_sqlite3_header_status=yes # Check whether --with-sqlite3-h was given. if test "${with_sqlite3_h+set}" = set; then withval=$with_sqlite3_h; mt_sqlite3_search_headers="$withval" { $as_echo "$as_me:$LINENO: Will search for sqlite3 headers in $withval" >&5 $as_echo "$as_me: Will search for sqlite3 headers in $withval" >&6;} fi if test "$mt_sqlite3_search_headers" ; then unset ac_cv_header_sqlite3_h CFLAGS="$CFLAGS -I${mt_sqlite3_search_headers}" CXXFLAGS="$CXXFLAGS -I${mt_sqlite3_search_headers}" CPPFLAGS="$CPPFLAGS -I${mt_sqlite3_search_headers}" as_ac_Header=`$as_echo "ac_cv_header_$mt_sqlite3_search_headers/sqlite3.h" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { $as_echo "$as_me:$LINENO: checking for $mt_sqlite3_search_headers/sqlite3.h" >&5 $as_echo_n "checking for $mt_sqlite3_search_headers/sqlite3.h... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:$LINENO: checking $mt_sqlite3_search_headers/sqlite3.h usability" >&5 $as_echo_n "checking $mt_sqlite3_search_headers/sqlite3.h usability... " >&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 <$mt_sqlite3_search_headers/sqlite3.h> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:$LINENO: checking $mt_sqlite3_search_headers/sqlite3.h presence" >&5 $as_echo_n "checking $mt_sqlite3_search_headers/sqlite3.h presence... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$mt_sqlite3_search_headers/sqlite3.h> _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&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 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else $as_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 { $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in yes:no: ) { $as_echo "$as_me:$LINENO: WARNING: $mt_sqlite3_search_headers/sqlite3.h: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $mt_sqlite3_search_headers/sqlite3.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $mt_sqlite3_search_headers/sqlite3.h: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $mt_sqlite3_search_headers/sqlite3.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { $as_echo "$as_me:$LINENO: WARNING: $mt_sqlite3_search_headers/sqlite3.h: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $mt_sqlite3_search_headers/sqlite3.h: present but cannot be compiled" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $mt_sqlite3_search_headers/sqlite3.h: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $mt_sqlite3_search_headers/sqlite3.h: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $mt_sqlite3_search_headers/sqlite3.h: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $mt_sqlite3_search_headers/sqlite3.h: see the Autoconf documentation" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $mt_sqlite3_search_headers/sqlite3.h: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $mt_sqlite3_search_headers/sqlite3.h: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $mt_sqlite3_search_headers/sqlite3.h: proceeding with the preprocessor's result" >&5 $as_echo "$as_me: WARNING: $mt_sqlite3_search_headers/sqlite3.h: proceeding with the preprocessor's result" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $mt_sqlite3_search_headers/sqlite3.h: in the future, the compiler will take precedence" >&5 $as_echo "$as_me: WARNING: $mt_sqlite3_search_headers/sqlite3.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------- ## ## Report this to jin@mediatomb.cc ## ## ------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { $as_echo "$as_me:$LINENO: checking for $mt_sqlite3_search_headers/sqlite3.h" >&5 $as_echo_n "checking for $mt_sqlite3_search_headers/sqlite3.h... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi as_val=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` if test "x$as_val" = x""yes; then mt_sqlite3_cxxflags="-I${mt_sqlite3_search_headers}" else mt_sqlite3_header_status=missing if test "" = "pass"; then { $as_echo "$as_me:$LINENO: sqlite3 headers not found in requested location $mt_sqlite3_search_headers" >&5 $as_echo "$as_me: sqlite3 headers not found in requested location $mt_sqlite3_search_headers" >&6;} else { { $as_echo "$as_me:$LINENO: error: sqlite3 headers not found in requested location $mt_sqlite3_search_headers" >&5 $as_echo "$as_me: error: sqlite3 headers not found in requested location $mt_sqlite3_search_headers" >&2;} { (exit 1); exit 1; }; } fi fi else unset ac_cv_header_sqlite3_h if test "${ac_cv_header_sqlite3_h+set}" = set; then { $as_echo "$as_me:$LINENO: checking for sqlite3.h" >&5 $as_echo_n "checking for sqlite3.h... " >&6; } if test "${ac_cv_header_sqlite3_h+set}" = set; then $as_echo_n "(cached) " >&6 fi { $as_echo "$as_me:$LINENO: result: $ac_cv_header_sqlite3_h" >&5 $as_echo "$ac_cv_header_sqlite3_h" >&6; } else # Is the header compilable? { $as_echo "$as_me:$LINENO: checking sqlite3.h usability" >&5 $as_echo_n "checking sqlite3.h usability... " >&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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:$LINENO: checking sqlite3.h presence" >&5 $as_echo_n "checking sqlite3.h presence... " >&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 { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&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 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else $as_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 { $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in yes:no: ) { $as_echo "$as_me:$LINENO: WARNING: sqlite3.h: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: sqlite3.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:$LINENO: WARNING: sqlite3.h: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: sqlite3.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { $as_echo "$as_me:$LINENO: WARNING: sqlite3.h: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: sqlite3.h: present but cannot be compiled" >&2;} { $as_echo "$as_me:$LINENO: WARNING: sqlite3.h: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: sqlite3.h: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:$LINENO: WARNING: sqlite3.h: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: sqlite3.h: see the Autoconf documentation" >&2;} { $as_echo "$as_me:$LINENO: WARNING: sqlite3.h: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: sqlite3.h: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:$LINENO: WARNING: sqlite3.h: proceeding with the preprocessor's result" >&5 $as_echo "$as_me: WARNING: sqlite3.h: proceeding with the preprocessor's result" >&2;} { $as_echo "$as_me:$LINENO: WARNING: sqlite3.h: in the future, the compiler will take precedence" >&5 $as_echo "$as_me: WARNING: sqlite3.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------- ## ## Report this to jin@mediatomb.cc ## ## ------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { $as_echo "$as_me:$LINENO: checking for sqlite3.h" >&5 $as_echo_n "checking for sqlite3.h... " >&6; } if test "${ac_cv_header_sqlite3_h+set}" = set; then $as_echo_n "(cached) " >&6 else ac_cv_header_sqlite3_h=$ac_header_preproc fi { $as_echo "$as_me:$LINENO: result: $ac_cv_header_sqlite3_h" >&5 $as_echo "$ac_cv_header_sqlite3_h" >&6; } fi if test "x$ac_cv_header_sqlite3_h" = x""yes; then : else CFLAGS="$CFLAGS -I$MT_SEARCHPATH_HEADERS" CXXFLAGS="$CXXFLAGS -I$MT_SEARCHPATH_HEADERS" CPPFLAGS="$CPPFLAGS -I$MT_SEARCHPATH_HEADERS" unset ac_cv_header_sqlite3_h as_ac_Header=`$as_echo "ac_cv_header_$MT_SEARCHPATH_HEADERS/sqlite3.h" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { $as_echo "$as_me:$LINENO: checking for $MT_SEARCHPATH_HEADERS/sqlite3.h" >&5 $as_echo_n "checking for $MT_SEARCHPATH_HEADERS/sqlite3.h... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:$LINENO: checking $MT_SEARCHPATH_HEADERS/sqlite3.h usability" >&5 $as_echo_n "checking $MT_SEARCHPATH_HEADERS/sqlite3.h usability... " >&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 <$MT_SEARCHPATH_HEADERS/sqlite3.h> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:$LINENO: checking $MT_SEARCHPATH_HEADERS/sqlite3.h presence" >&5 $as_echo_n "checking $MT_SEARCHPATH_HEADERS/sqlite3.h presence... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$MT_SEARCHPATH_HEADERS/sqlite3.h> _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&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 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else $as_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 { $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in yes:no: ) { $as_echo "$as_me:$LINENO: WARNING: $MT_SEARCHPATH_HEADERS/sqlite3.h: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $MT_SEARCHPATH_HEADERS/sqlite3.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $MT_SEARCHPATH_HEADERS/sqlite3.h: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $MT_SEARCHPATH_HEADERS/sqlite3.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { $as_echo "$as_me:$LINENO: WARNING: $MT_SEARCHPATH_HEADERS/sqlite3.h: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $MT_SEARCHPATH_HEADERS/sqlite3.h: present but cannot be compiled" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $MT_SEARCHPATH_HEADERS/sqlite3.h: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $MT_SEARCHPATH_HEADERS/sqlite3.h: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $MT_SEARCHPATH_HEADERS/sqlite3.h: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $MT_SEARCHPATH_HEADERS/sqlite3.h: see the Autoconf documentation" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $MT_SEARCHPATH_HEADERS/sqlite3.h: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $MT_SEARCHPATH_HEADERS/sqlite3.h: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $MT_SEARCHPATH_HEADERS/sqlite3.h: proceeding with the preprocessor's result" >&5 $as_echo "$as_me: WARNING: $MT_SEARCHPATH_HEADERS/sqlite3.h: proceeding with the preprocessor's result" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $MT_SEARCHPATH_HEADERS/sqlite3.h: in the future, the compiler will take precedence" >&5 $as_echo "$as_me: WARNING: $MT_SEARCHPATH_HEADERS/sqlite3.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------- ## ## Report this to jin@mediatomb.cc ## ## ------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { $as_echo "$as_me:$LINENO: checking for $MT_SEARCHPATH_HEADERS/sqlite3.h" >&5 $as_echo_n "checking for $MT_SEARCHPATH_HEADERS/sqlite3.h... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi as_val=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` if test "x$as_val" = x""yes; then mt_sqlite3_cxxflags="-I${MT_SEARCHPATH_HEADERS}" else mt_sqlite3_header_status=missing fi fi fi if test "x$mt_sqlite3_header_status" != xyes; then mt_sqlite3_cxxflags="" fi LIBS=$LIBS_SAVE LDFLAGS=$LDFLAGS_SAVE CFLAGS=$CFLAGS_SAVE CXXFLAGS=$CXXFLAGS_SAVE CPPFLAGS=$CPPFLAGS_SAVE mt_sqlite3_package_status=${mt_sqlite3_header_status} if test "x$mt_sqlite3_package_status" = xyes; then mt_sqlite3_arg_default=yes mt_sqlite3_library_status=yes LIBS_SAVE=$LIBS LDFLAGS_SAVE=$LDFLAGS CFLAGS_SAVE=$CFLAGS CXXFLAGS_SAVE=$CXXFLAGS CPPFLAGS_SAVE=$CPPFLAGS # Check whether --with-sqlite3-libs was given. if test "${with_sqlite3_libs+set}" = set; then withval=$with_sqlite3_libs; mt_sqlite3_search_libs="$withval" { $as_echo "$as_me:$LINENO: Will search for sqlite3 libs in $withval" >&5 $as_echo "$as_me: Will search for sqlite3 libs in $withval" >&6;} fi if test "$mt_sqlite3_search_libs" ; then unset ac_cv_lib_sqlite3_sqlite3_open LDFLAGS="$LDFLAGS -L$mt_sqlite3_search_libs" { $as_echo "$as_me:$LINENO: checking for sqlite3_open in -lsqlite3" >&5 $as_echo_n "checking for sqlite3_open in -lsqlite3... " >&6; } if test "${ac_cv_lib_sqlite3_sqlite3_open+set}" = set; then $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsqlite3 $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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char sqlite3_open (); int main () { return sqlite3_open (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_lib_sqlite3_sqlite3_open=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_sqlite3_sqlite3_open=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_sqlite3_sqlite3_open" >&5 $as_echo "$ac_cv_lib_sqlite3_sqlite3_open" >&6; } if test "x$ac_cv_lib_sqlite3_sqlite3_open" = x""yes; then mt_sqlite3_libs="-lsqlite3" mt_sqlite3_ldflags="-L$mt_sqlite3_search_libs" else mt_sqlite3_library_status=missing if test "" = "pass"; then { $as_echo "$as_me:$LINENO: sqlite3 library not found in requested location $mt_sqlite3_search_libs" >&5 $as_echo "$as_me: sqlite3 library not found in requested location $mt_sqlite3_search_libs" >&6;} else { { $as_echo "$as_me:$LINENO: error: sqlite3 library not found in requested location $mt_sqlite3_search_libs" >&5 $as_echo "$as_me: error: sqlite3 library not found in requested location $mt_sqlite3_search_libs" >&2;} { (exit 1); exit 1; }; } fi fi else unset ac_cv_lib_sqlite3_sqlite3_open { $as_echo "$as_me:$LINENO: checking for sqlite3_open in -lsqlite3" >&5 $as_echo_n "checking for sqlite3_open in -lsqlite3... " >&6; } if test "${ac_cv_lib_sqlite3_sqlite3_open+set}" = set; then $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsqlite3 $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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char sqlite3_open (); int main () { return sqlite3_open (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_lib_sqlite3_sqlite3_open=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_sqlite3_sqlite3_open=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_sqlite3_sqlite3_open" >&5 $as_echo "$ac_cv_lib_sqlite3_sqlite3_open" >&6; } if test "x$ac_cv_lib_sqlite3_sqlite3_open" = x""yes; then mt_sqlite3_libs="-lsqlite3" else LDFLAGS="$LDFLAGS -L$MT_SEARCHPATH_LIBS" unset ac_cv_lib_sqlite3_sqlite3_open { $as_echo "$as_me:$LINENO: checking for sqlite3_open in -lsqlite3" >&5 $as_echo_n "checking for sqlite3_open in -lsqlite3... " >&6; } if test "${ac_cv_lib_sqlite3_sqlite3_open+set}" = set; then $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsqlite3 $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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char sqlite3_open (); int main () { return sqlite3_open (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_lib_sqlite3_sqlite3_open=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_sqlite3_sqlite3_open=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_sqlite3_sqlite3_open" >&5 $as_echo "$ac_cv_lib_sqlite3_sqlite3_open" >&6; } if test "x$ac_cv_lib_sqlite3_sqlite3_open" = x""yes; then mt_sqlite3_libs="-lsqlite3" mt_sqlite3_ldflags="-L$MT_SEARCHPATH_LIBS" else mt_sqlite3_library_status=missing fi fi fi if test "x$mt_sqlite3_library_status" != xyes; then mt_sqlite3_libs="" mt_sqlite3_ldflags="" fi LIBS=$LIBS_SAVE LDFLAGS=$LDFLAGS_SAVE CFLAGS=$CFLAGS_SAVE CXXFLAGS=$CXXFLAGS_SAVE CPPFLAGS=$CPPFLAGS_SAVE mt_sqlite3_package_status=${mt_sqlite3_library_status} fi if test "x$mt_sqlite3_package_status" = xyes; then SQLITE3_CFLAGS=${mt_sqlite3_cxxflags} SQLITE3_LIBS=${mt_sqlite3_libs} SQLITE3_LDFLAGS=${mt_sqlite3_ldflags} fi mt_sqlite3_status=${mt_sqlite3_package_status} else mt_sqlite3_status=disabled fi if ((test "x${SQLITE3_OPTION_ENABLED}" = xyes) && (test "x${SQLITE3_OPTION_REQUESTED}" = xyes) && (test "x$mt_sqlite3_status" != xyes) && (test "" != "pass")); then { { $as_echo "$as_me:$LINENO: error: unable to configure sqlite3 support" >&5 $as_echo "$as_me: error: unable to configure sqlite3 support" >&2;} { (exit 1); exit 1; }; } fi if test "x$mt_sqlite3_status" = xyes; then cat >>confdefs.h <<\_ACEOF #define HAVE_SQLITE3 1 _ACEOF fi SQLITE3_STATUS=${mt_sqlite3_status} if test "x$SQLITE3_STATUS" = xyes; then if test "x$RT_STATUS" = xyes; then SQLITE_LDFLAGS="$SQLITE_LDFLAGS $RT_LDFLAGS" SQLITE_LIBS="$SQLITE_LIBS $RT_LIBS" fi if test "x$SQLITE_BACKUP_OPTION_ENABLED" = xyes; then cat >>confdefs.h <<\_ACEOF #define SQLITE_BACKUP_ENABLED 1 _ACEOF fi else if (test "x$SQLITE_BACKUP_OPTION_ENABLED" = xyes) && (test "x$SQLITE_BACKUP_OPTION_REQUESTED" = xyes); then { { $as_echo "$as_me:$LINENO: error: You specified the option to use sqlite backup settings but the sqlite support could not be configured" >&5 $as_echo "$as_me: error: You specified the option to use sqlite backup settings but the sqlite support could not be configured" >&2;} { (exit 1); exit 1; }; } fi fi LDFLAGS="$LDFLAGS_SAVE" CPPFLAGS="$CPPFLAGS_SAVE" CXXFLAGS="$CXXFLAGS_SAVE" ########## MySQL mt_mysql_status=yes mt_mysql_requested=no mt_mysql_option_enabled= mt_mysql_option_requested=no if test "xdisable" = xdisable; then mt_mysql_option_enabled=yes else mt_mysql_option_enabled=no fi # Check whether --enable-mysql was given. if test "${enable_mysql+set}" = set; then enableval=$enable_mysql; mt_mysql_option_enabled=$enableval mt_mysql_option_requested=yes fi MYSQL_OPTION_ENABLED=${mt_mysql_option_enabled} MYSQL_OPTION_REQUESTED=${mt_mysql_option_requested} if test "x${MYSQL_OPTION_ENABLED}" = xyes; then LIBS_SAVE=$LIBS LDFLAGS_SAVE=$LDFLAGS CFLAGS_SAVE=$CFLAGS CXXFLAGS_SAVE=$CXXFLAGS CPPFLAGS_SAVE=$CPPFLAGS mt_mysql_config=none mt_mysql_package_status=yes # Check whether --with-mysql-cfg was given. if test "${with_mysql_cfg+set}" = set; then withval=$with_mysql_cfg; mt_mysql_search_config="$withval" { $as_echo "$as_me:$LINENO: Will search for mysql config in $withval" >&5 $as_echo "$as_me: Will search for mysql config in $withval" >&6;} fi if test -n "$mt_mysql_search_config"; then { $as_echo "$as_me:$LINENO: You specified ${mt_mysql_search_config} for mysql_config" >&5 $as_echo "$as_me: You specified ${mt_mysql_search_config} for mysql_config" >&6;} if test -f "$mt_mysql_search_config"; then mt_mysql_config=${mt_mysql_search_config} else { { $as_echo "$as_me:$LINENO: error: ${mt_mysql_search_config} not found" >&5 $as_echo "$as_me: error: ${mt_mysql_search_config} not found" >&2;} { (exit 1); exit 1; }; } fi mt_mysql_version=`${mt_mysql_config} --version 2>/dev/null` if test -z "$mt_mysql_version"; then { { $as_echo "$as_me:$LINENO: error: ${mt_mysql_search_config} could not be executed or returned invalid values" >&5 $as_echo "$as_me: error: ${mt_mysql_search_config} could not be executed or returned invalid values" >&2;} { (exit 1); exit 1; }; } fi else # Extract the first word of "mysql_config", so it can be a program name with args. set dummy mysql_config; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_mt_mysql_config+set}" = set; then $as_echo_n "(cached) " >&6 else case $mt_mysql_config in [\\/]* | ?:[\\/]*) ac_cv_path_mt_mysql_config="$mt_mysql_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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_mt_mysql_config="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_mt_mysql_config" && ac_cv_path_mt_mysql_config="none" ;; esac fi mt_mysql_config=$ac_cv_path_mt_mysql_config if test -n "$mt_mysql_config"; then { $as_echo "$as_me:$LINENO: result: $mt_mysql_config" >&5 $as_echo "$mt_mysql_config" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi if test "x$mt_mysql_config" = xnone; then unset ac_cv_path_mt_mysql_config # Extract the first word of "mysql_config", so it can be a program name with args. set dummy mysql_config; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_mt_mysql_config+set}" = set; then $as_echo_n "(cached) " >&6 else case $mt_mysql_config in [\\/]* | ?:[\\/]*) ac_cv_path_mt_mysql_config="$mt_mysql_config" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $MT_SEARCHPATH_PROGS do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_mt_mysql_config="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_mt_mysql_config" && ac_cv_path_mt_mysql_config="none" ;; esac fi mt_mysql_config=$ac_cv_path_mt_mysql_config if test -n "$mt_mysql_config"; then { $as_echo "$as_me:$LINENO: result: $mt_mysql_config" >&5 $as_echo "$mt_mysql_config" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi if test "x$mt_mysql_config" = xnone; then mt_mysql_package_status=missing { $as_echo "$as_me:$LINENO: result: mysql_config not found, please install the mysql devel package" >&5 $as_echo "mysql_config not found, please install the mysql devel package" >&6; } fi fi mt_mysql_version=`${mt_mysql_config} --version 2>/dev/null` if test -z "$mt_mysql_version"; then { $as_echo "$as_me:$LINENO: ${mt_mysql_config} could not be executed or returned invalid values" >&5 $as_echo "$as_me: ${mt_mysql_config} could not be executed or returned invalid values" >&6;} mt_mysql_package_status=missing fi fi if test "x$mt_mysql_package_status" = xyes; then { $as_echo "$as_me:$LINENO: checking mysql cflags" >&5 $as_echo_n "checking mysql cflags... " >&6; } mt_mysql_cxxflags=`${mt_mysql_config} --cflags` { $as_echo "$as_me:$LINENO: result: $mt_mysql_cxxflags" >&5 $as_echo "$mt_mysql_cxxflags" >&6; } mt_mysql_libs= { $as_echo "$as_me:$LINENO: checking mysql libs" >&5 $as_echo_n "checking mysql libs... " >&6; } if test -z "--libs_r"; then mt_mysql_libs=`${mt_mysql_config} --libs` else mt_mysql_libs=`${mt_mysql_config} --libs_r` fi { $as_echo "$as_me:$LINENO: result: $mt_mysql_libs" >&5 $as_echo "$mt_mysql_libs" >&6; } fi if test "x$mt_mysql_package_status" = xyes; then CPPFLAGS="$CPPFLAGS $mt_mysql_cxxflags" CXXFLAGS="$CXXFLAGS $mt_mysql_cxxflags" CFLAGS="$CFLAGS $mt_mysql_cxxflags" for mt_u_header in mysql_h; do unset ac_cv_header_${mt_u_header} done for ac_header in mysql.h do as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 $as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 $as_echo_n "checking $ac_header usability... " >&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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 $as_echo_n "checking $ac_header presence... " >&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 { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&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 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else $as_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 { $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in yes:no: ) { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 $as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 $as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------- ## ## Report this to jin@mediatomb.cc ## ## ------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 $as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi as_val=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF else mt_mysql_package_status=missing fi done fi if test "x$mt_mysql_package_status" = xyes; then LIBS="$mt_mysql_libs $LIBS" if test -z ""; then unset ac_cv_func_mysql_init for ac_func in mysql_init do as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` { $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 $as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $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 #endif int main () { return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then eval "$as_ac_var=yes" else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval 'as_val=${'$as_ac_var'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } as_val=`eval 'as_val=${'$as_ac_var'} $as_echo "$as_val"'` if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF else mt_mysql_package_status=missing fi done else unset ac_cv_lib__mysql_init { $as_echo "$as_me:$LINENO: checking for mysql_init in -l" >&5 $as_echo_n "checking for mysql_init in -l... " >&6; } if test "${ac_cv_lib__mysql_init+set}" = set; then $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-l $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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char mysql_init (); int main () { return mysql_init (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_lib__mysql_init=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib__mysql_init=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:$LINENO: result: $ac_cv_lib__mysql_init" >&5 $as_echo "$ac_cv_lib__mysql_init" >&6; } if test "x$ac_cv_lib__mysql_init" = x""yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIB 1 _ACEOF LIBS="-l $LIBS" else mt_mysql_package_status=missing fi fi fi if test "x$mt_mysql_package_status" = xyes; then MYSQL_CFLAGS=${mt_mysql_cxxflags} MYSQL_LIBS=${mt_mysql_libs} MYSQL_VERSION=${mt_mysql_version} fi LIBS=$LIBS_SAVE LDFLAGS=$LDFLAGS_SAVE CFLAGS=$CFLAGS_SAVE CXXFLAGS=$CXXFLAGS_SAVE CPPFLAGS=$CPPFLAGS_SAVE mt_mysql_status=${mt_mysql_package_status} else mt_mysql_status=disabled fi if ((test "x${MYSQL_OPTION_ENABLED}" = xyes) && (test "x${MYSQL_OPTION_REQUESTED}" = xyes) && (test "x$mt_mysql_status" != xyes)); then { { $as_echo "$as_me:$LINENO: error: unable to configure mysql support" >&5 $as_echo "$as_me: error: unable to configure mysql support" >&2;} { (exit 1); exit 1; }; } fi if test "x$mt_mysql_status" = xyes; then cat >>confdefs.h <<\_ACEOF #define HAVE_MYSQL 1 _ACEOF fi MYSQL_STATUS=${mt_mysql_status} # AS_IF([test x"$mt_mysql_status" = xyes], [--libs_r], [])[]dnl if test "x$MYSQL_STATUS" = xyes; then { $as_echo "$as_me:$LINENO: checking mysql version" >&5 $as_echo_n "checking mysql version... " >&6; } MYSQL_VERSION_MAJOR=`echo $MYSQL_VERSION | sed 's/^\([0-9]\{1,\}\)\.\([0-9]\{1,\}\).\([0-9]\{1,\}\).*$/\1/'` MYSQL_VERSION_MINOR=`echo $MYSQL_VERSION | sed 's/^\([0-9]\{1,\}\)\.\([0-9]\{1,\}\).\([0-9]\{1,\}\).*$/\2/'` { $as_echo "$as_me:$LINENO: result: $MYSQL_VERSION" >&5 $as_echo "$MYSQL_VERSION" >&6; } if test -z $MYSQL_VERSION_MAJOR || test -z $MYSQL_VERSION_MINOR; then { $as_echo "$as_me:$LINENO: WARNING: could not parse mysql version string" >&5 $as_echo "$as_me: WARNING: could not parse mysql version string" >&2;} MYSQL_STATUS=missing elif test $MYSQL_VERSION_MAJOR -le 3 ; then { $as_echo "$as_me:$LINENO: WARNING: MySQL version too old" >&5 $as_echo "$as_me: WARNING: MySQL version too old" >&2;} MYSQL_STATUS=missing fi fi LDFLAGS="$LDFLAGS_SAVE" LIBS="$LIBS $MYSQL_LIBS" CFLAGS="$CFLAGS $MYSQL_CFLAGS" CXXFLAGS="$CXXFLAGS $MYSQL_CFLAGS" CPPFLAGS="$CFLAGS $MYSQL_CFLAGS" if test "x$MYSQL_STATUS" = xyes; then cat >>confdefs.h <<\_ACEOF #define HAVE_MYSQL 1 _ACEOF for ac_func in mysql_stmt_init do as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` { $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 $as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $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 #endif int main () { return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then eval "$as_ac_var=yes" else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval 'as_val=${'$as_ac_var'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } as_val=`eval 'as_val=${'$as_ac_var'} $as_echo "$as_val"'` if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done { $as_echo "$as_me:$LINENO: checking MYSQL_OPT_RECONNECT" >&5 $as_echo_n "checking MYSQL_OPT_RECONNECT... " >&6; } 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)mysql_options(0, MYSQL_OPT_RECONNECT, 0); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then { $as_echo "$as_me:$LINENO: result: yes" >&5 $as_echo "yes" >&6; } cat >>confdefs.h <<\_ACEOF #define HAVE_MYSQL_OPT_RECONNECT 1 _ACEOF else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext else MYSQL_CFLAGS= MYSQL_LIBS= fi CPPFLAGS="$CPPFLAGS_SAVE" CXXFLAGS="$CXXFLAGS_SAVE" CFLAGS="$CFLAGS_SAVE" LDFLAGS="$LDFLAGS_SAVE" LIBS="$LIBS_SAVE" ######### check if at least one database available if ((test "x$SQLITE3_STATUS" != xyes) && (test "x$MYSQL_STATUS" != xyes)); then { { $as_echo "$as_me:$LINENO: error: Support of at least one of mysql or sqlite3 must be configured" >&5 $as_echo "$as_me: error: Support of at least one of mysql or sqlite3 must be configured" >&2;} { (exit 1); exit 1; }; } fi ######### javascript # Check whether --enable-libjs was given. if test "${enable_libjs+set}" = set; then enableval=$enable_libjs; JS_EN=$enableval if test "x$enableval" = xno; then JS_OK=disabled else JS_OK=yes fi else JS_OK=yes fi XP_ADD="" if test "x$JS_OK" = xyes; then XP_ADD="-DXP_UNIX" CXXFLAGS="$CXXFLAGS $XP_ADD" CPPFLAGS="$CPPFLAGS $XP_ADD" if test -n "$JS_SEARCH_HEADERS" ; then { $as_echo "$as_me:$LINENO: Will search for js (spidermonkey) headers in $JS_SEARCH_HEADERS" >&5 $as_echo "$as_me: Will search for js (spidermonkey) headers in $JS_SEARCH_HEADERS" >&6;} as_ac_Header=`$as_echo "ac_cv_header_$JS_SEARCH_HEADERS/jsapi.h" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { $as_echo "$as_me:$LINENO: checking for $JS_SEARCH_HEADERS/jsapi.h" >&5 $as_echo_n "checking for $JS_SEARCH_HEADERS/jsapi.h... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:$LINENO: checking $JS_SEARCH_HEADERS/jsapi.h usability" >&5 $as_echo_n "checking $JS_SEARCH_HEADERS/jsapi.h usability... " >&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 <$JS_SEARCH_HEADERS/jsapi.h> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:$LINENO: checking $JS_SEARCH_HEADERS/jsapi.h presence" >&5 $as_echo_n "checking $JS_SEARCH_HEADERS/jsapi.h presence... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$JS_SEARCH_HEADERS/jsapi.h> _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&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 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else $as_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 { $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in yes:no: ) { $as_echo "$as_me:$LINENO: WARNING: $JS_SEARCH_HEADERS/jsapi.h: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $JS_SEARCH_HEADERS/jsapi.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $JS_SEARCH_HEADERS/jsapi.h: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $JS_SEARCH_HEADERS/jsapi.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { $as_echo "$as_me:$LINENO: WARNING: $JS_SEARCH_HEADERS/jsapi.h: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $JS_SEARCH_HEADERS/jsapi.h: present but cannot be compiled" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $JS_SEARCH_HEADERS/jsapi.h: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $JS_SEARCH_HEADERS/jsapi.h: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $JS_SEARCH_HEADERS/jsapi.h: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $JS_SEARCH_HEADERS/jsapi.h: see the Autoconf documentation" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $JS_SEARCH_HEADERS/jsapi.h: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $JS_SEARCH_HEADERS/jsapi.h: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $JS_SEARCH_HEADERS/jsapi.h: proceeding with the preprocessor's result" >&5 $as_echo "$as_me: WARNING: $JS_SEARCH_HEADERS/jsapi.h: proceeding with the preprocessor's result" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $JS_SEARCH_HEADERS/jsapi.h: in the future, the compiler will take precedence" >&5 $as_echo "$as_me: WARNING: $JS_SEARCH_HEADERS/jsapi.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------- ## ## Report this to jin@mediatomb.cc ## ## ------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { $as_echo "$as_me:$LINENO: checking for $JS_SEARCH_HEADERS/jsapi.h" >&5 $as_echo_n "checking for $JS_SEARCH_HEADERS/jsapi.h... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi as_val=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` if test "x$as_val" = x""yes; then JS_CXXFLAGS="-I$JS_SEARCH_HEADERS" else { { $as_echo "$as_me:$LINENO: error: jsapi.h not found in requested location $JS_SEARCH_HEADERS" >&5 $as_echo "$as_me: error: jsapi.h not found in requested location $JS_SEARCH_HEADERS" >&2;} { (exit 1); exit 1; }; } fi else if test "${ac_cv_header_jsapi_h+set}" = set; then { $as_echo "$as_me:$LINENO: checking for jsapi.h" >&5 $as_echo_n "checking for jsapi.h... " >&6; } if test "${ac_cv_header_jsapi_h+set}" = set; then $as_echo_n "(cached) " >&6 fi { $as_echo "$as_me:$LINENO: result: $ac_cv_header_jsapi_h" >&5 $as_echo "$ac_cv_header_jsapi_h" >&6; } else # Is the header compilable? { $as_echo "$as_me:$LINENO: checking jsapi.h usability" >&5 $as_echo_n "checking jsapi.h usability... " >&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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:$LINENO: checking jsapi.h presence" >&5 $as_echo_n "checking jsapi.h presence... " >&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 { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&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 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else $as_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 { $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in yes:no: ) { $as_echo "$as_me:$LINENO: WARNING: jsapi.h: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: jsapi.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:$LINENO: WARNING: jsapi.h: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: jsapi.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { $as_echo "$as_me:$LINENO: WARNING: jsapi.h: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: jsapi.h: present but cannot be compiled" >&2;} { $as_echo "$as_me:$LINENO: WARNING: jsapi.h: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: jsapi.h: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:$LINENO: WARNING: jsapi.h: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: jsapi.h: see the Autoconf documentation" >&2;} { $as_echo "$as_me:$LINENO: WARNING: jsapi.h: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: jsapi.h: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:$LINENO: WARNING: jsapi.h: proceeding with the preprocessor's result" >&5 $as_echo "$as_me: WARNING: jsapi.h: proceeding with the preprocessor's result" >&2;} { $as_echo "$as_me:$LINENO: WARNING: jsapi.h: in the future, the compiler will take precedence" >&5 $as_echo "$as_me: WARNING: jsapi.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------- ## ## Report this to jin@mediatomb.cc ## ## ------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { $as_echo "$as_me:$LINENO: checking for jsapi.h" >&5 $as_echo_n "checking for jsapi.h... " >&6; } if test "${ac_cv_header_jsapi_h+set}" = set; then $as_echo_n "(cached) " >&6 else ac_cv_header_jsapi_h=$ac_header_preproc fi { $as_echo "$as_me:$LINENO: result: $ac_cv_header_jsapi_h" >&5 $as_echo "$ac_cv_header_jsapi_h" >&6; } fi if test "x$ac_cv_header_jsapi_h" = x""yes; then : else for sm_path in $SEARCH_DIR_HEADERS \ /usr/include/js \ /usr/include/smjs \ /usr/include/mozjs \ /usr/local/include/js \ /usr/local/include/smjs \ /usr/local/include/mozjs \ /usr/include/spidermonkey \ /usr/local/include/spidermonkey \ $SEARCH_DIR_HEADERS/js \ $SEARCH_DIR_HEADERS/smjs \ $SEARCH_DIR_HEADERS/mozjs \ $SEARCH_DIR_HEADERS/spidermonkey; do if test "x$ac_cv_header_jsapi_h" != xyes ; then { $as_echo "$as_me:$LINENO: checking checking alternative libjs header location: $sm_path" >&5 $as_echo_n "checking checking alternative libjs header location: $sm_path... " >&6; } CXXFLAGS="$XP_ADD -I$sm_path" CPPFLAGS="$XP_ADD -I$sm_path" unset ac_cv_header_jsapi_h if test "${ac_cv_header_jsapi_h+set}" = set; then { $as_echo "$as_me:$LINENO: checking for jsapi.h" >&5 $as_echo_n "checking for jsapi.h... " >&6; } if test "${ac_cv_header_jsapi_h+set}" = set; then $as_echo_n "(cached) " >&6 fi { $as_echo "$as_me:$LINENO: result: $ac_cv_header_jsapi_h" >&5 $as_echo "$ac_cv_header_jsapi_h" >&6; } else # Is the header compilable? { $as_echo "$as_me:$LINENO: checking jsapi.h usability" >&5 $as_echo_n "checking jsapi.h usability... " >&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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:$LINENO: checking jsapi.h presence" >&5 $as_echo_n "checking jsapi.h presence... " >&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 { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&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 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else $as_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 { $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in yes:no: ) { $as_echo "$as_me:$LINENO: WARNING: jsapi.h: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: jsapi.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:$LINENO: WARNING: jsapi.h: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: jsapi.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { $as_echo "$as_me:$LINENO: WARNING: jsapi.h: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: jsapi.h: present but cannot be compiled" >&2;} { $as_echo "$as_me:$LINENO: WARNING: jsapi.h: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: jsapi.h: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:$LINENO: WARNING: jsapi.h: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: jsapi.h: see the Autoconf documentation" >&2;} { $as_echo "$as_me:$LINENO: WARNING: jsapi.h: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: jsapi.h: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:$LINENO: WARNING: jsapi.h: proceeding with the preprocessor's result" >&5 $as_echo "$as_me: WARNING: jsapi.h: proceeding with the preprocessor's result" >&2;} { $as_echo "$as_me:$LINENO: WARNING: jsapi.h: in the future, the compiler will take precedence" >&5 $as_echo "$as_me: WARNING: jsapi.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------- ## ## Report this to jin@mediatomb.cc ## ## ------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { $as_echo "$as_me:$LINENO: checking for jsapi.h" >&5 $as_echo_n "checking for jsapi.h... " >&6; } if test "${ac_cv_header_jsapi_h+set}" = set; then $as_echo_n "(cached) " >&6 else ac_cv_header_jsapi_h=$ac_header_preproc fi { $as_echo "$as_me:$LINENO: result: $ac_cv_header_jsapi_h" >&5 $as_echo "$ac_cv_header_jsapi_h" >&6; } fi if test "x$ac_cv_header_jsapi_h" = x""yes; then JS_CXXFLAGS="-I$sm_path" { $as_echo "$as_me:$LINENO: result: jsapi.h found in $sm_path" >&5 $as_echo "jsapi.h found in $sm_path" >&6; } fi fi done fi if test "x$ac_cv_header_jsapi_h" != xyes ; then JS_OK=missing { $as_echo "$as_me:$LINENO: result: not found, giving up" >&5 $as_echo "not found, giving up" >&6; } fi fi fi MOZLIB= if test "x$JS_OK" = xyes; then if test -n "$JS_SEARCH_LIBS" ; then { $as_echo "$as_me:$LINENO: Will search for js (spidermonkey) libraries in $JS_SEARCH_LIBS" >&5 $as_echo "$as_me: Will search for js (spidermonkey) libraries in $JS_SEARCH_LIBS" >&6;} LDFLAGS="-L$JS_SEARCH_LIBS $LDFLAGS_SAVE -ljs $ADD_PTHREAD_CFLAGS" { $as_echo "$as_me:$LINENO: checking for JS_NewObject in -ljs" >&5 $as_echo_n "checking for JS_NewObject in -ljs... " >&6; } if test "${ac_cv_lib_js_JS_NewObject+set}" = set; then $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ljs $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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char JS_NewObject (); int main () { return JS_NewObject (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_lib_js_JS_NewObject=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_js_JS_NewObject=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_js_JS_NewObject" >&5 $as_echo "$ac_cv_lib_js_JS_NewObject" >&6; } if test "x$ac_cv_lib_js_JS_NewObject" = x""yes; then JS_LIBS="-L$JS_SEARCH_LIBS -ljs" MOZLIB=js else LDFLAGS="-L$JS_SEARCH_LIBS $LDFLAGS_SAVE -lsmjs $ADD_PTHREAD_CFLAGS" { $as_echo "$as_me:$LINENO: checking for JS_NewObject in -lsmjs" >&5 $as_echo_n "checking for JS_NewObject in -lsmjs... " >&6; } if test "${ac_cv_lib_smjs_JS_NewObject+set}" = set; then $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsmjs $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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char JS_NewObject (); int main () { return JS_NewObject (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_lib_smjs_JS_NewObject=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_smjs_JS_NewObject=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_smjs_JS_NewObject" >&5 $as_echo "$ac_cv_lib_smjs_JS_NewObject" >&6; } if test "x$ac_cv_lib_smjs_JS_NewObject" = x""yes; then JS_LIBS="-L$JS_SEARCH_LIBS $LDFLAGS_SAVE -lsmjs $ADD_PTHREAD_CFLAGS" MOZLIB=smjs else LDFLAGS="-L$JS_SEARCH_LIBS $LDFLAGS_SAVE -lmozjs $ADD_PTHREAD_CFLAGS" { $as_echo "$as_me:$LINENO: checking for JS_NewObject in -lmozjs" >&5 $as_echo_n "checking for JS_NewObject in -lmozjs... " >&6; } if test "${ac_cv_lib_mozjs_JS_NewObject+set}" = set; then $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lmozjs $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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char JS_NewObject (); int main () { return JS_NewObject (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_lib_mozjs_JS_NewObject=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_mozjs_JS_NewObject=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_mozjs_JS_NewObject" >&5 $as_echo "$ac_cv_lib_mozjs_JS_NewObject" >&6; } if test "x$ac_cv_lib_mozjs_JS_NewObject" = x""yes; then JS_LIBS="-L$JS_SEARCH_LIBS -lmozjs" MOZLIB=mozjs else { { $as_echo "$as_me:$LINENO: error: Spidermonkey not found in requested location $JS_SEARCH_LIBS" >&5 $as_echo "$as_me: error: Spidermonkey not found in requested location $JS_SEARCH_LIBS" >&2;} { (exit 1); exit 1; }; } fi fi fi else LDFLAGS="$LDFLAGS_SAVE $ADD_PTHREAD_CFLAGS" { $as_echo "$as_me:$LINENO: checking for JS_NewObject in -ljs" >&5 $as_echo_n "checking for JS_NewObject in -ljs... " >&6; } if test "${ac_cv_lib_js_JS_NewObject+set}" = set; then $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ljs $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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char JS_NewObject (); int main () { return JS_NewObject (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_lib_js_JS_NewObject=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_js_JS_NewObject=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_js_JS_NewObject" >&5 $as_echo "$ac_cv_lib_js_JS_NewObject" >&6; } if test "x$ac_cv_lib_js_JS_NewObject" = x""yes; then MOZLIB=js JS_LIBS="-ljs" else unset ac_cv_lib_js_JS_NewObject { $as_echo "$as_me:$LINENO: checking for JS_NewObject in -lsmjs" >&5 $as_echo_n "checking for JS_NewObject in -lsmjs... " >&6; } if test "${ac_cv_lib_smjs_JS_NewObject+set}" = set; then $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsmjs $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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char JS_NewObject (); int main () { return JS_NewObject (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_lib_smjs_JS_NewObject=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_smjs_JS_NewObject=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_smjs_JS_NewObject" >&5 $as_echo "$ac_cv_lib_smjs_JS_NewObject" >&6; } if test "x$ac_cv_lib_smjs_JS_NewObject" = x""yes; then JS_LIBS="-lsmjs" MOZLIB=smjs else unset ac_cv_lib_smjs_JS_NewObject { $as_echo "$as_me:$LINENO: checking for JS_NewObject in -lmozjs" >&5 $as_echo_n "checking for JS_NewObject in -lmozjs... " >&6; } if test "${ac_cv_lib_mozjs_JS_NewObject+set}" = set; then $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lmozjs $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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char JS_NewObject (); int main () { return JS_NewObject (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_lib_mozjs_JS_NewObject=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_mozjs_JS_NewObject=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_mozjs_JS_NewObject" >&5 $as_echo "$ac_cv_lib_mozjs_JS_NewObject" >&6; } if test "x$ac_cv_lib_mozjs_JS_NewObject" = x""yes; then MOZLIB=mozjs JS_LIBS="-lmozjs" else LDFLAGS="-L$SEARCH_DIR_LIBS $LDFLAGS_SAVE $ADD_PTHREAD_CFLAGS" unset ac_cv_lib_js_JS_NewObject { $as_echo "$as_me:$LINENO: checking for JS_NewObject in -ljs" >&5 $as_echo_n "checking for JS_NewObject in -ljs... " >&6; } if test "${ac_cv_lib_js_JS_NewObject+set}" = set; then $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ljs $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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char JS_NewObject (); int main () { return JS_NewObject (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_lib_js_JS_NewObject=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_js_JS_NewObject=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_js_JS_NewObject" >&5 $as_echo "$ac_cv_lib_js_JS_NewObject" >&6; } if test "x$ac_cv_lib_js_JS_NewObject" = x""yes; then JS_LIBS="-L$SEARCH_DIR_LIBS -ljs" MOZLIB=js else unset ac_cv_lib_smjs_JS_NewObject { $as_echo "$as_me:$LINENO: checking for JS_NewObject in -lsmjs" >&5 $as_echo_n "checking for JS_NewObject in -lsmjs... " >&6; } if test "${ac_cv_lib_smjs_JS_NewObject+set}" = set; then $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsmjs $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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char JS_NewObject (); int main () { return JS_NewObject (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_lib_smjs_JS_NewObject=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_smjs_JS_NewObject=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_smjs_JS_NewObject" >&5 $as_echo "$ac_cv_lib_smjs_JS_NewObject" >&6; } if test "x$ac_cv_lib_smjs_JS_NewObject" = x""yes; then JS_LIBS="-L$SEARCH_DIR_LIBS -lsmjs" MOZLIB=smjs else LDFLAGS="-L$SEARCH_DIR_LIBS $LDFLAGS_SAVE -lmozjs" unset ac_cv_lib_mozjs_JS_NewObject { $as_echo "$as_me:$LINENO: checking for JS_NewObject in -lmozjs" >&5 $as_echo_n "checking for JS_NewObject in -lmozjs... " >&6; } if test "${ac_cv_lib_mozjs_JS_NewObject+set}" = set; then $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lmozjs $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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char JS_NewObject (); int main () { return JS_NewObject (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_lib_mozjs_JS_NewObject=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_mozjs_JS_NewObject=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_mozjs_JS_NewObject" >&5 $as_echo "$ac_cv_lib_mozjs_JS_NewObject" >&6; } if test "x$ac_cv_lib_mozjs_JS_NewObject" = x""yes; then JS_LIBS="-L$SEARCH_DIR_LIBS -lmozjs" MOZLIB=mozjs else JS_OK=missing { $as_echo "$as_me:$LINENO: result: libjs/libsmjs link failed" >&5 $as_echo "libjs/libsmjs link failed" >&6; } fi fi fi fi fi fi fi fi if test "x$JS_OK" = xyes; then cat >>confdefs.h <<\_ACEOF #define HAVE_JS 1 _ACEOF LDFLAGS="$LDFLAGS $JS_LIBS" CFLAGS="$CFLAGS $JS_CXXFLAGS" CXXFLAGS="$CXXFLAGS $JS_CXXFLAGS" as_ac_Lib=`$as_echo "ac_cv_lib_$MOZLIB''_JS_ClearContextThread" | $as_tr_sh` { $as_echo "$as_me:$LINENO: checking for JS_ClearContextThread in -l$MOZLIB" >&5 $as_echo_n "checking for JS_ClearContextThread in -l$MOZLIB... " >&6; } if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-l$MOZLIB $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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char JS_ClearContextThread (); int main () { return JS_ClearContextThread (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then eval "$as_ac_Lib=yes" else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Lib=no" fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi ac_res=`eval 'as_val=${'$as_ac_Lib'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } as_val=`eval 'as_val=${'$as_ac_Lib'} $as_echo "$as_val"'` if test "x$as_val" = x""yes; then cat >>confdefs.h <<\_ACEOF #define JS_THREADSAFE 1 _ACEOF fi else if test "x$JS_EN" = xyes; then { { $as_echo "$as_me:$LINENO: error: unable to configure libjs support" >&5 $as_echo "$as_me: error: unable to configure libjs support" >&2;} { (exit 1); exit 1; }; } fi fi CXXFLAGS="$CXXFLAGS_SAVE" CPPFLAGS="$CPPFLAGS_SAVE" LDFLAGS="$LDFLAGS_SAVE" ########### libmagic mt_libmagic_option_enabled= mt_libmagic_option_requested=no if test "xdisable" = xdisable; then mt_libmagic_option_enabled=yes else mt_libmagic_option_enabled=no fi # Check whether --enable-libmagic was given. if test "${enable_libmagic+set}" = set; then enableval=$enable_libmagic; mt_libmagic_option_enabled=$enableval mt_libmagic_option_requested=yes fi LIBMAGIC_OPTION_ENABLED=${mt_libmagic_option_enabled} LIBMAGIC_OPTION_REQUESTED=${mt_libmagic_option_requested} if test "x$LIBMAGIC_OPTION_ENABLED" = xyes; then mt_libmagic_status=yes if test "x$mt_libmagic_status" = xyes; then LIBS_SAVE=$LIBS LDFLAGS_SAVE=$LDFLAGS CFLAGS_SAVE=$CFLAGS CXXFLAGS_SAVE=$CXXFLAGS CPPFLAGS_SAVE=$CPPFLAGS mt_libmagic_header_status=yes # Check whether --with-libmagic-h was given. if test "${with_libmagic_h+set}" = set; then withval=$with_libmagic_h; mt_libmagic_search_headers="$withval" { $as_echo "$as_me:$LINENO: Will search for libmagic headers in $withval" >&5 $as_echo "$as_me: Will search for libmagic headers in $withval" >&6;} fi if test "$mt_libmagic_search_headers" ; then unset ac_cv_header_magic_h CFLAGS="$CFLAGS -I${mt_libmagic_search_headers}" CXXFLAGS="$CXXFLAGS -I${mt_libmagic_search_headers}" CPPFLAGS="$CPPFLAGS -I${mt_libmagic_search_headers}" as_ac_Header=`$as_echo "ac_cv_header_$mt_libmagic_search_headers/magic.h" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { $as_echo "$as_me:$LINENO: checking for $mt_libmagic_search_headers/magic.h" >&5 $as_echo_n "checking for $mt_libmagic_search_headers/magic.h... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:$LINENO: checking $mt_libmagic_search_headers/magic.h usability" >&5 $as_echo_n "checking $mt_libmagic_search_headers/magic.h usability... " >&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 <$mt_libmagic_search_headers/magic.h> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:$LINENO: checking $mt_libmagic_search_headers/magic.h presence" >&5 $as_echo_n "checking $mt_libmagic_search_headers/magic.h presence... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$mt_libmagic_search_headers/magic.h> _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&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 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else $as_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 { $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in yes:no: ) { $as_echo "$as_me:$LINENO: WARNING: $mt_libmagic_search_headers/magic.h: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $mt_libmagic_search_headers/magic.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $mt_libmagic_search_headers/magic.h: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $mt_libmagic_search_headers/magic.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { $as_echo "$as_me:$LINENO: WARNING: $mt_libmagic_search_headers/magic.h: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $mt_libmagic_search_headers/magic.h: present but cannot be compiled" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $mt_libmagic_search_headers/magic.h: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $mt_libmagic_search_headers/magic.h: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $mt_libmagic_search_headers/magic.h: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $mt_libmagic_search_headers/magic.h: see the Autoconf documentation" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $mt_libmagic_search_headers/magic.h: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $mt_libmagic_search_headers/magic.h: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $mt_libmagic_search_headers/magic.h: proceeding with the preprocessor's result" >&5 $as_echo "$as_me: WARNING: $mt_libmagic_search_headers/magic.h: proceeding with the preprocessor's result" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $mt_libmagic_search_headers/magic.h: in the future, the compiler will take precedence" >&5 $as_echo "$as_me: WARNING: $mt_libmagic_search_headers/magic.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------- ## ## Report this to jin@mediatomb.cc ## ## ------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { $as_echo "$as_me:$LINENO: checking for $mt_libmagic_search_headers/magic.h" >&5 $as_echo_n "checking for $mt_libmagic_search_headers/magic.h... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi as_val=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` if test "x$as_val" = x""yes; then mt_libmagic_cxxflags="-I${mt_libmagic_search_headers}" else mt_libmagic_header_status=missing if test "" = "pass"; then { $as_echo "$as_me:$LINENO: libmagic headers not found in requested location $mt_libmagic_search_headers" >&5 $as_echo "$as_me: libmagic headers not found in requested location $mt_libmagic_search_headers" >&6;} else { { $as_echo "$as_me:$LINENO: error: libmagic headers not found in requested location $mt_libmagic_search_headers" >&5 $as_echo "$as_me: error: libmagic headers not found in requested location $mt_libmagic_search_headers" >&2;} { (exit 1); exit 1; }; } fi fi else unset ac_cv_header_magic_h if test "${ac_cv_header_magic_h+set}" = set; then { $as_echo "$as_me:$LINENO: checking for magic.h" >&5 $as_echo_n "checking for magic.h... " >&6; } if test "${ac_cv_header_magic_h+set}" = set; then $as_echo_n "(cached) " >&6 fi { $as_echo "$as_me:$LINENO: result: $ac_cv_header_magic_h" >&5 $as_echo "$ac_cv_header_magic_h" >&6; } else # Is the header compilable? { $as_echo "$as_me:$LINENO: checking magic.h usability" >&5 $as_echo_n "checking magic.h usability... " >&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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:$LINENO: checking magic.h presence" >&5 $as_echo_n "checking magic.h presence... " >&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 { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&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 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else $as_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 { $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in yes:no: ) { $as_echo "$as_me:$LINENO: WARNING: magic.h: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: magic.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:$LINENO: WARNING: magic.h: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: magic.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { $as_echo "$as_me:$LINENO: WARNING: magic.h: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: magic.h: present but cannot be compiled" >&2;} { $as_echo "$as_me:$LINENO: WARNING: magic.h: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: magic.h: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:$LINENO: WARNING: magic.h: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: magic.h: see the Autoconf documentation" >&2;} { $as_echo "$as_me:$LINENO: WARNING: magic.h: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: magic.h: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:$LINENO: WARNING: magic.h: proceeding with the preprocessor's result" >&5 $as_echo "$as_me: WARNING: magic.h: proceeding with the preprocessor's result" >&2;} { $as_echo "$as_me:$LINENO: WARNING: magic.h: in the future, the compiler will take precedence" >&5 $as_echo "$as_me: WARNING: magic.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------- ## ## Report this to jin@mediatomb.cc ## ## ------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { $as_echo "$as_me:$LINENO: checking for magic.h" >&5 $as_echo_n "checking for magic.h... " >&6; } if test "${ac_cv_header_magic_h+set}" = set; then $as_echo_n "(cached) " >&6 else ac_cv_header_magic_h=$ac_header_preproc fi { $as_echo "$as_me:$LINENO: result: $ac_cv_header_magic_h" >&5 $as_echo "$ac_cv_header_magic_h" >&6; } fi if test "x$ac_cv_header_magic_h" = x""yes; then : else CFLAGS="$CFLAGS -I$MT_SEARCHPATH_HEADERS" CXXFLAGS="$CXXFLAGS -I$MT_SEARCHPATH_HEADERS" CPPFLAGS="$CPPFLAGS -I$MT_SEARCHPATH_HEADERS" unset ac_cv_header_magic_h as_ac_Header=`$as_echo "ac_cv_header_$MT_SEARCHPATH_HEADERS/magic.h" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { $as_echo "$as_me:$LINENO: checking for $MT_SEARCHPATH_HEADERS/magic.h" >&5 $as_echo_n "checking for $MT_SEARCHPATH_HEADERS/magic.h... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:$LINENO: checking $MT_SEARCHPATH_HEADERS/magic.h usability" >&5 $as_echo_n "checking $MT_SEARCHPATH_HEADERS/magic.h usability... " >&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 <$MT_SEARCHPATH_HEADERS/magic.h> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:$LINENO: checking $MT_SEARCHPATH_HEADERS/magic.h presence" >&5 $as_echo_n "checking $MT_SEARCHPATH_HEADERS/magic.h presence... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$MT_SEARCHPATH_HEADERS/magic.h> _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&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 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else $as_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 { $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in yes:no: ) { $as_echo "$as_me:$LINENO: WARNING: $MT_SEARCHPATH_HEADERS/magic.h: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $MT_SEARCHPATH_HEADERS/magic.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $MT_SEARCHPATH_HEADERS/magic.h: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $MT_SEARCHPATH_HEADERS/magic.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { $as_echo "$as_me:$LINENO: WARNING: $MT_SEARCHPATH_HEADERS/magic.h: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $MT_SEARCHPATH_HEADERS/magic.h: present but cannot be compiled" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $MT_SEARCHPATH_HEADERS/magic.h: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $MT_SEARCHPATH_HEADERS/magic.h: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $MT_SEARCHPATH_HEADERS/magic.h: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $MT_SEARCHPATH_HEADERS/magic.h: see the Autoconf documentation" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $MT_SEARCHPATH_HEADERS/magic.h: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $MT_SEARCHPATH_HEADERS/magic.h: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $MT_SEARCHPATH_HEADERS/magic.h: proceeding with the preprocessor's result" >&5 $as_echo "$as_me: WARNING: $MT_SEARCHPATH_HEADERS/magic.h: proceeding with the preprocessor's result" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $MT_SEARCHPATH_HEADERS/magic.h: in the future, the compiler will take precedence" >&5 $as_echo "$as_me: WARNING: $MT_SEARCHPATH_HEADERS/magic.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------- ## ## Report this to jin@mediatomb.cc ## ## ------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { $as_echo "$as_me:$LINENO: checking for $MT_SEARCHPATH_HEADERS/magic.h" >&5 $as_echo_n "checking for $MT_SEARCHPATH_HEADERS/magic.h... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi as_val=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` if test "x$as_val" = x""yes; then mt_libmagic_cxxflags="-I${MT_SEARCHPATH_HEADERS}" else mt_libmagic_header_status=missing fi fi fi if test "x$mt_libmagic_header_status" != xyes; then mt_libmagic_cxxflags="" fi LIBS=$LIBS_SAVE LDFLAGS=$LDFLAGS_SAVE CFLAGS=$CFLAGS_SAVE CXXFLAGS=$CXXFLAGS_SAVE CPPFLAGS=$CPPFLAGS_SAVE mt_libmagic_package_status=${mt_libmagic_header_status} if test "x$mt_libmagic_package_status" = xyes; then mt_libmagic_arg_default=yes mt_libmagic_library_status=yes LIBS_SAVE=$LIBS LDFLAGS_SAVE=$LDFLAGS CFLAGS_SAVE=$CFLAGS CXXFLAGS_SAVE=$CXXFLAGS CPPFLAGS_SAVE=$CPPFLAGS # Check whether --with-libmagic-libs was given. if test "${with_libmagic_libs+set}" = set; then withval=$with_libmagic_libs; mt_libmagic_search_libs="$withval" { $as_echo "$as_me:$LINENO: Will search for libmagic libs in $withval" >&5 $as_echo "$as_me: Will search for libmagic libs in $withval" >&6;} fi if test "$mt_libmagic_search_libs" ; then unset ac_cv_lib_magic_magic_load LDFLAGS="$LDFLAGS -L$mt_libmagic_search_libs" { $as_echo "$as_me:$LINENO: checking for magic_load in -lmagic" >&5 $as_echo_n "checking for magic_load in -lmagic... " >&6; } if test "${ac_cv_lib_magic_magic_load+set}" = set; then $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lmagic $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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char magic_load (); int main () { return magic_load (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_lib_magic_magic_load=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_magic_magic_load=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_magic_magic_load" >&5 $as_echo "$ac_cv_lib_magic_magic_load" >&6; } if test "x$ac_cv_lib_magic_magic_load" = x""yes; then mt_libmagic_libs="-lmagic" mt_libmagic_ldflags="-L$mt_libmagic_search_libs" else mt_libmagic_library_status=missing if test "" = "pass"; then { $as_echo "$as_me:$LINENO: libmagic library not found in requested location $mt_libmagic_search_libs" >&5 $as_echo "$as_me: libmagic library not found in requested location $mt_libmagic_search_libs" >&6;} else { { $as_echo "$as_me:$LINENO: error: libmagic library not found in requested location $mt_libmagic_search_libs" >&5 $as_echo "$as_me: error: libmagic library not found in requested location $mt_libmagic_search_libs" >&2;} { (exit 1); exit 1; }; } fi fi else unset ac_cv_lib_magic_magic_load { $as_echo "$as_me:$LINENO: checking for magic_load in -lmagic" >&5 $as_echo_n "checking for magic_load in -lmagic... " >&6; } if test "${ac_cv_lib_magic_magic_load+set}" = set; then $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lmagic $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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char magic_load (); int main () { return magic_load (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_lib_magic_magic_load=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_magic_magic_load=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_magic_magic_load" >&5 $as_echo "$ac_cv_lib_magic_magic_load" >&6; } if test "x$ac_cv_lib_magic_magic_load" = x""yes; then mt_libmagic_libs="-lmagic" else LDFLAGS="$LDFLAGS -L$MT_SEARCHPATH_LIBS" unset ac_cv_lib_magic_magic_load { $as_echo "$as_me:$LINENO: checking for magic_load in -lmagic" >&5 $as_echo_n "checking for magic_load in -lmagic... " >&6; } if test "${ac_cv_lib_magic_magic_load+set}" = set; then $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lmagic $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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char magic_load (); int main () { return magic_load (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_lib_magic_magic_load=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_magic_magic_load=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_magic_magic_load" >&5 $as_echo "$ac_cv_lib_magic_magic_load" >&6; } if test "x$ac_cv_lib_magic_magic_load" = x""yes; then mt_libmagic_libs="-lmagic" mt_libmagic_ldflags="-L$MT_SEARCHPATH_LIBS" else mt_libmagic_library_status=missing fi fi fi if test "x$mt_libmagic_library_status" != xyes; then mt_libmagic_libs="" mt_libmagic_ldflags="" fi LIBS=$LIBS_SAVE LDFLAGS=$LDFLAGS_SAVE CFLAGS=$CFLAGS_SAVE CXXFLAGS=$CXXFLAGS_SAVE CPPFLAGS=$CPPFLAGS_SAVE mt_libmagic_package_status=${mt_libmagic_library_status} fi if test "x$mt_libmagic_package_status" = xyes; then LIBMAGIC_CFLAGS=${mt_libmagic_cxxflags} LIBMAGIC_LIBS=${mt_libmagic_libs} LIBMAGIC_LDFLAGS=${mt_libmagic_ldflags} fi mt_libmagic_status=${mt_libmagic_package_status} fi if test "x$mt_libmagic_status" = xyes; then cat >>confdefs.h <<\_ACEOF #define HAVE_LIBMAGIC 1 _ACEOF fi LIBMAGIC_STATUS=${mt_libmagic_status} if test "x$LIBMAGIC_STATUS" != xyes; then if test "x$ZLIB_STATUS" != xyes; then mt_zlib_arg_default=yes mt_zlib_library_status=yes LIBS_SAVE=$LIBS LDFLAGS_SAVE=$LDFLAGS CFLAGS_SAVE=$CFLAGS CXXFLAGS_SAVE=$CXXFLAGS CPPFLAGS_SAVE=$CPPFLAGS # Check whether --with-zlib-libs was given. if test "${with_zlib_libs+set}" = set; then withval=$with_zlib_libs; mt_zlib_search_libs="$withval" { $as_echo "$as_me:$LINENO: Will search for zlib libs in $withval" >&5 $as_echo "$as_me: Will search for zlib libs in $withval" >&6;} fi if test "$mt_zlib_search_libs" ; then unset ac_cv_lib_z_compress LDFLAGS="$LDFLAGS -L$mt_zlib_search_libs" { $as_echo "$as_me:$LINENO: checking for compress in -lz" >&5 $as_echo_n "checking for compress in -lz... " >&6; } if test "${ac_cv_lib_z_compress+set}" = set; then $as_echo_n "(cached) " >&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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char compress (); int main () { return compress (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_lib_z_compress=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_z_compress=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_z_compress" >&5 $as_echo "$ac_cv_lib_z_compress" >&6; } if test "x$ac_cv_lib_z_compress" = x""yes; then mt_zlib_libs="-lz" mt_zlib_ldflags="-L$mt_zlib_search_libs" else mt_zlib_library_status=missing if test "" = "pass"; then { $as_echo "$as_me:$LINENO: zlib library not found in requested location $mt_zlib_search_libs" >&5 $as_echo "$as_me: zlib library not found in requested location $mt_zlib_search_libs" >&6;} else { { $as_echo "$as_me:$LINENO: error: zlib library not found in requested location $mt_zlib_search_libs" >&5 $as_echo "$as_me: error: zlib library not found in requested location $mt_zlib_search_libs" >&2;} { (exit 1); exit 1; }; } fi fi else unset ac_cv_lib_z_compress { $as_echo "$as_me:$LINENO: checking for compress in -lz" >&5 $as_echo_n "checking for compress in -lz... " >&6; } if test "${ac_cv_lib_z_compress+set}" = set; then $as_echo_n "(cached) " >&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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char compress (); int main () { return compress (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_lib_z_compress=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_z_compress=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_z_compress" >&5 $as_echo "$ac_cv_lib_z_compress" >&6; } if test "x$ac_cv_lib_z_compress" = x""yes; then mt_zlib_libs="-lz" else LDFLAGS="$LDFLAGS -L$MT_SEARCHPATH_LIBS" unset ac_cv_lib_z_compress { $as_echo "$as_me:$LINENO: checking for compress in -lz" >&5 $as_echo_n "checking for compress in -lz... " >&6; } if test "${ac_cv_lib_z_compress+set}" = set; then $as_echo_n "(cached) " >&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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char compress (); int main () { return compress (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_lib_z_compress=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_z_compress=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_z_compress" >&5 $as_echo "$ac_cv_lib_z_compress" >&6; } if test "x$ac_cv_lib_z_compress" = x""yes; then mt_zlib_libs="-lz" mt_zlib_ldflags="-L$MT_SEARCHPATH_LIBS" else mt_zlib_library_status=missing fi fi fi if test "x$mt_zlib_library_status" != xyes; then mt_zlib_libs="" mt_zlib_ldflags="" fi LIBS=$LIBS_SAVE LDFLAGS=$LDFLAGS_SAVE CFLAGS=$CFLAGS_SAVE CXXFLAGS=$CXXFLAGS_SAVE CPPFLAGS=$CPPFLAGS_SAVE ZLIB_LIBS=${mt_zlib_libs} ZLIB_LDFLAGS=${mt_zlib_ldflags} ZLIB_STATUS=${mt_zlib_library_status} LDFLAGS="$LDFLAGS $ZLIB_LDFLAGS" LIBS="$LIBS $ZLIB_LIBS" { $as_echo "$as_me:$LINENO: retrying libmagic check with zlib flags" >&5 $as_echo "$as_me: retrying libmagic check with zlib flags" >&6;} mt_libmagic_status=yes if test "x$mt_libmagic_status" = xyes; then LIBS_SAVE=$LIBS LDFLAGS_SAVE=$LDFLAGS CFLAGS_SAVE=$CFLAGS CXXFLAGS_SAVE=$CXXFLAGS CPPFLAGS_SAVE=$CPPFLAGS mt_libmagic_header_status=yes # Check whether --with-libmagic-h was given. if test "${with_libmagic_h+set}" = set; then withval=$with_libmagic_h; mt_libmagic_search_headers="$withval" { $as_echo "$as_me:$LINENO: Will search for libmagic headers in $withval" >&5 $as_echo "$as_me: Will search for libmagic headers in $withval" >&6;} fi if test "$mt_libmagic_search_headers" ; then unset ac_cv_header_magic_h CFLAGS="$CFLAGS -I${mt_libmagic_search_headers}" CXXFLAGS="$CXXFLAGS -I${mt_libmagic_search_headers}" CPPFLAGS="$CPPFLAGS -I${mt_libmagic_search_headers}" as_ac_Header=`$as_echo "ac_cv_header_$mt_libmagic_search_headers/magic.h" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { $as_echo "$as_me:$LINENO: checking for $mt_libmagic_search_headers/magic.h" >&5 $as_echo_n "checking for $mt_libmagic_search_headers/magic.h... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:$LINENO: checking $mt_libmagic_search_headers/magic.h usability" >&5 $as_echo_n "checking $mt_libmagic_search_headers/magic.h usability... " >&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 <$mt_libmagic_search_headers/magic.h> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:$LINENO: checking $mt_libmagic_search_headers/magic.h presence" >&5 $as_echo_n "checking $mt_libmagic_search_headers/magic.h presence... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$mt_libmagic_search_headers/magic.h> _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&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 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else $as_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 { $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in yes:no: ) { $as_echo "$as_me:$LINENO: WARNING: $mt_libmagic_search_headers/magic.h: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $mt_libmagic_search_headers/magic.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $mt_libmagic_search_headers/magic.h: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $mt_libmagic_search_headers/magic.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { $as_echo "$as_me:$LINENO: WARNING: $mt_libmagic_search_headers/magic.h: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $mt_libmagic_search_headers/magic.h: present but cannot be compiled" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $mt_libmagic_search_headers/magic.h: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $mt_libmagic_search_headers/magic.h: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $mt_libmagic_search_headers/magic.h: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $mt_libmagic_search_headers/magic.h: see the Autoconf documentation" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $mt_libmagic_search_headers/magic.h: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $mt_libmagic_search_headers/magic.h: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $mt_libmagic_search_headers/magic.h: proceeding with the preprocessor's result" >&5 $as_echo "$as_me: WARNING: $mt_libmagic_search_headers/magic.h: proceeding with the preprocessor's result" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $mt_libmagic_search_headers/magic.h: in the future, the compiler will take precedence" >&5 $as_echo "$as_me: WARNING: $mt_libmagic_search_headers/magic.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------- ## ## Report this to jin@mediatomb.cc ## ## ------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { $as_echo "$as_me:$LINENO: checking for $mt_libmagic_search_headers/magic.h" >&5 $as_echo_n "checking for $mt_libmagic_search_headers/magic.h... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi as_val=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` if test "x$as_val" = x""yes; then mt_libmagic_cxxflags="-I${mt_libmagic_search_headers}" else mt_libmagic_header_status=missing if test "" = "pass"; then { $as_echo "$as_me:$LINENO: libmagic headers not found in requested location $mt_libmagic_search_headers" >&5 $as_echo "$as_me: libmagic headers not found in requested location $mt_libmagic_search_headers" >&6;} else { { $as_echo "$as_me:$LINENO: error: libmagic headers not found in requested location $mt_libmagic_search_headers" >&5 $as_echo "$as_me: error: libmagic headers not found in requested location $mt_libmagic_search_headers" >&2;} { (exit 1); exit 1; }; } fi fi else unset ac_cv_header_magic_h if test "${ac_cv_header_magic_h+set}" = set; then { $as_echo "$as_me:$LINENO: checking for magic.h" >&5 $as_echo_n "checking for magic.h... " >&6; } if test "${ac_cv_header_magic_h+set}" = set; then $as_echo_n "(cached) " >&6 fi { $as_echo "$as_me:$LINENO: result: $ac_cv_header_magic_h" >&5 $as_echo "$ac_cv_header_magic_h" >&6; } else # Is the header compilable? { $as_echo "$as_me:$LINENO: checking magic.h usability" >&5 $as_echo_n "checking magic.h usability... " >&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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:$LINENO: checking magic.h presence" >&5 $as_echo_n "checking magic.h presence... " >&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 { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&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 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else $as_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 { $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in yes:no: ) { $as_echo "$as_me:$LINENO: WARNING: magic.h: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: magic.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:$LINENO: WARNING: magic.h: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: magic.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { $as_echo "$as_me:$LINENO: WARNING: magic.h: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: magic.h: present but cannot be compiled" >&2;} { $as_echo "$as_me:$LINENO: WARNING: magic.h: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: magic.h: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:$LINENO: WARNING: magic.h: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: magic.h: see the Autoconf documentation" >&2;} { $as_echo "$as_me:$LINENO: WARNING: magic.h: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: magic.h: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:$LINENO: WARNING: magic.h: proceeding with the preprocessor's result" >&5 $as_echo "$as_me: WARNING: magic.h: proceeding with the preprocessor's result" >&2;} { $as_echo "$as_me:$LINENO: WARNING: magic.h: in the future, the compiler will take precedence" >&5 $as_echo "$as_me: WARNING: magic.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------- ## ## Report this to jin@mediatomb.cc ## ## ------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { $as_echo "$as_me:$LINENO: checking for magic.h" >&5 $as_echo_n "checking for magic.h... " >&6; } if test "${ac_cv_header_magic_h+set}" = set; then $as_echo_n "(cached) " >&6 else ac_cv_header_magic_h=$ac_header_preproc fi { $as_echo "$as_me:$LINENO: result: $ac_cv_header_magic_h" >&5 $as_echo "$ac_cv_header_magic_h" >&6; } fi if test "x$ac_cv_header_magic_h" = x""yes; then : else CFLAGS="$CFLAGS -I$MT_SEARCHPATH_HEADERS" CXXFLAGS="$CXXFLAGS -I$MT_SEARCHPATH_HEADERS" CPPFLAGS="$CPPFLAGS -I$MT_SEARCHPATH_HEADERS" unset ac_cv_header_magic_h as_ac_Header=`$as_echo "ac_cv_header_$MT_SEARCHPATH_HEADERS/magic.h" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { $as_echo "$as_me:$LINENO: checking for $MT_SEARCHPATH_HEADERS/magic.h" >&5 $as_echo_n "checking for $MT_SEARCHPATH_HEADERS/magic.h... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:$LINENO: checking $MT_SEARCHPATH_HEADERS/magic.h usability" >&5 $as_echo_n "checking $MT_SEARCHPATH_HEADERS/magic.h usability... " >&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 <$MT_SEARCHPATH_HEADERS/magic.h> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:$LINENO: checking $MT_SEARCHPATH_HEADERS/magic.h presence" >&5 $as_echo_n "checking $MT_SEARCHPATH_HEADERS/magic.h presence... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$MT_SEARCHPATH_HEADERS/magic.h> _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&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 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else $as_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 { $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in yes:no: ) { $as_echo "$as_me:$LINENO: WARNING: $MT_SEARCHPATH_HEADERS/magic.h: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $MT_SEARCHPATH_HEADERS/magic.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $MT_SEARCHPATH_HEADERS/magic.h: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $MT_SEARCHPATH_HEADERS/magic.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { $as_echo "$as_me:$LINENO: WARNING: $MT_SEARCHPATH_HEADERS/magic.h: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $MT_SEARCHPATH_HEADERS/magic.h: present but cannot be compiled" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $MT_SEARCHPATH_HEADERS/magic.h: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $MT_SEARCHPATH_HEADERS/magic.h: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $MT_SEARCHPATH_HEADERS/magic.h: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $MT_SEARCHPATH_HEADERS/magic.h: see the Autoconf documentation" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $MT_SEARCHPATH_HEADERS/magic.h: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $MT_SEARCHPATH_HEADERS/magic.h: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $MT_SEARCHPATH_HEADERS/magic.h: proceeding with the preprocessor's result" >&5 $as_echo "$as_me: WARNING: $MT_SEARCHPATH_HEADERS/magic.h: proceeding with the preprocessor's result" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $MT_SEARCHPATH_HEADERS/magic.h: in the future, the compiler will take precedence" >&5 $as_echo "$as_me: WARNING: $MT_SEARCHPATH_HEADERS/magic.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------- ## ## Report this to jin@mediatomb.cc ## ## ------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { $as_echo "$as_me:$LINENO: checking for $MT_SEARCHPATH_HEADERS/magic.h" >&5 $as_echo_n "checking for $MT_SEARCHPATH_HEADERS/magic.h... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi as_val=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` if test "x$as_val" = x""yes; then mt_libmagic_cxxflags="-I${MT_SEARCHPATH_HEADERS}" else mt_libmagic_header_status=missing fi fi fi if test "x$mt_libmagic_header_status" != xyes; then mt_libmagic_cxxflags="" fi LIBS=$LIBS_SAVE LDFLAGS=$LDFLAGS_SAVE CFLAGS=$CFLAGS_SAVE CXXFLAGS=$CXXFLAGS_SAVE CPPFLAGS=$CPPFLAGS_SAVE mt_libmagic_package_status=${mt_libmagic_header_status} if test "x$mt_libmagic_package_status" = xyes; then mt_libmagic_arg_default=yes mt_libmagic_library_status=yes LIBS_SAVE=$LIBS LDFLAGS_SAVE=$LDFLAGS CFLAGS_SAVE=$CFLAGS CXXFLAGS_SAVE=$CXXFLAGS CPPFLAGS_SAVE=$CPPFLAGS # Check whether --with-libmagic-libs was given. if test "${with_libmagic_libs+set}" = set; then withval=$with_libmagic_libs; mt_libmagic_search_libs="$withval" { $as_echo "$as_me:$LINENO: Will search for libmagic libs in $withval" >&5 $as_echo "$as_me: Will search for libmagic libs in $withval" >&6;} fi if test "$mt_libmagic_search_libs" ; then unset ac_cv_lib_magic_magic_load LDFLAGS="$LDFLAGS -L$mt_libmagic_search_libs" { $as_echo "$as_me:$LINENO: checking for magic_load in -lmagic" >&5 $as_echo_n "checking for magic_load in -lmagic... " >&6; } if test "${ac_cv_lib_magic_magic_load+set}" = set; then $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lmagic $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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char magic_load (); int main () { return magic_load (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_lib_magic_magic_load=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_magic_magic_load=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_magic_magic_load" >&5 $as_echo "$ac_cv_lib_magic_magic_load" >&6; } if test "x$ac_cv_lib_magic_magic_load" = x""yes; then mt_libmagic_libs="-lmagic" mt_libmagic_ldflags="-L$mt_libmagic_search_libs" else mt_libmagic_library_status=missing if test "" = "pass"; then { $as_echo "$as_me:$LINENO: libmagic library not found in requested location $mt_libmagic_search_libs" >&5 $as_echo "$as_me: libmagic library not found in requested location $mt_libmagic_search_libs" >&6;} else { { $as_echo "$as_me:$LINENO: error: libmagic library not found in requested location $mt_libmagic_search_libs" >&5 $as_echo "$as_me: error: libmagic library not found in requested location $mt_libmagic_search_libs" >&2;} { (exit 1); exit 1; }; } fi fi else unset ac_cv_lib_magic_magic_load { $as_echo "$as_me:$LINENO: checking for magic_load in -lmagic" >&5 $as_echo_n "checking for magic_load in -lmagic... " >&6; } if test "${ac_cv_lib_magic_magic_load+set}" = set; then $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lmagic $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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char magic_load (); int main () { return magic_load (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_lib_magic_magic_load=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_magic_magic_load=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_magic_magic_load" >&5 $as_echo "$ac_cv_lib_magic_magic_load" >&6; } if test "x$ac_cv_lib_magic_magic_load" = x""yes; then mt_libmagic_libs="-lmagic" else LDFLAGS="$LDFLAGS -L$MT_SEARCHPATH_LIBS" unset ac_cv_lib_magic_magic_load { $as_echo "$as_me:$LINENO: checking for magic_load in -lmagic" >&5 $as_echo_n "checking for magic_load in -lmagic... " >&6; } if test "${ac_cv_lib_magic_magic_load+set}" = set; then $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lmagic $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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char magic_load (); int main () { return magic_load (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_lib_magic_magic_load=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_magic_magic_load=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_magic_magic_load" >&5 $as_echo "$ac_cv_lib_magic_magic_load" >&6; } if test "x$ac_cv_lib_magic_magic_load" = x""yes; then mt_libmagic_libs="-lmagic" mt_libmagic_ldflags="-L$MT_SEARCHPATH_LIBS" else mt_libmagic_library_status=missing fi fi fi if test "x$mt_libmagic_library_status" != xyes; then mt_libmagic_libs="" mt_libmagic_ldflags="" fi LIBS=$LIBS_SAVE LDFLAGS=$LDFLAGS_SAVE CFLAGS=$CFLAGS_SAVE CXXFLAGS=$CXXFLAGS_SAVE CPPFLAGS=$CPPFLAGS_SAVE mt_libmagic_package_status=${mt_libmagic_library_status} fi if test "x$mt_libmagic_package_status" = xyes; then LIBMAGIC_CFLAGS=${mt_libmagic_cxxflags} LIBMAGIC_LIBS=${mt_libmagic_libs} LIBMAGIC_LDFLAGS=${mt_libmagic_ldflags} fi mt_libmagic_status=${mt_libmagic_package_status} fi if test "x$mt_libmagic_status" = xyes; then cat >>confdefs.h <<\_ACEOF #define HAVE_LIBMAGIC 1 _ACEOF fi LIBMAGIC_STATUS=${mt_libmagic_status} if test "x$LIBMAGIC_STATUS" = xyes; then LIBMAGIC_LIBS="$LIBMAGIC_LIBS $ZLIB_LIBS" LIBMAGIC_LDFLAGS="$LIBMAGIC_LDFLAGS $ZLIB_LDFLAGS" fi else LDFLAGS="$LDFLAGS $ZLIB_LDFLAGS" LIBS="$LIBS $ZLIB_LIBS" { $as_echo "$as_me:$LINENO: retrying libmagic check with zlib flags" >&5 $as_echo "$as_me: retrying libmagic check with zlib flags" >&6;} mt_libmagic_status=yes if test "x$mt_libmagic_status" = xyes; then LIBS_SAVE=$LIBS LDFLAGS_SAVE=$LDFLAGS CFLAGS_SAVE=$CFLAGS CXXFLAGS_SAVE=$CXXFLAGS CPPFLAGS_SAVE=$CPPFLAGS mt_libmagic_header_status=yes # Check whether --with-libmagic-h was given. if test "${with_libmagic_h+set}" = set; then withval=$with_libmagic_h; mt_libmagic_search_headers="$withval" { $as_echo "$as_me:$LINENO: Will search for libmagic headers in $withval" >&5 $as_echo "$as_me: Will search for libmagic headers in $withval" >&6;} fi if test "$mt_libmagic_search_headers" ; then unset ac_cv_header_magic_h CFLAGS="$CFLAGS -I${mt_libmagic_search_headers}" CXXFLAGS="$CXXFLAGS -I${mt_libmagic_search_headers}" CPPFLAGS="$CPPFLAGS -I${mt_libmagic_search_headers}" as_ac_Header=`$as_echo "ac_cv_header_$mt_libmagic_search_headers/magic.h" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { $as_echo "$as_me:$LINENO: checking for $mt_libmagic_search_headers/magic.h" >&5 $as_echo_n "checking for $mt_libmagic_search_headers/magic.h... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:$LINENO: checking $mt_libmagic_search_headers/magic.h usability" >&5 $as_echo_n "checking $mt_libmagic_search_headers/magic.h usability... " >&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 <$mt_libmagic_search_headers/magic.h> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:$LINENO: checking $mt_libmagic_search_headers/magic.h presence" >&5 $as_echo_n "checking $mt_libmagic_search_headers/magic.h presence... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$mt_libmagic_search_headers/magic.h> _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&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 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else $as_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 { $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in yes:no: ) { $as_echo "$as_me:$LINENO: WARNING: $mt_libmagic_search_headers/magic.h: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $mt_libmagic_search_headers/magic.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $mt_libmagic_search_headers/magic.h: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $mt_libmagic_search_headers/magic.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { $as_echo "$as_me:$LINENO: WARNING: $mt_libmagic_search_headers/magic.h: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $mt_libmagic_search_headers/magic.h: present but cannot be compiled" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $mt_libmagic_search_headers/magic.h: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $mt_libmagic_search_headers/magic.h: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $mt_libmagic_search_headers/magic.h: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $mt_libmagic_search_headers/magic.h: see the Autoconf documentation" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $mt_libmagic_search_headers/magic.h: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $mt_libmagic_search_headers/magic.h: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $mt_libmagic_search_headers/magic.h: proceeding with the preprocessor's result" >&5 $as_echo "$as_me: WARNING: $mt_libmagic_search_headers/magic.h: proceeding with the preprocessor's result" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $mt_libmagic_search_headers/magic.h: in the future, the compiler will take precedence" >&5 $as_echo "$as_me: WARNING: $mt_libmagic_search_headers/magic.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------- ## ## Report this to jin@mediatomb.cc ## ## ------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { $as_echo "$as_me:$LINENO: checking for $mt_libmagic_search_headers/magic.h" >&5 $as_echo_n "checking for $mt_libmagic_search_headers/magic.h... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi as_val=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` if test "x$as_val" = x""yes; then mt_libmagic_cxxflags="-I${mt_libmagic_search_headers}" else mt_libmagic_header_status=missing if test "" = "pass"; then { $as_echo "$as_me:$LINENO: libmagic headers not found in requested location $mt_libmagic_search_headers" >&5 $as_echo "$as_me: libmagic headers not found in requested location $mt_libmagic_search_headers" >&6;} else { { $as_echo "$as_me:$LINENO: error: libmagic headers not found in requested location $mt_libmagic_search_headers" >&5 $as_echo "$as_me: error: libmagic headers not found in requested location $mt_libmagic_search_headers" >&2;} { (exit 1); exit 1; }; } fi fi else unset ac_cv_header_magic_h if test "${ac_cv_header_magic_h+set}" = set; then { $as_echo "$as_me:$LINENO: checking for magic.h" >&5 $as_echo_n "checking for magic.h... " >&6; } if test "${ac_cv_header_magic_h+set}" = set; then $as_echo_n "(cached) " >&6 fi { $as_echo "$as_me:$LINENO: result: $ac_cv_header_magic_h" >&5 $as_echo "$ac_cv_header_magic_h" >&6; } else # Is the header compilable? { $as_echo "$as_me:$LINENO: checking magic.h usability" >&5 $as_echo_n "checking magic.h usability... " >&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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:$LINENO: checking magic.h presence" >&5 $as_echo_n "checking magic.h presence... " >&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 { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&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 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else $as_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 { $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in yes:no: ) { $as_echo "$as_me:$LINENO: WARNING: magic.h: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: magic.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:$LINENO: WARNING: magic.h: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: magic.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { $as_echo "$as_me:$LINENO: WARNING: magic.h: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: magic.h: present but cannot be compiled" >&2;} { $as_echo "$as_me:$LINENO: WARNING: magic.h: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: magic.h: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:$LINENO: WARNING: magic.h: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: magic.h: see the Autoconf documentation" >&2;} { $as_echo "$as_me:$LINENO: WARNING: magic.h: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: magic.h: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:$LINENO: WARNING: magic.h: proceeding with the preprocessor's result" >&5 $as_echo "$as_me: WARNING: magic.h: proceeding with the preprocessor's result" >&2;} { $as_echo "$as_me:$LINENO: WARNING: magic.h: in the future, the compiler will take precedence" >&5 $as_echo "$as_me: WARNING: magic.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------- ## ## Report this to jin@mediatomb.cc ## ## ------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { $as_echo "$as_me:$LINENO: checking for magic.h" >&5 $as_echo_n "checking for magic.h... " >&6; } if test "${ac_cv_header_magic_h+set}" = set; then $as_echo_n "(cached) " >&6 else ac_cv_header_magic_h=$ac_header_preproc fi { $as_echo "$as_me:$LINENO: result: $ac_cv_header_magic_h" >&5 $as_echo "$ac_cv_header_magic_h" >&6; } fi if test "x$ac_cv_header_magic_h" = x""yes; then : else CFLAGS="$CFLAGS -I$MT_SEARCHPATH_HEADERS" CXXFLAGS="$CXXFLAGS -I$MT_SEARCHPATH_HEADERS" CPPFLAGS="$CPPFLAGS -I$MT_SEARCHPATH_HEADERS" unset ac_cv_header_magic_h as_ac_Header=`$as_echo "ac_cv_header_$MT_SEARCHPATH_HEADERS/magic.h" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { $as_echo "$as_me:$LINENO: checking for $MT_SEARCHPATH_HEADERS/magic.h" >&5 $as_echo_n "checking for $MT_SEARCHPATH_HEADERS/magic.h... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:$LINENO: checking $MT_SEARCHPATH_HEADERS/magic.h usability" >&5 $as_echo_n "checking $MT_SEARCHPATH_HEADERS/magic.h usability... " >&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 <$MT_SEARCHPATH_HEADERS/magic.h> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:$LINENO: checking $MT_SEARCHPATH_HEADERS/magic.h presence" >&5 $as_echo_n "checking $MT_SEARCHPATH_HEADERS/magic.h presence... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$MT_SEARCHPATH_HEADERS/magic.h> _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&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 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else $as_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 { $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in yes:no: ) { $as_echo "$as_me:$LINENO: WARNING: $MT_SEARCHPATH_HEADERS/magic.h: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $MT_SEARCHPATH_HEADERS/magic.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $MT_SEARCHPATH_HEADERS/magic.h: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $MT_SEARCHPATH_HEADERS/magic.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { $as_echo "$as_me:$LINENO: WARNING: $MT_SEARCHPATH_HEADERS/magic.h: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $MT_SEARCHPATH_HEADERS/magic.h: present but cannot be compiled" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $MT_SEARCHPATH_HEADERS/magic.h: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $MT_SEARCHPATH_HEADERS/magic.h: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $MT_SEARCHPATH_HEADERS/magic.h: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $MT_SEARCHPATH_HEADERS/magic.h: see the Autoconf documentation" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $MT_SEARCHPATH_HEADERS/magic.h: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $MT_SEARCHPATH_HEADERS/magic.h: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $MT_SEARCHPATH_HEADERS/magic.h: proceeding with the preprocessor's result" >&5 $as_echo "$as_me: WARNING: $MT_SEARCHPATH_HEADERS/magic.h: proceeding with the preprocessor's result" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $MT_SEARCHPATH_HEADERS/magic.h: in the future, the compiler will take precedence" >&5 $as_echo "$as_me: WARNING: $MT_SEARCHPATH_HEADERS/magic.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------- ## ## Report this to jin@mediatomb.cc ## ## ------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { $as_echo "$as_me:$LINENO: checking for $MT_SEARCHPATH_HEADERS/magic.h" >&5 $as_echo_n "checking for $MT_SEARCHPATH_HEADERS/magic.h... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi as_val=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` if test "x$as_val" = x""yes; then mt_libmagic_cxxflags="-I${MT_SEARCHPATH_HEADERS}" else mt_libmagic_header_status=missing fi fi fi if test "x$mt_libmagic_header_status" != xyes; then mt_libmagic_cxxflags="" fi LIBS=$LIBS_SAVE LDFLAGS=$LDFLAGS_SAVE CFLAGS=$CFLAGS_SAVE CXXFLAGS=$CXXFLAGS_SAVE CPPFLAGS=$CPPFLAGS_SAVE mt_libmagic_package_status=${mt_libmagic_header_status} if test "x$mt_libmagic_package_status" = xyes; then mt_libmagic_arg_default=yes mt_libmagic_library_status=yes LIBS_SAVE=$LIBS LDFLAGS_SAVE=$LDFLAGS CFLAGS_SAVE=$CFLAGS CXXFLAGS_SAVE=$CXXFLAGS CPPFLAGS_SAVE=$CPPFLAGS # Check whether --with-libmagic-libs was given. if test "${with_libmagic_libs+set}" = set; then withval=$with_libmagic_libs; mt_libmagic_search_libs="$withval" { $as_echo "$as_me:$LINENO: Will search for libmagic libs in $withval" >&5 $as_echo "$as_me: Will search for libmagic libs in $withval" >&6;} fi if test "$mt_libmagic_search_libs" ; then unset ac_cv_lib_magic_magic_load LDFLAGS="$LDFLAGS -L$mt_libmagic_search_libs" { $as_echo "$as_me:$LINENO: checking for magic_load in -lmagic" >&5 $as_echo_n "checking for magic_load in -lmagic... " >&6; } if test "${ac_cv_lib_magic_magic_load+set}" = set; then $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lmagic $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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char magic_load (); int main () { return magic_load (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_lib_magic_magic_load=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_magic_magic_load=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_magic_magic_load" >&5 $as_echo "$ac_cv_lib_magic_magic_load" >&6; } if test "x$ac_cv_lib_magic_magic_load" = x""yes; then mt_libmagic_libs="-lmagic" mt_libmagic_ldflags="-L$mt_libmagic_search_libs" else mt_libmagic_library_status=missing if test "" = "pass"; then { $as_echo "$as_me:$LINENO: libmagic library not found in requested location $mt_libmagic_search_libs" >&5 $as_echo "$as_me: libmagic library not found in requested location $mt_libmagic_search_libs" >&6;} else { { $as_echo "$as_me:$LINENO: error: libmagic library not found in requested location $mt_libmagic_search_libs" >&5 $as_echo "$as_me: error: libmagic library not found in requested location $mt_libmagic_search_libs" >&2;} { (exit 1); exit 1; }; } fi fi else unset ac_cv_lib_magic_magic_load { $as_echo "$as_me:$LINENO: checking for magic_load in -lmagic" >&5 $as_echo_n "checking for magic_load in -lmagic... " >&6; } if test "${ac_cv_lib_magic_magic_load+set}" = set; then $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lmagic $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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char magic_load (); int main () { return magic_load (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_lib_magic_magic_load=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_magic_magic_load=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_magic_magic_load" >&5 $as_echo "$ac_cv_lib_magic_magic_load" >&6; } if test "x$ac_cv_lib_magic_magic_load" = x""yes; then mt_libmagic_libs="-lmagic" else LDFLAGS="$LDFLAGS -L$MT_SEARCHPATH_LIBS" unset ac_cv_lib_magic_magic_load { $as_echo "$as_me:$LINENO: checking for magic_load in -lmagic" >&5 $as_echo_n "checking for magic_load in -lmagic... " >&6; } if test "${ac_cv_lib_magic_magic_load+set}" = set; then $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lmagic $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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char magic_load (); int main () { return magic_load (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_lib_magic_magic_load=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_magic_magic_load=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_magic_magic_load" >&5 $as_echo "$ac_cv_lib_magic_magic_load" >&6; } if test "x$ac_cv_lib_magic_magic_load" = x""yes; then mt_libmagic_libs="-lmagic" mt_libmagic_ldflags="-L$MT_SEARCHPATH_LIBS" else mt_libmagic_library_status=missing fi fi fi if test "x$mt_libmagic_library_status" != xyes; then mt_libmagic_libs="" mt_libmagic_ldflags="" fi LIBS=$LIBS_SAVE LDFLAGS=$LDFLAGS_SAVE CFLAGS=$CFLAGS_SAVE CXXFLAGS=$CXXFLAGS_SAVE CPPFLAGS=$CPPFLAGS_SAVE mt_libmagic_package_status=${mt_libmagic_library_status} fi if test "x$mt_libmagic_package_status" = xyes; then LIBMAGIC_CFLAGS=${mt_libmagic_cxxflags} LIBMAGIC_LIBS=${mt_libmagic_libs} LIBMAGIC_LDFLAGS=${mt_libmagic_ldflags} fi mt_libmagic_status=${mt_libmagic_package_status} fi if test "x$mt_libmagic_status" = xyes; then cat >>confdefs.h <<\_ACEOF #define HAVE_LIBMAGIC 1 _ACEOF fi LIBMAGIC_STATUS=${mt_libmagic_status} if test "x$LIBMAGIC_STATUS" = xyes; then LIBMAGIC_LIBS="$LIBMAGIC_LIBS $ZLIB_LIBS" LIBMAGIC_LDFLAGS="$LIBMAGIC_LDFLAGS $ZLIB_LDFLAGS" fi fi fi fi if test "x$LIBMAGIC_STATUS" = xyes; then { $as_echo "$as_me:$LINENO: checking if libmagic is broken (Slackware check)" >&5 $as_echo_n "checking if libmagic is broken (Slackware check)... " >&6; } CFLAGS="$CFLAGS $LIBMAGIC_CXXLAGS" CXXFLAGS="$CXXFLAGS $LIBMAGIC_CFLAGS" LDFLAGS="$LDFLAGS $LIBMAGIC_LDFLAGS $LIBMAGIC_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 if test "$cross_compiling" = yes; then { $as_echo "$as_me:$LINENO: result: passing for cross compiling" >&5 $as_echo "passing for cross compiling" >&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 () { struct magic_set *ms; ms = magic_open(MAGIC_MIME); if (ms == 0) return 0; magic_load(ms, 0); magic_close(ms); return 0; ; return 0; } _ACEOF rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; }; else $as_echo "$as_me: program exited with status $ac_status" >&5 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) { $as_echo "$as_me:$LINENO: result: yes" >&5 $as_echo "yes" >&6; } MAGIC_OK=broken { $as_echo "$as_me:$LINENO: WARNING: your magic library is broken, if you are using Slackware install the 'file' package manually" >&5 $as_echo "$as_me: WARNING: your magic library is broken, if you are using Slackware install the 'file' package manually" >&2;} fi rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi ac_ext=cpp 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 if test "x$LIBMAGIC_STATUS" = xyes; then cat >>confdefs.h <<\_ACEOF #define HAVE_MAGIC 1 _ACEOF else if (test "x$LIBMAGIC_OPTION_REQUESTED" = xyes) && (test "x$LIBMAGIC_OPTION_ENABLED" = xyes); then { { $as_echo "$as_me:$LINENO: error: unable to configure libmagic support" >&5 $as_echo "$as_me: error: unable to configure libmagic support" >&2;} { (exit 1); exit 1; }; } fi fi CFLAGS="$CFLAGS_SAVE" CXXFLAGS="$CXXFLAGS_SAVE" CPPFLAFS="$CPPFLAFS_SAVE" LDFLGAS="$LDFLAGS_SAVE" ######### taglib or id3lib selection TAGLIB_STATUS= ID3LIB_STATUS= mt_id3lib_option_enabled= mt_id3lib_option_requested=no if test "xdisable" = xdisable; then mt_id3lib_option_enabled=yes else mt_id3lib_option_enabled=no fi # Check whether --enable-id3lib was given. if test "${enable_id3lib+set}" = set; then enableval=$enable_id3lib; mt_id3lib_option_enabled=$enableval mt_id3lib_option_requested=yes fi ID3LIB_OPTION_ENABLED=${mt_id3lib_option_enabled} ID3LIB_OPTION_REQUESTED=${mt_id3lib_option_requested} mt_taglib_option_enabled= mt_taglib_option_requested=no if test "xdisable" = xdisable; then mt_taglib_option_enabled=yes else mt_taglib_option_enabled=no fi # Check whether --enable-taglib was given. if test "${enable_taglib+set}" = set; then enableval=$enable_taglib; mt_taglib_option_enabled=$enableval mt_taglib_option_requested=yes fi TAGLIB_OPTION_ENABLED=${mt_taglib_option_enabled} TAGLIB_OPTION_REQUESTED=${mt_taglib_option_requested} if ((test "x$TAGLIB_OPTION_ENABLED" = xno) && (test "x$ID3LIB_OPTION_ENABLED" = xyes)) ; then TAGLIB_STATUS=disabled TAGLIB_OPTION_ENABLED=no { $as_echo "$as_me:$LINENO: WARNING: taglib disabled" >&5 $as_echo "$as_me: WARNING: taglib disabled" >&2;} elif ((test "x$TAGLIB_OPTION_ENABLED" = xyes) && (test "x$ID3LIB_OPTION_ENABLED" = xno)) ; then ID3LIB_STATUS=disabled ID3LIB_OPTION_ENABLED=no { $as_echo "$as_me:$LINENO: WARNING: id3lib disabled" >&5 $as_echo "$as_me: WARNING: id3lib disabled" >&2;} elif ((test "x$TAGLIB_OPTION_ENABLED" = xyes) && (test "x$ID3LIB_OPTION_ENABLED" = xyes)) ; then if ((test "x$TAGLIB_OPTION_REQUESTED" = xyes) && (test "x$ID3LIB_OPTION_REQUESTED" = xyes)); then { { $as_echo "$as_me:$LINENO: error: Please select either taglib or id3lib, but not both." >&5 $as_echo "$as_me: error: Please select either taglib or id3lib, but not both." >&2;} { (exit 1); exit 1; }; } elif ((test "x$TAGLIB_OPTION_REQUESTED" = xyes) && (test "x$ID3LIB_OPTION_REQUESTED" != xyes)); then ID3LIB_OPTION_ENABLED=no elif ((test "x$TAGLIB_OPTION_REQUESTED" != xyes) && (test "x$ID3LIB_OPTION_REQUESTED" = xyes)); then TAGLIB_OPTION_ENABLED=no fi fi if test "x$TAGLIB_OPTION_ENABLED" = xyes; then mt_taglib_status=yes if test "x$mt_taglib_status" = xyes; then LIBS_SAVE=$LIBS LDFLAGS_SAVE=$LDFLAGS CFLAGS_SAVE=$CFLAGS CXXFLAGS_SAVE=$CXXFLAGS CPPFLAGS_SAVE=$CPPFLAGS mt_taglib_config=none mt_taglib_package_status=yes # Check whether --with-taglib-cfg was given. if test "${with_taglib_cfg+set}" = set; then withval=$with_taglib_cfg; mt_taglib_search_config="$withval" { $as_echo "$as_me:$LINENO: Will search for taglib config in $withval" >&5 $as_echo "$as_me: Will search for taglib config in $withval" >&6;} fi if test -n "$mt_taglib_search_config"; then { $as_echo "$as_me:$LINENO: You specified ${mt_taglib_search_config} for taglib-config" >&5 $as_echo "$as_me: You specified ${mt_taglib_search_config} for taglib-config" >&6;} if test -f "$mt_taglib_search_config"; then mt_taglib_config=${mt_taglib_search_config} else { { $as_echo "$as_me:$LINENO: error: ${mt_taglib_search_config} not found" >&5 $as_echo "$as_me: error: ${mt_taglib_search_config} not found" >&2;} { (exit 1); exit 1; }; } fi mt_taglib_version=`${mt_taglib_config} --version 2>/dev/null` if test -z "$mt_taglib_version"; then { { $as_echo "$as_me:$LINENO: error: ${mt_taglib_search_config} could not be executed or returned invalid values" >&5 $as_echo "$as_me: error: ${mt_taglib_search_config} could not be executed or returned invalid values" >&2;} { (exit 1); exit 1; }; } fi else # Extract the first word of "taglib-config", so it can be a program name with args. set dummy taglib-config; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_mt_taglib_config+set}" = set; then $as_echo_n "(cached) " >&6 else case $mt_taglib_config in [\\/]* | ?:[\\/]*) ac_cv_path_mt_taglib_config="$mt_taglib_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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_mt_taglib_config="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_mt_taglib_config" && ac_cv_path_mt_taglib_config="none" ;; esac fi mt_taglib_config=$ac_cv_path_mt_taglib_config if test -n "$mt_taglib_config"; then { $as_echo "$as_me:$LINENO: result: $mt_taglib_config" >&5 $as_echo "$mt_taglib_config" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi if test "x$mt_taglib_config" = xnone; then unset ac_cv_path_mt_taglib_config # Extract the first word of "taglib-config", so it can be a program name with args. set dummy taglib-config; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_mt_taglib_config+set}" = set; then $as_echo_n "(cached) " >&6 else case $mt_taglib_config in [\\/]* | ?:[\\/]*) ac_cv_path_mt_taglib_config="$mt_taglib_config" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $MT_SEARCHPATH_PROGS do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_mt_taglib_config="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_mt_taglib_config" && ac_cv_path_mt_taglib_config="none" ;; esac fi mt_taglib_config=$ac_cv_path_mt_taglib_config if test -n "$mt_taglib_config"; then { $as_echo "$as_me:$LINENO: result: $mt_taglib_config" >&5 $as_echo "$mt_taglib_config" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi if test "x$mt_taglib_config" = xnone; then mt_taglib_package_status=missing { $as_echo "$as_me:$LINENO: result: taglib-config not found, please install the taglib devel package" >&5 $as_echo "taglib-config not found, please install the taglib devel package" >&6; } fi fi mt_taglib_version=`${mt_taglib_config} --version 2>/dev/null` if test -z "$mt_taglib_version"; then { $as_echo "$as_me:$LINENO: ${mt_taglib_config} could not be executed or returned invalid values" >&5 $as_echo "$as_me: ${mt_taglib_config} could not be executed or returned invalid values" >&6;} mt_taglib_package_status=missing fi fi if test "x$mt_taglib_package_status" = xyes; then { $as_echo "$as_me:$LINENO: checking taglib cflags" >&5 $as_echo_n "checking taglib cflags... " >&6; } mt_taglib_cxxflags=`${mt_taglib_config} --cflags` { $as_echo "$as_me:$LINENO: result: $mt_taglib_cxxflags" >&5 $as_echo "$mt_taglib_cxxflags" >&6; } mt_taglib_libs= { $as_echo "$as_me:$LINENO: checking taglib libs" >&5 $as_echo_n "checking taglib libs... " >&6; } if test -z ""; then mt_taglib_libs=`${mt_taglib_config} --libs` else mt_taglib_libs=`${mt_taglib_config} ` fi { $as_echo "$as_me:$LINENO: result: $mt_taglib_libs" >&5 $as_echo "$mt_taglib_libs" >&6; } fi if test "x$mt_taglib_package_status" = xyes; then CPPFLAGS="$CPPFLAGS $mt_taglib_cxxflags" CXXFLAGS="$CXXFLAGS $mt_taglib_cxxflags" CFLAGS="$CFLAGS $mt_taglib_cxxflags" for mt_u_header in taglib_h fileref_h tag_h audioproperties_h tstring_h textidentificationframe_h attachedpictureframe_h; do unset ac_cv_header_${mt_u_header} done for ac_header in taglib.h fileref.h tag.h audioproperties.h tstring.h textidentificationframe.h attachedpictureframe.h do as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 $as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 $as_echo_n "checking $ac_header usability... " >&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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 $as_echo_n "checking $ac_header presence... " >&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 { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&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 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else $as_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 { $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in yes:no: ) { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 $as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 $as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------- ## ## Report this to jin@mediatomb.cc ## ## ------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 $as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi as_val=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF else mt_taglib_package_status=missing fi done fi if test "x$mt_taglib_package_status" = xyes; then LIBS="$mt_taglib_libs $LIBS" if test -z "tag"; then unset ac_cv_func_main for ac_func in main do as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` { $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 $as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $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 #endif int main () { return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then eval "$as_ac_var=yes" else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval 'as_val=${'$as_ac_var'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } as_val=`eval 'as_val=${'$as_ac_var'} $as_echo "$as_val"'` if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF else mt_taglib_package_status=missing fi done else unset ac_cv_lib_tag_main { $as_echo "$as_me:$LINENO: checking for main in -ltag" >&5 $as_echo_n "checking for main in -ltag... " >&6; } if test "${ac_cv_lib_tag_main+set}" = set; then $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ltag $LIBS" 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 main (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_lib_tag_main=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_tag_main=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_tag_main" >&5 $as_echo "$ac_cv_lib_tag_main" >&6; } if test "x$ac_cv_lib_tag_main" = x""yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBTAG 1 _ACEOF LIBS="-ltag $LIBS" else mt_taglib_package_status=missing fi fi fi if test "x$mt_taglib_package_status" = xyes; then TAGLIB_CFLAGS=${mt_taglib_cxxflags} TAGLIB_LIBS=${mt_taglib_libs} TAGLIB_VERSION=${mt_taglib_version} fi LIBS=$LIBS_SAVE LDFLAGS=$LDFLAGS_SAVE CFLAGS=$CFLAGS_SAVE CXXFLAGS=$CXXFLAGS_SAVE CPPFLAGS=$CPPFLAGS_SAVE mt_taglib_status=${mt_taglib_package_status} fi if test "x$mt_taglib_status" = xyes; then cat >>confdefs.h <<\_ACEOF #define HAVE_TAGLIB 1 _ACEOF fi TAGLIB_STATUS=${mt_taglib_status} else TAGLIB_STATUS=disabled if test "x$ID3_OPTION_REQUESTED" = no; then ID3_OPTION_ENABLED=yes fi fi if test "x$TAGLIB_STATUS" = xyes; then cat >>confdefs.h <<\_ACEOF #define HAVE_ID3_ALBUMART 1 _ACEOF ID3LIB_STATUS=disabled ID3LIB_OPTION_ENABLED=no else if (test "x$TAGLIB_OPTION_REQUESTED" = xyes) && (test "x$TAGLIB_OPTION_ENABLED" = xyes); then { { $as_echo "$as_me:$LINENO: error: unable to configure taglib support" >&5 $as_echo "$as_me: error: unable to configure taglib support" >&2;} { (exit 1); exit 1; }; } fi fi ######### id3lib if test "x$ID3LIB_OPTION_ENABLED" = xyes; then mt_id3lib_status=yes if test "x$mt_id3lib_status" = xyes; then LIBS_SAVE=$LIBS LDFLAGS_SAVE=$LDFLAGS CFLAGS_SAVE=$CFLAGS CXXFLAGS_SAVE=$CXXFLAGS CPPFLAGS_SAVE=$CPPFLAGS mt_id3lib_header_status=yes # Check whether --with-id3lib-h was given. if test "${with_id3lib_h+set}" = set; then withval=$with_id3lib_h; mt_id3lib_search_headers="$withval" { $as_echo "$as_me:$LINENO: Will search for id3lib headers in $withval" >&5 $as_echo "$as_me: Will search for id3lib headers in $withval" >&6;} fi if test "$mt_id3lib_search_headers" ; then unset ac_cv_header_id3_tag_h CFLAGS="$CFLAGS -I${mt_id3lib_search_headers}" CXXFLAGS="$CXXFLAGS -I${mt_id3lib_search_headers}" CPPFLAGS="$CPPFLAGS -I${mt_id3lib_search_headers}" as_ac_Header=`$as_echo "ac_cv_header_$mt_id3lib_search_headers/id3/tag.h" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { $as_echo "$as_me:$LINENO: checking for $mt_id3lib_search_headers/id3/tag.h" >&5 $as_echo_n "checking for $mt_id3lib_search_headers/id3/tag.h... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:$LINENO: checking $mt_id3lib_search_headers/id3/tag.h usability" >&5 $as_echo_n "checking $mt_id3lib_search_headers/id3/tag.h usability... " >&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 <$mt_id3lib_search_headers/id3/tag.h> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:$LINENO: checking $mt_id3lib_search_headers/id3/tag.h presence" >&5 $as_echo_n "checking $mt_id3lib_search_headers/id3/tag.h presence... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$mt_id3lib_search_headers/id3/tag.h> _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&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 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else $as_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 { $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in yes:no: ) { $as_echo "$as_me:$LINENO: WARNING: $mt_id3lib_search_headers/id3/tag.h: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $mt_id3lib_search_headers/id3/tag.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $mt_id3lib_search_headers/id3/tag.h: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $mt_id3lib_search_headers/id3/tag.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { $as_echo "$as_me:$LINENO: WARNING: $mt_id3lib_search_headers/id3/tag.h: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $mt_id3lib_search_headers/id3/tag.h: present but cannot be compiled" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $mt_id3lib_search_headers/id3/tag.h: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $mt_id3lib_search_headers/id3/tag.h: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $mt_id3lib_search_headers/id3/tag.h: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $mt_id3lib_search_headers/id3/tag.h: see the Autoconf documentation" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $mt_id3lib_search_headers/id3/tag.h: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $mt_id3lib_search_headers/id3/tag.h: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $mt_id3lib_search_headers/id3/tag.h: proceeding with the preprocessor's result" >&5 $as_echo "$as_me: WARNING: $mt_id3lib_search_headers/id3/tag.h: proceeding with the preprocessor's result" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $mt_id3lib_search_headers/id3/tag.h: in the future, the compiler will take precedence" >&5 $as_echo "$as_me: WARNING: $mt_id3lib_search_headers/id3/tag.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------- ## ## Report this to jin@mediatomb.cc ## ## ------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { $as_echo "$as_me:$LINENO: checking for $mt_id3lib_search_headers/id3/tag.h" >&5 $as_echo_n "checking for $mt_id3lib_search_headers/id3/tag.h... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi as_val=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` if test "x$as_val" = x""yes; then mt_id3lib_cxxflags="-I${mt_id3lib_search_headers}" else mt_id3lib_header_status=missing if test "" = "pass"; then { $as_echo "$as_me:$LINENO: id3lib headers not found in requested location $mt_id3lib_search_headers" >&5 $as_echo "$as_me: id3lib headers not found in requested location $mt_id3lib_search_headers" >&6;} else { { $as_echo "$as_me:$LINENO: error: id3lib headers not found in requested location $mt_id3lib_search_headers" >&5 $as_echo "$as_me: error: id3lib headers not found in requested location $mt_id3lib_search_headers" >&2;} { (exit 1); exit 1; }; } fi fi else unset ac_cv_header_id3_tag_h if test "${ac_cv_header_id3_tag_h+set}" = set; then { $as_echo "$as_me:$LINENO: checking for id3/tag.h" >&5 $as_echo_n "checking for id3/tag.h... " >&6; } if test "${ac_cv_header_id3_tag_h+set}" = set; then $as_echo_n "(cached) " >&6 fi { $as_echo "$as_me:$LINENO: result: $ac_cv_header_id3_tag_h" >&5 $as_echo "$ac_cv_header_id3_tag_h" >&6; } else # Is the header compilable? { $as_echo "$as_me:$LINENO: checking id3/tag.h usability" >&5 $as_echo_n "checking id3/tag.h usability... " >&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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:$LINENO: checking id3/tag.h presence" >&5 $as_echo_n "checking id3/tag.h presence... " >&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 { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&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 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else $as_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 { $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in yes:no: ) { $as_echo "$as_me:$LINENO: WARNING: id3/tag.h: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: id3/tag.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:$LINENO: WARNING: id3/tag.h: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: id3/tag.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { $as_echo "$as_me:$LINENO: WARNING: id3/tag.h: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: id3/tag.h: present but cannot be compiled" >&2;} { $as_echo "$as_me:$LINENO: WARNING: id3/tag.h: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: id3/tag.h: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:$LINENO: WARNING: id3/tag.h: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: id3/tag.h: see the Autoconf documentation" >&2;} { $as_echo "$as_me:$LINENO: WARNING: id3/tag.h: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: id3/tag.h: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:$LINENO: WARNING: id3/tag.h: proceeding with the preprocessor's result" >&5 $as_echo "$as_me: WARNING: id3/tag.h: proceeding with the preprocessor's result" >&2;} { $as_echo "$as_me:$LINENO: WARNING: id3/tag.h: in the future, the compiler will take precedence" >&5 $as_echo "$as_me: WARNING: id3/tag.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------- ## ## Report this to jin@mediatomb.cc ## ## ------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { $as_echo "$as_me:$LINENO: checking for id3/tag.h" >&5 $as_echo_n "checking for id3/tag.h... " >&6; } if test "${ac_cv_header_id3_tag_h+set}" = set; then $as_echo_n "(cached) " >&6 else ac_cv_header_id3_tag_h=$ac_header_preproc fi { $as_echo "$as_me:$LINENO: result: $ac_cv_header_id3_tag_h" >&5 $as_echo "$ac_cv_header_id3_tag_h" >&6; } fi if test "x$ac_cv_header_id3_tag_h" = x""yes; then : else CFLAGS="$CFLAGS -I$MT_SEARCHPATH_HEADERS" CXXFLAGS="$CXXFLAGS -I$MT_SEARCHPATH_HEADERS" CPPFLAGS="$CPPFLAGS -I$MT_SEARCHPATH_HEADERS" unset ac_cv_header_id3_tag_h as_ac_Header=`$as_echo "ac_cv_header_$MT_SEARCHPATH_HEADERS/id3/tag.h" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { $as_echo "$as_me:$LINENO: checking for $MT_SEARCHPATH_HEADERS/id3/tag.h" >&5 $as_echo_n "checking for $MT_SEARCHPATH_HEADERS/id3/tag.h... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:$LINENO: checking $MT_SEARCHPATH_HEADERS/id3/tag.h usability" >&5 $as_echo_n "checking $MT_SEARCHPATH_HEADERS/id3/tag.h usability... " >&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 <$MT_SEARCHPATH_HEADERS/id3/tag.h> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:$LINENO: checking $MT_SEARCHPATH_HEADERS/id3/tag.h presence" >&5 $as_echo_n "checking $MT_SEARCHPATH_HEADERS/id3/tag.h presence... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$MT_SEARCHPATH_HEADERS/id3/tag.h> _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&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 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else $as_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 { $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in yes:no: ) { $as_echo "$as_me:$LINENO: WARNING: $MT_SEARCHPATH_HEADERS/id3/tag.h: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $MT_SEARCHPATH_HEADERS/id3/tag.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $MT_SEARCHPATH_HEADERS/id3/tag.h: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $MT_SEARCHPATH_HEADERS/id3/tag.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { $as_echo "$as_me:$LINENO: WARNING: $MT_SEARCHPATH_HEADERS/id3/tag.h: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $MT_SEARCHPATH_HEADERS/id3/tag.h: present but cannot be compiled" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $MT_SEARCHPATH_HEADERS/id3/tag.h: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $MT_SEARCHPATH_HEADERS/id3/tag.h: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $MT_SEARCHPATH_HEADERS/id3/tag.h: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $MT_SEARCHPATH_HEADERS/id3/tag.h: see the Autoconf documentation" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $MT_SEARCHPATH_HEADERS/id3/tag.h: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $MT_SEARCHPATH_HEADERS/id3/tag.h: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $MT_SEARCHPATH_HEADERS/id3/tag.h: proceeding with the preprocessor's result" >&5 $as_echo "$as_me: WARNING: $MT_SEARCHPATH_HEADERS/id3/tag.h: proceeding with the preprocessor's result" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $MT_SEARCHPATH_HEADERS/id3/tag.h: in the future, the compiler will take precedence" >&5 $as_echo "$as_me: WARNING: $MT_SEARCHPATH_HEADERS/id3/tag.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------- ## ## Report this to jin@mediatomb.cc ## ## ------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { $as_echo "$as_me:$LINENO: checking for $MT_SEARCHPATH_HEADERS/id3/tag.h" >&5 $as_echo_n "checking for $MT_SEARCHPATH_HEADERS/id3/tag.h... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi as_val=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` if test "x$as_val" = x""yes; then mt_id3lib_cxxflags="-I${MT_SEARCHPATH_HEADERS}" else mt_id3lib_header_status=missing fi fi fi if test "x$mt_id3lib_header_status" != xyes; then mt_id3lib_cxxflags="" fi LIBS=$LIBS_SAVE LDFLAGS=$LDFLAGS_SAVE CFLAGS=$CFLAGS_SAVE CXXFLAGS=$CXXFLAGS_SAVE CPPFLAGS=$CPPFLAGS_SAVE mt_id3lib_package_status=${mt_id3lib_header_status} if test "x$mt_id3lib_package_status" = xyes; then mt_id3lib_arg_default=yes mt_id3lib_library_status=yes LIBS_SAVE=$LIBS LDFLAGS_SAVE=$LDFLAGS CFLAGS_SAVE=$CFLAGS CXXFLAGS_SAVE=$CXXFLAGS CPPFLAGS_SAVE=$CPPFLAGS # Check whether --with-id3lib-libs was given. if test "${with_id3lib_libs+set}" = set; then withval=$with_id3lib_libs; mt_id3lib_search_libs="$withval" { $as_echo "$as_me:$LINENO: Will search for id3lib libs in $withval" >&5 $as_echo "$as_me: Will search for id3lib libs in $withval" >&6;} fi if test "$mt_id3lib_search_libs" ; then unset ac_cv_lib_id3_main LDFLAGS="$LDFLAGS -L$mt_id3lib_search_libs" { $as_echo "$as_me:$LINENO: checking for main in -lid3" >&5 $as_echo_n "checking for main in -lid3... " >&6; } if test "${ac_cv_lib_id3_main+set}" = set; then $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lid3 $LIBS" 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 main (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_lib_id3_main=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_id3_main=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_id3_main" >&5 $as_echo "$ac_cv_lib_id3_main" >&6; } if test "x$ac_cv_lib_id3_main" = x""yes; then mt_id3lib_libs="-lid3" mt_id3lib_ldflags="-L$mt_id3lib_search_libs" else mt_id3lib_library_status=missing if test "" = "pass"; then { $as_echo "$as_me:$LINENO: id3lib library not found in requested location $mt_id3lib_search_libs" >&5 $as_echo "$as_me: id3lib library not found in requested location $mt_id3lib_search_libs" >&6;} else { { $as_echo "$as_me:$LINENO: error: id3lib library not found in requested location $mt_id3lib_search_libs" >&5 $as_echo "$as_me: error: id3lib library not found in requested location $mt_id3lib_search_libs" >&2;} { (exit 1); exit 1; }; } fi fi else unset ac_cv_lib_id3_main { $as_echo "$as_me:$LINENO: checking for main in -lid3" >&5 $as_echo_n "checking for main in -lid3... " >&6; } if test "${ac_cv_lib_id3_main+set}" = set; then $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lid3 $LIBS" 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 main (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_lib_id3_main=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_id3_main=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_id3_main" >&5 $as_echo "$ac_cv_lib_id3_main" >&6; } if test "x$ac_cv_lib_id3_main" = x""yes; then mt_id3lib_libs="-lid3" else LDFLAGS="$LDFLAGS -L$MT_SEARCHPATH_LIBS" unset ac_cv_lib_id3_main { $as_echo "$as_me:$LINENO: checking for main in -lid3" >&5 $as_echo_n "checking for main in -lid3... " >&6; } if test "${ac_cv_lib_id3_main+set}" = set; then $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lid3 $LIBS" 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 main (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_lib_id3_main=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_id3_main=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_id3_main" >&5 $as_echo "$ac_cv_lib_id3_main" >&6; } if test "x$ac_cv_lib_id3_main" = x""yes; then mt_id3lib_libs="-lid3" mt_id3lib_ldflags="-L$MT_SEARCHPATH_LIBS" else mt_id3lib_library_status=missing fi fi fi if test "x$mt_id3lib_library_status" != xyes; then mt_id3lib_libs="" mt_id3lib_ldflags="" fi LIBS=$LIBS_SAVE LDFLAGS=$LDFLAGS_SAVE CFLAGS=$CFLAGS_SAVE CXXFLAGS=$CXXFLAGS_SAVE CPPFLAGS=$CPPFLAGS_SAVE mt_id3lib_package_status=${mt_id3lib_library_status} fi if test "x$mt_id3lib_package_status" = xyes; then ID3LIB_CFLAGS=${mt_id3lib_cxxflags} ID3LIB_LIBS=${mt_id3lib_libs} ID3LIB_LDFLAGS=${mt_id3lib_ldflags} fi mt_id3lib_status=${mt_id3lib_package_status} fi if test "x$mt_id3lib_status" = xyes; then cat >>confdefs.h <<\_ACEOF #define HAVE_ID3LIB 1 _ACEOF fi ID3LIB_STATUS=${mt_id3lib_status} if test "x$ID3LIB_STATUS" != xyes; then if test "x$ZLIB_STATUS" != xyes; then mt_zlib_arg_default=yes mt_zlib_library_status=yes LIBS_SAVE=$LIBS LDFLAGS_SAVE=$LDFLAGS CFLAGS_SAVE=$CFLAGS CXXFLAGS_SAVE=$CXXFLAGS CPPFLAGS_SAVE=$CPPFLAGS # Check whether --with-zlib-libs was given. if test "${with_zlib_libs+set}" = set; then withval=$with_zlib_libs; mt_zlib_search_libs="$withval" { $as_echo "$as_me:$LINENO: Will search for zlib libs in $withval" >&5 $as_echo "$as_me: Will search for zlib libs in $withval" >&6;} fi if test "$mt_zlib_search_libs" ; then unset ac_cv_lib_z_compress LDFLAGS="$LDFLAGS -L$mt_zlib_search_libs" { $as_echo "$as_me:$LINENO: checking for compress in -lz" >&5 $as_echo_n "checking for compress in -lz... " >&6; } if test "${ac_cv_lib_z_compress+set}" = set; then $as_echo_n "(cached) " >&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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char compress (); int main () { return compress (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_lib_z_compress=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_z_compress=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_z_compress" >&5 $as_echo "$ac_cv_lib_z_compress" >&6; } if test "x$ac_cv_lib_z_compress" = x""yes; then mt_zlib_libs="-lz" mt_zlib_ldflags="-L$mt_zlib_search_libs" else mt_zlib_library_status=missing if test "" = "pass"; then { $as_echo "$as_me:$LINENO: zlib library not found in requested location $mt_zlib_search_libs" >&5 $as_echo "$as_me: zlib library not found in requested location $mt_zlib_search_libs" >&6;} else { { $as_echo "$as_me:$LINENO: error: zlib library not found in requested location $mt_zlib_search_libs" >&5 $as_echo "$as_me: error: zlib library not found in requested location $mt_zlib_search_libs" >&2;} { (exit 1); exit 1; }; } fi fi else unset ac_cv_lib_z_compress { $as_echo "$as_me:$LINENO: checking for compress in -lz" >&5 $as_echo_n "checking for compress in -lz... " >&6; } if test "${ac_cv_lib_z_compress+set}" = set; then $as_echo_n "(cached) " >&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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char compress (); int main () { return compress (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_lib_z_compress=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_z_compress=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_z_compress" >&5 $as_echo "$ac_cv_lib_z_compress" >&6; } if test "x$ac_cv_lib_z_compress" = x""yes; then mt_zlib_libs="-lz" else LDFLAGS="$LDFLAGS -L$MT_SEARCHPATH_LIBS" unset ac_cv_lib_z_compress { $as_echo "$as_me:$LINENO: checking for compress in -lz" >&5 $as_echo_n "checking for compress in -lz... " >&6; } if test "${ac_cv_lib_z_compress+set}" = set; then $as_echo_n "(cached) " >&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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char compress (); int main () { return compress (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_lib_z_compress=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_z_compress=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_z_compress" >&5 $as_echo "$ac_cv_lib_z_compress" >&6; } if test "x$ac_cv_lib_z_compress" = x""yes; then mt_zlib_libs="-lz" mt_zlib_ldflags="-L$MT_SEARCHPATH_LIBS" else mt_zlib_library_status=missing fi fi fi if test "x$mt_zlib_library_status" != xyes; then mt_zlib_libs="" mt_zlib_ldflags="" fi LIBS=$LIBS_SAVE LDFLAGS=$LDFLAGS_SAVE CFLAGS=$CFLAGS_SAVE CXXFLAGS=$CXXFLAGS_SAVE CPPFLAGS=$CPPFLAGS_SAVE ZLIB_LIBS=${mt_zlib_libs} ZLIB_LDFLAGS=${mt_zlib_ldflags} ZLIB_STATUS=${mt_zlib_library_status} LDFLAGS="$LDFLAGS $ZLIB_LDFLAGS" LIBS="$LIBS $ZLIB_LIBS" { $as_echo "$as_me:$LINENO: retrying id3lib check with zlib flags" >&5 $as_echo "$as_me: retrying id3lib check with zlib flags" >&6;} mt_id3lib_status=yes if test "x$mt_id3lib_status" = xyes; then LIBS_SAVE=$LIBS LDFLAGS_SAVE=$LDFLAGS CFLAGS_SAVE=$CFLAGS CXXFLAGS_SAVE=$CXXFLAGS CPPFLAGS_SAVE=$CPPFLAGS mt_id3lib_header_status=yes # Check whether --with-id3lib-h was given. if test "${with_id3lib_h+set}" = set; then withval=$with_id3lib_h; mt_id3lib_search_headers="$withval" { $as_echo "$as_me:$LINENO: Will search for id3lib headers in $withval" >&5 $as_echo "$as_me: Will search for id3lib headers in $withval" >&6;} fi if test "$mt_id3lib_search_headers" ; then unset ac_cv_header_id3_tag_h CFLAGS="$CFLAGS -I${mt_id3lib_search_headers}" CXXFLAGS="$CXXFLAGS -I${mt_id3lib_search_headers}" CPPFLAGS="$CPPFLAGS -I${mt_id3lib_search_headers}" as_ac_Header=`$as_echo "ac_cv_header_$mt_id3lib_search_headers/id3/tag.h" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { $as_echo "$as_me:$LINENO: checking for $mt_id3lib_search_headers/id3/tag.h" >&5 $as_echo_n "checking for $mt_id3lib_search_headers/id3/tag.h... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:$LINENO: checking $mt_id3lib_search_headers/id3/tag.h usability" >&5 $as_echo_n "checking $mt_id3lib_search_headers/id3/tag.h usability... " >&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 <$mt_id3lib_search_headers/id3/tag.h> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:$LINENO: checking $mt_id3lib_search_headers/id3/tag.h presence" >&5 $as_echo_n "checking $mt_id3lib_search_headers/id3/tag.h presence... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$mt_id3lib_search_headers/id3/tag.h> _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&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 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else $as_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 { $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in yes:no: ) { $as_echo "$as_me:$LINENO: WARNING: $mt_id3lib_search_headers/id3/tag.h: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $mt_id3lib_search_headers/id3/tag.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $mt_id3lib_search_headers/id3/tag.h: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $mt_id3lib_search_headers/id3/tag.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { $as_echo "$as_me:$LINENO: WARNING: $mt_id3lib_search_headers/id3/tag.h: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $mt_id3lib_search_headers/id3/tag.h: present but cannot be compiled" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $mt_id3lib_search_headers/id3/tag.h: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $mt_id3lib_search_headers/id3/tag.h: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $mt_id3lib_search_headers/id3/tag.h: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $mt_id3lib_search_headers/id3/tag.h: see the Autoconf documentation" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $mt_id3lib_search_headers/id3/tag.h: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $mt_id3lib_search_headers/id3/tag.h: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $mt_id3lib_search_headers/id3/tag.h: proceeding with the preprocessor's result" >&5 $as_echo "$as_me: WARNING: $mt_id3lib_search_headers/id3/tag.h: proceeding with the preprocessor's result" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $mt_id3lib_search_headers/id3/tag.h: in the future, the compiler will take precedence" >&5 $as_echo "$as_me: WARNING: $mt_id3lib_search_headers/id3/tag.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------- ## ## Report this to jin@mediatomb.cc ## ## ------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { $as_echo "$as_me:$LINENO: checking for $mt_id3lib_search_headers/id3/tag.h" >&5 $as_echo_n "checking for $mt_id3lib_search_headers/id3/tag.h... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi as_val=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` if test "x$as_val" = x""yes; then mt_id3lib_cxxflags="-I${mt_id3lib_search_headers}" else mt_id3lib_header_status=missing if test "" = "pass"; then { $as_echo "$as_me:$LINENO: id3lib headers not found in requested location $mt_id3lib_search_headers" >&5 $as_echo "$as_me: id3lib headers not found in requested location $mt_id3lib_search_headers" >&6;} else { { $as_echo "$as_me:$LINENO: error: id3lib headers not found in requested location $mt_id3lib_search_headers" >&5 $as_echo "$as_me: error: id3lib headers not found in requested location $mt_id3lib_search_headers" >&2;} { (exit 1); exit 1; }; } fi fi else unset ac_cv_header_id3_tag_h if test "${ac_cv_header_id3_tag_h+set}" = set; then { $as_echo "$as_me:$LINENO: checking for id3/tag.h" >&5 $as_echo_n "checking for id3/tag.h... " >&6; } if test "${ac_cv_header_id3_tag_h+set}" = set; then $as_echo_n "(cached) " >&6 fi { $as_echo "$as_me:$LINENO: result: $ac_cv_header_id3_tag_h" >&5 $as_echo "$ac_cv_header_id3_tag_h" >&6; } else # Is the header compilable? { $as_echo "$as_me:$LINENO: checking id3/tag.h usability" >&5 $as_echo_n "checking id3/tag.h usability... " >&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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:$LINENO: checking id3/tag.h presence" >&5 $as_echo_n "checking id3/tag.h presence... " >&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 { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&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 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else $as_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 { $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in yes:no: ) { $as_echo "$as_me:$LINENO: WARNING: id3/tag.h: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: id3/tag.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:$LINENO: WARNING: id3/tag.h: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: id3/tag.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { $as_echo "$as_me:$LINENO: WARNING: id3/tag.h: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: id3/tag.h: present but cannot be compiled" >&2;} { $as_echo "$as_me:$LINENO: WARNING: id3/tag.h: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: id3/tag.h: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:$LINENO: WARNING: id3/tag.h: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: id3/tag.h: see the Autoconf documentation" >&2;} { $as_echo "$as_me:$LINENO: WARNING: id3/tag.h: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: id3/tag.h: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:$LINENO: WARNING: id3/tag.h: proceeding with the preprocessor's result" >&5 $as_echo "$as_me: WARNING: id3/tag.h: proceeding with the preprocessor's result" >&2;} { $as_echo "$as_me:$LINENO: WARNING: id3/tag.h: in the future, the compiler will take precedence" >&5 $as_echo "$as_me: WARNING: id3/tag.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------- ## ## Report this to jin@mediatomb.cc ## ## ------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { $as_echo "$as_me:$LINENO: checking for id3/tag.h" >&5 $as_echo_n "checking for id3/tag.h... " >&6; } if test "${ac_cv_header_id3_tag_h+set}" = set; then $as_echo_n "(cached) " >&6 else ac_cv_header_id3_tag_h=$ac_header_preproc fi { $as_echo "$as_me:$LINENO: result: $ac_cv_header_id3_tag_h" >&5 $as_echo "$ac_cv_header_id3_tag_h" >&6; } fi if test "x$ac_cv_header_id3_tag_h" = x""yes; then : else CFLAGS="$CFLAGS -I$MT_SEARCHPATH_HEADERS" CXXFLAGS="$CXXFLAGS -I$MT_SEARCHPATH_HEADERS" CPPFLAGS="$CPPFLAGS -I$MT_SEARCHPATH_HEADERS" unset ac_cv_header_id3_tag_h as_ac_Header=`$as_echo "ac_cv_header_$MT_SEARCHPATH_HEADERS/id3/tag.h" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { $as_echo "$as_me:$LINENO: checking for $MT_SEARCHPATH_HEADERS/id3/tag.h" >&5 $as_echo_n "checking for $MT_SEARCHPATH_HEADERS/id3/tag.h... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:$LINENO: checking $MT_SEARCHPATH_HEADERS/id3/tag.h usability" >&5 $as_echo_n "checking $MT_SEARCHPATH_HEADERS/id3/tag.h usability... " >&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 <$MT_SEARCHPATH_HEADERS/id3/tag.h> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:$LINENO: checking $MT_SEARCHPATH_HEADERS/id3/tag.h presence" >&5 $as_echo_n "checking $MT_SEARCHPATH_HEADERS/id3/tag.h presence... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$MT_SEARCHPATH_HEADERS/id3/tag.h> _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&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 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else $as_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 { $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in yes:no: ) { $as_echo "$as_me:$LINENO: WARNING: $MT_SEARCHPATH_HEADERS/id3/tag.h: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $MT_SEARCHPATH_HEADERS/id3/tag.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $MT_SEARCHPATH_HEADERS/id3/tag.h: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $MT_SEARCHPATH_HEADERS/id3/tag.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { $as_echo "$as_me:$LINENO: WARNING: $MT_SEARCHPATH_HEADERS/id3/tag.h: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $MT_SEARCHPATH_HEADERS/id3/tag.h: present but cannot be compiled" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $MT_SEARCHPATH_HEADERS/id3/tag.h: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $MT_SEARCHPATH_HEADERS/id3/tag.h: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $MT_SEARCHPATH_HEADERS/id3/tag.h: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $MT_SEARCHPATH_HEADERS/id3/tag.h: see the Autoconf documentation" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $MT_SEARCHPATH_HEADERS/id3/tag.h: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $MT_SEARCHPATH_HEADERS/id3/tag.h: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $MT_SEARCHPATH_HEADERS/id3/tag.h: proceeding with the preprocessor's result" >&5 $as_echo "$as_me: WARNING: $MT_SEARCHPATH_HEADERS/id3/tag.h: proceeding with the preprocessor's result" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $MT_SEARCHPATH_HEADERS/id3/tag.h: in the future, the compiler will take precedence" >&5 $as_echo "$as_me: WARNING: $MT_SEARCHPATH_HEADERS/id3/tag.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------- ## ## Report this to jin@mediatomb.cc ## ## ------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { $as_echo "$as_me:$LINENO: checking for $MT_SEARCHPATH_HEADERS/id3/tag.h" >&5 $as_echo_n "checking for $MT_SEARCHPATH_HEADERS/id3/tag.h... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi as_val=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` if test "x$as_val" = x""yes; then mt_id3lib_cxxflags="-I${MT_SEARCHPATH_HEADERS}" else mt_id3lib_header_status=missing fi fi fi if test "x$mt_id3lib_header_status" != xyes; then mt_id3lib_cxxflags="" fi LIBS=$LIBS_SAVE LDFLAGS=$LDFLAGS_SAVE CFLAGS=$CFLAGS_SAVE CXXFLAGS=$CXXFLAGS_SAVE CPPFLAGS=$CPPFLAGS_SAVE mt_id3lib_package_status=${mt_id3lib_header_status} if test "x$mt_id3lib_package_status" = xyes; then mt_id3lib_arg_default=yes mt_id3lib_library_status=yes LIBS_SAVE=$LIBS LDFLAGS_SAVE=$LDFLAGS CFLAGS_SAVE=$CFLAGS CXXFLAGS_SAVE=$CXXFLAGS CPPFLAGS_SAVE=$CPPFLAGS # Check whether --with-id3lib-libs was given. if test "${with_id3lib_libs+set}" = set; then withval=$with_id3lib_libs; mt_id3lib_search_libs="$withval" { $as_echo "$as_me:$LINENO: Will search for id3lib libs in $withval" >&5 $as_echo "$as_me: Will search for id3lib libs in $withval" >&6;} fi if test "$mt_id3lib_search_libs" ; then unset ac_cv_lib_id3_main LDFLAGS="$LDFLAGS -L$mt_id3lib_search_libs" { $as_echo "$as_me:$LINENO: checking for main in -lid3" >&5 $as_echo_n "checking for main in -lid3... " >&6; } if test "${ac_cv_lib_id3_main+set}" = set; then $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lid3 $LIBS" 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 main (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_lib_id3_main=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_id3_main=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_id3_main" >&5 $as_echo "$ac_cv_lib_id3_main" >&6; } if test "x$ac_cv_lib_id3_main" = x""yes; then mt_id3lib_libs="-lid3" mt_id3lib_ldflags="-L$mt_id3lib_search_libs" else mt_id3lib_library_status=missing if test "" = "pass"; then { $as_echo "$as_me:$LINENO: id3lib library not found in requested location $mt_id3lib_search_libs" >&5 $as_echo "$as_me: id3lib library not found in requested location $mt_id3lib_search_libs" >&6;} else { { $as_echo "$as_me:$LINENO: error: id3lib library not found in requested location $mt_id3lib_search_libs" >&5 $as_echo "$as_me: error: id3lib library not found in requested location $mt_id3lib_search_libs" >&2;} { (exit 1); exit 1; }; } fi fi else unset ac_cv_lib_id3_main { $as_echo "$as_me:$LINENO: checking for main in -lid3" >&5 $as_echo_n "checking for main in -lid3... " >&6; } if test "${ac_cv_lib_id3_main+set}" = set; then $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lid3 $LIBS" 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 main (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_lib_id3_main=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_id3_main=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_id3_main" >&5 $as_echo "$ac_cv_lib_id3_main" >&6; } if test "x$ac_cv_lib_id3_main" = x""yes; then mt_id3lib_libs="-lid3" else LDFLAGS="$LDFLAGS -L$MT_SEARCHPATH_LIBS" unset ac_cv_lib_id3_main { $as_echo "$as_me:$LINENO: checking for main in -lid3" >&5 $as_echo_n "checking for main in -lid3... " >&6; } if test "${ac_cv_lib_id3_main+set}" = set; then $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lid3 $LIBS" 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 main (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_lib_id3_main=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_id3_main=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_id3_main" >&5 $as_echo "$ac_cv_lib_id3_main" >&6; } if test "x$ac_cv_lib_id3_main" = x""yes; then mt_id3lib_libs="-lid3" mt_id3lib_ldflags="-L$MT_SEARCHPATH_LIBS" else mt_id3lib_library_status=missing fi fi fi if test "x$mt_id3lib_library_status" != xyes; then mt_id3lib_libs="" mt_id3lib_ldflags="" fi LIBS=$LIBS_SAVE LDFLAGS=$LDFLAGS_SAVE CFLAGS=$CFLAGS_SAVE CXXFLAGS=$CXXFLAGS_SAVE CPPFLAGS=$CPPFLAGS_SAVE mt_id3lib_package_status=${mt_id3lib_library_status} fi if test "x$mt_id3lib_package_status" = xyes; then ID3LIB_CFLAGS=${mt_id3lib_cxxflags} ID3LIB_LIBS=${mt_id3lib_libs} ID3LIB_LDFLAGS=${mt_id3lib_ldflags} fi mt_id3lib_status=${mt_id3lib_package_status} fi if test "x$mt_id3lib_status" = xyes; then cat >>confdefs.h <<\_ACEOF #define HAVE_ID3LIB 1 _ACEOF fi ID3LIB_STATUS=${mt_id3lib_status} if test "x$ID3LIB_STATUS" = xyes; then ID3LIB_LIBS="$ID3LIB_LIBS $ZLIB_LIBS" ID3LIB_LDFLAGS="$ID3LIB_LDFLAGS $ZLIB_LDFLAGS" fi else LDFLAGS="$LDFLAGS $ZLIB_LDFLAGS" LIBS="$LIBS $ZLIB_LIBS" { $as_echo "$as_me:$LINENO: retrying id3lib check with zlib flags" >&5 $as_echo "$as_me: retrying id3lib check with zlib flags" >&6;} mt_id3lib_status=yes if test "x$mt_id3lib_status" = xyes; then LIBS_SAVE=$LIBS LDFLAGS_SAVE=$LDFLAGS CFLAGS_SAVE=$CFLAGS CXXFLAGS_SAVE=$CXXFLAGS CPPFLAGS_SAVE=$CPPFLAGS mt_id3lib_header_status=yes # Check whether --with-id3lib-h was given. if test "${with_id3lib_h+set}" = set; then withval=$with_id3lib_h; mt_id3lib_search_headers="$withval" { $as_echo "$as_me:$LINENO: Will search for id3lib headers in $withval" >&5 $as_echo "$as_me: Will search for id3lib headers in $withval" >&6;} fi if test "$mt_id3lib_search_headers" ; then unset ac_cv_header_id3_tag_h CFLAGS="$CFLAGS -I${mt_id3lib_search_headers}" CXXFLAGS="$CXXFLAGS -I${mt_id3lib_search_headers}" CPPFLAGS="$CPPFLAGS -I${mt_id3lib_search_headers}" as_ac_Header=`$as_echo "ac_cv_header_$mt_id3lib_search_headers/id3/tag.h" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { $as_echo "$as_me:$LINENO: checking for $mt_id3lib_search_headers/id3/tag.h" >&5 $as_echo_n "checking for $mt_id3lib_search_headers/id3/tag.h... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:$LINENO: checking $mt_id3lib_search_headers/id3/tag.h usability" >&5 $as_echo_n "checking $mt_id3lib_search_headers/id3/tag.h usability... " >&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 <$mt_id3lib_search_headers/id3/tag.h> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:$LINENO: checking $mt_id3lib_search_headers/id3/tag.h presence" >&5 $as_echo_n "checking $mt_id3lib_search_headers/id3/tag.h presence... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$mt_id3lib_search_headers/id3/tag.h> _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&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 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else $as_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 { $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in yes:no: ) { $as_echo "$as_me:$LINENO: WARNING: $mt_id3lib_search_headers/id3/tag.h: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $mt_id3lib_search_headers/id3/tag.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $mt_id3lib_search_headers/id3/tag.h: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $mt_id3lib_search_headers/id3/tag.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { $as_echo "$as_me:$LINENO: WARNING: $mt_id3lib_search_headers/id3/tag.h: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $mt_id3lib_search_headers/id3/tag.h: present but cannot be compiled" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $mt_id3lib_search_headers/id3/tag.h: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $mt_id3lib_search_headers/id3/tag.h: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $mt_id3lib_search_headers/id3/tag.h: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $mt_id3lib_search_headers/id3/tag.h: see the Autoconf documentation" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $mt_id3lib_search_headers/id3/tag.h: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $mt_id3lib_search_headers/id3/tag.h: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $mt_id3lib_search_headers/id3/tag.h: proceeding with the preprocessor's result" >&5 $as_echo "$as_me: WARNING: $mt_id3lib_search_headers/id3/tag.h: proceeding with the preprocessor's result" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $mt_id3lib_search_headers/id3/tag.h: in the future, the compiler will take precedence" >&5 $as_echo "$as_me: WARNING: $mt_id3lib_search_headers/id3/tag.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------- ## ## Report this to jin@mediatomb.cc ## ## ------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { $as_echo "$as_me:$LINENO: checking for $mt_id3lib_search_headers/id3/tag.h" >&5 $as_echo_n "checking for $mt_id3lib_search_headers/id3/tag.h... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi as_val=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` if test "x$as_val" = x""yes; then mt_id3lib_cxxflags="-I${mt_id3lib_search_headers}" else mt_id3lib_header_status=missing if test "" = "pass"; then { $as_echo "$as_me:$LINENO: id3lib headers not found in requested location $mt_id3lib_search_headers" >&5 $as_echo "$as_me: id3lib headers not found in requested location $mt_id3lib_search_headers" >&6;} else { { $as_echo "$as_me:$LINENO: error: id3lib headers not found in requested location $mt_id3lib_search_headers" >&5 $as_echo "$as_me: error: id3lib headers not found in requested location $mt_id3lib_search_headers" >&2;} { (exit 1); exit 1; }; } fi fi else unset ac_cv_header_id3_tag_h if test "${ac_cv_header_id3_tag_h+set}" = set; then { $as_echo "$as_me:$LINENO: checking for id3/tag.h" >&5 $as_echo_n "checking for id3/tag.h... " >&6; } if test "${ac_cv_header_id3_tag_h+set}" = set; then $as_echo_n "(cached) " >&6 fi { $as_echo "$as_me:$LINENO: result: $ac_cv_header_id3_tag_h" >&5 $as_echo "$ac_cv_header_id3_tag_h" >&6; } else # Is the header compilable? { $as_echo "$as_me:$LINENO: checking id3/tag.h usability" >&5 $as_echo_n "checking id3/tag.h usability... " >&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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:$LINENO: checking id3/tag.h presence" >&5 $as_echo_n "checking id3/tag.h presence... " >&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 { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&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 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else $as_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 { $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in yes:no: ) { $as_echo "$as_me:$LINENO: WARNING: id3/tag.h: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: id3/tag.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:$LINENO: WARNING: id3/tag.h: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: id3/tag.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { $as_echo "$as_me:$LINENO: WARNING: id3/tag.h: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: id3/tag.h: present but cannot be compiled" >&2;} { $as_echo "$as_me:$LINENO: WARNING: id3/tag.h: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: id3/tag.h: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:$LINENO: WARNING: id3/tag.h: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: id3/tag.h: see the Autoconf documentation" >&2;} { $as_echo "$as_me:$LINENO: WARNING: id3/tag.h: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: id3/tag.h: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:$LINENO: WARNING: id3/tag.h: proceeding with the preprocessor's result" >&5 $as_echo "$as_me: WARNING: id3/tag.h: proceeding with the preprocessor's result" >&2;} { $as_echo "$as_me:$LINENO: WARNING: id3/tag.h: in the future, the compiler will take precedence" >&5 $as_echo "$as_me: WARNING: id3/tag.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------- ## ## Report this to jin@mediatomb.cc ## ## ------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { $as_echo "$as_me:$LINENO: checking for id3/tag.h" >&5 $as_echo_n "checking for id3/tag.h... " >&6; } if test "${ac_cv_header_id3_tag_h+set}" = set; then $as_echo_n "(cached) " >&6 else ac_cv_header_id3_tag_h=$ac_header_preproc fi { $as_echo "$as_me:$LINENO: result: $ac_cv_header_id3_tag_h" >&5 $as_echo "$ac_cv_header_id3_tag_h" >&6; } fi if test "x$ac_cv_header_id3_tag_h" = x""yes; then : else CFLAGS="$CFLAGS -I$MT_SEARCHPATH_HEADERS" CXXFLAGS="$CXXFLAGS -I$MT_SEARCHPATH_HEADERS" CPPFLAGS="$CPPFLAGS -I$MT_SEARCHPATH_HEADERS" unset ac_cv_header_id3_tag_h as_ac_Header=`$as_echo "ac_cv_header_$MT_SEARCHPATH_HEADERS/id3/tag.h" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { $as_echo "$as_me:$LINENO: checking for $MT_SEARCHPATH_HEADERS/id3/tag.h" >&5 $as_echo_n "checking for $MT_SEARCHPATH_HEADERS/id3/tag.h... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:$LINENO: checking $MT_SEARCHPATH_HEADERS/id3/tag.h usability" >&5 $as_echo_n "checking $MT_SEARCHPATH_HEADERS/id3/tag.h usability... " >&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 <$MT_SEARCHPATH_HEADERS/id3/tag.h> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:$LINENO: checking $MT_SEARCHPATH_HEADERS/id3/tag.h presence" >&5 $as_echo_n "checking $MT_SEARCHPATH_HEADERS/id3/tag.h presence... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$MT_SEARCHPATH_HEADERS/id3/tag.h> _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&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 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else $as_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 { $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in yes:no: ) { $as_echo "$as_me:$LINENO: WARNING: $MT_SEARCHPATH_HEADERS/id3/tag.h: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $MT_SEARCHPATH_HEADERS/id3/tag.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $MT_SEARCHPATH_HEADERS/id3/tag.h: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $MT_SEARCHPATH_HEADERS/id3/tag.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { $as_echo "$as_me:$LINENO: WARNING: $MT_SEARCHPATH_HEADERS/id3/tag.h: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $MT_SEARCHPATH_HEADERS/id3/tag.h: present but cannot be compiled" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $MT_SEARCHPATH_HEADERS/id3/tag.h: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $MT_SEARCHPATH_HEADERS/id3/tag.h: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $MT_SEARCHPATH_HEADERS/id3/tag.h: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $MT_SEARCHPATH_HEADERS/id3/tag.h: see the Autoconf documentation" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $MT_SEARCHPATH_HEADERS/id3/tag.h: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $MT_SEARCHPATH_HEADERS/id3/tag.h: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $MT_SEARCHPATH_HEADERS/id3/tag.h: proceeding with the preprocessor's result" >&5 $as_echo "$as_me: WARNING: $MT_SEARCHPATH_HEADERS/id3/tag.h: proceeding with the preprocessor's result" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $MT_SEARCHPATH_HEADERS/id3/tag.h: in the future, the compiler will take precedence" >&5 $as_echo "$as_me: WARNING: $MT_SEARCHPATH_HEADERS/id3/tag.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------- ## ## Report this to jin@mediatomb.cc ## ## ------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { $as_echo "$as_me:$LINENO: checking for $MT_SEARCHPATH_HEADERS/id3/tag.h" >&5 $as_echo_n "checking for $MT_SEARCHPATH_HEADERS/id3/tag.h... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi as_val=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` if test "x$as_val" = x""yes; then mt_id3lib_cxxflags="-I${MT_SEARCHPATH_HEADERS}" else mt_id3lib_header_status=missing fi fi fi if test "x$mt_id3lib_header_status" != xyes; then mt_id3lib_cxxflags="" fi LIBS=$LIBS_SAVE LDFLAGS=$LDFLAGS_SAVE CFLAGS=$CFLAGS_SAVE CXXFLAGS=$CXXFLAGS_SAVE CPPFLAGS=$CPPFLAGS_SAVE mt_id3lib_package_status=${mt_id3lib_header_status} if test "x$mt_id3lib_package_status" = xyes; then mt_id3lib_arg_default=yes mt_id3lib_library_status=yes LIBS_SAVE=$LIBS LDFLAGS_SAVE=$LDFLAGS CFLAGS_SAVE=$CFLAGS CXXFLAGS_SAVE=$CXXFLAGS CPPFLAGS_SAVE=$CPPFLAGS # Check whether --with-id3lib-libs was given. if test "${with_id3lib_libs+set}" = set; then withval=$with_id3lib_libs; mt_id3lib_search_libs="$withval" { $as_echo "$as_me:$LINENO: Will search for id3lib libs in $withval" >&5 $as_echo "$as_me: Will search for id3lib libs in $withval" >&6;} fi if test "$mt_id3lib_search_libs" ; then unset ac_cv_lib_id3_main LDFLAGS="$LDFLAGS -L$mt_id3lib_search_libs" { $as_echo "$as_me:$LINENO: checking for main in -lid3" >&5 $as_echo_n "checking for main in -lid3... " >&6; } if test "${ac_cv_lib_id3_main+set}" = set; then $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lid3 $LIBS" 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 main (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_lib_id3_main=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_id3_main=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_id3_main" >&5 $as_echo "$ac_cv_lib_id3_main" >&6; } if test "x$ac_cv_lib_id3_main" = x""yes; then mt_id3lib_libs="-lid3" mt_id3lib_ldflags="-L$mt_id3lib_search_libs" else mt_id3lib_library_status=missing if test "" = "pass"; then { $as_echo "$as_me:$LINENO: id3lib library not found in requested location $mt_id3lib_search_libs" >&5 $as_echo "$as_me: id3lib library not found in requested location $mt_id3lib_search_libs" >&6;} else { { $as_echo "$as_me:$LINENO: error: id3lib library not found in requested location $mt_id3lib_search_libs" >&5 $as_echo "$as_me: error: id3lib library not found in requested location $mt_id3lib_search_libs" >&2;} { (exit 1); exit 1; }; } fi fi else unset ac_cv_lib_id3_main { $as_echo "$as_me:$LINENO: checking for main in -lid3" >&5 $as_echo_n "checking for main in -lid3... " >&6; } if test "${ac_cv_lib_id3_main+set}" = set; then $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lid3 $LIBS" 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 main (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_lib_id3_main=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_id3_main=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_id3_main" >&5 $as_echo "$ac_cv_lib_id3_main" >&6; } if test "x$ac_cv_lib_id3_main" = x""yes; then mt_id3lib_libs="-lid3" else LDFLAGS="$LDFLAGS -L$MT_SEARCHPATH_LIBS" unset ac_cv_lib_id3_main { $as_echo "$as_me:$LINENO: checking for main in -lid3" >&5 $as_echo_n "checking for main in -lid3... " >&6; } if test "${ac_cv_lib_id3_main+set}" = set; then $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lid3 $LIBS" 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 main (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_lib_id3_main=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_id3_main=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_id3_main" >&5 $as_echo "$ac_cv_lib_id3_main" >&6; } if test "x$ac_cv_lib_id3_main" = x""yes; then mt_id3lib_libs="-lid3" mt_id3lib_ldflags="-L$MT_SEARCHPATH_LIBS" else mt_id3lib_library_status=missing fi fi fi if test "x$mt_id3lib_library_status" != xyes; then mt_id3lib_libs="" mt_id3lib_ldflags="" fi LIBS=$LIBS_SAVE LDFLAGS=$LDFLAGS_SAVE CFLAGS=$CFLAGS_SAVE CXXFLAGS=$CXXFLAGS_SAVE CPPFLAGS=$CPPFLAGS_SAVE mt_id3lib_package_status=${mt_id3lib_library_status} fi if test "x$mt_id3lib_package_status" = xyes; then ID3LIB_CFLAGS=${mt_id3lib_cxxflags} ID3LIB_LIBS=${mt_id3lib_libs} ID3LIB_LDFLAGS=${mt_id3lib_ldflags} fi mt_id3lib_status=${mt_id3lib_package_status} fi if test "x$mt_id3lib_status" = xyes; then cat >>confdefs.h <<\_ACEOF #define HAVE_ID3LIB 1 _ACEOF fi ID3LIB_STATUS=${mt_id3lib_status} if test "x$ID3LIB_STATUS" = xyes; then ID3LIB_LIBS="$ID3LIB_LIBS $ZLIB_LIBS" ID3LIB_LDFLAGS="$ID3LIB_LDFLAGS $ZLIB_LDFLAGS" fi fi fi fi if test "x$ID3LIB_STATUS" = xyes; then CFLAGS="$CFLAGS $ID3_CFLAGS" CXXFLAGS="$CXXFLAGS $ID3_CFLAGS" LDFLAGS="$LDFLAGS $ID3LIB_LDFLAGS $ID3LIB_LIBS" ac_ext=cpp 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 { $as_echo "$as_me:$LINENO: checking for album art support in id3lib" >&5 $as_echo_n "checking for album art support in id3lib... " >&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 () { (void)ID3_HasPicture(0); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then { $as_echo "$as_me:$LINENO: result: yes" >&5 $as_echo "yes" >&6; } cat >>confdefs.h <<\_ACEOF #define HAVE_ID3_ALBUMART 1 _ACEOF else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_ext=cpp 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 else if (test "x$ID3LIB_OPTION_REQUESTED" = xyes) && (test "x$ID3LIB_OPTION_ENABLED" = xyes); then if test "x$TAGLIB_STATUS" = xyes; then { { $as_echo "$as_me:$LINENO: error: Please select either taglib or id3lib, but not both." >&5 $as_echo "$as_me: error: Please select either taglib or id3lib, but not both." >&2;} { (exit 1); exit 1; }; } else { { $as_echo "$as_me:$LINENO: error: unable to configure id3lib support" >&5 $as_echo "$as_me: error: unable to configure id3lib support" >&2;} { (exit 1); exit 1; }; } fi else ID3LIB_STATUS=disabled fi fi LDFLAGS="$LDFLAGS_SAVE" LIBS="$LIBS_SAVE" CXXFLAGS="$CXXFLAGS_SAVE" CPPFLAGS="$CPPFLAGS_SAVE" ######## curl CURL_PROG_FOUND=0 CURL_LIBS= CURL_CFLAGS= CURL_OK=no if ((test "x$YOUTUBE_OPTION_ENABLED" = xyes) && (test "x$YOUTUBE_OPTION_REQUESTED" = xyes) && (test $USE_CURL -eq 0) && (test $CURL_REQUESTED -eq 1)); then { { $as_echo "$as_me:$LINENO: error: You enabled YouTube but disabled curl, however curl is required by the YouTube feature" >&5 $as_echo "$as_me: error: You enabled YouTube but disabled curl, however curl is required by the YouTube feature" >&2;} { (exit 1); exit 1; }; } fi if ((test "x$WEBORAMA_OPTION_ENABLED" = xyes) && (test "x$WEBORAMA_OPTION_REQUESTED" = xyes) && (test $USE_CURL -eq 0) && (test $CURL_REQUESTED -eq 1)); then { { $as_echo "$as_me:$LINENO: error: You enabled Weborama but disabled curl, however curl is required by the Weborama feature" >&5 $as_echo "$as_me: error: You enabled Weborama but disabled curl, however curl is required by the Weborama feature" >&2;} { (exit 1); exit 1; }; } fi if ((test "x$ATRAILERS_OPTION_ENABLED" = xyes) && (test "x$ATRAILERS_OPTION_REQUESTED" = xyes) && (test $USE_CURL -eq 0) && (test $CURL_REQUESTED -eq 1)); then { { $as_echo "$as_me:$LINENO: error: You enabled Apple Trailers but disabled curl, however curl is required by the Apple Trailers feature" >&5 $as_echo "$as_me: error: You enabled Apple Trailers but disabled curl, however curl is required by the Apple Trailers feature" >&2;} { (exit 1); exit 1; }; } fi if ((test "x$YOUTUBE_OPTION_ENABLED" != xyes) && (test "x$SOPCAST_OPTION_ENABLED" != xyes) && (test "x$EXTERNAL_TRANSCODING_OPTION" != xyes) && (test "x$ATRAILERS_OPTION_ENABLED" != xyes) && (test "x$WEBORAMA_OPTION_ENABLED" != xyes)); then if test $USE_CURL -eq 1; then if test $CURL_REQUESTED -eq 1; then { { $as_echo "$as_me:$LINENO: error: You enabled curl support but the external transcoding, YouTube and SopCast features are disabled - curl is not needed without it" >&5 $as_echo "$as_me: error: You enabled curl support but the external transcoding, YouTube and SopCast features are disabled - curl is not needed without it" >&2;} { (exit 1); exit 1; }; } else CURL_OK=no USE_CURL=0 fi fi fi if (((test "x$YOUTUBE_OPTION_ENABLED" = xyes) || (test "x$SOPCAST_OPTION_ENABLED" = xyes) || (test "x$ATRAILERS_OPTION_ENABLED" = xyes) || (test "x$WEBORAMA_OPTION_ENABLED" = xyes) || (test "x$EXTERNAL_TRANSCODING_OPTION" = xyes)) && (test $USE_CURL -eq 1)); then { $as_echo "$as_me:$LINENO: Checking for curl (needed for extended external transcoding/YouTube support)" >&5 $as_echo "$as_me: Checking for curl (needed for extended external transcoding/YouTube support)" >&6;} CURL_OK=yes if test -n "$CURL_SEARCH_CONFIG"; then { $as_echo "$as_me:$LINENO: You specified $CURL_SEARCH_CONFIG for curl-config" >&5 $as_echo "$as_me: You specified $CURL_SEARCH_CONFIG for curl-config" >&6;} if test -f "$CURL_SEARCH_CONFIG"; then curlconfig="$CURL_SEARCH_CONFIG" else curlconfig="no" fi if test "x$curlconfig" = xno; then { { $as_echo "$as_me:$LINENO: error: $CURL_SEARCH_CONFIG not found" >&5 $as_echo "$as_me: error: $CURL_SEARCH_CONFIG not found" >&2;} { (exit 1); exit 1; }; } else CURL_TEST=`${curlconfig} --version 2>/dev/null` if test -z "$CURL_TEST"; then { { $as_echo "$as_me:$LINENO: error: ${curlconfig} could not be executed or returned invalid values" >&5 $as_echo "$as_me: error: ${curlconfig} could not be executed or returned invalid values" >&2;} { (exit 1); exit 1; }; } fi CURL_PROG_FOUND=1 fi else # Extract the first word of "curl-config", so it can be a program name with args. set dummy curl-config; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_curlconfig+set}" = set; then $as_echo_n "(cached) " >&6 else case $curlconfig in [\\/]* | ?:[\\/]*) ac_cv_path_curlconfig="$curlconfig" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_curlconfig="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_curlconfig" && ac_cv_path_curlconfig="no" ;; esac fi curlconfig=$ac_cv_path_curlconfig if test -n "$curlconfig"; then { $as_echo "$as_me:$LINENO: result: $curlconfig" >&5 $as_echo "$curlconfig" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi if test "x$curlconfig" = xno; then unset ac_cv_path_curlconfig # Extract the first word of "curl-config", so it can be a program name with args. set dummy curl-config; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_curlconfig+set}" = set; then $as_echo_n "(cached) " >&6 else case $curlconfig in [\\/]* | ?:[\\/]*) ac_cv_path_curlconfig="$curlconfig" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $SEARCH_DIR_PROGS do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_curlconfig="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_curlconfig" && ac_cv_path_curlconfig="no" ;; esac fi curlconfig=$ac_cv_path_curlconfig if test -n "$curlconfig"; then { $as_echo "$as_me:$LINENO: result: $curlconfig" >&5 $as_echo "$curlconfig" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi if test "x$curlconfig" = xno; then CURL_OK=missing { $as_echo "$as_me:$LINENO: result: curl-config not found, please install the curl-devel package" >&5 $as_echo "curl-config not found, please install the curl-devel package" >&6; } else CURL_PROG_FOUND=1 fi else CURL_PROG_FOUND=1 fi fi if test $CURL_PROG_FOUND -eq 1 ; then { $as_echo "$as_me:$LINENO: checking curl cflags" >&5 $as_echo_n "checking curl cflags... " >&6; } CURL_CFLAGS=`${curlconfig} --cflags` { $as_echo "$as_me:$LINENO: result: $CURL_CFLAGS" >&5 $as_echo "$CURL_CFLAGS" >&6; } { $as_echo "$as_me:$LINENO: checking curl libraries" >&5 $as_echo_n "checking curl libraries... " >&6; } CURL_LIBS=`${curlconfig} --libs` { $as_echo "$as_me:$LINENO: result: $CURL_LIBS" >&5 $as_echo "$CURL_LIBS" >&6; } fi fi if test "x$CURL_OK" = xyes; then CPPFLAGS="$CPPFLAGS $CURL_CFLAGS" CXXFLAGS="$CXXFLAGS $CURL_CFLAGS" for ac_header in curl/curl.h do as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 $as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 $as_echo_n "checking $ac_header usability... " >&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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 $as_echo_n "checking $ac_header presence... " >&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 { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&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 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else $as_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 { $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in yes:no: ) { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 $as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 $as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------- ## ## Report this to jin@mediatomb.cc ## ## ------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 $as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi as_val=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF else CURL_OK=missing fi done fi if test "x$CURL_OK" = xyes; then LDFLAGS="$CURL_LIBS" { $as_echo "$as_me:$LINENO: checking for curl_easy_init in -lcurl" >&5 $as_echo_n "checking for curl_easy_init in -lcurl... " >&6; } if test "${ac_cv_lib_curl_curl_easy_init+set}" = set; then $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcurl $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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char curl_easy_init (); int main () { return curl_easy_init (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_lib_curl_curl_easy_init=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_curl_curl_easy_init=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_curl_curl_easy_init" >&5 $as_echo "$ac_cv_lib_curl_curl_easy_init" >&6; } if test "x$ac_cv_lib_curl_curl_easy_init" = x""yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBCURL 1 _ACEOF LIBS="-lcurl $LIBS" else CURL_OK=missing fi fi if test "x$CURL_OK" = xyes; then cat >>confdefs.h <<\_ACEOF #define HAVE_CURL 1 _ACEOF else if (test "x$YOUTUBE_OPTION_ENABLED" = xyes) && (test "x$YOUTUBE_OPTION_REQUESTED" = xyes); then { { $as_echo "$as_me:$LINENO: error: unable to configure curl which is required for YouTube support!" >&5 $as_echo "$as_me: error: unable to configure curl which is required for YouTube support!" >&2;} { (exit 1); exit 1; }; } fi if (test "x$YOUTUBE_OPTION_ENABLED" = xyes) && (test "x$YOUTUBE_OPTION_REQUESTED" != xyes); then { $as_echo "$as_me:$LINENO: WARNING: curl not found, disabling YouTube" >&5 $as_echo "$as_me: WARNING: curl not found, disabling YouTube" >&2;} YOUTUBE_OPTION_ENABLED="missing" fi if (test "x$WEBORAMA_OPTION_ENABLED" = xyes) && (test "x$WEBORAMA_OPTION_REQUESTED" = xyes); then { { $as_echo "$as_me:$LINENO: error: unable to configure curl which is required for Weborama support!" >&5 $as_echo "$as_me: error: unable to configure curl which is required for Weborama support!" >&2;} { (exit 1); exit 1; }; } fi if (test "x$WEBORAMA_OPTION_ENABLED" = xyes) && (test "x$WEBORAMA_OPTION_REQUESTED" != xyes); then { $as_echo "$as_me:$LINENO: WARNING: curl not found, disabling Weborama" >&5 $as_echo "$as_me: WARNING: curl not found, disabling Weborama" >&2;} WEBORAMA_OPTION_ENABLED="missing" fi if (test "x$ATRAILERS_OPTION_ENABLED" = xyes) && (test "x$ATRAILERS_OPTION_REQUESTED" = xyes); then { { $as_echo "$as_me:$LINENO: error: unable to configure curl which is required for Apple Trailers support!" >&5 $as_echo "$as_me: error: unable to configure curl which is required for Apple Trailers support!" >&2;} { (exit 1); exit 1; }; } fi if (test "x$ATRAILERS_OPTION_ENABLED" = xyes) && (test "x$ATRAILERS_OPTION_REQUESTED" != xyes); then { $as_echo "$as_me:$LINENO: WARNING: curl not found, disabling Apple Trailers" >&5 $as_echo "$as_me: WARNING: curl not found, disabling Apple Trailers" >&2;} ATRAILERS_OPTION_ENABLED="missing" fi if (test "x$SOPCAST_OPTION_ENABLED" = xyes) && (test "x$SOPCAST_OPTION_REQUESTED" = xyes); then { { $as_echo "$as_me:$LINENO: error: unable to configure curl which is required for SopCast support!" >&5 $as_echo "$as_me: error: unable to configure curl which is required for SopCast support!" >&2;} { (exit 1); exit 1; }; } fi if (test "x$SOPCAST_OPTION_ENABLED" = xyes) && (test "x$SOPCAST_OPTION_REQUESTED" != xyes); then { $as_echo "$as_me:$LINENO: WARNING: curl not found, disabling SopCast" >&5 $as_echo "$as_me: WARNING: curl not found, disabling SopCast" >&2;} SOPCAST_OPTION_ENABLED="missing" fi if test "x$EXTERNAL_TRANSCODING_OPTION" = xyes; then if ((test $USE_CURL -eq 1) && (test $CURL_REQUESTED -eq 0)); then { $as_echo "$as_me:$LINENO: WARNING: unable to configure curl, external transcoding will have limited functionality!" >&5 $as_echo "$as_me: WARNING: unable to configure curl, external transcoding will have limited functionality!" >&2;} fi if ((test $USE_CURL -eq 1) && (test $CURL_REQUESTED -eq 1)); then { { $as_echo "$as_me:$LINENO: error: You enabled curl support but the curl library could not be configured" >&5 $as_echo "$as_me: error: You enabled curl support but the curl library could not be configured" >&2;} { (exit 1); exit 1; }; } fi fi if (test "x$YOUTUBE_OPTION_ENABLED" != xyes) && (test "x$WEBORAMA_OPTION_ENABLED" != xyes) && (test "x$ATRAILERS_OPTION_ENABLED" != xyes) && (test "x$EXTERNAL_TRANSCODING_OPTION" = !xyes) && (test "x$SOPCAST_OPTION_ENABLED" != xyes); then CURL_CFLAGS= CURL_LIBS= fi fi CPPFLAGS="$CPPFLAGS_SAVE" CXXFLAGS="$CXXFLAGS_SAVE" LDFLAGS="$LDFLAGS_SAVE" ######## ffmpeg or extractor? FFMPEG_STATUS= LIBEXTRACTOR_STATUS= mt_libextractor_option_enabled= mt_libextractor_option_requested=no if test "xenable" = xdisable; then mt_libextractor_option_enabled=yes else mt_libextractor_option_enabled=no fi # Check whether --enable-libextractor was given. if test "${enable_libextractor+set}" = set; then enableval=$enable_libextractor; mt_libextractor_option_enabled=$enableval mt_libextractor_option_requested=yes fi LIBEXTRACTOR_OPTION_ENABLED=${mt_libextractor_option_enabled} LIBEXTRACTOR_OPTION_REQUESTED=${mt_libextractor_option_requested} mt_ffmpeg_option_enabled= mt_ffmpeg_option_requested=no if test "xdisable" = xdisable; then mt_ffmpeg_option_enabled=yes else mt_ffmpeg_option_enabled=no fi # Check whether --enable-ffmpeg was given. if test "${enable_ffmpeg+set}" = set; then enableval=$enable_ffmpeg; mt_ffmpeg_option_enabled=$enableval mt_ffmpeg_option_requested=yes fi FFMPEG_OPTION_ENABLED=${mt_ffmpeg_option_enabled} FFMPEG_OPTION_REQUESTED=${mt_ffmpeg_option_requested} if ((test "x$FFMPEG_OPTION_ENABLED" = xno) && (test "x$LIBEXTRACTOR_OPTION_ENABLED" = xyes)) ; then FFMPEG_STATUS=disabled FFMPEG_OPTION_ENABLED=no { $as_echo "$as_me:$LINENO: WARNING: ffmpeg disabled" >&5 $as_echo "$as_me: WARNING: ffmpeg disabled" >&2;} elif ((test "x$FFMPEG_OPTION_ENABLED" = xyes) && (test "x$LIBEXTRACTOR_OPTION_ENABLED" = xno)) ; then LIBEXTRACTOR_STATUS=disabled LIBEXTRACTOR_OPTION_ENABLED=no elif ((test "x$FFMPEG_OPTION_ENABLED" = xyes) && (test "x$LIBEXTRACTOR_OPTION_ENABLED" = xyes)) ; then if ((test "x$FFMPEG_OPTION_REQUESTED" = xyes) && (test "x$LIBEXTRACTOR_OPTION_REQUESTED" = xyes)); then { { $as_echo "$as_me:$LINENO: error: Please select either ffmpeg or libextractor, but not both." >&5 $as_echo "$as_me: error: Please select either ffmpeg or libextractor, but not both." >&2;} { (exit 1); exit 1; }; } elif ((test "x$FFMPEG_OPTION_REQUESTED" = xyes) && (test "x$LIBEXTRACTOR_OPTION_REQUESTED" = xno)); then LIBEXTRACTOR_STATUS=disabled LIBEXTRACTOR_OPTION_ENABLED=no elif ((test "x$FFMPEG_OPTION_REQUESTED" = xno) && (test "x$LIBEXTRACTOR_OPTION_REQUESTED" = xyes)); then FFMPEG_STATUS=disabled FFMPEG_OPTION_ENABLED=no { $as_echo "$as_me:$LINENO: WARNING: ffmpeg disabled" >&5 $as_echo "$as_me: WARNING: ffmpeg disabled" >&2;} fi fi ######## ffmpeg if test "x$FFMPEG_OPTION_ENABLED" = 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 FFMPEG_EXTRA_CFLAGS="" # the header location of the older and newer ffmpeg version is different LIBS_SAVE=$LIBS LDFLAGS_SAVE=$LDFLAGS CFLAGS_SAVE=$CFLAGS CXXFLAGS_SAVE=$CXXFLAGS CPPFLAGS_SAVE=$CPPFLAGS mt_avformat_header_status=yes # Check whether --with-avformat-h was given. if test "${with_avformat_h+set}" = set; then withval=$with_avformat_h; mt_avformat_search_headers="$withval" { $as_echo "$as_me:$LINENO: Will search for avformat headers in $withval" >&5 $as_echo "$as_me: Will search for avformat headers in $withval" >&6;} fi if test "$mt_avformat_search_headers" ; then unset ac_cv_header_ffmpeg_avformat_h CFLAGS="$CFLAGS -I${mt_avformat_search_headers}" CXXFLAGS="$CXXFLAGS -I${mt_avformat_search_headers}" CPPFLAGS="$CPPFLAGS -I${mt_avformat_search_headers}" as_ac_Header=`$as_echo "ac_cv_header_$mt_avformat_search_headers/ffmpeg/avformat.h" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { $as_echo "$as_me:$LINENO: checking for $mt_avformat_search_headers/ffmpeg/avformat.h" >&5 $as_echo_n "checking for $mt_avformat_search_headers/ffmpeg/avformat.h... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:$LINENO: checking $mt_avformat_search_headers/ffmpeg/avformat.h usability" >&5 $as_echo_n "checking $mt_avformat_search_headers/ffmpeg/avformat.h usability... " >&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 <$mt_avformat_search_headers/ffmpeg/avformat.h> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:$LINENO: checking $mt_avformat_search_headers/ffmpeg/avformat.h presence" >&5 $as_echo_n "checking $mt_avformat_search_headers/ffmpeg/avformat.h presence... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$mt_avformat_search_headers/ffmpeg/avformat.h> _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&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 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else $as_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 { $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { $as_echo "$as_me:$LINENO: WARNING: $mt_avformat_search_headers/ffmpeg/avformat.h: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $mt_avformat_search_headers/ffmpeg/avformat.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $mt_avformat_search_headers/ffmpeg/avformat.h: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $mt_avformat_search_headers/ffmpeg/avformat.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { $as_echo "$as_me:$LINENO: WARNING: $mt_avformat_search_headers/ffmpeg/avformat.h: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $mt_avformat_search_headers/ffmpeg/avformat.h: present but cannot be compiled" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $mt_avformat_search_headers/ffmpeg/avformat.h: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $mt_avformat_search_headers/ffmpeg/avformat.h: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $mt_avformat_search_headers/ffmpeg/avformat.h: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $mt_avformat_search_headers/ffmpeg/avformat.h: see the Autoconf documentation" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $mt_avformat_search_headers/ffmpeg/avformat.h: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $mt_avformat_search_headers/ffmpeg/avformat.h: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $mt_avformat_search_headers/ffmpeg/avformat.h: proceeding with the preprocessor's result" >&5 $as_echo "$as_me: WARNING: $mt_avformat_search_headers/ffmpeg/avformat.h: proceeding with the preprocessor's result" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $mt_avformat_search_headers/ffmpeg/avformat.h: in the future, the compiler will take precedence" >&5 $as_echo "$as_me: WARNING: $mt_avformat_search_headers/ffmpeg/avformat.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------- ## ## Report this to jin@mediatomb.cc ## ## ------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { $as_echo "$as_me:$LINENO: checking for $mt_avformat_search_headers/ffmpeg/avformat.h" >&5 $as_echo_n "checking for $mt_avformat_search_headers/ffmpeg/avformat.h... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi as_val=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` if test "x$as_val" = x""yes; then mt_avformat_cxxflags="-I${mt_avformat_search_headers}" else mt_avformat_header_status=missing if test "pass" = "pass"; then { $as_echo "$as_me:$LINENO: avformat headers not found in requested location $mt_avformat_search_headers" >&5 $as_echo "$as_me: avformat headers not found in requested location $mt_avformat_search_headers" >&6;} else { { $as_echo "$as_me:$LINENO: error: avformat headers not found in requested location $mt_avformat_search_headers" >&5 $as_echo "$as_me: error: avformat headers not found in requested location $mt_avformat_search_headers" >&2;} { (exit 1); exit 1; }; } fi fi else unset ac_cv_header_ffmpeg_avformat_h if test "${ac_cv_header_ffmpeg_avformat_h+set}" = set; then { $as_echo "$as_me:$LINENO: checking for ffmpeg/avformat.h" >&5 $as_echo_n "checking for ffmpeg/avformat.h... " >&6; } if test "${ac_cv_header_ffmpeg_avformat_h+set}" = set; then $as_echo_n "(cached) " >&6 fi { $as_echo "$as_me:$LINENO: result: $ac_cv_header_ffmpeg_avformat_h" >&5 $as_echo "$ac_cv_header_ffmpeg_avformat_h" >&6; } else # Is the header compilable? { $as_echo "$as_me:$LINENO: checking ffmpeg/avformat.h usability" >&5 $as_echo_n "checking ffmpeg/avformat.h usability... " >&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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:$LINENO: checking ffmpeg/avformat.h presence" >&5 $as_echo_n "checking ffmpeg/avformat.h presence... " >&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 { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&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 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else $as_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 { $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { $as_echo "$as_me:$LINENO: WARNING: ffmpeg/avformat.h: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: ffmpeg/avformat.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:$LINENO: WARNING: ffmpeg/avformat.h: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: ffmpeg/avformat.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { $as_echo "$as_me:$LINENO: WARNING: ffmpeg/avformat.h: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: ffmpeg/avformat.h: present but cannot be compiled" >&2;} { $as_echo "$as_me:$LINENO: WARNING: ffmpeg/avformat.h: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: ffmpeg/avformat.h: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:$LINENO: WARNING: ffmpeg/avformat.h: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: ffmpeg/avformat.h: see the Autoconf documentation" >&2;} { $as_echo "$as_me:$LINENO: WARNING: ffmpeg/avformat.h: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: ffmpeg/avformat.h: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:$LINENO: WARNING: ffmpeg/avformat.h: proceeding with the preprocessor's result" >&5 $as_echo "$as_me: WARNING: ffmpeg/avformat.h: proceeding with the preprocessor's result" >&2;} { $as_echo "$as_me:$LINENO: WARNING: ffmpeg/avformat.h: in the future, the compiler will take precedence" >&5 $as_echo "$as_me: WARNING: ffmpeg/avformat.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------- ## ## Report this to jin@mediatomb.cc ## ## ------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { $as_echo "$as_me:$LINENO: checking for ffmpeg/avformat.h" >&5 $as_echo_n "checking for ffmpeg/avformat.h... " >&6; } if test "${ac_cv_header_ffmpeg_avformat_h+set}" = set; then $as_echo_n "(cached) " >&6 else ac_cv_header_ffmpeg_avformat_h=$ac_header_preproc fi { $as_echo "$as_me:$LINENO: result: $ac_cv_header_ffmpeg_avformat_h" >&5 $as_echo "$ac_cv_header_ffmpeg_avformat_h" >&6; } fi if test "x$ac_cv_header_ffmpeg_avformat_h" = x""yes; then : else CFLAGS="$CFLAGS -I$MT_SEARCHPATH_HEADERS" CXXFLAGS="$CXXFLAGS -I$MT_SEARCHPATH_HEADERS" CPPFLAGS="$CPPFLAGS -I$MT_SEARCHPATH_HEADERS" unset ac_cv_header_ffmpeg_avformat_h as_ac_Header=`$as_echo "ac_cv_header_$MT_SEARCHPATH_HEADERS/ffmpeg/avformat.h" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { $as_echo "$as_me:$LINENO: checking for $MT_SEARCHPATH_HEADERS/ffmpeg/avformat.h" >&5 $as_echo_n "checking for $MT_SEARCHPATH_HEADERS/ffmpeg/avformat.h... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:$LINENO: checking $MT_SEARCHPATH_HEADERS/ffmpeg/avformat.h usability" >&5 $as_echo_n "checking $MT_SEARCHPATH_HEADERS/ffmpeg/avformat.h usability... " >&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 <$MT_SEARCHPATH_HEADERS/ffmpeg/avformat.h> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:$LINENO: checking $MT_SEARCHPATH_HEADERS/ffmpeg/avformat.h presence" >&5 $as_echo_n "checking $MT_SEARCHPATH_HEADERS/ffmpeg/avformat.h presence... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$MT_SEARCHPATH_HEADERS/ffmpeg/avformat.h> _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&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 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else $as_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 { $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { $as_echo "$as_me:$LINENO: WARNING: $MT_SEARCHPATH_HEADERS/ffmpeg/avformat.h: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $MT_SEARCHPATH_HEADERS/ffmpeg/avformat.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $MT_SEARCHPATH_HEADERS/ffmpeg/avformat.h: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $MT_SEARCHPATH_HEADERS/ffmpeg/avformat.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { $as_echo "$as_me:$LINENO: WARNING: $MT_SEARCHPATH_HEADERS/ffmpeg/avformat.h: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $MT_SEARCHPATH_HEADERS/ffmpeg/avformat.h: present but cannot be compiled" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $MT_SEARCHPATH_HEADERS/ffmpeg/avformat.h: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $MT_SEARCHPATH_HEADERS/ffmpeg/avformat.h: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $MT_SEARCHPATH_HEADERS/ffmpeg/avformat.h: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $MT_SEARCHPATH_HEADERS/ffmpeg/avformat.h: see the Autoconf documentation" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $MT_SEARCHPATH_HEADERS/ffmpeg/avformat.h: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $MT_SEARCHPATH_HEADERS/ffmpeg/avformat.h: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $MT_SEARCHPATH_HEADERS/ffmpeg/avformat.h: proceeding with the preprocessor's result" >&5 $as_echo "$as_me: WARNING: $MT_SEARCHPATH_HEADERS/ffmpeg/avformat.h: proceeding with the preprocessor's result" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $MT_SEARCHPATH_HEADERS/ffmpeg/avformat.h: in the future, the compiler will take precedence" >&5 $as_echo "$as_me: WARNING: $MT_SEARCHPATH_HEADERS/ffmpeg/avformat.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------- ## ## Report this to jin@mediatomb.cc ## ## ------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { $as_echo "$as_me:$LINENO: checking for $MT_SEARCHPATH_HEADERS/ffmpeg/avformat.h" >&5 $as_echo_n "checking for $MT_SEARCHPATH_HEADERS/ffmpeg/avformat.h... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi as_val=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` if test "x$as_val" = x""yes; then mt_avformat_cxxflags="-I${MT_SEARCHPATH_HEADERS}" else mt_avformat_header_status=missing fi fi fi if test "x$mt_avformat_header_status" != xyes; then mt_avformat_cxxflags="" fi LIBS=$LIBS_SAVE LDFLAGS=$LDFLAGS_SAVE CFLAGS=$CFLAGS_SAVE CXXFLAGS=$CXXFLAGS_SAVE CPPFLAGS=$CPPFLAGS_SAVE AVFORMAT_CFLAGS=${mt_avformat_cxxflags} AVFORMAT_STATUS=${mt_avformat_header_status} if test "x$AVFORMAT_STATUS" != xyes; then LIBS_SAVE=$LIBS LDFLAGS_SAVE=$LDFLAGS CFLAGS_SAVE=$CFLAGS CXXFLAGS_SAVE=$CXXFLAGS CPPFLAGS_SAVE=$CPPFLAGS mt_avformat_header_status=yes # Check whether --with-avformat-h was given. if test "${with_avformat_h+set}" = set; then withval=$with_avformat_h; mt_avformat_search_headers="$withval" { $as_echo "$as_me:$LINENO: Will search for avformat headers in $withval" >&5 $as_echo "$as_me: Will search for avformat headers in $withval" >&6;} fi if test "$mt_avformat_search_headers" ; then unset ac_cv_header_libavformat_avformat_h CFLAGS="$CFLAGS -I${mt_avformat_search_headers}" CXXFLAGS="$CXXFLAGS -I${mt_avformat_search_headers}" CPPFLAGS="$CPPFLAGS -I${mt_avformat_search_headers}" as_ac_Header=`$as_echo "ac_cv_header_$mt_avformat_search_headers/libavformat/avformat.h" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { $as_echo "$as_me:$LINENO: checking for $mt_avformat_search_headers/libavformat/avformat.h" >&5 $as_echo_n "checking for $mt_avformat_search_headers/libavformat/avformat.h... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:$LINENO: checking $mt_avformat_search_headers/libavformat/avformat.h usability" >&5 $as_echo_n "checking $mt_avformat_search_headers/libavformat/avformat.h usability... " >&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 <$mt_avformat_search_headers/libavformat/avformat.h> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:$LINENO: checking $mt_avformat_search_headers/libavformat/avformat.h presence" >&5 $as_echo_n "checking $mt_avformat_search_headers/libavformat/avformat.h presence... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$mt_avformat_search_headers/libavformat/avformat.h> _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&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 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else $as_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 { $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { $as_echo "$as_me:$LINENO: WARNING: $mt_avformat_search_headers/libavformat/avformat.h: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $mt_avformat_search_headers/libavformat/avformat.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $mt_avformat_search_headers/libavformat/avformat.h: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $mt_avformat_search_headers/libavformat/avformat.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { $as_echo "$as_me:$LINENO: WARNING: $mt_avformat_search_headers/libavformat/avformat.h: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $mt_avformat_search_headers/libavformat/avformat.h: present but cannot be compiled" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $mt_avformat_search_headers/libavformat/avformat.h: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $mt_avformat_search_headers/libavformat/avformat.h: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $mt_avformat_search_headers/libavformat/avformat.h: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $mt_avformat_search_headers/libavformat/avformat.h: see the Autoconf documentation" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $mt_avformat_search_headers/libavformat/avformat.h: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $mt_avformat_search_headers/libavformat/avformat.h: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $mt_avformat_search_headers/libavformat/avformat.h: proceeding with the preprocessor's result" >&5 $as_echo "$as_me: WARNING: $mt_avformat_search_headers/libavformat/avformat.h: proceeding with the preprocessor's result" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $mt_avformat_search_headers/libavformat/avformat.h: in the future, the compiler will take precedence" >&5 $as_echo "$as_me: WARNING: $mt_avformat_search_headers/libavformat/avformat.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------- ## ## Report this to jin@mediatomb.cc ## ## ------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { $as_echo "$as_me:$LINENO: checking for $mt_avformat_search_headers/libavformat/avformat.h" >&5 $as_echo_n "checking for $mt_avformat_search_headers/libavformat/avformat.h... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi as_val=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` if test "x$as_val" = x""yes; then mt_avformat_cxxflags="-I${mt_avformat_search_headers}" else mt_avformat_header_status=missing if test "pass" = "pass"; then { $as_echo "$as_me:$LINENO: avformat headers not found in requested location $mt_avformat_search_headers" >&5 $as_echo "$as_me: avformat headers not found in requested location $mt_avformat_search_headers" >&6;} else { { $as_echo "$as_me:$LINENO: error: avformat headers not found in requested location $mt_avformat_search_headers" >&5 $as_echo "$as_me: error: avformat headers not found in requested location $mt_avformat_search_headers" >&2;} { (exit 1); exit 1; }; } fi fi else unset ac_cv_header_libavformat_avformat_h if test "${ac_cv_header_libavformat_avformat_h+set}" = set; then { $as_echo "$as_me:$LINENO: checking for libavformat/avformat.h" >&5 $as_echo_n "checking for libavformat/avformat.h... " >&6; } if test "${ac_cv_header_libavformat_avformat_h+set}" = set; then $as_echo_n "(cached) " >&6 fi { $as_echo "$as_me:$LINENO: result: $ac_cv_header_libavformat_avformat_h" >&5 $as_echo "$ac_cv_header_libavformat_avformat_h" >&6; } else # Is the header compilable? { $as_echo "$as_me:$LINENO: checking libavformat/avformat.h usability" >&5 $as_echo_n "checking libavformat/avformat.h usability... " >&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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:$LINENO: checking libavformat/avformat.h presence" >&5 $as_echo_n "checking libavformat/avformat.h presence... " >&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 { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&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 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else $as_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 { $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { $as_echo "$as_me:$LINENO: WARNING: libavformat/avformat.h: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: libavformat/avformat.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:$LINENO: WARNING: libavformat/avformat.h: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: libavformat/avformat.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { $as_echo "$as_me:$LINENO: WARNING: libavformat/avformat.h: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: libavformat/avformat.h: present but cannot be compiled" >&2;} { $as_echo "$as_me:$LINENO: WARNING: libavformat/avformat.h: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: libavformat/avformat.h: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:$LINENO: WARNING: libavformat/avformat.h: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: libavformat/avformat.h: see the Autoconf documentation" >&2;} { $as_echo "$as_me:$LINENO: WARNING: libavformat/avformat.h: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: libavformat/avformat.h: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:$LINENO: WARNING: libavformat/avformat.h: proceeding with the preprocessor's result" >&5 $as_echo "$as_me: WARNING: libavformat/avformat.h: proceeding with the preprocessor's result" >&2;} { $as_echo "$as_me:$LINENO: WARNING: libavformat/avformat.h: in the future, the compiler will take precedence" >&5 $as_echo "$as_me: WARNING: libavformat/avformat.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------- ## ## Report this to jin@mediatomb.cc ## ## ------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { $as_echo "$as_me:$LINENO: checking for libavformat/avformat.h" >&5 $as_echo_n "checking for libavformat/avformat.h... " >&6; } if test "${ac_cv_header_libavformat_avformat_h+set}" = set; then $as_echo_n "(cached) " >&6 else ac_cv_header_libavformat_avformat_h=$ac_header_preproc fi { $as_echo "$as_me:$LINENO: result: $ac_cv_header_libavformat_avformat_h" >&5 $as_echo "$ac_cv_header_libavformat_avformat_h" >&6; } fi if test "x$ac_cv_header_libavformat_avformat_h" = x""yes; then : else CFLAGS="$CFLAGS -I$MT_SEARCHPATH_HEADERS" CXXFLAGS="$CXXFLAGS -I$MT_SEARCHPATH_HEADERS" CPPFLAGS="$CPPFLAGS -I$MT_SEARCHPATH_HEADERS" unset ac_cv_header_libavformat_avformat_h as_ac_Header=`$as_echo "ac_cv_header_$MT_SEARCHPATH_HEADERS/libavformat/avformat.h" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { $as_echo "$as_me:$LINENO: checking for $MT_SEARCHPATH_HEADERS/libavformat/avformat.h" >&5 $as_echo_n "checking for $MT_SEARCHPATH_HEADERS/libavformat/avformat.h... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:$LINENO: checking $MT_SEARCHPATH_HEADERS/libavformat/avformat.h usability" >&5 $as_echo_n "checking $MT_SEARCHPATH_HEADERS/libavformat/avformat.h usability... " >&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 <$MT_SEARCHPATH_HEADERS/libavformat/avformat.h> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:$LINENO: checking $MT_SEARCHPATH_HEADERS/libavformat/avformat.h presence" >&5 $as_echo_n "checking $MT_SEARCHPATH_HEADERS/libavformat/avformat.h presence... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$MT_SEARCHPATH_HEADERS/libavformat/avformat.h> _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&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 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else $as_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 { $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { $as_echo "$as_me:$LINENO: WARNING: $MT_SEARCHPATH_HEADERS/libavformat/avformat.h: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $MT_SEARCHPATH_HEADERS/libavformat/avformat.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $MT_SEARCHPATH_HEADERS/libavformat/avformat.h: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $MT_SEARCHPATH_HEADERS/libavformat/avformat.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { $as_echo "$as_me:$LINENO: WARNING: $MT_SEARCHPATH_HEADERS/libavformat/avformat.h: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $MT_SEARCHPATH_HEADERS/libavformat/avformat.h: present but cannot be compiled" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $MT_SEARCHPATH_HEADERS/libavformat/avformat.h: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $MT_SEARCHPATH_HEADERS/libavformat/avformat.h: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $MT_SEARCHPATH_HEADERS/libavformat/avformat.h: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $MT_SEARCHPATH_HEADERS/libavformat/avformat.h: see the Autoconf documentation" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $MT_SEARCHPATH_HEADERS/libavformat/avformat.h: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $MT_SEARCHPATH_HEADERS/libavformat/avformat.h: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $MT_SEARCHPATH_HEADERS/libavformat/avformat.h: proceeding with the preprocessor's result" >&5 $as_echo "$as_me: WARNING: $MT_SEARCHPATH_HEADERS/libavformat/avformat.h: proceeding with the preprocessor's result" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $MT_SEARCHPATH_HEADERS/libavformat/avformat.h: in the future, the compiler will take precedence" >&5 $as_echo "$as_me: WARNING: $MT_SEARCHPATH_HEADERS/libavformat/avformat.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------- ## ## Report this to jin@mediatomb.cc ## ## ------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { $as_echo "$as_me:$LINENO: checking for $MT_SEARCHPATH_HEADERS/libavformat/avformat.h" >&5 $as_echo_n "checking for $MT_SEARCHPATH_HEADERS/libavformat/avformat.h... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi as_val=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` if test "x$as_val" = x""yes; then mt_avformat_cxxflags="-I${MT_SEARCHPATH_HEADERS}" else mt_avformat_header_status=missing fi fi fi if test "x$mt_avformat_header_status" != xyes; then mt_avformat_cxxflags="" fi LIBS=$LIBS_SAVE LDFLAGS=$LDFLAGS_SAVE CFLAGS=$CFLAGS_SAVE CXXFLAGS=$CXXFLAGS_SAVE CPPFLAGS=$CPPFLAGS_SAVE AVFORMAT_CFLAGS=${mt_avformat_cxxflags} AVFORMAT_STATUS=${mt_avformat_header_status} if test "x$AVFORMAT_STATUS" = xyes; then cat >>confdefs.h <<_ACEOF #define AVFORMAT_INCLUDE _ACEOF else CFLAGS="$CFLAGS -I/usr/include/ffmpeg" CPPFLAGS="$CPPFLAGS -I/usr/include/ffmpeg" LIBS_SAVE=$LIBS LDFLAGS_SAVE=$LDFLAGS CFLAGS_SAVE=$CFLAGS CXXFLAGS_SAVE=$CXXFLAGS CPPFLAGS_SAVE=$CPPFLAGS mt_avformat_header_status=yes # Check whether --with-avformat-h was given. if test "${with_avformat_h+set}" = set; then withval=$with_avformat_h; mt_avformat_search_headers="$withval" { $as_echo "$as_me:$LINENO: Will search for avformat headers in $withval" >&5 $as_echo "$as_me: Will search for avformat headers in $withval" >&6;} fi if test "$mt_avformat_search_headers" ; then unset ac_cv_header_libavformat_avformat_h CFLAGS="$CFLAGS -I${mt_avformat_search_headers}" CXXFLAGS="$CXXFLAGS -I${mt_avformat_search_headers}" CPPFLAGS="$CPPFLAGS -I${mt_avformat_search_headers}" as_ac_Header=`$as_echo "ac_cv_header_$mt_avformat_search_headers/libavformat/avformat.h" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { $as_echo "$as_me:$LINENO: checking for $mt_avformat_search_headers/libavformat/avformat.h" >&5 $as_echo_n "checking for $mt_avformat_search_headers/libavformat/avformat.h... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:$LINENO: checking $mt_avformat_search_headers/libavformat/avformat.h usability" >&5 $as_echo_n "checking $mt_avformat_search_headers/libavformat/avformat.h usability... " >&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 <$mt_avformat_search_headers/libavformat/avformat.h> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:$LINENO: checking $mt_avformat_search_headers/libavformat/avformat.h presence" >&5 $as_echo_n "checking $mt_avformat_search_headers/libavformat/avformat.h presence... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$mt_avformat_search_headers/libavformat/avformat.h> _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&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 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else $as_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 { $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { $as_echo "$as_me:$LINENO: WARNING: $mt_avformat_search_headers/libavformat/avformat.h: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $mt_avformat_search_headers/libavformat/avformat.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $mt_avformat_search_headers/libavformat/avformat.h: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $mt_avformat_search_headers/libavformat/avformat.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { $as_echo "$as_me:$LINENO: WARNING: $mt_avformat_search_headers/libavformat/avformat.h: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $mt_avformat_search_headers/libavformat/avformat.h: present but cannot be compiled" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $mt_avformat_search_headers/libavformat/avformat.h: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $mt_avformat_search_headers/libavformat/avformat.h: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $mt_avformat_search_headers/libavformat/avformat.h: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $mt_avformat_search_headers/libavformat/avformat.h: see the Autoconf documentation" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $mt_avformat_search_headers/libavformat/avformat.h: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $mt_avformat_search_headers/libavformat/avformat.h: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $mt_avformat_search_headers/libavformat/avformat.h: proceeding with the preprocessor's result" >&5 $as_echo "$as_me: WARNING: $mt_avformat_search_headers/libavformat/avformat.h: proceeding with the preprocessor's result" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $mt_avformat_search_headers/libavformat/avformat.h: in the future, the compiler will take precedence" >&5 $as_echo "$as_me: WARNING: $mt_avformat_search_headers/libavformat/avformat.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------- ## ## Report this to jin@mediatomb.cc ## ## ------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { $as_echo "$as_me:$LINENO: checking for $mt_avformat_search_headers/libavformat/avformat.h" >&5 $as_echo_n "checking for $mt_avformat_search_headers/libavformat/avformat.h... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi as_val=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` if test "x$as_val" = x""yes; then mt_avformat_cxxflags="-I${mt_avformat_search_headers}" else mt_avformat_header_status=missing if test "pass" = "pass"; then { $as_echo "$as_me:$LINENO: avformat headers not found in requested location $mt_avformat_search_headers" >&5 $as_echo "$as_me: avformat headers not found in requested location $mt_avformat_search_headers" >&6;} else { { $as_echo "$as_me:$LINENO: error: avformat headers not found in requested location $mt_avformat_search_headers" >&5 $as_echo "$as_me: error: avformat headers not found in requested location $mt_avformat_search_headers" >&2;} { (exit 1); exit 1; }; } fi fi else unset ac_cv_header_libavformat_avformat_h if test "${ac_cv_header_libavformat_avformat_h+set}" = set; then { $as_echo "$as_me:$LINENO: checking for libavformat/avformat.h" >&5 $as_echo_n "checking for libavformat/avformat.h... " >&6; } if test "${ac_cv_header_libavformat_avformat_h+set}" = set; then $as_echo_n "(cached) " >&6 fi { $as_echo "$as_me:$LINENO: result: $ac_cv_header_libavformat_avformat_h" >&5 $as_echo "$ac_cv_header_libavformat_avformat_h" >&6; } else # Is the header compilable? { $as_echo "$as_me:$LINENO: checking libavformat/avformat.h usability" >&5 $as_echo_n "checking libavformat/avformat.h usability... " >&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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:$LINENO: checking libavformat/avformat.h presence" >&5 $as_echo_n "checking libavformat/avformat.h presence... " >&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 { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&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 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else $as_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 { $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { $as_echo "$as_me:$LINENO: WARNING: libavformat/avformat.h: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: libavformat/avformat.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:$LINENO: WARNING: libavformat/avformat.h: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: libavformat/avformat.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { $as_echo "$as_me:$LINENO: WARNING: libavformat/avformat.h: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: libavformat/avformat.h: present but cannot be compiled" >&2;} { $as_echo "$as_me:$LINENO: WARNING: libavformat/avformat.h: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: libavformat/avformat.h: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:$LINENO: WARNING: libavformat/avformat.h: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: libavformat/avformat.h: see the Autoconf documentation" >&2;} { $as_echo "$as_me:$LINENO: WARNING: libavformat/avformat.h: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: libavformat/avformat.h: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:$LINENO: WARNING: libavformat/avformat.h: proceeding with the preprocessor's result" >&5 $as_echo "$as_me: WARNING: libavformat/avformat.h: proceeding with the preprocessor's result" >&2;} { $as_echo "$as_me:$LINENO: WARNING: libavformat/avformat.h: in the future, the compiler will take precedence" >&5 $as_echo "$as_me: WARNING: libavformat/avformat.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------- ## ## Report this to jin@mediatomb.cc ## ## ------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { $as_echo "$as_me:$LINENO: checking for libavformat/avformat.h" >&5 $as_echo_n "checking for libavformat/avformat.h... " >&6; } if test "${ac_cv_header_libavformat_avformat_h+set}" = set; then $as_echo_n "(cached) " >&6 else ac_cv_header_libavformat_avformat_h=$ac_header_preproc fi { $as_echo "$as_me:$LINENO: result: $ac_cv_header_libavformat_avformat_h" >&5 $as_echo "$ac_cv_header_libavformat_avformat_h" >&6; } fi if test "x$ac_cv_header_libavformat_avformat_h" = x""yes; then : else CFLAGS="$CFLAGS -I$MT_SEARCHPATH_HEADERS" CXXFLAGS="$CXXFLAGS -I$MT_SEARCHPATH_HEADERS" CPPFLAGS="$CPPFLAGS -I$MT_SEARCHPATH_HEADERS" unset ac_cv_header_libavformat_avformat_h as_ac_Header=`$as_echo "ac_cv_header_$MT_SEARCHPATH_HEADERS/libavformat/avformat.h" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { $as_echo "$as_me:$LINENO: checking for $MT_SEARCHPATH_HEADERS/libavformat/avformat.h" >&5 $as_echo_n "checking for $MT_SEARCHPATH_HEADERS/libavformat/avformat.h... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:$LINENO: checking $MT_SEARCHPATH_HEADERS/libavformat/avformat.h usability" >&5 $as_echo_n "checking $MT_SEARCHPATH_HEADERS/libavformat/avformat.h usability... " >&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 <$MT_SEARCHPATH_HEADERS/libavformat/avformat.h> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:$LINENO: checking $MT_SEARCHPATH_HEADERS/libavformat/avformat.h presence" >&5 $as_echo_n "checking $MT_SEARCHPATH_HEADERS/libavformat/avformat.h presence... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$MT_SEARCHPATH_HEADERS/libavformat/avformat.h> _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&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 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else $as_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 { $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { $as_echo "$as_me:$LINENO: WARNING: $MT_SEARCHPATH_HEADERS/libavformat/avformat.h: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $MT_SEARCHPATH_HEADERS/libavformat/avformat.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $MT_SEARCHPATH_HEADERS/libavformat/avformat.h: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $MT_SEARCHPATH_HEADERS/libavformat/avformat.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { $as_echo "$as_me:$LINENO: WARNING: $MT_SEARCHPATH_HEADERS/libavformat/avformat.h: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $MT_SEARCHPATH_HEADERS/libavformat/avformat.h: present but cannot be compiled" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $MT_SEARCHPATH_HEADERS/libavformat/avformat.h: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $MT_SEARCHPATH_HEADERS/libavformat/avformat.h: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $MT_SEARCHPATH_HEADERS/libavformat/avformat.h: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $MT_SEARCHPATH_HEADERS/libavformat/avformat.h: see the Autoconf documentation" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $MT_SEARCHPATH_HEADERS/libavformat/avformat.h: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $MT_SEARCHPATH_HEADERS/libavformat/avformat.h: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $MT_SEARCHPATH_HEADERS/libavformat/avformat.h: proceeding with the preprocessor's result" >&5 $as_echo "$as_me: WARNING: $MT_SEARCHPATH_HEADERS/libavformat/avformat.h: proceeding with the preprocessor's result" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $MT_SEARCHPATH_HEADERS/libavformat/avformat.h: in the future, the compiler will take precedence" >&5 $as_echo "$as_me: WARNING: $MT_SEARCHPATH_HEADERS/libavformat/avformat.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------- ## ## Report this to jin@mediatomb.cc ## ## ------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { $as_echo "$as_me:$LINENO: checking for $MT_SEARCHPATH_HEADERS/libavformat/avformat.h" >&5 $as_echo_n "checking for $MT_SEARCHPATH_HEADERS/libavformat/avformat.h... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi as_val=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` if test "x$as_val" = x""yes; then mt_avformat_cxxflags="-I${MT_SEARCHPATH_HEADERS}" else mt_avformat_header_status=missing fi fi fi if test "x$mt_avformat_header_status" != xyes; then mt_avformat_cxxflags="" fi LIBS=$LIBS_SAVE LDFLAGS=$LDFLAGS_SAVE CFLAGS=$CFLAGS_SAVE CXXFLAGS=$CXXFLAGS_SAVE CPPFLAGS=$CPPFLAGS_SAVE AVFORMAT_CFLAGS=${mt_avformat_cxxflags} AVFORMAT_STATUS=${mt_avformat_header_status} if test "x$AVFORMAT_STATUS" = xyes; then cat >>confdefs.h <<_ACEOF #define AVFORMAT_INCLUDE _ACEOF FFMPEG_EXTRA_CFLAGS="$FFMPEG_CFLAGS -I/usr/include/ffmpeg" else CFLAGS="$CFLAGS_SAVE" CPPFLAGS="$CPPFLAGS_SAVE" CFLAGS="$CFLAGS -I/usr/local/include/ffmpeg" CPPFLAGS="$CPPFLAGS -I/usr/local/include/ffmpeg" LIBS_SAVE=$LIBS LDFLAGS_SAVE=$LDFLAGS CFLAGS_SAVE=$CFLAGS CXXFLAGS_SAVE=$CXXFLAGS CPPFLAGS_SAVE=$CPPFLAGS mt_avformat_header_status=yes # Check whether --with-avformat-h was given. if test "${with_avformat_h+set}" = set; then withval=$with_avformat_h; mt_avformat_search_headers="$withval" { $as_echo "$as_me:$LINENO: Will search for avformat headers in $withval" >&5 $as_echo "$as_me: Will search for avformat headers in $withval" >&6;} fi if test "$mt_avformat_search_headers" ; then unset ac_cv_header_libavformat_avformat_h CFLAGS="$CFLAGS -I${mt_avformat_search_headers}" CXXFLAGS="$CXXFLAGS -I${mt_avformat_search_headers}" CPPFLAGS="$CPPFLAGS -I${mt_avformat_search_headers}" as_ac_Header=`$as_echo "ac_cv_header_$mt_avformat_search_headers/libavformat/avformat.h" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { $as_echo "$as_me:$LINENO: checking for $mt_avformat_search_headers/libavformat/avformat.h" >&5 $as_echo_n "checking for $mt_avformat_search_headers/libavformat/avformat.h... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:$LINENO: checking $mt_avformat_search_headers/libavformat/avformat.h usability" >&5 $as_echo_n "checking $mt_avformat_search_headers/libavformat/avformat.h usability... " >&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 <$mt_avformat_search_headers/libavformat/avformat.h> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:$LINENO: checking $mt_avformat_search_headers/libavformat/avformat.h presence" >&5 $as_echo_n "checking $mt_avformat_search_headers/libavformat/avformat.h presence... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$mt_avformat_search_headers/libavformat/avformat.h> _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&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 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else $as_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 { $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { $as_echo "$as_me:$LINENO: WARNING: $mt_avformat_search_headers/libavformat/avformat.h: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $mt_avformat_search_headers/libavformat/avformat.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $mt_avformat_search_headers/libavformat/avformat.h: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $mt_avformat_search_headers/libavformat/avformat.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { $as_echo "$as_me:$LINENO: WARNING: $mt_avformat_search_headers/libavformat/avformat.h: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $mt_avformat_search_headers/libavformat/avformat.h: present but cannot be compiled" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $mt_avformat_search_headers/libavformat/avformat.h: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $mt_avformat_search_headers/libavformat/avformat.h: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $mt_avformat_search_headers/libavformat/avformat.h: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $mt_avformat_search_headers/libavformat/avformat.h: see the Autoconf documentation" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $mt_avformat_search_headers/libavformat/avformat.h: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $mt_avformat_search_headers/libavformat/avformat.h: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $mt_avformat_search_headers/libavformat/avformat.h: proceeding with the preprocessor's result" >&5 $as_echo "$as_me: WARNING: $mt_avformat_search_headers/libavformat/avformat.h: proceeding with the preprocessor's result" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $mt_avformat_search_headers/libavformat/avformat.h: in the future, the compiler will take precedence" >&5 $as_echo "$as_me: WARNING: $mt_avformat_search_headers/libavformat/avformat.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------- ## ## Report this to jin@mediatomb.cc ## ## ------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { $as_echo "$as_me:$LINENO: checking for $mt_avformat_search_headers/libavformat/avformat.h" >&5 $as_echo_n "checking for $mt_avformat_search_headers/libavformat/avformat.h... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi as_val=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` if test "x$as_val" = x""yes; then mt_avformat_cxxflags="-I${mt_avformat_search_headers}" else mt_avformat_header_status=missing if test "" = "pass"; then { $as_echo "$as_me:$LINENO: avformat headers not found in requested location $mt_avformat_search_headers" >&5 $as_echo "$as_me: avformat headers not found in requested location $mt_avformat_search_headers" >&6;} else { { $as_echo "$as_me:$LINENO: error: avformat headers not found in requested location $mt_avformat_search_headers" >&5 $as_echo "$as_me: error: avformat headers not found in requested location $mt_avformat_search_headers" >&2;} { (exit 1); exit 1; }; } fi fi else unset ac_cv_header_libavformat_avformat_h if test "${ac_cv_header_libavformat_avformat_h+set}" = set; then { $as_echo "$as_me:$LINENO: checking for libavformat/avformat.h" >&5 $as_echo_n "checking for libavformat/avformat.h... " >&6; } if test "${ac_cv_header_libavformat_avformat_h+set}" = set; then $as_echo_n "(cached) " >&6 fi { $as_echo "$as_me:$LINENO: result: $ac_cv_header_libavformat_avformat_h" >&5 $as_echo "$ac_cv_header_libavformat_avformat_h" >&6; } else # Is the header compilable? { $as_echo "$as_me:$LINENO: checking libavformat/avformat.h usability" >&5 $as_echo_n "checking libavformat/avformat.h usability... " >&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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:$LINENO: checking libavformat/avformat.h presence" >&5 $as_echo_n "checking libavformat/avformat.h presence... " >&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 { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&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 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else $as_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 { $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { $as_echo "$as_me:$LINENO: WARNING: libavformat/avformat.h: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: libavformat/avformat.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:$LINENO: WARNING: libavformat/avformat.h: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: libavformat/avformat.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { $as_echo "$as_me:$LINENO: WARNING: libavformat/avformat.h: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: libavformat/avformat.h: present but cannot be compiled" >&2;} { $as_echo "$as_me:$LINENO: WARNING: libavformat/avformat.h: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: libavformat/avformat.h: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:$LINENO: WARNING: libavformat/avformat.h: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: libavformat/avformat.h: see the Autoconf documentation" >&2;} { $as_echo "$as_me:$LINENO: WARNING: libavformat/avformat.h: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: libavformat/avformat.h: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:$LINENO: WARNING: libavformat/avformat.h: proceeding with the preprocessor's result" >&5 $as_echo "$as_me: WARNING: libavformat/avformat.h: proceeding with the preprocessor's result" >&2;} { $as_echo "$as_me:$LINENO: WARNING: libavformat/avformat.h: in the future, the compiler will take precedence" >&5 $as_echo "$as_me: WARNING: libavformat/avformat.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------- ## ## Report this to jin@mediatomb.cc ## ## ------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { $as_echo "$as_me:$LINENO: checking for libavformat/avformat.h" >&5 $as_echo_n "checking for libavformat/avformat.h... " >&6; } if test "${ac_cv_header_libavformat_avformat_h+set}" = set; then $as_echo_n "(cached) " >&6 else ac_cv_header_libavformat_avformat_h=$ac_header_preproc fi { $as_echo "$as_me:$LINENO: result: $ac_cv_header_libavformat_avformat_h" >&5 $as_echo "$ac_cv_header_libavformat_avformat_h" >&6; } fi if test "x$ac_cv_header_libavformat_avformat_h" = x""yes; then : else CFLAGS="$CFLAGS -I$MT_SEARCHPATH_HEADERS" CXXFLAGS="$CXXFLAGS -I$MT_SEARCHPATH_HEADERS" CPPFLAGS="$CPPFLAGS -I$MT_SEARCHPATH_HEADERS" unset ac_cv_header_libavformat_avformat_h as_ac_Header=`$as_echo "ac_cv_header_$MT_SEARCHPATH_HEADERS/libavformat/avformat.h" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { $as_echo "$as_me:$LINENO: checking for $MT_SEARCHPATH_HEADERS/libavformat/avformat.h" >&5 $as_echo_n "checking for $MT_SEARCHPATH_HEADERS/libavformat/avformat.h... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:$LINENO: checking $MT_SEARCHPATH_HEADERS/libavformat/avformat.h usability" >&5 $as_echo_n "checking $MT_SEARCHPATH_HEADERS/libavformat/avformat.h usability... " >&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 <$MT_SEARCHPATH_HEADERS/libavformat/avformat.h> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:$LINENO: checking $MT_SEARCHPATH_HEADERS/libavformat/avformat.h presence" >&5 $as_echo_n "checking $MT_SEARCHPATH_HEADERS/libavformat/avformat.h presence... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$MT_SEARCHPATH_HEADERS/libavformat/avformat.h> _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&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 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else $as_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 { $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { $as_echo "$as_me:$LINENO: WARNING: $MT_SEARCHPATH_HEADERS/libavformat/avformat.h: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $MT_SEARCHPATH_HEADERS/libavformat/avformat.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $MT_SEARCHPATH_HEADERS/libavformat/avformat.h: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $MT_SEARCHPATH_HEADERS/libavformat/avformat.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { $as_echo "$as_me:$LINENO: WARNING: $MT_SEARCHPATH_HEADERS/libavformat/avformat.h: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $MT_SEARCHPATH_HEADERS/libavformat/avformat.h: present but cannot be compiled" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $MT_SEARCHPATH_HEADERS/libavformat/avformat.h: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $MT_SEARCHPATH_HEADERS/libavformat/avformat.h: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $MT_SEARCHPATH_HEADERS/libavformat/avformat.h: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $MT_SEARCHPATH_HEADERS/libavformat/avformat.h: see the Autoconf documentation" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $MT_SEARCHPATH_HEADERS/libavformat/avformat.h: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $MT_SEARCHPATH_HEADERS/libavformat/avformat.h: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $MT_SEARCHPATH_HEADERS/libavformat/avformat.h: proceeding with the preprocessor's result" >&5 $as_echo "$as_me: WARNING: $MT_SEARCHPATH_HEADERS/libavformat/avformat.h: proceeding with the preprocessor's result" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $MT_SEARCHPATH_HEADERS/libavformat/avformat.h: in the future, the compiler will take precedence" >&5 $as_echo "$as_me: WARNING: $MT_SEARCHPATH_HEADERS/libavformat/avformat.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------- ## ## Report this to jin@mediatomb.cc ## ## ------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { $as_echo "$as_me:$LINENO: checking for $MT_SEARCHPATH_HEADERS/libavformat/avformat.h" >&5 $as_echo_n "checking for $MT_SEARCHPATH_HEADERS/libavformat/avformat.h... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi as_val=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` if test "x$as_val" = x""yes; then mt_avformat_cxxflags="-I${MT_SEARCHPATH_HEADERS}" else mt_avformat_header_status=missing fi fi fi if test "x$mt_avformat_header_status" != xyes; then mt_avformat_cxxflags="" fi LIBS=$LIBS_SAVE LDFLAGS=$LDFLAGS_SAVE CFLAGS=$CFLAGS_SAVE CXXFLAGS=$CXXFLAGS_SAVE CPPFLAGS=$CPPFLAGS_SAVE AVFORMAT_CFLAGS=${mt_avformat_cxxflags} AVFORMAT_STATUS=${mt_avformat_header_status} if test "x$AVFORMAT_STATUS" = xyes; then FFMPEG_EXTRA_CFLAGS="$FFMPEG_CFLAGS -I/usr/include/ffmpeg" cat >>confdefs.h <<_ACEOF #define AVFORMAT_INCLUDE _ACEOF fi fi fi else cat >>confdefs.h <<_ACEOF #define AVFORMAT_INCLUDE _ACEOF fi if test "x$AVFORMAT_STATUS" = xyes; then mt_avformat_arg_default=yes mt_avformat_library_status=yes LIBS_SAVE=$LIBS LDFLAGS_SAVE=$LDFLAGS CFLAGS_SAVE=$CFLAGS CXXFLAGS_SAVE=$CXXFLAGS CPPFLAGS_SAVE=$CPPFLAGS # Check whether --with-avformat-libs was given. if test "${with_avformat_libs+set}" = set; then withval=$with_avformat_libs; mt_avformat_search_libs="$withval" { $as_echo "$as_me:$LINENO: Will search for avformat libs in $withval" >&5 $as_echo "$as_me: Will search for avformat libs in $withval" >&6;} fi if test "$mt_avformat_search_libs" ; then unset ac_cv_lib_avformat_av_register_all LDFLAGS="$LDFLAGS -L$mt_avformat_search_libs" { $as_echo "$as_me:$LINENO: checking for av_register_all in -lavformat" >&5 $as_echo_n "checking for av_register_all in -lavformat... " >&6; } if test "${ac_cv_lib_avformat_av_register_all+set}" = set; then $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lavformat $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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char av_register_all (); int main () { return av_register_all (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_lib_avformat_av_register_all=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_avformat_av_register_all=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_avformat_av_register_all" >&5 $as_echo "$ac_cv_lib_avformat_av_register_all" >&6; } if test "x$ac_cv_lib_avformat_av_register_all" = x""yes; then mt_avformat_libs="-lavformat" mt_avformat_ldflags="-L$mt_avformat_search_libs" else mt_avformat_library_status=missing if test "" = "pass"; then { $as_echo "$as_me:$LINENO: avformat library not found in requested location $mt_avformat_search_libs" >&5 $as_echo "$as_me: avformat library not found in requested location $mt_avformat_search_libs" >&6;} else { { $as_echo "$as_me:$LINENO: error: avformat library not found in requested location $mt_avformat_search_libs" >&5 $as_echo "$as_me: error: avformat library not found in requested location $mt_avformat_search_libs" >&2;} { (exit 1); exit 1; }; } fi fi else unset ac_cv_lib_avformat_av_register_all { $as_echo "$as_me:$LINENO: checking for av_register_all in -lavformat" >&5 $as_echo_n "checking for av_register_all in -lavformat... " >&6; } if test "${ac_cv_lib_avformat_av_register_all+set}" = set; then $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lavformat $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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char av_register_all (); int main () { return av_register_all (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_lib_avformat_av_register_all=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_avformat_av_register_all=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_avformat_av_register_all" >&5 $as_echo "$ac_cv_lib_avformat_av_register_all" >&6; } if test "x$ac_cv_lib_avformat_av_register_all" = x""yes; then mt_avformat_libs="-lavformat" else LDFLAGS="$LDFLAGS -L$MT_SEARCHPATH_LIBS" unset ac_cv_lib_avformat_av_register_all { $as_echo "$as_me:$LINENO: checking for av_register_all in -lavformat" >&5 $as_echo_n "checking for av_register_all in -lavformat... " >&6; } if test "${ac_cv_lib_avformat_av_register_all+set}" = set; then $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lavformat $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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char av_register_all (); int main () { return av_register_all (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_lib_avformat_av_register_all=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_avformat_av_register_all=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_avformat_av_register_all" >&5 $as_echo "$ac_cv_lib_avformat_av_register_all" >&6; } if test "x$ac_cv_lib_avformat_av_register_all" = x""yes; then mt_avformat_libs="-lavformat" mt_avformat_ldflags="-L$MT_SEARCHPATH_LIBS" else mt_avformat_library_status=missing fi fi fi if test "x$mt_avformat_library_status" != xyes; then mt_avformat_libs="" mt_avformat_ldflags="" fi LIBS=$LIBS_SAVE LDFLAGS=$LDFLAGS_SAVE CFLAGS=$CFLAGS_SAVE CXXFLAGS=$CXXFLAGS_SAVE CPPFLAGS=$CPPFLAGS_SAVE AVFORMAT_LIBS=${mt_avformat_libs} AVFORMAT_LDFLAGS=${mt_avformat_ldflags} AVFORMAT_STATUS=${mt_avformat_library_status} mt_avutil_arg_default=yes mt_avutil_library_status=yes LIBS_SAVE=$LIBS LDFLAGS_SAVE=$LDFLAGS CFLAGS_SAVE=$CFLAGS CXXFLAGS_SAVE=$CXXFLAGS CPPFLAGS_SAVE=$CPPFLAGS # Check whether --with-avutil-libs was given. if test "${with_avutil_libs+set}" = set; then withval=$with_avutil_libs; mt_avutil_search_libs="$withval" { $as_echo "$as_me:$LINENO: Will search for avutil libs in $withval" >&5 $as_echo "$as_me: Will search for avutil libs in $withval" >&6;} fi if test "$mt_avutil_search_libs" ; then unset ac_cv_lib_avutil_av_log_set_callback LDFLAGS="$LDFLAGS -L$mt_avutil_search_libs" { $as_echo "$as_me:$LINENO: checking for av_log_set_callback in -lavutil" >&5 $as_echo_n "checking for av_log_set_callback in -lavutil... " >&6; } if test "${ac_cv_lib_avutil_av_log_set_callback+set}" = set; then $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lavutil $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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char av_log_set_callback (); int main () { return av_log_set_callback (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_lib_avutil_av_log_set_callback=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_avutil_av_log_set_callback=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_avutil_av_log_set_callback" >&5 $as_echo "$ac_cv_lib_avutil_av_log_set_callback" >&6; } if test "x$ac_cv_lib_avutil_av_log_set_callback" = x""yes; then mt_avutil_libs="-lavutil" mt_avutil_ldflags="-L$mt_avutil_search_libs" else mt_avutil_library_status=missing if test "" = "pass"; then { $as_echo "$as_me:$LINENO: avutil library not found in requested location $mt_avutil_search_libs" >&5 $as_echo "$as_me: avutil library not found in requested location $mt_avutil_search_libs" >&6;} else { { $as_echo "$as_me:$LINENO: error: avutil library not found in requested location $mt_avutil_search_libs" >&5 $as_echo "$as_me: error: avutil library not found in requested location $mt_avutil_search_libs" >&2;} { (exit 1); exit 1; }; } fi fi else unset ac_cv_lib_avutil_av_log_set_callback { $as_echo "$as_me:$LINENO: checking for av_log_set_callback in -lavutil" >&5 $as_echo_n "checking for av_log_set_callback in -lavutil... " >&6; } if test "${ac_cv_lib_avutil_av_log_set_callback+set}" = set; then $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lavutil $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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char av_log_set_callback (); int main () { return av_log_set_callback (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_lib_avutil_av_log_set_callback=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_avutil_av_log_set_callback=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_avutil_av_log_set_callback" >&5 $as_echo "$ac_cv_lib_avutil_av_log_set_callback" >&6; } if test "x$ac_cv_lib_avutil_av_log_set_callback" = x""yes; then mt_avutil_libs="-lavutil" else LDFLAGS="$LDFLAGS -L$MT_SEARCHPATH_LIBS" unset ac_cv_lib_avutil_av_log_set_callback { $as_echo "$as_me:$LINENO: checking for av_log_set_callback in -lavutil" >&5 $as_echo_n "checking for av_log_set_callback in -lavutil... " >&6; } if test "${ac_cv_lib_avutil_av_log_set_callback+set}" = set; then $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lavutil $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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char av_log_set_callback (); int main () { return av_log_set_callback (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_lib_avutil_av_log_set_callback=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_avutil_av_log_set_callback=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_avutil_av_log_set_callback" >&5 $as_echo "$ac_cv_lib_avutil_av_log_set_callback" >&6; } if test "x$ac_cv_lib_avutil_av_log_set_callback" = x""yes; then mt_avutil_libs="-lavutil" mt_avutil_ldflags="-L$MT_SEARCHPATH_LIBS" else mt_avutil_library_status=missing fi fi fi if test "x$mt_avutil_library_status" != xyes; then mt_avutil_libs="" mt_avutil_ldflags="" fi LIBS=$LIBS_SAVE LDFLAGS=$LDFLAGS_SAVE CFLAGS=$CFLAGS_SAVE CXXFLAGS=$CXXFLAGS_SAVE CPPFLAGS=$CPPFLAGS_SAVE AVUTIL_LIBS=${mt_avutil_libs} AVUTIL_LDFLAGS=${mt_avutil_ldflags} AVUTIL_STATUS=${mt_avutil_library_status} fi ac_ext=cpp 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 "x$AVFORMAT_STATUS" = xyes) && (test "x$AVUTIL_STATUS" = xyes)); then FFMPEG_STATUS=yes else FFMPEG_STATUS=missing fi fi if test "x$FFMPEG_STATUS" = xyes; then cat >>confdefs.h <<\_ACEOF #define HAVE_FFMPEG 1 _ACEOF FFMPEG_CFLAGS="$FFMPEG_EXTRA_CFLAGS $AVFORMAT_CFLAGS $AVUTIL_CFLAGS" FFMPEG_LDFLAGS="$AVFORMAT_LDFLAGS $AVUTIL_LDFLAGS" FFMPEG_LIBS="$AVFORMAT_LIBS $AVUTIL_LIBS" else if (test "x$FFMPEG_OPTION_ENABLED" != xyes); then FFMPEG_STATUS=disabled fi if (test "x$FFMPEG_OPTION_REQUESTED" = xyes) && (test "x$FFMPEG_OPTION_ENABLED" = xyes); then { { $as_echo "$as_me:$LINENO: error: unable to configure ffmpeg support" >&5 $as_echo "$as_me: error: unable to configure ffmpeg support" >&2;} { (exit 1); exit 1; }; } fi fi FFMPEGTHUMBNAILER_USES_OLD_API= mt_ffmpegthumbnailer_status=yes mt_ffmpegthumbnailer_option_enabled= mt_ffmpegthumbnailer_option_requested=no if test "xdisable" = xdisable; then mt_ffmpegthumbnailer_option_enabled=yes else mt_ffmpegthumbnailer_option_enabled=no fi # Check whether --enable-ffmpegthumbnailer was given. if test "${enable_ffmpegthumbnailer+set}" = set; then enableval=$enable_ffmpegthumbnailer; mt_ffmpegthumbnailer_option_enabled=$enableval mt_ffmpegthumbnailer_option_requested=yes fi FFMPEGTHUMBNAILER_OPTION_ENABLED=${mt_ffmpegthumbnailer_option_enabled} FFMPEGTHUMBNAILER_OPTION_REQUESTED=${mt_ffmpegthumbnailer_option_requested} if test "x${FFMPEGTHUMBNAILER_OPTION_ENABLED}" = xyes; then LIBS_SAVE=$LIBS LDFLAGS_SAVE=$LDFLAGS CFLAGS_SAVE=$CFLAGS CXXFLAGS_SAVE=$CXXFLAGS CPPFLAGS_SAVE=$CPPFLAGS mt_ffmpegthumbnailer_header_status=yes # Check whether --with-ffmpegthumbnailer-h was given. if test "${with_ffmpegthumbnailer_h+set}" = set; then withval=$with_ffmpegthumbnailer_h; mt_ffmpegthumbnailer_search_headers="$withval" { $as_echo "$as_me:$LINENO: Will search for ffmpegthumbnailer headers in $withval" >&5 $as_echo "$as_me: Will search for ffmpegthumbnailer headers in $withval" >&6;} fi if test "$mt_ffmpegthumbnailer_search_headers" ; then unset ac_cv_header_libffmpegthumbnailer_videothumbnailerc_h CFLAGS="$CFLAGS -I${mt_ffmpegthumbnailer_search_headers}" CXXFLAGS="$CXXFLAGS -I${mt_ffmpegthumbnailer_search_headers}" CPPFLAGS="$CPPFLAGS -I${mt_ffmpegthumbnailer_search_headers}" as_ac_Header=`$as_echo "ac_cv_header_$mt_ffmpegthumbnailer_search_headers/libffmpegthumbnailer/videothumbnailerc.h" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { $as_echo "$as_me:$LINENO: checking for $mt_ffmpegthumbnailer_search_headers/libffmpegthumbnailer/videothumbnailerc.h" >&5 $as_echo_n "checking for $mt_ffmpegthumbnailer_search_headers/libffmpegthumbnailer/videothumbnailerc.h... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:$LINENO: checking $mt_ffmpegthumbnailer_search_headers/libffmpegthumbnailer/videothumbnailerc.h usability" >&5 $as_echo_n "checking $mt_ffmpegthumbnailer_search_headers/libffmpegthumbnailer/videothumbnailerc.h usability... " >&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 <$mt_ffmpegthumbnailer_search_headers/libffmpegthumbnailer/videothumbnailerc.h> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:$LINENO: checking $mt_ffmpegthumbnailer_search_headers/libffmpegthumbnailer/videothumbnailerc.h presence" >&5 $as_echo_n "checking $mt_ffmpegthumbnailer_search_headers/libffmpegthumbnailer/videothumbnailerc.h presence... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$mt_ffmpegthumbnailer_search_headers/libffmpegthumbnailer/videothumbnailerc.h> _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&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 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else $as_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 { $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in yes:no: ) { $as_echo "$as_me:$LINENO: WARNING: $mt_ffmpegthumbnailer_search_headers/libffmpegthumbnailer/videothumbnailerc.h: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $mt_ffmpegthumbnailer_search_headers/libffmpegthumbnailer/videothumbnailerc.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $mt_ffmpegthumbnailer_search_headers/libffmpegthumbnailer/videothumbnailerc.h: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $mt_ffmpegthumbnailer_search_headers/libffmpegthumbnailer/videothumbnailerc.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { $as_echo "$as_me:$LINENO: WARNING: $mt_ffmpegthumbnailer_search_headers/libffmpegthumbnailer/videothumbnailerc.h: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $mt_ffmpegthumbnailer_search_headers/libffmpegthumbnailer/videothumbnailerc.h: present but cannot be compiled" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $mt_ffmpegthumbnailer_search_headers/libffmpegthumbnailer/videothumbnailerc.h: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $mt_ffmpegthumbnailer_search_headers/libffmpegthumbnailer/videothumbnailerc.h: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $mt_ffmpegthumbnailer_search_headers/libffmpegthumbnailer/videothumbnailerc.h: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $mt_ffmpegthumbnailer_search_headers/libffmpegthumbnailer/videothumbnailerc.h: see the Autoconf documentation" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $mt_ffmpegthumbnailer_search_headers/libffmpegthumbnailer/videothumbnailerc.h: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $mt_ffmpegthumbnailer_search_headers/libffmpegthumbnailer/videothumbnailerc.h: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $mt_ffmpegthumbnailer_search_headers/libffmpegthumbnailer/videothumbnailerc.h: proceeding with the preprocessor's result" >&5 $as_echo "$as_me: WARNING: $mt_ffmpegthumbnailer_search_headers/libffmpegthumbnailer/videothumbnailerc.h: proceeding with the preprocessor's result" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $mt_ffmpegthumbnailer_search_headers/libffmpegthumbnailer/videothumbnailerc.h: in the future, the compiler will take precedence" >&5 $as_echo "$as_me: WARNING: $mt_ffmpegthumbnailer_search_headers/libffmpegthumbnailer/videothumbnailerc.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------- ## ## Report this to jin@mediatomb.cc ## ## ------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { $as_echo "$as_me:$LINENO: checking for $mt_ffmpegthumbnailer_search_headers/libffmpegthumbnailer/videothumbnailerc.h" >&5 $as_echo_n "checking for $mt_ffmpegthumbnailer_search_headers/libffmpegthumbnailer/videothumbnailerc.h... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi as_val=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` if test "x$as_val" = x""yes; then mt_ffmpegthumbnailer_cxxflags="-I${mt_ffmpegthumbnailer_search_headers}" else mt_ffmpegthumbnailer_header_status=missing if test "pass" = "pass"; then { $as_echo "$as_me:$LINENO: ffmpegthumbnailer headers not found in requested location $mt_ffmpegthumbnailer_search_headers" >&5 $as_echo "$as_me: ffmpegthumbnailer headers not found in requested location $mt_ffmpegthumbnailer_search_headers" >&6;} else { { $as_echo "$as_me:$LINENO: error: ffmpegthumbnailer headers not found in requested location $mt_ffmpegthumbnailer_search_headers" >&5 $as_echo "$as_me: error: ffmpegthumbnailer headers not found in requested location $mt_ffmpegthumbnailer_search_headers" >&2;} { (exit 1); exit 1; }; } fi fi else unset ac_cv_header_libffmpegthumbnailer_videothumbnailerc_h if test "${ac_cv_header_libffmpegthumbnailer_videothumbnailerc_h+set}" = set; then { $as_echo "$as_me:$LINENO: checking for libffmpegthumbnailer/videothumbnailerc.h" >&5 $as_echo_n "checking for libffmpegthumbnailer/videothumbnailerc.h... " >&6; } if test "${ac_cv_header_libffmpegthumbnailer_videothumbnailerc_h+set}" = set; then $as_echo_n "(cached) " >&6 fi { $as_echo "$as_me:$LINENO: result: $ac_cv_header_libffmpegthumbnailer_videothumbnailerc_h" >&5 $as_echo "$ac_cv_header_libffmpegthumbnailer_videothumbnailerc_h" >&6; } else # Is the header compilable? { $as_echo "$as_me:$LINENO: checking libffmpegthumbnailer/videothumbnailerc.h usability" >&5 $as_echo_n "checking libffmpegthumbnailer/videothumbnailerc.h usability... " >&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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:$LINENO: checking libffmpegthumbnailer/videothumbnailerc.h presence" >&5 $as_echo_n "checking libffmpegthumbnailer/videothumbnailerc.h presence... " >&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 { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&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 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else $as_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 { $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in yes:no: ) { $as_echo "$as_me:$LINENO: WARNING: libffmpegthumbnailer/videothumbnailerc.h: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: libffmpegthumbnailer/videothumbnailerc.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:$LINENO: WARNING: libffmpegthumbnailer/videothumbnailerc.h: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: libffmpegthumbnailer/videothumbnailerc.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { $as_echo "$as_me:$LINENO: WARNING: libffmpegthumbnailer/videothumbnailerc.h: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: libffmpegthumbnailer/videothumbnailerc.h: present but cannot be compiled" >&2;} { $as_echo "$as_me:$LINENO: WARNING: libffmpegthumbnailer/videothumbnailerc.h: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: libffmpegthumbnailer/videothumbnailerc.h: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:$LINENO: WARNING: libffmpegthumbnailer/videothumbnailerc.h: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: libffmpegthumbnailer/videothumbnailerc.h: see the Autoconf documentation" >&2;} { $as_echo "$as_me:$LINENO: WARNING: libffmpegthumbnailer/videothumbnailerc.h: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: libffmpegthumbnailer/videothumbnailerc.h: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:$LINENO: WARNING: libffmpegthumbnailer/videothumbnailerc.h: proceeding with the preprocessor's result" >&5 $as_echo "$as_me: WARNING: libffmpegthumbnailer/videothumbnailerc.h: proceeding with the preprocessor's result" >&2;} { $as_echo "$as_me:$LINENO: WARNING: libffmpegthumbnailer/videothumbnailerc.h: in the future, the compiler will take precedence" >&5 $as_echo "$as_me: WARNING: libffmpegthumbnailer/videothumbnailerc.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------- ## ## Report this to jin@mediatomb.cc ## ## ------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { $as_echo "$as_me:$LINENO: checking for libffmpegthumbnailer/videothumbnailerc.h" >&5 $as_echo_n "checking for libffmpegthumbnailer/videothumbnailerc.h... " >&6; } if test "${ac_cv_header_libffmpegthumbnailer_videothumbnailerc_h+set}" = set; then $as_echo_n "(cached) " >&6 else ac_cv_header_libffmpegthumbnailer_videothumbnailerc_h=$ac_header_preproc fi { $as_echo "$as_me:$LINENO: result: $ac_cv_header_libffmpegthumbnailer_videothumbnailerc_h" >&5 $as_echo "$ac_cv_header_libffmpegthumbnailer_videothumbnailerc_h" >&6; } fi if test "x$ac_cv_header_libffmpegthumbnailer_videothumbnailerc_h" = x""yes; then : else CFLAGS="$CFLAGS -I$MT_SEARCHPATH_HEADERS" CXXFLAGS="$CXXFLAGS -I$MT_SEARCHPATH_HEADERS" CPPFLAGS="$CPPFLAGS -I$MT_SEARCHPATH_HEADERS" unset ac_cv_header_libffmpegthumbnailer_videothumbnailerc_h as_ac_Header=`$as_echo "ac_cv_header_$MT_SEARCHPATH_HEADERS/libffmpegthumbnailer/videothumbnailerc.h" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { $as_echo "$as_me:$LINENO: checking for $MT_SEARCHPATH_HEADERS/libffmpegthumbnailer/videothumbnailerc.h" >&5 $as_echo_n "checking for $MT_SEARCHPATH_HEADERS/libffmpegthumbnailer/videothumbnailerc.h... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:$LINENO: checking $MT_SEARCHPATH_HEADERS/libffmpegthumbnailer/videothumbnailerc.h usability" >&5 $as_echo_n "checking $MT_SEARCHPATH_HEADERS/libffmpegthumbnailer/videothumbnailerc.h usability... " >&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 <$MT_SEARCHPATH_HEADERS/libffmpegthumbnailer/videothumbnailerc.h> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:$LINENO: checking $MT_SEARCHPATH_HEADERS/libffmpegthumbnailer/videothumbnailerc.h presence" >&5 $as_echo_n "checking $MT_SEARCHPATH_HEADERS/libffmpegthumbnailer/videothumbnailerc.h presence... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$MT_SEARCHPATH_HEADERS/libffmpegthumbnailer/videothumbnailerc.h> _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&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 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else $as_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 { $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in yes:no: ) { $as_echo "$as_me:$LINENO: WARNING: $MT_SEARCHPATH_HEADERS/libffmpegthumbnailer/videothumbnailerc.h: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $MT_SEARCHPATH_HEADERS/libffmpegthumbnailer/videothumbnailerc.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $MT_SEARCHPATH_HEADERS/libffmpegthumbnailer/videothumbnailerc.h: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $MT_SEARCHPATH_HEADERS/libffmpegthumbnailer/videothumbnailerc.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { $as_echo "$as_me:$LINENO: WARNING: $MT_SEARCHPATH_HEADERS/libffmpegthumbnailer/videothumbnailerc.h: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $MT_SEARCHPATH_HEADERS/libffmpegthumbnailer/videothumbnailerc.h: present but cannot be compiled" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $MT_SEARCHPATH_HEADERS/libffmpegthumbnailer/videothumbnailerc.h: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $MT_SEARCHPATH_HEADERS/libffmpegthumbnailer/videothumbnailerc.h: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $MT_SEARCHPATH_HEADERS/libffmpegthumbnailer/videothumbnailerc.h: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $MT_SEARCHPATH_HEADERS/libffmpegthumbnailer/videothumbnailerc.h: see the Autoconf documentation" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $MT_SEARCHPATH_HEADERS/libffmpegthumbnailer/videothumbnailerc.h: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $MT_SEARCHPATH_HEADERS/libffmpegthumbnailer/videothumbnailerc.h: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $MT_SEARCHPATH_HEADERS/libffmpegthumbnailer/videothumbnailerc.h: proceeding with the preprocessor's result" >&5 $as_echo "$as_me: WARNING: $MT_SEARCHPATH_HEADERS/libffmpegthumbnailer/videothumbnailerc.h: proceeding with the preprocessor's result" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $MT_SEARCHPATH_HEADERS/libffmpegthumbnailer/videothumbnailerc.h: in the future, the compiler will take precedence" >&5 $as_echo "$as_me: WARNING: $MT_SEARCHPATH_HEADERS/libffmpegthumbnailer/videothumbnailerc.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------- ## ## Report this to jin@mediatomb.cc ## ## ------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { $as_echo "$as_me:$LINENO: checking for $MT_SEARCHPATH_HEADERS/libffmpegthumbnailer/videothumbnailerc.h" >&5 $as_echo_n "checking for $MT_SEARCHPATH_HEADERS/libffmpegthumbnailer/videothumbnailerc.h... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi as_val=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` if test "x$as_val" = x""yes; then mt_ffmpegthumbnailer_cxxflags="-I${MT_SEARCHPATH_HEADERS}" else mt_ffmpegthumbnailer_header_status=missing fi fi fi if test "x$mt_ffmpegthumbnailer_header_status" != xyes; then mt_ffmpegthumbnailer_cxxflags="" fi LIBS=$LIBS_SAVE LDFLAGS=$LDFLAGS_SAVE CFLAGS=$CFLAGS_SAVE CXXFLAGS=$CXXFLAGS_SAVE CPPFLAGS=$CPPFLAGS_SAVE mt_ffmpegthumbnailer_package_status=${mt_ffmpegthumbnailer_header_status} if test "x$mt_ffmpegthumbnailer_package_status" = xyes; then mt_ffmpegthumbnailer_arg_default=yes mt_ffmpegthumbnailer_library_status=yes LIBS_SAVE=$LIBS LDFLAGS_SAVE=$LDFLAGS CFLAGS_SAVE=$CFLAGS CXXFLAGS_SAVE=$CXXFLAGS CPPFLAGS_SAVE=$CPPFLAGS # Check whether --with-ffmpegthumbnailer-libs was given. if test "${with_ffmpegthumbnailer_libs+set}" = set; then withval=$with_ffmpegthumbnailer_libs; mt_ffmpegthumbnailer_search_libs="$withval" { $as_echo "$as_me:$LINENO: Will search for ffmpegthumbnailer libs in $withval" >&5 $as_echo "$as_me: Will search for ffmpegthumbnailer libs in $withval" >&6;} fi if test "$mt_ffmpegthumbnailer_search_libs" ; then unset ac_cv_lib_ffmpegthumbnailer_video_thumbnailer_create LDFLAGS="$LDFLAGS -L$mt_ffmpegthumbnailer_search_libs" { $as_echo "$as_me:$LINENO: checking for video_thumbnailer_create in -lffmpegthumbnailer" >&5 $as_echo_n "checking for video_thumbnailer_create in -lffmpegthumbnailer... " >&6; } if test "${ac_cv_lib_ffmpegthumbnailer_video_thumbnailer_create+set}" = set; then $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lffmpegthumbnailer $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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char video_thumbnailer_create (); int main () { return video_thumbnailer_create (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_lib_ffmpegthumbnailer_video_thumbnailer_create=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_ffmpegthumbnailer_video_thumbnailer_create=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_ffmpegthumbnailer_video_thumbnailer_create" >&5 $as_echo "$ac_cv_lib_ffmpegthumbnailer_video_thumbnailer_create" >&6; } if test "x$ac_cv_lib_ffmpegthumbnailer_video_thumbnailer_create" = x""yes; then mt_ffmpegthumbnailer_libs="-lffmpegthumbnailer" mt_ffmpegthumbnailer_ldflags="-L$mt_ffmpegthumbnailer_search_libs" else mt_ffmpegthumbnailer_library_status=missing if test "pass" = "pass"; then { $as_echo "$as_me:$LINENO: ffmpegthumbnailer library not found in requested location $mt_ffmpegthumbnailer_search_libs" >&5 $as_echo "$as_me: ffmpegthumbnailer library not found in requested location $mt_ffmpegthumbnailer_search_libs" >&6;} else { { $as_echo "$as_me:$LINENO: error: ffmpegthumbnailer library not found in requested location $mt_ffmpegthumbnailer_search_libs" >&5 $as_echo "$as_me: error: ffmpegthumbnailer library not found in requested location $mt_ffmpegthumbnailer_search_libs" >&2;} { (exit 1); exit 1; }; } fi fi else unset ac_cv_lib_ffmpegthumbnailer_video_thumbnailer_create { $as_echo "$as_me:$LINENO: checking for video_thumbnailer_create in -lffmpegthumbnailer" >&5 $as_echo_n "checking for video_thumbnailer_create in -lffmpegthumbnailer... " >&6; } if test "${ac_cv_lib_ffmpegthumbnailer_video_thumbnailer_create+set}" = set; then $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lffmpegthumbnailer $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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char video_thumbnailer_create (); int main () { return video_thumbnailer_create (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_lib_ffmpegthumbnailer_video_thumbnailer_create=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_ffmpegthumbnailer_video_thumbnailer_create=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_ffmpegthumbnailer_video_thumbnailer_create" >&5 $as_echo "$ac_cv_lib_ffmpegthumbnailer_video_thumbnailer_create" >&6; } if test "x$ac_cv_lib_ffmpegthumbnailer_video_thumbnailer_create" = x""yes; then mt_ffmpegthumbnailer_libs="-lffmpegthumbnailer" else LDFLAGS="$LDFLAGS -L$MT_SEARCHPATH_LIBS" unset ac_cv_lib_ffmpegthumbnailer_video_thumbnailer_create { $as_echo "$as_me:$LINENO: checking for video_thumbnailer_create in -lffmpegthumbnailer" >&5 $as_echo_n "checking for video_thumbnailer_create in -lffmpegthumbnailer... " >&6; } if test "${ac_cv_lib_ffmpegthumbnailer_video_thumbnailer_create+set}" = set; then $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lffmpegthumbnailer $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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char video_thumbnailer_create (); int main () { return video_thumbnailer_create (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_lib_ffmpegthumbnailer_video_thumbnailer_create=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_ffmpegthumbnailer_video_thumbnailer_create=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_ffmpegthumbnailer_video_thumbnailer_create" >&5 $as_echo "$ac_cv_lib_ffmpegthumbnailer_video_thumbnailer_create" >&6; } if test "x$ac_cv_lib_ffmpegthumbnailer_video_thumbnailer_create" = x""yes; then mt_ffmpegthumbnailer_libs="-lffmpegthumbnailer" mt_ffmpegthumbnailer_ldflags="-L$MT_SEARCHPATH_LIBS" else mt_ffmpegthumbnailer_library_status=missing fi fi fi if test "x$mt_ffmpegthumbnailer_library_status" != xyes; then mt_ffmpegthumbnailer_libs="" mt_ffmpegthumbnailer_ldflags="" fi LIBS=$LIBS_SAVE LDFLAGS=$LDFLAGS_SAVE CFLAGS=$CFLAGS_SAVE CXXFLAGS=$CXXFLAGS_SAVE CPPFLAGS=$CPPFLAGS_SAVE mt_ffmpegthumbnailer_package_status=${mt_ffmpegthumbnailer_library_status} fi if test "x$mt_ffmpegthumbnailer_package_status" = xyes; then FFMPEGTHUMBNAILER_CFLAGS=${mt_ffmpegthumbnailer_cxxflags} FFMPEGTHUMBNAILER_LIBS=${mt_ffmpegthumbnailer_libs} FFMPEGTHUMBNAILER_LDFLAGS=${mt_ffmpegthumbnailer_ldflags} fi mt_ffmpegthumbnailer_status=${mt_ffmpegthumbnailer_package_status} else mt_ffmpegthumbnailer_status=disabled fi if ((test "x${FFMPEGTHUMBNAILER_OPTION_ENABLED}" = xyes) && (test "x${FFMPEGTHUMBNAILER_OPTION_REQUESTED}" = xyes) && (test "x$mt_ffmpegthumbnailer_status" != xyes) && (test "pass" != "pass")); then { { $as_echo "$as_me:$LINENO: error: unable to configure ffmpegthumbnailer support" >&5 $as_echo "$as_me: error: unable to configure ffmpegthumbnailer support" >&2;} { (exit 1); exit 1; }; } fi if test "x$mt_ffmpegthumbnailer_status" = xyes; then cat >>confdefs.h <<\_ACEOF #define HAVE_FFMPEGTHUMBNAILER 1 _ACEOF fi FFMPEGTHUMBNAILER_STATUS=${mt_ffmpegthumbnailer_status} if (test "x$FFMPEGTHUMBNAILER_STATUS" != xyes); then mt_ffmpegthumbnailer_status=yes mt_ffmpegthumbnailer_option_enabled= mt_ffmpegthumbnailer_option_requested=no if test "xdisable" = xdisable; then mt_ffmpegthumbnailer_option_enabled=yes else mt_ffmpegthumbnailer_option_enabled=no fi # Check whether --enable-ffmpegthumbnailer was given. if test "${enable_ffmpegthumbnailer+set}" = set; then enableval=$enable_ffmpegthumbnailer; mt_ffmpegthumbnailer_option_enabled=$enableval mt_ffmpegthumbnailer_option_requested=yes fi FFMPEGTHUMBNAILER_OPTION_ENABLED=${mt_ffmpegthumbnailer_option_enabled} FFMPEGTHUMBNAILER_OPTION_REQUESTED=${mt_ffmpegthumbnailer_option_requested} if test "x${FFMPEGTHUMBNAILER_OPTION_ENABLED}" = xyes; then LIBS_SAVE=$LIBS LDFLAGS_SAVE=$LDFLAGS CFLAGS_SAVE=$CFLAGS CXXFLAGS_SAVE=$CXXFLAGS CPPFLAGS_SAVE=$CPPFLAGS mt_ffmpegthumbnailer_header_status=yes # Check whether --with-ffmpegthumbnailer-h was given. if test "${with_ffmpegthumbnailer_h+set}" = set; then withval=$with_ffmpegthumbnailer_h; mt_ffmpegthumbnailer_search_headers="$withval" { $as_echo "$as_me:$LINENO: Will search for ffmpegthumbnailer headers in $withval" >&5 $as_echo "$as_me: Will search for ffmpegthumbnailer headers in $withval" >&6;} fi if test "$mt_ffmpegthumbnailer_search_headers" ; then unset ac_cv_header_libffmpegthumbnailer_videothumbnailerc_h CFLAGS="$CFLAGS -I${mt_ffmpegthumbnailer_search_headers}" CXXFLAGS="$CXXFLAGS -I${mt_ffmpegthumbnailer_search_headers}" CPPFLAGS="$CPPFLAGS -I${mt_ffmpegthumbnailer_search_headers}" as_ac_Header=`$as_echo "ac_cv_header_$mt_ffmpegthumbnailer_search_headers/libffmpegthumbnailer/videothumbnailerc.h" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { $as_echo "$as_me:$LINENO: checking for $mt_ffmpegthumbnailer_search_headers/libffmpegthumbnailer/videothumbnailerc.h" >&5 $as_echo_n "checking for $mt_ffmpegthumbnailer_search_headers/libffmpegthumbnailer/videothumbnailerc.h... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:$LINENO: checking $mt_ffmpegthumbnailer_search_headers/libffmpegthumbnailer/videothumbnailerc.h usability" >&5 $as_echo_n "checking $mt_ffmpegthumbnailer_search_headers/libffmpegthumbnailer/videothumbnailerc.h usability... " >&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 <$mt_ffmpegthumbnailer_search_headers/libffmpegthumbnailer/videothumbnailerc.h> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:$LINENO: checking $mt_ffmpegthumbnailer_search_headers/libffmpegthumbnailer/videothumbnailerc.h presence" >&5 $as_echo_n "checking $mt_ffmpegthumbnailer_search_headers/libffmpegthumbnailer/videothumbnailerc.h presence... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$mt_ffmpegthumbnailer_search_headers/libffmpegthumbnailer/videothumbnailerc.h> _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&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 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else $as_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 { $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in yes:no: ) { $as_echo "$as_me:$LINENO: WARNING: $mt_ffmpegthumbnailer_search_headers/libffmpegthumbnailer/videothumbnailerc.h: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $mt_ffmpegthumbnailer_search_headers/libffmpegthumbnailer/videothumbnailerc.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $mt_ffmpegthumbnailer_search_headers/libffmpegthumbnailer/videothumbnailerc.h: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $mt_ffmpegthumbnailer_search_headers/libffmpegthumbnailer/videothumbnailerc.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { $as_echo "$as_me:$LINENO: WARNING: $mt_ffmpegthumbnailer_search_headers/libffmpegthumbnailer/videothumbnailerc.h: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $mt_ffmpegthumbnailer_search_headers/libffmpegthumbnailer/videothumbnailerc.h: present but cannot be compiled" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $mt_ffmpegthumbnailer_search_headers/libffmpegthumbnailer/videothumbnailerc.h: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $mt_ffmpegthumbnailer_search_headers/libffmpegthumbnailer/videothumbnailerc.h: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $mt_ffmpegthumbnailer_search_headers/libffmpegthumbnailer/videothumbnailerc.h: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $mt_ffmpegthumbnailer_search_headers/libffmpegthumbnailer/videothumbnailerc.h: see the Autoconf documentation" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $mt_ffmpegthumbnailer_search_headers/libffmpegthumbnailer/videothumbnailerc.h: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $mt_ffmpegthumbnailer_search_headers/libffmpegthumbnailer/videothumbnailerc.h: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $mt_ffmpegthumbnailer_search_headers/libffmpegthumbnailer/videothumbnailerc.h: proceeding with the preprocessor's result" >&5 $as_echo "$as_me: WARNING: $mt_ffmpegthumbnailer_search_headers/libffmpegthumbnailer/videothumbnailerc.h: proceeding with the preprocessor's result" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $mt_ffmpegthumbnailer_search_headers/libffmpegthumbnailer/videothumbnailerc.h: in the future, the compiler will take precedence" >&5 $as_echo "$as_me: WARNING: $mt_ffmpegthumbnailer_search_headers/libffmpegthumbnailer/videothumbnailerc.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------- ## ## Report this to jin@mediatomb.cc ## ## ------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { $as_echo "$as_me:$LINENO: checking for $mt_ffmpegthumbnailer_search_headers/libffmpegthumbnailer/videothumbnailerc.h" >&5 $as_echo_n "checking for $mt_ffmpegthumbnailer_search_headers/libffmpegthumbnailer/videothumbnailerc.h... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi as_val=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` if test "x$as_val" = x""yes; then mt_ffmpegthumbnailer_cxxflags="-I${mt_ffmpegthumbnailer_search_headers}" else mt_ffmpegthumbnailer_header_status=missing if test "" = "pass"; then { $as_echo "$as_me:$LINENO: ffmpegthumbnailer headers not found in requested location $mt_ffmpegthumbnailer_search_headers" >&5 $as_echo "$as_me: ffmpegthumbnailer headers not found in requested location $mt_ffmpegthumbnailer_search_headers" >&6;} else { { $as_echo "$as_me:$LINENO: error: ffmpegthumbnailer headers not found in requested location $mt_ffmpegthumbnailer_search_headers" >&5 $as_echo "$as_me: error: ffmpegthumbnailer headers not found in requested location $mt_ffmpegthumbnailer_search_headers" >&2;} { (exit 1); exit 1; }; } fi fi else unset ac_cv_header_libffmpegthumbnailer_videothumbnailerc_h if test "${ac_cv_header_libffmpegthumbnailer_videothumbnailerc_h+set}" = set; then { $as_echo "$as_me:$LINENO: checking for libffmpegthumbnailer/videothumbnailerc.h" >&5 $as_echo_n "checking for libffmpegthumbnailer/videothumbnailerc.h... " >&6; } if test "${ac_cv_header_libffmpegthumbnailer_videothumbnailerc_h+set}" = set; then $as_echo_n "(cached) " >&6 fi { $as_echo "$as_me:$LINENO: result: $ac_cv_header_libffmpegthumbnailer_videothumbnailerc_h" >&5 $as_echo "$ac_cv_header_libffmpegthumbnailer_videothumbnailerc_h" >&6; } else # Is the header compilable? { $as_echo "$as_me:$LINENO: checking libffmpegthumbnailer/videothumbnailerc.h usability" >&5 $as_echo_n "checking libffmpegthumbnailer/videothumbnailerc.h usability... " >&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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:$LINENO: checking libffmpegthumbnailer/videothumbnailerc.h presence" >&5 $as_echo_n "checking libffmpegthumbnailer/videothumbnailerc.h presence... " >&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 { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&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 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else $as_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 { $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in yes:no: ) { $as_echo "$as_me:$LINENO: WARNING: libffmpegthumbnailer/videothumbnailerc.h: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: libffmpegthumbnailer/videothumbnailerc.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:$LINENO: WARNING: libffmpegthumbnailer/videothumbnailerc.h: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: libffmpegthumbnailer/videothumbnailerc.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { $as_echo "$as_me:$LINENO: WARNING: libffmpegthumbnailer/videothumbnailerc.h: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: libffmpegthumbnailer/videothumbnailerc.h: present but cannot be compiled" >&2;} { $as_echo "$as_me:$LINENO: WARNING: libffmpegthumbnailer/videothumbnailerc.h: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: libffmpegthumbnailer/videothumbnailerc.h: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:$LINENO: WARNING: libffmpegthumbnailer/videothumbnailerc.h: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: libffmpegthumbnailer/videothumbnailerc.h: see the Autoconf documentation" >&2;} { $as_echo "$as_me:$LINENO: WARNING: libffmpegthumbnailer/videothumbnailerc.h: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: libffmpegthumbnailer/videothumbnailerc.h: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:$LINENO: WARNING: libffmpegthumbnailer/videothumbnailerc.h: proceeding with the preprocessor's result" >&5 $as_echo "$as_me: WARNING: libffmpegthumbnailer/videothumbnailerc.h: proceeding with the preprocessor's result" >&2;} { $as_echo "$as_me:$LINENO: WARNING: libffmpegthumbnailer/videothumbnailerc.h: in the future, the compiler will take precedence" >&5 $as_echo "$as_me: WARNING: libffmpegthumbnailer/videothumbnailerc.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------- ## ## Report this to jin@mediatomb.cc ## ## ------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { $as_echo "$as_me:$LINENO: checking for libffmpegthumbnailer/videothumbnailerc.h" >&5 $as_echo_n "checking for libffmpegthumbnailer/videothumbnailerc.h... " >&6; } if test "${ac_cv_header_libffmpegthumbnailer_videothumbnailerc_h+set}" = set; then $as_echo_n "(cached) " >&6 else ac_cv_header_libffmpegthumbnailer_videothumbnailerc_h=$ac_header_preproc fi { $as_echo "$as_me:$LINENO: result: $ac_cv_header_libffmpegthumbnailer_videothumbnailerc_h" >&5 $as_echo "$ac_cv_header_libffmpegthumbnailer_videothumbnailerc_h" >&6; } fi if test "x$ac_cv_header_libffmpegthumbnailer_videothumbnailerc_h" = x""yes; then : else CFLAGS="$CFLAGS -I$MT_SEARCHPATH_HEADERS" CXXFLAGS="$CXXFLAGS -I$MT_SEARCHPATH_HEADERS" CPPFLAGS="$CPPFLAGS -I$MT_SEARCHPATH_HEADERS" unset ac_cv_header_libffmpegthumbnailer_videothumbnailerc_h as_ac_Header=`$as_echo "ac_cv_header_$MT_SEARCHPATH_HEADERS/libffmpegthumbnailer/videothumbnailerc.h" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { $as_echo "$as_me:$LINENO: checking for $MT_SEARCHPATH_HEADERS/libffmpegthumbnailer/videothumbnailerc.h" >&5 $as_echo_n "checking for $MT_SEARCHPATH_HEADERS/libffmpegthumbnailer/videothumbnailerc.h... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:$LINENO: checking $MT_SEARCHPATH_HEADERS/libffmpegthumbnailer/videothumbnailerc.h usability" >&5 $as_echo_n "checking $MT_SEARCHPATH_HEADERS/libffmpegthumbnailer/videothumbnailerc.h usability... " >&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 <$MT_SEARCHPATH_HEADERS/libffmpegthumbnailer/videothumbnailerc.h> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:$LINENO: checking $MT_SEARCHPATH_HEADERS/libffmpegthumbnailer/videothumbnailerc.h presence" >&5 $as_echo_n "checking $MT_SEARCHPATH_HEADERS/libffmpegthumbnailer/videothumbnailerc.h presence... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$MT_SEARCHPATH_HEADERS/libffmpegthumbnailer/videothumbnailerc.h> _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&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 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else $as_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 { $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in yes:no: ) { $as_echo "$as_me:$LINENO: WARNING: $MT_SEARCHPATH_HEADERS/libffmpegthumbnailer/videothumbnailerc.h: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $MT_SEARCHPATH_HEADERS/libffmpegthumbnailer/videothumbnailerc.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $MT_SEARCHPATH_HEADERS/libffmpegthumbnailer/videothumbnailerc.h: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $MT_SEARCHPATH_HEADERS/libffmpegthumbnailer/videothumbnailerc.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { $as_echo "$as_me:$LINENO: WARNING: $MT_SEARCHPATH_HEADERS/libffmpegthumbnailer/videothumbnailerc.h: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $MT_SEARCHPATH_HEADERS/libffmpegthumbnailer/videothumbnailerc.h: present but cannot be compiled" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $MT_SEARCHPATH_HEADERS/libffmpegthumbnailer/videothumbnailerc.h: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $MT_SEARCHPATH_HEADERS/libffmpegthumbnailer/videothumbnailerc.h: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $MT_SEARCHPATH_HEADERS/libffmpegthumbnailer/videothumbnailerc.h: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $MT_SEARCHPATH_HEADERS/libffmpegthumbnailer/videothumbnailerc.h: see the Autoconf documentation" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $MT_SEARCHPATH_HEADERS/libffmpegthumbnailer/videothumbnailerc.h: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $MT_SEARCHPATH_HEADERS/libffmpegthumbnailer/videothumbnailerc.h: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $MT_SEARCHPATH_HEADERS/libffmpegthumbnailer/videothumbnailerc.h: proceeding with the preprocessor's result" >&5 $as_echo "$as_me: WARNING: $MT_SEARCHPATH_HEADERS/libffmpegthumbnailer/videothumbnailerc.h: proceeding with the preprocessor's result" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $MT_SEARCHPATH_HEADERS/libffmpegthumbnailer/videothumbnailerc.h: in the future, the compiler will take precedence" >&5 $as_echo "$as_me: WARNING: $MT_SEARCHPATH_HEADERS/libffmpegthumbnailer/videothumbnailerc.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------- ## ## Report this to jin@mediatomb.cc ## ## ------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { $as_echo "$as_me:$LINENO: checking for $MT_SEARCHPATH_HEADERS/libffmpegthumbnailer/videothumbnailerc.h" >&5 $as_echo_n "checking for $MT_SEARCHPATH_HEADERS/libffmpegthumbnailer/videothumbnailerc.h... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi as_val=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` if test "x$as_val" = x""yes; then mt_ffmpegthumbnailer_cxxflags="-I${MT_SEARCHPATH_HEADERS}" else mt_ffmpegthumbnailer_header_status=missing fi fi fi if test "x$mt_ffmpegthumbnailer_header_status" != xyes; then mt_ffmpegthumbnailer_cxxflags="" fi LIBS=$LIBS_SAVE LDFLAGS=$LDFLAGS_SAVE CFLAGS=$CFLAGS_SAVE CXXFLAGS=$CXXFLAGS_SAVE CPPFLAGS=$CPPFLAGS_SAVE mt_ffmpegthumbnailer_package_status=${mt_ffmpegthumbnailer_header_status} if test "x$mt_ffmpegthumbnailer_package_status" = xyes; then mt_ffmpegthumbnailer_arg_default=yes mt_ffmpegthumbnailer_library_status=yes LIBS_SAVE=$LIBS LDFLAGS_SAVE=$LDFLAGS CFLAGS_SAVE=$CFLAGS CXXFLAGS_SAVE=$CXXFLAGS CPPFLAGS_SAVE=$CPPFLAGS # Check whether --with-ffmpegthumbnailer-libs was given. if test "${with_ffmpegthumbnailer_libs+set}" = set; then withval=$with_ffmpegthumbnailer_libs; mt_ffmpegthumbnailer_search_libs="$withval" { $as_echo "$as_me:$LINENO: Will search for ffmpegthumbnailer libs in $withval" >&5 $as_echo "$as_me: Will search for ffmpegthumbnailer libs in $withval" >&6;} fi if test "$mt_ffmpegthumbnailer_search_libs" ; then unset ac_cv_lib_ffmpegthumbnailer_create_thumbnailer LDFLAGS="$LDFLAGS -L$mt_ffmpegthumbnailer_search_libs" { $as_echo "$as_me:$LINENO: checking for create_thumbnailer in -lffmpegthumbnailer" >&5 $as_echo_n "checking for create_thumbnailer in -lffmpegthumbnailer... " >&6; } if test "${ac_cv_lib_ffmpegthumbnailer_create_thumbnailer+set}" = set; then $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lffmpegthumbnailer $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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char create_thumbnailer (); int main () { return create_thumbnailer (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_lib_ffmpegthumbnailer_create_thumbnailer=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_ffmpegthumbnailer_create_thumbnailer=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_ffmpegthumbnailer_create_thumbnailer" >&5 $as_echo "$ac_cv_lib_ffmpegthumbnailer_create_thumbnailer" >&6; } if test "x$ac_cv_lib_ffmpegthumbnailer_create_thumbnailer" = x""yes; then mt_ffmpegthumbnailer_libs="-lffmpegthumbnailer" mt_ffmpegthumbnailer_ldflags="-L$mt_ffmpegthumbnailer_search_libs" else mt_ffmpegthumbnailer_library_status=missing if test "" = "pass"; then { $as_echo "$as_me:$LINENO: ffmpegthumbnailer library not found in requested location $mt_ffmpegthumbnailer_search_libs" >&5 $as_echo "$as_me: ffmpegthumbnailer library not found in requested location $mt_ffmpegthumbnailer_search_libs" >&6;} else { { $as_echo "$as_me:$LINENO: error: ffmpegthumbnailer library not found in requested location $mt_ffmpegthumbnailer_search_libs" >&5 $as_echo "$as_me: error: ffmpegthumbnailer library not found in requested location $mt_ffmpegthumbnailer_search_libs" >&2;} { (exit 1); exit 1; }; } fi fi else unset ac_cv_lib_ffmpegthumbnailer_create_thumbnailer { $as_echo "$as_me:$LINENO: checking for create_thumbnailer in -lffmpegthumbnailer" >&5 $as_echo_n "checking for create_thumbnailer in -lffmpegthumbnailer... " >&6; } if test "${ac_cv_lib_ffmpegthumbnailer_create_thumbnailer+set}" = set; then $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lffmpegthumbnailer $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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char create_thumbnailer (); int main () { return create_thumbnailer (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_lib_ffmpegthumbnailer_create_thumbnailer=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_ffmpegthumbnailer_create_thumbnailer=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_ffmpegthumbnailer_create_thumbnailer" >&5 $as_echo "$ac_cv_lib_ffmpegthumbnailer_create_thumbnailer" >&6; } if test "x$ac_cv_lib_ffmpegthumbnailer_create_thumbnailer" = x""yes; then mt_ffmpegthumbnailer_libs="-lffmpegthumbnailer" else LDFLAGS="$LDFLAGS -L$MT_SEARCHPATH_LIBS" unset ac_cv_lib_ffmpegthumbnailer_create_thumbnailer { $as_echo "$as_me:$LINENO: checking for create_thumbnailer in -lffmpegthumbnailer" >&5 $as_echo_n "checking for create_thumbnailer in -lffmpegthumbnailer... " >&6; } if test "${ac_cv_lib_ffmpegthumbnailer_create_thumbnailer+set}" = set; then $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lffmpegthumbnailer $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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char create_thumbnailer (); int main () { return create_thumbnailer (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_lib_ffmpegthumbnailer_create_thumbnailer=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_ffmpegthumbnailer_create_thumbnailer=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_ffmpegthumbnailer_create_thumbnailer" >&5 $as_echo "$ac_cv_lib_ffmpegthumbnailer_create_thumbnailer" >&6; } if test "x$ac_cv_lib_ffmpegthumbnailer_create_thumbnailer" = x""yes; then mt_ffmpegthumbnailer_libs="-lffmpegthumbnailer" mt_ffmpegthumbnailer_ldflags="-L$MT_SEARCHPATH_LIBS" else mt_ffmpegthumbnailer_library_status=missing fi fi fi if test "x$mt_ffmpegthumbnailer_library_status" != xyes; then mt_ffmpegthumbnailer_libs="" mt_ffmpegthumbnailer_ldflags="" fi LIBS=$LIBS_SAVE LDFLAGS=$LDFLAGS_SAVE CFLAGS=$CFLAGS_SAVE CXXFLAGS=$CXXFLAGS_SAVE CPPFLAGS=$CPPFLAGS_SAVE mt_ffmpegthumbnailer_package_status=${mt_ffmpegthumbnailer_library_status} fi if test "x$mt_ffmpegthumbnailer_package_status" = xyes; then FFMPEGTHUMBNAILER_CFLAGS=${mt_ffmpegthumbnailer_cxxflags} FFMPEGTHUMBNAILER_LIBS=${mt_ffmpegthumbnailer_libs} FFMPEGTHUMBNAILER_LDFLAGS=${mt_ffmpegthumbnailer_ldflags} fi mt_ffmpegthumbnailer_status=${mt_ffmpegthumbnailer_package_status} else mt_ffmpegthumbnailer_status=disabled fi if ((test "x${FFMPEGTHUMBNAILER_OPTION_ENABLED}" = xyes) && (test "x${FFMPEGTHUMBNAILER_OPTION_REQUESTED}" = xyes) && (test "x$mt_ffmpegthumbnailer_status" != xyes) && (test "" != "pass")); then { { $as_echo "$as_me:$LINENO: error: unable to configure ffmpegthumbnailer support" >&5 $as_echo "$as_me: error: unable to configure ffmpegthumbnailer support" >&2;} { (exit 1); exit 1; }; } fi if test "x$mt_ffmpegthumbnailer_status" = xyes; then cat >>confdefs.h <<\_ACEOF #define HAVE_FFMPEGTHUMBNAILER 1 _ACEOF fi FFMPEGTHUMBNAILER_STATUS=${mt_ffmpegthumbnailer_status} if (test "x$FFMPEGTHUMBNAILER_STATUS" = xyes); then cat >>confdefs.h <<\_ACEOF #define FFMPEGTHUMBNAILER_OLD_API 1 _ACEOF FFMPEGTHUMBNAILER_USES_OLD_API=yes fi fi if ((test "x$FFMPEG_STATUS" != xyes) && (test "x$FFMPEGTHUMBNAILER_STATUS" = xyes)); then if test "x$FFMPEGTHUMBNAILER_OPTION_REQUESTED" = xyes; then { { $as_echo "$as_me:$LINENO: error: ffmpeg libraries are required in order to use ffmpegthumbnailer" >&5 $as_echo "$as_me: error: ffmpeg libraries are required in order to use ffmpegthumbnailer" >&2;} { (exit 1); exit 1; }; } else { $as_echo "$as_me:$LINENO: WARNING: ffmpegthumbnailer disabled: ffmpeg libraries required" >&5 $as_echo "$as_me: WARNING: ffmpegthumbnailer disabled: ffmpeg libraries required" >&2;} FFMPEGTHUMBNAILER_STATUS="disabled" FFMPEGTHUMBNAILER_CFLAGS="" FFMPEGTHUMBNAILER_LDFLAGS="" FFMPEGTHUMBNAILER_LIBS="" fi fi CXXFLAGS="$CXXFLAGS_SAVE" LDFLAGS="$LDFLAGS_SAVE" CPPFLAGS="$CPPFLAGS_SAVE" ######## lastfm mt_lastfmlib_status=yes mt_lastfmlib_option_enabled= mt_lastfmlib_option_requested=no if test "xdisable" = xdisable; then mt_lastfmlib_option_enabled=yes else mt_lastfmlib_option_enabled=no fi # Check whether --enable-lastfmlib was given. if test "${enable_lastfmlib+set}" = set; then enableval=$enable_lastfmlib; mt_lastfmlib_option_enabled=$enableval mt_lastfmlib_option_requested=yes fi LASTFMLIB_OPTION_ENABLED=${mt_lastfmlib_option_enabled} LASTFMLIB_OPTION_REQUESTED=${mt_lastfmlib_option_requested} if test "x${LASTFMLIB_OPTION_ENABLED}" = xyes; then LIBS_SAVE=$LIBS LDFLAGS_SAVE=$LDFLAGS CFLAGS_SAVE=$CFLAGS CXXFLAGS_SAVE=$CXXFLAGS CPPFLAGS_SAVE=$CPPFLAGS mt_lastfmlib_header_status=yes # Check whether --with-lastfmlib-h was given. if test "${with_lastfmlib_h+set}" = set; then withval=$with_lastfmlib_h; mt_lastfmlib_search_headers="$withval" { $as_echo "$as_me:$LINENO: Will search for lastfmlib headers in $withval" >&5 $as_echo "$as_me: Will search for lastfmlib headers in $withval" >&6;} fi if test "$mt_lastfmlib_search_headers" ; then unset ac_cv_header_lastfmlib_lastfmscrobbler_h CFLAGS="$CFLAGS -I${mt_lastfmlib_search_headers}" CXXFLAGS="$CXXFLAGS -I${mt_lastfmlib_search_headers}" CPPFLAGS="$CPPFLAGS -I${mt_lastfmlib_search_headers}" as_ac_Header=`$as_echo "ac_cv_header_$mt_lastfmlib_search_headers/lastfmlib/lastfmscrobbler.h" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { $as_echo "$as_me:$LINENO: checking for $mt_lastfmlib_search_headers/lastfmlib/lastfmscrobbler.h" >&5 $as_echo_n "checking for $mt_lastfmlib_search_headers/lastfmlib/lastfmscrobbler.h... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:$LINENO: checking $mt_lastfmlib_search_headers/lastfmlib/lastfmscrobbler.h usability" >&5 $as_echo_n "checking $mt_lastfmlib_search_headers/lastfmlib/lastfmscrobbler.h usability... " >&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 <$mt_lastfmlib_search_headers/lastfmlib/lastfmscrobbler.h> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:$LINENO: checking $mt_lastfmlib_search_headers/lastfmlib/lastfmscrobbler.h presence" >&5 $as_echo_n "checking $mt_lastfmlib_search_headers/lastfmlib/lastfmscrobbler.h presence... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$mt_lastfmlib_search_headers/lastfmlib/lastfmscrobbler.h> _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&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 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else $as_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 { $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in yes:no: ) { $as_echo "$as_me:$LINENO: WARNING: $mt_lastfmlib_search_headers/lastfmlib/lastfmscrobbler.h: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $mt_lastfmlib_search_headers/lastfmlib/lastfmscrobbler.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $mt_lastfmlib_search_headers/lastfmlib/lastfmscrobbler.h: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $mt_lastfmlib_search_headers/lastfmlib/lastfmscrobbler.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { $as_echo "$as_me:$LINENO: WARNING: $mt_lastfmlib_search_headers/lastfmlib/lastfmscrobbler.h: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $mt_lastfmlib_search_headers/lastfmlib/lastfmscrobbler.h: present but cannot be compiled" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $mt_lastfmlib_search_headers/lastfmlib/lastfmscrobbler.h: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $mt_lastfmlib_search_headers/lastfmlib/lastfmscrobbler.h: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $mt_lastfmlib_search_headers/lastfmlib/lastfmscrobbler.h: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $mt_lastfmlib_search_headers/lastfmlib/lastfmscrobbler.h: see the Autoconf documentation" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $mt_lastfmlib_search_headers/lastfmlib/lastfmscrobbler.h: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $mt_lastfmlib_search_headers/lastfmlib/lastfmscrobbler.h: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $mt_lastfmlib_search_headers/lastfmlib/lastfmscrobbler.h: proceeding with the preprocessor's result" >&5 $as_echo "$as_me: WARNING: $mt_lastfmlib_search_headers/lastfmlib/lastfmscrobbler.h: proceeding with the preprocessor's result" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $mt_lastfmlib_search_headers/lastfmlib/lastfmscrobbler.h: in the future, the compiler will take precedence" >&5 $as_echo "$as_me: WARNING: $mt_lastfmlib_search_headers/lastfmlib/lastfmscrobbler.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------- ## ## Report this to jin@mediatomb.cc ## ## ------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { $as_echo "$as_me:$LINENO: checking for $mt_lastfmlib_search_headers/lastfmlib/lastfmscrobbler.h" >&5 $as_echo_n "checking for $mt_lastfmlib_search_headers/lastfmlib/lastfmscrobbler.h... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi as_val=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` if test "x$as_val" = x""yes; then mt_lastfmlib_cxxflags="-I${mt_lastfmlib_search_headers}" else mt_lastfmlib_header_status=missing if test "" = "pass"; then { $as_echo "$as_me:$LINENO: lastfmlib headers not found in requested location $mt_lastfmlib_search_headers" >&5 $as_echo "$as_me: lastfmlib headers not found in requested location $mt_lastfmlib_search_headers" >&6;} else { { $as_echo "$as_me:$LINENO: error: lastfmlib headers not found in requested location $mt_lastfmlib_search_headers" >&5 $as_echo "$as_me: error: lastfmlib headers not found in requested location $mt_lastfmlib_search_headers" >&2;} { (exit 1); exit 1; }; } fi fi else unset ac_cv_header_lastfmlib_lastfmscrobbler_h if test "${ac_cv_header_lastfmlib_lastfmscrobbler_h+set}" = set; then { $as_echo "$as_me:$LINENO: checking for lastfmlib/lastfmscrobbler.h" >&5 $as_echo_n "checking for lastfmlib/lastfmscrobbler.h... " >&6; } if test "${ac_cv_header_lastfmlib_lastfmscrobbler_h+set}" = set; then $as_echo_n "(cached) " >&6 fi { $as_echo "$as_me:$LINENO: result: $ac_cv_header_lastfmlib_lastfmscrobbler_h" >&5 $as_echo "$ac_cv_header_lastfmlib_lastfmscrobbler_h" >&6; } else # Is the header compilable? { $as_echo "$as_me:$LINENO: checking lastfmlib/lastfmscrobbler.h usability" >&5 $as_echo_n "checking lastfmlib/lastfmscrobbler.h usability... " >&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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:$LINENO: checking lastfmlib/lastfmscrobbler.h presence" >&5 $as_echo_n "checking lastfmlib/lastfmscrobbler.h presence... " >&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 { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&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 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else $as_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 { $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in yes:no: ) { $as_echo "$as_me:$LINENO: WARNING: lastfmlib/lastfmscrobbler.h: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: lastfmlib/lastfmscrobbler.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:$LINENO: WARNING: lastfmlib/lastfmscrobbler.h: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: lastfmlib/lastfmscrobbler.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { $as_echo "$as_me:$LINENO: WARNING: lastfmlib/lastfmscrobbler.h: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: lastfmlib/lastfmscrobbler.h: present but cannot be compiled" >&2;} { $as_echo "$as_me:$LINENO: WARNING: lastfmlib/lastfmscrobbler.h: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: lastfmlib/lastfmscrobbler.h: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:$LINENO: WARNING: lastfmlib/lastfmscrobbler.h: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: lastfmlib/lastfmscrobbler.h: see the Autoconf documentation" >&2;} { $as_echo "$as_me:$LINENO: WARNING: lastfmlib/lastfmscrobbler.h: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: lastfmlib/lastfmscrobbler.h: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:$LINENO: WARNING: lastfmlib/lastfmscrobbler.h: proceeding with the preprocessor's result" >&5 $as_echo "$as_me: WARNING: lastfmlib/lastfmscrobbler.h: proceeding with the preprocessor's result" >&2;} { $as_echo "$as_me:$LINENO: WARNING: lastfmlib/lastfmscrobbler.h: in the future, the compiler will take precedence" >&5 $as_echo "$as_me: WARNING: lastfmlib/lastfmscrobbler.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------- ## ## Report this to jin@mediatomb.cc ## ## ------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { $as_echo "$as_me:$LINENO: checking for lastfmlib/lastfmscrobbler.h" >&5 $as_echo_n "checking for lastfmlib/lastfmscrobbler.h... " >&6; } if test "${ac_cv_header_lastfmlib_lastfmscrobbler_h+set}" = set; then $as_echo_n "(cached) " >&6 else ac_cv_header_lastfmlib_lastfmscrobbler_h=$ac_header_preproc fi { $as_echo "$as_me:$LINENO: result: $ac_cv_header_lastfmlib_lastfmscrobbler_h" >&5 $as_echo "$ac_cv_header_lastfmlib_lastfmscrobbler_h" >&6; } fi if test "x$ac_cv_header_lastfmlib_lastfmscrobbler_h" = x""yes; then : else CFLAGS="$CFLAGS -I$MT_SEARCHPATH_HEADERS" CXXFLAGS="$CXXFLAGS -I$MT_SEARCHPATH_HEADERS" CPPFLAGS="$CPPFLAGS -I$MT_SEARCHPATH_HEADERS" unset ac_cv_header_lastfmlib_lastfmscrobbler_h as_ac_Header=`$as_echo "ac_cv_header_$MT_SEARCHPATH_HEADERS/lastfmlib/lastfmscrobbler.h" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { $as_echo "$as_me:$LINENO: checking for $MT_SEARCHPATH_HEADERS/lastfmlib/lastfmscrobbler.h" >&5 $as_echo_n "checking for $MT_SEARCHPATH_HEADERS/lastfmlib/lastfmscrobbler.h... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:$LINENO: checking $MT_SEARCHPATH_HEADERS/lastfmlib/lastfmscrobbler.h usability" >&5 $as_echo_n "checking $MT_SEARCHPATH_HEADERS/lastfmlib/lastfmscrobbler.h usability... " >&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 <$MT_SEARCHPATH_HEADERS/lastfmlib/lastfmscrobbler.h> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:$LINENO: checking $MT_SEARCHPATH_HEADERS/lastfmlib/lastfmscrobbler.h presence" >&5 $as_echo_n "checking $MT_SEARCHPATH_HEADERS/lastfmlib/lastfmscrobbler.h presence... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$MT_SEARCHPATH_HEADERS/lastfmlib/lastfmscrobbler.h> _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&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 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else $as_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 { $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in yes:no: ) { $as_echo "$as_me:$LINENO: WARNING: $MT_SEARCHPATH_HEADERS/lastfmlib/lastfmscrobbler.h: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $MT_SEARCHPATH_HEADERS/lastfmlib/lastfmscrobbler.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $MT_SEARCHPATH_HEADERS/lastfmlib/lastfmscrobbler.h: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $MT_SEARCHPATH_HEADERS/lastfmlib/lastfmscrobbler.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { $as_echo "$as_me:$LINENO: WARNING: $MT_SEARCHPATH_HEADERS/lastfmlib/lastfmscrobbler.h: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $MT_SEARCHPATH_HEADERS/lastfmlib/lastfmscrobbler.h: present but cannot be compiled" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $MT_SEARCHPATH_HEADERS/lastfmlib/lastfmscrobbler.h: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $MT_SEARCHPATH_HEADERS/lastfmlib/lastfmscrobbler.h: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $MT_SEARCHPATH_HEADERS/lastfmlib/lastfmscrobbler.h: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $MT_SEARCHPATH_HEADERS/lastfmlib/lastfmscrobbler.h: see the Autoconf documentation" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $MT_SEARCHPATH_HEADERS/lastfmlib/lastfmscrobbler.h: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $MT_SEARCHPATH_HEADERS/lastfmlib/lastfmscrobbler.h: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $MT_SEARCHPATH_HEADERS/lastfmlib/lastfmscrobbler.h: proceeding with the preprocessor's result" >&5 $as_echo "$as_me: WARNING: $MT_SEARCHPATH_HEADERS/lastfmlib/lastfmscrobbler.h: proceeding with the preprocessor's result" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $MT_SEARCHPATH_HEADERS/lastfmlib/lastfmscrobbler.h: in the future, the compiler will take precedence" >&5 $as_echo "$as_me: WARNING: $MT_SEARCHPATH_HEADERS/lastfmlib/lastfmscrobbler.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------- ## ## Report this to jin@mediatomb.cc ## ## ------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { $as_echo "$as_me:$LINENO: checking for $MT_SEARCHPATH_HEADERS/lastfmlib/lastfmscrobbler.h" >&5 $as_echo_n "checking for $MT_SEARCHPATH_HEADERS/lastfmlib/lastfmscrobbler.h... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi as_val=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` if test "x$as_val" = x""yes; then mt_lastfmlib_cxxflags="-I${MT_SEARCHPATH_HEADERS}" else mt_lastfmlib_header_status=missing fi fi fi if test "x$mt_lastfmlib_header_status" != xyes; then mt_lastfmlib_cxxflags="" fi LIBS=$LIBS_SAVE LDFLAGS=$LDFLAGS_SAVE CFLAGS=$CFLAGS_SAVE CXXFLAGS=$CXXFLAGS_SAVE CPPFLAGS=$CPPFLAGS_SAVE mt_lastfmlib_package_status=${mt_lastfmlib_header_status} if test "x$mt_lastfmlib_package_status" = xyes; then mt_lastfmlib_arg_default=yes mt_lastfmlib_library_status=yes LIBS_SAVE=$LIBS LDFLAGS_SAVE=$LDFLAGS CFLAGS_SAVE=$CFLAGS CXXFLAGS_SAVE=$CXXFLAGS CPPFLAGS_SAVE=$CPPFLAGS # Check whether --with-lastfmlib-libs was given. if test "${with_lastfmlib_libs+set}" = set; then withval=$with_lastfmlib_libs; mt_lastfmlib_search_libs="$withval" { $as_echo "$as_me:$LINENO: Will search for lastfmlib libs in $withval" >&5 $as_echo "$as_me: Will search for lastfmlib libs in $withval" >&6;} fi if test "$mt_lastfmlib_search_libs" ; then unset ac_cv_lib_lastfmlib_create_scrobbler LDFLAGS="$LDFLAGS -L$mt_lastfmlib_search_libs" { $as_echo "$as_me:$LINENO: checking for create_scrobbler in -llastfmlib" >&5 $as_echo_n "checking for create_scrobbler in -llastfmlib... " >&6; } if test "${ac_cv_lib_lastfmlib_create_scrobbler+set}" = set; then $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-llastfmlib $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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char create_scrobbler (); int main () { return create_scrobbler (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_lib_lastfmlib_create_scrobbler=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_lastfmlib_create_scrobbler=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_lastfmlib_create_scrobbler" >&5 $as_echo "$ac_cv_lib_lastfmlib_create_scrobbler" >&6; } if test "x$ac_cv_lib_lastfmlib_create_scrobbler" = x""yes; then mt_lastfmlib_libs="-llastfmlib" mt_lastfmlib_ldflags="-L$mt_lastfmlib_search_libs" else mt_lastfmlib_library_status=missing if test "" = "pass"; then { $as_echo "$as_me:$LINENO: lastfmlib library not found in requested location $mt_lastfmlib_search_libs" >&5 $as_echo "$as_me: lastfmlib library not found in requested location $mt_lastfmlib_search_libs" >&6;} else { { $as_echo "$as_me:$LINENO: error: lastfmlib library not found in requested location $mt_lastfmlib_search_libs" >&5 $as_echo "$as_me: error: lastfmlib library not found in requested location $mt_lastfmlib_search_libs" >&2;} { (exit 1); exit 1; }; } fi fi else unset ac_cv_lib_lastfmlib_create_scrobbler { $as_echo "$as_me:$LINENO: checking for create_scrobbler in -llastfmlib" >&5 $as_echo_n "checking for create_scrobbler in -llastfmlib... " >&6; } if test "${ac_cv_lib_lastfmlib_create_scrobbler+set}" = set; then $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-llastfmlib $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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char create_scrobbler (); int main () { return create_scrobbler (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_lib_lastfmlib_create_scrobbler=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_lastfmlib_create_scrobbler=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_lastfmlib_create_scrobbler" >&5 $as_echo "$ac_cv_lib_lastfmlib_create_scrobbler" >&6; } if test "x$ac_cv_lib_lastfmlib_create_scrobbler" = x""yes; then mt_lastfmlib_libs="-llastfmlib" else LDFLAGS="$LDFLAGS -L$MT_SEARCHPATH_LIBS" unset ac_cv_lib_lastfmlib_create_scrobbler { $as_echo "$as_me:$LINENO: checking for create_scrobbler in -llastfmlib" >&5 $as_echo_n "checking for create_scrobbler in -llastfmlib... " >&6; } if test "${ac_cv_lib_lastfmlib_create_scrobbler+set}" = set; then $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-llastfmlib $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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char create_scrobbler (); int main () { return create_scrobbler (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_lib_lastfmlib_create_scrobbler=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_lastfmlib_create_scrobbler=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_lastfmlib_create_scrobbler" >&5 $as_echo "$ac_cv_lib_lastfmlib_create_scrobbler" >&6; } if test "x$ac_cv_lib_lastfmlib_create_scrobbler" = x""yes; then mt_lastfmlib_libs="-llastfmlib" mt_lastfmlib_ldflags="-L$MT_SEARCHPATH_LIBS" else mt_lastfmlib_library_status=missing fi fi fi if test "x$mt_lastfmlib_library_status" != xyes; then mt_lastfmlib_libs="" mt_lastfmlib_ldflags="" fi LIBS=$LIBS_SAVE LDFLAGS=$LDFLAGS_SAVE CFLAGS=$CFLAGS_SAVE CXXFLAGS=$CXXFLAGS_SAVE CPPFLAGS=$CPPFLAGS_SAVE mt_lastfmlib_package_status=${mt_lastfmlib_library_status} fi if test "x$mt_lastfmlib_package_status" = xyes; then LASTFMLIB_CFLAGS=${mt_lastfmlib_cxxflags} LASTFMLIB_LIBS=${mt_lastfmlib_libs} LASTFMLIB_LDFLAGS=${mt_lastfmlib_ldflags} fi mt_lastfmlib_status=${mt_lastfmlib_package_status} else mt_lastfmlib_status=disabled fi if ((test "x${LASTFMLIB_OPTION_ENABLED}" = xyes) && (test "x${LASTFMLIB_OPTION_REQUESTED}" = xyes) && (test "x$mt_lastfmlib_status" != xyes) && (test "" != "pass")); then { { $as_echo "$as_me:$LINENO: error: unable to configure lastfmlib support" >&5 $as_echo "$as_me: error: unable to configure lastfmlib support" >&2;} { (exit 1); exit 1; }; } fi if test "x$mt_lastfmlib_status" = xyes; then cat >>confdefs.h <<\_ACEOF #define HAVE_LASTFMLIB 1 _ACEOF fi LASTFMLIB_STATUS=${mt_lastfmlib_status} ######## extractor if test "x$LIBEXTRACTOR_OPTION_ENABLED" = xyes; then mt_libextractor_status=yes if test "x$mt_libextractor_status" = xyes; then LIBS_SAVE=$LIBS LDFLAGS_SAVE=$LDFLAGS CFLAGS_SAVE=$CFLAGS CXXFLAGS_SAVE=$CXXFLAGS CPPFLAGS_SAVE=$CPPFLAGS mt_libextractor_header_status=yes # Check whether --with-libextractor-h was given. if test "${with_libextractor_h+set}" = set; then withval=$with_libextractor_h; mt_libextractor_search_headers="$withval" { $as_echo "$as_me:$LINENO: Will search for libextractor headers in $withval" >&5 $as_echo "$as_me: Will search for libextractor headers in $withval" >&6;} fi if test "$mt_libextractor_search_headers" ; then unset ac_cv_header_extractor_h CFLAGS="$CFLAGS -I${mt_libextractor_search_headers}" CXXFLAGS="$CXXFLAGS -I${mt_libextractor_search_headers}" CPPFLAGS="$CPPFLAGS -I${mt_libextractor_search_headers}" as_ac_Header=`$as_echo "ac_cv_header_$mt_libextractor_search_headers/extractor.h" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { $as_echo "$as_me:$LINENO: checking for $mt_libextractor_search_headers/extractor.h" >&5 $as_echo_n "checking for $mt_libextractor_search_headers/extractor.h... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:$LINENO: checking $mt_libextractor_search_headers/extractor.h usability" >&5 $as_echo_n "checking $mt_libextractor_search_headers/extractor.h usability... " >&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 <$mt_libextractor_search_headers/extractor.h> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:$LINENO: checking $mt_libextractor_search_headers/extractor.h presence" >&5 $as_echo_n "checking $mt_libextractor_search_headers/extractor.h presence... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$mt_libextractor_search_headers/extractor.h> _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&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 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else $as_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 { $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in yes:no: ) { $as_echo "$as_me:$LINENO: WARNING: $mt_libextractor_search_headers/extractor.h: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $mt_libextractor_search_headers/extractor.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $mt_libextractor_search_headers/extractor.h: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $mt_libextractor_search_headers/extractor.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { $as_echo "$as_me:$LINENO: WARNING: $mt_libextractor_search_headers/extractor.h: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $mt_libextractor_search_headers/extractor.h: present but cannot be compiled" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $mt_libextractor_search_headers/extractor.h: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $mt_libextractor_search_headers/extractor.h: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $mt_libextractor_search_headers/extractor.h: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $mt_libextractor_search_headers/extractor.h: see the Autoconf documentation" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $mt_libextractor_search_headers/extractor.h: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $mt_libextractor_search_headers/extractor.h: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $mt_libextractor_search_headers/extractor.h: proceeding with the preprocessor's result" >&5 $as_echo "$as_me: WARNING: $mt_libextractor_search_headers/extractor.h: proceeding with the preprocessor's result" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $mt_libextractor_search_headers/extractor.h: in the future, the compiler will take precedence" >&5 $as_echo "$as_me: WARNING: $mt_libextractor_search_headers/extractor.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------- ## ## Report this to jin@mediatomb.cc ## ## ------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { $as_echo "$as_me:$LINENO: checking for $mt_libextractor_search_headers/extractor.h" >&5 $as_echo_n "checking for $mt_libextractor_search_headers/extractor.h... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi as_val=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` if test "x$as_val" = x""yes; then mt_libextractor_cxxflags="-I${mt_libextractor_search_headers}" else mt_libextractor_header_status=missing if test "" = "pass"; then { $as_echo "$as_me:$LINENO: libextractor headers not found in requested location $mt_libextractor_search_headers" >&5 $as_echo "$as_me: libextractor headers not found in requested location $mt_libextractor_search_headers" >&6;} else { { $as_echo "$as_me:$LINENO: error: libextractor headers not found in requested location $mt_libextractor_search_headers" >&5 $as_echo "$as_me: error: libextractor headers not found in requested location $mt_libextractor_search_headers" >&2;} { (exit 1); exit 1; }; } fi fi else unset ac_cv_header_extractor_h if test "${ac_cv_header_extractor_h+set}" = set; then { $as_echo "$as_me:$LINENO: checking for extractor.h" >&5 $as_echo_n "checking for extractor.h... " >&6; } if test "${ac_cv_header_extractor_h+set}" = set; then $as_echo_n "(cached) " >&6 fi { $as_echo "$as_me:$LINENO: result: $ac_cv_header_extractor_h" >&5 $as_echo "$ac_cv_header_extractor_h" >&6; } else # Is the header compilable? { $as_echo "$as_me:$LINENO: checking extractor.h usability" >&5 $as_echo_n "checking extractor.h usability... " >&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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:$LINENO: checking extractor.h presence" >&5 $as_echo_n "checking extractor.h presence... " >&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 { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&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 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else $as_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 { $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in yes:no: ) { $as_echo "$as_me:$LINENO: WARNING: extractor.h: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: extractor.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:$LINENO: WARNING: extractor.h: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: extractor.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { $as_echo "$as_me:$LINENO: WARNING: extractor.h: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: extractor.h: present but cannot be compiled" >&2;} { $as_echo "$as_me:$LINENO: WARNING: extractor.h: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: extractor.h: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:$LINENO: WARNING: extractor.h: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: extractor.h: see the Autoconf documentation" >&2;} { $as_echo "$as_me:$LINENO: WARNING: extractor.h: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: extractor.h: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:$LINENO: WARNING: extractor.h: proceeding with the preprocessor's result" >&5 $as_echo "$as_me: WARNING: extractor.h: proceeding with the preprocessor's result" >&2;} { $as_echo "$as_me:$LINENO: WARNING: extractor.h: in the future, the compiler will take precedence" >&5 $as_echo "$as_me: WARNING: extractor.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------- ## ## Report this to jin@mediatomb.cc ## ## ------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { $as_echo "$as_me:$LINENO: checking for extractor.h" >&5 $as_echo_n "checking for extractor.h... " >&6; } if test "${ac_cv_header_extractor_h+set}" = set; then $as_echo_n "(cached) " >&6 else ac_cv_header_extractor_h=$ac_header_preproc fi { $as_echo "$as_me:$LINENO: result: $ac_cv_header_extractor_h" >&5 $as_echo "$ac_cv_header_extractor_h" >&6; } fi if test "x$ac_cv_header_extractor_h" = x""yes; then : else CFLAGS="$CFLAGS -I$MT_SEARCHPATH_HEADERS" CXXFLAGS="$CXXFLAGS -I$MT_SEARCHPATH_HEADERS" CPPFLAGS="$CPPFLAGS -I$MT_SEARCHPATH_HEADERS" unset ac_cv_header_extractor_h as_ac_Header=`$as_echo "ac_cv_header_$MT_SEARCHPATH_HEADERS/extractor.h" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { $as_echo "$as_me:$LINENO: checking for $MT_SEARCHPATH_HEADERS/extractor.h" >&5 $as_echo_n "checking for $MT_SEARCHPATH_HEADERS/extractor.h... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:$LINENO: checking $MT_SEARCHPATH_HEADERS/extractor.h usability" >&5 $as_echo_n "checking $MT_SEARCHPATH_HEADERS/extractor.h usability... " >&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 <$MT_SEARCHPATH_HEADERS/extractor.h> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:$LINENO: checking $MT_SEARCHPATH_HEADERS/extractor.h presence" >&5 $as_echo_n "checking $MT_SEARCHPATH_HEADERS/extractor.h presence... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$MT_SEARCHPATH_HEADERS/extractor.h> _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&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 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else $as_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 { $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in yes:no: ) { $as_echo "$as_me:$LINENO: WARNING: $MT_SEARCHPATH_HEADERS/extractor.h: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $MT_SEARCHPATH_HEADERS/extractor.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $MT_SEARCHPATH_HEADERS/extractor.h: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $MT_SEARCHPATH_HEADERS/extractor.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { $as_echo "$as_me:$LINENO: WARNING: $MT_SEARCHPATH_HEADERS/extractor.h: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $MT_SEARCHPATH_HEADERS/extractor.h: present but cannot be compiled" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $MT_SEARCHPATH_HEADERS/extractor.h: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $MT_SEARCHPATH_HEADERS/extractor.h: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $MT_SEARCHPATH_HEADERS/extractor.h: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $MT_SEARCHPATH_HEADERS/extractor.h: see the Autoconf documentation" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $MT_SEARCHPATH_HEADERS/extractor.h: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $MT_SEARCHPATH_HEADERS/extractor.h: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $MT_SEARCHPATH_HEADERS/extractor.h: proceeding with the preprocessor's result" >&5 $as_echo "$as_me: WARNING: $MT_SEARCHPATH_HEADERS/extractor.h: proceeding with the preprocessor's result" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $MT_SEARCHPATH_HEADERS/extractor.h: in the future, the compiler will take precedence" >&5 $as_echo "$as_me: WARNING: $MT_SEARCHPATH_HEADERS/extractor.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------- ## ## Report this to jin@mediatomb.cc ## ## ------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { $as_echo "$as_me:$LINENO: checking for $MT_SEARCHPATH_HEADERS/extractor.h" >&5 $as_echo_n "checking for $MT_SEARCHPATH_HEADERS/extractor.h... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi as_val=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` if test "x$as_val" = x""yes; then mt_libextractor_cxxflags="-I${MT_SEARCHPATH_HEADERS}" else mt_libextractor_header_status=missing fi fi fi if test "x$mt_libextractor_header_status" != xyes; then mt_libextractor_cxxflags="" fi LIBS=$LIBS_SAVE LDFLAGS=$LDFLAGS_SAVE CFLAGS=$CFLAGS_SAVE CXXFLAGS=$CXXFLAGS_SAVE CPPFLAGS=$CPPFLAGS_SAVE mt_libextractor_package_status=${mt_libextractor_header_status} if test "x$mt_libextractor_package_status" = xyes; then mt_libextractor_arg_default=yes mt_libextractor_library_status=yes LIBS_SAVE=$LIBS LDFLAGS_SAVE=$LDFLAGS CFLAGS_SAVE=$CFLAGS CXXFLAGS_SAVE=$CXXFLAGS CPPFLAGS_SAVE=$CPPFLAGS # Check whether --with-libextractor-libs was given. if test "${with_libextractor_libs+set}" = set; then withval=$with_libextractor_libs; mt_libextractor_search_libs="$withval" { $as_echo "$as_me:$LINENO: Will search for libextractor libs in $withval" >&5 $as_echo "$as_me: Will search for libextractor libs in $withval" >&6;} fi if test "$mt_libextractor_search_libs" ; then unset ac_cv_lib_extractor_EXTRACTOR_getKeywords LDFLAGS="$LDFLAGS -L$mt_libextractor_search_libs" { $as_echo "$as_me:$LINENO: checking for EXTRACTOR_getKeywords in -lextractor" >&5 $as_echo_n "checking for EXTRACTOR_getKeywords in -lextractor... " >&6; } if test "${ac_cv_lib_extractor_EXTRACTOR_getKeywords+set}" = set; then $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lextractor $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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char EXTRACTOR_getKeywords (); int main () { return EXTRACTOR_getKeywords (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_lib_extractor_EXTRACTOR_getKeywords=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_extractor_EXTRACTOR_getKeywords=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_extractor_EXTRACTOR_getKeywords" >&5 $as_echo "$ac_cv_lib_extractor_EXTRACTOR_getKeywords" >&6; } if test "x$ac_cv_lib_extractor_EXTRACTOR_getKeywords" = x""yes; then mt_libextractor_libs="-lextractor" mt_libextractor_ldflags="-L$mt_libextractor_search_libs" else mt_libextractor_library_status=missing if test "" = "pass"; then { $as_echo "$as_me:$LINENO: libextractor library not found in requested location $mt_libextractor_search_libs" >&5 $as_echo "$as_me: libextractor library not found in requested location $mt_libextractor_search_libs" >&6;} else { { $as_echo "$as_me:$LINENO: error: libextractor library not found in requested location $mt_libextractor_search_libs" >&5 $as_echo "$as_me: error: libextractor library not found in requested location $mt_libextractor_search_libs" >&2;} { (exit 1); exit 1; }; } fi fi else unset ac_cv_lib_extractor_EXTRACTOR_getKeywords { $as_echo "$as_me:$LINENO: checking for EXTRACTOR_getKeywords in -lextractor" >&5 $as_echo_n "checking for EXTRACTOR_getKeywords in -lextractor... " >&6; } if test "${ac_cv_lib_extractor_EXTRACTOR_getKeywords+set}" = set; then $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lextractor $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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char EXTRACTOR_getKeywords (); int main () { return EXTRACTOR_getKeywords (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_lib_extractor_EXTRACTOR_getKeywords=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_extractor_EXTRACTOR_getKeywords=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_extractor_EXTRACTOR_getKeywords" >&5 $as_echo "$ac_cv_lib_extractor_EXTRACTOR_getKeywords" >&6; } if test "x$ac_cv_lib_extractor_EXTRACTOR_getKeywords" = x""yes; then mt_libextractor_libs="-lextractor" else LDFLAGS="$LDFLAGS -L$MT_SEARCHPATH_LIBS" unset ac_cv_lib_extractor_EXTRACTOR_getKeywords { $as_echo "$as_me:$LINENO: checking for EXTRACTOR_getKeywords in -lextractor" >&5 $as_echo_n "checking for EXTRACTOR_getKeywords in -lextractor... " >&6; } if test "${ac_cv_lib_extractor_EXTRACTOR_getKeywords+set}" = set; then $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lextractor $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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char EXTRACTOR_getKeywords (); int main () { return EXTRACTOR_getKeywords (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_lib_extractor_EXTRACTOR_getKeywords=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_extractor_EXTRACTOR_getKeywords=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_extractor_EXTRACTOR_getKeywords" >&5 $as_echo "$ac_cv_lib_extractor_EXTRACTOR_getKeywords" >&6; } if test "x$ac_cv_lib_extractor_EXTRACTOR_getKeywords" = x""yes; then mt_libextractor_libs="-lextractor" mt_libextractor_ldflags="-L$MT_SEARCHPATH_LIBS" else mt_libextractor_library_status=missing fi fi fi if test "x$mt_libextractor_library_status" != xyes; then mt_libextractor_libs="" mt_libextractor_ldflags="" fi LIBS=$LIBS_SAVE LDFLAGS=$LDFLAGS_SAVE CFLAGS=$CFLAGS_SAVE CXXFLAGS=$CXXFLAGS_SAVE CPPFLAGS=$CPPFLAGS_SAVE mt_libextractor_package_status=${mt_libextractor_library_status} fi if test "x$mt_libextractor_package_status" = xyes; then LIBEXTRACTOR_CFLAGS=${mt_libextractor_cxxflags} LIBEXTRACTOR_LIBS=${mt_libextractor_libs} LIBEXTRACTOR_LDFLAGS=${mt_libextractor_ldflags} fi mt_libextractor_status=${mt_libextractor_package_status} fi if test "x$mt_libextractor_status" = xyes; then cat >>confdefs.h <<\_ACEOF #define HAVE_LIBEXTRACTOR 1 _ACEOF fi LIBEXTRACTOR_STATUS=${mt_libextractor_status} fi if test "x$LIBEXTRACTOR_STATUS" = xyes; then FFMPEG_STATUS=disabled FFMPEG_OPTION_ENABLED=no else if (test "x$LIBEXTRACTOR_OPTION_REQUESTED" = xyes) && (test "x$LIBEXTRACTOR_OPTION_ENABLED" = xyes); then { { $as_echo "$as_me:$LINENO: error: unable to configure libextractor support" >&5 $as_echo "$as_me: error: unable to configure libextractor support" >&2;} { (exit 1); exit 1; }; } fi fi ######## libexif mt_libexif_status=yes mt_libexif_option_enabled= mt_libexif_option_requested=no if test "xdisable" = xdisable; then mt_libexif_option_enabled=yes else mt_libexif_option_enabled=no fi # Check whether --enable-libexif was given. if test "${enable_libexif+set}" = set; then enableval=$enable_libexif; mt_libexif_option_enabled=$enableval mt_libexif_option_requested=yes fi LIBEXIF_OPTION_ENABLED=${mt_libexif_option_enabled} LIBEXIF_OPTION_REQUESTED=${mt_libexif_option_requested} if test "x${LIBEXIF_OPTION_ENABLED}" = xyes; then LIBS_SAVE=$LIBS LDFLAGS_SAVE=$LDFLAGS CFLAGS_SAVE=$CFLAGS CXXFLAGS_SAVE=$CXXFLAGS CPPFLAGS_SAVE=$CPPFLAGS mt_libexif_header_status=yes # Check whether --with-libexif-h was given. if test "${with_libexif_h+set}" = set; then withval=$with_libexif_h; mt_libexif_search_headers="$withval" { $as_echo "$as_me:$LINENO: Will search for libexif headers in $withval" >&5 $as_echo "$as_me: Will search for libexif headers in $withval" >&6;} fi if test "$mt_libexif_search_headers" ; then unset ac_cv_header_libexif_exif_content_h CFLAGS="$CFLAGS -I${mt_libexif_search_headers}" CXXFLAGS="$CXXFLAGS -I${mt_libexif_search_headers}" CPPFLAGS="$CPPFLAGS -I${mt_libexif_search_headers}" as_ac_Header=`$as_echo "ac_cv_header_$mt_libexif_search_headers/libexif/exif-content.h" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { $as_echo "$as_me:$LINENO: checking for $mt_libexif_search_headers/libexif/exif-content.h" >&5 $as_echo_n "checking for $mt_libexif_search_headers/libexif/exif-content.h... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:$LINENO: checking $mt_libexif_search_headers/libexif/exif-content.h usability" >&5 $as_echo_n "checking $mt_libexif_search_headers/libexif/exif-content.h usability... " >&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 <$mt_libexif_search_headers/libexif/exif-content.h> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:$LINENO: checking $mt_libexif_search_headers/libexif/exif-content.h presence" >&5 $as_echo_n "checking $mt_libexif_search_headers/libexif/exif-content.h presence... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$mt_libexif_search_headers/libexif/exif-content.h> _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&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 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else $as_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 { $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in yes:no: ) { $as_echo "$as_me:$LINENO: WARNING: $mt_libexif_search_headers/libexif/exif-content.h: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $mt_libexif_search_headers/libexif/exif-content.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $mt_libexif_search_headers/libexif/exif-content.h: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $mt_libexif_search_headers/libexif/exif-content.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { $as_echo "$as_me:$LINENO: WARNING: $mt_libexif_search_headers/libexif/exif-content.h: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $mt_libexif_search_headers/libexif/exif-content.h: present but cannot be compiled" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $mt_libexif_search_headers/libexif/exif-content.h: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $mt_libexif_search_headers/libexif/exif-content.h: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $mt_libexif_search_headers/libexif/exif-content.h: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $mt_libexif_search_headers/libexif/exif-content.h: see the Autoconf documentation" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $mt_libexif_search_headers/libexif/exif-content.h: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $mt_libexif_search_headers/libexif/exif-content.h: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $mt_libexif_search_headers/libexif/exif-content.h: proceeding with the preprocessor's result" >&5 $as_echo "$as_me: WARNING: $mt_libexif_search_headers/libexif/exif-content.h: proceeding with the preprocessor's result" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $mt_libexif_search_headers/libexif/exif-content.h: in the future, the compiler will take precedence" >&5 $as_echo "$as_me: WARNING: $mt_libexif_search_headers/libexif/exif-content.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------- ## ## Report this to jin@mediatomb.cc ## ## ------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { $as_echo "$as_me:$LINENO: checking for $mt_libexif_search_headers/libexif/exif-content.h" >&5 $as_echo_n "checking for $mt_libexif_search_headers/libexif/exif-content.h... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi as_val=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` if test "x$as_val" = x""yes; then mt_libexif_cxxflags="-I${mt_libexif_search_headers}" else mt_libexif_header_status=missing if test "" = "pass"; then { $as_echo "$as_me:$LINENO: libexif headers not found in requested location $mt_libexif_search_headers" >&5 $as_echo "$as_me: libexif headers not found in requested location $mt_libexif_search_headers" >&6;} else { { $as_echo "$as_me:$LINENO: error: libexif headers not found in requested location $mt_libexif_search_headers" >&5 $as_echo "$as_me: error: libexif headers not found in requested location $mt_libexif_search_headers" >&2;} { (exit 1); exit 1; }; } fi fi else unset ac_cv_header_libexif_exif_content_h if test "${ac_cv_header_libexif_exif_content_h+set}" = set; then { $as_echo "$as_me:$LINENO: checking for libexif/exif-content.h" >&5 $as_echo_n "checking for libexif/exif-content.h... " >&6; } if test "${ac_cv_header_libexif_exif_content_h+set}" = set; then $as_echo_n "(cached) " >&6 fi { $as_echo "$as_me:$LINENO: result: $ac_cv_header_libexif_exif_content_h" >&5 $as_echo "$ac_cv_header_libexif_exif_content_h" >&6; } else # Is the header compilable? { $as_echo "$as_me:$LINENO: checking libexif/exif-content.h usability" >&5 $as_echo_n "checking libexif/exif-content.h usability... " >&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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:$LINENO: checking libexif/exif-content.h presence" >&5 $as_echo_n "checking libexif/exif-content.h presence... " >&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 { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&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 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else $as_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 { $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in yes:no: ) { $as_echo "$as_me:$LINENO: WARNING: libexif/exif-content.h: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: libexif/exif-content.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:$LINENO: WARNING: libexif/exif-content.h: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: libexif/exif-content.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { $as_echo "$as_me:$LINENO: WARNING: libexif/exif-content.h: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: libexif/exif-content.h: present but cannot be compiled" >&2;} { $as_echo "$as_me:$LINENO: WARNING: libexif/exif-content.h: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: libexif/exif-content.h: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:$LINENO: WARNING: libexif/exif-content.h: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: libexif/exif-content.h: see the Autoconf documentation" >&2;} { $as_echo "$as_me:$LINENO: WARNING: libexif/exif-content.h: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: libexif/exif-content.h: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:$LINENO: WARNING: libexif/exif-content.h: proceeding with the preprocessor's result" >&5 $as_echo "$as_me: WARNING: libexif/exif-content.h: proceeding with the preprocessor's result" >&2;} { $as_echo "$as_me:$LINENO: WARNING: libexif/exif-content.h: in the future, the compiler will take precedence" >&5 $as_echo "$as_me: WARNING: libexif/exif-content.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------- ## ## Report this to jin@mediatomb.cc ## ## ------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { $as_echo "$as_me:$LINENO: checking for libexif/exif-content.h" >&5 $as_echo_n "checking for libexif/exif-content.h... " >&6; } if test "${ac_cv_header_libexif_exif_content_h+set}" = set; then $as_echo_n "(cached) " >&6 else ac_cv_header_libexif_exif_content_h=$ac_header_preproc fi { $as_echo "$as_me:$LINENO: result: $ac_cv_header_libexif_exif_content_h" >&5 $as_echo "$ac_cv_header_libexif_exif_content_h" >&6; } fi if test "x$ac_cv_header_libexif_exif_content_h" = x""yes; then : else CFLAGS="$CFLAGS -I$MT_SEARCHPATH_HEADERS" CXXFLAGS="$CXXFLAGS -I$MT_SEARCHPATH_HEADERS" CPPFLAGS="$CPPFLAGS -I$MT_SEARCHPATH_HEADERS" unset ac_cv_header_libexif_exif_content_h as_ac_Header=`$as_echo "ac_cv_header_$MT_SEARCHPATH_HEADERS/libexif/exif-content.h" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { $as_echo "$as_me:$LINENO: checking for $MT_SEARCHPATH_HEADERS/libexif/exif-content.h" >&5 $as_echo_n "checking for $MT_SEARCHPATH_HEADERS/libexif/exif-content.h... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:$LINENO: checking $MT_SEARCHPATH_HEADERS/libexif/exif-content.h usability" >&5 $as_echo_n "checking $MT_SEARCHPATH_HEADERS/libexif/exif-content.h usability... " >&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 <$MT_SEARCHPATH_HEADERS/libexif/exif-content.h> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:$LINENO: checking $MT_SEARCHPATH_HEADERS/libexif/exif-content.h presence" >&5 $as_echo_n "checking $MT_SEARCHPATH_HEADERS/libexif/exif-content.h presence... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$MT_SEARCHPATH_HEADERS/libexif/exif-content.h> _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&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 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else $as_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 { $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in yes:no: ) { $as_echo "$as_me:$LINENO: WARNING: $MT_SEARCHPATH_HEADERS/libexif/exif-content.h: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $MT_SEARCHPATH_HEADERS/libexif/exif-content.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $MT_SEARCHPATH_HEADERS/libexif/exif-content.h: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $MT_SEARCHPATH_HEADERS/libexif/exif-content.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { $as_echo "$as_me:$LINENO: WARNING: $MT_SEARCHPATH_HEADERS/libexif/exif-content.h: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $MT_SEARCHPATH_HEADERS/libexif/exif-content.h: present but cannot be compiled" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $MT_SEARCHPATH_HEADERS/libexif/exif-content.h: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $MT_SEARCHPATH_HEADERS/libexif/exif-content.h: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $MT_SEARCHPATH_HEADERS/libexif/exif-content.h: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $MT_SEARCHPATH_HEADERS/libexif/exif-content.h: see the Autoconf documentation" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $MT_SEARCHPATH_HEADERS/libexif/exif-content.h: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $MT_SEARCHPATH_HEADERS/libexif/exif-content.h: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $MT_SEARCHPATH_HEADERS/libexif/exif-content.h: proceeding with the preprocessor's result" >&5 $as_echo "$as_me: WARNING: $MT_SEARCHPATH_HEADERS/libexif/exif-content.h: proceeding with the preprocessor's result" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $MT_SEARCHPATH_HEADERS/libexif/exif-content.h: in the future, the compiler will take precedence" >&5 $as_echo "$as_me: WARNING: $MT_SEARCHPATH_HEADERS/libexif/exif-content.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------- ## ## Report this to jin@mediatomb.cc ## ## ------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { $as_echo "$as_me:$LINENO: checking for $MT_SEARCHPATH_HEADERS/libexif/exif-content.h" >&5 $as_echo_n "checking for $MT_SEARCHPATH_HEADERS/libexif/exif-content.h... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi as_val=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` if test "x$as_val" = x""yes; then mt_libexif_cxxflags="-I${MT_SEARCHPATH_HEADERS}" else mt_libexif_header_status=missing fi fi fi if test "x$mt_libexif_header_status" != xyes; then mt_libexif_cxxflags="" fi LIBS=$LIBS_SAVE LDFLAGS=$LDFLAGS_SAVE CFLAGS=$CFLAGS_SAVE CXXFLAGS=$CXXFLAGS_SAVE CPPFLAGS=$CPPFLAGS_SAVE mt_libexif_package_status=${mt_libexif_header_status} if test "x$mt_libexif_package_status" = xyes; then mt_libexif_arg_default=yes mt_libexif_library_status=yes LIBS_SAVE=$LIBS LDFLAGS_SAVE=$LDFLAGS CFLAGS_SAVE=$CFLAGS CXXFLAGS_SAVE=$CXXFLAGS CPPFLAGS_SAVE=$CPPFLAGS # Check whether --with-libexif-libs was given. if test "${with_libexif_libs+set}" = set; then withval=$with_libexif_libs; mt_libexif_search_libs="$withval" { $as_echo "$as_me:$LINENO: Will search for libexif libs in $withval" >&5 $as_echo "$as_me: Will search for libexif libs in $withval" >&6;} fi if test "$mt_libexif_search_libs" ; then unset ac_cv_lib_exif_exif_data_new_from_file LDFLAGS="$LDFLAGS -L$mt_libexif_search_libs" { $as_echo "$as_me:$LINENO: checking for exif_data_new_from_file in -lexif" >&5 $as_echo_n "checking for exif_data_new_from_file in -lexif... " >&6; } if test "${ac_cv_lib_exif_exif_data_new_from_file+set}" = set; then $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lexif $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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char exif_data_new_from_file (); int main () { return exif_data_new_from_file (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_lib_exif_exif_data_new_from_file=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_exif_exif_data_new_from_file=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_exif_exif_data_new_from_file" >&5 $as_echo "$ac_cv_lib_exif_exif_data_new_from_file" >&6; } if test "x$ac_cv_lib_exif_exif_data_new_from_file" = x""yes; then mt_libexif_libs="-lexif" mt_libexif_ldflags="-L$mt_libexif_search_libs" else mt_libexif_library_status=missing if test "" = "pass"; then { $as_echo "$as_me:$LINENO: libexif library not found in requested location $mt_libexif_search_libs" >&5 $as_echo "$as_me: libexif library not found in requested location $mt_libexif_search_libs" >&6;} else { { $as_echo "$as_me:$LINENO: error: libexif library not found in requested location $mt_libexif_search_libs" >&5 $as_echo "$as_me: error: libexif library not found in requested location $mt_libexif_search_libs" >&2;} { (exit 1); exit 1; }; } fi fi else unset ac_cv_lib_exif_exif_data_new_from_file { $as_echo "$as_me:$LINENO: checking for exif_data_new_from_file in -lexif" >&5 $as_echo_n "checking for exif_data_new_from_file in -lexif... " >&6; } if test "${ac_cv_lib_exif_exif_data_new_from_file+set}" = set; then $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lexif $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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char exif_data_new_from_file (); int main () { return exif_data_new_from_file (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_lib_exif_exif_data_new_from_file=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_exif_exif_data_new_from_file=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_exif_exif_data_new_from_file" >&5 $as_echo "$ac_cv_lib_exif_exif_data_new_from_file" >&6; } if test "x$ac_cv_lib_exif_exif_data_new_from_file" = x""yes; then mt_libexif_libs="-lexif" else LDFLAGS="$LDFLAGS -L$MT_SEARCHPATH_LIBS" unset ac_cv_lib_exif_exif_data_new_from_file { $as_echo "$as_me:$LINENO: checking for exif_data_new_from_file in -lexif" >&5 $as_echo_n "checking for exif_data_new_from_file in -lexif... " >&6; } if test "${ac_cv_lib_exif_exif_data_new_from_file+set}" = set; then $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lexif $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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char exif_data_new_from_file (); int main () { return exif_data_new_from_file (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_lib_exif_exif_data_new_from_file=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_exif_exif_data_new_from_file=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_exif_exif_data_new_from_file" >&5 $as_echo "$ac_cv_lib_exif_exif_data_new_from_file" >&6; } if test "x$ac_cv_lib_exif_exif_data_new_from_file" = x""yes; then mt_libexif_libs="-lexif" mt_libexif_ldflags="-L$MT_SEARCHPATH_LIBS" else mt_libexif_library_status=missing fi fi fi if test "x$mt_libexif_library_status" != xyes; then mt_libexif_libs="" mt_libexif_ldflags="" fi LIBS=$LIBS_SAVE LDFLAGS=$LDFLAGS_SAVE CFLAGS=$CFLAGS_SAVE CXXFLAGS=$CXXFLAGS_SAVE CPPFLAGS=$CPPFLAGS_SAVE mt_libexif_package_status=${mt_libexif_library_status} fi if test "x$mt_libexif_package_status" = xyes; then LIBEXIF_CFLAGS=${mt_libexif_cxxflags} LIBEXIF_LIBS=${mt_libexif_libs} LIBEXIF_LDFLAGS=${mt_libexif_ldflags} fi mt_libexif_status=${mt_libexif_package_status} else mt_libexif_status=disabled fi if ((test "x${LIBEXIF_OPTION_ENABLED}" = xyes) && (test "x${LIBEXIF_OPTION_REQUESTED}" = xyes) && (test "x$mt_libexif_status" != xyes) && (test "" != "pass")); then { { $as_echo "$as_me:$LINENO: error: unable to configure libexif support" >&5 $as_echo "$as_me: error: unable to configure libexif support" >&2;} { (exit 1); exit 1; }; } fi if test "x$mt_libexif_status" = xyes; then cat >>confdefs.h <<\_ACEOF #define HAVE_LIBEXIF 1 _ACEOF fi LIBEXIF_STATUS=${mt_libexif_status} if test "x$LIBEXIF_STATUS" = xyes; then CFLAGS="$CFLAGS $LIBEXIF_CFLAGS" CXXFLAGS="$CXXFLAGS $LIBEXIF_CFLAGS" LDFLAGS="$LDFLAGS $LIBEXIF_LDFLAGS $LIBEXIF_LIBS" # try 1 argument signature { $as_echo "$as_me:$LINENO: checking exif_entry_get_value signature" >&5 $as_echo_n "checking exif_entry_get_value signature... " >&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 () { (void)exif_entry_get_value(0); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then { $as_echo "$as_me:$LINENO: result: requires 1 argument" >&5 $as_echo "requires 1 argument" >&6; } EXIF_EGV_1=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # try 3 argument signature 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 () { (void)exif_entry_get_value(0, 0, 0); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then { $as_echo "$as_me:$LINENO: result: requires 3 arguments" >&5 $as_echo "requires 3 arguments" >&6; } EXIF_EGV_3=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { $as_echo "$as_me:$LINENO: result: unsupported, disabling" >&5 $as_echo "unsupported, disabling" >&6; } EXIF_OK="disabled (unsupported version)" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test "x$EXIF_EGV_1" = xyes; then cat >>confdefs.h <<\_ACEOF #define EXIF_EGV_1 1 _ACEOF fi if test "x$EXIF_EGV_3" = xyes; then cat >>confdefs.h <<\_ACEOF #define EXIF_EGV_3 1 _ACEOF fi fi LDFLAGS="$LDFLAGS_SAVE" CFLAGS="$CFLAGS_SAVE" CXXFLAGS="$CXXFLAGS_SAVE" ######## expat LIBS_SAVE=$LIBS LDFLAGS_SAVE=$LDFLAGS CFLAGS_SAVE=$CFLAGS CXXFLAGS_SAVE=$CXXFLAGS CPPFLAGS_SAVE=$CPPFLAGS mt_expat_header_status=yes # Check whether --with-expat-h was given. if test "${with_expat_h+set}" = set; then withval=$with_expat_h; mt_expat_search_headers="$withval" { $as_echo "$as_me:$LINENO: Will search for expat headers in $withval" >&5 $as_echo "$as_me: Will search for expat headers in $withval" >&6;} fi if test "$mt_expat_search_headers" ; then unset ac_cv_header_expat_h CFLAGS="$CFLAGS -I${mt_expat_search_headers}" CXXFLAGS="$CXXFLAGS -I${mt_expat_search_headers}" CPPFLAGS="$CPPFLAGS -I${mt_expat_search_headers}" as_ac_Header=`$as_echo "ac_cv_header_$mt_expat_search_headers/expat.h" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { $as_echo "$as_me:$LINENO: checking for $mt_expat_search_headers/expat.h" >&5 $as_echo_n "checking for $mt_expat_search_headers/expat.h... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:$LINENO: checking $mt_expat_search_headers/expat.h usability" >&5 $as_echo_n "checking $mt_expat_search_headers/expat.h usability... " >&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 <$mt_expat_search_headers/expat.h> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:$LINENO: checking $mt_expat_search_headers/expat.h presence" >&5 $as_echo_n "checking $mt_expat_search_headers/expat.h presence... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$mt_expat_search_headers/expat.h> _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&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 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else $as_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 { $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in yes:no: ) { $as_echo "$as_me:$LINENO: WARNING: $mt_expat_search_headers/expat.h: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $mt_expat_search_headers/expat.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $mt_expat_search_headers/expat.h: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $mt_expat_search_headers/expat.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { $as_echo "$as_me:$LINENO: WARNING: $mt_expat_search_headers/expat.h: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $mt_expat_search_headers/expat.h: present but cannot be compiled" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $mt_expat_search_headers/expat.h: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $mt_expat_search_headers/expat.h: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $mt_expat_search_headers/expat.h: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $mt_expat_search_headers/expat.h: see the Autoconf documentation" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $mt_expat_search_headers/expat.h: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $mt_expat_search_headers/expat.h: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $mt_expat_search_headers/expat.h: proceeding with the preprocessor's result" >&5 $as_echo "$as_me: WARNING: $mt_expat_search_headers/expat.h: proceeding with the preprocessor's result" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $mt_expat_search_headers/expat.h: in the future, the compiler will take precedence" >&5 $as_echo "$as_me: WARNING: $mt_expat_search_headers/expat.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------- ## ## Report this to jin@mediatomb.cc ## ## ------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { $as_echo "$as_me:$LINENO: checking for $mt_expat_search_headers/expat.h" >&5 $as_echo_n "checking for $mt_expat_search_headers/expat.h... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi as_val=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` if test "x$as_val" = x""yes; then mt_expat_cxxflags="-I${mt_expat_search_headers}" else mt_expat_header_status=missing if test "" = "pass"; then { $as_echo "$as_me:$LINENO: expat headers not found in requested location $mt_expat_search_headers" >&5 $as_echo "$as_me: expat headers not found in requested location $mt_expat_search_headers" >&6;} else { { $as_echo "$as_me:$LINENO: error: expat headers not found in requested location $mt_expat_search_headers" >&5 $as_echo "$as_me: error: expat headers not found in requested location $mt_expat_search_headers" >&2;} { (exit 1); exit 1; }; } fi fi else unset ac_cv_header_expat_h if test "${ac_cv_header_expat_h+set}" = set; then { $as_echo "$as_me:$LINENO: checking for expat.h" >&5 $as_echo_n "checking for expat.h... " >&6; } if test "${ac_cv_header_expat_h+set}" = set; then $as_echo_n "(cached) " >&6 fi { $as_echo "$as_me:$LINENO: result: $ac_cv_header_expat_h" >&5 $as_echo "$ac_cv_header_expat_h" >&6; } else # Is the header compilable? { $as_echo "$as_me:$LINENO: checking expat.h usability" >&5 $as_echo_n "checking expat.h usability... " >&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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:$LINENO: checking expat.h presence" >&5 $as_echo_n "checking expat.h presence... " >&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 { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&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 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else $as_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 { $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in yes:no: ) { $as_echo "$as_me:$LINENO: WARNING: expat.h: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: expat.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:$LINENO: WARNING: expat.h: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: expat.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { $as_echo "$as_me:$LINENO: WARNING: expat.h: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: expat.h: present but cannot be compiled" >&2;} { $as_echo "$as_me:$LINENO: WARNING: expat.h: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: expat.h: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:$LINENO: WARNING: expat.h: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: expat.h: see the Autoconf documentation" >&2;} { $as_echo "$as_me:$LINENO: WARNING: expat.h: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: expat.h: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:$LINENO: WARNING: expat.h: proceeding with the preprocessor's result" >&5 $as_echo "$as_me: WARNING: expat.h: proceeding with the preprocessor's result" >&2;} { $as_echo "$as_me:$LINENO: WARNING: expat.h: in the future, the compiler will take precedence" >&5 $as_echo "$as_me: WARNING: expat.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------- ## ## Report this to jin@mediatomb.cc ## ## ------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { $as_echo "$as_me:$LINENO: checking for expat.h" >&5 $as_echo_n "checking for expat.h... " >&6; } if test "${ac_cv_header_expat_h+set}" = set; then $as_echo_n "(cached) " >&6 else ac_cv_header_expat_h=$ac_header_preproc fi { $as_echo "$as_me:$LINENO: result: $ac_cv_header_expat_h" >&5 $as_echo "$ac_cv_header_expat_h" >&6; } fi if test "x$ac_cv_header_expat_h" = x""yes; then : else CFLAGS="$CFLAGS -I$MT_SEARCHPATH_HEADERS" CXXFLAGS="$CXXFLAGS -I$MT_SEARCHPATH_HEADERS" CPPFLAGS="$CPPFLAGS -I$MT_SEARCHPATH_HEADERS" unset ac_cv_header_expat_h as_ac_Header=`$as_echo "ac_cv_header_$MT_SEARCHPATH_HEADERS/expat.h" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { $as_echo "$as_me:$LINENO: checking for $MT_SEARCHPATH_HEADERS/expat.h" >&5 $as_echo_n "checking for $MT_SEARCHPATH_HEADERS/expat.h... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:$LINENO: checking $MT_SEARCHPATH_HEADERS/expat.h usability" >&5 $as_echo_n "checking $MT_SEARCHPATH_HEADERS/expat.h usability... " >&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 <$MT_SEARCHPATH_HEADERS/expat.h> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:$LINENO: checking $MT_SEARCHPATH_HEADERS/expat.h presence" >&5 $as_echo_n "checking $MT_SEARCHPATH_HEADERS/expat.h presence... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$MT_SEARCHPATH_HEADERS/expat.h> _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&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 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else $as_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 { $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in yes:no: ) { $as_echo "$as_me:$LINENO: WARNING: $MT_SEARCHPATH_HEADERS/expat.h: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $MT_SEARCHPATH_HEADERS/expat.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $MT_SEARCHPATH_HEADERS/expat.h: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $MT_SEARCHPATH_HEADERS/expat.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { $as_echo "$as_me:$LINENO: WARNING: $MT_SEARCHPATH_HEADERS/expat.h: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $MT_SEARCHPATH_HEADERS/expat.h: present but cannot be compiled" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $MT_SEARCHPATH_HEADERS/expat.h: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $MT_SEARCHPATH_HEADERS/expat.h: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $MT_SEARCHPATH_HEADERS/expat.h: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $MT_SEARCHPATH_HEADERS/expat.h: see the Autoconf documentation" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $MT_SEARCHPATH_HEADERS/expat.h: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $MT_SEARCHPATH_HEADERS/expat.h: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $MT_SEARCHPATH_HEADERS/expat.h: proceeding with the preprocessor's result" >&5 $as_echo "$as_me: WARNING: $MT_SEARCHPATH_HEADERS/expat.h: proceeding with the preprocessor's result" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $MT_SEARCHPATH_HEADERS/expat.h: in the future, the compiler will take precedence" >&5 $as_echo "$as_me: WARNING: $MT_SEARCHPATH_HEADERS/expat.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------- ## ## Report this to jin@mediatomb.cc ## ## ------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { $as_echo "$as_me:$LINENO: checking for $MT_SEARCHPATH_HEADERS/expat.h" >&5 $as_echo_n "checking for $MT_SEARCHPATH_HEADERS/expat.h... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi as_val=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` if test "x$as_val" = x""yes; then mt_expat_cxxflags="-I${MT_SEARCHPATH_HEADERS}" else mt_expat_header_status=missing fi fi fi if test "x$mt_expat_header_status" != xyes; then mt_expat_cxxflags="" fi LIBS=$LIBS_SAVE LDFLAGS=$LDFLAGS_SAVE CFLAGS=$CFLAGS_SAVE CXXFLAGS=$CXXFLAGS_SAVE CPPFLAGS=$CPPFLAGS_SAVE mt_expat_package_status=${mt_expat_header_status} if test "x$mt_expat_package_status" = xyes; then mt_expat_arg_default=yes mt_expat_library_status=yes LIBS_SAVE=$LIBS LDFLAGS_SAVE=$LDFLAGS CFLAGS_SAVE=$CFLAGS CXXFLAGS_SAVE=$CXXFLAGS CPPFLAGS_SAVE=$CPPFLAGS # Check whether --with-expat-libs was given. if test "${with_expat_libs+set}" = set; then withval=$with_expat_libs; mt_expat_search_libs="$withval" { $as_echo "$as_me:$LINENO: Will search for expat libs in $withval" >&5 $as_echo "$as_me: Will search for expat libs in $withval" >&6;} fi if test "$mt_expat_search_libs" ; then unset ac_cv_lib_expat_XML_ParserCreate LDFLAGS="$LDFLAGS -L$mt_expat_search_libs" { $as_echo "$as_me:$LINENO: checking for XML_ParserCreate in -lexpat" >&5 $as_echo_n "checking for XML_ParserCreate in -lexpat... " >&6; } if test "${ac_cv_lib_expat_XML_ParserCreate+set}" = set; then $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lexpat $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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char XML_ParserCreate (); int main () { return XML_ParserCreate (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_lib_expat_XML_ParserCreate=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_expat_XML_ParserCreate=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_expat_XML_ParserCreate" >&5 $as_echo "$ac_cv_lib_expat_XML_ParserCreate" >&6; } if test "x$ac_cv_lib_expat_XML_ParserCreate" = x""yes; then mt_expat_libs="-lexpat" mt_expat_ldflags="-L$mt_expat_search_libs" else mt_expat_library_status=missing if test "" = "pass"; then { $as_echo "$as_me:$LINENO: expat library not found in requested location $mt_expat_search_libs" >&5 $as_echo "$as_me: expat library not found in requested location $mt_expat_search_libs" >&6;} else { { $as_echo "$as_me:$LINENO: error: expat library not found in requested location $mt_expat_search_libs" >&5 $as_echo "$as_me: error: expat library not found in requested location $mt_expat_search_libs" >&2;} { (exit 1); exit 1; }; } fi fi else unset ac_cv_lib_expat_XML_ParserCreate { $as_echo "$as_me:$LINENO: checking for XML_ParserCreate in -lexpat" >&5 $as_echo_n "checking for XML_ParserCreate in -lexpat... " >&6; } if test "${ac_cv_lib_expat_XML_ParserCreate+set}" = set; then $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lexpat $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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char XML_ParserCreate (); int main () { return XML_ParserCreate (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_lib_expat_XML_ParserCreate=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_expat_XML_ParserCreate=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_expat_XML_ParserCreate" >&5 $as_echo "$ac_cv_lib_expat_XML_ParserCreate" >&6; } if test "x$ac_cv_lib_expat_XML_ParserCreate" = x""yes; then mt_expat_libs="-lexpat" else LDFLAGS="$LDFLAGS -L$MT_SEARCHPATH_LIBS" unset ac_cv_lib_expat_XML_ParserCreate { $as_echo "$as_me:$LINENO: checking for XML_ParserCreate in -lexpat" >&5 $as_echo_n "checking for XML_ParserCreate in -lexpat... " >&6; } if test "${ac_cv_lib_expat_XML_ParserCreate+set}" = set; then $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lexpat $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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char XML_ParserCreate (); int main () { return XML_ParserCreate (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_lib_expat_XML_ParserCreate=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_expat_XML_ParserCreate=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_expat_XML_ParserCreate" >&5 $as_echo "$ac_cv_lib_expat_XML_ParserCreate" >&6; } if test "x$ac_cv_lib_expat_XML_ParserCreate" = x""yes; then mt_expat_libs="-lexpat" mt_expat_ldflags="-L$MT_SEARCHPATH_LIBS" else mt_expat_library_status=missing fi fi fi if test "x$mt_expat_library_status" != xyes; then mt_expat_libs="" mt_expat_ldflags="" fi LIBS=$LIBS_SAVE LDFLAGS=$LDFLAGS_SAVE CFLAGS=$CFLAGS_SAVE CXXFLAGS=$CXXFLAGS_SAVE CPPFLAGS=$CPPFLAGS_SAVE mt_expat_package_status=${mt_expat_library_status} fi if test "x$mt_expat_package_status" = xyes; then EXPAT_CFLAGS=${mt_expat_cxxflags} EXPAT_LIBS=${mt_expat_libs} EXPAT_LDFLAGS=${mt_expat_ldflags} fi if test "x$mt_expat_package_status" != xyes; then { { $as_echo "$as_me:$LINENO: error: unable to configure required package expat" >&5 $as_echo "$as_me: error: unable to configure required package expat" >&2;} { (exit 1); exit 1; }; } fi cat >>confdefs.h <<\_ACEOF #define HAVE_EXPAT 1 _ACEOF EXPAT_STATUS=${mt_expat_package_status} ####### libmp4v2 MP4_HEADER="mp4" # prefer newer mp4v2 LIBS_SAVE=$LIBS LDFLAGS_SAVE=$LDFLAGS CFLAGS_SAVE=$CFLAGS CXXFLAGS_SAVE=$CXXFLAGS CPPFLAGS_SAVE=$CPPFLAGS mt_libmp4v2_header_status=yes # Check whether --with-libmp4v2-h was given. if test "${with_libmp4v2_h+set}" = set; then withval=$with_libmp4v2_h; mt_libmp4v2_search_headers="$withval" { $as_echo "$as_me:$LINENO: Will search for libmp4v2 headers in $withval" >&5 $as_echo "$as_me: Will search for libmp4v2 headers in $withval" >&6;} fi if test "$mt_libmp4v2_search_headers" ; then unset ac_cv_header_mp4v2_mp4v2_h CFLAGS="$CFLAGS -I${mt_libmp4v2_search_headers}" CXXFLAGS="$CXXFLAGS -I${mt_libmp4v2_search_headers}" CPPFLAGS="$CPPFLAGS -I${mt_libmp4v2_search_headers}" as_ac_Header=`$as_echo "ac_cv_header_$mt_libmp4v2_search_headers/mp4v2/mp4v2.h" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { $as_echo "$as_me:$LINENO: checking for $mt_libmp4v2_search_headers/mp4v2/mp4v2.h" >&5 $as_echo_n "checking for $mt_libmp4v2_search_headers/mp4v2/mp4v2.h... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:$LINENO: checking $mt_libmp4v2_search_headers/mp4v2/mp4v2.h usability" >&5 $as_echo_n "checking $mt_libmp4v2_search_headers/mp4v2/mp4v2.h usability... " >&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 <$mt_libmp4v2_search_headers/mp4v2/mp4v2.h> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:$LINENO: checking $mt_libmp4v2_search_headers/mp4v2/mp4v2.h presence" >&5 $as_echo_n "checking $mt_libmp4v2_search_headers/mp4v2/mp4v2.h presence... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$mt_libmp4v2_search_headers/mp4v2/mp4v2.h> _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&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 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else $as_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 { $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in yes:no: ) { $as_echo "$as_me:$LINENO: WARNING: $mt_libmp4v2_search_headers/mp4v2/mp4v2.h: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $mt_libmp4v2_search_headers/mp4v2/mp4v2.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $mt_libmp4v2_search_headers/mp4v2/mp4v2.h: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $mt_libmp4v2_search_headers/mp4v2/mp4v2.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { $as_echo "$as_me:$LINENO: WARNING: $mt_libmp4v2_search_headers/mp4v2/mp4v2.h: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $mt_libmp4v2_search_headers/mp4v2/mp4v2.h: present but cannot be compiled" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $mt_libmp4v2_search_headers/mp4v2/mp4v2.h: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $mt_libmp4v2_search_headers/mp4v2/mp4v2.h: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $mt_libmp4v2_search_headers/mp4v2/mp4v2.h: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $mt_libmp4v2_search_headers/mp4v2/mp4v2.h: see the Autoconf documentation" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $mt_libmp4v2_search_headers/mp4v2/mp4v2.h: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $mt_libmp4v2_search_headers/mp4v2/mp4v2.h: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $mt_libmp4v2_search_headers/mp4v2/mp4v2.h: proceeding with the preprocessor's result" >&5 $as_echo "$as_me: WARNING: $mt_libmp4v2_search_headers/mp4v2/mp4v2.h: proceeding with the preprocessor's result" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $mt_libmp4v2_search_headers/mp4v2/mp4v2.h: in the future, the compiler will take precedence" >&5 $as_echo "$as_me: WARNING: $mt_libmp4v2_search_headers/mp4v2/mp4v2.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------- ## ## Report this to jin@mediatomb.cc ## ## ------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { $as_echo "$as_me:$LINENO: checking for $mt_libmp4v2_search_headers/mp4v2/mp4v2.h" >&5 $as_echo_n "checking for $mt_libmp4v2_search_headers/mp4v2/mp4v2.h... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi as_val=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` if test "x$as_val" = x""yes; then mt_libmp4v2_cxxflags="-I${mt_libmp4v2_search_headers}" else mt_libmp4v2_header_status=missing if test "pass" = "pass"; then { $as_echo "$as_me:$LINENO: libmp4v2 headers not found in requested location $mt_libmp4v2_search_headers" >&5 $as_echo "$as_me: libmp4v2 headers not found in requested location $mt_libmp4v2_search_headers" >&6;} else { { $as_echo "$as_me:$LINENO: error: libmp4v2 headers not found in requested location $mt_libmp4v2_search_headers" >&5 $as_echo "$as_me: error: libmp4v2 headers not found in requested location $mt_libmp4v2_search_headers" >&2;} { (exit 1); exit 1; }; } fi fi else unset ac_cv_header_mp4v2_mp4v2_h if test "${ac_cv_header_mp4v2_mp4v2_h+set}" = set; then { $as_echo "$as_me:$LINENO: checking for mp4v2/mp4v2.h" >&5 $as_echo_n "checking for mp4v2/mp4v2.h... " >&6; } if test "${ac_cv_header_mp4v2_mp4v2_h+set}" = set; then $as_echo_n "(cached) " >&6 fi { $as_echo "$as_me:$LINENO: result: $ac_cv_header_mp4v2_mp4v2_h" >&5 $as_echo "$ac_cv_header_mp4v2_mp4v2_h" >&6; } else # Is the header compilable? { $as_echo "$as_me:$LINENO: checking mp4v2/mp4v2.h usability" >&5 $as_echo_n "checking mp4v2/mp4v2.h usability... " >&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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:$LINENO: checking mp4v2/mp4v2.h presence" >&5 $as_echo_n "checking mp4v2/mp4v2.h presence... " >&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 { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&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 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else $as_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 { $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in yes:no: ) { $as_echo "$as_me:$LINENO: WARNING: mp4v2/mp4v2.h: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: mp4v2/mp4v2.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:$LINENO: WARNING: mp4v2/mp4v2.h: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: mp4v2/mp4v2.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { $as_echo "$as_me:$LINENO: WARNING: mp4v2/mp4v2.h: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: mp4v2/mp4v2.h: present but cannot be compiled" >&2;} { $as_echo "$as_me:$LINENO: WARNING: mp4v2/mp4v2.h: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: mp4v2/mp4v2.h: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:$LINENO: WARNING: mp4v2/mp4v2.h: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: mp4v2/mp4v2.h: see the Autoconf documentation" >&2;} { $as_echo "$as_me:$LINENO: WARNING: mp4v2/mp4v2.h: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: mp4v2/mp4v2.h: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:$LINENO: WARNING: mp4v2/mp4v2.h: proceeding with the preprocessor's result" >&5 $as_echo "$as_me: WARNING: mp4v2/mp4v2.h: proceeding with the preprocessor's result" >&2;} { $as_echo "$as_me:$LINENO: WARNING: mp4v2/mp4v2.h: in the future, the compiler will take precedence" >&5 $as_echo "$as_me: WARNING: mp4v2/mp4v2.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------- ## ## Report this to jin@mediatomb.cc ## ## ------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { $as_echo "$as_me:$LINENO: checking for mp4v2/mp4v2.h" >&5 $as_echo_n "checking for mp4v2/mp4v2.h... " >&6; } if test "${ac_cv_header_mp4v2_mp4v2_h+set}" = set; then $as_echo_n "(cached) " >&6 else ac_cv_header_mp4v2_mp4v2_h=$ac_header_preproc fi { $as_echo "$as_me:$LINENO: result: $ac_cv_header_mp4v2_mp4v2_h" >&5 $as_echo "$ac_cv_header_mp4v2_mp4v2_h" >&6; } fi if test "x$ac_cv_header_mp4v2_mp4v2_h" = x""yes; then : else CFLAGS="$CFLAGS -I$MT_SEARCHPATH_HEADERS" CXXFLAGS="$CXXFLAGS -I$MT_SEARCHPATH_HEADERS" CPPFLAGS="$CPPFLAGS -I$MT_SEARCHPATH_HEADERS" unset ac_cv_header_mp4v2_mp4v2_h as_ac_Header=`$as_echo "ac_cv_header_$MT_SEARCHPATH_HEADERS/mp4v2/mp4v2.h" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { $as_echo "$as_me:$LINENO: checking for $MT_SEARCHPATH_HEADERS/mp4v2/mp4v2.h" >&5 $as_echo_n "checking for $MT_SEARCHPATH_HEADERS/mp4v2/mp4v2.h... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:$LINENO: checking $MT_SEARCHPATH_HEADERS/mp4v2/mp4v2.h usability" >&5 $as_echo_n "checking $MT_SEARCHPATH_HEADERS/mp4v2/mp4v2.h usability... " >&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 <$MT_SEARCHPATH_HEADERS/mp4v2/mp4v2.h> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:$LINENO: checking $MT_SEARCHPATH_HEADERS/mp4v2/mp4v2.h presence" >&5 $as_echo_n "checking $MT_SEARCHPATH_HEADERS/mp4v2/mp4v2.h presence... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$MT_SEARCHPATH_HEADERS/mp4v2/mp4v2.h> _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&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 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else $as_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 { $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in yes:no: ) { $as_echo "$as_me:$LINENO: WARNING: $MT_SEARCHPATH_HEADERS/mp4v2/mp4v2.h: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $MT_SEARCHPATH_HEADERS/mp4v2/mp4v2.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $MT_SEARCHPATH_HEADERS/mp4v2/mp4v2.h: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $MT_SEARCHPATH_HEADERS/mp4v2/mp4v2.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { $as_echo "$as_me:$LINENO: WARNING: $MT_SEARCHPATH_HEADERS/mp4v2/mp4v2.h: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $MT_SEARCHPATH_HEADERS/mp4v2/mp4v2.h: present but cannot be compiled" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $MT_SEARCHPATH_HEADERS/mp4v2/mp4v2.h: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $MT_SEARCHPATH_HEADERS/mp4v2/mp4v2.h: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $MT_SEARCHPATH_HEADERS/mp4v2/mp4v2.h: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $MT_SEARCHPATH_HEADERS/mp4v2/mp4v2.h: see the Autoconf documentation" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $MT_SEARCHPATH_HEADERS/mp4v2/mp4v2.h: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $MT_SEARCHPATH_HEADERS/mp4v2/mp4v2.h: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $MT_SEARCHPATH_HEADERS/mp4v2/mp4v2.h: proceeding with the preprocessor's result" >&5 $as_echo "$as_me: WARNING: $MT_SEARCHPATH_HEADERS/mp4v2/mp4v2.h: proceeding with the preprocessor's result" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $MT_SEARCHPATH_HEADERS/mp4v2/mp4v2.h: in the future, the compiler will take precedence" >&5 $as_echo "$as_me: WARNING: $MT_SEARCHPATH_HEADERS/mp4v2/mp4v2.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------- ## ## Report this to jin@mediatomb.cc ## ## ------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { $as_echo "$as_me:$LINENO: checking for $MT_SEARCHPATH_HEADERS/mp4v2/mp4v2.h" >&5 $as_echo_n "checking for $MT_SEARCHPATH_HEADERS/mp4v2/mp4v2.h... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi as_val=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` if test "x$as_val" = x""yes; then mt_libmp4v2_cxxflags="-I${MT_SEARCHPATH_HEADERS}" else mt_libmp4v2_header_status=missing fi fi fi if test "x$mt_libmp4v2_header_status" != xyes; then mt_libmp4v2_cxxflags="" fi LIBS=$LIBS_SAVE LDFLAGS=$LDFLAGS_SAVE CFLAGS=$CFLAGS_SAVE CXXFLAGS=$CXXFLAGS_SAVE CPPFLAGS=$CPPFLAGS_SAVE LIBMP4V2_CFLAGS=${mt_libmp4v2_cxxflags} LIBMP4V2_STATUS=${mt_libmp4v2_header_status} if test "x$LIBMP4V2_STATUS" = xyes; then MP4_HEADER="mp4v2/mp4v2" fi LIBMP4V2_STATUS= mt_libmp4v2_status=yes mt_libmp4v2_option_enabled= mt_libmp4v2_option_requested=no if test "xdisable" = xdisable; then mt_libmp4v2_option_enabled=yes else mt_libmp4v2_option_enabled=no fi # Check whether --enable-libmp4v2 was given. if test "${enable_libmp4v2+set}" = set; then enableval=$enable_libmp4v2; mt_libmp4v2_option_enabled=$enableval mt_libmp4v2_option_requested=yes fi LIBMP4V2_OPTION_ENABLED=${mt_libmp4v2_option_enabled} LIBMP4V2_OPTION_REQUESTED=${mt_libmp4v2_option_requested} if test "x${LIBMP4V2_OPTION_ENABLED}" = xyes; then LIBS_SAVE=$LIBS LDFLAGS_SAVE=$LDFLAGS CFLAGS_SAVE=$CFLAGS CXXFLAGS_SAVE=$CXXFLAGS CPPFLAGS_SAVE=$CPPFLAGS mt_libmp4v2_header_status=yes # Check whether --with-libmp4v2-h was given. if test "${with_libmp4v2_h+set}" = set; then withval=$with_libmp4v2_h; mt_libmp4v2_search_headers="$withval" { $as_echo "$as_me:$LINENO: Will search for libmp4v2 headers in $withval" >&5 $as_echo "$as_me: Will search for libmp4v2 headers in $withval" >&6;} fi if test "$mt_libmp4v2_search_headers" ; then unset ac_cv_header_$MP4_HEADER_h CFLAGS="$CFLAGS -I${mt_libmp4v2_search_headers}" CXXFLAGS="$CXXFLAGS -I${mt_libmp4v2_search_headers}" CPPFLAGS="$CPPFLAGS -I${mt_libmp4v2_search_headers}" as_ac_Header=`$as_echo "ac_cv_header_$mt_libmp4v2_search_headers/$MP4_HEADER.h" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { $as_echo "$as_me:$LINENO: checking for $mt_libmp4v2_search_headers/$MP4_HEADER.h" >&5 $as_echo_n "checking for $mt_libmp4v2_search_headers/$MP4_HEADER.h... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:$LINENO: checking $mt_libmp4v2_search_headers/$MP4_HEADER.h usability" >&5 $as_echo_n "checking $mt_libmp4v2_search_headers/$MP4_HEADER.h usability... " >&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 <$mt_libmp4v2_search_headers/$MP4_HEADER.h> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:$LINENO: checking $mt_libmp4v2_search_headers/$MP4_HEADER.h presence" >&5 $as_echo_n "checking $mt_libmp4v2_search_headers/$MP4_HEADER.h presence... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$mt_libmp4v2_search_headers/$MP4_HEADER.h> _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&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 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else $as_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 { $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in yes:no: ) { $as_echo "$as_me:$LINENO: WARNING: $mt_libmp4v2_search_headers/$MP4_HEADER.h: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $mt_libmp4v2_search_headers/$MP4_HEADER.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $mt_libmp4v2_search_headers/$MP4_HEADER.h: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $mt_libmp4v2_search_headers/$MP4_HEADER.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { $as_echo "$as_me:$LINENO: WARNING: $mt_libmp4v2_search_headers/$MP4_HEADER.h: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $mt_libmp4v2_search_headers/$MP4_HEADER.h: present but cannot be compiled" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $mt_libmp4v2_search_headers/$MP4_HEADER.h: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $mt_libmp4v2_search_headers/$MP4_HEADER.h: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $mt_libmp4v2_search_headers/$MP4_HEADER.h: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $mt_libmp4v2_search_headers/$MP4_HEADER.h: see the Autoconf documentation" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $mt_libmp4v2_search_headers/$MP4_HEADER.h: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $mt_libmp4v2_search_headers/$MP4_HEADER.h: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $mt_libmp4v2_search_headers/$MP4_HEADER.h: proceeding with the preprocessor's result" >&5 $as_echo "$as_me: WARNING: $mt_libmp4v2_search_headers/$MP4_HEADER.h: proceeding with the preprocessor's result" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $mt_libmp4v2_search_headers/$MP4_HEADER.h: in the future, the compiler will take precedence" >&5 $as_echo "$as_me: WARNING: $mt_libmp4v2_search_headers/$MP4_HEADER.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------- ## ## Report this to jin@mediatomb.cc ## ## ------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { $as_echo "$as_me:$LINENO: checking for $mt_libmp4v2_search_headers/$MP4_HEADER.h" >&5 $as_echo_n "checking for $mt_libmp4v2_search_headers/$MP4_HEADER.h... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi as_val=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` if test "x$as_val" = x""yes; then mt_libmp4v2_cxxflags="-I${mt_libmp4v2_search_headers}" else mt_libmp4v2_header_status=missing if test "" = "pass"; then { $as_echo "$as_me:$LINENO: libmp4v2 headers not found in requested location $mt_libmp4v2_search_headers" >&5 $as_echo "$as_me: libmp4v2 headers not found in requested location $mt_libmp4v2_search_headers" >&6;} else { { $as_echo "$as_me:$LINENO: error: libmp4v2 headers not found in requested location $mt_libmp4v2_search_headers" >&5 $as_echo "$as_me: error: libmp4v2 headers not found in requested location $mt_libmp4v2_search_headers" >&2;} { (exit 1); exit 1; }; } fi fi else unset ac_cv_header_$MP4_HEADER_h as_ac_Header=`$as_echo "ac_cv_header_$MP4_HEADER.h" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { $as_echo "$as_me:$LINENO: checking for $MP4_HEADER.h" >&5 $as_echo_n "checking for $MP4_HEADER.h... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:$LINENO: checking $MP4_HEADER.h usability" >&5 $as_echo_n "checking $MP4_HEADER.h usability... " >&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 <$MP4_HEADER.h> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:$LINENO: checking $MP4_HEADER.h presence" >&5 $as_echo_n "checking $MP4_HEADER.h presence... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$MP4_HEADER.h> _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&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 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else $as_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 { $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in yes:no: ) { $as_echo "$as_me:$LINENO: WARNING: $MP4_HEADER.h: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $MP4_HEADER.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $MP4_HEADER.h: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $MP4_HEADER.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { $as_echo "$as_me:$LINENO: WARNING: $MP4_HEADER.h: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $MP4_HEADER.h: present but cannot be compiled" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $MP4_HEADER.h: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $MP4_HEADER.h: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $MP4_HEADER.h: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $MP4_HEADER.h: see the Autoconf documentation" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $MP4_HEADER.h: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $MP4_HEADER.h: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $MP4_HEADER.h: proceeding with the preprocessor's result" >&5 $as_echo "$as_me: WARNING: $MP4_HEADER.h: proceeding with the preprocessor's result" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $MP4_HEADER.h: in the future, the compiler will take precedence" >&5 $as_echo "$as_me: WARNING: $MP4_HEADER.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------- ## ## Report this to jin@mediatomb.cc ## ## ------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { $as_echo "$as_me:$LINENO: checking for $MP4_HEADER.h" >&5 $as_echo_n "checking for $MP4_HEADER.h... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi as_val=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` if test "x$as_val" = x""yes; then : else CFLAGS="$CFLAGS -I$MT_SEARCHPATH_HEADERS" CXXFLAGS="$CXXFLAGS -I$MT_SEARCHPATH_HEADERS" CPPFLAGS="$CPPFLAGS -I$MT_SEARCHPATH_HEADERS" unset ac_cv_header_$MP4_HEADER_h as_ac_Header=`$as_echo "ac_cv_header_$MT_SEARCHPATH_HEADERS/$MP4_HEADER.h" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { $as_echo "$as_me:$LINENO: checking for $MT_SEARCHPATH_HEADERS/$MP4_HEADER.h" >&5 $as_echo_n "checking for $MT_SEARCHPATH_HEADERS/$MP4_HEADER.h... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:$LINENO: checking $MT_SEARCHPATH_HEADERS/$MP4_HEADER.h usability" >&5 $as_echo_n "checking $MT_SEARCHPATH_HEADERS/$MP4_HEADER.h usability... " >&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 <$MT_SEARCHPATH_HEADERS/$MP4_HEADER.h> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:$LINENO: checking $MT_SEARCHPATH_HEADERS/$MP4_HEADER.h presence" >&5 $as_echo_n "checking $MT_SEARCHPATH_HEADERS/$MP4_HEADER.h presence... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$MT_SEARCHPATH_HEADERS/$MP4_HEADER.h> _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&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 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else $as_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 { $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in yes:no: ) { $as_echo "$as_me:$LINENO: WARNING: $MT_SEARCHPATH_HEADERS/$MP4_HEADER.h: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $MT_SEARCHPATH_HEADERS/$MP4_HEADER.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $MT_SEARCHPATH_HEADERS/$MP4_HEADER.h: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $MT_SEARCHPATH_HEADERS/$MP4_HEADER.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { $as_echo "$as_me:$LINENO: WARNING: $MT_SEARCHPATH_HEADERS/$MP4_HEADER.h: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $MT_SEARCHPATH_HEADERS/$MP4_HEADER.h: present but cannot be compiled" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $MT_SEARCHPATH_HEADERS/$MP4_HEADER.h: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $MT_SEARCHPATH_HEADERS/$MP4_HEADER.h: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $MT_SEARCHPATH_HEADERS/$MP4_HEADER.h: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $MT_SEARCHPATH_HEADERS/$MP4_HEADER.h: see the Autoconf documentation" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $MT_SEARCHPATH_HEADERS/$MP4_HEADER.h: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $MT_SEARCHPATH_HEADERS/$MP4_HEADER.h: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $MT_SEARCHPATH_HEADERS/$MP4_HEADER.h: proceeding with the preprocessor's result" >&5 $as_echo "$as_me: WARNING: $MT_SEARCHPATH_HEADERS/$MP4_HEADER.h: proceeding with the preprocessor's result" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $MT_SEARCHPATH_HEADERS/$MP4_HEADER.h: in the future, the compiler will take precedence" >&5 $as_echo "$as_me: WARNING: $MT_SEARCHPATH_HEADERS/$MP4_HEADER.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------- ## ## Report this to jin@mediatomb.cc ## ## ------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { $as_echo "$as_me:$LINENO: checking for $MT_SEARCHPATH_HEADERS/$MP4_HEADER.h" >&5 $as_echo_n "checking for $MT_SEARCHPATH_HEADERS/$MP4_HEADER.h... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi as_val=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` if test "x$as_val" = x""yes; then mt_libmp4v2_cxxflags="-I${MT_SEARCHPATH_HEADERS}" else mt_libmp4v2_header_status=missing fi fi fi if test "x$mt_libmp4v2_header_status" != xyes; then mt_libmp4v2_cxxflags="" fi LIBS=$LIBS_SAVE LDFLAGS=$LDFLAGS_SAVE CFLAGS=$CFLAGS_SAVE CXXFLAGS=$CXXFLAGS_SAVE CPPFLAGS=$CPPFLAGS_SAVE mt_libmp4v2_package_status=${mt_libmp4v2_header_status} if test "x$mt_libmp4v2_package_status" = xyes; then mt_libmp4v2_arg_default=yes mt_libmp4v2_library_status=yes LIBS_SAVE=$LIBS LDFLAGS_SAVE=$LDFLAGS CFLAGS_SAVE=$CFLAGS CXXFLAGS_SAVE=$CXXFLAGS CPPFLAGS_SAVE=$CPPFLAGS # Check whether --with-libmp4v2-libs was given. if test "${with_libmp4v2_libs+set}" = set; then withval=$with_libmp4v2_libs; mt_libmp4v2_search_libs="$withval" { $as_echo "$as_me:$LINENO: Will search for libmp4v2 libs in $withval" >&5 $as_echo "$as_me: Will search for libmp4v2 libs in $withval" >&6;} fi if test "$mt_libmp4v2_search_libs" ; then unset ac_cv_lib_mp4v2_MP4Read LDFLAGS="$LDFLAGS -L$mt_libmp4v2_search_libs" { $as_echo "$as_me:$LINENO: checking for MP4Read in -lmp4v2" >&5 $as_echo_n "checking for MP4Read in -lmp4v2... " >&6; } if test "${ac_cv_lib_mp4v2_MP4Read+set}" = set; then $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lmp4v2 $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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char MP4Read (); int main () { return MP4Read (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_lib_mp4v2_MP4Read=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_mp4v2_MP4Read=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_mp4v2_MP4Read" >&5 $as_echo "$ac_cv_lib_mp4v2_MP4Read" >&6; } if test "x$ac_cv_lib_mp4v2_MP4Read" = x""yes; then mt_libmp4v2_libs="-lmp4v2" mt_libmp4v2_ldflags="-L$mt_libmp4v2_search_libs" else mt_libmp4v2_library_status=missing if test "" = "pass"; then { $as_echo "$as_me:$LINENO: libmp4v2 library not found in requested location $mt_libmp4v2_search_libs" >&5 $as_echo "$as_me: libmp4v2 library not found in requested location $mt_libmp4v2_search_libs" >&6;} else { { $as_echo "$as_me:$LINENO: error: libmp4v2 library not found in requested location $mt_libmp4v2_search_libs" >&5 $as_echo "$as_me: error: libmp4v2 library not found in requested location $mt_libmp4v2_search_libs" >&2;} { (exit 1); exit 1; }; } fi fi else unset ac_cv_lib_mp4v2_MP4Read { $as_echo "$as_me:$LINENO: checking for MP4Read in -lmp4v2" >&5 $as_echo_n "checking for MP4Read in -lmp4v2... " >&6; } if test "${ac_cv_lib_mp4v2_MP4Read+set}" = set; then $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lmp4v2 $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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char MP4Read (); int main () { return MP4Read (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_lib_mp4v2_MP4Read=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_mp4v2_MP4Read=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_mp4v2_MP4Read" >&5 $as_echo "$ac_cv_lib_mp4v2_MP4Read" >&6; } if test "x$ac_cv_lib_mp4v2_MP4Read" = x""yes; then mt_libmp4v2_libs="-lmp4v2" else LDFLAGS="$LDFLAGS -L$MT_SEARCHPATH_LIBS" unset ac_cv_lib_mp4v2_MP4Read { $as_echo "$as_me:$LINENO: checking for MP4Read in -lmp4v2" >&5 $as_echo_n "checking for MP4Read in -lmp4v2... " >&6; } if test "${ac_cv_lib_mp4v2_MP4Read+set}" = set; then $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lmp4v2 $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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char MP4Read (); int main () { return MP4Read (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_lib_mp4v2_MP4Read=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_mp4v2_MP4Read=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_mp4v2_MP4Read" >&5 $as_echo "$ac_cv_lib_mp4v2_MP4Read" >&6; } if test "x$ac_cv_lib_mp4v2_MP4Read" = x""yes; then mt_libmp4v2_libs="-lmp4v2" mt_libmp4v2_ldflags="-L$MT_SEARCHPATH_LIBS" else mt_libmp4v2_library_status=missing fi fi fi if test "x$mt_libmp4v2_library_status" != xyes; then mt_libmp4v2_libs="" mt_libmp4v2_ldflags="" fi LIBS=$LIBS_SAVE LDFLAGS=$LDFLAGS_SAVE CFLAGS=$CFLAGS_SAVE CXXFLAGS=$CXXFLAGS_SAVE CPPFLAGS=$CPPFLAGS_SAVE mt_libmp4v2_package_status=${mt_libmp4v2_library_status} fi if test "x$mt_libmp4v2_package_status" = xyes; then LIBMP4V2_CFLAGS=${mt_libmp4v2_cxxflags} LIBMP4V2_LIBS=${mt_libmp4v2_libs} LIBMP4V2_LDFLAGS=${mt_libmp4v2_ldflags} fi mt_libmp4v2_status=${mt_libmp4v2_package_status} else mt_libmp4v2_status=disabled fi if ((test "x${LIBMP4V2_OPTION_ENABLED}" = xyes) && (test "x${LIBMP4V2_OPTION_REQUESTED}" = xyes) && (test "x$mt_libmp4v2_status" != xyes) && (test "" != "pass")); then { { $as_echo "$as_me:$LINENO: error: unable to configure libmp4v2 support" >&5 $as_echo "$as_me: error: unable to configure libmp4v2 support" >&2;} { (exit 1); exit 1; }; } fi if test "x$mt_libmp4v2_status" = xyes; then cat >>confdefs.h <<\_ACEOF #define HAVE_LIBMP4V2 1 _ACEOF fi LIBMP4V2_STATUS=${mt_libmp4v2_status} if test "x$LIBMP4V2_STATUS" = xyes; then CFLAGS="$CFLAGS $LIBMP4V2_CFLAGS" CXXFLAGS="$CXXFLAGS $LIBMP4V2_CFLAGS" LDFLAGS="$LDFLAGS $LIBMP4V2_LDFLAGS $LIBMP4V2_LIBS" cat >>confdefs.h <<_ACEOF #define LIBMP4V2_INCLUDE <$MP4_HEADER.h> _ACEOF ac_ext=cpp 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 { $as_echo "$as_me:$LINENO: checking for MP4GetMetadataCoverArtCount() in libmp4v2" >&5 $as_echo_n "checking for MP4GetMetadataCoverArtCount() in libmp4v2... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$MP4_HEADER.h> int main () { (void)MP4GetMetadataCoverArtCount(0); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then { $as_echo "$as_me:$LINENO: result: yes" >&5 $as_echo "yes" >&6; } cat >>confdefs.h <<\_ACEOF #define HAVE_MP4_GET_METADATA_COVER_ART_COUNT 1 _ACEOF else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:$LINENO: checking for MP4GetTrackAudioChannels() in libmp4v2" >&5 $as_echo_n "checking for MP4GetTrackAudioChannels() in libmp4v2... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$MP4_HEADER.h> int main () { (void)MP4GetTrackAudioChannels(0, 0); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then { $as_echo "$as_me:$LINENO: result: yes" >&5 $as_echo "yes" >&6; } cat >>confdefs.h <<\_ACEOF #define HAVE_MP4_GET_TRACK_AUDIO_CHANNELS 1 _ACEOF else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_ext=cpp 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 ########## INOTIFY TOOLS mt_inotify_option_enabled= mt_inotify_option_requested=no if test "xdisable" = xdisable; then mt_inotify_option_enabled=yes else mt_inotify_option_enabled=no fi # Check whether --enable-inotify was given. if test "${enable_inotify+set}" = set; then enableval=$enable_inotify; mt_inotify_option_enabled=$enableval mt_inotify_option_requested=yes fi INOTIFY_OPTION_ENABLED=${mt_inotify_option_enabled} INOTIFY_OPTION_REQUESTED=${mt_inotify_option_requested} if test "x${mt_inotify_option_enabled}" = xyes; then : else INOTIFY_STATUS=disabled fi if test "x$INOTIFY_OPTION_ENABLED" = xyes; then LIBS_SAVE=$LIBS LDFLAGS_SAVE=$LDFLAGS CFLAGS_SAVE=$CFLAGS CXXFLAGS_SAVE=$CXXFLAGS CPPFLAGS_SAVE=$CPPFLAGS mt_inotify_header_status=yes # Check whether --with-inotify-h was given. if test "${with_inotify_h+set}" = set; then withval=$with_inotify_h; mt_inotify_search_headers="$withval" { $as_echo "$as_me:$LINENO: Will search for inotify headers in $withval" >&5 $as_echo "$as_me: Will search for inotify headers in $withval" >&6;} fi if test "$mt_inotify_search_headers" ; then unset ac_cv_header_sys_inotify_h CFLAGS="$CFLAGS -I${mt_inotify_search_headers}" CXXFLAGS="$CXXFLAGS -I${mt_inotify_search_headers}" CPPFLAGS="$CPPFLAGS -I${mt_inotify_search_headers}" as_ac_Header=`$as_echo "ac_cv_header_$mt_inotify_search_headers/sys/inotify.h" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { $as_echo "$as_me:$LINENO: checking for $mt_inotify_search_headers/sys/inotify.h" >&5 $as_echo_n "checking for $mt_inotify_search_headers/sys/inotify.h... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:$LINENO: checking $mt_inotify_search_headers/sys/inotify.h usability" >&5 $as_echo_n "checking $mt_inotify_search_headers/sys/inotify.h usability... " >&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 <$mt_inotify_search_headers/sys/inotify.h> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:$LINENO: checking $mt_inotify_search_headers/sys/inotify.h presence" >&5 $as_echo_n "checking $mt_inotify_search_headers/sys/inotify.h presence... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$mt_inotify_search_headers/sys/inotify.h> _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&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 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else $as_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 { $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in yes:no: ) { $as_echo "$as_me:$LINENO: WARNING: $mt_inotify_search_headers/sys/inotify.h: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $mt_inotify_search_headers/sys/inotify.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $mt_inotify_search_headers/sys/inotify.h: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $mt_inotify_search_headers/sys/inotify.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { $as_echo "$as_me:$LINENO: WARNING: $mt_inotify_search_headers/sys/inotify.h: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $mt_inotify_search_headers/sys/inotify.h: present but cannot be compiled" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $mt_inotify_search_headers/sys/inotify.h: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $mt_inotify_search_headers/sys/inotify.h: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $mt_inotify_search_headers/sys/inotify.h: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $mt_inotify_search_headers/sys/inotify.h: see the Autoconf documentation" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $mt_inotify_search_headers/sys/inotify.h: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $mt_inotify_search_headers/sys/inotify.h: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $mt_inotify_search_headers/sys/inotify.h: proceeding with the preprocessor's result" >&5 $as_echo "$as_me: WARNING: $mt_inotify_search_headers/sys/inotify.h: proceeding with the preprocessor's result" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $mt_inotify_search_headers/sys/inotify.h: in the future, the compiler will take precedence" >&5 $as_echo "$as_me: WARNING: $mt_inotify_search_headers/sys/inotify.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------- ## ## Report this to jin@mediatomb.cc ## ## ------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { $as_echo "$as_me:$LINENO: checking for $mt_inotify_search_headers/sys/inotify.h" >&5 $as_echo_n "checking for $mt_inotify_search_headers/sys/inotify.h... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi as_val=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` if test "x$as_val" = x""yes; then mt_inotify_cxxflags="-I${mt_inotify_search_headers}" else mt_inotify_header_status=missing if test "" = "pass"; then { $as_echo "$as_me:$LINENO: inotify headers not found in requested location $mt_inotify_search_headers" >&5 $as_echo "$as_me: inotify headers not found in requested location $mt_inotify_search_headers" >&6;} else { { $as_echo "$as_me:$LINENO: error: inotify headers not found in requested location $mt_inotify_search_headers" >&5 $as_echo "$as_me: error: inotify headers not found in requested location $mt_inotify_search_headers" >&2;} { (exit 1); exit 1; }; } fi fi else unset ac_cv_header_sys_inotify_h if test "${ac_cv_header_sys_inotify_h+set}" = set; then { $as_echo "$as_me:$LINENO: checking for sys/inotify.h" >&5 $as_echo_n "checking for sys/inotify.h... " >&6; } if test "${ac_cv_header_sys_inotify_h+set}" = set; then $as_echo_n "(cached) " >&6 fi { $as_echo "$as_me:$LINENO: result: $ac_cv_header_sys_inotify_h" >&5 $as_echo "$ac_cv_header_sys_inotify_h" >&6; } else # Is the header compilable? { $as_echo "$as_me:$LINENO: checking sys/inotify.h usability" >&5 $as_echo_n "checking sys/inotify.h usability... " >&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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:$LINENO: checking sys/inotify.h presence" >&5 $as_echo_n "checking sys/inotify.h presence... " >&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 { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&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 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else $as_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 { $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in yes:no: ) { $as_echo "$as_me:$LINENO: WARNING: sys/inotify.h: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: sys/inotify.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:$LINENO: WARNING: sys/inotify.h: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: sys/inotify.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { $as_echo "$as_me:$LINENO: WARNING: sys/inotify.h: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: sys/inotify.h: present but cannot be compiled" >&2;} { $as_echo "$as_me:$LINENO: WARNING: sys/inotify.h: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: sys/inotify.h: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:$LINENO: WARNING: sys/inotify.h: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: sys/inotify.h: see the Autoconf documentation" >&2;} { $as_echo "$as_me:$LINENO: WARNING: sys/inotify.h: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: sys/inotify.h: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:$LINENO: WARNING: sys/inotify.h: proceeding with the preprocessor's result" >&5 $as_echo "$as_me: WARNING: sys/inotify.h: proceeding with the preprocessor's result" >&2;} { $as_echo "$as_me:$LINENO: WARNING: sys/inotify.h: in the future, the compiler will take precedence" >&5 $as_echo "$as_me: WARNING: sys/inotify.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------- ## ## Report this to jin@mediatomb.cc ## ## ------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { $as_echo "$as_me:$LINENO: checking for sys/inotify.h" >&5 $as_echo_n "checking for sys/inotify.h... " >&6; } if test "${ac_cv_header_sys_inotify_h+set}" = set; then $as_echo_n "(cached) " >&6 else ac_cv_header_sys_inotify_h=$ac_header_preproc fi { $as_echo "$as_me:$LINENO: result: $ac_cv_header_sys_inotify_h" >&5 $as_echo "$ac_cv_header_sys_inotify_h" >&6; } fi if test "x$ac_cv_header_sys_inotify_h" = x""yes; then : else CFLAGS="$CFLAGS -I$MT_SEARCHPATH_HEADERS" CXXFLAGS="$CXXFLAGS -I$MT_SEARCHPATH_HEADERS" CPPFLAGS="$CPPFLAGS -I$MT_SEARCHPATH_HEADERS" unset ac_cv_header_sys_inotify_h as_ac_Header=`$as_echo "ac_cv_header_$MT_SEARCHPATH_HEADERS/sys/inotify.h" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { $as_echo "$as_me:$LINENO: checking for $MT_SEARCHPATH_HEADERS/sys/inotify.h" >&5 $as_echo_n "checking for $MT_SEARCHPATH_HEADERS/sys/inotify.h... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:$LINENO: checking $MT_SEARCHPATH_HEADERS/sys/inotify.h usability" >&5 $as_echo_n "checking $MT_SEARCHPATH_HEADERS/sys/inotify.h usability... " >&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 <$MT_SEARCHPATH_HEADERS/sys/inotify.h> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:$LINENO: checking $MT_SEARCHPATH_HEADERS/sys/inotify.h presence" >&5 $as_echo_n "checking $MT_SEARCHPATH_HEADERS/sys/inotify.h presence... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$MT_SEARCHPATH_HEADERS/sys/inotify.h> _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&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 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else $as_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 { $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in yes:no: ) { $as_echo "$as_me:$LINENO: WARNING: $MT_SEARCHPATH_HEADERS/sys/inotify.h: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $MT_SEARCHPATH_HEADERS/sys/inotify.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $MT_SEARCHPATH_HEADERS/sys/inotify.h: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $MT_SEARCHPATH_HEADERS/sys/inotify.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { $as_echo "$as_me:$LINENO: WARNING: $MT_SEARCHPATH_HEADERS/sys/inotify.h: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $MT_SEARCHPATH_HEADERS/sys/inotify.h: present but cannot be compiled" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $MT_SEARCHPATH_HEADERS/sys/inotify.h: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $MT_SEARCHPATH_HEADERS/sys/inotify.h: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $MT_SEARCHPATH_HEADERS/sys/inotify.h: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $MT_SEARCHPATH_HEADERS/sys/inotify.h: see the Autoconf documentation" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $MT_SEARCHPATH_HEADERS/sys/inotify.h: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $MT_SEARCHPATH_HEADERS/sys/inotify.h: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $MT_SEARCHPATH_HEADERS/sys/inotify.h: proceeding with the preprocessor's result" >&5 $as_echo "$as_me: WARNING: $MT_SEARCHPATH_HEADERS/sys/inotify.h: proceeding with the preprocessor's result" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $MT_SEARCHPATH_HEADERS/sys/inotify.h: in the future, the compiler will take precedence" >&5 $as_echo "$as_me: WARNING: $MT_SEARCHPATH_HEADERS/sys/inotify.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------- ## ## Report this to jin@mediatomb.cc ## ## ------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { $as_echo "$as_me:$LINENO: checking for $MT_SEARCHPATH_HEADERS/sys/inotify.h" >&5 $as_echo_n "checking for $MT_SEARCHPATH_HEADERS/sys/inotify.h... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi as_val=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` if test "x$as_val" = x""yes; then mt_inotify_cxxflags="-I${MT_SEARCHPATH_HEADERS}" else mt_inotify_header_status=missing fi fi fi if test "x$mt_inotify_header_status" != xyes; then mt_inotify_cxxflags="" fi LIBS=$LIBS_SAVE LDFLAGS=$LDFLAGS_SAVE CFLAGS=$CFLAGS_SAVE CXXFLAGS=$CXXFLAGS_SAVE CPPFLAGS=$CPPFLAGS_SAVE INOTIFY_CFLAGS=${mt_inotify_cxxflags} INOTIFY_STATUS=${mt_inotify_header_status} fi if test "x$INOTIFY_STATUS" = xyes; then for ac_func in inotify_init do as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` { $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 $as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $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 #endif int main () { return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then eval "$as_ac_var=yes" else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval 'as_val=${'$as_ac_var'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } as_val=`eval 'as_val=${'$as_ac_var'} $as_echo "$as_val"'` if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF else INOTIFY_STATUS=missing fi done fi if test "x$INOTIFY_STATUS" = xyes; then CXXFLAGS="$CXXFLAGS $INOTIFY_CFLAGS" CFLAGS="$CFLAGS $INOTIFY_CFLAGS" { $as_echo "$as_me:$LINENO: checking whether sys/inotify.h works" >&5 $as_echo_n "checking whether sys/inotify.h works... " >&6; } if test "$cross_compiling" = yes; then if ((test "x$INOTIFY_OPTION_REQUESTED" = xyes) && (test "x$INOTIFY_OPTION_ENABLED" = xyes)); then { $as_echo "$as_me:$LINENO: result: selecting yes for cross compiling" >&5 $as_echo "selecting yes for cross compiling" >&6; } INOTIFY_STATUS=yes else { $as_echo "$as_me:$LINENO: result: selecting no for cross compiling" >&5 $as_echo "selecting no for cross compiling" >&6; } INOTIFY_STATUS=no fi 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 () { return (-1 == inotify_init()); ; return 0; } _ACEOF rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then { $as_echo "$as_me:$LINENO: result: yes" >&5 $as_echo "yes" >&6; }; cat >>confdefs.h <<\_ACEOF #define SYS_INOTIFY_H_OK 1 _ACEOF else $as_echo "$as_me: program exited with status $ac_status" >&5 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) { $as_echo "$as_me:$LINENO: result: no, using own inotify headers" >&5 $as_echo "no, using own inotify headers" >&6; } { $as_echo "$as_me:$LINENO: checking whether inotify-nosys.h works on this system" >&5 $as_echo_n "checking whether inotify-nosys.h works on this system... " >&6; } if test "$cross_compiling" = yes; then if ((test "x$INOTIFY_OPTION_REQUESTED" = xyes) && (test "x$INOTIFY_OPTION_ENABLED" = xyes)); then { $as_echo "$as_me:$LINENO: result: selecting yes for cross compiling" >&5 $as_echo "selecting yes for cross compiling" >&6; } INOTIFY_STATUS=yes else { $as_echo "$as_me:$LINENO: result: selecting no for cross compiling" >&5 $as_echo "selecting no for cross compiling" >&6; } INOTIFY_STATUS=no fi else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include "src/inotify-nosys.h" int main () { return (-1 == inotify_init()); ; return 0; } _ACEOF rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then { $as_echo "$as_me:$LINENO: result: yes" >&5 $as_echo "yes" >&6; }; else $as_echo "$as_me: program exited with status $ac_status" >&5 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) if ((test "x$INOTIFY_OPTION_REQUESTED" != xyes) && (test "x$INOTIFY_OPTION_ENABLED" = xyes)); then { $as_echo "$as_me:$LINENO: result: no, disabling inotify support" >&5 $as_echo "no, disabling inotify support" >&6; } elif ((test "x$INOTIFY_OPTION_REQUESTED" != xyes) && (test "x$INOTIFY_OPTION_ENABLED" != xyes)); then { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi INOTIFY_STATUS=no fi rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi if test "x$INOTIFY_STATUS" = xyes; then cat >>confdefs.h <<\_ACEOF #define HAVE_INOTIFY 1 _ACEOF else if ((test "x$INOTIFY_OPTION_REQUESTED" = xyes) && (test "x$INOTIFY_OPTION_ENABLED" = xyes)); then { $as_echo "$as_me:$LINENO: enabling runtime inotify detection" >&5 $as_echo "$as_me: enabling runtime inotify detection" >&6;} # if system inotify header exists, go with it, otherwise take our own if test "x$ac_cv_header_sys_inotify_h" = xyes; then cat >>confdefs.h <<\_ACEOF #define SYS_INOTIFY_H_OK 1 _ACEOF fi cat >>confdefs.h <<\_ACEOF #define HAVE_INOTIFY 1 _ACEOF INOTIFY_STATUS=yes fi fi LDFLAGS="$LDFLAGS_SAVE" CPPFLAGS="$CPPFLAGS_SAVE" CXXFLAGS="$CXXFLAGS_SAVE" cat >>confdefs.h <<\_ACEOF #define __STDC_CONSTANT_MACROS 1 _ACEOF cat >>confdefs.h <<\_ACEOF #define __STDC_LIMIT_MACROS 1 _ACEOF #MT_CHECK_OPTIONAL_PACKAGE_CFG([libdvdnav], [enable], # [compile with libdvdnav support for extended DVD image parsing], # [dvdnav-config], # [dvdnav/dvdnav.h], [dvdnav], [dvdnav_get_audio_attr], []) # mt_tombdebug_option_enabled= mt_tombdebug_option_requested=no if test "xenable" = xdisable; then mt_tombdebug_option_enabled=yes else mt_tombdebug_option_enabled=no fi # Check whether --enable-tombdebug was given. if test "${enable_tombdebug+set}" = set; then enableval=$enable_tombdebug; mt_tombdebug_option_enabled=$enableval mt_tombdebug_option_requested=yes fi TOMBDEBUG_OPTION_ENABLED=${mt_tombdebug_option_enabled} TOMBDEBUG_OPTION_REQUESTED=${mt_tombdebug_option_requested} if test "x${mt_tombdebug_option_enabled}" = xyes; then cat >>confdefs.h <<\_ACEOF #define TOMBDEBUG 1 _ACEOF fi mt_upnpdebug_option_enabled= mt_upnpdebug_option_requested=no if test "xenable" = xdisable; then mt_upnpdebug_option_enabled=yes else mt_upnpdebug_option_enabled=no fi # Check whether --enable-upnpdebug was given. if test "${enable_upnpdebug+set}" = set; then enableval=$enable_upnpdebug; mt_upnpdebug_option_enabled=$enableval mt_upnpdebug_option_requested=yes fi UPNPDEBUG_OPTION_ENABLED=${mt_upnpdebug_option_enabled} UPNPDEBUG_OPTION_REQUESTED=${mt_upnpdebug_option_requested} if test "x${mt_upnpdebug_option_enabled}" = xyes; then cat >>confdefs.h <<\_ACEOF #define UPNP_HAVE_DEBUG 1 _ACEOF cat >>confdefs.h <<\_ACEOF #define DEBUG 1 _ACEOF fi if (test "x$TOMBDEBUG_OPTION_ENABLED" != xyes) && (test "x$UPNPDEBUG_OPTION_ENABLED" != xyes); then cat >>confdefs.h <<\_ACEOF #define NDEBUG 1 _ACEOF fi mt_log_option_enabled= mt_log_option_requested=no if test "xdisable" = xdisable; then mt_log_option_enabled=yes else mt_log_option_enabled=no fi # Check whether --enable-log was given. if test "${enable_log+set}" = set; then enableval=$enable_log; mt_log_option_enabled=$enableval mt_log_option_requested=yes fi LOG_OPTION_ENABLED=${mt_log_option_enabled} LOG_OPTION_REQUESTED=${mt_log_option_requested} if test "x${mt_log_option_enabled}" = xyes; then cat >>confdefs.h <<\_ACEOF #define LOG_ENABLED 1 _ACEOF fi mt_debug_log_option_enabled= mt_debug_log_option_requested=no if test "xdisable" = xdisable; then mt_debug_log_option_enabled=yes else mt_debug_log_option_enabled=no fi # Check whether --enable-debug-log was given. if test "${enable_debug_log+set}" = set; then enableval=$enable_debug_log; mt_debug_log_option_enabled=$enableval mt_debug_log_option_requested=yes fi DEBUG_LOG_OPTION_ENABLED=${mt_debug_log_option_enabled} DEBUG_LOG_OPTION_REQUESTED=${mt_debug_log_option_requested} if test "x${mt_debug_log_option_enabled}" = xyes; then cat >>confdefs.h <<\_ACEOF #define DEBUG_LOG_ENABLED 1 _ACEOF fi eval PACKAGE_DATADIR="${datadir}/${PACKAGE}" eval PACKAGE_DATADIR="${PACKAGE_DATADIR}" cat >>confdefs.h <<_ACEOF #define PACKAGE_DATADIR "$PACKAGE_DATADIR" _ACEOF if (test "x$YOUTUBE_OPTION_ENABLED" = xyes) || (test "x$WEBORAMA_OPTION_ENABLED" = xyes) || (test "x$ATRAILERS_OPTION_ENABLED" = xyes) || (test "x$SOPCAST_OPTION_ENABLED" = xyes); then cat >>confdefs.h <<\_ACEOF #define ONLINE_SERVICES 1 _ACEOF fi if (test "x$YOUTUBE_OPTION_ENABLED" = xyes); then cat >>confdefs.h <<\_ACEOF #define YOUTUBE 1 _ACEOF fi if (test "x$WEBORAMA_OPTION_ENABLED" = xyes); then cat >>confdefs.h <<\_ACEOF #define WEBORAMA 1 _ACEOF fi if (test "x$ATRAILERS_OPTION_ENABLED" = xyes); then cat >>confdefs.h <<\_ACEOF #define ATRAILERS 1 _ACEOF fi if (test "x$SOPCAST_OPTION_ENABLED" = xyes); then cat >>confdefs.h <<\_ACEOF #define SOPCAST 1 _ACEOF fi cat >>confdefs.h <<_ACEOF #define COMPILE_INFO "\thost:\t\t\t$host\n\tsqlite3:\t\t$SQLITE3_STATUS\n\tmysql:\t\t\t$MYSQL_STATUS\n\tlibjs:\t\t\t$JS_OK\n\tlibmagic:\t\t$LIBMAGIC_STATUS\n\tinotify:\t\t$INOTIFY_STATUS\n\tlibexif:\t\t$LIBEXIF_STATUS\n\tid3lib:\t\t\t$ID3LIB_STATUS\n\ttaglib:\t\t\t$TAGLIB_STATUS\n\tffmpeg\t\t\t$FFMPEG_STATUS\n\tlibmp4v2:\t\t$LIBMP4V2_STATUS\n\texternal transcoding:\t$EXTERNAL_TRANSCODING_OPTION_ENABLED\n\tcurl:\t\t\t$CURL_OK\n\tYouTube:\t\t$YOUTUBE_OPTION_ENABLED\n\tlibextractor\t\t$LIBEXTRACTOR_STATUS\n\tdb-autocreate:\t\t$DB_AUTOCREATE_OPTION_ENABLED\n\tdebug log:\t\t$DEBUG_LOG_OPTION_ENABLED\n\tprotocol info extension:$PROTOCOLINFO_EXTENSION_OPTION_ENABLED\n\tffmpegthumbnailer:\t$FFMPEGTHUMBNAILER_STATUS\n\tlastfmlib:\t\t$LASTFMLIB_STATUS\n\tdata directory:\t\t$PACKAGE_DATADIR" _ACEOF ############### ac_config_files="$ac_config_files Makefile build/Makefile doc/Makefile scripts/Makefile scripts/js/Makefile scripts/mediatomb-service-optware tombupnp/Makefile tombupnp/build/Makefile web/Makefile config/Makefile artwork/Makefile mediatomb.spec" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, we kill variables containing newlines. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. ( for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:$LINENO: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) $as_unset $ac_var ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes (double-quote # substitution turns \\\\ into \\, and sed turns \\ into \). sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then test "x$cache_file" != "x/dev/null" && { $as_echo "$as_me:$LINENO: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} cat confcache >$cache_file else { $as_echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' DEFS=-DHAVE_CONFIG_H ac_libobjs= ac_ltlibobjs= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' ac_i=`$as_echo "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext" ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs if test -n "$EXEEXT"; then am__EXEEXT_TRUE= am__EXEEXT_FALSE='#' else am__EXEEXT_TRUE='#' am__EXEEXT_FALSE= fi if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then { { $as_echo "$as_me:$LINENO: error: conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." >&5 $as_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__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then { { $as_echo "$as_me:$LINENO: error: conditional \"am__fastdepCXX\" was never defined. Usually this means the macro was only invoked conditionally." >&5 $as_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 "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then { { $as_echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." >&5 $as_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 : ${CONFIG_STATUS=./config.status} ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { $as_echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 $as_echo "$as_me: creating $CONFIG_STATUS" >&6;} cat >$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac fi # PATH needs CR # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo if (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 { (exit 1); exit 1; } fi # Work around bugs in pre-3.0 UWIN ksh. for as_var in ENV MAIL MAILPATH do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi # Name of the executable. as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # CDPATH. $as_unset CDPATH as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { # 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 after each line using $LINENO; the second 'sed' # does the real work. The second script uses 'N' to pair each # line-number line with the line containing $LINENO, 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 # scripts with optimization help from Paolo Bonzini. Blame Lee # E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (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 sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in -n*) case `echo 'x\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. *) ECHO_C='\c';; esac;; *) ECHO_N='-n';; esac if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 # Save the log message, to keep $[0] and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by MediaTomb $as_me 0.12.1, which was generated by GNU Autoconf 2.63. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ on `(hostname || uname -n) 2>/dev/null | sed 1q` " _ACEOF case $ac_config_files in *" "*) set x $ac_config_files; shift; ac_config_files=$*;; esac case $ac_config_headers in *" "*) set x $ac_config_headers; shift; ac_config_headers=$*;; esac cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # Files that config.status was made for. config_files="$ac_config_files" config_headers="$ac_config_headers" config_commands="$ac_config_commands" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ \`$as_me' instantiates files from templates according to the current configuration. Usage: $0 [OPTION]... [FILE]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit -q, --quiet, --silent do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE --header=FILE[:TEMPLATE] instantiate the configuration header FILE Configuration files: $config_files Configuration headers: $config_headers Configuration commands: $config_commands Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_version="\\ MediaTomb config.status 0.12.1 configured by $0, generated by GNU Autoconf 2.63, with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" Copyright (C) 2008 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' INSTALL='$INSTALL' MKDIR_P='$MKDIR_P' AWK='$AWK' test -n "\$AWK" || AWK=awk _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # The default lists apply if the user does not specify any file. ac_need_defaults=: while test $# != 0 do case $1 in --*=*) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; esac case $ac_option in # Handling of the options. -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) $as_echo "$ac_cs_version"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; esac CONFIG_FILES="$CONFIG_FILES '$ac_optarg'" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; esac CONFIG_HEADERS="$CONFIG_HEADERS '$ac_optarg'" ac_need_defaults=false;; --he | --h) # Conflict between --help and --header { $as_echo "$as_me: error: ambiguous option: $1 Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; };; --help | --hel | -h ) $as_echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) { $as_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" ac_need_defaults=false ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' export CONFIG_SHELL exec "\$@" fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX $as_echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # # INIT-COMMANDS # AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "autoconfig.h") CONFIG_HEADERS="$CONFIG_HEADERS autoconfig.h" ;; "tombupnp/upnp/inc/upnpconfig.h") CONFIG_HEADERS="$CONFIG_HEADERS tombupnp/upnp/inc/upnpconfig.h" ;; "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "build/Makefile") CONFIG_FILES="$CONFIG_FILES build/Makefile" ;; "doc/Makefile") CONFIG_FILES="$CONFIG_FILES doc/Makefile" ;; "scripts/Makefile") CONFIG_FILES="$CONFIG_FILES scripts/Makefile" ;; "scripts/js/Makefile") CONFIG_FILES="$CONFIG_FILES scripts/js/Makefile" ;; "scripts/mediatomb-service-optware") CONFIG_FILES="$CONFIG_FILES scripts/mediatomb-service-optware" ;; "tombupnp/Makefile") CONFIG_FILES="$CONFIG_FILES tombupnp/Makefile" ;; "tombupnp/build/Makefile") CONFIG_FILES="$CONFIG_FILES tombupnp/build/Makefile" ;; "web/Makefile") CONFIG_FILES="$CONFIG_FILES web/Makefile" ;; "config/Makefile") CONFIG_FILES="$CONFIG_FILES config/Makefile" ;; "artwork/Makefile") CONFIG_FILES="$CONFIG_FILES artwork/Makefile" ;; "mediatomb.spec") CONFIG_FILES="$CONFIG_FILES mediatomb.spec" ;; *) { { $as_echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 $as_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 against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= trap 'exit_status=$? { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$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 "./confXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || { $as_echo "$as_me: cannot create a temporary directory in ." >&2 { (exit 1); exit 1; } } # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. # This happens for instance with `./config.status config.h'. if test -n "$CONFIG_FILES"; then ac_cr=' ' ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then ac_cs_awk_cr='\\r' else ac_cs_awk_cr=$ac_cr fi echo 'BEGIN {' >"$tmp/subs1.awk" && _ACEOF { echo "cat >conf$$subs.awk <<_ACEOF" && echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && echo "_ACEOF" } >conf$$subs.sh || { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 $as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} { (exit 1); exit 1; }; } ac_delim_num=`echo "$ac_subst_vars" | grep -c '$'` ac_delim='%!_!# ' for ac_last_try in false false false false false :; do . ./conf$$subs.sh || { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 $as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} { (exit 1); exit 1; }; } ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` if test $ac_delim_n = $ac_delim_num; then break elif $ac_last_try; then { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 $as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} { (exit 1); exit 1; }; } else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done rm -f conf$$subs.sh cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 cat >>"\$tmp/subs1.awk" <<\\_ACAWK && _ACEOF sed -n ' h s/^/S["/; s/!.*/"]=/ p g s/^[^!]*!// :repl t repl s/'"$ac_delim"'$// t delim :nl h s/\(.\{148\}\).*/\1/ t more1 s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ p n b repl :more1 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t nl :delim h s/\(.\{148\}\).*/\1/ t more2 s/["\\]/\\&/g; s/^/"/; s/$/"/ p b :more2 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t delim ' >$CONFIG_STATUS || ac_write_fail=1 rm -f conf$$subs.awk cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK cat >>"\$tmp/subs1.awk" <<_ACAWK && for (key in S) S_is_set[key] = 1 FS = "" } { line = $ 0 nfields = split(line, field, "@") substed = 0 len = length(field[1]) for (i = 2; i < nfields; i++) { key = field[i] keylen = length(key) if (S_is_set[key]) { value = S[key] line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) len += length(value) + length(field[++i]) substed = 1 } else len += 1 + keylen } print line } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" else cat fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \ || { { $as_echo "$as_me:$LINENO: error: could not setup config files machinery" >&5 $as_echo "$as_me: error: could not setup config files machinery" >&2;} { (exit 1); exit 1; }; } _ACEOF # 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 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 fi # test -n "$CONFIG_FILES" # Set up the scripts for CONFIG_HEADERS section. # No need to generate them if there are no CONFIG_HEADERS. # This happens for instance with `./config.status Makefile'. if test -n "$CONFIG_HEADERS"; then cat >"$tmp/defines.awk" <<\_ACAWK || BEGIN { _ACEOF # Transform confdefs.h into an awk script `defines.awk', embedded as # here-document in config.status, that substitutes the proper values into # config.h.in to produce config.h. # Create a delimiter string that does not exist in confdefs.h, to ease # handling of long lines. ac_delim='%!_!# ' for ac_last_try in false false :; do ac_t=`sed -n "/$ac_delim/p" confdefs.h` if test -z "$ac_t"; then break elif $ac_last_try; then { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_HEADERS" >&5 $as_echo "$as_me: error: could not make $CONFIG_HEADERS" >&2;} { (exit 1); exit 1; }; } else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done # For the awk script, D is an array of macro values keyed by name, # likewise P contains macro parameters if any. Preserve backslash # newline sequences. ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* sed -n ' s/.\{148\}/&'"$ac_delim"'/g t rset :rset s/^[ ]*#[ ]*define[ ][ ]*/ / t def d :def s/\\$// t bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3"/p s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p d :bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3\\\\\\n"\\/p t cont s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p t cont d :cont n s/.\{148\}/&'"$ac_delim"'/g t clear :clear s/\\$// t bsnlc s/["\\]/\\&/g; s/^/"/; s/$/"/p d :bsnlc s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p b cont ' >$CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 for (key in D) D_is_set[key] = 1 FS = "" } /^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { line = \$ 0 split(line, arg, " ") if (arg[1] == "#") { defundef = arg[2] mac1 = arg[3] } else { defundef = substr(arg[1], 2) mac1 = arg[2] } split(mac1, mac2, "(") #) macro = mac2[1] prefix = substr(line, 1, index(line, defundef) - 1) if (D_is_set[macro]) { # Preserve the white space surrounding the "#". print prefix "define", macro P[macro] D[macro] next } else { # Replace #undef with comments. This is necessary, for example, # in the case of _POSIX_SOURCE, which is predefined and required # on some systems where configure will not decide to define it. if (defundef == "undef") { print "/*", prefix defundef, macro, "*/" next } } } { print } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 { { $as_echo "$as_me:$LINENO: error: could not setup config headers machinery" >&5 $as_echo "$as_me: error: could not setup config headers machinery" >&2;} { (exit 1); exit 1; }; } fi # test -n "$CONFIG_HEADERS" eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS" shift for ac_tag do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) { { $as_echo "$as_me:$LINENO: error: invalid tag $ac_tag" >&5 $as_echo "$as_me: error: invalid tag $ac_tag" >&2;} { (exit 1); exit 1; }; };; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || { { $as_echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5 $as_echo "$as_me: error: cannot find input file: $ac_f" >&2;} { (exit 1); exit 1; }; };; esac case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac ac_file_inputs="$ac_file_inputs '$ac_f'" done # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input='Generated from '` $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { $as_echo "$as_me:$LINENO: creating $ac_file" >&5 $as_echo "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. case $configure_input in #( *\&* | *\|* | *\\* ) ac_sed_conf_input=`$as_echo "$configure_input" | sed 's/[\\\\&|]/\\\\&/g'`;; #( *) ac_sed_conf_input=$configure_input;; esac case $ac_tag in *:-:* | *:-) cat >"$tmp/stdin" \ || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 $as_echo "$as_me: error: could not create $ac_file" >&2;} { (exit 1); exit 1; }; } ;; esac ;; esac ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` { as_dir="$ac_dir" case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || { { $as_echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 $as_echo "$as_me: error: cannot create directory $as_dir" >&2;} { (exit 1); exit 1; }; }; } ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix case $ac_mode in :F) # # CONFIG_FILE # case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; esac ac_MKDIR_P=$MKDIR_P case $MKDIR_P in [\\/$]* | ?:[\\/]* ) ;; */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; esac _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= ac_sed_dataroot=' /datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p ' case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { $as_echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 $as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_datarootdir_hack=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g s&@infodir@&$infodir&g s&@localedir@&$localedir&g s&@mandir@&$mandir&g s&\\\${datarootdir}&$datarootdir&g' ;; esac _ACEOF # Neutralize VPATH when `$srcdir' = `.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_sed_extra="$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s|@configure_input@|$ac_sed_conf_input|;t t s&@top_builddir@&$ac_top_builddir_sub&;t t s&@top_build_prefix@&$ac_top_build_prefix&;t t s&@srcdir@&$ac_srcdir&;t t s&@abs_srcdir@&$ac_abs_srcdir&;t t s&@top_srcdir@&$ac_top_srcdir&;t t s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t s&@builddir@&$ac_builddir&;t t s&@abs_builddir@&$ac_abs_builddir&;t t s&@abs_top_builddir@&$ac_abs_top_builddir&;t t s&@INSTALL@&$ac_INSTALL&;t t s&@MKDIR_P@&$ac_MKDIR_P&;t t $ac_datarootdir_hack " eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$tmp/subs.awk" >$tmp/out \ || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 $as_echo "$as_me: error: could not create $ac_file" >&2;} { (exit 1); exit 1; }; } test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && { $as_echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined." >&5 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined." >&2;} rm -f "$tmp/stdin" case $ac_file in -) cat "$tmp/out" && rm -f "$tmp/out";; *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";; esac \ || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 $as_echo "$as_me: error: could not create $ac_file" >&2;} { (exit 1); exit 1; }; } ;; :H) # # CONFIG_HEADER # if test x"$ac_file" != x-; then { $as_echo "/* $configure_input */" \ && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" } >"$tmp/config.h" \ || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 $as_echo "$as_me: error: could not create $ac_file" >&2;} { (exit 1); exit 1; }; } if diff "$ac_file" "$tmp/config.h" >/dev/null 2>&1; then { $as_echo "$as_me:$LINENO: $ac_file is unchanged" >&5 $as_echo "$as_me: $ac_file is unchanged" >&6;} else rm -f "$ac_file" mv "$tmp/config.h" "$ac_file" \ || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 $as_echo "$as_me: error: could not create $ac_file" >&2;} { (exit 1); exit 1; }; } fi else $as_echo "/* $configure_input */" \ && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" \ || { { $as_echo "$as_me:$LINENO: error: could not create -" >&5 $as_echo "$as_me: error: could not create -" >&2;} { (exit 1); exit 1; }; } fi # Compute "$ac_file"'s index in $config_headers. _am_arg="$ac_file" _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" || $as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$_am_arg" : 'X\(//\)[^/]' \| \ X"$_am_arg" : 'X\(//\)$' \| \ X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$_am_arg" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'`/stamp-h$_am_stamp_count ;; :C) { $as_echo "$as_me:$LINENO: executing $ac_file commands" >&5 $as_echo "$as_me: executing $ac_file commands" >&6;} ;; esac case $ac_file$ac_mode in "depfiles":C) test x"$AMDEP_TRUE" != x"" || { # Autoconf 2.62 quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. case $CONFIG_FILES in *\'*) eval set x "$CONFIG_FILES" ;; *) set x $CONFIG_FILES ;; esac shift for mf do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named `Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then dirpart=`$as_dirname -- "$mf" || $as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$mf" : 'X\(//\)[^/]' \| \ X"$mf" : 'X\(//\)$' \| \ X"$mf" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$mf" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running `make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # 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_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$file" : 'X\(//\)[^/]' \| \ X"$file" : 'X\(//\)$' \| \ X"$file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` { as_dir=$dirpart/$fdir case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || { { $as_echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 $as_echo "$as_me: error: cannot create directory $as_dir" >&2;} { (exit 1); exit 1; }; }; } # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done } ;; esac done # for ac_tag { (exit 0); exit 0; } _ACEOF chmod +x $CONFIG_STATUS ac_clean_files=$ac_clean_files_save test $ac_write_fail = 0 || { { $as_echo "$as_me:$LINENO: error: write failure creating $CONFIG_STATUS" >&5 $as_echo "$as_me: error: write failure creating $CONFIG_STATUS" >&2;} { (exit 1); exit 1; }; } # 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 if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then { $as_echo "$as_me:$LINENO: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi echo echo "CONFIGURATION SUMMARY ----" # disabled echo echo "sqlite3 : $SQLITE3_STATUS" echo "mysql : $MYSQL_STATUS" echo "libjs : $JS_OK" echo "libmagic : $LIBMAGIC_STATUS" echo "inotify : $INOTIFY_STATUS" echo "libexif : $LIBEXIF_STATUS" echo "id3lib : $ID3LIB_STATUS" echo "taglib : $TAGLIB_STATUS" echo "libmp4v2 : $LIBMP4V2_STATUS" echo "ffmpeg : $FFMPEG_STATUS" echo "ffmpegthumbnailer : $FFMPEGTHUMBNAILER_STATUS" echo "lastfmlib : $LASTFMLIB_STATUS" echo "external transcoding : $EXTERNAL_TRANSCODING_OPTION_ENABLED" echo "curl : $CURL_OK" echo "YouTube : $YOUTUBE_OPTION_ENABLED" #echo "Weborama : $WEBORAMA_OPTION_ENABLED" echo "libextractor : $LIBEXTRACTOR_STATUS" echo "db-autocreate : $DB_AUTOCREATE_OPTION_ENABLED" if test "x$TOMBDEBUG_OPTION_ENABLED" = xyes; then echo "debug log : $TOMBDEBUG_OPTION_ENABLED" fi if test "x$UPNPDEBUG_OPTION_ENABLED" = xyes; then echo "upnpdebug : $UPNPDEBUG_OPTION_ENABLED" fi if test "x$STATIC_OPTION_ENABLED" = xyes; then echo "static build : $STATIC_OPTION_ENABLED" fi echo mediatomb-0.12.1/AUTHORS0000664000076400007640000000015511351644367011552 00000000000000Gena Batyan Sergey Bostandzhyan Leonhard Wimmer mediatomb-0.12.1/TODO0000664000076400007640000000001511351644367011165 00000000000000todo... TODO mediatomb-0.12.1/config/0000775000076400007640000000000011357204751012021 500000000000000mediatomb-0.12.1/config/mediatomb-conf-fedora0000664000076400007640000000125611351644366016016 00000000000000## This is a sambel configuration file for the MediaTomb daemon script ## used on Fedora Core ## By default the configuration will be created in /etc/mediatomb ## Network interface on which the server will run, you need to edit this! MT_INTERFACE="NOT_SET" ## User defined command line options that may be passed to the server MT_OPTIONS="" ## MediaTomb will be started on port 50500 MT_PORT="50500" ## MediaTomb will run as mediatomb MT_USER="mediatomb" MT_GROUP="mediatomb" ## Location of the PID file MT_PIDFILE="/var/run/mediatomb.pid" ## Location of the log file MT_LOGFILE="/var/log/mediatomb" ## Location of the config file/database MT_HOME="/etc" MT_CFGDIR="mediatomb" mediatomb-0.12.1/config/mediatomb-default-optware0000664000076400007640000000034711351644366016736 00000000000000# defaults file for the mediatomb daemon mode # start mediatomb daemon mode from init.d script? # allowed values are "true" and "false" MT_ENABLE=false # further mediatomb daemon configuration is done in /opt/etc/mediatomb.conf mediatomb-0.12.1/config/Makefile.am0000664000076400007640000000035111351644366014000 00000000000000_DIST_FILES_CONFIG = \ mappings.xml \ sqlite3.sql \ mysql.sql EXTRA_DIST=mediatomb-conf-fedora \ mediatomb-conf-optware \ mediatomb-default-optware \ config.xsd dist_pkgdata_DATA = $(_DIST_FILES_CONFIG) mediatomb-0.12.1/config/config.xsd0000664000076400007640000006056611352675006013743 00000000000000 mediatomb-0.12.1/config/mediatomb-conf-optware0000664000076400007640000000111211351644366016226 00000000000000## This is a sambel configuration file for the MediaTomb daemon script ## used on Optware ## By default the configuration will be created in /etc/mediatomb ## User defined command line options that may be passed to the server MT_OPTIONS="" ## MediaTomb will be started on port 50500 MT_PORT="50500" ## MediaTomb will run as mediatomb MT_USER="root" MT_GROUP="root" ## Location of the PID file MT_PIDFILE="/opt/var/run/mediatomb.pid" ## Location of the log file MT_LOGFILE="/opt/var/log/mediatomb" ## Location of the config file/database MT_HOME="/opt/etc" MT_CFGDIR="mediatomb" mediatomb-0.12.1/config/Makefile.in0000664000076400007640000004251111357204717014013 00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, # Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = config DIST_COMMON = $(dist_pkgdata_DATA) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in 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) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/autoconfig.h \ $(top_builddir)/tombupnp/upnp/inc/upnpconfig.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__installdirs = "$(DESTDIR)$(pkgdatadir)" DATA = $(dist_pkgdata_DATA) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ ATOMIC_OPTION_ENABLED = @ATOMIC_OPTION_ENABLED@ ATOMIC_OPTION_REQUESTED = @ATOMIC_OPTION_REQUESTED@ ATOMIC_X86_SINGLE_OPTION_ENABLED = @ATOMIC_X86_SINGLE_OPTION_ENABLED@ ATOMIC_X86_SINGLE_OPTION_REQUESTED = @ATOMIC_X86_SINGLE_OPTION_REQUESTED@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AVFORMAT_CFLAGS = @AVFORMAT_CFLAGS@ AVFORMAT_LDFLAGS = @AVFORMAT_LDFLAGS@ AVFORMAT_LIBS = @AVFORMAT_LIBS@ AVFORMAT_STATUS = @AVFORMAT_STATUS@ AVUTIL_LDFLAGS = @AVUTIL_LDFLAGS@ AVUTIL_LIBS = @AVUTIL_LIBS@ AVUTIL_STATUS = @AVUTIL_STATUS@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CURL_CFLAGS = @CURL_CFLAGS@ CURL_LIBS = @CURL_LIBS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DB_AUTOCREATE_OPTION_ENABLED = @DB_AUTOCREATE_OPTION_ENABLED@ DB_AUTOCREATE_OPTION_REQUESTED = @DB_AUTOCREATE_OPTION_REQUESTED@ DEBUG_LOG_OPTION_ENABLED = @DEBUG_LOG_OPTION_ENABLED@ DEBUG_LOG_OPTION_REQUESTED = @DEBUG_LOG_OPTION_REQUESTED@ DEBUG_MALLOC0_OPTION_ENABLED = @DEBUG_MALLOC0_OPTION_ENABLED@ DEBUG_MALLOC0_OPTION_REQUESTED = @DEBUG_MALLOC0_OPTION_REQUESTED@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ EXPAT_CFLAGS = @EXPAT_CFLAGS@ EXPAT_LDFLAGS = @EXPAT_LDFLAGS@ EXPAT_LIBS = @EXPAT_LIBS@ EXPAT_STATUS = @EXPAT_STATUS@ EXTERNAL_TRANSCODING_OPTION_ENABLED = @EXTERNAL_TRANSCODING_OPTION_ENABLED@ EXTERNAL_TRANSCODING_OPTION_REQUESTED = @EXTERNAL_TRANSCODING_OPTION_REQUESTED@ FFMPEGTHUMBNAILER_CFLAGS = @FFMPEGTHUMBNAILER_CFLAGS@ FFMPEGTHUMBNAILER_LDFLAGS = @FFMPEGTHUMBNAILER_LDFLAGS@ FFMPEGTHUMBNAILER_LIBS = @FFMPEGTHUMBNAILER_LIBS@ FFMPEGTHUMBNAILER_OPTION_ENABLED = @FFMPEGTHUMBNAILER_OPTION_ENABLED@ FFMPEGTHUMBNAILER_OPTION_REQUESTED = @FFMPEGTHUMBNAILER_OPTION_REQUESTED@ FFMPEGTHUMBNAILER_STATUS = @FFMPEGTHUMBNAILER_STATUS@ FFMPEG_CFLAGS = @FFMPEG_CFLAGS@ FFMPEG_LDFLAGS = @FFMPEG_LDFLAGS@ FFMPEG_LIBS = @FFMPEG_LIBS@ FFMPEG_OPTION_ENABLED = @FFMPEG_OPTION_ENABLED@ FFMPEG_OPTION_REQUESTED = @FFMPEG_OPTION_REQUESTED@ FSEEKO_CHECK_OPTION_ENABLED = @FSEEKO_CHECK_OPTION_ENABLED@ FSEEKO_CHECK_OPTION_REQUESTED = @FSEEKO_CHECK_OPTION_REQUESTED@ GREP = @GREP@ ICONV_CXXFLAGS = @ICONV_CXXFLAGS@ ICONV_LIBS = @ICONV_LIBS@ ICONV_LIB_OPTION_ENABLED = @ICONV_LIB_OPTION_ENABLED@ ICONV_LIB_OPTION_REQUESTED = @ICONV_LIB_OPTION_REQUESTED@ ID3LIB_CFLAGS = @ID3LIB_CFLAGS@ ID3LIB_LDFLAGS = @ID3LIB_LDFLAGS@ ID3LIB_LIBS = @ID3LIB_LIBS@ ID3LIB_OPTION_ENABLED = @ID3LIB_OPTION_ENABLED@ ID3LIB_OPTION_REQUESTED = @ID3LIB_OPTION_REQUESTED@ ID3LIB_STATUS = @ID3LIB_STATUS@ ID3LIB_VERSION = @ID3LIB_VERSION@ INOTIFY_CFLAGS = @INOTIFY_CFLAGS@ INOTIFY_OPTION_ENABLED = @INOTIFY_OPTION_ENABLED@ INOTIFY_OPTION_REQUESTED = @INOTIFY_OPTION_REQUESTED@ INOTIFY_STATUS = @INOTIFY_STATUS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ JS_CXXFLAGS = @JS_CXXFLAGS@ JS_LIBS = @JS_LIBS@ LASTFMLIB_CFLAGS = @LASTFMLIB_CFLAGS@ LASTFMLIB_LDFLAGS = @LASTFMLIB_LDFLAGS@ LASTFMLIB_LIBS = @LASTFMLIB_LIBS@ LASTFMLIB_OPTION_ENABLED = @LASTFMLIB_OPTION_ENABLED@ LASTFMLIB_OPTION_REQUESTED = @LASTFMLIB_OPTION_REQUESTED@ LASTFMLIB_STATUS = @LASTFMLIB_STATUS@ LDFLAGS = @LDFLAGS@ LIBEXIF_CFLAGS = @LIBEXIF_CFLAGS@ LIBEXIF_LDFLAGS = @LIBEXIF_LDFLAGS@ LIBEXIF_LIBS = @LIBEXIF_LIBS@ LIBEXIF_OPTION_ENABLED = @LIBEXIF_OPTION_ENABLED@ LIBEXIF_OPTION_REQUESTED = @LIBEXIF_OPTION_REQUESTED@ LIBEXIF_STATUS = @LIBEXIF_STATUS@ LIBEXTRACTOR_CFLAGS = @LIBEXTRACTOR_CFLAGS@ LIBEXTRACTOR_LIBS = @LIBEXTRACTOR_LIBS@ LIBEXTRACTOR_OPTION_ENABLED = @LIBEXTRACTOR_OPTION_ENABLED@ LIBEXTRACTOR_OPTION_REQUESTED = @LIBEXTRACTOR_OPTION_REQUESTED@ LIBEXTRACTOR_STATUS = @LIBEXTRACTOR_STATUS@ LIBEXTRACTOR_VERSION = @LIBEXTRACTOR_VERSION@ LIBMAGIC_CFLAGS = @LIBMAGIC_CFLAGS@ LIBMAGIC_LDFLAGS = @LIBMAGIC_LDFLAGS@ LIBMAGIC_LIBS = @LIBMAGIC_LIBS@ LIBMAGIC_OPTION_ENABLED = @LIBMAGIC_OPTION_ENABLED@ LIBMAGIC_OPTION_REQUESTED = @LIBMAGIC_OPTION_REQUESTED@ LIBMAGIC_STATUS = @LIBMAGIC_STATUS@ LIBMAGIC_VERSION = @LIBMAGIC_VERSION@ LIBMP4V2_CFLAGS = @LIBMP4V2_CFLAGS@ LIBMP4V2_LDFLAGS = @LIBMP4V2_LDFLAGS@ LIBMP4V2_LIBS = @LIBMP4V2_LIBS@ LIBMP4V2_OPTION_ENABLED = @LIBMP4V2_OPTION_ENABLED@ LIBMP4V2_OPTION_REQUESTED = @LIBMP4V2_OPTION_REQUESTED@ LIBMP4V2_STATUS = @LIBMP4V2_STATUS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LOG_OPTION_ENABLED = @LOG_OPTION_ENABLED@ LOG_OPTION_REQUESTED = @LOG_OPTION_REQUESTED@ LTLIBOBJS = @LTLIBOBJS@ LWRES_LIBS = @LWRES_LIBS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MRREG_SERVICE_OPTION_ENABLED = @MRREG_SERVICE_OPTION_ENABLED@ MRREG_SERVICE_OPTION_REQUESTED = @MRREG_SERVICE_OPTION_REQUESTED@ MT_SEARCHPATH = @MT_SEARCHPATH@ MT_SEARCHPATH_HEADERS = @MT_SEARCHPATH_HEADERS@ MT_SEARCHPATH_LIBS = @MT_SEARCHPATH_LIBS@ MT_SEARCHPATH_PROGS = @MT_SEARCHPATH_PROGS@ MYSQL_CFLAGS = @MYSQL_CFLAGS@ MYSQL_LIBS = @MYSQL_LIBS@ MYSQL_OPTION_ENABLED = @MYSQL_OPTION_ENABLED@ MYSQL_OPTION_REQUESTED = @MYSQL_OPTION_REQUESTED@ MYSQL_STATUS = @MYSQL_STATUS@ MYSQL_VERSION = @MYSQL_VERSION@ NSL_LIBS = @NSL_LIBS@ 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@ POW_LIB = @POW_LIB@ PROTOCOLINFO_EXTENSION_OPTION_ENABLED = @PROTOCOLINFO_EXTENSION_OPTION_ENABLED@ PROTOCOLINFO_EXTENSION_OPTION_REQUESTED = @PROTOCOLINFO_EXTENSION_OPTION_REQUESTED@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LDFLAGS = @PTHREAD_LDFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ PTHREAD_LIB_OPTION_ENABLED = @PTHREAD_LIB_OPTION_ENABLED@ PTHREAD_LIB_OPTION_REQUESTED = @PTHREAD_LIB_OPTION_REQUESTED@ PTHREAD_STATUS = @PTHREAD_STATUS@ RANLIB = @RANLIB@ RT_LDFLAGS = @RT_LDFLAGS@ RT_LIBS = @RT_LIBS@ RT_STATUS = @RT_STATUS@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SQLITE3_CFLAGS = @SQLITE3_CFLAGS@ SQLITE3_LDFLAGS = @SQLITE3_LDFLAGS@ SQLITE3_LIBS = @SQLITE3_LIBS@ SQLITE3_OPTION_ENABLED = @SQLITE3_OPTION_ENABLED@ SQLITE3_OPTION_REQUESTED = @SQLITE3_OPTION_REQUESTED@ SQLITE3_STATUS = @SQLITE3_STATUS@ SQLITE_BACKUP_DEFAULTS_OPTION_ENABLED = @SQLITE_BACKUP_DEFAULTS_OPTION_ENABLED@ SQLITE_BACKUP_DEFAULTS_OPTION_REQUESTED = @SQLITE_BACKUP_DEFAULTS_OPTION_REQUESTED@ STATIC_OPTION_ENABLED = @STATIC_OPTION_ENABLED@ STATIC_OPTION_REQUESTED = @STATIC_OPTION_REQUESTED@ STRIP = @STRIP@ TAGLIB_CFLAGS = @TAGLIB_CFLAGS@ TAGLIB_LIBS = @TAGLIB_LIBS@ TAGLIB_OPTION_ENABLED = @TAGLIB_OPTION_ENABLED@ TAGLIB_OPTION_REQUESTED = @TAGLIB_OPTION_REQUESTED@ TAGLIB_STATUS = @TAGLIB_STATUS@ TAGLIB_VERSION = @TAGLIB_VERSION@ TOMBDEBUG_OPTION_ENABLED = @TOMBDEBUG_OPTION_ENABLED@ TOMBDEBUG_OPTION_REQUESTED = @TOMBDEBUG_OPTION_REQUESTED@ UPNPDEBUG_OPTION_ENABLED = @UPNPDEBUG_OPTION_ENABLED@ UPNPDEBUG_OPTION_REQUESTED = @UPNPDEBUG_OPTION_REQUESTED@ VERSION = @VERSION@ YOUTUBE_OPTION_ENABLED = @YOUTUBE_OPTION_ENABLED@ YOUTUBE_OPTION_REQUESTED = @YOUTUBE_OPTION_REQUESTED@ ZLIB_CFLAGS = @ZLIB_CFLAGS@ ZLIB_LDFLAGS = @ZLIB_LDFLAGS@ ZLIB_LIBS = @ZLIB_LIBS@ ZLIB_OPTION_ENABLED = @ZLIB_OPTION_ENABLED@ ZLIB_OPTION_REQUESTED = @ZLIB_OPTION_REQUESTED@ ZLIB_STATUS = @ZLIB_STATUS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ acx_pthread_config = @acx_pthread_config@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ curlconfig = @curlconfig@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ mt_mysql_config = @mt_mysql_config@ mt_taglib_config = @mt_taglib_config@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ _DIST_FILES_CONFIG = \ mappings.xml \ sqlite3.sql \ mysql.sql EXTRA_DIST = mediatomb-conf-fedora \ mediatomb-conf-optware \ mediatomb-default-optware \ config.xsd dist_pkgdata_DATA = $(_DIST_FILES_CONFIG) all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu config/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu config/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: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-dist_pkgdataDATA: $(dist_pkgdata_DATA) @$(NORMAL_INSTALL) test -z "$(pkgdatadir)" || $(MKDIR_P) "$(DESTDIR)$(pkgdatadir)" @list='$(dist_pkgdata_DATA)'; test -n "$(pkgdatadir)" || list=; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pkgdatadir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(pkgdatadir)" || exit $$?; \ done uninstall-dist_pkgdataDATA: @$(NORMAL_UNINSTALL) @list='$(dist_pkgdata_DATA)'; test -n "$(pkgdatadir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ test -n "$$files" || exit 0; \ echo " ( cd '$(DESTDIR)$(pkgdatadir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(pkgdatadir)" && rm -f $$files tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(DATA) installdirs: for dir in "$(DESTDIR)$(pkgdatadir)"; 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) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dist_pkgdataDATA install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-dist_pkgdataDATA .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic distclean \ distclean-generic distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am \ install-dist_pkgdataDATA install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic pdf \ pdf-am ps ps-am uninstall uninstall-am \ uninstall-dist_pkgdataDATA # 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: mediatomb-0.12.1/config/mysql.sql0000664000076400007640000000735411351644366013644 00000000000000/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8 */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; CREATE TABLE `mt_cds_object` ( `id` int(11) NOT NULL auto_increment, `ref_id` int(11) default NULL, `parent_id` int(11) NOT NULL default '0', `object_type` tinyint(4) unsigned NOT NULL, `upnp_class` varchar(80) default NULL, `dc_title` varchar(255) default NULL, `location` blob, `location_hash` int(11) unsigned default NULL, `metadata` blob, `auxdata` blob, `resources` blob, `update_id` int(11) NOT NULL default '0', `mime_type` varchar(40) default NULL, `flags` int(11) unsigned NOT NULL default '1', `track_number` int(11) default NULL, `service_id` varchar(255) default NULL, PRIMARY KEY (`id`), KEY `cds_object_ref_id` (`ref_id`), KEY `cds_object_parent_id` (`parent_id`,`object_type`,`dc_title`), KEY `cds_object_object_type` (`object_type`), KEY `location_parent` (`location_hash`,`parent_id`), KEY `cds_object_track_number` (`track_number`), KEY `cds_object_service_id` (`service_id`), CONSTRAINT `mt_cds_object_ibfk_1` FOREIGN KEY (`ref_id`) REFERENCES `mt_cds_object` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `mt_cds_object_ibfk_2` FOREIGN KEY (`parent_id`) REFERENCES `mt_cds_object` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=MyISAM CHARSET=utf8; INSERT INTO `mt_cds_object` VALUES (-1,NULL,-1,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,NULL,9,NULL,NULL); INSERT INTO `mt_cds_object` VALUES (0,NULL,-1,1,'object.container','Root',NULL,NULL,NULL,NULL,NULL,0,NULL,9,NULL,NULL); UPDATE `mt_cds_object` SET `id`='0' WHERE `id`='1'; INSERT INTO `mt_cds_object` VALUES (1,NULL,0,1,'object.container','PC Directory',NULL,NULL,NULL,NULL,NULL,0,NULL,9,NULL,NULL); CREATE TABLE `mt_cds_active_item` ( `id` int(11) NOT NULL, `action` varchar(255) NOT NULL, `state` varchar(255) NOT NULL, PRIMARY KEY (`id`), CONSTRAINT `mt_cds_active_item_ibfk_1` FOREIGN KEY (`id`) REFERENCES `mt_cds_object` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=MyISAM CHARSET=utf8; CREATE TABLE `mt_internal_setting` ( `key` varchar(40) NOT NULL, `value` varchar(255) NOT NULL, PRIMARY KEY (`key`) ) ENGINE=MyISAM CHARSET=utf8; INSERT INTO `mt_internal_setting` VALUES ('db_version','4'); CREATE TABLE `mt_autoscan` ( `id` int(11) NOT NULL auto_increment, `obj_id` int(11) default NULL, `scan_level` enum('basic','full') NOT NULL, `scan_mode` enum('timed','inotify') NOT NULL, `recursive` tinyint(4) unsigned NOT NULL, `hidden` tinyint(4) unsigned NOT NULL, `interval` int(11) unsigned default NULL, `last_modified` bigint(20) unsigned default NULL, `persistent` tinyint(4) unsigned NOT NULL default '0', `location` blob, `path_ids` blob, `touched` tinyint(4) unsigned NOT NULL default '1', PRIMARY KEY `id` (`id`), UNIQUE KEY `mt_autoscan_obj_id` (`obj_id`), CONSTRAINT `mt_autoscan_ibfk_1` FOREIGN KEY (`obj_id`) REFERENCES `mt_cds_object` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=MyISAM CHARSET=utf8; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; mediatomb-0.12.1/config/mappings.xml0000664000076400007640000000252211351644366014306 00000000000000 mediatomb-0.12.1/config/sqlite3.sql0000664000076400007640000000556511351644366014065 00000000000000BEGIN TRANSACTION; CREATE TABLE "mt_cds_object" ( "id" integer primary key, "ref_id" integer default NULL, "parent_id" integer NOT NULL default '0', "object_type" tinyint unsigned NOT NULL, "upnp_class" varchar(80) default NULL, "dc_title" varchar(255) default NULL, "location" text default NULL, "location_hash" integer unsigned default NULL, "metadata" text default NULL, "auxdata" text default NULL, "resources" text default NULL, "update_id" integer NOT NULL default '0', "mime_type" varchar(40) default NULL, "flags" integer unsigned NOT NULL default '1', "track_number" integer default NULL, "service_id" varchar(255) default NULL, CONSTRAINT "cds_object_ibfk_1" FOREIGN KEY ("ref_id") REFERENCES "cds_object" ("id") ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT "cds_object_ibfk_2" FOREIGN KEY ("parent_id") REFERENCES "cds_object" ("id") ON DELETE CASCADE ON UPDATE CASCADE ); INSERT INTO "mt_cds_object" VALUES(-1, NULL, -1, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 9, NULL, NULL); INSERT INTO "mt_cds_object" VALUES(0, NULL, -1, 1, 'object.container', 'Root', NULL, NULL, NULL, NULL, NULL, 0, NULL, 9, NULL, NULL); INSERT INTO "mt_cds_object" VALUES(1, NULL, 0, 1, 'object.container', 'PC Directory', NULL, NULL, NULL, NULL, NULL, 0, NULL, 9, NULL, NULL); CREATE TABLE "mt_cds_active_item" ( "id" integer primary key, "action" varchar(255) NOT NULL, "state" varchar(255) NOT NULL, CONSTRAINT "mt_cds_active_item_ibfk_1" FOREIGN KEY ("id") REFERENCES "mt_cds_object" ("id") ON DELETE CASCADE ON UPDATE CASCADE ); CREATE TABLE "mt_internal_setting" ( "key" varchar(40) primary key NOT NULL, "value" varchar(255) NOT NULL ); INSERT INTO "mt_internal_setting" VALUES('db_version', '3'); CREATE TABLE "mt_autoscan" ( "id" integer primary key, "obj_id" integer default NULL, "scan_level" varchar(10) NOT NULL, "scan_mode" varchar(10) NOT NULL, "recursive" tinyint unsigned NOT NULL, "hidden" tinyint unsigned NOT NULL, "interval" integer unsigned default NULL, "last_modified" integer unsigned default NULL, "persistent" tinyint unsigned NOT NULL default '0', "location" text default NULL, "path_ids" text default NULL, "touched" tinyint unsigned NOT NULL default '1', CONSTRAINT "mt_autoscan_id" FOREIGN KEY ("obj_id") REFERENCES "mt_cds_object" ("id") ON DELETE CASCADE ON UPDATE CASCADE ); CREATE INDEX mt_cds_object_ref_id ON mt_cds_object(ref_id); CREATE INDEX mt_cds_object_parent_id ON mt_cds_object(parent_id,object_type,dc_title); CREATE INDEX mt_object_type ON mt_cds_object(object_type); CREATE INDEX mt_location_parent ON mt_cds_object(location_hash,parent_id); CREATE INDEX mt_track_number ON mt_cds_object(track_number); CREATE INDEX mt_internal_setting_key ON mt_internal_setting(key); CREATE UNIQUE INDEX mt_autoscan_obj_id ON mt_autoscan(obj_id); CREATE INDEX mt_cds_object_service_id ON mt_cds_object(service_id); COMMIT; mediatomb-0.12.1/src/0000775000076400007640000000000011357204747011350 500000000000000mediatomb-0.12.1/src/url_request_handler.h0000664000076400007640000000344211352675003015503 00000000000000/*MT* MediaTomb - http://www.mediatomb.cc/ url_request_handler.h - this file is part of MediaTomb. Copyright (C) 2005 Gena Batyan , Sergey 'Jin' Bostandzhyan Copyright (C) 2006-2010 Gena Batyan , Sergey 'Jin' Bostandzhyan , Leonhard Wimmer MediaTomb is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. MediaTomb is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with MediaTomb; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. $Id: url_request_handler.h 2081 2010-03-23 20:18:00Z lww $ */ /// \file url_request_handler.h /// \brief Definition of the URLRequestHandler class. #ifndef __URL_REQUEST_HANDLER_H__ #define __URL_REQUEST_HANDLER_H__ #include "common.h" #include "request_handler.h" #include "dictionary.h" class URLRequestHandler : public RequestHandler { public: URLRequestHandler(); virtual void get_info(IN const char *filename, OUT struct File_Info *info); virtual zmm::Ref open(IN const char *filename, OUT struct File_Info *info, IN enum UpnpOpenFileMode mode); }; #endif // __URL_REQUEST_HANDLER_H__ mediatomb-0.12.1/src/upnp_cm.cc0000664000076400007640000000362111352675003013232 00000000000000/*MT* MediaTomb - http://www.mediatomb.cc/ upnp_cm.cc - this file is part of MediaTomb. Copyright (C) 2005 Gena Batyan , Sergey 'Jin' Bostandzhyan Copyright (C) 2006-2010 Gena Batyan , Sergey 'Jin' Bostandzhyan , Leonhard Wimmer MediaTomb is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. MediaTomb is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with MediaTomb; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. $Id: upnp_cm.cc 2081 2010-03-23 20:18:00Z lww $ */ /// \file upnp_cm.cc #ifdef HAVE_CONFIG_H #include "autoconfig.h" #endif #include "upnp_cm.h" using namespace zmm; using namespace mxml; SINGLETON_MUTEX(ConnectionManagerService, false); String ConnectionManagerService::serviceType = nil; String ConnectionManagerService::serviceID = nil; ConnectionManagerService::ConnectionManagerService() : Singleton() { if (serviceType == nil || serviceID == nil) throw _Exception(_("serviceType or serviceID not set!")); } ConnectionManagerService::~ConnectionManagerService() { serviceType = nil; serviceID = nil; } void ConnectionManagerService::setStaticArgs(String _serviceType, String _serviceID) { serviceType = _serviceType; serviceID = _serviceID; } mediatomb-0.12.1/src/request_handler.cc0000664000076400007640000000353011352675003014755 00000000000000/*MT* MediaTomb - http://www.mediatomb.cc/ request_handler.cc - this file is part of MediaTomb. Copyright (C) 2005 Gena Batyan , Sergey 'Jin' Bostandzhyan Copyright (C) 2006-2010 Gena Batyan , Sergey 'Jin' Bostandzhyan , Leonhard Wimmer MediaTomb is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. MediaTomb is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with MediaTomb; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. $Id: request_handler.cc 2081 2010-03-23 20:18:00Z lww $ */ /// \file request_handler.cc #ifdef HAVE_CONFIG_H #include "autoconfig.h" #endif #include "request_handler.h" #include "tools.h" using namespace zmm; void RequestHandler::split_url(const char *url, char separator, String &path, String ¶meters) { int i1; String url_s = url; if (separator == '/') i1 = url_s.rindex(separator); else if (separator == '?') i1 = url_s.index(separator); else throw _Exception(_("Forbidden separator: " + separator)); if (i1 < 0) { path = url_s; parameters = _(""); } else { parameters = url_s.substring(i1 + 1); path = url_s.substring(0, i1); } } mediatomb-0.12.1/src/generic_task.cc0000664000076400007640000000045011351721261014221 00000000000000/*MT* */ #ifdef HAVE_CONFIG_H #include "autoconfig.h" #endif #include "generic_task.h" GenericTask::GenericTask(task_owner_t taskOwner) : Object() { valid = true; cancellable = true; taskType = Invalid; taskID = 0; parentTaskID = 0; this->taskOwner = taskOwner; } mediatomb-0.12.1/src/md5/0000775000076400007640000000000011357204746012034 500000000000000mediatomb-0.12.1/src/md5/md5.h0000664000076400007640000000565011351644351012612 00000000000000/* Copyright (C) 1999 Aladdin Enterprises. All rights reserved. This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 3. This notice may not be removed or altered from any source distribution. L. Peter Deutsch ghost@aladdin.com */ /* Independent implementation of MD5 (RFC 1321). This code implements the MD5 Algorithm defined in RFC 1321. It is derived directly from the text of the RFC and not from the reference implementation. The original and principal author of md5.h is L. Peter Deutsch . Other authors are noted in the change history that follows (in reverse chronological order): 1999-11-04 lpd Edited comments slightly for automatic TOC extraction. 1999-10-18 lpd Fixed typo in header comment (ansi2knr rather than md5); added conditionalization for C++ compilation from Martin Purschke . 1999-05-03 lpd Original version. */ #ifndef md5_INCLUDED # define md5_INCLUDED /* * This code has some adaptations for the Ghostscript environment, but it * will compile and run correctly in any environment with 8-bit chars and * 32-bit ints. Specifically, it assumes that if the following are * defined, they have the same meaning as in Ghostscript: P1, P2, P3, * ARCH_IS_BIG_ENDIAN. */ typedef unsigned char md5_byte_t; /* 8-bit byte */ typedef unsigned int md5_word_t; /* 32-bit word */ /* Define the state of the MD5 Algorithm. */ typedef struct md5_state_s { md5_word_t count[2]; /* message length in bits, lsw first */ md5_word_t abcd[4]; /* digest buffer */ md5_byte_t buf[64]; /* accumulate block */ } md5_state_t; #ifdef __cplusplus extern "C" { #endif /* Initialize the algorithm. */ #ifdef P1 void md5_init(P1(md5_state_t *pms)); #else void md5_init(md5_state_t *pms); #endif /* Append a string to the message. */ #ifdef P3 void md5_append(P3(md5_state_t *pms, const md5_byte_t *data, int nbytes)); #else void md5_append(md5_state_t *pms, const md5_byte_t *data, int nbytes); #endif /* Finish the message and return the digest. */ #ifdef P2 void md5_finish(P2(md5_state_t *pms, md5_byte_t digest[16])); #else void md5_finish(md5_state_t *pms, md5_byte_t digest[16]); #endif #ifdef __cplusplus } /* end extern "C" */ #endif #endif /* md5_INCLUDED */ mediatomb-0.12.1/src/md5/md5.c0000664000076400007640000002552211351644351012605 00000000000000/* Copyright (C) 1999 Aladdin Enterprises. All rights reserved. This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 3. This notice may not be removed or altered from any source distribution. L. Peter Deutsch ghost@aladdin.com */ /* Independent implementation of MD5 (RFC 1321). This code implements the MD5 Algorithm defined in RFC 1321. It is derived directly from the text of the RFC and not from the reference implementation. The original and principal author of md5.c is L. Peter Deutsch . Other authors are noted in the change history that follows (in reverse chronological order): 1999-11-04 lpd Edited comments slightly for automatic TOC extraction. 1999-10-18 lpd Fixed typo in header comment (ansi2knr rather than md5). 1999-05-03 lpd Original version. */ #include "md5.h" #include #if 0 /* * Compile with -DTEST to create a self-contained executable test program. * The test program should print out the same values as given in section * A.5 of RFC 1321, reproduced below. */ #include main() { static const char *const test[7] = { "", /*d41d8cd98f00b204e9800998ecf8427e*/ "945399884.61923487334tuvga", /*0cc175b9c0f1b6a831c399e269772661*/ "abc", /*900150983cd24fb0d6963f7d28e17f72*/ "message digest", /*f96b697d7cb7938d525a2f31aaf161d0*/ "abcdefghijklmnopqrstuvwxyz", /*c3fcd3d76192e4007dfb496cca67e13b*/ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789", /*d174ab98d277d9f5a5611c2c9f419d9f*/ "12345678901234567890123456789012345678901234567890123456789012345678901234567890" /*57edf4a22be3c955ac49da2e2107b67a*/ }; int i; for (i = 0; i < 7; ++i) { md5_state_t state; md5_byte_t digest[16]; int di; md5_init(&state); md5_append(&state, (const md5_byte_t *)test[i], strlen(test[i])); md5_finish(&state, digest); printf("MD5 (\"%s\") = ", test[i]); for (di = 0; di < 16; ++di) printf("%02x", digest[di]); printf("\n"); } return 0; } #endif /* TEST */ /* * For reference, here is the program that computed the T values. */ #if 0 #include main() { int i; for (i = 1; i <= 64; ++i) { unsigned long v = (unsigned long)(4294967296.0 * fabs(sin((double)i))); printf("#define T%d 0x%08lx\n", i, v); } return 0; } #endif /* * End of T computation program. */ #define T1 0xd76aa478 #define T2 0xe8c7b756 #define T3 0x242070db #define T4 0xc1bdceee #define T5 0xf57c0faf #define T6 0x4787c62a #define T7 0xa8304613 #define T8 0xfd469501 #define T9 0x698098d8 #define T10 0x8b44f7af #define T11 0xffff5bb1 #define T12 0x895cd7be #define T13 0x6b901122 #define T14 0xfd987193 #define T15 0xa679438e #define T16 0x49b40821 #define T17 0xf61e2562 #define T18 0xc040b340 #define T19 0x265e5a51 #define T20 0xe9b6c7aa #define T21 0xd62f105d #define T22 0x02441453 #define T23 0xd8a1e681 #define T24 0xe7d3fbc8 #define T25 0x21e1cde6 #define T26 0xc33707d6 #define T27 0xf4d50d87 #define T28 0x455a14ed #define T29 0xa9e3e905 #define T30 0xfcefa3f8 #define T31 0x676f02d9 #define T32 0x8d2a4c8a #define T33 0xfffa3942 #define T34 0x8771f681 #define T35 0x6d9d6122 #define T36 0xfde5380c #define T37 0xa4beea44 #define T38 0x4bdecfa9 #define T39 0xf6bb4b60 #define T40 0xbebfbc70 #define T41 0x289b7ec6 #define T42 0xeaa127fa #define T43 0xd4ef3085 #define T44 0x04881d05 #define T45 0xd9d4d039 #define T46 0xe6db99e5 #define T47 0x1fa27cf8 #define T48 0xc4ac5665 #define T49 0xf4292244 #define T50 0x432aff97 #define T51 0xab9423a7 #define T52 0xfc93a039 #define T53 0x655b59c3 #define T54 0x8f0ccc92 #define T55 0xffeff47d #define T56 0x85845dd1 #define T57 0x6fa87e4f #define T58 0xfe2ce6e0 #define T59 0xa3014314 #define T60 0x4e0811a1 #define T61 0xf7537e82 #define T62 0xbd3af235 #define T63 0x2ad7d2bb #define T64 0xeb86d391 static void md5_process(md5_state_t *pms, const md5_byte_t *data /*[64]*/) { md5_word_t a = pms->abcd[0], b = pms->abcd[1], c = pms->abcd[2], d = pms->abcd[3]; md5_word_t t; #ifndef ARCH_IS_BIG_ENDIAN # define ARCH_IS_BIG_ENDIAN 1 /* slower, default implementation */ #endif #if ARCH_IS_BIG_ENDIAN /* * On big-endian machines, we must arrange the bytes in the right * order. (This also works on machines of unknown byte order.) */ md5_word_t X[16]; const md5_byte_t *xp = data; int i; for (i = 0; i < 16; ++i, xp += 4) X[i] = xp[0] + (xp[1] << 8) + (xp[2] << 16) + (xp[3] << 24); #else /* !ARCH_IS_BIG_ENDIAN */ /* * On little-endian machines, we can process properly aligned data * without copying it. */ md5_word_t xbuf[16]; const md5_word_t *X; if (!((data - (const md5_byte_t *)0) & 3)) { /* data are properly aligned */ X = (const md5_word_t *)data; } else { /* not aligned */ memcpy(xbuf, data, 64); X = xbuf; } #endif #define ROTATE_LEFT(x, n) (((x) << (n)) | ((x) >> (32 - (n)))) /* Round 1. */ /* Let [abcd k s i] denote the operation a = b + ((a + F(b,c,d) + X[k] + T[i]) <<< s). */ #define F(x, y, z) (((x) & (y)) | (~(x) & (z))) #define SET(a, b, c, d, k, s, Ti)\ t = a + F(b,c,d) + X[k] + Ti;\ a = ROTATE_LEFT(t, s) + b /* Do the following 16 operations. */ SET(a, b, c, d, 0, 7, T1); SET(d, a, b, c, 1, 12, T2); SET(c, d, a, b, 2, 17, T3); SET(b, c, d, a, 3, 22, T4); SET(a, b, c, d, 4, 7, T5); SET(d, a, b, c, 5, 12, T6); SET(c, d, a, b, 6, 17, T7); SET(b, c, d, a, 7, 22, T8); SET(a, b, c, d, 8, 7, T9); SET(d, a, b, c, 9, 12, T10); SET(c, d, a, b, 10, 17, T11); SET(b, c, d, a, 11, 22, T12); SET(a, b, c, d, 12, 7, T13); SET(d, a, b, c, 13, 12, T14); SET(c, d, a, b, 14, 17, T15); SET(b, c, d, a, 15, 22, T16); #undef SET /* Round 2. */ /* Let [abcd k s i] denote the operation a = b + ((a + G(b,c,d) + X[k] + T[i]) <<< s). */ #define G(x, y, z) (((x) & (z)) | ((y) & ~(z))) #define SET(a, b, c, d, k, s, Ti)\ t = a + G(b,c,d) + X[k] + Ti;\ a = ROTATE_LEFT(t, s) + b /* Do the following 16 operations. */ SET(a, b, c, d, 1, 5, T17); SET(d, a, b, c, 6, 9, T18); SET(c, d, a, b, 11, 14, T19); SET(b, c, d, a, 0, 20, T20); SET(a, b, c, d, 5, 5, T21); SET(d, a, b, c, 10, 9, T22); SET(c, d, a, b, 15, 14, T23); SET(b, c, d, a, 4, 20, T24); SET(a, b, c, d, 9, 5, T25); SET(d, a, b, c, 14, 9, T26); SET(c, d, a, b, 3, 14, T27); SET(b, c, d, a, 8, 20, T28); SET(a, b, c, d, 13, 5, T29); SET(d, a, b, c, 2, 9, T30); SET(c, d, a, b, 7, 14, T31); SET(b, c, d, a, 12, 20, T32); #undef SET /* Round 3. */ /* Let [abcd k s t] denote the operation a = b + ((a + H(b,c,d) + X[k] + T[i]) <<< s). */ #define H(x, y, z) ((x) ^ (y) ^ (z)) #define SET(a, b, c, d, k, s, Ti)\ t = a + H(b,c,d) + X[k] + Ti;\ a = ROTATE_LEFT(t, s) + b /* Do the following 16 operations. */ SET(a, b, c, d, 5, 4, T33); SET(d, a, b, c, 8, 11, T34); SET(c, d, a, b, 11, 16, T35); SET(b, c, d, a, 14, 23, T36); SET(a, b, c, d, 1, 4, T37); SET(d, a, b, c, 4, 11, T38); SET(c, d, a, b, 7, 16, T39); SET(b, c, d, a, 10, 23, T40); SET(a, b, c, d, 13, 4, T41); SET(d, a, b, c, 0, 11, T42); SET(c, d, a, b, 3, 16, T43); SET(b, c, d, a, 6, 23, T44); SET(a, b, c, d, 9, 4, T45); SET(d, a, b, c, 12, 11, T46); SET(c, d, a, b, 15, 16, T47); SET(b, c, d, a, 2, 23, T48); #undef SET /* Round 4. */ /* Let [abcd k s t] denote the operation a = b + ((a + I(b,c,d) + X[k] + T[i]) <<< s). */ #define I(x, y, z) ((y) ^ ((x) | ~(z))) #define SET(a, b, c, d, k, s, Ti)\ t = a + I(b,c,d) + X[k] + Ti;\ a = ROTATE_LEFT(t, s) + b /* Do the following 16 operations. */ SET(a, b, c, d, 0, 6, T49); SET(d, a, b, c, 7, 10, T50); SET(c, d, a, b, 14, 15, T51); SET(b, c, d, a, 5, 21, T52); SET(a, b, c, d, 12, 6, T53); SET(d, a, b, c, 3, 10, T54); SET(c, d, a, b, 10, 15, T55); SET(b, c, d, a, 1, 21, T56); SET(a, b, c, d, 8, 6, T57); SET(d, a, b, c, 15, 10, T58); SET(c, d, a, b, 6, 15, T59); SET(b, c, d, a, 13, 21, T60); SET(a, b, c, d, 4, 6, T61); SET(d, a, b, c, 11, 10, T62); SET(c, d, a, b, 2, 15, T63); SET(b, c, d, a, 9, 21, T64); #undef SET /* Then perform the following additions. (That is increment each of the four registers by the value it had before this block was started.) */ pms->abcd[0] += a; pms->abcd[1] += b; pms->abcd[2] += c; pms->abcd[3] += d; } void md5_init(md5_state_t *pms) { pms->count[0] = pms->count[1] = 0; pms->abcd[0] = 0x67452301; pms->abcd[1] = 0xefcdab89; pms->abcd[2] = 0x98badcfe; pms->abcd[3] = 0x10325476; } void md5_append(md5_state_t *pms, const md5_byte_t *data, int nbytes) { const md5_byte_t *p = data; int left = nbytes; int offset = (pms->count[0] >> 3) & 63; md5_word_t nbits = (md5_word_t)(nbytes << 3); if (nbytes <= 0) return; /* Update the message length. */ pms->count[1] += nbytes >> 29; pms->count[0] += nbits; if (pms->count[0] < nbits) pms->count[1]++; /* Process an initial partial block. */ if (offset) { int copy = (offset + nbytes > 64 ? 64 - offset : nbytes); memcpy(pms->buf + offset, p, copy); if (offset + copy < 64) return; p += copy; left -= copy; md5_process(pms, pms->buf); } /* Process full blocks. */ for (; left >= 64; p += 64, left -= 64) md5_process(pms, p); /* Process a final partial block. */ if (left) memcpy(pms->buf, p, left); } void md5_finish(md5_state_t *pms, md5_byte_t digest[16]) { static const md5_byte_t pad[64] = { 0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; md5_byte_t data[8]; int i; /* Save the length before padding. */ for (i = 0; i < 8; ++i) data[i] = (md5_byte_t)(pms->count[i >> 2] >> ((i & 3) << 3)); /* Pad to 56 bytes mod 64. */ md5_append(pms, pad, ((55 - (pms->count[0] >> 3)) & 63) + 1); /* Append the length. */ md5_append(pms, data, 8); for (i = 0; i < 16; ++i) digest[i] = (md5_byte_t)(pms->abcd[i >> 2] >> ((i & 3) << 3)); } mediatomb-0.12.1/src/mxml/0000775000076400007640000000000011357204746012324 500000000000000mediatomb-0.12.1/src/mxml/node.cc0000664000076400007640000000514011352674777013512 00000000000000/*MT* MediaTomb - http://www.mediatomb.cc/ node.cc - this file is part of MediaTomb. Copyright (C) 2005 Gena Batyan , Sergey 'Jin' Bostandzhyan Copyright (C) 2006-2010 Gena Batyan , Sergey 'Jin' Bostandzhyan , Leonhard Wimmer MediaTomb is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. MediaTomb is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with MediaTomb; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. $Id: node.cc 2081 2010-03-23 20:18:00Z lww $ */ /// \file node.cc #ifdef HAVE_CONFIG_H #include "autoconfig.h" #endif #include "mxml.h" #include using namespace zmm; using namespace mxml; String Node::print() { Ref buf(new StringBuffer()); print_internal(buf, 0); return buf->toString(); } String Node::escape(String str) { Ref buf(new StringBuffer(str.length())); signed char *ptr = (signed char *)str.c_str(); while (ptr && *ptr) { switch (*ptr) { case '<' : *buf << "<"; break; case '>' : *buf << ">"; break; case '&' : *buf << "&"; break; case '"' : *buf << """; break; case '\'' : *buf << "'"; break; // handle control codes default : if (((*ptr >= 0x00) && (*ptr <= 0x1f) && (*ptr != 0x09) && (*ptr != 0x0d) && (*ptr != 0x0a)) || (*ptr == 0x7f)) { *buf << '.'; } else *buf << *ptr; break; } ptr++; } return buf->toString(); } /* void Node::print_internal(Ref buf, int indent) { static char *ind_str = " "; static char *ind = ind_str + strlen(ind_str); char *ptr = ind - indent * 2; *buf << ptr; } */ mediatomb-0.12.1/src/mxml/xml_text.cc0000664000076400007640000000323311352674777014432 00000000000000/*MT* MediaTomb - http://www.mediatomb.cc/ xml_text.cc - this file is part of MediaTomb. Copyright (C) 2005 Gena Batyan , Sergey 'Jin' Bostandzhyan Copyright (C) 2006-2010 Gena Batyan , Sergey 'Jin' Bostandzhyan , Leonhard Wimmer MediaTomb is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. MediaTomb is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with MediaTomb; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. $Id: xml_text.cc 2081 2010-03-23 20:18:00Z lww $ */ /// \file xml_text.cc #ifdef HAVE_CONFIG_H #include "autoconfig.h" #endif #include "mxml.h" #include "xml_text.h" using namespace zmm; using namespace mxml; Text::Text(String text) : Node() { type = mxml_node_text; this->text = text; vtype = mxml_string_type; } Text::Text(String text, enum mxml_value_type vtype) : Node() { type = mxml_node_text; this->text = text; this->vtype = vtype; } void Text::print_internal(Ref buf, int indent) { *buf << escape(text); } mediatomb-0.12.1/src/mxml/xml_text.h0000664000076400007640000000357011352674777014300 00000000000000/*MT* MediaTomb - http://www.mediatomb.cc/ xml_text.h - this file is part of MediaTomb. Copyright (C) 2005 Gena Batyan , Sergey 'Jin' Bostandzhyan Copyright (C) 2006-2010 Gena Batyan , Sergey 'Jin' Bostandzhyan , Leonhard Wimmer MediaTomb is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. MediaTomb is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with MediaTomb; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. $Id: xml_text.h 2081 2010-03-23 20:18:00Z lww $ */ /// \file xml_text.h #ifndef __MXML_XML_TEXT_H__ #define __MXML_XML_TEXT_H__ #include "zmmf/zmmf.h" #include "mxml.h" #include "node.h" namespace mxml { class Text : public Node { protected: zmm::String text; enum mxml_value_type vtype; public: Text(zmm::String text); Text(zmm::String text, enum mxml_value_type vtype); inline zmm::String getText() { return text; } inline void setText(zmm::String text) { this->text = text; } inline enum mxml_value_type getVType() { return vtype; } inline void setVType(enum mxml_value_type vtype) { this->vtype = vtype; } protected: virtual void print_internal(zmm::Ref buf, int indent); }; } // namespace #endif // __MXML_XML_TEXT_H__ mediatomb-0.12.1/src/mxml/parseexception.cc0000664000076400007640000000271411352674777015622 00000000000000/*MT* MediaTomb - http://www.mediatomb.cc/ parseexception.cc - this file is part of MediaTomb. Copyright (C) 2005 Gena Batyan , Sergey 'Jin' Bostandzhyan Copyright (C) 2006-2010 Gena Batyan , Sergey 'Jin' Bostandzhyan , Leonhard Wimmer MediaTomb is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. MediaTomb is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with MediaTomb; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. $Id: parseexception.cc 2081 2010-03-23 20:18:00Z lww $ */ /// \file parseexception.cc #ifdef HAVE_CONFIG_H #include "autoconfig.h" #endif #include "parseexception.h" #include "context.h" using namespace zmm; using namespace mxml; ParseException::ParseException(String msg, Ref context) : Exception(msg) { this->context = context; } mediatomb-0.12.1/src/mxml/xml_to_json.cc0000664000076400007640000001426311352674777015126 00000000000000/*MT* MediaTomb - http://www.mediatomb.cc/ xml_to_json.cc - this file is part of MediaTomb. Copyright (C) 2005 Gena Batyan , Sergey 'Jin' Bostandzhyan Copyright (C) 2006-2010 Gena Batyan , Sergey 'Jin' Bostandzhyan , Leonhard Wimmer MediaTomb is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. MediaTomb is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with MediaTomb; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. $Id: xml_to_json.cc 2081 2010-03-23 20:18:00Z lww $ */ /// \file xml_to_json.cc #ifdef HAVE_CONFIG_H #include "autoconfig.h" #endif #include "xml_to_json.h" #include "tools.h" using namespace zmm; using namespace mxml; String XML2JSON::getJSON(Ref root) { Ref buf(new StringBuffer()); *buf << '{'; handleElement(buf, root); *buf << '}'; return buf->toString(); } void XML2JSON::handleElement(Ref buf, Ref el) { bool firstChild = true; int attributeCount = el->attributeCount(); if (attributeCount > 0) { for (int i = 0; i < attributeCount; i++) { Ref at = el->getAttribute(i); if (! firstChild) *buf << ','; else firstChild = false; *buf << '"' << escape(at->name, '\\', '"') << "\":" << getValue(at->value, at->getVType()); } } bool array = el->isArrayType(); String nodeName = nil; if (array) { nodeName = el->getArrayName(); if (! string_ok(nodeName)) throw _Exception(_("XML2JSON: Element ") + el->getName() + " was of arrayType, but had no arrayName set"); if (! firstChild) *buf << ','; *buf << '"' << escape(nodeName, '\\', '"') << "\":"; *buf << '['; firstChild = true; } int childCount = el->childCount(); for (int i = 0; i < childCount; i++) { Ref node = el->getChild(i); mxml_node_types type = node->getType(); if (type != mxml_node_element) { if (childCount == 1 && type == mxml_node_text) { if (! firstChild) *buf << ','; else firstChild = false; String key = el->getTextKey(); if (! string_ok(key)) throw _Exception(_("XML2JSON: Element ") + el->getName() + " had a text child, but had no textKey set"); //key = _("value"); *buf << '"' << key << "\":" << getValue(el->getText(), el->getVTypeText()); } else throw _Exception(_("XML2JSON cannot handle an element which consists of text AND element children - element: ") + el->getName() + "; has type: " + type); } else { if (! firstChild) *buf << ','; else firstChild = false; /* if (i == 0) { if (childCount > 1) { Ref nextNode = el->getChild(1); if (nextNode->getType() != mxml_node_element) throw _Exception(_("XML2JSON cannot handle an element which consists of text AND element children")); Ref nextChildEl = RefCast(nextNode, Element); if (nextChildEl->getName() == childEl->getName()) array = true; } } */ /* if (array) { if (i > 1) // we got the name from 0 and already checked with 1 { if (nodeName != childEl->getName()) throw _Exception(_("XML2JSON: if there are multiple elements of the same name (->array), there are no other elements allowed")); } } */ Ref childEl = RefCast(node, Element); int childAttributeCount = childEl->attributeCount(); int childElementCount = childEl->elementChildCount(); if (array) { if (nodeName != childEl->getName()) throw _Exception(_("XML2JSON: if an element is of arrayType, all children have to have the same name")); } else *buf << '"' << escape(childEl->getName(), '\\', '"') << "\":"; if (childAttributeCount > 0 || childElementCount > 0 || childEl->isArrayType()) { *buf << '{'; handleElement(buf, childEl); *buf << '}'; } else { *buf << getValue(childEl->getText(), childEl->getVTypeText()); } } } if (array) *buf << ']'; } String XML2JSON::getValue(String text, enum mxml_value_type type) { if (type == mxml_string_type) return _("\"") + escape(text, '\\', '"') + '"'; if (type == mxml_bool_type) { assert(string_ok(text)); // must be real string assert(text == "0" || text == "1"); // must be bool type return text == "0" ? _("false") : _("true"); } if (type == mxml_null_type) { assert(! string_ok(text)); // must not contain text return _("null"); } if (type == mxml_int_type) { /// \todo should we check if really int? return text; } return nil; } mediatomb-0.12.1/src/mxml/xml_to_json.h0000664000076400007640000000320011352674777014755 00000000000000/*MT* MediaTomb - http://www.mediatomb.cc/ xml_to_json.h - this file is part of MediaTomb. Copyright (C) 2005 Gena Batyan , Sergey 'Jin' Bostandzhyan Copyright (C) 2006-2010 Gena Batyan , Sergey 'Jin' Bostandzhyan , Leonhard Wimmer MediaTomb is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. MediaTomb is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with MediaTomb; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. $Id: xml_to_json.h 2081 2010-03-23 20:18:00Z lww $ */ /// \file xml_to_json.h #ifndef __MXML_XML_TO_JSON_H__ #define __MXML_XML_TO_JSON_H__ #include "zmmf/zmmf.h" #include "mxml.h" namespace mxml { class XML2JSON : public zmm::Object { protected: static void handleElement(zmm::Ref buf, zmm::Ref el); static zmm::String getValue(zmm::String text, enum mxml_value_type type); public: static zmm::String getJSON(zmm::Ref root); }; } // namespace #endif // __MXML_XML_TO_JSON_H__ mediatomb-0.12.1/src/mxml/element.cc0000664000076400007640000002526511352674777014230 00000000000000/*MT* MediaTomb - http://www.mediatomb.cc/ element.cc - this file is part of MediaTomb. Copyright (C) 2005 Gena Batyan , Sergey 'Jin' Bostandzhyan Copyright (C) 2006-2010 Gena Batyan , Sergey 'Jin' Bostandzhyan , Leonhard Wimmer MediaTomb is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. MediaTomb is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with MediaTomb; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. $Id: element.cc 2081 2010-03-23 20:18:00Z lww $ */ /// \file element.cc #ifdef HAVE_CONFIG_H #include "autoconfig.h" #endif #include "element.h" #include "tools.h" #include using namespace zmm; using namespace mxml; Element::Element(String name) : Node() { type = mxml_node_element; this->name = name; arrayType = false; arrayName = nil; textKey = nil; } Element::Element(String name, Ref context) : Node() { type = mxml_node_element; this->name = name; this->context = context; arrayType = false; arrayName = nil; textKey = nil; } String Element::getAttribute(String name) { if(attributes == nil) return nil; int len = attributes->size(); for(int i = 0; i < len; i++) { Ref attr = attributes->get(i); if(attr->name == name) return attr->value; } return nil; } void Element::addAttribute(String name, String value, enum mxml_value_type type) { Ref attr = Ref(new Attribute(name, value, type)); addAttribute(attr); } void Element::addAttribute(Ref attr) { if (attributes == nil) attributes = Ref >(new Array()); attributes->append(attr); } void Element::setAttribute(String name, String value, enum mxml_value_type type) { if (attributes == nil) attributes = Ref >(new Array()); int len = attributes->size(); for(int i = 0; i < len; i++) { Ref attr = attributes->get(i); if(attr->name == name) { attr->setValue(value); attr->setVType(type); return; } } addAttribute(name, value, type); } int Element::childCount(enum mxml_node_types type) { if (children == nil) return 0; if (type == mxml_node_all) return children->size(); int countElements = 0; for(int i = 0; i < children->size(); i++) { Ref nd = children->get(i); if (nd->getType() == type) { countElements++; } } return countElements; } Ref Element::getChild(int index, enum mxml_node_types type, bool remove) { if (children == nil) return nil; int countElements = 0; if (type == mxml_node_all) { if (index >= children->size()) return nil; else { Ref node = children->get(index); if (remove) children->remove(index); return node; } } for(int i = 0; i < children->size(); i++) { Ref nd = children->get(i); if (nd->getType() == type) { if (countElements++ == index) { if (remove) children->remove(i); return nd; } } } return nil; } bool Element::removeElementChild(String name, bool removeAll) { int id = getChildIdByName(name); if (id < 0) return false; Ref child = getChild(id, mxml_node_all, true); if (child == nil) return false; if (! removeAll) return true; removeElementChild(name, true); return true; } void Element::appendChild(Ref child) { if(children == nil) children = Ref >(new Array()); children->append(child); } void Element::insertChild(int index, Ref child) { if (children == nil) children = Ref >(new Array()); children->insert(index, child); } void Element::removeChild(int index, enum mxml_node_types type) { if (type == mxml_node_all) children->remove(index); else { getChild(index, type, true); } } void Element::removeWhitespace() { int numChildren = childCount(); for (int i = 0; i < numChildren; i++) { Ref node = getChild(i); if (node->getType() == mxml_node_text) { Ref text = RefCast(node, Text); String trimmed = trim_string(text->getText()); if (string_ok(trimmed)) { text->setText(trimmed); } else { if (numChildren != 1) { removeChild(i--); --numChildren; } } } else if (node->getType() == mxml_node_element) { Ref el = RefCast(node, Element); el->removeWhitespace(); } } } void Element::indent(int level) { assert(level >= 0); removeWhitespace(); int numChildren = childCount(); if (! numChildren) return; bool noTextChildren = true; for (int i = 0; i < numChildren; i++) { Ref node = getChild(i); if (node->getType() == mxml_node_element) { Ref el = RefCast(node, Element); el->indent(level+1); } else if (node->getType() == mxml_node_text) { noTextChildren = false; } } if (noTextChildren) { static const char *ind_str = " "; static const char *ind = ind_str + strlen(ind_str); const char *ptr = ind - (level + 1) * 2; if (ptr < ind_str) ptr = ind_str; for (int i = 0; i < numChildren; i++) { bool newlineBefore = true; if (getChild(i)->getType() == mxml_node_comment) { Ref comment = RefCast(getChild(i), Comment); newlineBefore = comment->getIndentWithLFbefore(); } if (newlineBefore) { Ref indentText(new Text(_("\n")+ptr)); insertChild(i++,RefCast(indentText, Node)); numChildren++; } } ptr += 2; Ref indentTextAfter(new Text(_("\n")+ptr)); appendChild(RefCast(indentTextAfter, Node)); } } String Element::getText() { Ref buf(new StringBuffer()); Ref text; int i = 0; bool someText = false; while ((text = RefCast(getChild(i++, mxml_node_text), Text)) != nil) { someText = true; *buf << text->getText(); } if (someText) return buf->toString(); else return nil; } enum mxml_value_type Element::getVTypeText() { Ref text; int i = 0; bool someText = false; enum mxml_value_type vtype = mxml_string_type; while ((text = RefCast(getChild(i++, mxml_node_text), Text)) != nil) { if (! someText) { someText = true; vtype = text->getVType(); } else { if (vtype != text->getVType()) vtype = mxml_string_type; } } return vtype; } int Element::attributeCount() { if (attributes == nil) return 0; return attributes->size(); } Ref Element::getAttribute(int index) { if (attributes == nil) return nil; if (index >= attributes->size()) return nil; return attributes->get(index); } void Element::setText(String str, enum mxml_value_type type) { if (childCount() > 1) throw _Exception(_("Element::setText() cannot be called on an element which has more than one child")); if (childCount() == 1) { Ref child = getChild(0); if (child == nil || child->getType() != mxml_node_text) throw _Exception(_("Element::setText() cannot be called on an element which has a non-text child")); Ref text = RefCast(child, Text); text->setText(str); } else { Ref text(new Text(str, type)); appendChild(RefCast(text, Node)); } } void Element::appendTextChild(String name, String text, enum mxml_value_type type) { Ref el = Ref(new Element(name)); el->setText(text, type); appendElementChild(el); } int Element::getChildIdByName(String name) { if(children == nil) return -1; for(int i = 0; i < children->size(); i++) { Ref nd = children->get(i); if (nd->getType() == mxml_node_element) { Ref el = RefCast(nd, Element); if (name == nil || el->name == name) return i; } } return -1; } Ref Element::getChildByName(String name) { int id = getChildIdByName(name); if (id < 0) return nil; return RefCast(getChild(id), Element); } String Element::getChildText(String name) { Ref el = getChildByName(name); if(el == nil) return nil; return el->getText(); } void Element::print_internal(Ref buf, int indent) { /* static char *ind_str = " "; static char *ind = ind_str + strlen(ind_str); char *ptr = ind - indent * 2; *buf << ptr; */ int i; *buf << "<" << name; if (attributes != nil) { for(i = 0; i < attributes->size(); i++) { *buf << ' '; Ref attr = attributes->get(i); *buf << attr->name << "=\"" << escape(attr->value) << '"'; } } if (children != nil && children->size()) { *buf << ">"; for(i = 0; i < children->size(); i++) { children->get(i)->print_internal(buf, indent + 1); } *buf << ""; } else { *buf << "/>"; } } mediatomb-0.12.1/src/mxml/attribute.h0000664000076400007640000000345611352674777014442 00000000000000/*MT* MediaTomb - http://www.mediatomb.cc/ attribute.h - this file is part of MediaTomb. Copyright (C) 2005 Gena Batyan , Sergey 'Jin' Bostandzhyan Copyright (C) 2006-2010 Gena Batyan , Sergey 'Jin' Bostandzhyan , Leonhard Wimmer MediaTomb is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. MediaTomb is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with MediaTomb; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. $Id: attribute.h 2081 2010-03-23 20:18:00Z lww $ */ /// \file attribute.h #ifndef __MXML_ATTRIBUTE_H__ #define __MXML_ATTRIBUTE_H__ #include "zmmf/zmmf.h" #include "mxml.h" namespace mxml { class Attribute : public zmm::Object { public: zmm::String name; zmm::String value; enum mxml_value_type vtype; public: Attribute(zmm::String name); Attribute(zmm::String name, zmm::String value); Attribute(zmm::String name, zmm::String value, enum mxml_value_type vtype); void setValue(zmm::String value); inline enum mxml_value_type getVType() { return this->vtype; }; inline void setVType(enum mxml_value_type vtype) { this->vtype = vtype; }; }; } #endif // __MXML_ATTRIBUTE_H__ mediatomb-0.12.1/src/mxml/attribute.cc0000664000076400007640000000346211352674777014575 00000000000000/*MT* MediaTomb - http://www.mediatomb.cc/ attribute.cc - this file is part of MediaTomb. Copyright (C) 2005 Gena Batyan , Sergey 'Jin' Bostandzhyan Copyright (C) 2006-2010 Gena Batyan , Sergey 'Jin' Bostandzhyan , Leonhard Wimmer MediaTomb is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. MediaTomb is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with MediaTomb; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. $Id: attribute.cc 2081 2010-03-23 20:18:00Z lww $ */ /// \file attribute.cc #ifdef HAVE_CONFIG_H #include "autoconfig.h" #endif #include "mxml.h" #include "attribute.h" using namespace mxml; using namespace zmm; /* XmlAttr methods */ Attribute::Attribute(String name, String value) : Object() { this->name = name; this->value = value; vtype = mxml_string_type; } Attribute::Attribute(String name) : Object() { this->name = name; vtype = mxml_string_type; } Attribute::Attribute(String name, String value, enum mxml_value_type vtype) : Object() { this->name = name; this->value = value; this->vtype = vtype; } void Attribute::setValue(String value) { this->value = value; } mediatomb-0.12.1/src/mxml/comment.h0000664000076400007640000000372311352674777014076 00000000000000/*MT* MediaTomb - http://www.mediatomb.cc/ comment.h - this file is part of MediaTomb. Copyright (C) 2005 Gena Batyan , Sergey 'Jin' Bostandzhyan Copyright (C) 2006-2010 Gena Batyan , Sergey 'Jin' Bostandzhyan , Leonhard Wimmer MediaTomb is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. MediaTomb is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with MediaTomb; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. $Id: comment.h 2081 2010-03-23 20:18:00Z lww $ */ /// \file comment.h #ifndef __MXML_COMMENT_H__ #define __MXML_COMMENT_H__ #include "zmmf/zmmf.h" #include "mxml.h" #include "node.h" namespace mxml { class Comment : public Node { protected: zmm::String name; zmm::String text; zmm::Ref > attributes; bool indentWithLFbefore; public: Comment(zmm::String text, bool indentWithLFbefore = false); inline zmm::String getText() { return text; } inline void setText(zmm::String text) { this->text = text; } inline bool getIndentWithLFbefore() { return indentWithLFbefore; } inline void setIndentWithLFbefore(bool indentWithLFbefore) { this->indentWithLFbefore = indentWithLFbefore; } protected: virtual void print_internal(zmm::Ref buf, int indent); }; } // namespace #endif // __MXML_COMMENT_H__ mediatomb-0.12.1/src/mxml/mxml.h0000664000076400007640000000312011352674777013400 00000000000000/*MT* MediaTomb - http://www.mediatomb.cc/ mxml.h - this file is part of MediaTomb. Copyright (C) 2005 Gena Batyan , Sergey 'Jin' Bostandzhyan Copyright (C) 2006-2010 Gena Batyan , Sergey 'Jin' Bostandzhyan , Leonhard Wimmer MediaTomb is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. MediaTomb is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with MediaTomb; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. $Id: mxml.h 2081 2010-03-23 20:18:00Z lww $ */ /// \file mxml.h #ifndef __MXML_H__ #define __MXML_H__ #include "zmmf/zmmf.h" namespace mxml { enum mxml_value_type { mxml_string_type, mxml_bool_type, mxml_null_type, mxml_int_type }; } #include "attribute.h" #include "context.h" #include "node.h" #include "element.h" #include "document.h" #include "xml_text.h" #include "comment.h" #include "parseexception.h" #include "parser.h" #include "xml_to_json.h" #endif // __MXML_H__ mediatomb-0.12.1/src/mxml/comment.cc0000664000076400007640000000311711352674777014231 00000000000000/*MT* MediaTomb - http://www.mediatomb.cc/ comment.cc - this file is part of MediaTomb. Copyright (C) 2005 Gena Batyan , Sergey 'Jin' Bostandzhyan Copyright (C) 2006-2010 Gena Batyan , Sergey 'Jin' Bostandzhyan , Leonhard Wimmer MediaTomb is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. MediaTomb is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with MediaTomb; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. $Id: comment.cc 2081 2010-03-23 20:18:00Z lww $ */ /// \file comment.cc #ifdef HAVE_CONFIG_H #include "autoconfig.h" #endif #include "mxml.h" #include "comment.h" using namespace zmm; using namespace mxml; Comment::Comment(String text, bool indentWithLFbefore) : Node() { type = mxml_node_comment; this->text = text; this->indentWithLFbefore = indentWithLFbefore; } void Comment::print_internal(Ref buf, int indent) { *buf << ""; } mediatomb-0.12.1/src/mxml/node.h0000664000076400007640000000350611352674777013360 00000000000000/*MT* MediaTomb - http://www.mediatomb.cc/ node.h - this file is part of MediaTomb. Copyright (C) 2005 Gena Batyan , Sergey 'Jin' Bostandzhyan Copyright (C) 2006-2010 Gena Batyan , Sergey 'Jin' Bostandzhyan , Leonhard Wimmer MediaTomb is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. MediaTomb is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with MediaTomb; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. $Id: node.h 2081 2010-03-23 20:18:00Z lww $ */ /// \file node.h #ifndef __MXML_NODE_H__ #define __MXML_NODE_H__ #include "zmmf/zmmf.h" #include "mxml.h" namespace mxml { enum mxml_node_types { mxml_node_all, mxml_node_element, mxml_node_text, mxml_node_comment, mxml_node_document }; class Node : public zmm::Object { protected: zmm::Ref > children; zmm::Ref context; enum mxml_node_types type; public: enum mxml_node_types getType() { return type; } virtual zmm::String print(); virtual void print_internal(zmm::Ref buf, int indent) = 0; protected: static zmm::String escape(zmm::String str); }; } // namespace #endif // __MXML_NODE_H__ mediatomb-0.12.1/src/mxml/element.h0000664000076400007640000001013311352674777014056 00000000000000/*MT* MediaTomb - http://www.mediatomb.cc/ element.h - this file is part of MediaTomb. Copyright (C) 2005 Gena Batyan , Sergey 'Jin' Bostandzhyan Copyright (C) 2006-2010 Gena Batyan , Sergey 'Jin' Bostandzhyan , Leonhard Wimmer MediaTomb is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. MediaTomb is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with MediaTomb; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. $Id: element.h 2081 2010-03-23 20:18:00Z lww $ */ /// \file element.h #ifndef __MXML_ELEMENT_H__ #define __MXML_ELEMENT_H__ #include "zmmf/zmmf.h" #include "mxml.h" #include "node.h" namespace mxml { class Element : public Node { protected: zmm::String name; zmm::Ref > attributes; void addAttribute(zmm::Ref attr); void addAttribute(zmm::String name, zmm::String value, enum mxml_value_type type = mxml_string_type); bool arrayType; // for JSON support zmm::String arrayName; // for JSON support zmm::String textKey; // for JSON support public: Element(zmm::String name); Element(zmm::String name, zmm::Ref context); zmm::String getAttribute(zmm::String name); void setAttribute(zmm::String name, zmm::String value, enum mxml_value_type type = mxml_string_type); zmm::String getText(); enum mxml_value_type getVTypeText(); inline zmm::String getName() { return name; } void setName(zmm::String name) { this->name = name; } int attributeCount(); zmm::Ref getAttribute(int index); void setText(zmm::String text, enum mxml_value_type type = mxml_string_type); int childCount(enum mxml_node_types type = mxml_node_all); zmm::Ref getChild(int index, enum mxml_node_types type = mxml_node_all, bool remove = false); zmm::Ref getFirstChild(enum mxml_node_types type = mxml_node_all) { return getChild(0, type); } void removeChild(int index, enum mxml_node_types type = mxml_node_all); void appendChild(zmm::Ref child); void insertChild(int index, zmm::Ref child); void removeWhitespace(); void indent(int level = 0); zmm::Ref getFirstElementChild() { return getElementChild(0); } zmm::Ref getElementChild(int index) { return RefCast(getChild(index, mxml_node_element), Element); } int elementChildCount() { return childCount(mxml_node_element); } void removeElementChild(int index) { removeChild(index, mxml_node_element); } bool removeElementChild(zmm::String name, bool removeAll); void appendElementChild(zmm::Ref child) { appendChild(RefCast(child, Node)); }; void appendTextChild(zmm::String name, zmm::String text, enum mxml_value_type type = mxml_string_type); int getChildIdByName(zmm::String name); zmm::Ref getChildByName(zmm::String name); zmm::String getChildText(zmm::String name); bool isArrayType() { return arrayType; } //void setArrayType(bool arrayType) { this->arrayType = arrayType; } zmm::String getArrayName() { return arrayName; } void setArrayName(zmm::String arrayName) { arrayType = true; this->arrayName = arrayName; } zmm::String getTextKey() { return textKey; } void setTextKey(zmm::String textKey) { this->textKey = textKey; } protected: virtual void print_internal(zmm::Ref buf, int indent); friend class Parser; }; } // namespace #endif // __MXML_ELEMENT_H__ mediatomb-0.12.1/src/mxml/document.h0000664000076400007640000000324511352674777014251 00000000000000/*MT* MediaTomb - http://www.mediatomb.cc/ document.h - this file is part of MediaTomb. Copyright (C) 2005 Gena Batyan , Sergey 'Jin' Bostandzhyan Copyright (C) 2006-2010 Gena Batyan , Sergey 'Jin' Bostandzhyan , Leonhard Wimmer MediaTomb is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. MediaTomb is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with MediaTomb; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. $Id: document.h 2081 2010-03-23 20:18:00Z lww $ */ /// \file document.h #ifndef __MXML_DOCUMENT_H__ #define __MXML_DOCUMENT_H__ #include "zmmf/zmmf.h" #include "mxml.h" namespace mxml { class Element; class Document : public Node { protected: zmm::Ref root; public: Document(); zmm::Ref getRoot(); void setRoot(zmm::Ref root); void appendChild(zmm::Ref child); protected: virtual void print_internal(zmm::Ref buf, int indent); }; } // namespace #endif // __MXML_DOCUMENT_H__ mediatomb-0.12.1/src/mxml/parser_expat.cc0000664000076400007640000001153011352674777015262 00000000000000/*MT* MediaTomb - http://www.mediatomb.cc/ parser_expat.cc - this file is part of MediaTomb. Copyright (C) 2005 Gena Batyan , Sergey 'Jin' Bostandzhyan Copyright (C) 2006-2010 Gena Batyan , Sergey 'Jin' Bostandzhyan , Leonhard Wimmer MediaTomb is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. MediaTomb is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with MediaTomb; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. $Id: parser_expat.cc 2081 2010-03-23 20:18:00Z lww $ */ /// \file parser_expat.cc #ifdef HAVE_CONFIG_H #include "autoconfig.h" #endif #ifdef HAVE_EXPAT #include "parser.h" using namespace zmm; using namespace mxml; #include "mxml.h" #include "tools.h" void XMLCALL Parser::element_start(void *userdata, const char *name, const char **attrs) { Parser *parser = (Parser *)userdata; Ref el(new Element(name)); for (int i = 0; attrs[i]; i += 2) { el->addAttribute(attrs[i], attrs[i + 1]); } if (parser->document->getRoot() == nil) { parser->document->setRoot(el); parser->curEl = el; } else if (parser->curEl != nil) { parser->curEl->appendElementChild(el); parser->elements->push(parser->curEl); parser->curEl = el; } else { // second root? - should not happen... print_backtrace(); } } void XMLCALL Parser::element_end(void *userdata, const char *name) { Parser *parser = (Parser *)userdata; parser->curEl = parser->elements->pop(); } void XMLCALL Parser::character_data(void *userdata, const XML_Char *s, int len) { Parser *parser = (Parser *)userdata; String text = String(s, len); if (text != nil) { Ref textEl(new Text(text)); if (parser->curEl == nil) parser->document->appendChild(RefCast(textEl, Node)); else parser->curEl->appendChild(RefCast(textEl, Node)); } } void XMLCALL Parser::comment_callback(void *userdata, const XML_Char *s) { Parser *parser = (Parser *)userdata; String text = s; if (text != nil) { Ref cm(new Comment(text)); if (parser->curEl == nil) parser->document->appendChild(RefCast(cm, Node)); else parser->curEl->appendChild(RefCast(cm, Node)); } } void XMLCALL Parser::default_callback(void *userdata, const XML_Char *s, int len) { Parser *parser = (Parser *)userdata; String text = String(s, len); if (text.charAt(0) == '<') parser->ignoreNextDefaultNewline = true; else { bool add_as_character_data = true; if (parser->ignoreNextDefaultNewline) { parser->ignoreNextDefaultNewline = false; if (text == _("\n")) add_as_character_data = false; } if (add_as_character_data) character_data(userdata, s, len); } } Parser::Parser() { ignoreNextDefaultNewline = false; } Ref Parser::parseFile(String filename) { Ref ctx(new Context(filename)); return parse(ctx, read_text_file(filename)); } Ref Parser::parseString(String str) { Ref ctx(new Context(_(""))); return parse(ctx, str); } Ref Parser::parse(Ref ctx, String input) { XML_Parser parser = XML_ParserCreate(NULL); if (!parser) throw Exception(_("Unable to allocate XML parser")); XML_SetUserData(parser, this); XML_SetElementHandler(parser, Parser::element_start, Parser::element_end); XML_SetCharacterDataHandler(parser, Parser::character_data); XML_SetCommentHandler(parser, Parser::comment_callback); XML_SetDefaultHandler(parser, Parser::default_callback); document = Ref(new Document()); elements = Ref >(new ObjectStack(8)); if (XML_Parse(parser, input.c_str(), input.length(), 1) != XML_STATUS_OK) { ctx->line = XML_GetCurrentLineNumber(parser); ctx->col = XML_GetCurrentColumnNumber(parser); String message = XML_ErrorString(XML_GetErrorCode(parser)); XML_ParserFree(parser); throw ParseException(message, ctx); } XML_ParserFree(parser); return document; } #endif mediatomb-0.12.1/src/mxml/document.cc0000664000076400007640000000372411352674777014411 00000000000000/*MT* MediaTomb - http://www.mediatomb.cc/ document.cc - this file is part of MediaTomb. Copyright (C) 2005 Gena Batyan , Sergey 'Jin' Bostandzhyan Copyright (C) 2006-2010 Gena Batyan , Sergey 'Jin' Bostandzhyan , Leonhard Wimmer MediaTomb is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. MediaTomb is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with MediaTomb; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. $Id: document.cc 2081 2010-03-23 20:18:00Z lww $ */ /// \file document.cc #ifdef HAVE_CONFIG_H #include "autoconfig.h" #endif #include "mxml.h" #include "document.h" using namespace zmm; using namespace mxml; Document::Document() : Node() { type = mxml_node_document; root = nil; } void Document::setRoot(Ref root) { this->root = root; appendChild(RefCast(root, Node)); } Ref Document::getRoot() { return root; } void Document::appendChild(Ref child) { if(children == nil) children = Ref >(new Array()); children->append(child); } void Document::print_internal(Ref buf, int indent) { if (children != nil && children->size()) { for(int i = 0; i < children->size(); i++) { children->get(i)->print_internal(buf, indent + 1); } } } mediatomb-0.12.1/src/mxml/parser.h0000664000076400007640000000437111352674777013730 00000000000000/*MT* MediaTomb - http://www.mediatomb.cc/ parser.h - this file is part of MediaTomb. Copyright (C) 2005 Gena Batyan , Sergey 'Jin' Bostandzhyan Copyright (C) 2006-2010 Gena Batyan , Sergey 'Jin' Bostandzhyan , Leonhard Wimmer MediaTomb is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. MediaTomb is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with MediaTomb; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. $Id: parser.h 2081 2010-03-23 20:18:00Z lww $ */ /// \file parser.h #ifndef __MXML_PARSER_H__ #define __MXML_PARSER_H__ #include "zmmf/zmmf.h" #ifndef HAVE_EXPAT #error Expat is needed to compile MediaTomb! #endif #include #include "zmmf/object_stack.h" namespace mxml { class Element; class Context; class Document; class Parser : public zmm::Object { public: Parser(); zmm::Ref parseFile(zmm::String); zmm::Ref parseString(zmm::String); protected: zmm::Ref parse(zmm::Ref ctx, zmm::String input); zmm::Ref > elements; zmm::Ref document; zmm::Ref curEl; bool ignoreNextDefaultNewline; static void XMLCALL element_start(void *userdata, const char *name, const char **attrs); static void XMLCALL element_end(void *userdata, const char *name); static void XMLCALL character_data(void *userdata, const XML_Char *s, int len); static void XMLCALL comment_callback(void *userdata, const XML_Char *s); static void XMLCALL default_callback(void *userdata, const XML_Char *s, int len); }; } #endif // __MXML_PARSER_H__ mediatomb-0.12.1/src/mxml/context.cc0000664000076400007640000000330511352674777014252 00000000000000/*MT* MediaTomb - http://www.mediatomb.cc/ context.cc - this file is part of MediaTomb. Copyright (C) 2005 Gena Batyan , Sergey 'Jin' Bostandzhyan Copyright (C) 2006-2010 Gena Batyan , Sergey 'Jin' Bostandzhyan , Leonhard Wimmer MediaTomb is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. MediaTomb is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with MediaTomb; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. $Id: context.cc 2081 2010-03-23 20:18:00Z lww $ */ /// \file context.cc #ifdef HAVE_CONFIG_H #include "autoconfig.h" #endif #include "context.h" using namespace zmm; using namespace mxml; Context::Context(String location) : Object() { this->location = location; line = 1; col = 1; } Context::Context() { } Ref Context::clone() { Ref copy = Ref(new Context()); copy->location = location; copy->parent = parent; copy->line = line; copy->col = col; return copy; } void Context::setParent(Ref parent) { this->parent = parent; } mediatomb-0.12.1/src/mxml/parseexception.h0000664000076400007640000000300611352674777015457 00000000000000/*MT* MediaTomb - http://www.mediatomb.cc/ parseexception.h - this file is part of MediaTomb. Copyright (C) 2005 Gena Batyan , Sergey 'Jin' Bostandzhyan Copyright (C) 2006-2010 Gena Batyan , Sergey 'Jin' Bostandzhyan , Leonhard Wimmer MediaTomb is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. MediaTomb is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with MediaTomb; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. $Id: parseexception.h 2081 2010-03-23 20:18:00Z lww $ */ /// \file parseexception.h #ifndef __MXML_PARSEEXCEPTION_H__ #define __MXML_PARSEEXCEPTION_H__ #include "zmmf/zmmf.h" namespace mxml { class Context; class ParseException : public zmm::Exception { public: zmm::Ref context; public: ParseException(zmm::String msg, zmm::Ref context); }; } #endif // __MXML_PARSEEXCEPTION_H__ mediatomb-0.12.1/src/mxml/context.h0000664000076400007640000000310211352674777014107 00000000000000/*MT* MediaTomb - http://www.mediatomb.cc/ context.h - this file is part of MediaTomb. Copyright (C) 2005 Gena Batyan , Sergey 'Jin' Bostandzhyan Copyright (C) 2006-2010 Gena Batyan , Sergey 'Jin' Bostandzhyan , Leonhard Wimmer MediaTomb is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. MediaTomb is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with MediaTomb; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. $Id: context.h 2081 2010-03-23 20:18:00Z lww $ */ /// \file context.h #ifndef __MXML_CONTEXT_H__ #define __MXML_CONTEXT_H__ #include "zmmf/zmmf.h" namespace mxml { class Context : public zmm::Object { public: zmm::Ref parent; zmm::String location; int line; int col; public: Context(zmm::String location); Context(); zmm::Ref clone(); void setParent(zmm::Ref parent); }; } // namespace #endif // __MXML_CONTEXT_H__ mediatomb-0.12.1/src/online_service_helper.h0000664000076400007640000000350611352675003016000 00000000000000/*MT* MediaTomb - http://www.mediatomb.cc/ online_service_helper.h - this file is part of MediaTomb. Copyright (C) 2005 Gena Batyan , Sergey 'Jin' Bostandzhyan Copyright (C) 2006-2010 Gena Batyan , Sergey 'Jin' Bostandzhyan , Leonhard Wimmer MediaTomb is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. MediaTomb is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with MediaTomb; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. $Id: online_service_helper.h 2081 2010-03-23 20:18:00Z lww $ */ /// \file online_service_helper.h /// \brief Definition of the OnlineServiceHelper class. #ifdef ONLINE_SERVICES #ifndef __ONLINE_SERVICE_HELPER_H__ #define __ONLINE_SERVICE_HELPER_H__ #include "zmm/zmm.h" #include "zmmf/zmmf.h" #include "cds_objects.h" /// \brief This class will handle things that are specific to various services class OnlineServiceHelper : public zmm::Object { public: OnlineServiceHelper(); /// \brief this function will determine the final URL for services that /// need extra steps to do that zmm::String resolveURL(zmm::Ref item); }; #endif//__ONLINE_SERVICE_HELPER_H__ #endif//ONLINE_SERVICES mediatomb-0.12.1/src/io_handler.cc0000664000076400007640000001151711352675003013700 00000000000000/*MT* MediaTomb - http://www.mediatomb.cc/ io_handler.cc - this file is part of MediaTomb. Copyright (C) 2005 Gena Batyan , Sergey 'Jin' Bostandzhyan Copyright (C) 2006-2010 Gena Batyan , Sergey 'Jin' Bostandzhyan , Leonhard Wimmer MediaTomb is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. MediaTomb is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with MediaTomb; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. $Id: io_handler.cc 2081 2010-03-23 20:18:00Z lww $ */ /// \file io_handler.cc /// This handles the VirtualDirCallbacks that come from the web server. #ifdef HAVE_CONFIG_H #include "autoconfig.h" #endif #include "web_callbacks.h" #include "server.h" #include #include #include #include #include #include "common.h" #include "storage.h" #include "cds_objects.h" #include "process.h" #include "update_manager.h" #include "ixml.h" #include "io_handler.h" using namespace zmm; IOHandler::IOHandler() : Object() { } /// \fn static UpnpWebFileHandle web_open(IN const char *filename, /// IN enum UpnpOpenFileMode mode) /// \brief Opens a file for the web server. /// \param filename Name of the file to open. /// \param mode in which the file will be opened (we only support UPNP_READ) /// /// This function is called by the web server when it needs to open a file. /// /// \retval UpnpWebFileHandle A valid file handle. /// \retval NULL Error. void IOHandler::open(IN enum UpnpOpenFileMode mode) { } /// \fn static int web_read (IN UpnpWebFileHandle f, OUT char *buf, /// IN size_t length) /// \brief Reads a previously opened file sequentially. /// \param f Handle of the file. /// \param buf This buffer will be filled by fread. /// \param length Number of bytes to read. /// /// This function is called by the web server to perform a sequential /// read from an open file. It copies \b length bytes from the file /// into the buffer. /// /// \retval 0 EOF encountered. /// \retval -1 Error. int IOHandler::read(OUT char *buf, IN size_t length) { return -1; } /// \fn static int web_write (IN UpnpWebFileHandle f,IN char *buf, /// IN size_t length) /// \brief Writes to a previously opened file sequentially. /// \param f Handle of the file. /// \param buf This buffer will be filled by fwrite. /// \param length Number of bytes to fwrite. /// /// This function is called by the web server to perform a sequential /// write to an open file. It copies \b length bytes into the file /// from the buffer. It should return the actual number of bytes /// written, in case of a write error this might be less than /// \b length. /// /// \retval Actual number of bytes written. /// /// \warning Currently this function is not supported. int IOHandler::write(IN char *buf, IN size_t length) { return 0; } /// \fn static int web_seek (IN UpnpWebFileHandle f, IN long offset, /// IN int origin) /// \brief Performs a seek on an open file. /// \param f Handle of the file. /// \param offset Number of bytes to move in the file. For seeking forwards /// positive values are used, for seeking backwards - negative. \b Offset must /// be positive if \b origin is set to \b SEEK_SET /// \param whence The position to move relative to. SEEK_CUR to move relative /// to current position, SEEK_END to move relative to the end of file, /// SEEK_SET to specify an absolute offset. /// /// This function is called by the web server to perform seek on an a file. /// /// \retval 0 On success, non-zero value on error. void IOHandler::seek(IN off_t offset, IN int whence) { } /// \fn static int web_close (IN UpnpWebFileHandle f) /// \brief Closes a previously opened file. /// \param f Handle of the file. /// /// Same as fclose() /// /// \retval 0 On success, non-zero on error. void IOHandler::close() { } mediatomb-0.12.1/src/tools.h0000664000076400007640000003312211352675003012572 00000000000000/*MT* MediaTomb - http://www.mediatomb.cc/ tools.h - this file is part of MediaTomb. Copyright (C) 2005 Gena Batyan , Sergey 'Jin' Bostandzhyan Copyright (C) 2006-2010 Gena Batyan , Sergey 'Jin' Bostandzhyan , Leonhard Wimmer MediaTomb is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. MediaTomb is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with MediaTomb; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. $Id: tools.h 2081 2010-03-23 20:18:00Z lww $ */ /// \file tools.h #ifndef __TOOLS_H__ #define __TOOLS_H__ #include "common.h" #include "rexp.h" #include "io_handler.h" #include "cds_objects.h" #include #ifdef HAVE_MAGIC // for older versions of filemagic extern "C" { #include } #endif /// \brief splits the given string into array of strings using a separator character. /// \param str String to split /// \param sep separator character /// \param treat subsequent separators as empty array elements /// \return array of strings zmm::Ref > split_string(zmm::String str, char sep, bool empty = false); /// \brief splits the given file path into the path to the file and the filename. /// \param str the path to split /// \return an array with the path at position 0 and the filename at position 1. zmm::Ref > split_path(zmm::String str); /// \brief returns str with leading and trailing whitespace removed zmm::String trim_string(zmm::String str); /// \brief Checks existance of the specified file or path. /// \param path file or directory to be checked. /// \param needDir true when checked item has to be a directory. /// \return true path or file exists /// \return false path of file not found bool check_path(zmm::String path, bool needDir = false); /// \brief Checks existance of the specified file or path. /// \param path file or directory to be checked. /// \param needDir true when checked item has to be a directory. /// \param existenceUnneeded do not throw exception if file was not found /// \param filesize returns the size of the file /// \return last modification time of the path or directory /// /// More or less the same as check_path, the only difference is, /// that this function throws an exception if a path or directory /// was not found or was not the desired type. Additionally this function /// returns the last modification time of the file or directory and, if /// needed, also the filesize. time_t check_path_ex(zmm::String path, bool needDir = false, bool existenceUnneeded = false, off_t *filesize = NULL); /// \brief Checks if the given binary is executable by our process /// \param path absolute path of the binary /// \param err if not NULL err will contain the errno result of the check /// \return true if the given binary is executable by our process, otherwise /// false bool is_executable(zmm::String path, int *err = NULL); /// \brief Checks if the given executable exists in $PATH /// \param exec filename of the executable that needs to be checked /// \return aboslute path to the given executable or nil of it was not found zmm::String find_in_path(zmm::String exec); /// \brief Checks if the string contains any data. /// \param str String to be checked. /// \return true if ok /// \return false if string was either nil or empty /// /// Checks if str is nil or "" bool string_ok(zmm::String str); bool string_ok(zmm::Ref str); /// \brief Checks if the string contains any data. /// \param str String to be checked. /// /// Checks if str is nil or "" and throws an exception if that is the case. void string_ok_ex(zmm::String str); /// \brief Render HTML that is doing a redirect to the given ip, port and html page. /// \param ip IP address as string. /// \param port Port as string. /// \oaram page HTML document to redirect to. /// \return string representing the desired HTML document. zmm::String http_redirect_to(zmm::String ip, zmm::String port, zmm::String page = _("")); /// \brief Encodes arbitrary data to a hex string. /// \param data Buffer that is holding the data /// \param len Length of the buffer. /// \return string of the data in hex representation. zmm::String hex_encode(void *data, int len); /// \brief Decodes hex encoded string. /// \param encoded hex-encoded string. /// \return decoded string zmm::String hex_decode_string(zmm::String encoded); /// \brief Generates random id. /// \return String representing the newly created id. zmm::String generate_random_id(); /// \brief Generates hex md5 sum of the given data. zmm::String hex_md5(void *data, int length); /// \brief Generates hex md5 sum of the given string. zmm::String hex_string_md5(zmm::String str); /// \brief Converts a string to a URL (meaning: %20 instead of space and so on) /// \param str String to be converted. /// \return string that contains the url-escaped representation of the original string. zmm::String url_escape(zmm::String str); /// \brief Opposite of url_escape :) zmm::String url_unescape(zmm::String str); /// \brief Convert an array of strings to a CSV list, with additional protocol information /// \param array that needs to be converted /// \return string containing the CSV list zmm::String mime_types_to_CSV(zmm::Ref > mimeTypes); /// \brief a wrapper for the reentrant strerror_r() function /// \param mt_errno the errno to get the error string from /// \return the error string zmm::String mt_strerror(int mt_errno); /// \brief Reads the entire contents of a text file and returns it as a string. zmm::String read_text_file(zmm::String path); /// \brief writes a string into a text file void write_text_file(zmm::String path, zmm::String contents); /// \brief copies a file /// \param from the path to the file to copy from /// \param to the path to the file to copy to void copy_file(zmm::String from, zmm::String to); typedef int (*COMPARATOR) (void *, void *); typedef void * COMPARABLE; int StringBaseComparatorAsc(void *, void *); void quicksort(COMPARABLE *arr, int size, COMPARATOR comparator); /// \brief Renders a string that can be used as the protocolInfo resource /// attribute: "http-get:*:mimetype:*" /// /// \param mimetype the mimetype that should be inserted /// \param protocol the protocol which should be inserted (default: "http-get") /// \return The rendered protocolInfo String zmm::String renderProtocolInfo(zmm::String mimetype, zmm::String protocol = _(PROTOCOL), zmm::String extend = nil); /// \brief Extracts mimetype from the protocol info string. /// \param protocol info string as used in the protocolInfo attribute zmm::String getMTFromProtocolInfo(zmm::String protocol); /// \brief Parses a protocolInfo string (see renderProtocolInfo). /// /// \param protocolInfoStr the String from renderProtocolInfo. /// \return Protocol (i.e. http-get). zmm::String getProtocol(zmm::String protocolInfo); /// \brief Converts a number of seconds to H+:MM:SS representation as required by /// the UPnP spec zmm::String secondsToHMS(int seconds); /// \brief converts a "H:MM:SS:" representation to seconds int HMSToSeconds(zmm::String time); #ifdef HAVE_MAGIC /// \brief Extracts mimetype from a file using filemagic zmm::String get_mime_type(magic_set *ms, zmm::Ref reMimetype, zmm::String file); /// \brief Extracts mimetype from a buffer using filemagic zmm::String get_mime_type_from_buffer(magic_set *ms, zmm::Ref reMimetype, void *buffer, size_t length); #endif // HAVE_MAGIC #ifdef SOPCAST /// \brief Finds a free port between range_min and range_max on localhost. int find_local_port(unsigned short range_min, unsigned short range_max); #endif /// \brief Extracts resolution from a JPEG image zmm::String get_jpeg_resolution(zmm::Ref ioh); /// \brief Sets resolution for a given resource index, item must be a JPEG image void set_jpeg_resolution_resource(zmm::Ref item, int res_num); /// \brief checks if the given string has the format xr x yr (i.e. 320x200 etc.) bool check_resolution(zmm::String resolution, int *x = NULL, int *y = NULL); zmm::String escape(zmm::String string, char escape_char, char to_escape); /// \brief Unescapes the given String. /// \param string the string to unescape /// \param escape the escape character (e.g. "\") /// \return the unescaped string zmm::String unescape(zmm::String string, char escape); /* /// \brief Unescape & " and similar XML sequences. /// /// This function will silently ignore and pass on any invalid combinations. /// \param string that should be unescaped /// \return the unescaped string zmm::String xml_unescape(zmm::String string); */ /// brief Unescape all & occurances in a given string. /// /// This function will look for & in a string and convert it to '&', /// all other tokens are not touched. /// \param string that should be unescaped /// \return the unescaped string zmm::String unescape_amp(zmm::String string); /// \brief Returns the first string if it isn't "nil", otherwise the fallback string. /// \param first the string to return if it isn't nil /// \param fallback fallback string to return if first is nil /// \return return first if it isn't nil, otherwise fallback zmm::String fallbackString(zmm::String first, zmm::String fallback); /// \brief computes an (unsigned int) hash for the given string /// \param str the string to compute the hash for /// \return return the (unsigned int) hash value unsigned int stringHash(zmm::String str); zmm::String intArrayToCSV(int *array, int size); //inline void getTimeval(struct timeval *now) { gettimeofday(now, NULL); } void getTimespecNow(struct timespec *ts); long getDeltaMillis(struct timespec *first); long getDeltaMillis(struct timespec *first, struct timespec *second); void getTimespecAfterMillis(long delta, struct timespec *ret, struct timespec *start = NULL); int compareTimespecs(struct timespec *a, struct timespec *b); /* /// \bried Returns the current milliseconds since the "epoch" or since startMillis (which are counted since the epoch). long getMillis(long startMillis = 0); void millisToTimespec(long millis, struct timespec *spec); */ /// \brief This function makes sure that there are no trailing slashes, no /// consecutive slashes. If /../ or /..\0 is encountered an exception is /// thrown. zmm::String normalizePath(zmm::String path); /// \brief Finds the IP address of the specified network interface. /// \param interface i.e. eth0, lo, etc. /// \return IP address or nil if interface was not found. zmm::String interfaceToIP(zmm::String interface); /// \brief Returns true if the given string is eitehr "yes" or "no", otherwise /// returns false. bool validateYesNo(zmm::String value); /// \brief Parses a command line, splitting the arguments into an array and /// substitutes %in and %out tokens with given strings. /// /// This function splits a string into array parts, where space is used as the /// separator. In addition special %in and %out tokens are replaced by given /// strings. /// \todo add escaping zmm::Ref > parseCommandLine(zmm::String line, zmm::String in, zmm::String out); /// \brief this is the mkstemp routine from glibc, the only difference is that /// it does not return an fd but just the name that we could use. /// /// The reason behind this is, that we need to open a pipe, while mkstemp will /// open a regular file. zmm::String tempName(zmm::String leadPath, char *tmpl); /// \brief Determines if the particular ogg file contains a video (theora) bool isTheora(zmm::String ogg_filename); /// \brief Gets an absolute filename as a parameter and returns the last parent /// /// "/some/path/to/file.txt" -> "to" zmm::String get_last_path(zmm::String location); /// \brief Calculates a position where it is safe to cut an UTF-8 string. /// \return Caclulated position or -1 in case of an error. ssize_t getValidUTF8CutPosition(zmm::String str, size_t cutpos); #ifdef EXTEND_PROTOCOLINFO zmm::String getDLNAtransferHeader(zmm::String mimeType, zmm::String header); #endif #ifndef HAVE_FFMPEG /// \brief Fallback code to retrieve the used fourcc from an AVI file. /// /// This code is based on offsets, so we will use it only if ffmpeg is not /// available. zmm::String getAVIFourCC(zmm::String avi_filename); #endif #ifdef TOMBDEBUG struct profiling_t { struct timespec sum; struct timespec last_start; bool running; pthread_t thread; }; #define PROFILING_T_INIT {{0,0},{0,0},false, pthread_self()} void profiling_start(struct profiling_t *data); void profiling_end(struct profiling_t *data); void profiling_print(struct profiling_t *data); #define PROF_INIT(var) profiling_t var = PROFILING_T_INIT #define PROF_START(var) profiling_start(var) #define PROF_END(var) profiling_end(var) #define PROF_PRINT(var) profiling_print(var) #else #define profiling_t int #define PROF_INIT(var) profiling_t var #define PROF_START(var) #define PROF_END(var) #define PROF_PRINT(var) /* #define profiling_start() #define profiling_end() #define profiling_get_time() */ #endif #endif // __TOOLS_H__ mediatomb-0.12.1/src/storage/0000775000076400007640000000000011357204747013014 500000000000000mediatomb-0.12.1/src/storage/storage_cache.h0000664000076400007640000000443111352674776015706 00000000000000/*MT* MediaTomb - http://www.mediatomb.cc/ storage_cache.h - this file is part of MediaTomb. Copyright (C) 2005 Gena Batyan , Sergey 'Jin' Bostandzhyan Copyright (C) 2006-2010 Gena Batyan , Sergey 'Jin' Bostandzhyan , Leonhard Wimmer MediaTomb is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. MediaTomb is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with MediaTomb; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. $Id: storage_cache.h 2081 2010-03-23 20:18:00Z lww $ */ /// \file storage_cache.h #ifndef __STORAGE_CACHE_H__ #define __STORAGE_CACHE_H__ #include "zmmf/zmmf.h" #include "common.h" #include "hash.h" #include "sync.h" #include "cache_object.h" #define STORAGE_CACHE_CAPACITY 29989 #define STORAGE_CACHE_MAXFILL 9973 class StorageCache : public zmm::Object { public: StorageCache(); zmm::Ref getObject(int id); zmm::Ref getObjectDefinitely(int id); bool removeObject(int id); void clear(); zmm::Ref > getObjects(zmm::String location); void checkLocation(zmm::Ref obj); // a child was added to the specified object - update numChildren accordingly, // if the object has cached information void addChild(int id); bool flushed(); zmm::Ref getMutex() { return mutex; } private: int capacity; int maxfill; bool hasBeenFlushed; void ensureFillLevelOk(); zmm::Ref > idHash; zmm::Ref > > locationHash; zmm::Ref mutex; }; #endif // __STORAGE_CACHE_H__ mediatomb-0.12.1/src/storage/sql_storage.cc0000664000076400007640000023471511352700412015563 00000000000000/*MT* MediaTomb - http://www.mediatomb.cc/ sql_storage.cc - this file is part of MediaTomb. Copyright (C) 2005 Gena Batyan , Sergey 'Jin' Bostandzhyan Copyright (C) 2006-2010 Gena Batyan , Sergey 'Jin' Bostandzhyan , Leonhard Wimmer MediaTomb is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. MediaTomb is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with MediaTomb; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. $Id: sql_storage.cc 2085 2010-03-25 15:27:12Z jin_eld $ */ /// \file sql_storage.cc #ifdef HAVE_CONFIG_H #include "autoconfig.h" #endif #include #include "sql_storage.h" #include "tools.h" #include "update_manager.h" #include "string_converter.h" #include "config_manager.h" #include "filesystem.h" using namespace zmm; #define MAX_REMOVE_SIZE 10000 #define MAX_REMOVE_RECURSION 500 #define SQL_NULL "NULL" #define RESOURCE_SEP '|' enum { _id = 0, _ref_id, _parent_id, _object_type, _upnp_class, _dc_title, _location, _location_hash, _metadata, _auxdata, _resources, _update_id, _mime_type, _flags, _track_number, _service_id, _ref_upnp_class, _ref_location, _ref_metadata, _ref_auxdata, _ref_resources, _ref_mime_type, _ref_service_id, _as_persistent }; /* table quote */ #define TQ(data) QTB << data << QTE /* table quote with dot */ #define TQD(data1, data2) TQ(data1) << '.' << TQ(data2) #define SEL_F_QUOTED << TQ('f') << #define SEL_RF_QUOTED << TQ("rf") << // end quote, space, f quoted, dot, begin quote #define SEL_EQ_SP_FQ_DT_BQ << QTE << ',' << TQ('f') << '.' << QTB << #define SEL_EQ_SP_RFQ_DT_BQ << QTE << ',' << TQ("rf") << '.' << QTB << #define SELECT_DATA_FOR_STRINGBUFFER \ TQ('f') << '.' << QTB << "id" \ SEL_EQ_SP_FQ_DT_BQ "ref_id" \ SEL_EQ_SP_FQ_DT_BQ "parent_id" \ SEL_EQ_SP_FQ_DT_BQ "object_type" \ SEL_EQ_SP_FQ_DT_BQ "upnp_class" \ SEL_EQ_SP_FQ_DT_BQ "dc_title" \ SEL_EQ_SP_FQ_DT_BQ "location" \ SEL_EQ_SP_FQ_DT_BQ "location_hash" \ SEL_EQ_SP_FQ_DT_BQ "metadata" \ SEL_EQ_SP_FQ_DT_BQ "auxdata" \ SEL_EQ_SP_FQ_DT_BQ "resources" \ SEL_EQ_SP_FQ_DT_BQ "update_id" \ SEL_EQ_SP_FQ_DT_BQ "mime_type" \ SEL_EQ_SP_FQ_DT_BQ "flags" \ SEL_EQ_SP_FQ_DT_BQ "track_number" \ SEL_EQ_SP_FQ_DT_BQ "service_id" \ SEL_EQ_SP_RFQ_DT_BQ "upnp_class" \ SEL_EQ_SP_RFQ_DT_BQ "location" \ SEL_EQ_SP_RFQ_DT_BQ "metadata" \ SEL_EQ_SP_RFQ_DT_BQ "auxdata" \ SEL_EQ_SP_RFQ_DT_BQ "resources" \ SEL_EQ_SP_RFQ_DT_BQ "mime_type" \ SEL_EQ_SP_RFQ_DT_BQ "service_id" << QTE \ << ',' << TQD("as","persistent") #define SQL_QUERY_FOR_STRINGBUFFER "SELECT " << SELECT_DATA_FOR_STRINGBUFFER << \ " FROM " << TQ(CDS_OBJECT_TABLE) << ' ' << TQ('f') << " LEFT JOIN " \ << TQ(CDS_OBJECT_TABLE) << ' ' << TQ("rf") << " ON " << TQD('f',"ref_id") \ << '=' << TQD("rf","id") << " LEFT JOIN " << TQ(AUTOSCAN_TABLE) << ' ' \ << TQ("as") << " ON " << TQD("as","obj_id") << '=' << TQD('f',"id") << ' ' #define SQL_QUERY sql_query /* enum for createObjectFromRow's mode parameter */ SQLStorage::SQLStorage() : Storage() { table_quote_begin = '\0'; table_quote_end = '\0'; lastID = INVALID_OBJECT_ID; } void SQLStorage::init() { if (table_quote_begin == '\0' || table_quote_end == '\0') throw _Exception(_("quote vars need to be overriden!")); Ref buf(new StringBuffer()); *buf << SQL_QUERY_FOR_STRINGBUFFER; this->sql_query = buf->toString(); if (ConfigManager::getInstance()->getBoolOption(CFG_SERVER_STORAGE_CACHING_ENABLED)) { cache = Ref(new StorageCache()); insertBufferOn = true; } else { cache = nil; insertBufferOn = false; } insertBufferEmpty = true; insertBufferMutex = Ref(new Mutex()); insertBufferStatementCount = 0; insertBufferByteCount = 0; //log_debug("using SQL: %s\n", this->sql_query.c_str()); //objectTitleCache = Ref >(new DSOHash(OBJECT_CACHE_CAPACITY)); //objectIDCache = Ref >(new DBOHash(OBJECT_CACHE_CAPACITY, -100)); /* Ref res = select(_("SELECT MAX(id) + 1 FROM cds_objects")); Ref row = res->nextRow(); nextObjectID = row->col(0).toInt(); log_debug(("PRELOADING OBJECTS...\n")); res = select(getSelectQuery(SELECT_FULL)); Ref > arr(new Array()); while((row = res->nextRow()) != nil) { Ref obj = createObjectFromRow(row, SELECT_FULL); obj->optimize(); objectTitleCache->put(String::from(obj->getParentID()) + '|' + obj->getTitle(), obj); objectIDCache->put(obj->getID(), obj); } log_debug(("PRELOADING OBJECTS DONE\n")); */ } void SQLStorage::dbReady() { nextIDMutex = Ref(new Mutex());; loadLastID(); } void SQLStorage::shutdown() { flushInsertBuffer(); shutdownDriver(); } /* SQLStorage::~SQLStorage() { } */ Ref SQLStorage::checkRefID(Ref obj) { if (! obj->isVirtual()) throw _Exception(_("checkRefID called for a non-virtual object")); int refID = obj->getRefID(); String location = obj->getLocation(); if (! string_ok(location)) throw _Exception(_("tried to check refID without a location set")); if (refID > 0) { try { Ref refObj; refObj = loadObject(refID); if (refObj != nil && refObj->getLocation() == location) return refObj; } catch (Exception e) { // this should never happen - but fail softly if compiled without debugging assert(0); throw _Exception(_("illegal refID was set")); } } // this should never happen - but fail softly if compiled without debugging // we do this assert to find code while debugging, that doesn't set the // refID correctly assert(0); return findObjectByPath(location); } Ref > SQLStorage::_addUpdateObject(Ref obj, bool isUpdate, int *changedContainer) { int objectType = obj->getObjectType(); Ref refObj = nil; bool hasReference = false; bool playlistRef = obj->getFlag(OBJECT_FLAG_PLAYLIST_REF); if (playlistRef) { if (IS_CDS_PURE_ITEM(objectType)) throw _Exception(_("tried to add pure item with PLAYLIST_REF flag set")); if (obj->getRefID() <= 0) throw _Exception(_("PLAYLIST_REF flag set but refId is <=0")); refObj = loadObject(obj->getRefID()); if (refObj == nil) throw _Exception(_("PLAYLIST_REF flag set but refId doesn't point to an existing object")); } else if (obj->isVirtual() && IS_CDS_PURE_ITEM(objectType)) { hasReference = true; refObj = checkRefID(obj); if (refObj == nil) throw _Exception(_("tried to add or update a virtual object with illegal reference id and an illegal location")); } else if (obj->getRefID() > 0) { if (obj->getFlag(OBJECT_FLAG_ONLINE_SERVICE)) { hasReference = true; refObj = loadObject(obj->getRefID()); if (refObj == nil) throw _Exception(_("OBJECT_FLAG_ONLINE_SERVICE and refID set but refID doesn't point to an existing object")); } else if (IS_CDS_CONTAINER(objectType)) { // in this case it's a playlist-container. that's ok // we don't need to do anything } else throw _Exception(_("refId set, but it makes no sense")); } Ref > returnVal(new Array(2)); Ref cdsObjectSql(new Dictionary()); returnVal->append(Ref (new AddUpdateTable(_(CDS_OBJECT_TABLE), cdsObjectSql))); cdsObjectSql->put(_("object_type"), quote(objectType)); if (hasReference || playlistRef) cdsObjectSql->put(_("ref_id"), quote(refObj->getID())); else if (isUpdate) cdsObjectSql->put(_("ref_id"), _(SQL_NULL)); if (! hasReference || refObj->getClass() != obj->getClass()) cdsObjectSql->put(_("upnp_class"), quote(obj->getClass())); else if (isUpdate) cdsObjectSql->put(_("upnp_class"), _(SQL_NULL)); //if (!hasReference || refObj->getTitle() != obj->getTitle()) cdsObjectSql->put(_("dc_title"), quote(obj->getTitle())); //else if (isUpdate) // cdsObjectSql->put(_("dc_title"), _(SQL_NULL)); if (isUpdate) cdsObjectSql->put(_("metadata"), _(SQL_NULL)); Ref dict = obj->getMetadata(); if (dict->size() > 0) { if (! hasReference || ! refObj->getMetadata()->equals(obj->getMetadata())) { cdsObjectSql->put(_("metadata"), quote(dict->encode())); } } if (isUpdate) cdsObjectSql->put(_("auxdata"), _(SQL_NULL)); dict = obj->getAuxData(); if (dict->size() > 0 && (! hasReference || ! refObj->getAuxData()->equals(obj->getAuxData()))) { cdsObjectSql->put(_("auxdata"), quote(obj->getAuxData()->encode())); } if (! hasReference || (! obj->getFlag(OBJECT_FLAG_USE_RESOURCE_REF) && ! refObj->resourcesEqual(obj))) { // encode resources Ref resBuf(new StringBuffer()); for (int i = 0; i < obj->getResourceCount(); i++) { if (i > 0) *resBuf << RESOURCE_SEP; *resBuf << obj->getResource(i)->encode(); } String resStr = resBuf->toString(); if (string_ok(resStr)) cdsObjectSql->put(_("resources"), quote(resStr)); else cdsObjectSql->put(_("resources"), _(SQL_NULL)); } else if (isUpdate) cdsObjectSql->put(_("resources"), _(SQL_NULL)); obj->clearFlag(OBJECT_FLAG_USE_RESOURCE_REF); cdsObjectSql->put(_("flags"), quote(obj->getFlags())); if (IS_CDS_CONTAINER(objectType)) { if (! (isUpdate && obj->isVirtual()) ) throw _Exception(_("tried to add a container or tried to update a non-virtual container via _addUpdateObject; is this correct?")); String dbLocation = addLocationPrefix(LOC_VIRT_PREFIX, obj->getLocation()); cdsObjectSql->put(_("location"), quote(dbLocation)); cdsObjectSql->put(_("location_hash"), quote(stringHash(dbLocation))); } if (IS_CDS_ITEM(objectType)) { Ref item = RefCast(obj, CdsItem); if (! hasReference) { String loc = item->getLocation(); if (!string_ok(loc)) throw _Exception(_("tried to create or update a non-referenced item without a location set")); if (IS_CDS_PURE_ITEM(objectType)) { Ref > pathAr = split_path(loc); String path = pathAr->get(0); int parentID = ensurePathExistence(path, changedContainer); item->setParentID(parentID); String dbLocation = addLocationPrefix(LOC_FILE_PREFIX, loc); cdsObjectSql->put(_("location"), quote(dbLocation)); cdsObjectSql->put(_("location_hash"), quote(stringHash(dbLocation))); } else { // URLs and active items cdsObjectSql->put(_("location"), quote(loc)); cdsObjectSql->put(_("location_hash"), _(SQL_NULL)); } } else { if (isUpdate) { cdsObjectSql->put(_("location"), _(SQL_NULL)); cdsObjectSql->put(_("location_hash"), _(SQL_NULL)); } } if (item->getTrackNumber() > 0) { cdsObjectSql->put(_("track_number"), quote(item->getTrackNumber())); } else { if (isUpdate) cdsObjectSql->put(_("track_number"), _(SQL_NULL)); } if (string_ok(item->getServiceID())) { if (! hasReference || RefCast(refObj,CdsItem)->getServiceID() != item->getServiceID()) cdsObjectSql->put(_("service_id"), quote(item->getServiceID())); else cdsObjectSql->put(_("service_id"), _(SQL_NULL)); } else { if (isUpdate) cdsObjectSql->put(_("service_id"), _(SQL_NULL)); } cdsObjectSql->put(_("mime_type"), quote(item->getMimeType())); } if (IS_CDS_ACTIVE_ITEM(objectType)) { Ref cdsActiveItemSql(new Dictionary()); returnVal->append(Ref (new AddUpdateTable(_(CDS_ACTIVE_ITEM_TABLE), cdsActiveItemSql))); Ref aitem = RefCast(obj, CdsActiveItem); cdsActiveItemSql->put(_("id"), String::from(aitem->getID())); cdsActiveItemSql->put(_("action"), quote(aitem->getAction())); cdsActiveItemSql->put(_("state"), quote(aitem->getState())); } // check for a duplicate (virtual) object if (hasReference && ! isUpdate) { Ref qb(new StringBuffer()); *qb << "SELECT " << TQ("id") << " FROM " << TQ(CDS_OBJECT_TABLE) << " WHERE " << TQ("parent_id") << '=' << quote(obj->getParentID()) << " AND " << TQ("ref_id") << '=' << quote(refObj->getID()) << " AND " << TQ("dc_title") << '=' << quote(obj->getTitle()) << " LIMIT 1"; Ref res = select(qb); // if duplicate items is found - ignore if (res != nil && (res->nextRow() != nil)) return nil; } if (obj->getParentID() == INVALID_OBJECT_ID) throw _Exception(_("tried to create or update an object with an illegal parent id")); cdsObjectSql->put(_("parent_id"), String::from(obj->getParentID())); return returnVal; } void SQLStorage::addObject(Ref obj, int *changedContainer) { if (obj->getID() != INVALID_OBJECT_ID) throw _Exception(_("tried to add an object with an object ID set")); //obj->setID(INVALID_OBJECT_ID); Ref > data = _addUpdateObject(obj, false, changedContainer); if (data == nil) return; int lastInsertID = INVALID_OBJECT_ID; for (int i = 0; i < data->size(); i++) { Ref addUpdateTable = data->get(i); String tableName = addUpdateTable->getTable(); Ref > dataElements = addUpdateTable->getDict()->getElements(); Ref fields(new StringBuffer(128)); Ref values(new StringBuffer(128)); for (int j = 0; j < dataElements->size(); j++) { Ref element = dataElements->get(j); if (j != 0) { *fields << ','; *values << ','; } *fields << TQ(element->getKey()); if (lastInsertID != INVALID_OBJECT_ID && element->getKey() == "id" && element->getValue().toInt() == INVALID_OBJECT_ID ) *values << lastInsertID; else *values << element->getValue(); } /* manually generate ID */ if (lastInsertID == INVALID_OBJECT_ID && tableName == _(CDS_OBJECT_TABLE)) { lastInsertID = getNextID(); obj->setID(lastInsertID); *fields << ',' << TQ("id"); *values << ',' << quote(lastInsertID); } /* -------------------- */ Ref qb(new StringBuffer(256)); *qb << "INSERT INTO " << TQ(tableName) << " (" << fields->toString() << ") VALUES (" << values->toString() << ')'; log_debug("insert_query: %s\n", qb->toString().c_str()); /* if (lastInsertID == INVALID_OBJECT_ID && tableName == _(CDS_OBJECT_TABLE)) { lastInsertID = exec(qb, true); obj->setID(lastInsertID); } else exec(qb); */ if (! doInsertBuffering()) exec(qb); else addToInsertBuffer(qb); } /* add to cache */ if (cacheOn()) { AUTOLOCK(cache->getMutex()); cache->addChild(obj->getParentID()); if (cache->flushed()) flushInsertBuffer(); addObjectToCache(obj, true); } /* ------------ */ } void SQLStorage::updateObject(zmm::Ref obj, int *changedContainer) { flushInsertBuffer(); Ref > data; if (obj->getID() == CDS_ID_FS_ROOT) { data = Ref >(new Array(1)); Ref cdsObjectSql(new Dictionary()); data->append(Ref (new AddUpdateTable(_(CDS_OBJECT_TABLE), cdsObjectSql))); cdsObjectSql->put(_("dc_title"), quote(obj->getTitle())); setFsRootName(obj->getTitle()); cdsObjectSql->put(_("upnp_class"), quote(obj->getClass())); } else { if (IS_FORBIDDEN_CDS_ID(obj->getID())) throw _Exception(_("tried to update an object with a forbidden ID (")+obj->getID()+")!"); data = _addUpdateObject(obj, true, changedContainer); if (data == nil) return; } for (int i = 0; i < data->size(); i++) { Ref addUpdateTable = data->get(i); String tableName = addUpdateTable->getTable(); Ref > dataElements = addUpdateTable->getDict()->getElements(); Ref qb(new StringBuffer(256)); *qb << "UPDATE " << TQ(tableName) << " SET "; for (int j = 0; j < dataElements->size(); j++) { Ref element = dataElements->get(j); if (j != 0) { *qb << ','; } *qb << TQ(element->getKey()) << '=' << element->getValue(); } *qb << " WHERE id = " << obj->getID(); log_debug("upd_query: %s\n", qb->toString().c_str()); exec(qb); } /* add to cache */ addObjectToCache(obj); /* ------------ */ } Ref SQLStorage::loadObject(int objectID) { /* check cache */ if (cacheOn()) { AUTOLOCK(cache->getMutex()); Ref cObj = cache->getObject(objectID); if (cObj != nil) { if (cObj->knowsObject()) return cObj->getObject(); } } /* ----------- */ /* Ref obj = objectIDCache->get(objectID); if (obj != nil) return obj; throw _Exception(_("Object not found: ") + objectID); */ Ref qb(new StringBuffer()); //log_debug("sql_query = %s\n",sql_query.c_str()); *qb << SQL_QUERY << " WHERE " << TQD('f',"id") << '=' << objectID; Ref res = select(qb); Ref row; if (res != nil && (row = res->nextRow()) != nil) { return createObjectFromRow(row); } throw _ObjectNotFoundException(_("Object not found: ") + objectID); } Ref SQLStorage::loadObjectByServiceID(String serviceID) { flushInsertBuffer(); Ref qb(new StringBuffer()); *qb << SQL_QUERY << " WHERE " << TQD('f',"service_id") << '=' << quote(serviceID); Ref res = select(qb); Ref row; if (res != nil && (row = res->nextRow()) != nil) { return createObjectFromRow(row); } return nil; } Ref SQLStorage::getServiceObjectIDs(char servicePrefix) { flushInsertBuffer(); Ref objectIDs(new IntArray()); Ref qb(new StringBuffer()); *qb << "SELECT " << TQ("id") << " FROM " << TQ(CDS_OBJECT_TABLE) << " WHERE " << TQ("service_id") << " LIKE " << quote(String(servicePrefix)+'%'); Ref res = select(qb); if (res == nil) throw _Exception(_("db error")); Ref row; while((row = res->nextRow()) != nil) { objectIDs->append(row->col(0).toInt()); } return objectIDs; } Ref > SQLStorage::browse(Ref param) { flushInsertBuffer(); int objectID; int objectType = 0; bool getContainers = param->getFlag(BROWSE_CONTAINERS); bool getItems = param->getFlag(BROWSE_ITEMS); objectID = param->getObjectID(); Ref res; Ref row; bool haveObjectType = false; /* check cache */ if (cacheOn()) { AUTOLOCK(cache->getMutex()); Ref cObj = cache->getObject(objectID); if (cObj != nil && cObj->knowsObjectType()) { objectType = cObj->getObjectType(); haveObjectType = true; } } /* ----------- */ Ref qb(new StringBuffer()); if (! haveObjectType) { *qb << "SELECT " << TQ("object_type") << " FROM " << TQ(CDS_OBJECT_TABLE) << " WHERE " << TQ("id") << '=' << objectID; res = select(qb); if(res != nil && (row = res->nextRow()) != nil) { objectType = row->col(0).toInt(); haveObjectType = true; /* add to cache */ if (cacheOn()) { AUTOLOCK(cache->getMutex()); cache->getObjectDefinitely(objectID)->setObjectType(objectType); if (cache->flushed()) flushInsertBuffer(); } /* ------------ */ } else { throw _ObjectNotFoundException(_("Object not found: ") + objectID); } row = nil; res = nil; } bool hideFsRoot = param->getFlag(BROWSE_HIDE_FS_ROOT); if(param->getFlag(BROWSE_DIRECT_CHILDREN) && IS_CDS_CONTAINER(objectType)) { param->setTotalMatches(getChildCount(objectID, getContainers, getItems, hideFsRoot)); } else { param->setTotalMatches(1); } // order by code.. qb->clear(); if (param->getFlag(BROWSE_TRACK_SORT)) *qb << TQD('f',"track_number") << ','; *qb << TQD('f',"dc_title"); String orderByCode = qb->toString(); qb->clear(); *qb << SQL_QUERY << " WHERE "; if(param->getFlag(BROWSE_DIRECT_CHILDREN) && IS_CDS_CONTAINER(objectType)) { int count = param->getRequestedCount(); bool doLimit = true; if (! count) { if (param->getStartingIndex()) count = INT_MAX; else doLimit = false; } *qb << TQD('f',"parent_id") << '=' << objectID; if (objectID == CDS_ID_ROOT && hideFsRoot) *qb << " AND " << TQD('f',"id") << "!=" << quote (CDS_ID_FS_ROOT); if (! getContainers && ! getItems) { *qb << " AND 0=1"; } else if (getContainers && ! getItems) { *qb << " AND " << TQD('f',"object_type") << '=' << quote(OBJECT_TYPE_CONTAINER) << " ORDER BY " << orderByCode; } else if (! getContainers && getItems) { *qb << " AND (" << TQD('f',"object_type") << " & " << quote(OBJECT_TYPE_ITEM) << ") = " << quote(OBJECT_TYPE_ITEM) << " ORDER BY " << orderByCode; } else { *qb << " ORDER BY (" << TQD('f',"object_type") << '=' << quote(OBJECT_TYPE_CONTAINER) << ") DESC, " << orderByCode; } if (doLimit) *qb << " LIMIT " << count << " OFFSET " << param->getStartingIndex(); } else // metadata { *qb << TQD('f',"id") << '=' << objectID << " LIMIT 1"; } log_debug("QUERY: %s\n", qb->toString().c_str()); res = select(qb); Ref > arr(new Array()); while((row = res->nextRow()) != nil) { Ref obj = createObjectFromRow(row); arr->append(obj); row = nil; } row = nil; res = nil; // update childCount fields for (int i = 0; i < arr->size(); i++) { Ref obj = arr->get(i); if (IS_CDS_CONTAINER(obj->getObjectType())) { Ref cont = RefCast(obj, CdsContainer); cont->setChildCount(getChildCount(cont->getID(), getContainers, getItems, hideFsRoot)); } } return arr; } int SQLStorage::getChildCount(int contId, bool containers, bool items, bool hideFsRoot) { if (! containers && ! items) return 0; /* check cache */ if (cacheOn() && containers && items && ! (contId == CDS_ID_ROOT && hideFsRoot)) { AUTOLOCK(cache->getMutex()); Ref cObj = cache->getObject(contId); if (cObj != nil) { if (cObj->knowsNumChildren()) return cObj->getNumChildren(); //cObj->debug(); } } /* ----------- */ flushInsertBuffer(); Ref row; Ref res; Ref qb(new StringBuffer()); *qb << "SELECT COUNT(*) FROM " << TQ(CDS_OBJECT_TABLE) << " WHERE " << TQ("parent_id") << '=' << contId; if (containers && ! items) *qb << " AND " << TQ("object_type") << '=' << OBJECT_TYPE_CONTAINER; else if (items && ! containers) *qb << " AND (" << TQ("object_type") << " & " << OBJECT_TYPE_ITEM << ") = " << OBJECT_TYPE_ITEM; if (contId == CDS_ID_ROOT && hideFsRoot) { *qb << " AND " << TQ("id") << "!=" << quote (CDS_ID_FS_ROOT); } res = select(qb); if (res != nil && (row = res->nextRow()) != nil) { int childCount = row->col(0).toInt(); /* add to cache */ if (cacheOn() && containers && items && ! (contId == CDS_ID_ROOT && hideFsRoot)) { AUTOLOCK(cache->getMutex()); cache->getObjectDefinitely(contId)->setNumChildren(childCount); if (cache->flushed()) flushInsertBuffer(); } /* ------------ */ return childCount; } return 0; } Ref > SQLStorage::getMimeTypes() { flushInsertBuffer(); Ref > arr(new Array()); Ref qb(new StringBuffer()); *qb << "SELECT DISTINCT " << TQ("mime_type") << " FROM " << TQ(CDS_OBJECT_TABLE) << " WHERE " << TQ("mime_type") << " IS NOT NULL ORDER BY " << TQ("mime_type"); Ref res = select(qb); if (res == nil) throw _Exception(_("db error")); Ref row; while ((row = res->nextRow()) != nil) { arr->append(String(row->col(0))); } return arr; } Ref SQLStorage::_findObjectByPath(String fullpath) { //log_debug("fullpath: %s\n", fullpath.c_str()); fullpath = fullpath.reduce(DIR_SEPARATOR); //log_debug("fullpath after reduce: %s\n", fullpath.c_str()); Ref > pathAr = split_path(fullpath); String path = pathAr->get(0); String filename = pathAr->get(1); bool file = string_ok(filename); String dbLocation; if (file) { //flushInsertBuffer(); - not needed if correctly in cache (see below) dbLocation = addLocationPrefix(LOC_FILE_PREFIX, fullpath); } else dbLocation = addLocationPrefix(LOC_DIR_PREFIX, path); /* check cache */ if (cacheOn()) { AUTOLOCK(cache->getMutex()); Ref > objects = cache->getObjects(dbLocation); if (objects != nil) { for (int i = 0; i < objects->size(); i++) { Ref cObj = objects->get(i); if (cObj->knowsObject() && cObj->knowsVirtual() && !cObj->getVirtual()) return cObj->getObject(); } } } /* ----------- */ Ref qb(new StringBuffer()); *qb << SQL_QUERY << " WHERE " << TQD('f',"location_hash") << '=' << quote(stringHash(dbLocation)) << " AND " << TQD('f',"location") << '=' << quote(dbLocation) << " AND " << TQD('f',"ref_id") << " IS NULL " "LIMIT 1"; Ref res = select(qb); if (res == nil) throw _Exception(_("error while doing select: ") + qb->toString()); Ref row = res->nextRow(); if (row == nil) return nil; return createObjectFromRow(row); } Ref SQLStorage::findObjectByPath(String fullpath) { return _findObjectByPath(fullpath); } int SQLStorage::findObjectIDByPath(String fullpath) { Ref obj = _findObjectByPath(fullpath); if (obj == nil) return INVALID_OBJECT_ID; return obj->getID(); } int SQLStorage::ensurePathExistence(String path, int *changedContainer) { *changedContainer = INVALID_OBJECT_ID; String cleanPath = path.reduce(DIR_SEPARATOR); if (cleanPath == DIR_SEPARATOR) return CDS_ID_FS_ROOT; if (cleanPath.charAt(cleanPath.length() - 1) == DIR_SEPARATOR) // cut off trailing slash cleanPath = cleanPath.substring(0, cleanPath.length() - 1); return _ensurePathExistence(cleanPath, changedContainer); } int SQLStorage::_ensurePathExistence(String path, int *changedContainer) { if (path == DIR_SEPARATOR) return CDS_ID_FS_ROOT; Ref obj = findObjectByPath(path + DIR_SEPARATOR); if (obj != nil) return obj->getID(); Ref > pathAr = split_path(path); String parent = pathAr->get(0); String folder = pathAr->get(1); int parentID; parentID = ensurePathExistence(parent, changedContainer); Ref f2i = StringConverter::f2i(); if (changedContainer != NULL && *changedContainer == INVALID_OBJECT_ID) *changedContainer = parentID; return createContainer(parentID, f2i->convert(folder), path, false, nil, INVALID_OBJECT_ID); } int SQLStorage::createContainer(int parentID, String name, String path, bool isVirtual, String upnpClass, int refID) { if (refID > 0) { Ref refObj = loadObject(refID); if (refObj == nil) throw _Exception(_("tried to create container with refID set, but refID doesn't point to an existing object")); } String dbLocation = addLocationPrefix((isVirtual ? LOC_VIRT_PREFIX : LOC_DIR_PREFIX), path); int newID = getNextID(); Ref qb(new StringBuffer()); *qb << "INSERT INTO " << TQ(CDS_OBJECT_TABLE) << " (" << TQ("id") << ',' << TQ("parent_id") << ',' << TQ("object_type") << ',' << TQ("upnp_class") << ',' << TQ("dc_title") << ',' << TQ("location") << ',' << TQ("location_hash") << ',' << TQ("ref_id") << ") VALUES (" << newID << ',' << parentID << ',' << OBJECT_TYPE_CONTAINER << ',' << (string_ok(upnpClass) ? quote(upnpClass) : quote(_(UPNP_DEFAULT_CLASS_CONTAINER))) << ',' << quote(name) << ',' << quote(dbLocation) << ',' << quote(stringHash(dbLocation)) << ',' << (refID > 0 ? quote(refID) : _(SQL_NULL)) << ')'; exec(qb); /* inform cache */ if (cacheOn()) { AUTOLOCK(cache->getMutex()); cache->addChild(parentID); if (cache->flushed()) flushInsertBuffer(); Ref cObj = cache->getObjectDefinitely(newID); if (cache->flushed()) flushInsertBuffer(); cObj->setParentID(parentID); cObj->setNumChildren(0); cObj->setObjectType(OBJECT_TYPE_CONTAINER); cObj->setLocation(path); } /* ------------ */ return newID; //return exec(qb, true); } String SQLStorage::buildContainerPath(int parentID, String title) { //title = escape(title, xxx); if (parentID == CDS_ID_ROOT) return String(VIRTUAL_CONTAINER_SEPARATOR) + title; Ref qb(new StringBuffer()); *qb << "SELECT " << TQ("location") << " FROM " << TQ(CDS_OBJECT_TABLE) << " WHERE " << TQ("id") << '=' << parentID << " LIMIT 1"; Ref res = select(qb); if (res == nil) return nil; Ref row = res->nextRow(); if (row == nil) return nil; char prefix; String path = stripLocationPrefix(&prefix, row->col(0)) + VIRTUAL_CONTAINER_SEPARATOR + title; if (prefix != LOC_VIRT_PREFIX) throw _Exception(_("tried to build a virtual container path with an non-virtual parentID")); return path; } void SQLStorage::addContainerChain(String path, String lastClass, int lastRefID, int *containerID, int *updateID) { path = path.reduce(VIRTUAL_CONTAINER_SEPARATOR); if (path == VIRTUAL_CONTAINER_SEPARATOR) { *containerID = CDS_ID_ROOT; return; } Ref qb(new StringBuffer()); String dbLocation = addLocationPrefix(LOC_VIRT_PREFIX, path); *qb << "SELECT " << TQ("id") << " FROM " << TQ(CDS_OBJECT_TABLE) << " WHERE " << TQ("location_hash") << '=' << quote(stringHash(dbLocation)) << " AND " << TQ("location") << '=' << quote(dbLocation) << " LIMIT 1"; Ref res = select(qb); if (res != nil) { Ref row = res->nextRow(); if (row != nil) { if (containerID != NULL) *containerID = row->col(0).toInt(); return; } } int parentContainerID; String newpath, container; stripAndUnescapeVirtualContainerFromPath(path, newpath, container); addContainerChain(newpath, nil, INVALID_OBJECT_ID, &parentContainerID, updateID); if (updateID != NULL && *updateID == INVALID_OBJECT_ID) *updateID = parentContainerID; *containerID = createContainer(parentContainerID, container, path, true, lastClass, lastRefID); } String SQLStorage::addLocationPrefix(char prefix, String path) { return String(prefix) + path; } String SQLStorage::stripLocationPrefix(char* prefix, String path) { if (path == nil) { *prefix = LOC_ILLEGAL_PREFIX; return nil; } *prefix = path.charAt(0); return path.substring(1); } String SQLStorage::stripLocationPrefix(String path) { if (path == nil) return nil; return path.substring(1); } Ref SQLStorage::createObjectFromRow(Ref row) { int objectType = row->col(_object_type).toInt(); Ref obj = CdsObject::createObject(objectType); /* set common properties */ obj->setID(row->col(_id).toInt()); obj->setRefID(row->col(_ref_id).toInt()); obj->setParentID(row->col(_parent_id).toInt()); obj->setTitle(row->col(_dc_title)); obj->setClass(fallbackString(row->col(_upnp_class), row->col(_ref_upnp_class))); obj->setFlags(row->col(_flags).toUInt()); String metadataStr = fallbackString(row->col(_metadata), row->col(_ref_metadata)); Ref meta(new Dictionary()); meta->decode(metadataStr); obj->setMetadata(meta); String auxdataStr = fallbackString(row->col(_auxdata), row->col(_ref_auxdata)); Ref aux(new Dictionary()); aux->decode(auxdataStr); obj->setAuxData(aux); String resources_str = fallbackString(row->col(_resources), row->col(_ref_resources)); bool resource_zero_ok = false; if (string_ok(resources_str)) { Ref > resources = split_string(resources_str, RESOURCE_SEP); for (int i = 0; i < resources->size(); i++) { if (i == 0) resource_zero_ok = true; obj->addResource(CdsResource::decode(resources->get(i))); } } if ( (obj->getRefID() && IS_CDS_PURE_ITEM(objectType)) || (IS_CDS_ITEM(objectType) && ! IS_CDS_PURE_ITEM(objectType)) ) obj->setVirtual(true); else obj->setVirtual(false); // gets set to true for virtual containers below int matched_types = 0; if (IS_CDS_CONTAINER(objectType)) { Ref cont = RefCast(obj, CdsContainer); cont->setUpdateID(row->col(_update_id).toInt()); char locationPrefix; cont->setLocation(stripLocationPrefix(&locationPrefix, row->col(_location))); if (locationPrefix == LOC_VIRT_PREFIX) cont->setVirtual(true); String autoscanPersistent = row->col(_as_persistent); if (string_ok(autoscanPersistent)) { if (remapBool(autoscanPersistent)) cont->setAutoscanType(OBJECT_AUTOSCAN_CFG); else cont->setAutoscanType(OBJECT_AUTOSCAN_UI); } else cont->setAutoscanType(OBJECT_AUTOSCAN_NONE); matched_types++; } if (IS_CDS_ITEM(objectType)) { if (! resource_zero_ok) throw _Exception(_("tried to create object without at least one resource")); Ref item = RefCast(obj, CdsItem); item->setMimeType(fallbackString(row->col(_mime_type), row->col(_ref_mime_type))); if (IS_CDS_PURE_ITEM(objectType)) { if (! obj->isVirtual()) item->setLocation(stripLocationPrefix(row->col(_location))); else item->setLocation(stripLocationPrefix(row->col(_ref_location))); } else // URLs and active items { item->setLocation(fallbackString(row->col(_location), row->col(_ref_location))); } item->setTrackNumber(row->col(_track_number).toInt()); if (string_ok(row->col(_ref_service_id))) item->setServiceID(row->col(_ref_service_id)); else item->setServiceID(row->col(_service_id)); matched_types++; } if (IS_CDS_ACTIVE_ITEM(objectType)) { Ref aitem = RefCast(obj, CdsActiveItem); Ref query(new StringBuffer()); *query << "SELECT " << TQ("id") << ',' << TQ("action") << ',' << TQ("state") << " FROM " << TQ(CDS_ACTIVE_ITEM_TABLE) << " WHERE " << TQ("id") << '=' << quote(aitem->getID()); Ref resAI = select(query); Ref rowAI; if (resAI != nil && (rowAI = resAI->nextRow()) != nil) { aitem->setAction(rowAI->col(1)); aitem->setState(rowAI->col(2)); } else throw _Exception(_("Active Item in cds_objects, but not in cds_active_item")); matched_types++; } if(! matched_types) { throw _StorageException(nil, _("unknown object type: ")+ objectType); } addObjectToCache(obj); return obj; } int SQLStorage::getTotalFiles() { flushInsertBuffer(); Ref query(new StringBuffer()); *query << "SELECT COUNT(*) FROM " << TQ(CDS_OBJECT_TABLE) << " WHERE " << TQ("object_type") << " != " << quote(OBJECT_TYPE_CONTAINER); //<< " AND is_virtual = 0"; Ref res = select(query); Ref row; if (res != nil && (row = res->nextRow()) != nil) { return row->col(0).toInt(); } return 0; } String SQLStorage::incrementUpdateIDs(int *ids, int size) { if (size <= 0) return nil; Ref inBuf(new StringBuffer()); // ??? what was that: size * sizeof(int))); *inBuf << "IN (" << ids[0]; for (int i = 1; i < size; i++) *inBuf << ',' << ids[i]; *inBuf << ')'; Ref buf(new StringBuffer()); *buf << "UPDATE " << TQ(CDS_OBJECT_TABLE) << " SET " << TQ("update_id") << '=' << TQ("update_id") << " + 1 WHERE " << TQ("id") << ' '; *buf << inBuf; exec(buf); buf->clear(); *buf << "SELECT " << TQ("id") << ',' << TQ("update_id") << " FROM " << TQ(CDS_OBJECT_TABLE) << " WHERE " << TQ("id") << ' '; *buf << inBuf; Ref res = select(buf); if (res == nil) throw _Exception(_("Error while fetching update ids")); Ref row; buf->clear(); while((row = res->nextRow()) != nil) *buf << ',' << row->col(0) << ',' << row->col(1); if (buf->length() <= 0) return nil; return buf->toString(1); } /* Ref > SQLStorage::selectObjects(Ref param) { Ref q(new StringBuffer()); *q << SQL_QUERY << " WHERE "; switch (param->flags) { case FILTER_PARENT_ID: *q << "f.parent_id = " << param->iArg1; break; case FILTER_REF_ID: *q << "f.ref_id = " << param->iArg1; break; case FILTER_PARENT_ID_ITEMS: *q << "f.parent_id = " << param->iArg1 << " AND " << "f.object_type & " << OBJECT_TYPE_ITEM << " <> 0"; break; case FILTER_PARENT_ID_CONTAINERS: *q << "f.parent_id = " << param->iArg1 << " AND " << "f.object_type & " << OBJECT_TYPE_CONTAINER << " <> 0"; break; default: throw _StorageException(_("selectObjects: invalid operation: ") + param->flags); } *q << " ORDER BY f.object_type, f.dc_title"; Ref res = select(q->toString()); Ref row; Ref > arr(new Array()); while((row = res->nextRow()) != nil) { Ref obj = createObjectFromRow(row); arr->append(obj); } return arr; } */ Ref > SQLStorage::getObjects(int parentID, bool withoutContainer) { flushInsertBuffer(); Ref q(new StringBuffer()); *q << "SELECT " << TQ("id") << " FROM " << TQ(CDS_OBJECT_TABLE) << " WHERE "; if (withoutContainer) *q << TQ("object_type") << " != " << OBJECT_TYPE_CONTAINER << " AND "; *q << TQ("parent_id") << '='; *q << parentID; Ref res = select(q); if (res == nil) throw _Exception(_("db error")); Ref row; if (res->getNumRows() <= 0) return nil; int capacity = res->getNumRows() * 5 + 1; if (capacity < 521) capacity = 521; Ref > ret(new DBRHash(capacity, res->getNumRows(), INVALID_OBJECT_ID, INVALID_OBJECT_ID_2)); while ((row = res->nextRow()) != nil) { ret->put(row->col(0).toInt()); } return ret; } Ref SQLStorage::removeObjects(zmm::Ref > list, bool all) { flushInsertBuffer(); hash_data_array_t hash_data_array; list->getAll(&hash_data_array); int count = hash_data_array.size; int *array = hash_data_array.data; if (count <= 0) return nil; Ref idsBuf(new StringBuffer()); *idsBuf << "SELECT " << TQ("id") << ',' << TQ("object_type") << " FROM " << TQ(CDS_OBJECT_TABLE) << " WHERE " << TQ("id") << " IN ("; int firstComma = idsBuf->length(); for (int i = 0; i < count; i++) { int id = array[i]; if (IS_FORBIDDEN_CDS_ID(id)) throw _Exception(_("tried to delete a forbidden ID (") + id + ")!"); *idsBuf << ',' << id; } idsBuf->setCharAt(firstComma, ' '); *idsBuf << ')'; Ref res = select(idsBuf); idsBuf = nil; if (res == nil) throw _Exception(_("sql error")); Ref items(new StringBuffer()); Ref containers(new StringBuffer()); Ref row; while ((row = res->nextRow()) != nil) { int objectType = row->col(1).toInt(); if (IS_CDS_CONTAINER(objectType)) *containers << ',' << row->col_c_str(0); else *items << ',' << row->col_c_str(0); } return _purgeEmptyContainers(_recursiveRemove(items, containers, all)); } void SQLStorage::_removeObjects(Ref objectIDs, int offset) { Ref q(new StringBuffer()); *q << "SELECT " << TQD('a',"id") << ',' << TQD('a',"persistent") << ',' << TQD('o',"location") << " FROM " << TQ(AUTOSCAN_TABLE) << " a" " JOIN " << TQ(CDS_OBJECT_TABLE) << " o" " ON " << TQD('o',"id") << '=' << TQD('a',"obj_id") << " WHERE " << TQD('o',"id") << " IN ("; q->concat(objectIDs, offset); *q << ')'; log_debug("%s\n", q->c_str()); Ref res = select(q); if (res != nil) { log_debug("relevant autoscans!\n"); Ref delete_as(new StringBuffer()); Ref row; while((row = res->nextRow()) != nil) { bool persistent = remapBool(row->col(1)); if (persistent) { String location = stripLocationPrefix(row->col(2)); *q << "UPDATE " << TQ(AUTOSCAN_TABLE) << " SET " << TQ("obj_id") << "=" SQL_NULL << ',' << TQ("location") << '=' << quote(location) << " WHERE " << TQ("id") << '=' << quote(row->col(0)); } else *delete_as << ',' << row->col_c_str(0); log_debug("relevant autoscan: %d; persistent: %d\n", row->col_c_str(0), persistent); } if (delete_as->length() > 0) { q->clear(); *q << "DELETE FROM " << TQ(AUTOSCAN_TABLE) << " WHERE " << TQ("id") << " IN ("; q->concat(delete_as, 1); *q << ')'; exec(q); log_debug("deleting autoscans: %s\n", delete_as->c_str()); } } q->clear(); *q << "DELETE FROM " << TQ(CDS_ACTIVE_ITEM_TABLE) << " WHERE " << TQ("id") << " IN ("; q->concat(objectIDs, offset); *q << ')'; exec(q); q->clear(); *q << "DELETE FROM " << TQ(CDS_OBJECT_TABLE) << " WHERE " << TQ("id") << " IN ("; q->concat(objectIDs, offset); *q << ')'; exec(q); } Ref SQLStorage::removeObject(int objectID, bool all) { flushInsertBuffer(); Ref q(new StringBuffer()); *q << "SELECT " << TQ("object_type") << ',' << TQ("ref_id") << " FROM " << TQ(CDS_OBJECT_TABLE) << " WHERE " << TQ("id") << '=' << quote(objectID) << " LIMIT 1"; Ref res = select(q); if (res == nil) return nil; Ref row = res->nextRow(); if (row == nil) return nil; int objectType = row->col(0).toInt(); bool isContainer = IS_CDS_CONTAINER(objectType); if (all && ! isContainer) { String ref_id_str = row->col(1); int ref_id; if (string_ok(ref_id_str)) { ref_id = ref_id_str.toInt(); if (! IS_FORBIDDEN_CDS_ID(ref_id)) objectID = ref_id; } } if (IS_FORBIDDEN_CDS_ID(objectID)) throw _Exception(_("tried to delete a forbidden ID (") + objectID + ")!"); Ref idsBuf(new StringBuffer()); *idsBuf << ',' << objectID; Ref changedContainers = nil; if (isContainer) changedContainers = _recursiveRemove(nil, idsBuf, all); else changedContainers = _recursiveRemove(idsBuf, nil, all); return _purgeEmptyContainers(changedContainers); } Ref SQLStorage::_recursiveRemove(Ref items, Ref containers, bool all) { log_debug("start\n"); Ref recurseItems(new StringBuffer()); *recurseItems << "SELECT DISTINCT " << TQ("id") << ',' << TQ("parent_id") << " FROM " << TQ(CDS_OBJECT_TABLE) << " WHERE " << TQ("ref_id") << " IN ("; int recurseItemsLen = recurseItems->length(); Ref recurseContainers(new StringBuffer()); *recurseContainers << "SELECT DISTINCT " << TQ("id") << ',' << TQ("object_type"); if (all) *recurseContainers << ',' << TQ("ref_id"); *recurseContainers << " FROM " << TQ(CDS_OBJECT_TABLE) << " WHERE " << TQ("parent_id") << " IN ("; int recurseContainersLen = recurseContainers->length(); Ref removeAddParents(new StringBuffer()); *removeAddParents << "SELECT DISTINCT " << TQ("parent_id") << " FROM " << TQ(CDS_OBJECT_TABLE) << " WHERE " << TQ("id") << " IN ("; int removeAddParentsLen = removeAddParents->length(); Ref remove(new StringBuffer()); Ref changedContainers(new ChangedContainersStr()); Ref res; Ref row; if (items != nil && items->length() > 1) { *recurseItems << items; *removeAddParents << items; } if (containers != nil && containers->length() > 1) { *recurseContainers << containers; *remove << containers; *removeAddParents << containers; removeAddParents->setCharAt(removeAddParentsLen, ' '); *removeAddParents << ')'; res = select(removeAddParents); if (res == nil) throw _StorageException(nil, _("sql error")); removeAddParents->setLength(removeAddParentsLen); while ((row = res->nextRow()) != nil) *changedContainers->ui << ',' << row->col_c_str(0); } int count = 0; while(recurseItems->length() > recurseItemsLen || removeAddParents->length() > removeAddParentsLen || recurseContainers->length() > recurseContainersLen) { if (removeAddParents->length() > removeAddParentsLen) { // add ids to remove *remove << removeAddParents->c_str(removeAddParentsLen); // get rid of first ',' removeAddParents->setCharAt(removeAddParentsLen, ' '); *removeAddParents << ')'; res = select(removeAddParents); if (res == nil) throw _StorageException(nil, _("sql error")); // reset length removeAddParents->setLength(removeAddParentsLen); while ((row = res->nextRow()) != nil) *changedContainers->upnp << ',' << row->col_c_str(0); } if (recurseItems->length() > recurseItemsLen) { recurseItems->setCharAt(recurseItemsLen, ' '); *recurseItems << ')'; res = select(recurseItems); if (res == nil) throw _StorageException(nil, _("sql error")); recurseItems->setLength(recurseItemsLen); while ((row = res->nextRow()) != nil) { *remove << ',' << row->col_c_str(0); *changedContainers->upnp << ',' << row->col_c_str(1); //log_debug("refs-add id: %s; parent_id: %s\n", id.c_str(), parentId.c_str()); } } if (recurseContainers->length() > recurseContainersLen) { recurseContainers->setCharAt(recurseContainersLen, ' '); *recurseContainers << ')'; res = select(recurseContainers); if (res == nil) throw _StorageException(nil, _("sql error")); recurseContainers->setLength(recurseContainersLen); while ((row = res->nextRow()) != nil) { //containers->append(row->col(1).toInt()); int objectType = row->col(1).toInt(); if (IS_CDS_CONTAINER(objectType)) { *recurseContainers << ',' << row->col_c_str(0); *remove << ',' << row->col_c_str(0); } else { if (all) { String refId = row->col(2); if (string_ok(refId)) { *removeAddParents << ',' << refId; *recurseItems << ',' << refId; //*remove << ',' << refId; } else { *remove << ',' << row->col_c_str(0); *recurseItems << ',' << row->col_c_str(0); } } else { *remove << ',' << row->col_c_str(0); *recurseItems << ',' << row->col_c_str(0); } } //log_debug("id: %s; parent_id: %s\n", id.c_str(), parentId.c_str()); } } if (remove->length() > MAX_REMOVE_SIZE) // remove->length() > 0) // ) { _removeObjects(remove, 1); remove->clear(); } if (count++ > MAX_REMOVE_RECURSION) throw _Exception(_("there seems to be an infinite loop...")); } if (remove->length() > 0) _removeObjects(remove, 1); log_debug("end\n"); return changedContainers; } Ref SQLStorage::_purgeEmptyContainers(Ref changedContainersStr) { log_debug("start upnp: %s; ui: %s\n", changedContainersStr->upnp->c_str(), changedContainersStr->ui->c_str()); Ref changedContainers(new ChangedContainers()); if (! string_ok(changedContainersStr->upnp) && ! string_ok(changedContainersStr->ui)) return changedContainers; Ref bufSelUI(new StringBuffer()); *bufSelUI << "SELECT " << TQD('a',"id") << ", COUNT(" << TQD('b',"parent_id") << ")," << TQD('a',"parent_id") << ',' << TQD('a',"flags") << " FROM " << TQ(CDS_OBJECT_TABLE) << ' ' << TQ('a') << " LEFT JOIN " << TQ(CDS_OBJECT_TABLE) << ' ' << TQ('b') << " ON " << TQD('a',"id") << '=' << TQD('b',"parent_id") << " WHERE " << TQD('a',"object_type") << '=' << quote(1) << " AND " << TQD('a',"id") << " IN ("; //(a.flags & " << OBJECT_FLAG_PERSISTENT_CONTAINER << ") = 0 AND int bufSelLen = bufSelUI->length(); String strSel2 = _(") GROUP BY a.id"); // HAVING COUNT(b.parent_id)=0"); Ref bufSelUpnp(new StringBuffer()); *bufSelUpnp << bufSelUI; Ref bufDel(new StringBuffer()); Ref res; Ref row; *bufSelUI << changedContainersStr->ui; *bufSelUpnp << changedContainersStr->upnp; bool again; int count = 0; do { again = false; if (bufSelUpnp->length() > bufSelLen) { bufSelUpnp->setCharAt(bufSelLen, ' '); *bufSelUpnp << strSel2; log_debug("upnp-sql: %s\n", bufSelUpnp->c_str()); res = select(bufSelUpnp); bufSelUpnp->setLength(bufSelLen); if (res == nil) throw _Exception(_("db error")); while ((row = res->nextRow()) != nil) { int flags = row->col(3).toInt(); if (flags & OBJECT_FLAG_PERSISTENT_CONTAINER) changedContainers->upnp->append(row->col(0).toInt()); else if (row->col(1) == "0") { *bufDel << ',' << row->col_c_str(0); *bufSelUI << ',' << row->col_c_str(2); } else { *bufSelUpnp << ',' << row->col_c_str(0); } } } if (bufSelUI->length() > bufSelLen) { bufSelUI->setCharAt(bufSelLen, ' '); *bufSelUI << strSel2; log_debug("ui-sql: %s\n", bufSelUI->c_str()); res = select(bufSelUI); bufSelUI->setLength(bufSelLen); if (res == nil) throw _Exception(_("db error")); while ((row = res->nextRow()) != nil) { int flags = row->col(3).toInt(); if (flags & OBJECT_FLAG_PERSISTENT_CONTAINER) { changedContainers->ui->append(row->col(0).toInt()); changedContainers->upnp->append(row->col(0).toInt()); } else if (row->col(1) == "0") { *bufDel << ',' << row->col_c_str(0); *bufSelUI << ',' << row->col_c_str(2); } else { *bufSelUI << ',' << row->col_c_str(0); } } } //log_debug("selecting: %s; removing: %s\n", bufSel->c_str(), bufDel->c_str()); if (bufDel->length() > 0) { _removeObjects(bufDel, 1); bufDel->clear(); if (bufSelUI->length() > bufSelLen || bufSelUpnp->length() > bufSelLen) again = true; } if (count++ >= MAX_REMOVE_RECURSION) throw _Exception(_("there seems to be an infinite loop...")); } while (again); if (bufSelUI->length() > bufSelLen) { changedContainers->ui->addCSV(bufSelUI->toString(bufSelLen + 1)); changedContainers->upnp->addCSV(bufSelUI->toString(bufSelLen + 1)); } if (bufSelUpnp->length() > bufSelLen) { changedContainers->upnp->addCSV(bufSelUpnp->toString(bufSelLen + 1)); } log_debug("end; changedContainers (upnp): %s\n", changedContainers->upnp->toCSV().c_str()); log_debug("end; changedContainers (ui): %s\n", changedContainers->ui->toCSV().c_str()); /* clear cache (for now) */ if (cacheOn()) cache->clear(); /* --------------------- */ return changedContainers; } String SQLStorage::getInternalSetting(String key) { Ref q(new StringBuffer()); *q << "SELECT " << TQ("value") << " FROM " << TQ(INTERNAL_SETTINGS_TABLE) << " WHERE " << TQ("key") << '=' << quote(key) << " LIMIT 1"; Ref res = select(q); if (res == nil) return nil; Ref row = res->nextRow(); if (row == nil) return nil; return row->col(0); } /* void SQLStorage::storeInternalSetting(String key, String value) overwritten due to different SQL syntax for MySQL and SQLite3 */ void SQLStorage::updateAutoscanPersistentList(scan_mode_t scanmode, Ref list) { log_debug("setting persistent autoscans untouched - scanmode: %s;\n", AutoscanDirectory::mapScanmode(scanmode).c_str()); Ref q(new StringBuffer()); *q << "UPDATE " << TQ(AUTOSCAN_TABLE) << " SET " << TQ("touched") << '=' << mapBool(false) << " WHERE " << TQ("persistent") << '=' << mapBool(true) << " AND " << TQ("scan_mode") << '=' << quote(AutoscanDirectory::mapScanmode(scanmode)); exec(q); int listSize = list->size(); log_debug("updating/adding persistent autoscans (count: %d)\n", listSize); for (int i = 0; i < listSize; i++) { log_debug("getting ad %d from list..\n", i); Ref ad = list->get(i); if (ad == nil) continue; // only persistent asD should be given to getAutoscanList assert(ad->persistent()); // the scanmode should match the given parameter assert(ad->getScanMode() == scanmode); String location = ad->getLocation(); if (! string_ok(location)) throw _Exception(_("AutoscanDirectoy with illegal location given to SQLStorage::updateAutoscanPersistentList")); q->clear(); *q << "SELECT " << TQ("id") << " FROM " << TQ(AUTOSCAN_TABLE) << " WHERE "; int objectID = findObjectIDByPath(location + '/'); log_debug("objectID = %d\n", objectID); if (objectID == INVALID_OBJECT_ID) *q << TQ("location") << '=' << quote(location); else *q << TQ("obj_id") << '=' << quote(objectID); *q << " LIMIT 1"; Ref res = select(q); if (res == nil) throw _StorageException(nil, _("query error while selecting from autoscan list")); Ref row; if ((row = res->nextRow()) != nil) { ad->setStorageID(row->col(0).toInt()); updateAutoscanDirectory(ad); } else addAutoscanDirectory(ad); } q->clear(); *q << "DELETE FROM " << TQ(AUTOSCAN_TABLE) << " WHERE " << TQ("touched") << '=' << mapBool(false) << " AND " << TQ("scan_mode") << '=' << quote(AutoscanDirectory::mapScanmode(scanmode)); exec(q); } Ref SQLStorage::getAutoscanList(scan_mode_t scanmode) { #define FLD(field) << TQD('a',field) << Ref q(new StringBuffer()); *q << "SELECT " FLD("id") ',' FLD("obj_id") ',' FLD("scan_level") ',' FLD("scan_mode") ',' FLD("recursive") ',' FLD("hidden") ',' FLD("interval") ',' FLD("last_modified") ',' FLD("persistent") ',' FLD("location") ',' << TQD('t',"location") << " FROM " << TQ(AUTOSCAN_TABLE) << ' ' << TQ('a') << " LEFT JOIN " << TQ(CDS_OBJECT_TABLE) << ' ' << TQ('t') << " ON " FLD("obj_id") '=' << TQD('t',"id") << " WHERE " FLD("scan_mode") '=' << quote(AutoscanDirectory::mapScanmode(scanmode)); Ref res = select(q); if (res == nil) throw _StorageException(nil, _("query error while fetching autoscan list")); Ref ret(new AutoscanList()); Ref row; while((row = res->nextRow()) != nil) { Ref dir = _fillAutoscanDirectory(row); if (dir == nil) removeAutoscanDirectory(row->col(0).toInt()); else ret->add(dir); } return ret; } Ref SQLStorage::getAutoscanDirectory(int objectID) { #define FLD(field) << TQD('a',field) << Ref q(new StringBuffer()); *q << "SELECT " FLD("id") ',' FLD("obj_id") ',' FLD("scan_level") ',' FLD("scan_mode") ',' FLD("recursive") ',' FLD("hidden") ',' FLD("interval") ',' FLD("last_modified") ',' FLD("persistent") ',' FLD("location") ',' << TQD('t',"location") << " FROM " << TQ(AUTOSCAN_TABLE) << ' ' << TQ('a') << " LEFT JOIN " << TQ(CDS_OBJECT_TABLE) << ' ' << TQ('t') << " ON " FLD("obj_id") '=' << TQD('t',"id") << " WHERE " << TQD('t',"id") << '=' << quote(objectID); Ref res = select(q); if (res == nil) throw _StorageException(nil, _("query error while fetching autoscan")); Ref ret(new AutoscanList()); Ref row = res->nextRow(); if (row == nil) return nil; else return _fillAutoscanDirectory(row); } Ref SQLStorage::_fillAutoscanDirectory(Ref row) { int objectID = INVALID_OBJECT_ID; String objectIDstr = row->col(1); if (string_ok(objectIDstr)) objectID = objectIDstr.toInt(); int storageID = row->col(0).toInt(); String location; if (objectID == INVALID_OBJECT_ID) location = row->col(9); else { char prefix; location = stripLocationPrefix(&prefix, row->col(10)); if (prefix != LOC_DIR_PREFIX) return nil; } scan_level_t level = AutoscanDirectory::remapScanlevel(row->col(2)); scan_mode_t mode = AutoscanDirectory::remapScanmode(row->col(3)); bool recursive = remapBool(row->col(4)); bool hidden = remapBool(row->col(5)); bool persistent = remapBool(row->col(8)); int interval = 0; if (mode == TimedScanMode) interval = row->col(6).toInt(); time_t last_modified = row->col(7).toLong(); //log_debug("adding autoscan location: %s; recursive: %d\n", location.c_str(), recursive); Ref dir(new AutoscanDirectory(location, mode, level, recursive, persistent, INVALID_SCAN_ID, interval, hidden)); dir->setObjectID(objectID); dir->setStorageID(storageID); dir->setCurrentLMT(last_modified); dir->updateLMT(); return dir; } void SQLStorage::addAutoscanDirectory(Ref adir) { if (adir == nil) throw _Exception(_("addAutoscanDirectory called with adir==nil")); if (adir->getStorageID() >= 0) throw _Exception(_("tried to add autoscan directory with a storage id set")); int objectID; if (adir->getLocation() == FS_ROOT_DIRECTORY) objectID = CDS_ID_FS_ROOT; else objectID = findObjectIDByPath(adir->getLocation() + DIR_SEPARATOR); if (! adir->persistent() && objectID < 0) throw _Exception(_("tried to add non-persistent autoscan directory with an illegal objectID or location")); Ref pathIds = _checkOverlappingAutoscans(adir); _autoscanChangePersistentFlag(objectID, true); Ref q(new StringBuffer()); *q << "INSERT INTO " << TQ(AUTOSCAN_TABLE) << " (" << TQ("obj_id") << ',' << TQ("scan_level") << ',' << TQ("scan_mode") << ',' << TQ("recursive") << ',' << TQ("hidden") << ',' << TQ("interval") << ',' << TQ("last_modified") << ',' << TQ("persistent") << ',' << TQ("location") << ',' << TQ("path_ids") << ") VALUES (" << (objectID >= 0 ? quote(objectID) : _(SQL_NULL)) << ',' << quote(AutoscanDirectory::mapScanlevel(adir->getScanLevel())) << ',' << quote(AutoscanDirectory::mapScanmode(adir->getScanMode())) << ',' << mapBool(adir->getRecursive()) << ',' << mapBool(adir->getHidden()) << ',' << quote(adir->getInterval()) << ',' << quote(adir->getPreviousLMT()) << ',' << mapBool(adir->persistent()) << ',' << (objectID >= 0 ? _(SQL_NULL) : quote(adir->getLocation())) << ',' << (pathIds == nil ? _(SQL_NULL) : quote(_(",") + pathIds->toCSV() + ',')) << ')'; adir->setStorageID(exec(q, true)); } void SQLStorage::updateAutoscanDirectory(Ref adir) { log_debug("id: %d, obj_id: %d\n", adir->getStorageID(), adir->getObjectID()); if (adir == nil) throw _Exception(_("updateAutoscanDirectory called with adir==nil")); Ref pathIds = _checkOverlappingAutoscans(adir); int objectID = adir->getObjectID(); int objectIDold = _getAutoscanObjectID(adir->getStorageID()); if (objectIDold != objectID) { _autoscanChangePersistentFlag(objectIDold, false); _autoscanChangePersistentFlag(objectID, true); } Ref q(new StringBuffer()); *q << "UPDATE " << TQ(AUTOSCAN_TABLE) << " SET " << TQ("obj_id") << '=' << (objectID >= 0 ? quote(objectID) : _(SQL_NULL)) << ',' << TQ("scan_level") << '=' << quote(AutoscanDirectory::mapScanlevel(adir->getScanLevel())) << ',' << TQ("scan_mode") << '=' << quote(AutoscanDirectory::mapScanmode(adir->getScanMode())) << ',' << TQ("recursive") << '=' << mapBool(adir->getRecursive()) << ',' << TQ("hidden") << '=' << mapBool(adir->getHidden()) << ',' << TQ("interval") << '=' << quote(adir->getInterval()); if (adir->getPreviousLMT() > 0) *q << ',' << TQ("last_modified") << '=' << quote(adir->getPreviousLMT()); *q << ',' << TQ("persistent") << '=' << mapBool(adir->persistent()) << ',' << TQ("location") << '=' << (objectID >= 0 ? _(SQL_NULL) : quote(adir->getLocation())) << ',' << TQ("path_ids") << '=' << (pathIds == nil ? _(SQL_NULL) : quote(_(",") + pathIds->toCSV() + ',')) << ',' << TQ("touched") << '=' << mapBool(true) << " WHERE " << TQ("id") << '=' << quote(adir->getStorageID()); exec(q); } void SQLStorage::removeAutoscanDirectoryByObjectID(int objectID) { if (objectID == INVALID_OBJECT_ID) return; Ref q(new StringBuffer()); *q << "DELETE FROM " << TQ(AUTOSCAN_TABLE) << " WHERE " << TQ("obj_id") << '=' << quote(objectID); exec(q); _autoscanChangePersistentFlag(objectID, false); } void SQLStorage::removeAutoscanDirectory(int autoscanID) { if (autoscanID == INVALID_OBJECT_ID) return; int objectID = _getAutoscanObjectID(autoscanID); Ref q(new StringBuffer()); *q << "DELETE FROM " << TQ(AUTOSCAN_TABLE) << " WHERE " << TQ("id") << '=' << quote(autoscanID); exec(q); if (objectID != INVALID_OBJECT_ID) _autoscanChangePersistentFlag(objectID, false); } int SQLStorage::getAutoscanDirectoryType(int objectID) { return _getAutoscanDirectoryInfo(objectID, _("persistent")); } int SQLStorage::isAutoscanDirectoryRecursive(int objectID) { return _getAutoscanDirectoryInfo(objectID, _("recursive")); } int SQLStorage::_getAutoscanDirectoryInfo(int objectID, String field) { if (objectID == INVALID_OBJECT_ID) return 0; Ref q(new StringBuffer()); *q << "SELECT " << TQ(field) << " FROM " << TQ(AUTOSCAN_TABLE) << " WHERE " << TQ("obj_id") << '=' << quote(objectID); Ref res = select(q); Ref row; if (res == nil || (row = res->nextRow()) == nil) return 0; if (! remapBool(row->col(0))) return 1; else return 2; } int SQLStorage::_getAutoscanObjectID(int autoscanID) { Ref q(new StringBuffer()); *q << "SELECT " << TQ("obj_id") << " FROM " << TQ(AUTOSCAN_TABLE) << " WHERE " << TQ("id") << '=' << quote(autoscanID) << " LIMIT 1"; Ref res = select(q); if (res == nil) throw _StorageException(nil, _("error while doing select on ")); Ref row; if ((row = res->nextRow()) != nil && string_ok(row->col(0))) return row->col(0).toInt(); return INVALID_OBJECT_ID; } void SQLStorage::_autoscanChangePersistentFlag(int objectID, bool persistent) { if (objectID == INVALID_OBJECT_ID && objectID == INVALID_OBJECT_ID_2) return; Ref q(new StringBuffer()); *q << "UPDATE " << TQ(CDS_OBJECT_TABLE) << " SET " << TQ("flags") << " = (" << TQ("flags") << (persistent ? _(" | ") : _(" & ~")) << OBJECT_FLAG_PERSISTENT_CONTAINER << ") WHERE " << TQ("id") << '=' << quote(objectID); exec(q); } void SQLStorage::autoscanUpdateLM(Ref adir) { /* int objectID = adir->getObjectID(); if (IS_FORBIDDEN_CDS_ID(objectID)) { objectID = findObjectIDByPath(adir->getLocation() + '/'); if (IS_FORBIDDEN_CDS_ID(objectID)) throw _Exception(_("autoscanUpdateLM called with adir with illegal objectID and location")); } */ log_debug("id: %d; last_modified: %d\n", adir->getStorageID(), adir->getPreviousLMT()); Ref q(new StringBuffer()); *q << "UPDATE " << TQ(AUTOSCAN_TABLE) << " SET " << TQ("last_modified") << '=' << quote(adir->getPreviousLMT()) << " WHERE " << TQ("id") << '=' << quote(adir->getStorageID()); exec(q); } int SQLStorage::isAutoscanChild(int objectID) { Ref pathIDs = getPathIDs(objectID); if (pathIDs == nil) return INVALID_OBJECT_ID; for (int i = 0; i < pathIDs->size(); i++) { int recursive = isAutoscanDirectoryRecursive(pathIDs->get(i)); if (recursive == 2) return pathIDs->get(i); } return INVALID_OBJECT_ID; } void SQLStorage::checkOverlappingAutoscans(Ref adir) { _checkOverlappingAutoscans(adir); } Ref SQLStorage::_checkOverlappingAutoscans(Ref adir) { if (adir == nil) throw _Exception(_("_checkOverlappingAutoscans called with adir==nil")); int checkObjectID = adir->getObjectID(); if (checkObjectID == INVALID_OBJECT_ID) return nil; int storageID = adir->getStorageID(); Ref res; Ref row; Ref q(new StringBuffer()); *q << "SELECT " << TQ("id") << " FROM " << TQ(AUTOSCAN_TABLE) << " WHERE " << TQ("obj_id") << " = " << quote(checkObjectID); if (storageID >= 0) *q << " AND " << TQ("id") << " != " << quote(storageID); res = select(q); if (res == nil) throw _Exception(_("SQL error")); if ((row = res->nextRow()) != nil) { Ref obj = loadObject(checkObjectID); if (obj == nil) throw _Exception(_("Referenced object (by Autoscan) not found.")); log_error("There is already an Autoscan set on %s\n", obj->getLocation().c_str()); throw _Exception(_("There is already an Autoscan set on ") + obj->getLocation()); } if (adir->getRecursive()) { q->clear(); *q << "SELECT " << TQ("obj_id") << " FROM " << TQ(AUTOSCAN_TABLE) << " WHERE " << TQ("path_ids") << " LIKE " << quote(_("%,") + checkObjectID + ",%"); if (storageID >= 0) *q << " AND " << TQ("id") << " != " << quote(storageID); *q << " LIMIT 1"; log_debug("------------ %s\n", q->c_str()); res = select(q); if (res == nil) throw _Exception(_("SQL error")); if ((row = res->nextRow()) != nil) { int objectID = row->col(0).toInt(); log_debug("-------------- %d\n", objectID); Ref obj = loadObject(objectID); if (obj == nil) throw _Exception(_("Referenced object (by Autoscan) not found.")); log_error("Overlapping Autoscans are not allowed. There is already an Autoscan set on %s\n", obj->getLocation().c_str()); throw _Exception(_("Overlapping Autoscans are not allowed. There is already an Autoscan set on ") + obj->getLocation()); } } Ref pathIDs = getPathIDs(checkObjectID); if (pathIDs == nil) throw _Exception(_("getPathIDs returned nil")); q->clear(); *q << "SELECT " << TQ("obj_id") << " FROM " << TQ(AUTOSCAN_TABLE) << " WHERE " << TQ("obj_id") << " IN (" << pathIDs->toCSV() << ") AND " << TQ("recursive") << '=' << mapBool(true); if (storageID >= 0) *q << " AND " << TQ("id") << " != " << quote(storageID); *q << " LIMIT 1"; res = select(q); if (res == nil) throw _Exception(_("SQL error")); if ((row = res->nextRow()) == nil) return pathIDs; else { int objectID = row->col(0).toInt(); Ref obj = loadObject(objectID); if (obj == nil) throw _Exception(_("Referenced object (by Autoscan) not found.")); log_error("Overlapping Autoscans are not allowed. There is already a recursive Autoscan set on %s\n", obj->getLocation().c_str()); throw _Exception(_("Overlapping Autoscans are not allowed. There is already a recursive Autoscan set on ") + obj->getLocation()); } } Ref SQLStorage::getPathIDs(int objectID) { flushInsertBuffer(); if (objectID == INVALID_OBJECT_ID) return nil; Ref pathIDs(new IntArray()); Ref q(new StringBuffer()); *q << "SELECT " << TQ("parent_id") << " FROM " << TQ(CDS_OBJECT_TABLE) << " WHERE "; *q << TQ("id") << '='; int selBufLen = q->length(); Ref res; Ref row; while (objectID != CDS_ID_ROOT) { pathIDs->append(objectID); q->setLength(selBufLen); *q << quote(objectID) << " LIMIT 1"; res = select(q); if (res == nil || (row = res->nextRow()) == nil) break; objectID = row->col(0).toInt(); } return pathIDs; } String SQLStorage::getFsRootName() { if (string_ok(fsRootName)) return fsRootName; setFsRootName(); return fsRootName; } void SQLStorage::setFsRootName(String rootName) { if (string_ok(rootName)) { fsRootName = rootName; } else { Ref fsRootObj = loadObject(CDS_ID_FS_ROOT); fsRootName = fsRootObj->getTitle(); } } int SQLStorage::getNextID() { if (lastID < CDS_ID_FS_ROOT) throw _Exception(_("SQLStorage::getNextID() called, but lastID hasn't been loaded correctly yet")); AUTOLOCK(nextIDMutex); return ++lastID; } void SQLStorage::loadLastID() { // we don't rely on automatic db generated ids, because of our caching Ref qb(new StringBuffer()); *qb << "SELECT MAX(" << TQ("id") << ')' << " FROM " << TQ(CDS_OBJECT_TABLE); Ref res = select(qb); if (res == nil) throw _Exception(_("could not load lastID (res==nil)")); Ref row = res->nextRow(); if (row == nil) throw _Exception(_("could not load lastID (row==nil)")); lastID = row->col(0).toInt(); if (lastID < CDS_ID_FS_ROOT) throw _Exception(_("could not load correct lastID (db not initialized?)")); } void SQLStorage::addObjectToCache(Ref object, bool dontLock) { if (cacheOn() && object != nil) { AUTOLOCK_DEFINE_ONLY(); if (! dontLock) AUTOLOCK_NO_DEFINE(cache->getMutex()); Ref cObj = cache->getObjectDefinitely(object->getID()); if (cache->flushed()) flushInsertBuffer(); cObj->setObject(object); cache->checkLocation(cObj); } } void SQLStorage::addToInsertBuffer(Ref query) { assert(doInsertBuffering()); _addToInsertBuffer(query); AUTOLOCK(mutex); insertBufferEmpty = false; insertBufferStatementCount++; insertBufferByteCount += query->length(); if (insertBufferByteCount > 102400) flushInsertBuffer(true); } void SQLStorage::flushInsertBuffer(bool dontLock) { if (! doInsertBuffering()) return; //print_backtrace(); AUTOLOCK_DEFINE_ONLY(); if (! dontLock) AUTOLOCK_NO_DEFINE(mutex); if (insertBufferEmpty) return; _flushInsertBuffer(); log_debug("flushing insert buffer (%d statements)\n", insertBufferStatementCount); insertBufferEmpty = true; insertBufferStatementCount = 0; insertBufferByteCount = 0; } void SQLStorage::clearFlagInDB(int flag) { Ref qb(new StringBuffer(256)); *qb << "UPDATE " << TQ(CDS_OBJECT_TABLE) << " SET " << TQ("flags") << " = (" << TQ("flags") << "&~" << flag << ") WHERE " << TQ("flags") << "&" << flag; exec(qb); } mediatomb-0.12.1/src/storage/mysql/0000775000076400007640000000000011357204746014160 500000000000000mediatomb-0.12.1/src/storage/mysql/mysql_storage.cc0000664000076400007640000003437411352674776017324 00000000000000/*MT* MediaTomb - http://www.mediatomb.cc/ mysql_storage.cc - this file is part of MediaTomb. Copyright (C) 2005 Gena Batyan , Sergey 'Jin' Bostandzhyan Copyright (C) 2006-2010 Gena Batyan , Sergey 'Jin' Bostandzhyan , Leonhard Wimmer MediaTomb is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. MediaTomb is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with MediaTomb; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. $Id: mysql_storage.cc 2081 2010-03-23 20:18:00Z lww $ */ /// \file mysql_storage.cc #ifdef HAVE_CONFIG_H #include "autoconfig.h" #endif #ifdef HAVE_MYSQL //#define MYSQL_SET_NAMES "/*!40101 SET NAMES utf8 */" //#define MYSQL_SELECT_DEBUG //#define MYSQL_EXEC_DEBUG #include "mysql_storage.h" #include "config_manager.h" #ifdef AUTO_CREATE_DATABASE #include "mysql_create_sql.h" #include #endif // updates 1->2 #define MYSQL_UPDATE_1_2_1 "ALTER TABLE `mt_cds_object` CHANGE `location` `location` BLOB NULL DEFAULT NULL" #define MYSQL_UPDATE_1_2_2 "ALTER TABLE `mt_cds_object` CHANGE `metadata` `metadata` BLOB NULL DEFAULT NULL" #define MYSQL_UPDATE_1_2_3 "ALTER TABLE `mt_cds_object` CHANGE `auxdata` `auxdata` BLOB NULL DEFAULT NULL" #define MYSQL_UPDATE_1_2_4 "ALTER TABLE `mt_cds_object` CHANGE `resources` `resources` BLOB NULL DEFAULT NULL" #define MYSQL_UPDATE_1_2_5 "ALTER TABLE `mt_autoscan` CHANGE `location` `location` BLOB NULL DEFAULT NULL" #define MYSQL_UPDATE_1_2_6 "UPDATE `mt_internal_setting` SET `value`='2' WHERE `key`='db_version'" // updates 2->3 #define MYSQL_UPDATE_2_3_1 "ALTER TABLE `mt_autoscan` CHANGE `scan_mode` `scan_mode` ENUM( 'timed', 'inotify' ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL" #define MYSQL_UPDATE_2_3_2 "ALTER TABLE `mt_autoscan` DROP INDEX `mt_autoscan_obj_id`, ADD UNIQUE `mt_autoscan_obj_id` ( `obj_id` )" #define MYSQL_UPDATE_2_3_3 "ALTER TABLE `mt_autoscan` ADD `path_ids` BLOB AFTER `location`" #define MYSQL_UPDATE_2_3_4 "UPDATE `mt_internal_setting` SET `value`='3' WHERE `key`='db_version' AND `value`='2'" // updates 3->4 #define MYSQL_UPDATE_3_4_1 "ALTER TABLE `mt_cds_object` ADD `service_id` varchar(255) default NULL" #define MYSQL_UPDATE_3_4_2 "ALTER TABLE `mt_cds_object` ADD KEY `cds_object_service_id` (`service_id`)" #define MYSQL_UPDATE_3_4_3 "UPDATE `mt_internal_setting` SET `value`='4' WHERE `key`='db_version' AND `value`='3'" using namespace zmm; using namespace mxml; MysqlStorage::MysqlStorage() : SQLStorage() { mysql_init_key_initialized = false; mysql_connection = false; mysqlMutex = Ref (new Mutex(true)); table_quote_begin = '`'; table_quote_end = '`'; insertBuffer = nil; } MysqlStorage::~MysqlStorage() { AUTOLOCK(mysqlMutex); // just to ensure, that we don't close while another thread // is executing a query if(mysql_connection) { mysql_close(&db); mysql_connection = false; } log_debug("calling mysql_server_end...\n"); mysql_server_end(); log_debug("...ok\n"); } void MysqlStorage::checkMysqlThreadInit() { if (! mysql_connection) throw _Exception(_("mysql connection is not open or already closed")); //log_debug("checkMysqlThreadInit; thread_id=%d\n", pthread_self()); if (pthread_getspecific(mysql_init_key) == NULL) { log_debug("running mysql_thread_init(); thread_id=%d\n", pthread_self()); if (mysql_thread_init()) throw _Exception(_("error while calling mysql_thread_init()")); if (pthread_setspecific(mysql_init_key, (void *) 1)) throw _Exception(_("error while calling pthread_setspecific()")); } } void MysqlStorage::threadCleanup() { log_debug("thread cleanup; thread_id=%d\n", pthread_self()); if (pthread_getspecific(mysql_init_key) != NULL) { mysql_thread_end(); } } void MysqlStorage::init() { log_debug("start\n"); SQLStorage::init(); AUTOLOCK(mysqlMutex); int ret; if (! mysql_thread_safe()) { throw _Exception(_("mysql library is not thread safe!")); } /// \todo write destructor function ret = pthread_key_create(&mysql_init_key, NULL); if (ret) { throw _Exception(_("could not create pthread_key")); } mysql_server_init(0, NULL, NULL); pthread_setspecific(mysql_init_key, (void *) 1); Ref config = ConfigManager::getInstance(); String dbHost = config->getOption(CFG_SERVER_STORAGE_MYSQL_HOST); String dbName = config->getOption(CFG_SERVER_STORAGE_MYSQL_DATABASE); String dbUser = config->getOption(CFG_SERVER_STORAGE_MYSQL_USERNAME); int dbPort = config->getIntOption(CFG_SERVER_STORAGE_MYSQL_PORT); String dbPass = config->getOption(CFG_SERVER_STORAGE_MYSQL_PASSWORD); String dbSock = config->getOption(CFG_SERVER_STORAGE_MYSQL_SOCKET); MYSQL *res_mysql; res_mysql = mysql_init(&db); if(! res_mysql) { throw _Exception(_("mysql_init failed")); } mysql_init_key_initialized = true; mysql_options(&db, MYSQL_SET_CHARSET_NAME, "utf8"); #ifdef HAVE_MYSQL_OPT_RECONNECT my_bool my_bool_var = true; mysql_options(&db, MYSQL_OPT_RECONNECT, &my_bool_var); #endif res_mysql = mysql_real_connect(&db, dbHost.c_str(), dbUser.c_str(), (dbPass == nil ? NULL : dbPass.c_str()), dbName.c_str(), dbPort, // port (dbSock == nil ? NULL : dbSock.c_str()), // socket 0 // flags ); if(! res_mysql) { throw _Exception(_("The connection to the MySQL database has failed: ") + getError(&db)); } /* int res = mysql_real_query(&db, MYSQL_SET_NAMES, strlen(MYSQL_SET_NAMES)); if(res) { String myError = getError(&db); throw _StorageException(nil, _("MySQL query 'SET NAMES' failed!")); } */ mysql_connection = true; String dbVersion = nil; try { dbVersion = getInternalSetting(_("db_version")); } catch (Exception) { } if (dbVersion == nil) { #ifdef AUTO_CREATE_DATABASE log_info("database doesn't seem to exist. automatically creating database...\n"); unsigned char buf[MS_CREATE_SQL_INFLATED_SIZE + 1]; // + 1 for '\0' at the end of the string unsigned long uncompressed_size = MS_CREATE_SQL_INFLATED_SIZE; int ret = uncompress(buf, &uncompressed_size, mysql_create_sql, MS_CREATE_SQL_DEFLATED_SIZE); if (ret != Z_OK || uncompressed_size != MS_CREATE_SQL_INFLATED_SIZE) throw _Exception(_("Error while uncompressing mysql create sql. returned: ") + ret); buf[MS_CREATE_SQL_INFLATED_SIZE] = '\0'; char *sql_start = (char *)buf; char *sql_end = strchr(sql_start, ';'); if (sql_end == NULL) { throw _Exception(_("';' not found in mysql create sql")); } do { ret = mysql_real_query(&db, sql_start, sql_end - sql_start); if (ret) { String myError = getError(&db); throw _StorageException(myError, _("Mysql: error while creating db: ") + myError); } sql_start = sql_end + 1; // skip ';' if (*sql_start == '\n') // skip newline sql_start++; sql_end = strchr(sql_start, ';'); } while(sql_end != NULL); dbVersion = getInternalSetting(_("db_version")); if (dbVersion == nil) { shutdown(); throw _Exception(_("error while creating database")); } log_info("database created successfully.\n"); #else shutdown(); throw _Exception(_("database doesn't seem to exist yet and autocreation wasn't compiled in")); #endif } log_debug("db_version: %s\n", dbVersion.c_str()); /* --- database upgrades --- */ if (dbVersion == "1") { log_info("Doing an automatic database upgrade from database version 1 to version 2...\n"); _exec(MYSQL_UPDATE_1_2_1); _exec(MYSQL_UPDATE_1_2_2); _exec(MYSQL_UPDATE_1_2_3); _exec(MYSQL_UPDATE_1_2_4); _exec(MYSQL_UPDATE_1_2_5); _exec(MYSQL_UPDATE_1_2_6); log_info("database upgrade successful.\n"); dbVersion = _("2"); } if (dbVersion == "2") { log_info("Doing an automatic database upgrade from database version 2 to version 3...\n"); _exec(MYSQL_UPDATE_2_3_1); _exec(MYSQL_UPDATE_2_3_2); _exec(MYSQL_UPDATE_2_3_3); _exec(MYSQL_UPDATE_2_3_4); log_info("database upgrade successful.\n"); dbVersion = _("3"); } if (dbVersion == "3") { log_info("Doing an automatic database upgrade from database version 3 to version 4...\n"); _exec(MYSQL_UPDATE_3_4_1); _exec(MYSQL_UPDATE_3_4_2); _exec(MYSQL_UPDATE_3_4_3); log_info("database upgrade successful.\n"); dbVersion = _("4"); } /* --- --- ---*/ if (! string_ok(dbVersion) || dbVersion != "4") throw _Exception(_("The database seems to be from a newer version (database version ") + dbVersion + ")!"); AUTOUNLOCK(); log_debug("end\n"); dbReady(); } String MysqlStorage::quote(String value) { /* note: mysql_real_escape_string returns a maximum of (length * 2 + 1) * chars; we need +1 for the first ' - the second ' will be written over * the \0; then the string won't be null-terminated, but that doesn't matter, * because we give the correct length to String() */ char *q = (char *)MALLOC(value.length() * 2 + 2); *q = '\''; long size = mysql_real_escape_string(&db, q + 1, value.c_str(), value.length()); q[size + 1] = '\''; String ret(q, size + 2); FREE(q); return ret; } String MysqlStorage::getError(MYSQL *db) { Ref err_buf(new StringBuffer()); *err_buf << "mysql_error (" << String::from(mysql_errno(db)); *err_buf << "): \"" << mysql_error(db) << "\""; log_debug("%s\n", err_buf->c_str()); return err_buf->toString(); } Ref MysqlStorage::select(const char *query, int length) { #ifdef MYSQL_SELECT_DEBUG log_debug("%s\n", query); print_backtrace(); #endif int res; checkMysqlThreadInit(); AUTOLOCK(mysqlMutex); res = mysql_real_query(&db, query, length); if (res) { String myError = getError(&db); throw _StorageException(myError, _("Mysql: mysql_real_query() failed: ") + myError + "; query: " + query); } MYSQL_RES *mysql_res; mysql_res = mysql_store_result(&db); if(! mysql_res) { String myError = getError(&db); throw _StorageException(myError, _("Mysql: mysql_store_result() failed: ") + myError + "; query: " + query); } return Ref (new MysqlResult(mysql_res)); } int MysqlStorage::exec(const char *query, int length, bool getLastInsertId) { #ifdef MYSQL_EXEC_DEBUG log_debug("%s\n", query); print_backtrace(); #endif int res; checkMysqlThreadInit(); AUTOLOCK(mysqlMutex); res = mysql_real_query(&db, query, length); if(res) { String myError = getError(&db); throw _StorageException(myError, _("Mysql: mysql_real_query() failed: ") + myError + "; query: " + query); } int insert_id=-1; if (getLastInsertId) insert_id = mysql_insert_id(&db); return insert_id; } void MysqlStorage::shutdownDriver() { } void MysqlStorage::storeInternalSetting(String key, String value) { String quotedValue = quote(value); Ref q(new StringBuffer()); *q << "INSERT INTO " << QTB << INTERNAL_SETTINGS_TABLE << QTE << " (`key`, `value`) " "VALUES (" << quote(key) << ", "<< quotedValue << ") " "ON DUPLICATE KEY UPDATE `value` = " << quotedValue; SQLStorage::exec(q); } void MysqlStorage::_exec(const char *query, int length) { if (mysql_real_query(&db, query, (length > 0 ? length : strlen(query)))) { String myError = getError(&db); throw _StorageException(myError, _("Mysql: error while updating db: ") + myError); } } void MysqlStorage::_addToInsertBuffer(Ref query) { if (insertBuffer == nil) { insertBuffer = Ref >(new Array()); insertBuffer->append(_("BEGIN")); } Ref sb (new StringBase(query->c_str())); insertBuffer->append(sb); } void MysqlStorage::_flushInsertBuffer() { if (insertBuffer == nil) return; insertBuffer->append(_("COMMIT")); checkMysqlThreadInit(); AUTOLOCK(mysqlMutex); for (int i=0; i < insertBuffer->size(); i++) { _exec(insertBuffer->get(i)->data, insertBuffer->get(i)->len); } AUTOUNLOCK(); insertBuffer->clear(); insertBuffer->append(_("BEGIN")); } /* MysqlResult */ MysqlResult::MysqlResult(MYSQL_RES *mysql_res) : SQLResult() { this->mysql_res = mysql_res; nullRead = false; } MysqlResult::~MysqlResult() { if(mysql_res) { if (! nullRead) { MYSQL_ROW mysql_row; while((mysql_row = mysql_fetch_row(mysql_res)) != NULL); // read out data } mysql_free_result(mysql_res); mysql_res = NULL; } } Ref MysqlResult::nextRow() { MYSQL_ROW mysql_row; mysql_row = mysql_fetch_row(mysql_res); if(mysql_row) { return Ref(new MysqlRow(mysql_row, Ref(this))); } nullRead = true; mysql_free_result(mysql_res); mysql_res = NULL; return nil; } /* MysqlRow */ MysqlRow::MysqlRow(MYSQL_ROW mysql_row, Ref sqlResult) : SQLRow(sqlResult) { this->mysql_row = mysql_row; } #endif // HAVE_MYSQL mediatomb-0.12.1/src/storage/mysql/mysql_create_sql.h0000664000076400007640000001527311352674776017641 00000000000000/*MT* MediaTomb - http://www.mediatomb.cc/ mysql_create_sql.h - this file is part of MediaTomb. Copyright (C) 2005 Gena Batyan , Sergey 'Jin' Bostandzhyan Copyright (C) 2006-2010 Gena Batyan , Sergey 'Jin' Bostandzhyan , Leonhard Wimmer MediaTomb is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. MediaTomb is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with MediaTomb; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. $Id: mysql_create_sql.h 2081 2010-03-23 20:18:00Z lww $ */ /// \file mysql_create_sql.h #ifdef AUTO_CREATE_DATABASE #ifdef HAVE_MYSQL #ifndef __MYSQL_CREATE_SQL_H__ #define __MYSQL_CREATE_SQL_H__ #define MS_CREATE_SQL_INFLATED_SIZE 3820 #define MS_CREATE_SQL_DEFLATED_SIZE 1031 /* begin binary data: */ const unsigned char mysql_create_sql[] = /* 1031 */ {0x78,0x9C,0xBD,0x57,0x51,0x8F,0x9B,0x38,0x10,0x7E,0xDF,0x5F,0xE1,0x7B,0x82 ,0x54,0xDC,0x2D,0xAC,0xB6,0x52,0x4F,0xD5,0x4A,0xCB,0x11,0xB7,0x8D,0x4A,0x60 ,0x0B,0xE4,0x4E,0xBD,0x17,0xE3,0x80,0xB3,0xE1,0x96,0x40,0x04,0x26,0xBA,0xFC ,0xFB,0x1B,0x43,0x08,0x10,0x9C,0x34,0x91,0x4E,0x7D,0x49,0x60,0xF8,0xFC,0xF9 ,0xF3,0x78,0x3C,0x9E,0xB9,0x7F,0xF7,0xCB,0xA3,0x6E,0xE8,0x06,0xF2,0x71,0x80 ,0x9E,0x5D,0x7B,0x4A,0xAC,0x2F,0xA6,0x67,0x5A,0x01,0xF6,0x08,0x98,0x88,0x65 ,0xCF,0xB0,0x13,0x3C,0x3D,0x3F,0xCB,0xCC,0xE8,0xDD,0xFD,0xC7,0xBB,0xFB,0x1F ,0x30,0x78,0xD8,0x5F,0xD8,0x81,0x3F,0xA2,0x38,0xD8,0xCF,0x71,0xB8,0xB6,0x6D ,0x06,0x33,0xD7,0x81,0x27,0xC7,0xC1,0x96,0x78,0x14,0x14,0x12,0xF3,0x98,0xC1 ,0x31,0xE7,0xD8,0x47,0x15,0x5F,0x7D,0xE8,0xBE,0xE9,0xC6,0x63,0xC7,0xBE,0x70 ,0x66,0xDF,0x16,0x18,0x84,0x62,0xEB,0xAB,0x50,0x36,0x78,0xD7,0xD0,0xF0,0xB3 ,0x7E,0x86,0xE4,0x93,0xEB,0xE1,0xD9,0x67,0x87,0x7C,0xC5,0xDF,0x3B,0xA6,0xB1 ,0x51,0x43,0x12,0xA0,0x7E,0x66,0xD9,0xFE,0x37,0x9B,0xCC,0xDD,0x29,0x06,0xA6 ,0xF6,0x51,0x43,0x47,0xA3,0xE2,0xB8,0xC4,0x5C,0x04,0x2E,0xF9,0xD3,0xB4,0x41 ,0x1F,0x78,0xE1,0x6F,0xEC,0xB9,0x4A,0x8F,0xCB,0x38,0xE1,0x72,0xDC,0x00,0xFB ,0x07,0xB2,0xFA,0xB9,0x61,0x6B,0xCC,0x8D,0x08,0xCB,0xC3,0x66,0x80,0x51,0x60 ,0xFE,0x61,0x63,0x14,0x6E,0x38,0x89,0xE2,0x92,0xE4,0xCB,0x7F,0x58,0xC4,0x43 ,0xA4,0xDE,0x21,0x14,0x26,0x71,0x88,0x92,0x8C,0xAB,0x86,0x31,0x41,0x30,0x12 ,0x39,0x0B,0xDB,0x46,0xB4,0xE2,0x39,0x49,0xB2,0xA8,0x60,0x1B,0x96,0x71,0x4D ,0xE0,0x0A,0xB6,0x22,0x7D,0x6C,0xCC,0x56,0xB4,0x4A,0x79,0x8D,0xAF,0x01,0x5B ,0x5A,0x00,0x96,0x48,0xF9,0x5A,0xB0,0xA2,0x2B,0x35,0xB6,0x51,0x40,0xF8,0x7E ,0xCB,0x42,0xC4,0x93,0x6C,0x2F,0x46,0x3C,0x4E,0x50,0x95,0x95,0xC9,0x6B,0xC6 ,0xE2,0xE3,0xC8,0x1A,0x5D,0x6D,0xB3,0x2D,0x89,0x52,0x5A,0x96,0x21,0xDA,0xD1 ,0x22,0x5A,0xD3,0x42,0xFD,0xA0,0x4B,0x24,0xC4,0x11,0xE1,0x09,0x4F,0x59,0x07 ,0x7B,0x78,0xFF,0x5E,0x82,0x4B,0xF3,0x88,0xF2,0x24,0xCF,0x42,0xB4,0x4C,0xF3 ,0xE5,0xC0,0x44,0xD6,0xB4,0x5C,0x77,0x2B,0x38,0x0A,0x1A,0x71,0x6C,0x18,0xA7 ,0x31,0xE5,0xB4,0xC7,0x41,0xAB,0x7F,0x4F,0x2C,0x05,0x2B,0xF3,0xAA,0x88,0x58 ,0xD9,0xB3,0x55,0x5B,0x00,0xB1,0xEB,0xFC,0xB4,0x49,0x36,0xEC,0xE0,0xA5,0x76 ,0x45,0x8F,0xB2,0x85,0xAF,0x52,0xFA,0x5A,0x4A,0x54,0x8F,0x89,0x8D,0x86,0x98 ,0x17,0x34,0x7A,0x23,0x59,0xB5,0x59,0xB2,0xE2,0xC2,0x9E,0x96,0xAC,0xD8,0x25 ,0x51,0x23,0xF6,0xA2,0x4B,0x5F,0xBC,0xD9,0xDC,0xF4,0xBE,0x23,0x38,0x05,0x08 ,0xA9,0x22,0xA8,0x26,0xC2,0x2C,0x5E,0xC3,0x2E,0xE4,0x48,0x1B,0x44,0x6A,0x1B ,0x4E,0x52,0x54,0x2F,0x92,0xD4,0x5E,0x58,0x69,0x83,0xB0,0xD1,0xBA,0xDD,0x96 ,0x92,0x0C,0x42,0x4C,0x1D,0x0C,0xED,0xF0,0xC7,0x5D,0x6F,0x66,0x11,0xC0,0x61 ,0x20,0x68,0xBD,0xF9,0xA5,0xD3,0x0C,0x1D,0xA9,0x0E,0x1D,0x2B,0x1D,0xD1,0xF7 ,0xA9,0xDA,0xF7,0x70,0x8D,0x86,0xCC,0xE7,0x07,0x9E,0x39,0x83,0xFC,0x3B,0x3C ,0xAE,0x24,0x59,0xAE,0xDE,0x88,0x11,0xB6,0x09,0xA7,0xE6,0xED,0xFC,0x88,0x3C ,0xFC,0x09,0x7B,0xD8,0xB1,0x20,0x37,0x8E,0xCE,0x79,0xBD,0x1F,0x08,0x92,0xE9 ,0x14,0xDB,0x18,0xD2,0x81,0x65,0xFA,0x96,0x39,0xC5,0xC2,0xB2,0x78,0x99,0x9A ,0x9D,0xE5,0x0A,0x05,0x0F,0xA7,0x0A,0x7A,0x0E,0xFA,0x7F,0x44,0xDC,0x4D,0x10 ,0x76,0x3E,0xCF,0x1C,0xFC,0x34,0xDF,0xCF,0x7C,0x73,0x8E,0xC4,0xD5,0x02,0x89 ,0xEF,0x49,0xE4,0xFC,0x8F,0x77,0x33,0xC7,0xC7,0x5E,0x80,0x40,0x9F,0x3B,0x9A ,0xA4,0x4E,0x9D,0x3E,0x52,0x7F,0x35,0xB4,0x3A,0x32,0xE1,0x5F,0x6F,0x9E,0x2E ,0xFF,0x1C,0x40,0xBF,0x77,0xA6,0xC9,0x75,0x13,0xE9,0xC7,0x79,0x0C,0x4D,0x69 ,0x3E,0xFE,0x16,0xE5,0x19,0xA7,0x49,0xC6,0x0A,0x45,0x53,0xBC,0x3C,0xE7,0xCA ,0x8D,0xF3,0x1E,0xBC,0x71,0x3A,0xA5,0x48,0xFD,0xC2,0x87,0x4F,0x90,0x1C,0xD0 ,0x5F,0x5F,0xC0,0xCF,0x87,0x57,0x43,0xB9,0x4E,0xAB,0xD1,0xCE,0x29,0x97,0xFA ,0x62,0xA1,0x69,0x52,0x80,0x35,0x2F,0xF6,0xB7,0x4A,0x96,0x5E,0x33,0x34,0xE2 ,0xC9,0x0E,0x22,0x9B,0xB3,0xCD,0x85,0xBB,0xA6,0xC9,0x9C,0x51,0x93,0x8E,0x07 ,0x39,0x66,0x80,0x28,0x39,0x24,0xCD,0x0B,0x80,0x33,0x09,0x48,0x12,0xCC,0x3D ,0x59,0x67,0xCE,0xD4,0x4F,0x0B,0xE5,0x91,0xDB,0xC0,0x39,0xAC,0xC8,0x68,0x0A ,0x49,0x82,0xC3,0xB5,0xF8,0x7A,0xF0,0xDB,0x1B,0xDB,0x0F,0x2F,0x80,0x81,0x6B ,0x76,0x34,0xAD,0x6E,0x70,0x8D,0x20,0x9B,0xDC,0x78,0xC6,0xC6,0xBA,0xDA,0xA0 ,0x52,0xE2,0x25,0xD9,0xB1,0xA2,0x84,0xED,0x83,0x18,0x7A,0x54,0x64,0xC1,0x20 ,0xAA,0x89,0x32,0xA2,0xD9,0x8D,0x15,0x07,0xB8,0xFB,0x72,0xC5,0x21,0x38,0x49 ,0xCA,0x76,0x2C,0x0D,0x11,0x83,0x94,0xAB,0x2A,0x4B,0x5A,0x26,0x11,0xE8,0x58 ,0x55,0x69,0xAA,0x9C,0x46,0x90,0x40,0x6F,0xF2,0x98,0xB5,0x60,0x0E,0x97,0x6B ,0x0C,0xE0,0x24,0xCB,0x79,0xB2,0xDA,0x9F,0xE2,0xE1,0x28,0x54,0xB0,0xAE,0xDD ,0x35,0x15,0xCA,0x3A,0x89,0x63,0x96,0x5D,0x01,0xAC,0x1D,0x09,0x1B,0x76,0x4D ,0x85,0x01,0x05,0x0F,0x17,0x82,0x93,0x55,0xC2,0xC0,0x0D,0xCB,0xE4,0x55,0x8C ,0x79,0xD0,0x2F,0x8D,0xD9,0x8A,0xAD,0x28,0x79,0x7D,0x97,0x5D,0x12,0x33,0xAA ,0x34,0x24,0x25,0xD1,0x96,0xF2,0x35,0x6C,0x40,0xBF,0x76,0xE1,0x79,0x15,0xAD ,0x85,0x98,0xEB,0xB8,0x9B,0x62,0xA3,0x1F,0x7F,0x61,0x73,0xEB,0xB5,0xC7,0xB3 ,0xA9,0xC5,0x9B,0x2F,0xBD,0x40,0x21,0xED,0xD6,0xAB,0x6D,0x10,0xC8,0x0E,0xF3 ,0x11,0x2D,0x3F,0xC5,0xED,0xC8,0x9F,0x72,0x92,0x07,0xC5,0x7E,0x57,0xE7,0xF7 ,0xAB,0xFE,0x71,0xA3,0x21,0xEB,0x31,0xE4,0xBD,0xC7,0x78,0xEC,0x49,0x93,0x33 ,0xEA,0x7B,0xC6,0x2D,0x88,0xBC,0xF5,0x3B,0xD7,0x14,0xFE,0x68,0xFC,0xB1,0xF1 ,0x3B,0xDB,0x13,0x4A,0x18,0xA4,0x6D,0xDF,0xB9,0x86,0x70,0xDC,0xF8,0xF4,0x7A ,0x9E,0x41,0x0B,0x54,0x23,0xFF,0x03,0x84,0xD2,0x7F,0xB7}; /* end binary data. size = 1031 bytes */ #endif // __MYSQL_CREATE_SQL_H__ #endif // HAVE_MYSQL #endif // AUTO_CREATE_DATABASE mediatomb-0.12.1/src/storage/mysql/mysql_storage.h0000664000076400007640000000707111352674776017160 00000000000000/*MT* MediaTomb - http://www.mediatomb.cc/ mysql_storage.h - this file is part of MediaTomb. Copyright (C) 2005 Gena Batyan , Sergey 'Jin' Bostandzhyan Copyright (C) 2006-2010 Gena Batyan , Sergey 'Jin' Bostandzhyan , Leonhard Wimmer MediaTomb is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. MediaTomb is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with MediaTomb; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. $Id: mysql_storage.h 2081 2010-03-23 20:18:00Z lww $ */ /// \file mysql_storage.h #ifdef HAVE_MYSQL #ifndef __MYSQL_STORAGE_H__ #define __MYSQL_STORAGE_H__ #include "common.h" #include "storage/sql_storage.h" #include "sync.h" #include class MysqlStorage : private SQLStorage { private: MysqlStorage(); friend zmm::Ref Storage::createInstance(); virtual ~MysqlStorage(); virtual void init(); virtual void shutdownDriver(); virtual zmm::String quote(zmm::String str); virtual inline zmm::String quote(int val) { return zmm::String::from(val); } virtual inline zmm::String quote(unsigned int val) { return zmm::String::from(val); } virtual inline zmm::String quote(long val) { return zmm::String::from(val); } virtual inline zmm::String quote(unsigned long val) { return zmm::String::from(val); } virtual inline zmm::String quote(bool val) { return zmm::String(val ? '1' : '0'); } virtual inline zmm::String quote(char val) { return quote(zmm::String(val)); } virtual zmm::Ref select(const char *query, int length); virtual int exec(const char *query, int length, bool getLastInsertId = false); virtual void storeInternalSetting(zmm::String key, zmm::String value); void _exec(const char *query, int lenth = -1); MYSQL db; bool mysql_connection; zmm::String getError(MYSQL *db); zmm::Ref mysqlMutex; virtual void threadCleanup(); virtual bool threadCleanupRequired() { return true; } pthread_key_t mysql_init_key; bool mysql_init_key_initialized; void checkMysqlThreadInit(); zmm::Ref > insertBuffer; virtual void _addToInsertBuffer(zmm::Ref query); virtual void _flushInsertBuffer(); }; class MysqlResult : private SQLResult { private: int nullRead; MysqlResult(MYSQL_RES *mysql_res); virtual ~MysqlResult(); virtual zmm::Ref nextRow(); virtual unsigned long long getNumRows() { return mysql_num_rows(mysql_res); } MYSQL_RES *mysql_res; friend class MysqlRow; friend class MysqlStorage; }; class MysqlRow : private SQLRow { private: MysqlRow(MYSQL_ROW mysql_row, zmm::Ref sqlResult); inline virtual char* col_c_str(int index) { return mysql_row[index]; } MYSQL_ROW mysql_row; friend zmm::Ref MysqlResult::nextRow(); }; #endif // __MYSQL_STORAGE_H__ #endif // HAVE_MYSQL mediatomb-0.12.1/src/storage/sql_storage.h0000664000076400007640000002317711352674776015452 00000000000000/*MT* MediaTomb - http://www.mediatomb.cc/ sql_storage.h - this file is part of MediaTomb. Copyright (C) 2005 Gena Batyan , Sergey 'Jin' Bostandzhyan Copyright (C) 2006-2010 Gena Batyan , Sergey 'Jin' Bostandzhyan , Leonhard Wimmer MediaTomb is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. MediaTomb is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with MediaTomb; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. $Id: sql_storage.h 2081 2010-03-23 20:18:00Z lww $ */ /// \file sql_storage.h #ifndef __SQL_STORAGE_H__ #define __SQL_STORAGE_H__ #include "zmmf/zmmf.h" #include "cds_objects.h" #include "dictionary.h" #include "storage.h" #include "hash.h" #include "sync.h" #include "storage_cache.h" #define QTB table_quote_begin #define QTE table_quote_end #define CDS_OBJECT_TABLE "mt_cds_object" #define CDS_ACTIVE_ITEM_TABLE "mt_cds_active_item" #define INTERNAL_SETTINGS_TABLE "mt_internal_setting" #define AUTOSCAN_TABLE "mt_autoscan" class SQLResult; class SQLRow : public zmm::Object { public: SQLRow(zmm::Ref sqlResult) { this->sqlResult = sqlResult; } //virtual ~SQLRow(); zmm::String col(int index) { return col_c_str(index); } virtual char* col_c_str(int index) = 0; protected: zmm::Ref sqlResult; }; class SQLResult : public zmm::Object { public: //SQLResult(); //virtual ~SQLResult(); virtual zmm::Ref nextRow() = 0; virtual unsigned long long getNumRows() = 0; }; class SQLStorage : protected Storage { public: /* methods to override in subclasses */ virtual zmm::String quote(zmm::String str) = 0; virtual zmm::String quote(int val) = 0; virtual zmm::String quote(unsigned int val) = 0; virtual zmm::String quote(long val) = 0; virtual zmm::String quote(unsigned long val) = 0; virtual zmm::String quote(bool val) = 0; virtual zmm::String quote(char val) = 0; virtual zmm::Ref select(const char *query, int length) = 0; virtual int exec(const char *query, int length, bool getLastInsertId = false) = 0; void dbReady(); /* wrapper functions for select and exec */ zmm::Ref select(zmm::Ref buf) { return select(buf->c_str(), buf->length()); } int exec(zmm::Ref buf, bool getLastInsertId = false) { return exec(buf->c_str(), buf->length(), getLastInsertId); } virtual void addObject(zmm::Ref object, int *changedContainer); virtual void updateObject(zmm::Ref object, int *changedContainer); virtual zmm::Ref loadObject(int objectID); virtual int getChildCount(int contId, bool containers, bool items, bool hideFsRoot); //virtual zmm::Ref > selectObjects(zmm::Ref param); virtual zmm::Ref > getObjects(int parentID, bool withoutContainer); virtual zmm::Ref removeObject(int objectID, bool all); virtual zmm::Ref removeObjects(zmm::Ref > list, bool all = false); virtual zmm::Ref loadObjectByServiceID(zmm::String serviceID); virtual zmm::Ref getServiceObjectIDs(char servicePrefix); /* accounting methods */ virtual int getTotalFiles(); virtual zmm::Ref > browse(zmm::Ref param); virtual zmm::Ref > getMimeTypes(); //virtual zmm::Ref findObjectByTitle(zmm::String title, int parentID); virtual zmm::Ref findObjectByPath(zmm::String fullpath); virtual int findObjectIDByPath(zmm::String fullpath); virtual zmm::String incrementUpdateIDs(int *ids, int size); virtual zmm::String buildContainerPath(int parentID, zmm::String title); virtual void addContainerChain(zmm::String path, zmm::String lastClass, int lastRefID, int *containerID, int *updateID); virtual zmm::String getInternalSetting(zmm::String key); virtual void storeInternalSetting(zmm::String key, zmm::String value) = 0; virtual void updateAutoscanPersistentList(scan_mode_t scanmode, zmm::Ref list); virtual zmm::Ref getAutoscanList(scan_mode_t scanmode); virtual void addAutoscanDirectory(zmm::Ref adir); virtual void updateAutoscanDirectory(zmm::Ref adir); virtual void removeAutoscanDirectoryByObjectID(int objectID); virtual void removeAutoscanDirectory(int autoscanID); virtual int getAutoscanDirectoryType(int objectId); virtual int isAutoscanDirectoryRecursive(int objectId); virtual void autoscanUpdateLM(zmm::Ref adir); virtual zmm::Ref getAutoscanDirectory(int objectID); virtual int isAutoscanChild(int objectID); virtual void checkOverlappingAutoscans(zmm::Ref adir); virtual zmm::Ref getPathIDs(int objectID); virtual void shutdown(); virtual void shutdownDriver() = 0; virtual int ensurePathExistence(zmm::String path, int *changedContainer); virtual zmm::String getFsRootName(); virtual void clearFlagInDB(int flag); protected: SQLStorage(); //virtual ~SQLStorage(); virtual void init(); char table_quote_begin; char table_quote_end; private: class ChangedContainersStr : public Object { public: ChangedContainersStr() { upnp = zmm::Ref(new zmm::StringBuffer()); ui = zmm::Ref(new zmm::StringBuffer()); } zmm::Ref upnp; zmm::Ref ui; }; zmm::String sql_query; /* helper for createObjectFromRow() */ zmm::String getRealLocation(int parentID, zmm::String location); zmm::Ref createObjectFromRow(zmm::Ref row); /* helper for findObjectByPath and findObjectIDByPath */ zmm::Ref _findObjectByPath(zmm::String fullpath); int _ensurePathExistence(zmm::String path, int *changedContainer); /* helper class and helper function for addObject and updateObject */ class AddUpdateTable : public Object { public: AddUpdateTable(zmm::String table, zmm::Ref dict) { this->table = table; this->dict = dict; } zmm::String getTable() { return table; } zmm::Ref getDict() { return dict; } protected: zmm::String table; zmm::Ref dict; }; zmm::Ref > _addUpdateObject(zmm::Ref obj, bool isUpdate, int *changedContainer); /* helper for removeObject(s) */ void _removeObjects(zmm::Ref objectIDs, int offset); zmm::Ref _recursiveRemove(zmm::Ref items, zmm::Ref containers, bool all); virtual zmm::Ref _purgeEmptyContainers(zmm::Ref changedContainersStr); /* helpers for autoscan */ int _getAutoscanObjectID(int autoscanID); void _autoscanChangePersistentFlag(int objectID, bool persistent); zmm::Ref _fillAutoscanDirectory(zmm::Ref row); int _getAutoscanDirectoryInfo(int objectID, zmm::String field); zmm::Ref _checkOverlappingAutoscans(zmm::Ref adir); /* location hash helpers */ zmm::String addLocationPrefix(char prefix, zmm::String path); zmm::String stripLocationPrefix(char* prefix, zmm::String path); zmm::String stripLocationPrefix(zmm::String path); zmm::Ref checkRefID(zmm::Ref obj); int createContainer(int parentID, zmm::String name, zmm::String path, bool isVirtual, zmm::String upnpClass, int refID); zmm::String mapBool(bool val) { return quote((val ? 1 : 0)); } bool remapBool(zmm::String field) { return (string_ok(field) && field == "1"); } void setFsRootName(zmm::String rootName = nil); zmm::String fsRootName; int lastID; int getNextID(); void loadLastID(); zmm::Ref nextIDMutex; zmm::Ref cache; inline bool cacheOn() { return cache != nil; } void addObjectToCache(zmm::Ref object, bool dontLock = false); inline bool doInsertBuffering() { return insertBufferOn; } void addToInsertBuffer(zmm::Ref query); void flushInsertBuffer(bool dontLock = false); /* insert buffer functions to be overriden by implementing classes */ virtual void _addToInsertBuffer(zmm::Ref query) = 0; virtual void _flushInsertBuffer() = 0; bool insertBufferOn; bool insertBufferEmpty; int insertBufferStatementCount; int insertBufferByteCount; zmm::Ref insertBufferMutex; }; #endif // __SQL_STORAGE_H__ mediatomb-0.12.1/src/storage/sqlite3/0000775000076400007640000000000011357204747014400 500000000000000mediatomb-0.12.1/src/storage/sqlite3/sqlite3_create_sql.h0000664000076400007640000001255711352674776020301 00000000000000/*MT* MediaTomb - http://www.mediatomb.cc/ sqlite3_create_sql.h - this file is part of MediaTomb. Copyright (C) 2005 Gena Batyan , Sergey 'Jin' Bostandzhyan Copyright (C) 2006-2010 Gena Batyan , Sergey 'Jin' Bostandzhyan , Leonhard Wimmer MediaTomb is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. MediaTomb is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with MediaTomb; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. $Id: sqlite3_create_sql.h 2081 2010-03-23 20:18:00Z lww $ */ /// \file sqlite3_create_sql.h #ifdef AUTO_CREATE_DATABASE #ifdef HAVE_SQLITE3 #ifndef __SQLITE3_CREATE_SQL_H__ #define __SQLITE3_CREATE_SQL_H__ #define SL3_CREATE_SQL_INFLATED_SIZE 2933 #define SL3_CREATE_SQL_DEFLATED_SIZE 760 /* begin binary data: */ const unsigned char sqlite3_create_sql[] = /* 760 */ {0x78,0x9C,0xB5,0x56,0x5B,0x6F,0xDA,0x30,0x14,0x7E,0xE7,0x57,0x58,0x79,0x09 ,0x95,0xD8,0x04,0xDD,0x2A,0x6D,0xEA,0x53,0x1A,0xDC,0x2A,0x1A,0x4D,0xBA,0x10 ,0xA6,0xED,0xC9,0x32,0x89,0x01,0xAF,0xB9,0xC9,0x71,0xA2,0xF2,0xEF,0x67,0x27 ,0x90,0x0B,0xB9,0x90,0x4D,0x9D,0x84,0x10,0x9C,0xF3,0x9D,0x8B,0xCF,0xF9,0x7C ,0x8E,0x1F,0xE0,0x93,0x61,0x02,0xC7,0xD6,0xCC,0xB5,0xA6,0x3B,0x86,0x65,0xDE ,0x4F,0x74,0x1B,0x6A,0x0E,0x04,0x8E,0xF6,0xB0,0x82,0x40,0x09,0x38,0x72,0xBD ,0x04,0x45,0xDB,0xDF,0xC4,0xE5,0x0A,0x98,0x4E,0x00,0x50,0xA8,0xA7,0x00,0x1A ,0x72,0xB2,0x27,0x0C,0xC4,0x8C,0x06,0x98,0x1D,0xC1,0x2B,0x39,0xCE,0xA4,0x8E ,0x91,0x1D,0xAA,0xEB,0x3D,0xB2,0xC3,0xA9,0xCF,0x81,0xB9,0x59,0xAD,0x72,0x40 ,0x8C,0x19,0x09,0x79,0x03,0x63,0x5A,0x4E,0xAE,0x2F,0xC1,0xEA,0x5C,0xCD,0xB1 ,0x45,0x54,0xC4,0x8F,0x31,0x51,0x00,0xA7,0xE1,0x51,0x58,0x80,0x34,0x4C,0xE8 ,0x3E,0x24,0x5E,0x69,0x96,0x43,0xD3,0x38,0x8C,0x91,0xEB,0xE3,0x24,0x51,0x40 ,0x86,0x99,0x7B,0xC0,0x6C,0xFA,0x65,0x7E,0xD3,0x8E,0xEF,0xB9,0x88,0x53,0xEE ,0x93,0x0A,0x76,0x7B,0x77,0xD7,0x81,0xF3,0x23,0x17,0x73,0x1A,0x85,0x22,0x30 ,0x79,0xE3,0xFD,0x7A,0x74,0xC0,0xC9,0xA1,0x3A,0x4B,0x99,0x5D,0xCB,0x20,0x20 ,0x1C,0x7B,0x98,0xE3,0x3E,0x87,0x38,0x7D,0x1B,0x52,0x33,0x92,0x44,0x29,0x73 ,0x49,0xD2,0x07,0x48,0x63,0x61,0x4E,0xC6,0x15,0x36,0xA0,0x01,0x39,0x95,0xF5 ,0x5C,0x85,0xCF,0x5D,0xC5,0xDA,0xF9,0x78,0x9F,0x74,0x1C,0xAE,0xED,0x78,0x51 ,0x38,0xE6,0x0C,0xBB,0xAF,0x28,0x4C,0x83,0x2D,0x61,0x03,0x24,0x48,0x08,0xCB ,0xA8,0x5B,0x24,0x3B,0xD8,0x06,0xDD,0x32,0xD7,0x82,0x9D,0x86,0xE9,0x00,0xA5 ,0xE2,0x21,0xA2,0xDB,0xDD,0x2B,0x5A,0x28,0xE0,0xD1,0xB2,0xA1,0xF1,0x64,0x82 ,0x6F,0xF0,0x17,0x98,0x9E,0xB9,0x77,0x03,0x6C,0xF8,0x08,0x6D,0x68,0xEA,0x70 ,0x5D,0xB7,0x12,0xEC,0x55,0x72,0xB5,0x65,0x82,0x25,0x5C,0x41,0x41,0x72,0x5D ,0x5B,0xEB,0xDA,0x12,0x4A,0xC9,0xE6,0x65,0xA9,0x55,0x92,0x6B,0xB1,0x6F,0x2F ,0x63,0x57,0xB4,0x7E,0x8F,0xF0,0x93,0x9B,0xFB,0x89,0x61,0xAE,0xA1,0xED,0x00 ,0x11,0xDE,0x6A,0x5D,0xC3,0x1F,0xDA,0x6A,0x03,0xD7,0xD3,0x0F,0x8B,0x59,0x51 ,0x29,0x20,0x7F,0xCD,0xCF,0x7F,0xC6,0x7C,0x97,0xE0,0xAF,0x75,0xF9,0xB8,0xB0 ,0xF3,0x7A,0x54,0xF1,0x51,0x0B,0xFD,0x47,0x37,0x0A,0x39,0xA6,0x21,0x61,0xAA ,0x90,0xD9,0x51,0xC4,0xD5,0xFF,0x99,0xC5,0xA2,0xE6,0xA4,0x2F,0x89,0x17,0x1D ,0x2C,0x29,0x13,0xE2,0x88,0x1D,0xFF,0x3D,0x99,0xCE,0x89,0x88,0x5D,0x4E,0x33 ,0xC1,0x60,0x4E,0x82,0x11,0x63,0x51,0xA2,0xE5,0x2C,0x69,0x90,0xBD,0x31,0xC0 ,0x12,0x2E,0x6E,0xEF,0x00,0xA0,0xCE,0xC6,0x76,0x0A,0x3D,0x37,0xA2,0x45,0xC7 ,0xCB,0x71,0xFE,0x57,0x8C,0x6C,0xD5,0x41,0x9E,0x96,0x85,0xD8,0x47,0x09,0xE1 ,0x62,0x3C,0xEF,0x4F,0x85,0x10,0x87,0x6E,0xCE,0x95,0x5A,0x35,0x9A,0x87,0xCE ,0xB0,0x9F,0xF6,0x1D,0xBA,0xEB,0x0E,0xB4,0x03,0x9E,0xC8,0xA0,0x7A,0x5B,0x94 ,0x11,0x96,0x88,0x22,0xCB,0xBE,0x7F,0x52,0xBB,0xD2,0xC5,0x29,0x8F,0x12,0x17 ,0x87,0x23,0xFA,0x25,0x0A,0x34,0xBC,0xC6,0xA4,0x1F,0xE4,0x93,0x8C,0xF8,0x55 ,0xFA,0x8B,0xF9,0x65,0x4F,0x25,0x28,0x88,0x3C,0x32,0x80,0x11,0xEC,0x4C,0x45 ,0xDE,0xD9,0xD5,0x0D,0x77,0xA0,0x9E,0x47,0xC2,0x6B,0xA8,0xBC,0x42,0xA2,0xAC ,0x63,0x36,0x92,0xD8,0x96,0x5C,0xA6,0x47,0x77,0x94,0x78,0x63,0x0C,0x62,0x59 ,0xE1,0x84,0x8B,0x41,0x37,0x90,0x46,0x6B,0xD9,0x5C,0xDB,0xA4,0x31,0xE6,0x07 ,0x51,0xEC,0xDE,0xC5,0xC6,0xA3,0xD4,0x3D,0xC8,0x04,0x47,0x84,0x2C,0xD6,0xD0 ,0xC5,0x5D,0x39,0xF7,0x3D,0xEF,0x68,0xF3,0x82,0x9C,0xFA,0xFC,0xFE,0x97,0xC4 ,0x30,0x97,0xF0,0x27,0x68,0x78,0x42,0xC5,0x7E,0x92,0x66,0x0D,0xF9,0xB4,0x90 ,0x0F,0xDB,0x96,0xFB,0xA5,0x6D,0x5E,0xAA,0x66,0xB5,0xF7,0xD2,0xEC,0xFC,0xCE ,0xE9,0x70,0x5B,0x83,0xB5,0xBD,0xD5,0x94,0x1D,0xA6,0xE5,0xAB,0xA7,0x08,0xDA ,0x36,0x6F,0x3C,0x8B,0x66,0x65,0x6A,0x1D,0xAE,0xEA,0x4F,0x85,0xB6,0x9F,0xBA ,0xB6,0xC3,0xF8,0x72,0x10,0x20,0x39,0x5A,0x0A,0x27,0x97,0xAA,0xA9,0x50,0x55 ,0x1E,0x36,0xA6,0xF1,0x7D,0x53,0x73,0x54,0x72,0xA3,0x60,0xC2,0xC9,0xC7,0x59 ,0x3A,0x2D,0xA4,0xC3,0xAD,0xA9,0x1E,0x33,0xED,0x63,0x54,0x3A,0xE9,0xC3,0x7A ,0x7E,0x36,0x9C,0xFB,0xC9,0x1F,0x6D,0x27,0x91,0x85}; /* end binary data. size = 760 bytes */ #endif // __SQLITE3_CREATE_SQL_H__ #endif // HAVE_SQLITE3 #endif // AUTO_CREATE_DATABASE mediatomb-0.12.1/src/storage/sqlite3/sqlite3_storage.h0000664000076400007640000001711611352674776017617 00000000000000/*MT* MediaTomb - http://www.mediatomb.cc/ sqlite3_storage.h - this file is part of MediaTomb. Copyright (C) 2005 Gena Batyan , Sergey 'Jin' Bostandzhyan Copyright (C) 2006-2010 Gena Batyan , Sergey 'Jin' Bostandzhyan , Leonhard Wimmer MediaTomb is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. MediaTomb is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with MediaTomb; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. $Id: sqlite3_storage.h 2081 2010-03-23 20:18:00Z lww $ */ /// \file sqlite3_storage.h ///\brief Definitions of the Sqlite3Storage, Sqlite3Result, Sqlite3Row and SLTask classes. #ifdef HAVE_SQLITE3 #ifndef __SQLITE3_STORAGE_H__ #define __SQLITE3_STORAGE_H__ #include #include "storage/sql_storage.h" #include "sync.h" #include "timer.h" class Sqlite3Storage; class Sqlite3Result; /// \brief A virtual class that represents a task to be done by the sqlite3 thread. class SLTask : public zmm::Object { public: /// \brief Instantiate a task SLTask(); /// \brief run the sqlite3 task /// \param sl The instance of Sqlite3Storage to do the queries with. virtual void run(sqlite3 **db, Sqlite3Storage *sl) = 0; /// \brief returns true if the task is not completed /// \return true if the task is not completed yet, false if the task is finished and the results are ready. bool is_running(); /// \brief modify the creator of the task using the supplied pthread_mutex and pthread_cond, that the task is finished void sendSignal(); void sendSignal(zmm::String error); void waitForTask(); bool didContamination() { return contamination; } bool didDecontamination() { return decontamination; } zmm::String getError() { return error; } protected: /// \brief true as long as the task is not finished /// /// The value is set by the constructor to true and then to false be sendSignal() bool running; /// \brief true if this task has changed the db (in comparison to the backup) bool contamination; /// \brief true if this task has backuped the db bool decontamination; zmm::Ref cond; zmm::Ref mutex; zmm::String error; }; #ifdef AUTO_CREATE_DATABASE /// \brief A task for the sqlite3 thread to inititally create the database. class SLInitTask : public SLTask { public: /// \brief Constructor for the sqlite3 init task SLInitTask() : SLTask() {} virtual void run(sqlite3 **db, Sqlite3Storage *sl); }; #endif /// \brief A task for the sqlite3 thread to do a SQL select. class SLSelectTask : public SLTask { public: /// \brief Constructor for the sqlite3 select task /// \param query The SQL query string SLSelectTask(const char *query); virtual void run(sqlite3 **db, Sqlite3Storage *sl); inline zmm::Ref getResult() { return RefCast(pres, SQLResult); }; protected: /// \brief The SQL query string const char *query; /// \brief The Sqlite3Result zmm::Ref pres; }; /// \brief A task for the sqlite3 thread to do a SQL exec. class SLExecTask : public SLTask { public: /// \brief Constructor for the sqlite3 exec task /// \param query The SQL query string SLExecTask(const char *query, bool getLastInsertId); virtual void run(sqlite3 **db, Sqlite3Storage *sl); inline int getLastInsertId() { return lastInsertId; } protected: /// \brief The SQL query string const char *query; int lastInsertId; bool getLastInsertIdFlag; }; /// \brief A task for the sqlite3 thread to do a SQL exec. class SLBackupTask : public SLTask { public: /// \brief Constructor for the sqlite3 backup task SLBackupTask(bool restore) { this->restore = restore; }; virtual void run(sqlite3 **db, Sqlite3Storage *sl); protected: bool restore; }; /// \brief The Storage class for using SQLite3 class Sqlite3Storage : private SQLStorage { private: Sqlite3Storage(); friend zmm::Ref Storage::createInstance(); virtual void init(); virtual void shutdownDriver(); virtual zmm::String quote(zmm::String str); virtual inline zmm::String quote(int val) { return zmm::String::from(val); } virtual inline zmm::String quote(unsigned int val) { return zmm::String::from(val); } virtual inline zmm::String quote(long val) { return zmm::String::from(val); } virtual inline zmm::String quote(unsigned long val) { return zmm::String::from(val); } virtual inline zmm::String quote(bool val) { return zmm::String(val ? '1' : '0'); } virtual inline zmm::String quote(char val) { return quote(zmm::String(val)); } virtual zmm::Ref select(const char *query, int length); virtual int exec(const char *query, int length, bool getLastInsertId = false); virtual void storeInternalSetting(zmm::String key, zmm::String value); void _exec(const char *query); zmm::String startupError; zmm::String getError(zmm::String query, zmm::String error, sqlite3 *db); static void *staticThreadProc(void *arg); void threadProc(); void addTask(zmm::Ref task, bool onlyIfDirty = false); pthread_t sqliteThread; zmm::Ref cond; zmm::Ref sqliteMutex; /// \brief is set to true by shutdown() if the sqlite3 thread should terminate bool shutdownFlag; /// \brief the tasks to be done by the sqlite3 thread zmm::Ref > taskQueue; bool taskQueueOpen; virtual void threadCleanup() {} virtual bool threadCleanupRequired() { return false; } inline void signal() { cond->signal(); } zmm::Ref insertBuffer; virtual void _addToInsertBuffer(zmm::Ref query); virtual void _flushInsertBuffer(); bool dirty; friend class SLSelectTask; friend class SLExecTask; friend class SLInitTask; friend class Sqlite3BackupTimerSubscriber; }; /// \brief Represents a result of a sqlite3 select class Sqlite3Result : public SQLResult { private: Sqlite3Result(); virtual ~Sqlite3Result(); virtual zmm::Ref nextRow(); virtual unsigned long long getNumRows() { return nrow; } char **table; char **row; int cur_row; int nrow; int ncolumn; friend class SLSelectTask; friend class Sqlite3Row; friend class Sqlite3Storage; }; /// \brief Represents a row of a result of a sqlite3 select class Sqlite3Row : public SQLRow { private: Sqlite3Row(char **row, zmm::Ref sqlResult); inline virtual char* col_c_str(int index) { return row[index]; } char **row; zmm::Ref res; friend class Sqlite3Result; }; class Sqlite3BackupTimerSubscriber : public TimerSubscriberObject { /// \brief for making backups in regulary intervals - see TimerSubscriber virtual void timerNotify(zmm::Ref sqlite3storage); }; #endif // __SQLITE3_STORAGE_H__ #endif // HAVE_SQLITE3 mediatomb-0.12.1/src/storage/sqlite3/sqlite3_storage.cc0000664000076400007640000004370311352674776017756 00000000000000/*MT* MediaTomb - http://www.mediatomb.cc/ sqlite3_storage.cc - this file is part of MediaTomb. Copyright (C) 2005 Gena Batyan , Sergey 'Jin' Bostandzhyan Copyright (C) 2006-2010 Gena Batyan , Sergey 'Jin' Bostandzhyan , Leonhard Wimmer MediaTomb is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. MediaTomb is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with MediaTomb; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. $Id: sqlite3_storage.cc 2081 2010-03-23 20:18:00Z lww $ */ /// \file sqlite3_storage.cc #ifdef HAVE_CONFIG_H #include "autoconfig.h" #endif #ifdef HAVE_SQLITE3 #include "sqlite3_storage.h" #include "common.h" #include "config_manager.h" #ifdef AUTO_CREATE_DATABASE #include "sqlite3_create_sql.h" #include #endif // updates 1->2 #define SQLITE3_UPDATE_1_2_1 "DROP INDEX mt_autoscan_obj_id" #define SQLITE3_UPDATE_1_2_2 "CREATE UNIQUE INDEX mt_autoscan_obj_id ON mt_autoscan(obj_id)" #define SQLITE3_UPDATE_1_2_3 "ALTER TABLE \"mt_autoscan\" ADD \"path_ids\" text" #define SQLITE3_UPDATE_1_2_4 "UPDATE \"mt_internal_setting\" SET \"value\"='2' WHERE \"key\"='db_version' AND \"value\"='1'" // updates 2->3 #define SQLITE3_UPDATE_2_3_1 "ALTER TABLE \"mt_cds_object\" ADD \"service_id\" varchar(255) default NULL" #define SQLITE3_UPDATE_2_3_2 "CREATE INDEX mt_cds_object_service_id ON mt_cds_object(service_id)" #define SQLITE3_UPDATE_2_3_3 "UPDATE \"mt_internal_setting\" SET \"value\"='3' WHERE \"key\"='db_version' AND \"value\"='2'" #define SL3_INITITAL_QUEUE_SIZE 20 using namespace zmm; using namespace mxml; Sqlite3Storage::Sqlite3Storage() : SQLStorage() { shutdownFlag = false; table_quote_begin = '"'; table_quote_end = '"'; startupError = nil; sqliteMutex = Ref(new Mutex()); cond = Ref(new Cond(sqliteMutex)); insertBuffer = nil; dirty = false; } void Sqlite3Storage::init() { SQLStorage::init(); int ret; AUTOLOCK(sqliteMutex); /* pthread_attr_t attr; pthread_attr_init(&attr); pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED); */ String dbFilePath = ConfigManager::getInstance()->getOption(CFG_SERVER_STORAGE_SQLITE_DATABASE_FILE); // check for db-file if (access(dbFilePath.c_str(), R_OK | W_OK) != 0 && errno != ENOENT) throw _StorageException(nil, _("Error while accessing sqlite database file (") + dbFilePath +"): " + mt_strerror(errno)); taskQueue = Ref >(new ObjectQueue(SL3_INITITAL_QUEUE_SIZE)); taskQueueOpen = true; ret = pthread_create( &sqliteThread, NULL, //&attr, Sqlite3Storage::staticThreadProc, this ); // wait for sqlite3 thread to become ready cond->wait(); AUTOUNLOCK(); if (startupError != nil) throw _StorageException(nil, startupError); String dbVersion = nil; try { dbVersion = getInternalSetting(_("db_version")); } catch (Exception) { log_warning("Sqlite3 database seems to be corrupt or doesn't exist yet.\n"); // database seems to be corrupt or nonexistent if (ConfigManager::getInstance()->getBoolOption(CFG_SERVER_STORAGE_SQLITE_RESTORE)) { // try to restore database // checking for backup file String dbFilePathbackup = dbFilePath + ".backup"; if (access(dbFilePathbackup.c_str(), R_OK) == 0) { try { // trying to copy backup file Ref btask (new SLBackupTask(true)); this->addTask(RefCast(btask, SLTask)); btask->waitForTask(); dbVersion = getInternalSetting(_("db_version")); } catch (Exception) { } } if (dbVersion == nil) { #ifdef AUTO_CREATE_DATABASE log_info("no sqlite3 backup is available or backup is corrupt. automatically creating database...\n"); Ref ptask (new SLInitTask()); addTask(RefCast(ptask, SLTask)); try { ptask->waitForTask(); dbVersion = getInternalSetting(_("db_version")); } catch (Exception e) { shutdown(); throw _Exception(_("error while creating database: ") + e.getMessage()); } log_info("database created successfully.\n"); #else shutdown(); throw _Exception(_("database doesn't seem to exist yet and autocreation wasn't compiled in")); #endif } } else { // fail because restore option is false shutdown(); throw _Exception(_("sqlite3 database seems to be corrupt and the 'on-error' option is set to 'fail'")); } } if (dbVersion == nil) { shutdown(); throw _Exception(_("sqlite3 database seems to be corrupt and restoring from backup failed")); } _exec("PRAGMA locking_mode = EXCLUSIVE"); int synchronousOption = ConfigManager::getInstance()->getIntOption(CFG_SERVER_STORAGE_SQLITE_SYNCHRONOUS); Ref buf(new StringBuffer()); *buf << "PRAGMA synchronous = " << synchronousOption; SQLStorage::exec(buf); log_debug("db_version: %s\n", dbVersion.c_str()); /* --- database upgrades --- */ if (dbVersion == "1") { log_info("Doing an automatic database upgrade from database version 1 to version 2...\n"); _exec(SQLITE3_UPDATE_1_2_1); _exec(SQLITE3_UPDATE_1_2_2); _exec(SQLITE3_UPDATE_1_2_3); _exec(SQLITE3_UPDATE_1_2_4); log_info("database upgrade successful.\n"); dbVersion = _("2"); } if (dbVersion == "2") { log_info("Doing an automatic database upgrade from database version 2 to version 3...\n"); _exec(SQLITE3_UPDATE_2_3_1); _exec(SQLITE3_UPDATE_2_3_2); _exec(SQLITE3_UPDATE_2_3_3); log_info("database upgrade successful.\n"); dbVersion = _("3"); } /* --- --- ---*/ if (! string_ok(dbVersion) || dbVersion != "3") throw _Exception(_("The database seems to be from a newer version!")); // add timer for backups if (ConfigManager::getInstance()->getBoolOption(CFG_SERVER_STORAGE_SQLITE_BACKUP_ENABLED)) { int backupInterval = ConfigManager::getInstance()->getIntOption(CFG_SERVER_STORAGE_SQLITE_BACKUP_INTERVAL); Ref backupTimerSubscriber(new Sqlite3BackupTimerSubscriber()); Timer::getInstance()->addTimerSubscriber(backupTimerSubscriber, backupInterval, Ref(this)); // do a backup now Ref btask (new SLBackupTask(false)); this->addTask(RefCast(btask, SLTask)); btask->waitForTask(); } dbReady(); } void Sqlite3Storage::_exec(const char *query) { exec(query, strlen(query), false); } String Sqlite3Storage::quote(String value) { char *q = sqlite3_mprintf("'%q'", (value == nil ? "" : value.c_str())); String ret = q; sqlite3_free(q); return ret; } String Sqlite3Storage::getError(String query, String error, sqlite3 *db) { return _("SQLITE3: (") + sqlite3_errcode(db) + ") " + sqlite3_errmsg(db) +"\nQuery:" + (query == nil ? _("unknown") : query) + "\nerror: " + (error == nil ? _("unknown") : error); } Ref Sqlite3Storage::select(const char *query, int length) { //fprintf(stdout, "%s\n",query); //fflush(stdout); Ref ptask (new SLSelectTask(query)); addTask(RefCast(ptask, SLTask)); ptask->waitForTask(); return ptask->getResult(); } int Sqlite3Storage::exec(const char *query, int length, bool getLastInsertId) { //fprintf(stdout, "%s\n",query); //fflush(stdout); Ref ptask (new SLExecTask(query, getLastInsertId)); addTask(RefCast(ptask, SLTask)); ptask->waitForTask(); if (getLastInsertId) return ptask->getLastInsertId(); else return -1; } void *Sqlite3Storage::staticThreadProc(void *arg) { Sqlite3Storage *inst = (Sqlite3Storage *)arg; inst->threadProc(); log_debug("Sqlite3Storage::staticThreadProc - exiting thread\n"); pthread_exit(NULL); return NULL; } void Sqlite3Storage::threadProc() { Ref task; sqlite3 *db; String dbFilePath = ConfigManager::getInstance()->getOption(CFG_SERVER_STORAGE_SQLITE_DATABASE_FILE); int res = sqlite3_open(dbFilePath.c_str(), &db); if(res != SQLITE_OK) { startupError = _("Sqlite3Storage.init: could not open ") + dbFilePath; return; } AUTOLOCK(sqliteMutex); // tell init() that we are ready cond->signal(); while(! shutdownFlag) { if((task = taskQueue->dequeue()) == nil) { /* if nothing to do, sleep until awakened */ cond->wait(); continue; } AUTOUNLOCK(); try { task->run(&db, this); if (task->didContamination()) dirty = true; else if (task->didDecontamination()) dirty = false; task->sendSignal(); } catch (Exception e) { task->sendSignal(e.getMessage()); } AUTORELOCK(); } taskQueueOpen = false; while((task = taskQueue->dequeue()) != nil) { task->sendSignal(_("Sorry, sqlite3 thread is shutting down")); } if (db) sqlite3_close(db); } void Sqlite3Storage::addTask(zmm::Ref task, bool onlyIfDirty) { if (! taskQueueOpen) throw _Exception(_("sqlite3 task queue is already closed")); AUTOLOCK(sqliteMutex); if (! taskQueueOpen) { throw _Exception(_("sqlite3 task queue is already closed")); } if (! onlyIfDirty || dirty) { taskQueue->enqueue(task); signal(); } } void Sqlite3Storage::shutdownDriver() { log_debug("start\n"); AUTOLOCK(sqliteMutex); shutdownFlag = true; log_debug("signalling...\n"); signal(); AUTOUNLOCK(); log_debug("waiting for thread\n"); if (sqliteThread) pthread_join(sqliteThread, NULL); sqliteThread = 0; log_debug("end\n"); } void Sqlite3Storage::storeInternalSetting(String key, String value) { Ref q(new StringBuffer()); *q << "INSERT OR REPLACE INTO " << QTB << INTERNAL_SETTINGS_TABLE << QTE << " (" << QTB << "key" << QTE << ", " << QTB << "value" << QTE << ") " "VALUES (" << quote(key) << ", "<< quote(value) << ") "; SQLStorage::exec(q); } void Sqlite3Storage::_addToInsertBuffer(Ref query) { if (insertBuffer == nil) { insertBuffer = Ref(new StringBuffer()); *insertBuffer << "BEGIN TRANSACTION;"; } *insertBuffer << query << ';'; } void Sqlite3Storage::_flushInsertBuffer() { if (insertBuffer == nil) return; *insertBuffer << "COMMIT;"; SQLStorage::exec(insertBuffer); insertBuffer->clear(); *insertBuffer << "BEGIN TRANSACTION;"; } /* SLTask */ SLTask::SLTask() : Object() { running = true; mutex = Ref(new Mutex()); cond = Ref(new Cond(mutex)); error = nil; contamination = false; decontamination = false; } bool SLTask::is_running() { return running; } void SLTask::sendSignal() { AUTOLOCK(mutex); running=false; cond->signal(); } void SLTask::sendSignal(String error) { this->error = error; sendSignal(); } void SLTask::waitForTask() { if (is_running()) { // we check before we lock first, because there is no need to lock then AUTOLOCK(mutex); if (is_running()) { // we check it a second time after locking to ensure we didn't miss the pthread_cond_signal cond->wait(); // waiting for the task to complete } } if (getError() != nil) { log_debug("%s\n", getError().c_str()); throw _Exception(getError()); } } #ifdef AUTO_CREATE_DATABASE /* SLInitTask */ void SLInitTask::run(sqlite3 **db, Sqlite3Storage *sl) { String dbFilePath = ConfigManager::getInstance()->getOption(CFG_SERVER_STORAGE_SQLITE_DATABASE_FILE); sqlite3_close(*db); if (unlink(dbFilePath.c_str()) != 0) throw _StorageException(nil, _("error while autocreating sqlite3 database: could not unlink old database file: ") + mt_strerror(errno)); int res = sqlite3_open(dbFilePath.c_str(), db); if (res != SQLITE_OK) throw _StorageException(nil, _("error while autocreating sqlite3 database: could not create new database")); unsigned char buf[SL3_CREATE_SQL_INFLATED_SIZE + 1]; // +1 for '\0' at the end of the string unsigned long uncompressed_size = SL3_CREATE_SQL_INFLATED_SIZE; int ret = uncompress(buf, &uncompressed_size, sqlite3_create_sql, SL3_CREATE_SQL_DEFLATED_SIZE); if (ret != Z_OK || uncompressed_size != SL3_CREATE_SQL_INFLATED_SIZE) throw _StorageException(nil, _("Error while uncompressing sqlite3 create sql. returned: ") + ret); buf[SL3_CREATE_SQL_INFLATED_SIZE] = '\0'; char *err = NULL; ret = sqlite3_exec( *db, (const char *)buf, NULL, NULL, &err ); String error = nil; if (err != NULL) { error = err; sqlite3_free(err); } if(ret != SQLITE_OK) { throw _StorageException(nil, sl->getError((const char*)buf, error, *db)); } contamination = true; } #endif /* SLSelectTask */ SLSelectTask::SLSelectTask(const char *query) : SLTask() { this->query = query; } void SLSelectTask::run(sqlite3 **db, Sqlite3Storage *sl) { pres = Ref(new Sqlite3Result()); char *err; int ret = sqlite3_get_table( *db, query, &pres->table, &pres->nrow, &pres->ncolumn, &err ); String error = nil; if (err != NULL) { error = err; sqlite3_free(err); } if(ret != SQLITE_OK) { throw _StorageException(nil, sl->getError(query, error, *db)); } pres->row = pres->table; pres->cur_row = 0; } /* SLExecTask */ SLExecTask::SLExecTask(const char *query, bool getLastInsertId) : SLTask() { this->query = query; this->getLastInsertIdFlag = getLastInsertId; } void SLExecTask::run(sqlite3 **db, Sqlite3Storage *sl) { //log_debug("%s\n", query); char *err; int res = sqlite3_exec( *db, query, NULL, NULL, &err ); String error = nil; if (err != NULL) { error = err; sqlite3_free(err); } if(res != SQLITE_OK) { throw _StorageException(nil, sl->getError(query, error, *db)); } if (getLastInsertIdFlag) lastInsertId = sqlite3_last_insert_rowid(*db); contamination = true; } /* SLBackupTask */ void SLBackupTask::run(sqlite3 **db, Sqlite3Storage *sl) { String dbFilePath = ConfigManager::getInstance()->getOption(CFG_SERVER_STORAGE_SQLITE_DATABASE_FILE); if (! restore) { try { copy_file( dbFilePath, dbFilePath + ".backup" ); log_debug("sqlite3 backup successful\n"); decontamination = true; } catch (Exception e) { log_error("error while making sqlite3 backup: %s\n", e.getMessage().c_str()); } } else { log_info("trying to restore sqlite3 database from backup...\n"); sqlite3_close(*db); try { copy_file( dbFilePath + ".backup", dbFilePath ); } catch (Exception e) { throw _StorageException(nil, _("error while restoring sqlite3 backup: ") + e.getMessage()); } int res = sqlite3_open(dbFilePath.c_str(), db); if (res != SQLITE_OK) { throw _StorageException(nil, _("error while restoring sqlite3 backup: could not reopen sqlite3 database after restore")); } log_info("sqlite3 database successfully restored from backup.\n"); } } /* Sqlite3Result */ Sqlite3Result::Sqlite3Result() : SQLResult() { table = NULL; } Sqlite3Result::~Sqlite3Result() { if(table) { sqlite3_free_table(table); table = NULL; } } Ref Sqlite3Result::nextRow() { if(nrow) { row += ncolumn; cur_row++; if (cur_row <= nrow) { Ref p (new Sqlite3Row(row, Ref(this))); p->res = Ref(this); return RefCast(p, SQLRow); } else return nil; } return nil; } /* Sqlite3Row */ Sqlite3Row::Sqlite3Row(char **row, Ref sqlResult) : SQLRow(sqlResult) { this->row = row; } /* Sqlite3BackupTimerSubscriber */ void Sqlite3BackupTimerSubscriber::timerNotify(Ref sqlite3storage) { Sqlite3Storage *storage = (Sqlite3Storage*)(sqlite3storage.getPtr()); Ref btask (new SLBackupTask(false)); storage->addTask(RefCast(btask, SLTask), true); } #endif // HAVE_SQLITE3 mediatomb-0.12.1/src/storage/cache_object.h0000664000076400007640000000567611352674776015524 00000000000000/*MT* MediaTomb - http://www.mediatomb.cc/ cache_object.h - this file is part of MediaTomb. Copyright (C) 2005 Gena Batyan , Sergey 'Jin' Bostandzhyan Copyright (C) 2006-2010 Gena Batyan , Sergey 'Jin' Bostandzhyan , Leonhard Wimmer MediaTomb is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. MediaTomb is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with MediaTomb; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. $Id: cache_object.h 2081 2010-03-23 20:18:00Z lww $ */ /// \file cache_object.h #ifndef __CACHE_OBJECT_H__ #define __CACHE_OBJECT_H__ #include "zmmf/zmmf.h" #include "common.h" #include "cds_objects.h" class CacheObject : public zmm::Object { public: CacheObject(); void debug(); void setParentID(int parentID) { this->parentID = parentID; } int getParentID() { return parentID; } bool knowsParentID() { return parentID != INVALID_OBJECT_ID; } void setRefID(int refID) { this->refID = refID; knowRefID = true; } int getRefID() { return refID; } bool knowsRefID() { return knowRefID; } void setObject(zmm::Ref obj); zmm::Ref getObject() { return obj; } bool knowsObject() { return obj != nil; } void setNumChildren(int numChildren) { this->numChildren = numChildren; knowNumChildren = true; } int getNumChildren() { return numChildren; } bool knowsNumChildren() { return knowNumChildren; } void setObjectType(int objectType) { this->objectType = objectType; knowObjectType = true; } int getObjectType() { return objectType; } bool knowsObjectType() { return knowObjectType; } void setLocation(zmm::String location) { this->location = location; } zmm::String getLocation() { return location; } bool knowsLocation() { return location != nil; } void setVirtual(bool virtualObj) { this->virtualObj = virtualObj; knowVirtualObj = true; } bool getVirtual() { return virtualObj; } bool knowsVirtual() { return knowVirtualObj; } private: int parentID; int refID; bool knowRefID; zmm::Ref obj; bool knowNumChildren; int numChildren; int objectType; bool knowObjectType; bool virtualObj; bool knowVirtualObj; zmm::String location; }; #endif // __CACHE_OBJECT_H_ mediatomb-0.12.1/src/storage/storage_cache.cc0000664000076400007640000000772511352674776016055 00000000000000/*MT* MediaTomb - http://www.mediatomb.cc/ storage_cache.cc - this file is part of MediaTomb. Copyright (C) 2005 Gena Batyan , Sergey 'Jin' Bostandzhyan Copyright (C) 2006-2010 Gena Batyan , Sergey 'Jin' Bostandzhyan , Leonhard Wimmer MediaTomb is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. MediaTomb is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with MediaTomb; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. $Id: storage_cache.cc 2081 2010-03-23 20:18:00Z lww $ */ /// \file storage_cache.cc #ifdef HAVE_CONFIG_H #include "autoconfig.h" #endif #include "storage_cache.h" using namespace zmm; StorageCache::StorageCache() { capacity = STORAGE_CACHE_CAPACITY; maxfill = STORAGE_CACHE_MAXFILL; idHash = Ref >(new DBOHash(capacity, INVALID_OBJECT_ID, INVALID_OBJECT_ID_2)); locationHash = Ref > >(new DSOHash >(capacity)); hasBeenFlushed = false; mutex = Ref (new Mutex()); } void StorageCache::clear() { AUTOLOCK(mutex); idHash->clear(); locationHash->clear(); } Ref StorageCache::getObject(int id) { #ifdef TOMBDEBUG assert(mutex->isLocked()); #endif return idHash->get(id); } Ref StorageCache::getObjectDefinitely(int id) { #ifdef TOMBDEBUG assert(mutex->isLocked()); #endif Ref obj = idHash->get(id); if (obj == nil) { ensureFillLevelOk(); obj = Ref(new CacheObject()); idHash->put(id, obj); } return obj; } void StorageCache::addChild(int id) { #ifdef TOMBDEBUG assert(mutex->isLocked()); #endif Ref obj = idHash->get(id); if (obj != nil && obj->knowsNumChildren()) { obj->setNumChildren(obj->getNumChildren() + 1); } } bool StorageCache::removeObject(int id) { AUTOLOCK(mutex); Ref obj = getObject(id); if (obj == nil) return false; if (obj->knowsLocation()) locationHash->remove(obj->getLocation()); return idHash->remove(id); } Ref > StorageCache::getObjects(String location) { #ifdef TOMBDEBUG assert(mutex->isLocked()); #endif return locationHash->get(location); } void StorageCache::checkLocation(Ref obj) { #ifdef TOMBDEBUG assert(mutex->isLocked()); #endif if (! obj->knowsLocation()) return; String location = obj->getLocation(); Ref > objects = locationHash->get(location); if (objects == nil) { objects = Ref >(new Array()); locationHash->put(location, objects); } else { for (int i=0;isize();i++) { if (objects->get(i) == obj) return; } } objects->append(obj); } bool StorageCache::flushed() { if (! hasBeenFlushed) return false; hasBeenFlushed = false; return true; } /* private */ void StorageCache::ensureFillLevelOk() { #ifdef TOMBDEBUG assert(mutex->isLocked()); #endif // TODO - much better... // for now just clear cache if it gets too full if (idHash->size() >= maxfill || locationHash->size() >= maxfill) { hasBeenFlushed = true; idHash->clear(); locationHash->clear(); } } mediatomb-0.12.1/src/storage/cache_object.cc0000664000076400007640000000556311352674776015655 00000000000000/*MT* MediaTomb - http://www.mediatomb.cc/ cache_object.cc - this file is part of MediaTomb. Copyright (C) 2005 Gena Batyan , Sergey 'Jin' Bostandzhyan Copyright (C) 2006-2010 Gena Batyan , Sergey 'Jin' Bostandzhyan , Leonhard Wimmer MediaTomb is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. MediaTomb is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with MediaTomb; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. $Id: cache_object.cc 2081 2010-03-23 20:18:00Z lww $ */ /// \file cache_object.cc #ifdef HAVE_CONFIG_H #include "autoconfig.h" #endif #include "common.h" #include "cache_object.h" using namespace zmm; CacheObject::CacheObject() { parentID = INVALID_OBJECT_ID; refID = INVALID_OBJECT_ID; knowRefID = false; obj = nil; numChildren = 0; knowNumChildren = false; objectType = 0; knowObjectType = false; virtualObj = true; knowVirtualObj = false; } void CacheObject::setObject(Ref obj) { Ref nObj = CdsObject::createObject(obj->getObjectType()); obj->copyTo(nObj); this->obj = nObj; setParentID(nObj->getParentID()); setRefID(nObj->getRefID()); setObjectType(nObj->getObjectType()); knowVirtualObj = true; setVirtual(nObj->isVirtual()); if (IS_CDS_CONTAINER(objectType)) { location = String(nObj->isVirtual() ? LOC_VIRT_PREFIX : LOC_FILE_PREFIX) + nObj->getLocation(); } else if (IS_CDS_ITEM(objectType)) { if (IS_CDS_PURE_ITEM(objectType)) location = String(LOC_FILE_PREFIX) + nObj->getLocation(); } } void CacheObject::debug() { log_debug("== cache object ==\n"); log_debug("== knows parent ID: %d %d\n", knowsParentID(), parentID); log_debug("== knows ref ID: %d %d\n", knowsRefID(), refID); log_debug("== knows object: %d\n", knowsObject()); log_debug("== knows num children: %d %d\n", knowsNumChildren(), numChildren); log_debug("== knows object type: %d %d\n", knowsObjectType(), objectType); log_debug("== knows location: %d %s\n", knowsLocation(), (knowsLocation() ? location.c_str() : "")); log_debug("== knows virtual: %d %d\n", knowsVirtual(), virtualObj); log_debug("==================\n"); } mediatomb-0.12.1/src/cached_url.cc0000664000076400007640000000441111352675003013660 00000000000000/*MT* MediaTomb - http://www.mediatomb.cc/ cached_url.cc - this file is part of MediaTomb. Copyright (C) 2005 Gena Batyan , Sergey 'Jin' Bostandzhyan Copyright (C) 2006-2010 Gena Batyan , Sergey 'Jin' Bostandzhyan , Leonhard Wimmer MediaTomb is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. MediaTomb is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with MediaTomb; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. $Id: cached_url.cc 2081 2010-03-23 20:18:00Z lww $ */ /// \file cached_url.cc #ifdef HAVE_CONFIG_H #include "autoconfig.h" #endif #include #include "cached_url.h" #include "tools.h" using namespace zmm; CachedURL::CachedURL(int object_id, zmm::String url) { this->object_id = object_id; this->url = url; this->creation_time = time(NULL); if (this->creation_time == -1) { throw _Exception(_("Failed to get current time: ") + mt_strerror(errno)); } this->last_access_time = creation_time; mutex = Ref(new Mutex(false)); // non recursive mutex } int CachedURL::getObjectID() { return object_id; } String CachedURL::getURL() { AUTOLOCK(mutex); last_access_time = time(NULL); if (last_access_time == -1) { throw _Exception(_("Failed to get current time: ") + mt_strerror(errno)); } return url; } time_t CachedURL::getCreationTime() { return creation_time; } /// \brief Retrieves the time when the last access time of the data. time_t CachedURL::getLastAccessTime() { AUTOLOCK(mutex); return last_access_time; } mediatomb-0.12.1/src/upnp_xml.cc0000664000076400007640000003501711352675003013437 00000000000000/*MT* MediaTomb - http://www.mediatomb.cc/ upnp_xml.cc - this file is part of MediaTomb. Copyright (C) 2005 Gena Batyan , Sergey 'Jin' Bostandzhyan Copyright (C) 2006-2010 Gena Batyan , Sergey 'Jin' Bostandzhyan , Leonhard Wimmer MediaTomb is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. MediaTomb is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with MediaTomb; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. $Id: upnp_xml.cc 2081 2010-03-23 20:18:00Z lww $ */ /// \file upnp_xml.cc #ifdef HAVE_CONFIG_H #include "autoconfig.h" #endif #include "upnp_xml.h" #include "server.h" #include "cds_resource_manager.h" #include "common.h" #include "config_manager.h" #include "metadata_handler.h" using namespace zmm; using namespace mxml; Ref UpnpXML_CreateResponse(String actionName, String serviceType) { Ref response(new Element(_("u:") + actionName + "Response")); response->setAttribute(_("xmlns:u"), serviceType); return response; } Ref UpnpXML_DIDLRenderObject(Ref obj, bool renderActions, int stringLimit) { Ref result(new Element(_(""))); result->setAttribute(_("id"), String::from(obj->getID())); result->setAttribute(_("parentID"), String::from(obj->getParentID())); result->setAttribute(_("restricted"), obj->isRestricted() ? _("1") : _("0")); String tmp = obj->getTitle(); if ((stringLimit > 0) && (tmp.length() > stringLimit)) { tmp = tmp.substring(0, getValidUTF8CutPosition(tmp, stringLimit-3)); tmp = tmp + _("..."); } result->appendTextChild(_("dc:title"), tmp); result->appendTextChild(_("upnp:class"), obj->getClass()); int objectType = obj->getObjectType(); if (IS_CDS_ITEM(objectType)) { Ref item = RefCast(obj, CdsItem); Ref meta = obj->getMetadata(); Ref > elements = meta->getElements(); int len = elements->size(); String key; String upnp_class = obj->getClass(); for (int i = 0; i < len; i++) { Ref el = elements->get(i); key = el->getKey(); if (key == MetadataHandler::getMetaFieldName(M_DESCRIPTION)) { tmp = el->getValue(); if ((stringLimit > 0) && (tmp.length() > stringLimit)) { tmp = tmp.substring(0, getValidUTF8CutPosition(tmp, stringLimit-3)); tmp = tmp + _("..."); } result->appendTextChild(key, tmp); } else if (key == MetadataHandler::getMetaFieldName(M_TRACKNUMBER)) { if (upnp_class == UPNP_DEFAULT_CLASS_MUSIC_TRACK) result->appendTextChild(key, el->getValue()); } else if ((key != MetadataHandler::getMetaFieldName(M_TITLE)) || ((key == MetadataHandler::getMetaFieldName(M_TRACKNUMBER)) && (upnp_class == UPNP_DEFAULT_CLASS_MUSIC_TRACK))) result->appendTextChild(key, el->getValue()); } // log_debug("ITEM HAS FOLLOWING METADATA: %s\n", item->getMetadata()->encode().c_str()); CdsResourceManager::addResources(item, result); result->setName(_("item")); } else if (IS_CDS_CONTAINER(objectType)) { Ref cont = RefCast(obj, CdsContainer); result->setName(_("container")); int childCount = cont->getChildCount(); if (childCount >= 0) result->setAttribute(_("childCount"), String::from(childCount)); } if (renderActions && IS_CDS_ACTIVE_ITEM(objectType)) { Ref aitem = RefCast(obj, CdsActiveItem); result->appendTextChild(_("action"), aitem->getAction()); result->appendTextChild(_("state"), aitem->getState()); result->appendTextChild(_("location"), aitem->getLocation()); result->appendTextChild(_("mime-type"), aitem->getMimeType()); } // log_debug("renderen DIDL: \n%s\n", result->print().c_str()); return result; } void UpnpXML_DIDLUpdateObject(Ref obj, String text) { Ref parser(new Parser()); Ref root = parser->parseString(text)->getRoot(); int objectType = obj->getObjectType(); if (IS_CDS_ACTIVE_ITEM(objectType)) { Ref aitem = RefCast(obj, CdsActiveItem); String title = root->getChildText(_("dc:title")); if (title != nil && title != "") aitem->setTitle(title); /// \todo description should be taken from the dictionary String description = root->getChildText(_("dc:description")); if (description == nil) description = _(""); aitem->setMetadata(MetadataHandler::getMetaFieldName(M_DESCRIPTION), description); String location = root->getChildText(_("location")); if (location != nil && location != "") aitem->setLocation(location); String mimeType = root->getChildText(_("mime-type")); if (mimeType != nil && mimeType != "") aitem->setMimeType(mimeType); String action = root->getChildText(_("action")); if (action != nil && action != "") aitem->setAction(action); String state = root->getChildText(_("state")); if (state == nil) state = _(""); aitem->setState(state); } } Ref UpnpXML_CreateEventPropertySet() { Ref propset(new Element(_("e:propertyset"))); propset->setAttribute(_("xmlns:e"), _("urn:schemas-upnp-org:event-1-0")); Ref property(new Element(_("e:property"))); propset->appendElementChild(property); return propset; } Ref UpnpXML_RenderDeviceDescription(String presentationURL) { log_debug("start\n"); Ref config = ConfigManager::getInstance(); Ref root(new Element(_("root"))); root->setAttribute(_("xmlns"), _(DESC_DEVICE_NAMESPACE)); Ref specVersion(new Element(_("specVersion"))); specVersion->appendTextChild(_("major"), _(DESC_SPEC_VERSION_MAJOR)); specVersion->appendTextChild(_("minor"), _(DESC_SPEC_VERSION_MINOR)); root->appendElementChild(specVersion); Ref device(new Element(_("device"))); #ifdef EXTEND_PROTOCOLINFO if (config->getBoolOption(CFG_SERVER_EXTEND_PROTOCOLINFO)) { //we do not do DLNA yet but this is needed for bravia tv (v5500) Ref DLNADOC(new Element(_("dlna:X_DLNADOC"))); DLNADOC->setText(_("DMS-1.50")); // DLNADOC->setText(_("M-DMS-1.50")); DLNADOC->setAttribute(_("xmlns:dlna"), _("urn:schemas-dlna-org:device-1-0")); device->appendElementChild(DLNADOC); } #endif device->appendTextChild(_("deviceType"), _(DESC_DEVICE_TYPE)); if (!string_ok(presentationURL)) device->appendTextChild(_("presentationURL"), _("/")); else device->appendTextChild(_("presentationURL"), presentationURL); device->appendTextChild(_("friendlyName"), config->getOption(CFG_SERVER_NAME)); device->appendTextChild(_("manufacturer"), _(DESC_MANUFACTURER)); device->appendTextChild(_("manufacturerURL"), config->getOption(CFG_SERVER_MANUFACTURER_URL)); device->appendTextChild(_("modelDescription"), config->getOption(CFG_SERVER_MODEL_DESCRIPTION)); device->appendTextChild(_("modelName"), config->getOption(CFG_SERVER_MODEL_NAME)); device->appendTextChild(_("modelNumber"), config->getOption(CFG_SERVER_MODEL_NUMBER)); device->appendTextChild(_("serialNumber"), config->getOption(CFG_SERVER_SERIAL_NUMBER)); device->appendTextChild(_("UDN"), config->getOption(CFG_SERVER_UDN)); Ref iconList(new Element(_("iconList"))); Ref icon120_png(new Element(_("icon"))); icon120_png->appendTextChild(_("mimetype"), _(DESC_ICON_PNG_MIMETYPE)); icon120_png->appendTextChild(_("width"), _("120")); icon120_png->appendTextChild(_("height"), _("120")); icon120_png->appendTextChild(_("depth"), _("24")); icon120_png->appendTextChild(_("url"), _(DESC_ICON120_PNG)); iconList->appendElementChild(icon120_png); Ref icon120_bmp(new Element(_("icon"))); icon120_bmp->appendTextChild(_("mimetype"), _(DESC_ICON_BMP_MIMETYPE)); icon120_bmp->appendTextChild(_("width"), _("120")); icon120_bmp->appendTextChild(_("height"), _("120")); icon120_bmp->appendTextChild(_("depth"), _("24")); icon120_bmp->appendTextChild(_("url"), _(DESC_ICON120_BMP)); iconList->appendElementChild(icon120_bmp); Ref icon120_jpg(new Element(_("icon"))); icon120_jpg->appendTextChild(_("mimetype"), _(DESC_ICON_JPG_MIMETYPE)); icon120_jpg->appendTextChild(_("width"), _("120")); icon120_jpg->appendTextChild(_("height"), _("120")); icon120_jpg->appendTextChild(_("depth"), _("24")); icon120_jpg->appendTextChild(_("url"), _(DESC_ICON120_JPG)); iconList->appendElementChild(icon120_jpg); Ref icon48_png(new Element(_("icon"))); icon48_png->appendTextChild(_("mimetype"), _(DESC_ICON_PNG_MIMETYPE)); icon48_png->appendTextChild(_("width"), _("48")); icon48_png->appendTextChild(_("height"), _("48")); icon48_png->appendTextChild(_("depth"), _("24")); icon48_png->appendTextChild(_("url"), _(DESC_ICON48_PNG)); iconList->appendElementChild(icon48_png); Ref icon48_bmp(new Element(_("icon"))); icon48_bmp->appendTextChild(_("mimetype"), _(DESC_ICON_BMP_MIMETYPE)); icon48_bmp->appendTextChild(_("width"), _("48")); icon48_bmp->appendTextChild(_("height"), _("48")); icon48_bmp->appendTextChild(_("depth"), _("24")); icon48_bmp->appendTextChild(_("url"), _(DESC_ICON48_BMP)); iconList->appendElementChild(icon48_bmp); Ref icon48_jpg(new Element(_("icon"))); icon48_jpg->appendTextChild(_("mimetype"), _(DESC_ICON_JPG_MIMETYPE)); icon48_jpg->appendTextChild(_("width"), _("48")); icon48_jpg->appendTextChild(_("height"), _("48")); icon48_jpg->appendTextChild(_("depth"), _("24")); icon48_jpg->appendTextChild(_("url"), _(DESC_ICON48_JPG)); iconList->appendElementChild(icon48_jpg); Ref icon32_png(new Element(_("icon"))); icon32_png->appendTextChild(_("mimetype"), _(DESC_ICON_PNG_MIMETYPE)); icon32_png->appendTextChild(_("width"), _("32")); icon32_png->appendTextChild(_("height"), _("32")); icon32_png->appendTextChild(_("depth"), _("8")); icon32_png->appendTextChild(_("url"), _(DESC_ICON32_PNG)); iconList->appendElementChild(icon32_png); Ref icon32_bmp(new Element(_("icon"))); icon32_bmp->appendTextChild(_("mimetype"), _(DESC_ICON_BMP_MIMETYPE)); icon32_bmp->appendTextChild(_("width"), _("32")); icon32_bmp->appendTextChild(_("height"), _("32")); icon32_bmp->appendTextChild(_("depth"), _("8")); icon32_bmp->appendTextChild(_("url"), _(DESC_ICON32_BMP)); iconList->appendElementChild(icon32_bmp); Ref icon32_jpg(new Element(_("icon"))); icon32_jpg->appendTextChild(_("mimetype"), _(DESC_ICON_JPG_MIMETYPE)); icon32_jpg->appendTextChild(_("width"), _("32")); icon32_jpg->appendTextChild(_("height"), _("32")); icon32_jpg->appendTextChild(_("depth"), _("8")); icon32_jpg->appendTextChild(_("url"), _(DESC_ICON32_JPG)); iconList->appendElementChild(icon32_jpg); device->appendElementChild(iconList); Ref serviceList(new Element(_("serviceList"))); Ref serviceCM(new Element(_("service"))); serviceCM->appendTextChild(_("serviceType"), _(DESC_CM_SERVICE_TYPE)); serviceCM->appendTextChild(_("serviceId"), _(DESC_CM_SERVICE_ID)); serviceCM->appendTextChild(_("SCPDURL"), _(DESC_CM_SCPD_URL)); serviceCM->appendTextChild(_("controlURL"), _(DESC_CM_CONTROL_URL)); serviceCM->appendTextChild(_("eventSubURL"), _(DESC_CM_EVENT_URL)); serviceList->appendElementChild(serviceCM); Ref serviceCDS(new Element(_("service"))); serviceCDS->appendTextChild(_("serviceType"), _(DESC_CDS_SERVICE_TYPE)); serviceCDS->appendTextChild(_("serviceId"), _(DESC_CDS_SERVICE_ID)); serviceCDS->appendTextChild(_("SCPDURL"), _(DESC_CDS_SCPD_URL)); serviceCDS->appendTextChild(_("controlURL"), _(DESC_CDS_CONTROL_URL)); serviceCDS->appendTextChild(_("eventSubURL"), _(DESC_CDS_EVENT_URL)); serviceList->appendElementChild(serviceCDS); #if defined(ENABLE_MRREG) // media receiver registrar service for the Xbox 360 Ref serviceMRREG(new Element(_("service"))); serviceMRREG->appendTextChild(_("serviceType"), _(DESC_MRREG_SERVICE_TYPE)); serviceMRREG->appendTextChild(_("serviceId"), _(DESC_MRREG_SERVICE_ID)); serviceMRREG->appendTextChild(_("SCPDURL"), _(DESC_MRREG_SCPD_URL)); serviceMRREG->appendTextChild(_("controlURL"), _(DESC_MRREG_CONTROL_URL)); serviceMRREG->appendTextChild(_("eventSubURL"), _(DESC_MRREG_EVENT_URL)); serviceList->appendElementChild(serviceMRREG); #endif device->appendElementChild(serviceList); root->appendElementChild(device); return root; } Ref UpnpXML_DIDLRenderResource(String URL, Ref attributes) { Ref res(new Element(_("res"))); res->setText(URL); Ref > elements = attributes->getElements(); int len = elements->size(); String attribute; for (int i = 0; i < len; i++) { Ref el = elements->get(i); attribute = el->getKey(); res->setAttribute(attribute, el->getValue()); } return res; } mediatomb-0.12.1/src/update_manager.cc0000664000076400007640000002251011352675003014543 00000000000000/*MT* MediaTomb - http://www.mediatomb.cc/ update_manager.cc - this file is part of MediaTomb. Copyright (C) 2005 Gena Batyan , Sergey 'Jin' Bostandzhyan Copyright (C) 2006-2010 Gena Batyan , Sergey 'Jin' Bostandzhyan , Leonhard Wimmer MediaTomb is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. MediaTomb is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with MediaTomb; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. $Id: update_manager.cc 2081 2010-03-23 20:18:00Z lww $ */ /// \file update_manager.cc #ifdef HAVE_CONFIG_H #include "autoconfig.h" #endif #include "update_manager.h" #include "upnp_cds.h" #include "storage.h" #include "tools.h" #include #include /* following constants in milliseconds */ #define SPEC_INTERVAL 2000 #define MIN_SLEEP 1 #define MAX_OBJECT_IDS 1000 #define MAX_OBJECT_IDS_OVERLOAD 30 #define OBJECT_ID_HASH_CAPACITY 3109 using namespace zmm; SINGLETON_MUTEX(UpdateManager, false); UpdateManager::UpdateManager() : Singleton() { objectIDHash = Ref >(new DBRHash(OBJECT_ID_HASH_CAPACITY, MAX_OBJECT_IDS + 2 * MAX_OBJECT_IDS_OVERLOAD, INVALID_OBJECT_ID, INVALID_OBJECT_ID_2)); shutdownFlag = false; flushPolicy = FLUSH_SPEC; lastContainerChanged = INVALID_OBJECT_ID; cond = Ref(new Cond(mutex)); } void UpdateManager::init() { /* pthread_attr_t attr; pthread_attr_init(&attr); pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED); */ pthread_create( &updateThread, NULL, // &attr, // attr UpdateManager::staticThreadProc, this ); //cond->wait(); //pthread_attr_destroy(&attr); } void UpdateManager::shutdown() { log_debug("start\n"); AUTOLOCK(mutex); shutdownFlag = true; log_debug("signalling...\n"); cond->signal(); AUTOUNLOCK(); log_debug("waiting for thread\n"); if (updateThread) pthread_join(updateThread, NULL); updateThread = 0; log_debug("end\n"); } void UpdateManager::containersChanged(Ref objectIDs, int flushPolicy) { if (objectIDs == nil) return; AUTOLOCK(mutex); // signalling thread if it could have been idle, because // there were no unprocessed updates bool signal = (! haveUpdates()); // signalling if the flushPolicy changes, so the thread recalculates // the sleep time if (flushPolicy > this->flushPolicy) { this->flushPolicy = flushPolicy; signal = true; } int size = objectIDs->size(); int hashSize = objectIDHash->size(); bool split = (hashSize + size >= MAX_OBJECT_IDS + MAX_OBJECT_IDS_OVERLOAD); for (int i = 0; i < size; i++) { int objectID = objectIDs->get(i); if (objectID != lastContainerChanged) { //log_debug("containerChanged. id: %d, signal: %d\n", objectID, signal); objectIDHash->put(objectID); if (split && objectIDHash->size() > MAX_OBJECT_IDS) { while(objectIDHash->size() > MAX_OBJECT_IDS) { log_debug("in-between signalling...\n"); cond->signal(); AUTOUNLOCK(); AUTORELOCK(); } } } } if (objectIDHash->size() >= MAX_OBJECT_IDS) signal = true; if (signal) { log_debug("signalling...\n"); cond->signal(); } } void UpdateManager::containerChanged(int objectID, int flushPolicy) { if (objectID == INVALID_OBJECT_ID) return; AUTOLOCK(mutex); if (objectID != lastContainerChanged || flushPolicy > this->flushPolicy) { // signalling thread if it could have been idle, because // there were no unprocessed updates bool signal = (! haveUpdates()); log_debug("containerChanged. id: %d, signal: %d\n", objectID, signal); objectIDHash->put(objectID); // signalling if the hash gets too full if (objectIDHash->size() >= MAX_OBJECT_IDS) signal = true; // very simple caching, but it get's a lot of hits lastContainerChanged = objectID; // signalling if the flushPolicy changes, so the thread recalculates // the sleep time if (flushPolicy > this->flushPolicy) { this->flushPolicy = flushPolicy; signal = true; } if (signal) { log_debug("signalling...\n"); cond->signal(); } } else { log_debug("last container changed!\n"); } } /* private stuff */ void UpdateManager::threadProc() { struct timespec lastUpdate; getTimespecNow(&lastUpdate); AUTOLOCK(mutex); //cond->signal(); while (! shutdownFlag) { if (haveUpdates()) { long sleepMillis = 0; struct timespec now; getTimespecNow(&now); long timeDiff = getDeltaMillis(&lastUpdate, &now); switch (flushPolicy) { case FLUSH_SPEC: sleepMillis = SPEC_INTERVAL - timeDiff; break; case FLUSH_ASAP: sleepMillis = 0; break; } bool sendUpdates = true; if (sleepMillis >= MIN_SLEEP && objectIDHash->size() < MAX_OBJECT_IDS) { struct timespec timeout; getTimespecAfterMillis(sleepMillis, &timeout, &now); log_debug("threadProc: sleeping for %ld millis\n", sleepMillis); int ret = cond->timedwait(&timeout); if (! shutdownFlag) { if (ret != 0 && ret != ETIMEDOUT) { log_error("Fatal error: pthread_cond_timedwait returned errorcode %d\n", ret); log_error("Forcing MediaTomb shutdown.\n"); print_backtrace(); kill(0, SIGINT); } if (ret == ETIMEDOUT) sendUpdates = false; } else sendUpdates = false; } if (sendUpdates) { log_debug("sending updates...\n"); lastContainerChanged = INVALID_OBJECT_ID; flushPolicy = FLUSH_SPEC; String updateString; try { hash_data_array_t hash_data_array; // hash_data_array points to the array inside objectIDHash, so // we may only call clear() after we don't need the array anymore objectIDHash->getAll(&hash_data_array); updateString = Storage::getInstance()->incrementUpdateIDs(hash_data_array.data,hash_data_array.size); objectIDHash->clear(); // hash_data_array will be invalid after clear() } catch (Exception e) { e.printStackTrace(); log_error("Fatal error when sending updates: %s\n", e.getMessage().c_str()); log_error("Forcing MediaTomb shutdown.\n"); kill(0, SIGINT); } AUTOUNLOCK(); // we don't need to hold the lock during the sending of the updates if (string_ok(updateString)) { try { ContentDirectoryService::getInstance()->subscription_update(updateString); log_debug("updates sent.\n"); getTimespecNow(&lastUpdate); } catch (Exception e) { log_error("Fatal error when sending updates: %s\n", e.getMessage().c_str()); log_error("Forcing MediaTomb shutdown.\n"); kill(0, SIGINT); } } else { log_debug("NOT sending updates (string empty or invalid).\n"); } AUTORELOCK(); } } else { //nothing to do cond->wait(); } } } void *UpdateManager::staticThreadProc(void *arg) { log_debug("starting update thread... thread: %d\n", pthread_self()); UpdateManager *inst = (UpdateManager *)arg; inst->threadProc(); Storage::getInstance()->threadCleanup(); log_debug("update thread shut down. thread: %d\n", pthread_self()); pthread_exit(NULL); return NULL; } mediatomb-0.12.1/src/mem_io_handler.h0000664000076400007640000000410011352675003014366 00000000000000/*MT* MediaTomb - http://www.mediatomb.cc/ mem_io_handler.h - this file is part of MediaTomb. Copyright (C) 2005 Gena Batyan , Sergey 'Jin' Bostandzhyan Copyright (C) 2006-2010 Gena Batyan , Sergey 'Jin' Bostandzhyan , Leonhard Wimmer MediaTomb is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. MediaTomb is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with MediaTomb; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. $Id: mem_io_handler.h 2081 2010-03-23 20:18:00Z lww $ */ /// \file mem_io_handler.h /// \brief definition of the MemIOHandler class. #ifndef __MEM_IO_HANDLER_H__ #define __MEM_IO_HANDLER_H__ #include "common.h" #include "io_handler.h" /// \brief Allows the web server to read from a memory buffer instead of a file. class MemIOHandler : public IOHandler { protected: /// \brief buffer that is holding our data. char *buffer; off_t length; /// \brief current offset in the buffer off_t pos; public: /// \brief Initializes the internal buffer. /// \param buffer all operations will be done on this buffer. MemIOHandler(void *buffer, int length); MemIOHandler(zmm::String str); virtual ~MemIOHandler(); /// virtual void open(IN enum UpnpOpenFileMode mode); virtual int read(OUT char *buf, IN size_t length); virtual void seek(IN off_t offset, IN int whence); }; #endif // __MEM_IO_HANDLER_H__ mediatomb-0.12.1/src/atrailers_content_handler.h0000664000076400007640000000502411352675003016647 00000000000000/*MT* MediaTomb - http://www.mediatomb.cc/ atrailers_content_handler.h - this file is part of MediaTomb. Copyright (C) 2005 Gena Batyan , Sergey 'Jin' Bostandzhyan Copyright (C) 2006-2010 Gena Batyan , Sergey 'Jin' Bostandzhyan , Leonhard Wimmer MediaTomb is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. MediaTomb is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with MediaTomb; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. $Id: atrailers_content_handler.h 2081 2010-03-23 20:18:00Z lww $ */ /// \file atrailers_content_handler.h /// \brief Definitions of the ATrailersContentHandler class. #ifdef ATRAILERS #ifndef __ATRAILERS_CONTENT_HANDLER_H__ #define __ATRAILERS_CONTENT_HANDLER_H__ #define ATRAILERS_SERVICE "Apple Trailers" #define ATRAILERS_SERVICE_ID "T" #define ATRAILERS_AUXDATA_POST_DATE ATRAILERS_SERVICE_ID "0" #include "zmmf/zmmf.h" #include "mxml/mxml.h" #include "cds_objects.h" /// \brief this class is responsible for creating objects from the ATrailers /// metadata XML. class ATrailersContentHandler : public zmm::Object { public: /// \brief Sets the service XML from which we will extract the objects. /// \return false if service XML contained an error status. bool setServiceContent(zmm::Ref service); /// \brief retrieves an object from the service. /// /// Each invokation of this funtion will return a new object, /// when the whole service XML is parsed and no more objects are left, /// this function will return nil. /// /// \return CdsObject or nil if there are no more objects to parse. zmm::Ref getNextObject(); protected: zmm::Ref service_xml; int current_trailer_index; int trailer_count; zmm::String trailer_mimetype; }; #endif//__ATRAILERS_CONTENT_HANDLER_H__ #endif//ATRAILERS mediatomb-0.12.1/src/autoscan_inotify.h0000664000076400007640000001636411352675003015021 00000000000000/*MT* MediaTomb - http://www.mediatomb.cc/ autoscan_inotify.h - this file is part of MediaTomb. Copyright (C) 2005 Gena Batyan , Sergey 'Jin' Bostandzhyan Copyright (C) 2006-2010 Gena Batyan , Sergey 'Jin' Bostandzhyan , Leonhard Wimmer MediaTomb is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. MediaTomb is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with MediaTomb; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. $Id: autoscan_inotify.h 2081 2010-03-23 20:18:00Z lww $ */ /// \file autoscan_inotify.h #ifndef __AUTOSCAN_INOTIFY_H__ #define __AUTOSCAN_INOTIFY_H__ #include "zmmf/zmmf.h" #include "sync.h" #include "hash.h" #include "autoscan.h" #include "mt_inotify.h" #define INOTIFY_ROOT -1 #define INOTIFY_UNKNOWN_PARENT_WD -2 enum inotify_watch_type_t { InotifyWatchTypeNonexisting, InotifyWatchTypeAutoscan }; class AutoscanInotify : public zmm::Object { public: AutoscanInotify(); virtual ~AutoscanInotify(); void init(); /// \brief shutdown the inotify thread /// /// warning: currently doesn't remove all the remaining inotify watches! void shutdown(); /// \brief Start monitoring a directory void monitor(zmm::Ref dir); /// \brief Stop monitoring a directory void unmonitor(zmm::Ref dir); private: static void *staticThreadProc(void *arg); void threadProc(); pthread_t thread; zmm::Ref inotify; zmm::Ref cond; zmm::Ref mutex; zmm::Ref > monitorQueue; zmm::Ref > unmonitorQueue; // event mask with events to watch for (set by constructor); int events; enum watch_type_t { WatchAutoscanType, WatchMoveType }; class Watch : public zmm::Object { public: Watch(watch_type_t type) { this->type = type; } watch_type_t getType() { return type; } private: watch_type_t type; }; class WatchAutoscan : public Watch { public: WatchAutoscan(bool startPoint, zmm::Ref adir, zmm::String normalizedAutoscanPath) : Watch(WatchAutoscanType) { setAutoscanDirectory(adir); setNormalizedAutoscanPath(normalizedAutoscanPath); setNonexistingPathArray(nil); this->startPoint = startPoint; this->descendants = nil; } zmm::Ref getAutoscanDirectory() { return adir; } void setAutoscanDirectory(zmm::Ref adir) { this->adir = adir; } zmm::String getNormalizedAutoscanPath() { return normalizedAutoscanPath; } void setNormalizedAutoscanPath(zmm::String normalizedAutoscanPath) { this->normalizedAutoscanPath = normalizedAutoscanPath; } bool isStartPoint() { return startPoint; } zmm::Ref > getNonexistingPathArray() { return nonexistingPathArray; } void setNonexistingPathArray(zmm::Ref > nonexistingPathArray) { this->nonexistingPathArray = nonexistingPathArray; } void addDescendant(int wd) { if (descendants == nil) descendants = zmm::Ref(new zmm::IntArray()); descendants->append(wd); } zmm::Ref getDescendants() { return descendants; } private: zmm::Ref adir; bool startPoint; zmm::Ref descendants; zmm::String normalizedAutoscanPath; zmm::Ref > nonexistingPathArray; }; class WatchMove : public Watch { public: WatchMove(int removeWd) : Watch(WatchMoveType) { this->removeWd = removeWd; } int getRemoveWd() { return removeWd; } private: int removeWd; }; class Wd : public zmm::Object { public: Wd(zmm::String path, int wd, int parentWd) { wdWatches = zmm::Ref >(new zmm::Array(1)); this->path = path; this->wd = wd; this->parentWd = parentWd; } zmm::String getPath() { return path; } int getWd() { return wd; } int getParentWd() { return parentWd; } void setParentWd(int parentWd) { this->parentWd = parentWd; } zmm::Ref > getWdWatches() { return wdWatches; } private: zmm::Ref > wdWatches; zmm::String path; int parentWd; int wd; }; zmm::Ref > watches; zmm::String normalizePathNoEx(zmm::String path); void monitorUnmonitorRecursive(zmm::String startPath, bool unmonitor, zmm::Ref adir, zmm::String normalizedAutoscanPath, bool startPoint); int monitorDirectory(zmm::String path, zmm::Ref adir, zmm::String normalizedAutoscanPath, bool startPoint, zmm::Ref > pathArray = nil); void unmonitorDirectory(zmm::String path, zmm::Ref adir); zmm::Ref getAppropriateAutoscan(zmm::Ref wdObj, zmm::Ref adir); zmm::Ref getAppropriateAutoscan(zmm::Ref wdObj, zmm::String path); zmm::Ref getStartPoint(zmm::Ref wdObj); bool removeFromWdObj(zmm::Ref wdObj, zmm::Ref toRemove); bool removeFromWdObj(zmm::Ref wdObj, zmm::Ref toRemove); bool removeFromWdObj(zmm::Ref wdObj, zmm::Ref toRemove); void monitorNonexisting(zmm::String path, zmm::Ref adir, zmm::String normalizedAutoscanPath); void recheckNonexistingMonitor(int curWd, zmm::Ref > nonexistingPathArray, zmm::Ref adir, zmm::String normalizedAutoscanPath); void recheckNonexistingMonitors(int wd, zmm::Ref wdObj); void removeNonexistingMonitor(int wd, zmm::Ref wdObj, zmm::Ref > pathAr); int watchPathForMoves(zmm::String path, int wd); int addMoveWatch(zmm::String path, int removeWd, int parentWd); void checkMoveWatches(int wd, zmm::Ref wdObj); void removeWatchMoves(int wd); void addDescendant(int startPointWd, int addWd, zmm::Ref adir); void removeDescendants(int wd); /// \brief is set to true by shutdown() if the inotify thread should terminate bool shutdownFlag; }; #endif // __AUTOSCAN_INOTIFY_H__ mediatomb-0.12.1/src/dvdnav_read.cc0000664000076400007640000003432311352675003014051 00000000000000/*MT* MediaTomb - http://www.mediatomb.cc/ dvdnav_read.cc - this file is part of MediaTomb. Copyright (C) 2005 Gena Batyan , Sergey 'Jin' Bostandzhyan Copyright (C) 2006-2010 Gena Batyan , Sergey 'Jin' Bostandzhyan , Leonhard Wimmer MediaTomb is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. MediaTomb is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with MediaTomb; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. $Id: dvdnav_read.cc 2081 2010-03-23 20:18:00Z lww $ */ /* Significant amounts of code were derived from the menus.c example program which is part of libdvdnav. menus.c is (C) 2003 by the libdvdnav project under GPLv2 or later. The dvdtime2msec() function as well as some other parts which are marked by comments were taken from lsdvd, (C) 2003 by Chris Phillips, Henk Vergonet, licensed under GPL version 2. */ /// \file dvdnav_read.cc #ifdef HAVE_CONFIG_H #include "autoconfig.h" #endif #ifdef HAVE_LIBDVDNAV #include "dvdnav_read.h" #include #include "tools.h" using namespace zmm; static double frames_per_s[4] = {-1.0, 25.00, -1.0, 29.97}; static struct { char code[3]; char name[20]; } // from lsdvd, ISO-639 language[] = { { " ", "Not Specified" }, { "aa", "Afar" }, { "ab", "Abkhazian" }, { "af", "Afrikaans" }, { "am", "Amharic" }, { "ar", "Arabic" }, { "as", "Assamese" }, { "ay", "Aymara" }, { "az", "Azerbaijani" }, { "ba", "Bashkir" }, { "be", "Byelorussian" }, { "bg", "Bulgarian" }, { "bh", "Bihari" }, { "bi", "Bislama" }, { "bn", "Bengali; Bangla" }, { "bo", "Tibetan" }, { "br", "Breton" }, { "ca", "Catalan" }, { "co", "Corsican" }, { "cs", "Czech" }, { "cy", "Welsh" }, { "da", "Dansk" }, { "de", "Deutsch" }, { "dz", "Bhutani" }, { "el", "Greek" }, { "en", "English" }, { "eo", "Esperanto" }, { "es", "Espanol" }, { "et", "Estonian" }, { "eu", "Basque" }, { "fa", "Persian" }, { "fi", "Suomi" }, { "fj", "Fiji" }, { "fo", "Faroese" }, { "fr", "Francais" }, { "fy", "Frisian" }, { "ga", "Gaelic" }, { "gd", "Scots Gaelic" }, { "gl", "Galician" }, { "gn", "Guarani" }, { "gu", "Gujarati" }, { "ha", "Hausa" }, { "he", "Hebrew" }, { "hi", "Hindi" }, { "hr", "Hrvatski" }, { "hu", "Magyar" }, { "hy", "Armenian" }, { "ia", "Interlingua" }, { "id", "Indonesian" }, { "ie", "Interlingue" }, { "ik", "Inupiak" }, { "in", "Indonesian" }, { "is", "Islenska" }, { "it", "Italiano" }, { "iu", "Inuktitut" }, { "iw", "Hebrew" }, { "ja", "Japanese" }, { "ji", "Yiddish" }, { "jw", "Javanese" }, { "ka", "Georgian" }, { "kk", "Kazakh" }, { "kl", "Greenlandic" }, { "km", "Cambodian" }, { "kn", "Kannada" }, { "ko", "Korean" }, { "ks", "Kashmiri" }, { "ku", "Kurdish" }, { "ky", "Kirghiz" }, { "la", "Latin" }, { "ln", "Lingala" }, { "lo", "Laothian" }, { "lt", "Lithuanian" }, { "lv", "Latvian, Lettish" }, { "mg", "Malagasy" }, { "mi", "Maori" }, { "mk", "Macedonian" }, { "ml", "Malayalam" }, { "mn", "Mongolian" }, { "mo", "Moldavian" }, { "mr", "Marathi" }, { "ms", "Malay" }, { "mt", "Maltese" }, { "my", "Burmese" }, { "na", "Nauru" }, { "ne", "Nepali" }, { "nl", "Nederlands" }, { "no", "Norsk" }, { "oc", "Occitan" }, { "om", "Oromo" }, { "or", "Oriya" }, { "pa", "Punjabi" }, { "pl", "Polish" }, { "ps", "Pashto, Pushto" }, { "pt", "Portugues" }, { "qu", "Quechua" }, { "rm", "Rhaeto-Romance" }, { "rn", "Kirundi" }, { "ro", "Romanian" }, { "ru", "Russian" }, { "rw", "Kinyarwanda" }, { "sa", "Sanskrit" }, { "sd", "Sindhi" }, { "sg", "Sangho" }, { "sh", "Serbo-Croatian" }, { "si", "Sinhalese" }, { "sk", "Slovak" }, { "sl", "Slovenian" }, { "sm", "Samoan" }, { "sn", "Shona" }, { "so", "Somali" }, { "sq", "Albanian" }, { "sr", "Serbian" }, { "ss", "Siswati" }, { "st", "Sesotho" }, { "su", "Sundanese" }, { "sv", "Svenska" }, { "sw", "Swahili" }, { "ta", "Tamil" }, { "te", "Telugu" }, { "tg", "Tajik" }, { "th", "Thai" }, { "ti", "Tigrinya" }, { "tk", "Turkmen" }, { "tl", "Tagalog" }, { "tn", "Setswana" }, { "to", "Tonga" }, { "tr", "Turkish" }, { "ts", "Tsonga" }, { "tt", "Tatar" }, { "tw", "Twi" }, { "ug", "Uighur" }, { "uk", "Ukrainian" }, { "ur", "Urdu" }, { "uz", "Uzbek" }, { "vi", "Vietnamese" }, { "vo", "Volapuk" }, { "wo", "Wolof" }, { "xh", "Xhosa" }, { "yi", "Yiddish" }, { "yo", "Yoruba" }, { "za", "Zhuang" }, { "zh", "Chinese" }, { "zu", "Zulu" }, { "xx", "Unknown" }, { "\0", "Unknown" } }; static const char *audio_format[7] = {"ac3", "?", "mpeg1", "mpeg2", "lpcm ", "sdds ", "dts"}; static int audio_id[7] = {0x80, 0, 0xC0, 0xC0, 0xA0, 0, 0x88}; DVDNavReader::DVDNavReader(String path) { /* * Threads: this function uses chdir() and getcwd(). * The current working directory is global to all threads, * so using chdir/getcwd in another thread could give unexpected results. */ /// \todo check the implications of the above comment, do we use chdir() /// somewhere? if (dvdnav_open(&dvd, path.c_str()) != DVDNAV_STATUS_OK) { throw _Exception(_("Could not open DVD ") + path); } dvd_path = path; // set the PGC positioning flag to have position information relatively to // the whole feature instead of just relatively to the current chapter if (dvdnav_set_PGC_positioning_flag(dvd, 1) != DVDNAV_STATUS_OK) { throw _Exception(_("Failed to set PGC positioning flag on DVD ") + path); } log_debug("Opened DVD %s\n", dvd_path.c_str()); mutex = Ref(new Mutex(true)); EOT = true; } DVDNavReader::~DVDNavReader() { if (dvd) dvdnav_close(dvd); log_debug("Closing DVD %s\n", dvd_path.c_str()); } int DVDNavReader::titleCount() { int32_t t; if (dvdnav_get_number_of_titles(dvd, &t) != DVDNAV_STATUS_OK) throw _Exception(_("Failed to get title count for DVD ") + dvd_path + " : " + dvdnav_err_to_string(dvd)); return t; } int DVDNavReader::chapterCount(int title_idx) { int32_t c; title_idx++; if ((title_idx < 1) || (title_idx > titleCount())) throw _Exception(_("Requested title number exceeds available titles " "for DVD ") + dvd_path); if (dvdnav_get_number_of_parts(dvd, title_idx, &c) != DVDNAV_STATUS_OK) throw _Exception(_("Failed to get chapter count for title ") + title_idx + " DVD " + dvd_path); return c; } void DVDNavReader::selectPGC(int title_idx, int chapter_idx) { title_idx++; chapter_idx++; if ((title_idx < 1) || (title_idx > titleCount())) throw _Exception(_("Attmpted to select invalid title!")); if ((chapter_idx < 1) || (chapter_idx > chapterCount(title_idx-1))) throw _Exception(_("Attempted to select invalid chapter!")); AUTOLOCK(mutex); if (dvdnav_part_play(dvd, title_idx, chapter_idx) != DVDNAV_STATUS_OK) { throw _Exception(_("Failed to select PGC for DVD ") + dvd_path + " : " + dvdnav_err_to_string(dvd)); } EOT = false; } size_t DVDNavReader::readSector(unsigned char *buffer, size_t length) { AUTOLOCK(mutex); unsigned char *p = buffer; size_t consumed = 0; if (length < DVD_VIDEO_LB_LEN) throw _Exception(_("Buffer must be at least ") + DVD_VIDEO_LB_LEN); while (!EOT) { int result, event, len; result = dvdnav_get_next_block(dvd, (uint8_t *)p, &event, &len); if (result == DVDNAV_STATUS_ERR) { throw _Exception(_("Error getting next block for DVD ") + dvd_path + " : " + dvdnav_err_to_string(dvd)); } switch (event) { case DVDNAV_BLOCK_OK: consumed = consumed + len; if ((consumed + DVD_VIDEO_LB_LEN) > length) return consumed; p = p + len; break; case DVDNAV_STILL_FRAME: { dvdnav_still_event_t *still_event; still_event = (dvdnav_still_event_t *)p; if (still_event->length == 0xff) dvdnav_still_skip(dvd); } break; case DVDNAV_WAIT: dvdnav_wait_skip(dvd); break; case DVDNAV_CELL_CHANGE: { int32_t tt = 0, ptt = 0; dvdnav_current_title_info(dvd, &tt, &ptt); if (tt == 0) { log_warning("Reached DVD menu, aborting.\n"); EOT = true; return consumed; } } break; case DVDNAV_STOP: EOT = true; return consumed; break; case DVDNAV_NAV_PACKET: case DVDNAV_NOP: case DVDNAV_SPU_CLUT_CHANGE: case DVDNAV_SPU_STREAM_CHANGE: case DVDNAV_AUDIO_STREAM_CHANGE: case DVDNAV_HIGHLIGHT: case DVDNAV_VTS_CHANGE: case DVDNAV_HOP_CHANNEL: break; default: log_error("Uknown event when playing DVD %s\n", dvd_path.c_str()); EOT = true; return -1; break; } } return 0; } int DVDNavReader::audioTrackCount() { AUTOLOCK(mutex); uint8_t count = 0; while (true) { if(dvdnav_get_audio_logical_stream(dvd, count) < 0) break; // afaik only 8 streams are supported? // \todo check the exact amount of supported audio streams in the DVD if (count > 10) break; count++; } return (int)count; } // from lsdvd String DVDNavReader::getLanguage(char *code) { int k = 0; while (memcmp(language[k].code, code, 2) && language[k].name[0] ) { k++; } return _(language[k].name); } String DVDNavReader::audioLanguage(int stream_idx) { char code[3]; audio_attr_t audio_attr; AUTOLOCK(mutex); if (dvdnav_get_audio_attr(dvd, stream_idx, &audio_attr) != DVDNAV_STATUS_OK) throw _Exception(_("Error error retrieving audio language from DVD ") + dvd_path + " : " + dvdnav_err_to_string(dvd)); sprintf(code, "%c%c", audio_attr.lang_code >> 8, audio_attr.lang_code & 0xff); if (!code[0]) { code[0] = 'x'; code[1] = 'x'; } return getLanguage(code); } int DVDNavReader::audioSampleFrequency(int stream_idx) { audio_attr_t audio_attr; AUTOLOCK(mutex); if (dvdnav_get_audio_attr(dvd, stream_idx, &audio_attr) != DVDNAV_STATUS_OK) throw _Exception(_("Error error retrieving audio language from DVD ") + dvd_path + " : " + dvdnav_err_to_string(dvd)); if (audio_attr.sample_frequency == 0) return 48000; else return 96000; } int DVDNavReader::audioChannels(int stream_idx) { audio_attr_t audio_attr; AUTOLOCK(mutex); if (dvdnav_get_audio_attr(dvd, stream_idx, &audio_attr) != DVDNAV_STATUS_OK) throw _Exception(_("Error error retrieving audio language from DVD ") + dvd_path + " : " + dvdnav_err_to_string(dvd)); return audio_attr.channels + 1; } String DVDNavReader::audioFormat(int stream_idx) { audio_attr_t audio_attr; AUTOLOCK(mutex); if (dvdnav_get_audio_attr(dvd, stream_idx, &audio_attr) != DVDNAV_STATUS_OK) throw _Exception(_("Error error retrieving audio language from DVD ") + dvd_path + " : " + dvdnav_err_to_string(dvd)); return _(audio_format[audio_attr.audio_format]); } int DVDNavReader::audioStreamID(int stream_idx) { audio_attr_t audio_attr; AUTOLOCK(mutex); if (dvdnav_get_audio_attr(dvd, stream_idx, &audio_attr) != DVDNAV_STATUS_OK) throw _Exception(_("Error error retrieving audio language from DVD ") + dvd_path + " : " + dvdnav_err_to_string(dvd)); return audio_id[audio_attr.audio_format]+stream_idx; } #endif//HAVE_LIBDVDNAV mediatomb-0.12.1/src/youtube_video_url.h0000664000076400007640000000444311352675003015202 00000000000000/*MT* MediaTomb - http://www.mediatomb.cc/ youtube_video_url.h - this file is part of MediaTomb. Copyright (C) 2005 Gena Batyan , Sergey 'Jin' Bostandzhyan Copyright (C) 2006-2010 Gena Batyan , Sergey 'Jin' Bostandzhyan , Leonhard Wimmer MediaTomb is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. MediaTomb is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with MediaTomb; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. $Id: youtube_video_url.h 2081 2010-03-23 20:18:00Z lww $ */ /// \file youtube_video_url.h /// \brief Definition of the YouTubeVideoURL class. #ifdef YOUTUBE #ifndef __YOUTUBE_VIDEO_URL_H__ #define __YOUTUBE_VIDEO_URL_H__ #include #include "zmmf/zmmf.h" #include "zmm/zmm.h" #include "rexp.h" /// \brief this class keeps all data associated with one transcoding profile. class YouTubeVideoURL : public zmm::Object { public: YouTubeVideoURL(); ~YouTubeVideoURL(); /// \brief Takes the usual YouTube style URL as argument /// and returns the URL to the associated video. /// /// \param video_id id of the video /// \param mp4 get video in mp4 format /// \param hd if mp4 format is selected, get video in HD resolution if /// available /// \return the url to the .flv or .mp4 file zmm::String getVideoURL(zmm::String video_id, bool mp4, bool hd); protected: // the handle *must never be used from multiple threads* CURL *curl_handle; pthread_t pid; zmm::Ref reVideoURLParams; zmm::Ref redirectLocation; zmm::Ref param_t; zmm::Ref HD; }; #endif//__YOUTUBE_VIDEO_URL_H__ #endif//YOUTUBE mediatomb-0.12.1/src/sopcast_service.h0000664000076400007640000000523311352675003014630 00000000000000/*MT* MediaTomb - http://www.mediatomb.cc/ sopcast_service.h - this file is part of MediaTomb. Copyright (C) 2005 Gena Batyan , Sergey 'Jin' Bostandzhyan Copyright (C) 2006-2010 Gena Batyan , Sergey 'Jin' Bostandzhyan , Leonhard Wimmer MediaTomb is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. MediaTomb is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with MediaTomb; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. $Id: sopcast_service.h 2081 2010-03-23 20:18:00Z lww $ */ /// \file sopcast_service.h /// \brief Definition of the SopCastService class. #ifdef SOPCAST #ifndef __SOPCAST_SERVICE_H__ #define __SOPCAST_SERVICE_H__ #include "zmm/zmm.h" #include "mxml/mxml.h" #include "online_service.h" #include "url.h" #include "dictionary.h" #include /// \brief This is an interface for all online services, the function /// handles adding/refreshing content in the database. class SopCastService : public OnlineService { public: SopCastService(); ~SopCastService(); /// \brief Retrieves user specified content from the service and adds /// the items to the database. virtual bool refreshServiceData(zmm::Ref layout); /// \brief Get the type of the service (i.e. SopCast, Shoutcast, etc.) virtual service_type_t getServiceType(); /// \brief Get the human readable name for the service virtual zmm::String getServiceName(); /// \brief Parse the xml fragment from the configuration and gather /// the user settings in a service task structure. virtual zmm::Ref defineServiceTask(zmm::Ref xmlopt, zmm::Ref params); protected: // the handle *must never be used from multiple threads* CURL *curl_handle; // safeguard to ensure the above pthread_t pid; // url retriever class zmm::Ref url; /// \brief This function will retrieve the XML according to the parametrs zmm::Ref getData(); }; #endif//__ONLINE_SERVICE_H__ #endif//SOPCAST mediatomb-0.12.1/src/xpath.h0000664000076400007640000000344611352675003012564 00000000000000/*MT* MediaTomb - http://www.mediatomb.cc/ xpath.h - this file is part of MediaTomb. Copyright (C) 2005 Gena Batyan , Sergey 'Jin' Bostandzhyan Copyright (C) 2006-2010 Gena Batyan , Sergey 'Jin' Bostandzhyan , Leonhard Wimmer MediaTomb is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. MediaTomb is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with MediaTomb; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. $Id: xpath.h 2081 2010-03-23 20:18:00Z lww $ */ /// \file xpath.h #ifndef __XPATH_H__ #define __XPATH_H__ #include "zmmf/zmmf.h" #include "mxml/mxml.h" class XPath : public zmm::Object { protected: zmm::Ref context; public: XPath(zmm::Ref context); zmm::String getText(zmm::String xpath); zmm::Ref getElement(zmm::String xpath); static zmm::String getPathPart(zmm::String xpath); static zmm::String getAxisPart(zmm::String xpath); static zmm::String getAxis(zmm::String axisPart); static zmm::String getSpec(zmm::String axisPart); protected: zmm::Ref elementAtPath(zmm::String path); }; #endif // __XPATH_H__ mediatomb-0.12.1/src/file_request_handler.h0000664000076400007640000000335511352675003015623 00000000000000/*MT* MediaTomb - http://www.mediatomb.cc/ file_request_handler.h - this file is part of MediaTomb. Copyright (C) 2005 Gena Batyan , Sergey 'Jin' Bostandzhyan Copyright (C) 2006-2010 Gena Batyan , Sergey 'Jin' Bostandzhyan , Leonhard Wimmer MediaTomb is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. MediaTomb is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with MediaTomb; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. $Id: file_request_handler.h 2081 2010-03-23 20:18:00Z lww $ */ /// \file file_request_handler.h /// \brief Definition of the FileRequestHandler class. #ifndef __FILE_REQUEST_HANDLER_H__ #define __FILE_REQUEST_HANDLER_H__ #include "common.h" #include "request_handler.h" #include "dictionary.h" class FileRequestHandler : public RequestHandler { public: FileRequestHandler(); virtual void get_info(IN const char *filename, OUT struct File_Info *info); virtual zmm::Ref open(IN const char *filename, OUT struct File_Info *info, IN enum UpnpOpenFileMode mode); }; #endif // __FILE_REQUEST_HANDLER_H__ mediatomb-0.12.1/src/process.h0000664000076400007640000000300211352675003013102 00000000000000/*MT* MediaTomb - http://www.mediatomb.cc/ process.h - this file is part of MediaTomb. Copyright (C) 2005 Gena Batyan , Sergey 'Jin' Bostandzhyan Copyright (C) 2006-2010 Gena Batyan , Sergey 'Jin' Bostandzhyan , Leonhard Wimmer MediaTomb is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. MediaTomb is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with MediaTomb; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. $Id: process.h 2081 2010-03-23 20:18:00Z lww $ */ /// \file process.h #ifndef __PROCESS_H__ #define __PROCESS_H__ #include "zmmf/zmmf.h" void init_process(); zmm::String run_simple_process(zmm::String prog, zmm::String param, zmm::String input); void run_process(zmm::String prog, zmm::String param); bool is_alive(pid_t pid, int *exit_status = NULL); bool kill_proc(pid_t kill_pid); #endif // __PROCESS_H__ mediatomb-0.12.1/src/youtube_video_url.cc0000664000076400007640000001416711355721703015346 00000000000000/*MT* MediaTomb - http://www.mediatomb.cc/ youtube_video_url.cc - this file is part of MediaTomb. Copyright (C) 2005 Gena Batyan , Sergey 'Jin' Bostandzhyan Copyright (C) 2006-2010 Gena Batyan , Sergey 'Jin' Bostandzhyan , Leonhard Wimmer MediaTomb is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. MediaTomb is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with MediaTomb; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. $Id: youtube_video_url.cc 2094 2010-04-03 20:22:31Z jin_eld $ */ /// \file youtube_video_url.cc /// \brief Definitions of the Transcoding classes. #ifdef HAVE_CONFIG_H #include "autoconfig.h" #endif #ifdef YOUTUBE #include #include "youtube_video_url.h" #include "tools.h" #include "url.h" using namespace zmm; #define YOUTUBE_URL_PARAMS_REGEXP "var swfHTML.*\\;" #define YOUTUBE_URL_LOCATION_REGEXP "\nLocation: (http://[^\n]+)\n" #define YOUTUBE_URL_WATCH "http://www.youtube.com/watch?v=" #define YOUTUBE_URL_GET "http://www.youtube.com/get_video?" #define YOUTUBE_URL_PARAM_VIDEO_ID "video_id" #define YOUTUBE_URL_PARAM_T_REGEXP ".*&t=([^&]+)&" #define YOUTUBE_URL_PARAM_T "t" #define YOUTUBE_IS_HD_AVAILABLE_REGEXP "IS_HD_AVAILABLE[^:]*: *([^,]*)" YouTubeVideoURL::YouTubeVideoURL() { curl_handle = curl_easy_init(); if (!curl_handle) throw _Exception(_("failed to initialize curl!\n")); reVideoURLParams = Ref(new RExp()); reVideoURLParams->compile(_(YOUTUBE_URL_PARAMS_REGEXP)); redirectLocation = Ref(new RExp()); redirectLocation->compile(_(YOUTUBE_URL_LOCATION_REGEXP)); param_t = Ref(new RExp()); param_t->compile(_(YOUTUBE_URL_PARAM_T_REGEXP)); HD = Ref(new RExp()); HD->compile(_(YOUTUBE_IS_HD_AVAILABLE_REGEXP)); // this is a safeguard to ensure that this class is not called from // multiple threads - it is not allowed to use the same curl handle // from multiple threads pid = pthread_self(); } YouTubeVideoURL::~YouTubeVideoURL() { if (curl_handle) curl_easy_cleanup(curl_handle); } String YouTubeVideoURL::getVideoURL(String video_id, bool mp4, bool hd) { long retcode; String flv_location; String watch; #ifdef TOMBDEBUG bool verbose = true; #else bool verbose = false; #endif /* // ########################################################### String swfargs = read_text_file("/home/jin/Work/UPnP/MediaTomb/YouTube/swf_args_new2.txt"); Ref m2 = param_t->matcher(swfargs); if (m2->next()) { String hmm = m2->group(1); if (string_ok(hmm)) log_debug("############### t: %s\n", hmm.c_str()); else log_debug("no match?\n"); } throw _Exception(_("OVER")); */ // ########################################################### if (!string_ok(video_id)) throw _Exception(_("No video ID specified!")); watch = _(YOUTUBE_URL_WATCH) + video_id; Ref url(new URL(YOUTUBE_PAGESIZE)); Ref buffer = url->download(watch, &retcode, curl_handle, false, verbose, true); if (retcode != 200) { throw _Exception(_("Failed to get URL for video with id ") + watch + _("HTTP response code: ") + String::from(retcode)); } log_debug("------> GOT BUFFER %s\n", buffer->toString().c_str()); Ref matcher = reVideoURLParams->matcher(buffer->toString()); String params; if (matcher->next()) { // params = trim_string(matcher->group(1)); params = trim_string( matcher->group( 0 ) ); /* int brace = params.index( '{' ); if ( brace > 0 ) params = params.substring( brace ); brace = params.index( '}' ); if ( brace > 0 ) params = params.substring( 0, brace + 1 ); */ Ref m2 = param_t->matcher(params); if (m2->next()) { String hmm = m2->group(1); if (string_ok(hmm)) params = hmm; else { throw _Exception(_("Could not retrieve \"t\" parameter.")); } } } else { throw _Exception(_("Failed to get URL for video with id (step 1)") + video_id); } params = _(YOUTUBE_URL_GET) + YOUTUBE_URL_PARAM_VIDEO_ID + '=' + video_id + '&' + YOUTUBE_URL_PARAM_T + '=' + params; if (mp4) { String format = _("&fmt=18"); if (hd) { matcher = HD->matcher(buffer->toString()); if (matcher->next()) { if (trim_string(matcher->group(1)) == "true") format = _("&fmt=22"); } } params = params + format; } buffer = url->download(params, &retcode, curl_handle, true, verbose, true); matcher = redirectLocation->matcher(buffer->toString()); if (matcher->next()) { if (string_ok(trim_string(matcher->group(1)))) return trim_string(matcher->group(1)); else throw _Exception(_("Failed to get URL for video with id (step 2)")+ video_id); } if (retcode != 303) { throw _Exception(_("Unexpected reply from YouTube: ") + String::from(retcode)); } throw _Exception(_("Could not retrieve YouTube video URL")); } #endif//YOUTUBE mediatomb-0.12.1/src/transcoding/0000775000076400007640000000000011357204747013663 500000000000000mediatomb-0.12.1/src/transcoding/transcoding_process_executor.cc0000664000076400007640000000402411352674777022112 00000000000000/*MT* MediaTomb - http://www.mediatomb.cc/ transcoding_process_executor.cc - this file is part of MediaTomb. Copyright (C) 2005 Gena Batyan , Sergey 'Jin' Bostandzhyan Copyright (C) 2006-2010 Gena Batyan , Sergey 'Jin' Bostandzhyan , Leonhard Wimmer MediaTomb is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. MediaTomb is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with MediaTomb; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. $Id: transcoding_process_executor.cc 2081 2010-03-23 20:18:00Z lww $ */ /// \file transcoding_process_executor.cc #ifdef HAVE_CONFIG_H #include "autoconfig.h" #endif #ifdef EXTERNAL_TRANSCODING #include #include "transcoding_process_executor.h" using namespace zmm; TranscodingProcessExecutor::TranscodingProcessExecutor(String command, Ref > arglist) : ProcessExecutor(command, arglist) { }; void TranscodingProcessExecutor::removeFile(String filename) { if (file_list == nil) file_list = Ref >(new Array(2)); file_list->append(filename); } TranscodingProcessExecutor::~TranscodingProcessExecutor() { kill(); if (file_list != nil) { for (int i = 0; i < file_list->size(); i++) { String name = file_list->get(i); unlink(name.c_str()); } } } #endif//EXTERNAL TRANSCODING mediatomb-0.12.1/src/transcoding/transcoding.cc0000664000076400007640000001060211352674777016435 00000000000000/*MT* MediaTomb - http://www.mediatomb.cc/ transcoding.cc - this file is part of MediaTomb. Copyright (C) 2005 Gena Batyan , Sergey 'Jin' Bostandzhyan Copyright (C) 2006-2010 Gena Batyan , Sergey 'Jin' Bostandzhyan , Leonhard Wimmer MediaTomb is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. MediaTomb is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with MediaTomb; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. $Id: transcoding.cc 2081 2010-03-23 20:18:00Z lww $ */ /// \file transcoding.cc /// \brief Definitions of the Transcoding classes. #ifdef HAVE_CONFIG_H #include "autoconfig.h" #endif #ifdef EXTERNAL_TRANSCODING #include "transcoding.h" #include "tools.h" using namespace zmm; TranscodingProfile::TranscodingProfile() { first_resource = false; buffer_size = 0; chunk_size = 0; initial_fill_size = 0; tr_type = TR_None; theora = false; accept_url = true; dvd_only = false; force_chunked = true; hide_orig_res = false; thumbnail = false; sample_frequency = SOURCE; // keep original number_of_channels = SOURCE; attributes = Ref(new Dictionary()); fourcc_list = Ref >(new Array()); fourcc_mode = FCC_None; } TranscodingProfile::TranscodingProfile(transcoding_type_t tr_type, String name) { this->name = name; this->tr_type = tr_type; theora = false; first_resource = false; accept_url = true; dvd_only = false; force_chunked = true; hide_orig_res = false; thumbnail = false; sample_frequency = SOURCE; // keep original number_of_channels = SOURCE; buffer_size = 0; chunk_size = 0; initial_fill_size = 0; tr_type = TR_None; attributes = Ref(new Dictionary()); fourcc_list = Ref >(new Array()); fourcc_mode = FCC_None; } void TranscodingProfile::setBufferOptions(size_t bs, size_t cs, size_t ifs) { buffer_size = bs; chunk_size = cs; initial_fill_size = ifs; } void TranscodingProfile::addAttribute(zmm::String name, zmm::String value) { attributes->put(name, value); } Ref TranscodingProfile::getAttributes() { return attributes; } void TranscodingProfile::setAVIFourCCList(Ref > list, avi_fourcc_listmode_t mode) { fourcc_list = list; fourcc_mode = mode; } Ref > TranscodingProfile::getAVIFourCCList() { return fourcc_list; } TranscodingProfileList::TranscodingProfileList() { list = Ref > >(new ObjectDictionary >()); } void TranscodingProfileList::add(zmm::String sourceMimeType, zmm::Ref prof) { Ref > inner = list->get(sourceMimeType); if (inner == nil) inner = Ref >(new ObjectDictionary()); inner->put(prof->getName(), prof); list->put(sourceMimeType, inner); } Ref > TranscodingProfileList::get(zmm::String sourceMimeType) { return list->get(sourceMimeType); } Ref TranscodingProfileList::getByName(zmm::String name) { Ref > > > mt_list = list->getElements(); for (int i = 0; i < mt_list->size(); i++) { Ref > names = mt_list->get(i)->getValue(); if (names != nil) { Ref tp = names->get(name); if (tp != nil) return tp; } } return nil; } #endif//EXTERNAL_TRANSCODING mediatomb-0.12.1/src/transcoding/transcode_dispatcher.cc0000664000076400007640000000450311352674777020315 00000000000000/*MT* MediaTomb - http://www.mediatomb.cc/ transcode_dispatcher.cc - this file is part of MediaTomb. Copyright (C) 2005 Gena Batyan , Sergey 'Jin' Bostandzhyan Copyright (C) 2006-2010 Gena Batyan , Sergey 'Jin' Bostandzhyan , Leonhard Wimmer MediaTomb is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. MediaTomb is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with MediaTomb; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. $Id: transcode_dispatcher.cc 2081 2010-03-23 20:18:00Z lww $ */ /// \file transcode_dispatcher.cc #ifdef HAVE_CONFIG_H #include "autoconfig.h" #endif #ifdef EXTERNAL_TRANSCODING #include "common.h" #include "cds_objects.h" #include "transcoding.h" #include "transcode_dispatcher.h" #include "transcode_ext_handler.h" #include "tools.h" using namespace zmm; TranscodeDispatcher::TranscodeDispatcher() : TranscodeHandler() { } Ref TranscodeDispatcher::open(Ref profile, String location, Ref obj, struct File_Info *info) { if (profile == nil) throw _Exception(_("Transcoding of file ") + location + "requested but no profile given "); // check_path_ex(location); if (profile->getType() == TR_External) { Ref tr_ext(new TranscodeExternalHandler()); return tr_ext->open(profile, location, obj, info); } else throw _Exception(_("Unknown transcoding type for profile ") + profile->getName()); } #endif//EXTERNAL_TRANSCODING mediatomb-0.12.1/src/transcoding/transcoding.h0000664000076400007640000002153511352674777016306 00000000000000/*MT* MediaTomb - http://www.mediatomb.cc/ transcoding.h - this file is part of MediaTomb. Copyright (C) 2005 Gena Batyan , Sergey 'Jin' Bostandzhyan Copyright (C) 2006-2010 Gena Batyan , Sergey 'Jin' Bostandzhyan , Leonhard Wimmer MediaTomb is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. MediaTomb is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with MediaTomb; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. $Id: transcoding.h 2081 2010-03-23 20:18:00Z lww $ */ /// \file transcoding.h /// \brief Definitions of the Transcoding classes. #ifdef EXTERNAL_TRANSCODING #ifndef __TRANSCODING_H__ #define __TRANSCODING_H__ #include "zmmf/zmmf.h" #include "dictionary.h" #include "object_dictionary.h" #define SOURCE (-1) #define OFF 0 typedef enum { TR_None, TR_External, TR_Remote } transcoding_type_t; typedef enum { FCC_None, FCC_Process, FCC_Ignore } avi_fourcc_listmode_t; /// \brief this class keeps all data associated with one transcoding profile. class TranscodingProfile : public zmm::Object { public: TranscodingProfile(transcoding_type_t tr_type, zmm::String name); /// \brief returns the transcoding type. transcoding_type_t getType() { return tr_type; } /// \brief set name of the transcoding profile void setName(zmm::String name) { this->name = name; } /// \brief get name of the transcoding profile zmm::String getName() { return name; } /// \brief set target mimetype /// /// The so called "target mimetype" is the mimetype of the media that will /// be produced by the transcoder and identifies the target format. void setTargetMimeType(zmm::String tm) { this->tm = tm; } /// \brief get target mimetype zmm::String getTargetMimeType() { return tm; } /// \brief sets the program name, i.e. the command line name of the /// transcoder that will be executed. void setCommand(zmm::String command) { this->command = command; } /// \brief gets the transcoders program name zmm::String getCommand() { return command; } /// \brief set buffering options /// \param bs the size of the buffer in bytes /// \param cs the maximum size of the chunks which are read by the buffer /// \param ifs the number of bytes which have to be in the buffer /// before the first read at the very beginning or after a seek returns; /// 0 disables the delay void setBufferOptions(size_t bs, size_t cs, size_t ifs); size_t getBufferSize() { return buffer_size; } size_t getBufferChunkSize() { return chunk_size; } size_t getBufferInitialFillSize() { return initial_fill_size; } /// \brief sets the arguments that will be fed to the transcoder, /// this is the string that comes right after the command. /// /// The argument string must contain the special %out token and may contain /// the special %in token. The %in token is replaced by the filename of the /// appropriate item - this is the source media for the transcoder. The /// %out token is replaced by the fifo name that is generated when the /// transcoding process is launched. Transcoded data will be read by /// the server from the fifo and served via HTTP to the renderer. void setArguments(zmm::String args) { this->args = args; } /// \brief retrieves the argument string zmm::String getArguments() { return args; } /// \brief identifies if the profile should be set as the first resource void setFirstResource(bool fr) { first_resource = fr; } bool firstResource() { return first_resource; } /// \brief Adds a resource attribute. /// /// This maps to an attribute of the tag in the DIDL-Lite XML. /// /// \param name attribute name /// \param value attribute value void addAttribute(zmm::String name, zmm::String value); zmm::Ref getAttributes(); /// \brief Override for theora content. /// /// I could not find a more generic way for this, I guess this could /// be extended to a dictionary style options if more things like that /// become necessary; we need a possibility to have a more fine grained /// detection of content where mimetype alone is not enough. void setTheora(bool theora) { this->theora = theora; } bool isTheora() { return theora; } /// \brief Specifies if the transcoding profile directly accepts an URL /// or if we should proxy the data. void setAcceptURL(bool accept) { accept_url = accept; } bool acceptURL() { return accept_url; } /// \brief Specifies if the output of the profile is a thumbnail, /// this will add appropriate DLNA tags to the XML. void setThumbnail(bool th) { thumbnail = th; } bool isThumbnail() { return thumbnail; } /// \brief Specifies if the availability of this transcoding profile /// should enforce hiding of all original resources in the browse XML void setHideOriginalResource(bool hide) { hide_orig_res = hide; } bool hideOriginalResource() { return hide_orig_res; } /// \brief If the profile handles source content in the AVI container, /// we can specify a list of fourcc's; the list can be either processed /// (i.e. the profile will process only AVI files that have a fourcc which /// matches an entry in the list), or we can specify that the AVIs that /// match a fourcc in the list are ignored and not transcoded. /// /// \param list List of FourCC entries. /// \param mode Specifies if the FourCCs in the list are accepted or ignored void setAVIFourCCList(zmm::Ref > list, avi_fourcc_listmode_t mode = FCC_Ignore); /// \brief Retrieves the FourCC list zmm::Ref > getAVIFourCCList(); /// \brief Provides information on the mode of the list avi_fourcc_listmode_t getAVIFourCCListMode() { return fourcc_mode; } /// \brief Send out the data in chunked encoding void setChunked(bool chunked) { force_chunked = chunked; } bool getChunked() { return force_chunked; } /// \brief Sample frequency handling void setSampleFreq(int freq) { sample_frequency = freq; } int getSampleFreq() { return sample_frequency; } /// \brief Number of channels void setNumChannels(int chans) { number_of_channels = chans; } int getNumChannels() { return number_of_channels; } /// \brief transcode or ignore streams extracted from a DVD image void setOnlyDVD(bool accept) { dvd_only = accept; } bool onlyDVD() { return dvd_only; } protected: zmm::String name; zmm::String tm; zmm::String command; zmm::String args; bool first_resource; bool theora; bool accept_url; bool dvd_only; bool hide_orig_res; bool thumbnail; bool force_chunked; size_t buffer_size; size_t chunk_size; size_t initial_fill_size; transcoding_type_t tr_type; int number_of_channels; int sample_frequency; zmm::Ref attributes; zmm::Ref > fourcc_list; avi_fourcc_listmode_t fourcc_mode; TranscodingProfile(); }; /// \brief this class allows access to available transcoding profiles. class TranscodingProfileList : public zmm::Object { public: TranscodingProfileList(); void add(zmm::String sourceMimeType, zmm::Ref prof); zmm::Ref > get(zmm::String sourceMimeType); zmm::Ref > get(int index); zmm::Ref getByName(zmm::String name); inline int size() { return list->size(); } protected: // outer dictionary is keyed by the source mimetype, inner dictionary by // profile name; this whole construction is necessary to allow to transcode // to the same output format but vary things like resolution, bitrate, etc. zmm::Ref > > list; }; class TranscodingProcess : public zmm::Object { public: TranscodingProcess(pid_t pid, zmm::String fname) { this->pid = pid; this->fname = fname; } pid_t getPID() { return pid; } zmm::String getFName() { return fname; } protected: pid_t pid; zmm::String fname; }; #endif//__TRANSCODING_H__ #endif//TRANSCODING mediatomb-0.12.1/src/transcoding/transcode_ext_handler.cc0000664000076400007640000003111011352674777020456 00000000000000/*MT* MediaTomb - http://www.mediatomb.cc/ transcode_ext_handler.cc - this file is part of MediaTomb. Copyright (C) 2005 Gena Batyan , Sergey 'Jin' Bostandzhyan Copyright (C) 2006-2010 Gena Batyan , Sergey 'Jin' Bostandzhyan , Leonhard Wimmer MediaTomb is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. MediaTomb is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with MediaTomb; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. $Id: transcode_ext_handler.cc 2081 2010-03-23 20:18:00Z lww $ */ /// \file transcode_ext_handler.cc #ifdef HAVE_CONFIG_H #include "autoconfig.h" #endif #ifdef EXTERNAL_TRANSCODING #include "transcode_ext_handler.h" #include "server.h" #include #include #include #include #include #include #include #include #include "common.h" #include "storage.h" #include "cds_objects.h" #include "process.h" #include "update_manager.h" #include "session_manager.h" #include "ixml.h" #include "process_io_handler.h" #include "buffered_io_handler.h" #include "dictionary.h" #include "metadata_handler.h" #include "tools.h" #include "file_io_handler.h" #include "transcoding_process_executor.h" #include "io_handler_chainer.h" #include "play_hook.h" #ifdef HAVE_CURL #include "curl_io_handler.h" #endif #ifdef HAVE_LIBDVDNAV #include "dvd_io_handler.h" #include "metadata/dvd_handler.h" #include "fd_io_handler.h" #include "mpegremux_processor.h" #endif using namespace zmm; TranscodeExternalHandler::TranscodeExternalHandler() : TranscodeHandler() { } Ref TranscodeExternalHandler::open(Ref profile, String location, Ref obj, struct File_Info *info) { bool isURL = false; // bool is_srt = false; log_debug("start\n"); char fifo_template[]="mt_transcode_XXXXXX"; if (profile == nil) throw _Exception(_("Transcoding of file ") + location + "requested but no profile given"); isURL = (IS_CDS_ITEM_INTERNAL_URL(obj->getObjectType()) || IS_CDS_ITEM_EXTERNAL_URL(obj->getObjectType())); String mimeType = profile->getTargetMimeType(); if (IS_CDS_ITEM(obj->getObjectType())) { Ref it = RefCast(obj, CdsItem); Ref mappings = ConfigManager::getInstance()->getDictionaryOption( CFG_IMPORT_MAPPINGS_MIMETYPE_TO_CONTENTTYPE_LIST); if (mappings->get(mimeType) == CONTENT_TYPE_PCM) { String freq = it->getResource(0)->getAttribute(MetadataHandler::getResAttrName(R_SAMPLEFREQUENCY)); String nrch = it->getResource(0)->getAttribute(MetadataHandler::getResAttrName(R_NRAUDIOCHANNELS)); if (string_ok(freq)) mimeType = mimeType + _(";rate=") + freq; if (string_ok(nrch)) mimeType = mimeType + _(";channels=") + nrch; } } info->content_type = ixmlCloneDOMString(mimeType.c_str()); #ifdef EXTEND_PROTOCOLINFO String header; header = getDLNAtransferHeader(mimeType, header); if (string_ok(header)) info->http_header = ixmlCloneDOMString(header.c_str()); #endif info->file_length = UNKNOWN_CONTENT_LENGTH; info->force_chunked = (int)profile->getChunked(); Ref cfg = ConfigManager::getInstance(); String fifo_name = normalizePath(tempName(cfg->getOption(CFG_SERVER_TMPDIR), fifo_template)); String arguments; String temp; String command; Ref > arglist; Ref > proc_list = nil; #ifdef SOPCAST service_type_t service = OS_None; if (obj->getFlag(OBJECT_FLAG_ONLINE_SERVICE)) { service = (service_type_t)(obj->getAuxData(_(ONLINE_SERVICE_AUX_ID)).toInt()); } if (service == OS_SopCast) { Ref > sop_args; int p1 = find_local_port(45000,65500); int p2 = find_local_port(45000,65500); sop_args = parseCommandLine(location + " " + String::from(p1) + " " + String::from(p2), nil, nil); Ref spsc(new ProcessExecutor(_("sp-sc-auth"), sop_args)); proc_list = Ref >(new Array(1)); Ref pr_item(new ProcListItem(RefCast(spsc, Executor))); proc_list->append(pr_item); location = _("http://localhost:") + String::from(p2) + "/tv.asf"; #warning check if socket is ready sleep(15); } #warning check if we can use "accept url" with sopcast else { #endif if (isURL && (!profile->acceptURL())) { #ifdef HAVE_CURL String url = location; strcpy(fifo_template, "mt_transcode_XXXXXX"); location = normalizePath(tempName(cfg->getOption(CFG_SERVER_TMPDIR), fifo_template)); log_debug("creating reader fifo: %s\n", location.c_str()); if (mkfifo(location.c_str(), O_RDWR) == -1) { log_error("Failed to create fifo for the remote content " "reading thread: %s\n", strerror(errno)); throw _Exception(_("Could not create reader fifo!\n")); } try { chmod(location.c_str(), S_IWUSR | S_IRUSR); Ref c_ioh(new CurlIOHandler(url, NULL, cfg->getIntOption(CFG_EXTERNAL_TRANSCODING_CURL_BUFFER_SIZE), cfg->getIntOption(CFG_EXTERNAL_TRANSCODING_CURL_FILL_SIZE))); Ref p_ioh(new ProcessIOHandler(location, nil)); Ref ch(new IOHandlerChainer(c_ioh, p_ioh, 16384)); proc_list = Ref >(new Array(1)); Ref pr_item(new ProcListItem(ch)); proc_list->append(pr_item); } catch (Exception ex) { unlink(location.c_str()); throw ex; } #else throw _Exception(_("MediaTomb was compiled without libcurl support," "data proxying is not available")); #endif } #ifdef SOPCAST } #endif #ifdef HAVE_LIBDVDNAV if (obj->getFlag(OBJECT_FLAG_DVD_IMAGE)) { strcpy(fifo_template, "mt_transcode_XXXXXX"); location = normalizePath(tempName(cfg->getOption(CFG_SERVER_TMPDIR), fifo_template)); log_debug("creating reader fifo: %s\n", location.c_str()); if (mkfifo(location.c_str(), O_RDWR) == -1) { log_error("Failed to create fifo for the DVD image " "reading thread: %s\n", strerror(errno)); throw _Exception(_("Could not create reader fifo!\n")); } try { String tmp = obj->getResource(0)->getParameter(DVDHandler::renderKey(DVD_Title)); if (!string_ok(tmp)) throw _Exception(_("DVD Image requested but title parameter is missing!")); int title = tmp.toInt(); if (title < 0) throw _Exception(_("DVD Image - requested invalid title!")); tmp = obj->getResource(0)->getParameter(DVDHandler::renderKey(DVD_Chapter)); if (!string_ok(tmp)) throw _Exception(_("DVD Image requested but chapter parameter is missing!")); int chapter = tmp.toInt(); if (chapter < 0) throw _Exception(_("DVD Image - requested invalid chapter!")); // actually we are retrieving the audio stream id here tmp = obj->getResource(0)->getParameter(DVDHandler::renderKey(DVD_AudioStreamID)); if (!string_ok(tmp)) throw _Exception(_("DVD Image requested but audio track parameter is missing!")); int audio_track = tmp.toInt(); if (audio_track < 0) throw _Exception(_("DVD Image - requested invalid audio stream ID!")); chmod(location.c_str(), S_IWUSR | S_IRUSR); Ref dvd_ioh(new DVDIOHandler(obj->getLocation(), title, chapter, audio_track)); int from_dvd_fd[2]; if (pipe(from_dvd_fd) == -1) throw _Exception(_("Failed to create DVD input pipe!")); int from_remux_fd[2]; if (pipe(from_remux_fd) == -1) { close(from_dvd_fd[0]); close(from_dvd_fd[1]); throw _Exception(_("Failed to create remux output pipe!")); } Ref fd_writer(new FDIOHandler(from_dvd_fd[1])); Ref from_dvd(new IOHandlerChainer(dvd_ioh, fd_writer, 16384)); Ref fd_reader(new FDIOHandler(from_remux_fd[0])); Ref remux(new MPEGRemuxProcessor(from_dvd_fd[0], from_remux_fd[1], (unsigned char)audio_track)); RefCast(fd_reader, FDIOHandler)->addReference(RefCast(remux, Object)); RefCast(fd_reader, FDIOHandler)->addReference(RefCast(from_dvd, Object)); RefCast(fd_reader, FDIOHandler)->addReference(RefCast(fd_writer, Object)); RefCast(fd_reader, FDIOHandler)->closeOther(fd_writer); Ref p_ioh(new ProcessIOHandler(location, nil)); Ref ch(new IOHandlerChainer(fd_reader, p_ioh, 16384)); proc_list = Ref >(new Array(2)); Ref pr_item(new ProcListItem(ch)); proc_list->append(pr_item); Ref pr2_item(new ProcListItem(from_dvd)); proc_list->append(pr2_item); } catch (Exception ex) { unlink(location.c_str()); throw ex; } } #endif String check; if (profile->getCommand().startsWith(_(_DIR_SEPARATOR))) { if (!check_path(profile->getCommand())) throw _Exception(_("Could not find transcoder: ") + profile->getCommand()); check = profile->getCommand(); } else { check = find_in_path(profile->getCommand()); if (!string_ok(check)) throw _Exception(_("Could not find transcoder ") + profile->getCommand() + " in $PATH"); } int err = 0; if (!is_executable(check, &err)) throw _Exception(_("Transcoder ") + profile->getCommand() + " is not executable: " + strerror(err)); log_debug("creating fifo: %s\n", fifo_name.c_str()); if (mkfifo(fifo_name.c_str(), O_RDWR) == -1) { log_error("Failed to create fifo for the transcoding process!: %s\n", strerror(errno)); throw _Exception(_("Could not create fifo!\n")); } chmod(fifo_name.c_str(), S_IWUSR | S_IRUSR); arglist = parseCommandLine(profile->getArguments(), location, fifo_name); log_info("Arguments: %s\n", profile->getArguments().c_str()); Ref main_proc(new TranscodingProcessExecutor(profile->getCommand(), arglist)); main_proc->removeFile(fifo_name); if (isURL && (!profile->acceptURL())) { main_proc->removeFile(location); } #ifdef HAVE_LIBDVDNAV if (obj->getFlag(OBJECT_FLAG_DVD_IMAGE)) { main_proc->removeFile(location); } #endif Ref io_handler(new BufferedIOHandler(Ref (new ProcessIOHandler(fifo_name, RefCast(main_proc, Executor), proc_list)), profile->getBufferSize(), profile->getBufferChunkSize(), profile->getBufferInitialFillSize())); io_handler->open(UPNP_READ); PlayHook::getInstance()->trigger(obj); return io_handler; } #endif//EXTERNAL_TRANSCODING mediatomb-0.12.1/src/transcoding/transcode_ext_handler.h0000664000076400007640000000347011352674777020330 00000000000000/*MT* MediaTomb - http://www.mediatomb.cc/ transcode_ext_handler.h - this file is part of MediaTomb. Copyright (C) 2005 Gena Batyan , Sergey 'Jin' Bostandzhyan Copyright (C) 2006-2010 Gena Batyan , Sergey 'Jin' Bostandzhyan , Leonhard Wimmer MediaTomb is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. MediaTomb is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with MediaTomb; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. $Id: transcode_ext_handler.h 2081 2010-03-23 20:18:00Z lww $ */ /// \file transcode_ext_handler.h /// \brief Definition of the TranscodeRequest class. #ifndef __TRANSCODE_EXTERNAL_HANDLER_H__ #define __TRANSCODE_EXTERNAL_HANDLER_H__ #include "common.h" #include "transcode_handler.h" #include "upnp.h" class TranscodeExternalHandler : public TranscodeHandler { public: TranscodeExternalHandler(); virtual zmm::Ref open(zmm::Ref profile, zmm::String location, zmm::Ref obj, struct File_Info *info); }; #endif // __TRANSCODE_EXTERNAL_HANDLER_H__ mediatomb-0.12.1/src/transcoding/transcoding_process_executor.h0000664000076400007640000000401511352674777021754 00000000000000/*MT* MediaTomb - http://www.mediatomb.cc/ transcoding_process_executor.h - this file is part of MediaTomb. Copyright (C) 2005 Gena Batyan , Sergey 'Jin' Bostandzhyan Copyright (C) 2006-2010 Gena Batyan , Sergey 'Jin' Bostandzhyan , Leonhard Wimmer MediaTomb is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. MediaTomb is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with MediaTomb; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. $Id: transcoding_process_executor.h 2081 2010-03-23 20:18:00Z lww $ */ /// \file transcoding_process_executor.h #ifdef EXTERNAL_TRANSCODING #ifndef __TRANSCODING_PROCESS_EXECUTOR_H__ #define __TRANSCODING_PROCESS_EXECUTOR_H__ #include "process_executor.h" class TranscodingProcessExecutor : public ProcessExecutor { public: TranscodingProcessExecutor(zmm::String command, zmm::Ref > arglist); /// \brief This function adds a filename to a list, files in that list /// will be removed once the class is destroyed. void removeFile(zmm::String filename); virtual ~TranscodingProcessExecutor(); protected: /// \brief The files in this list will be removed once the class is no /// longer in use. zmm::Ref > file_list; }; #endif // __TRANSCODING_PROCESS_EXECUTOR_H__ #endif//EXTERNAL_TRANSCODING mediatomb-0.12.1/src/transcoding/transcode_handler.h0000664000076400007640000000354111352674777017447 00000000000000/*MT* MediaTomb - http://www.mediatomb.cc/ transcode_handler.h - this file is part of MediaTomb. Copyright (C) 2005 Gena Batyan , Sergey 'Jin' Bostandzhyan Copyright (C) 2006-2010 Gena Batyan , Sergey 'Jin' Bostandzhyan , Leonhard Wimmer MediaTomb is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. MediaTomb is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with MediaTomb; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. $Id: transcode_handler.h 2081 2010-03-23 20:18:00Z lww $ */ /// \file transcode_handler.h /// \brief Definition of the TranscodeRequest class. #ifndef __TRANSCODE_HANDLER_H__ #define __TRANSCODE_HANDLER_H__ #include "common.h" #include "io_handler.h" #include "transcoding.h" #include "upnp.h" #include "cds_objects.h" class TranscodeHandler : public zmm::Object { public: // TranscodeHandler(); virtual zmm::Ref open(zmm::Ref profile, zmm::String location, zmm::Ref obj, struct File_Info *info) = 0; protected: enum { UNKNOWN_CONTENT_LENGTH = -1 }; }; #endif // __TRANSCODE_HANDLER_H__ mediatomb-0.12.1/src/transcoding/transcode_dispatcher.h0000664000076400007640000000340611352674777020160 00000000000000/*MT* MediaTomb - http://www.mediatomb.cc/ transcode_dispatcher.h - this file is part of MediaTomb. Copyright (C) 2005 Gena Batyan , Sergey 'Jin' Bostandzhyan Copyright (C) 2006-2010 Gena Batyan , Sergey 'Jin' Bostandzhyan , Leonhard Wimmer MediaTomb is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. MediaTomb is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with MediaTomb; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. $Id: transcode_dispatcher.h 2081 2010-03-23 20:18:00Z lww $ */ /// \file transcode_dispatcher.h /// \brief Definition of the TranscodeRequest class. #ifndef __TRANSCODE_DISPATCHER_H__ #define __TRANSCODE_DISPATCHER_H__ #include "common.h" #include "transcode_handler.h" class TranscodeDispatcher : public TranscodeHandler { public: TranscodeDispatcher(); virtual zmm::Ref open(zmm::Ref profile, zmm::String location, zmm::Ref obj, struct File_Info *info); }; #endif // __TRANSCODE_DISPATCHER_H__ mediatomb-0.12.1/src/action_request.cc0000664000076400007640000000646611352675003014630 00000000000000/*MT* MediaTomb - http://www.mediatomb.cc/ action_request.cc - this file is part of MediaTomb. Copyright (C) 2005 Gena Batyan , Sergey 'Jin' Bostandzhyan Copyright (C) 2006-2010 Gena Batyan , Sergey 'Jin' Bostandzhyan , Leonhard Wimmer MediaTomb is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. MediaTomb is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with MediaTomb; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. $Id: action_request.cc 2081 2010-03-23 20:18:00Z lww $ */ /// \file action_request.cc #ifdef HAVE_CONFIG_H #include "autoconfig.h" #endif #include "action_request.h" using namespace zmm; using namespace mxml; ActionRequest::ActionRequest(Upnp_Action_Request *upnp_request) : Object() { this->upnp_request = upnp_request; errCode = UPNP_E_SUCCESS; actionName = upnp_request->ActionName; UDN = upnp_request->DevUDN; serviceID = upnp_request->ServiceID; DOMString cxml = ixmlPrintDocument(upnp_request->ActionRequest); String xml = cxml; ixmlFreeDOMString(cxml); Ref parser(new Parser()); request = parser->parseString(xml)->getRoot(); } String ActionRequest::getActionName() { return actionName; } String ActionRequest::getUDN() { return UDN; } String ActionRequest::getServiceID() { return serviceID; } Ref ActionRequest::getRequest() { return request; } void ActionRequest::setResponse(Ref response) { this->response = response; } void ActionRequest::setErrorCode(int errCode) { this->errCode = errCode; } void ActionRequest::update() { if(response != nil) { String xml = response->print(); int ret; //log_debug("ActionRequest::update(): \n%s\n\n", xml.c_str()); ret = ixmlParseBufferEx(xml.c_str(), &upnp_request->ActionResult); if (ret != IXML_SUCCESS) { log_error("ActionRequest::update(): could not convert to iXML\n"); log_debug("Dump:\n%s\n", xml.c_str()); upnp_request->ErrCode = UPNP_E_ACTION_FAILED; } else { // log_debug("ActionRequest::update(): converted to iXML, code %d\n", errCode); upnp_request->ErrCode = errCode; } } else { // ok, here there can be two cases // either the function below already did set an error code, // then we keep it // if it did not do so - we set an error code of our own if (errCode == UPNP_E_SUCCESS) { upnp_request->ErrCode = UPNP_E_ACTION_FAILED; } log_error("ActionRequest::update(): response is nil, code %d\n", errCode); } } mediatomb-0.12.1/src/youtube_service.h0000664000076400007640000001415711352675003014655 00000000000000/*MT* MediaTomb - http://www.mediatomb.cc/ youtube_service.h - this file is part of MediaTomb. Copyright (C) 2005 Gena Batyan , Sergey 'Jin' Bostandzhyan Copyright (C) 2006-2010 Gena Batyan , Sergey 'Jin' Bostandzhyan , Leonhard Wimmer MediaTomb is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. MediaTomb is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with MediaTomb; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. $Id: youtube_service.h 2081 2010-03-23 20:18:00Z lww $ */ /// \file youtube_service.h /// \brief Definition of the YouTubeService class. #if defined(YOUTUBE) // make sure to add more ifdefs when we get more services #ifndef __YOUTUBE_SERVICE_H__ #define __YOUTUBE_SERVICE_H__ #include "zmm/zmm.h" #include "mxml/mxml.h" #include "online_service.h" #include "url.h" #include "dictionary.h" #include "youtube_content_handler.h" #include typedef enum { YT_request_none = 0, YT_request_video_search, YT_request_stdfeed, YT_request_user_favorites, YT_request_user_playlists, YT_request_user_subscriptions, YT_request_user_uploads, YT_subrequest_playlists, YT_subrequest_subscriptions, } yt_requests_t; typedef enum { YT_region_au = 0, YT_region_br, YT_region_ca, YT_region_fr, YT_region_de, YT_region_gb, YT_region_nl, YT_region_hk, YT_region_ie, YT_region_it, YT_region_jp, YT_region_mx, YT_region_nz, YT_region_pl, YT_region_ru, YT_region_kr, YT_region_es, YT_region_tw, YT_region_us, YT_region_none, } yt_regions_t; /// \brief This is an interface for all online services, the function /// handles adding/refreshing content in the database. class YouTubeService : public OnlineService { public: YouTubeService(); ~YouTubeService(); /// \brief Retrieves user specified content from the service and adds /// the items to the database. virtual bool refreshServiceData(zmm::Ref layout); /// \brief Get the type of the service (i.e. YouTube, Shoutcast, etc.) virtual service_type_t getServiceType(); /// \brief Get the human readable name for the service virtual zmm::String getServiceName(); /// \brief Parse the xml fragment from the configuration and gather /// the user settings in a service task structure. virtual zmm::Ref defineServiceTask(zmm::Ref xmlopt, zmm::Ref params); /// \brief Get the human readable name of a particular request type, i.e. /// did we request Favorites or Featured videos, etc. static zmm::String getRequestName(yt_requests_t request); /// \brief Get the human readable category name static zmm::String getRegionName(yt_regions_t region_code); protected: // the handle *must never be used from multiple threads* CURL *curl_handle; // safeguard to ensure the above pthread_t pid; // url retriever class zmm::Ref url; /// \brief This function will retrieve the XML according to the parametrs zmm::Ref getData(zmm::String url_part, zmm::Ref params, bool construct_url = true); /// \brief This class defines the so called "YouTube task", the task /// holds various parameters that are needed to perform. A task means /// the process of downloading, parsing service data and creating /// CdsObjects. class YouTubeTask : public zmm::Object { public: YouTubeTask(); /// \brief Request identifier yt_requests_t request; /// \brief Region setting yt_regions_t region; /// \brief Constructed URL that will be prepended with the base and /// appended with parameters. zmm::String url_part; /// \brief It was so nice when using with the REST API, now we will /// have to convert the parameters to a specific string. zmm::Ref parameters; /// \brief Amount of items that we are allowed to get. int amount; /// \brief Amount of items that have been fetched. int amount_fetched; /// \brief Starting index of the item to fetch int start_index; /// \brief Starging index as specified in the configuration by the user int cfg_start_index; /// \brief Name of the actual subrequest zmm::String sub_request_name; /// \brief Special requests have a subfeed zmm::Ref subfeed; int subfeed_index; /// \brief Task must be removed from the tasklist after one time /// execution bool kill; }; /// \brief task that we will be working with when refreshServiceData is /// called. int current_task; // helper functions for parsing config.xml // zmm::String getCheckAttr(zmm::Ref xml, zmm::String attrname); // int getCheckPosIntAttr(zmm::Ref xml, zmm::String attrname); void getPagingParams(zmm::Ref xml, zmm::Ref task); void addTimeParams(zmm::Ref xml, zmm::Ref task); yt_regions_t getRegion(zmm::Ref xml); zmm::String getFeed(zmm::Ref xml); // subrequests are spawned as one time tasks, they are removed from the // task list after one time execution - this function takes care of it void killOneTimeTasks(zmm::Ref > tasklist); }; #endif//__ONLINE_SERVICE_H__ #endif//YOUTUBE mediatomb-0.12.1/src/io_handler.h0000664000076400007640000000537711352675003013551 00000000000000/*MT* MediaTomb - http://www.mediatomb.cc/ io_handler.h - this file is part of MediaTomb. Copyright (C) 2005 Gena Batyan , Sergey 'Jin' Bostandzhyan Copyright (C) 2006-2010 Gena Batyan , Sergey 'Jin' Bostandzhyan , Leonhard Wimmer MediaTomb is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. MediaTomb is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with MediaTomb; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. $Id: io_handler.h 2081 2010-03-23 20:18:00Z lww $ */ /// \file io_handler.h /// \brief Definitoin for the IOHandler class. #ifndef __IO_HANDLER_H__ #define __IO_HANDLER_H__ #include "common.h" #include "upnp.h" class IOHandler : public zmm::Object { public: IOHandler(); /// \brief Opens a data for the web server. /// \param mode in which the data will be opened (we only support UPNP_READ) /// \todo Genych, ya tut che to zapamyatowal kak gawno rabotaet? kto filename poluchaet?? virtual void open(enum UpnpOpenFileMode mode); /// \brief Reads previously opened/initialized data sequentially. /// \param buf This buffer will be filled by our read functions. /// \param length Number of bytes to read. virtual int read(char *buf, size_t length); /// \brief Writes to previously opened/initialized data sequentially. /// \param buf Data to be written. /// \param length Number of bytes to write. virtual int write(char *buf, size_t length); /// \brief Performs a seek on an open/initialized data. /// \param offset Number of bytes to move in the buffer. /// For seeking forwards /// positive values are used, for seeking backwards - negative. \b Offset must /// be positive if \b origin is set to \b SEEK_SET /// \param whence The position to move relative to. SEEK_CUR to move relative /// to current position, SEEK_END to move relative to the end of file, /// SEEK_SET to specify an absolute offset. virtual void seek(off_t offset, int whence); /// \brief Close/free previously opened/initialized data. virtual void close(); }; #endif // __IO_HANDLER_H__ mediatomb-0.12.1/src/cds_resource.cc0000664000076400007640000001113511352675003014250 00000000000000/*MT* MediaTomb - http://www.mediatomb.cc/ cds_resource.cc - this file is part of MediaTomb. Copyright (C) 2005 Gena Batyan , Sergey 'Jin' Bostandzhyan Copyright (C) 2006-2010 Gena Batyan , Sergey 'Jin' Bostandzhyan , Leonhard Wimmer MediaTomb is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. MediaTomb is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with MediaTomb; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. $Id: cds_resource.cc 2081 2010-03-23 20:18:00Z lww $ */ /// \file cds_resource.cc #ifdef HAVE_CONFIG_H #include "autoconfig.h" #endif #include "tools.h" #include "cds_resource.h" #define RESOURCE_PART_SEP '~' using namespace zmm; CdsResource::CdsResource(int handlerType) : Object() { this->handlerType = handlerType; this->attributes = Ref(new Dictionary()); this->parameters = Ref(new Dictionary()); this->options = Ref(new Dictionary()); } CdsResource::CdsResource(int handlerType, Ref attributes, Ref parameters, Ref options) { this->handlerType = handlerType; this->attributes = attributes; this->parameters = parameters; this->options = options; } void CdsResource::addAttribute(String name, String value) { attributes->put(name, value); } void CdsResource::removeAttribute(String name) { attributes->remove(name); } void CdsResource::mergeAttributes(Ref additional) { attributes->merge(additional); } void CdsResource::addParameter(String name, String value) { parameters->put(name, value); } void CdsResource::addOption(String name, String value) { options->put(name, value); } int CdsResource::getHandlerType() { return handlerType; } Ref CdsResource::getAttributes() { return attributes; } Ref CdsResource::getParameters() { return parameters; } Ref CdsResource::getOptions() { return options; } String CdsResource::getAttribute(String name) { return attributes->get(name); } String CdsResource::getParameter(String name) { return parameters->get(name); } String CdsResource::getOption(String name) { return options->get(name); } bool CdsResource::equals(Ref other) { return ( handlerType == other->handlerType && attributes->equals(other->attributes) && parameters->equals(other->parameters) && options->equals(other->options) ); } Ref CdsResource::clone() { return Ref(new CdsResource(handlerType, attributes->clone(), parameters->clone(), options->clone())); } String CdsResource::encode() { // encode resources Ref buf(new StringBuffer()); *buf << handlerType; *buf << RESOURCE_PART_SEP; *buf << attributes->encode(); *buf << RESOURCE_PART_SEP; *buf << parameters->encode(); *buf << RESOURCE_PART_SEP; *buf << options->encode(); return buf->toString(); } Ref CdsResource::decode(String serial) { Ref > parts = split_string(serial, RESOURCE_PART_SEP, true); int size = parts->size(); if (size < 2 || size > 4) throw _Exception(_("CdsResource::decode: Could not parse resources")); int handlerType = String(parts->get(0)).toInt(); Ref attr(new Dictionary()); attr->decode(parts->get(1)); Ref par(new Dictionary()); if (size >= 3) par->decode(parts->get(2)); Ref opt(new Dictionary()); if (size >= 4) opt->decode(parts->get(3)); Ref resource(new CdsResource(handlerType, attr, par, opt)); return resource; } void CdsResource::optimize() { attributes->optimize(); parameters->optimize(); options->optimize(); } mediatomb-0.12.1/src/filesystem.h0000664000076400007640000000425411352675003013622 00000000000000/*MT* MediaTomb - http://www.mediatomb.cc/ filesystem.h - this file is part of MediaTomb. Copyright (C) 2005 Gena Batyan , Sergey 'Jin' Bostandzhyan Copyright (C) 2006-2010 Gena Batyan , Sergey 'Jin' Bostandzhyan , Leonhard Wimmer MediaTomb is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. MediaTomb is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with MediaTomb; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. $Id: filesystem.h 2081 2010-03-23 20:18:00Z lww $ */ /// \file filesystem.h #ifndef __FILESYSTEM_H__ #define __FILESYSTEM_H__ #include "common.h" #include "rexp.h" #define FS_MASK_FILES 1 #define FS_MASK_DIRECTORIES 2 #define FS_MASK_HIDDEN 4 // accept hidden files (start with . "dot") #ifdef __CYGWIN__ #define FS_ROOT_DIRECTORY "/cygdrive/" #else #define FS_ROOT_DIRECTORY "/" #endif class FsObject : public zmm::Object { public: inline FsObject() : zmm::Object() { isDirectory = false; hasContent = false; } public: zmm::String filename; bool isDirectory; bool hasContent; }; class Filesystem : public zmm::Object { public: Filesystem(); zmm::Ref > readDirectory(zmm::String path, int mask, int chldMask = 0); bool haveFiles(zmm::String dir); bool haveDirectories(zmm::String dir); bool fileAllowed(zmm::String path); protected: zmm::Ref > includeRules; bool have(zmm::String dir, int mask); }; #endif // __FILESYSTEM_H__ mediatomb-0.12.1/src/curl_io_handler.cc0000664000076400007640000002003111352675003014714 00000000000000/*MT* MediaTomb - http://www.mediatomb.cc/ curl_io_handler.cc - this file is part of MediaTomb. Copyright (C) 2005 Gena Batyan , Sergey 'Jin' Bostandzhyan Copyright (C) 2006-2010 Gena Batyan , Sergey 'Jin' Bostandzhyan , Leonhard Wimmer MediaTomb is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. MediaTomb is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with MediaTomb; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. $Id: curl_io_handler.cc 2081 2010-03-23 20:18:00Z lww $ */ /// \file curl_io_handler.cc #ifdef HAVE_CONFIG_H #include "autoconfig.h" #endif #ifdef HAVE_CURL #include "config_manager.h" #include "tools.h" #include "curl_io_handler.h" using namespace zmm; CurlIOHandler::CurlIOHandler(String URL, CURL *curl_handle, size_t bufSize, size_t initialFillSize) : IOHandlerBufferHelper(bufSize, initialFillSize) { if (! string_ok(URL)) throw _Exception(_("URL has not been set correctly")); if (bufSize < CURL_MAX_WRITE_SIZE) throw _Exception(_("bufSize must be at least CURL_MAX_WRITE_SIZE(")+CURL_MAX_WRITE_SIZE+')'); this->URL = URL; this->external_curl_handle = (curl_handle != NULL); this->curl_handle = curl_handle; //bytesCurl = 0; signalAfterEveryRead = true; // still todo: // * optimize seek if data already in buffer seekEnabled = true; } void CurlIOHandler::open(IN enum UpnpOpenFileMode mode) { if (curl_handle == NULL) { curl_handle = curl_easy_init(); if (curl_handle == NULL) throw _Exception(_("failed to init curl")); } else curl_easy_reset(curl_handle); IOHandlerBufferHelper::open(mode); } void CurlIOHandler::close() { IOHandlerBufferHelper::close(); if (external_curl_handle && curl_handle != NULL) curl_easy_cleanup(curl_handle); } void CurlIOHandler::threadProc() { CURLcode res; assert(curl_handle != NULL); assert(string_ok(URL)); //char error_buffer[CURL_ERROR_SIZE] = {'\0'}; //curl_easy_setopt(curl_handle, CURLOPT_ERRORBUFFER, error_buffer); curl_easy_setopt(curl_handle, CURLOPT_URL, URL.c_str()); curl_easy_setopt(curl_handle, CURLOPT_NOSIGNAL, 1); curl_easy_setopt(curl_handle, CURLOPT_FOLLOWLOCATION, 1); curl_easy_setopt(curl_handle, CURLOPT_MAXREDIRS, -1); bool logEnabled; #ifdef TOMBDEBUG logEnabled = !ConfigManager::isDebugLogging(); #else logEnabled = ConfigManager::isDebugLogging(); #endif if (logEnabled) curl_easy_setopt(curl_handle, CURLOPT_VERBOSE, 1); //curl_easy_setopt(curl_handle, CURLOPT_CONNECTTIMEOUT, //proxy.. curl_easy_setopt(curl_handle, CURLOPT_WRITEFUNCTION, CurlIOHandler::curlCallback); curl_easy_setopt(curl_handle, CURLOPT_WRITEDATA, (void *)this); AUTOLOCK_NOLOCK(mutex); do { AUTORELOCK(); if (doSeek) { log_debug("SEEK: %lld %d\n", seekOffset, seekWhence); if (seekWhence == SEEK_SET) { posRead = seekOffset; curl_easy_setopt(curl_handle, CURLOPT_RESUME_FROM_LARGE, seekOffset); } else if (seekWhence == SEEK_CUR) { posRead += seekOffset; curl_easy_setopt(curl_handle, CURLOPT_RESUME_FROM_LARGE, posRead); } else { log_error("CurlIOHandler currently does not support SEEK_END\n"); assert(1); } /// \todo should we do that? waitForInitialFillSize = (initialFillSize > 0); doSeek = false; cond->signal(); } AUTOUNLOCK(); res = curl_easy_perform(curl_handle); } while (doSeek); if (res != CURLE_OK) readError = true; else eof = true; cond->signal(); } size_t CurlIOHandler::curlCallback(void *ptr, size_t size, size_t nmemb, void *data) { CurlIOHandler * ego = (CurlIOHandler *) data; size_t wantWrite = size * nmemb; assert(wantWrite <= ego->bufSize); //log_debug("URL: %s; size: %d; nmemb: %d; wantWrite: %d\n", ego->URL.c_str(), size, nmemb, wantWrite); AUTOLOCK(ego->mutex); bool first = true; int bufFree = 0; do { if (ego->doSeek && ! ego->empty && ( ego->seekWhence == SEEK_SET || (ego->seekWhence == SEEK_CUR && ego->seekOffset > 0) ) ) { int currentFillSize = ego->b - ego->a; if (currentFillSize <= 0) currentFillSize += ego->bufSize; int relSeek = ego->seekOffset; if (ego->seekWhence == SEEK_SET) relSeek -= ego->posRead; if (relSeek <= currentFillSize) { // we have everything we need in the buffer already ego->a += relSeek; ego->posRead += relSeek; if (ego->a >= ego->bufSize) ego->a -= ego->bufSize; if (ego->a == ego->b) { ego->empty = true; ego->a = ego->b = 0; } /// \todo do we need to wait for initialFillSize again? ego->doSeek = false; ego->cond->signal(); } } // note: seeking could be optimized some more (backward seeking) // but this should suffice for now if (ego->doSeek) { // seek not been processed yet ego->a = ego->b = 0; ego->empty = true; // terminate this request, because we need a new request // after the seek return 0; } if (! first) { ego->cond->wait(); } else first = false; if (ego->threadShutdown) return 0; if (ego->empty) { ego->a = ego->b = 0; bufFree = ego->bufSize; } else { bufFree = ego->a - ego->b; if (bufFree < 0) bufFree += ego->bufSize; } } while ((size_t)bufFree < wantWrite); size_t maxWrite = (ego->empty ? ego->bufSize : (ego->a < ego->b ? ego->bufSize - ego->b : ego->a - ego->b)); size_t write1 = (wantWrite > maxWrite ? maxWrite : wantWrite); size_t write2 = (write1 < wantWrite ? wantWrite - write1 : 0); size_t bLocal = ego->b; AUTOUNLOCK(); memcpy(ego->buffer + bLocal, ptr, write1); if (write2) memcpy(ego->buffer, (char *)ptr + maxWrite, write2); AUTORELOCK(); //ego->bytesCurl += wantWrite; ego->b += wantWrite; if (ego->b >= ego->bufSize) ego->b -= ego->bufSize; if (ego->empty) { ego->empty = false; ego->cond->signal(); } if (ego->waitForInitialFillSize) { int currentFillSize = ego->b - ego->a; if (currentFillSize <= 0) currentFillSize += ego->bufSize; if ((size_t)currentFillSize >= ego->initialFillSize) { log_debug("buffer: initial fillsize reached\n"); ego->waitForInitialFillSize = false; ego->cond->signal(); } } return wantWrite; } #endif//HAVE_CURL mediatomb-0.12.1/src/web_request_handler.cc0000664000076400007640000002126511352675003015617 00000000000000/*MT* MediaTomb - http://www.mediatomb.cc/ web_request_handler.cc - this file is part of MediaTomb. Copyright (C) 2005 Gena Batyan , Sergey 'Jin' Bostandzhyan Copyright (C) 2006-2010 Gena Batyan , Sergey 'Jin' Bostandzhyan , Leonhard Wimmer MediaTomb is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. MediaTomb is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with MediaTomb; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. $Id: web_request_handler.cc 2081 2010-03-23 20:18:00Z lww $ */ /// \file web_request_handler.cc #ifdef HAVE_CONFIG_H #include "autoconfig.h" #endif #include #include "mem_io_handler.h" #include "web_request_handler.h" #include "config_manager.h" #include "content_manager.h" #include "web/pages.h" #include "tools.h" #include "hash.h" using namespace zmm; using namespace mxml; WebRequestHandler::WebRequestHandler() : RequestHandler() { checkRequestCalled = false; params = Ref(new Dictionary()); } int WebRequestHandler::intParam(String name, int invalid) { String value = param(name); if (!string_ok(value)) return invalid; else return value.toInt(); } bool WebRequestHandler::boolParam(zmm::String name) { String value = param(name); return string_ok(value) && (value == "1" || value == "true"); } void WebRequestHandler::check_request(bool checkLogin) { // we have a minimum set of parameters that are "must have" // check if the session parameter was supplied and if we have // a session with that id checkRequestCalled = true; String sid = param(_("sid")); if (sid == nil) throw SessionException(_("no session id given")); if ((session = SessionManager::getInstance()->getSession(sid)) == nil) throw SessionException(_("invalid session id")); if (checkLogin && ! session->isLoggedIn()) throw LoginException(_("not logged in")); session->access(); } String WebRequestHandler::renderXMLHeader() { return _("\n"; } void WebRequestHandler::get_info(IN const char *filename, OUT struct File_Info *info) { info->file_length = -1; // length is unknown info->last_modified = time(NULL); info->is_directory = 0; info->is_readable = 1; String contentType; String mimetype; String returnType = param(_("return_type")); if (string_ok(returnType) && returnType == "xml") mimetype = _(MIMETYPE_XML); else mimetype = _(MIMETYPE_JSON); contentType = mimetype + "; charset=" + DEFAULT_INTERNAL_CHARSET; info->content_type = ixmlCloneDOMString(contentType.c_str()); info->http_header = ixmlCloneDOMString("Cache-Control: no-cache, must-revalidate"); } Ref WebRequestHandler::open(IN enum UpnpOpenFileMode mode) { root = Ref(new Element(_("root"))); out = Ref(new StringBuffer()); String error = nil; int error_code = 0; String output; // processing page, creating output try { if(!ConfigManager::getInstance()->getBoolOption(CFG_SERVER_UI_ENABLED)) { log_warning("The UI is disabled in the configuration file. See README.\n"); error = _("The UI is disabled in the configuration file. See README."); error_code = 900; } else { process(); if (checkRequestCalled) { // add current task appendTask(root, ContentManager::getInstance()->getCurrentTask()); handleUpdateIDs(); } } } catch (LoginException e) { error = e.getMessage(); error_code = 300; } catch (ObjectNotFoundException e) { error = e.getMessage();; error_code = 200; } catch (SessionException e) { error = e.getMessage(); error_code = 400; } catch (StorageException e) { error = e.getUserMessage(); error_code = 500; e.printStackTrace(); } catch (Exception e) { error = _("Error: ") + e.getMessage(); error_code = 800; e.printStackTrace(); } if (! string_ok(error)) { root->setAttribute(_("success"), _("1"), mxml_bool_type); } else { root->setAttribute(_("success"), _("0"), mxml_bool_type); Ref errorEl(new Element(_("error"))); errorEl->setTextKey(_("text")); errorEl->setText(error); if (error_code == 0) error_code = 899; errorEl->setAttribute(_("code"), String::from(error_code)); root->appendElementChild(errorEl); } String returnType = param(_("return_type")); if (string_ok(returnType) && returnType == "xml") { #ifdef TOMBDEBUG try { // make sure we can generate JSON w/o exceptions XML2JSON::getJSON(root); //log_debug("JSON-----------------------\n\n\n%s\n\n\n\n", XML2JSON::getJSON(root).c_str()); } catch(Exception e) { e.printStackTrace(); } #endif output = renderXMLHeader() + root->print(); } else { try { output = XML2JSON::getJSON(root); } catch(Exception e) { e.printStackTrace(); } } /* try { printf("%s\n", output.c_str()); String json = XML2JSON::getJSON(root); printf("%s\n",json.c_str()); } catch (Exception e) { e.printStackTrace(); } */ //root = nil; Ref io_handler(new MemIOHandler(output)); io_handler->open(mode); return RefCast(io_handler, IOHandler); } Ref WebRequestHandler::open(IN const char *filename, OUT struct File_Info *info, IN enum UpnpOpenFileMode mode) { log_debug("request: %s\n", filename); this->filename = filename; this->mode = mode; String path, parameters; split_url(filename, URL_UI_PARAM_SEPARATOR, path, parameters); params->decode(parameters); get_info(NULL, info); return open(mode); } void WebRequestHandler::handleUpdateIDs() { // session will be filled by check_request String updates = param(_("updates")); if (string_ok(updates)) { Ref updateIDs(new Element(_("update_ids"))); root->appendElementChild(updateIDs); if (updates == "check") { updateIDs->setAttribute(_("pending"), session->hasUIUpdateIDs() ? _("1") : _("0"), mxml_bool_type); } else if (updates == "get") { addUpdateIDs(updateIDs, session); } } } void WebRequestHandler::addUpdateIDs(Ref updateIDsEl, Ref session) { String updateIDs = session->getUIUpdateIDs(); if (string_ok(updateIDs)) { log_debug("UI: sending update ids: %s\n", updateIDs.c_str()); updateIDsEl->setTextKey(_("ids")); updateIDsEl->setText(updateIDs); updateIDsEl->setAttribute(_("updates"), _("1"), mxml_bool_type); } } void WebRequestHandler::appendTask(Ref el, Ref task) { if (task == nil || el == nil) return; Ref taskEl (new Element(_("task"))); taskEl->setAttribute(_("id"), String::from(task->getID()), mxml_int_type); taskEl->setAttribute(_("cancellable"), task->isCancellable() ? _("1") : _("0"), mxml_bool_type); taskEl->setTextKey(_("text")); taskEl->setText(task->getDescription()); el->appendElementChild(taskEl); } String WebRequestHandler::mapAutoscanType(int type) { if (type == 1) return _("ui"); else if (type == 2) return _("persistent"); else return _("none"); } int WebRequestHandler::remapAutoscanType(String type) { if (type == "ui") return 1; else if (type == "persistent") return 2; else return 0; } mediatomb-0.12.1/src/thread_executor.cc0000664000076400007640000000416011352675003014755 00000000000000/*MT* MediaTomb - http://www.mediatomb.cc/ thread_executor.cc - this file is part of MediaTomb. Copyright (C) 2005 Gena Batyan , Sergey 'Jin' Bostandzhyan Copyright (C) 2006-2010 Gena Batyan , Sergey 'Jin' Bostandzhyan , Leonhard Wimmer MediaTomb is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. MediaTomb is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with MediaTomb; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. $Id: thread_executor.cc 2081 2010-03-23 20:18:00Z lww $ */ /// \file thread_executor.cc #ifdef HAVE_CONFIG_H #include "autoconfig.h" #endif #include "thread_executor.h" using namespace zmm; ThreadExecutor::ThreadExecutor() { mutex = Ref(new Mutex()); cond = Ref(new Cond(mutex)); threadShutdown = false; } ThreadExecutor::~ThreadExecutor() { kill(); } void ThreadExecutor::startThread() { threadRunning = true; pthread_create( &thread, NULL, // attr ThreadExecutor::staticThreadProc, this ); } bool ThreadExecutor::kill() { if (! threadRunning) return true; AUTOLOCK(mutex); threadShutdown = true; cond->signal(); AUTOUNLOCK(); if (thread) { threadRunning = false; pthread_join(thread, NULL); } return true; } void *ThreadExecutor::staticThreadProc(void *arg) { ThreadExecutor *inst = (ThreadExecutor *)arg; inst->threadProc(); pthread_exit(NULL); return NULL; } mediatomb-0.12.1/src/metadata/0000775000076400007640000000000011357204746013127 500000000000000mediatomb-0.12.1/src/metadata/id3_handler.h0000664000076400007640000000317711352675002015374 00000000000000/*MT* MediaTomb - http://www.mediatomb.cc/ id3_handler.h - this file is part of MediaTomb. Copyright (C) 2005 Gena Batyan , Sergey 'Jin' Bostandzhyan Copyright (C) 2006-2010 Gena Batyan , Sergey 'Jin' Bostandzhyan , Leonhard Wimmer MediaTomb is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. MediaTomb is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with MediaTomb; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. $Id: id3_handler.h 2081 2010-03-23 20:18:00Z lww $ */ /// \file id3_handler.h /// \brief Definition of the Id3Handler class. #ifndef __METADATA_ID3_H__ #define __METADATA_ID3_H__ #include "metadata_handler.h" /// \brief This class is responsible for reading id3 tags metadata class Id3Handler : public MetadataHandler { public: Id3Handler(); virtual void fillMetadata(zmm::Ref item); virtual zmm::Ref serveContent(zmm::Ref item, int resNum, off_t *data_size); }; #endif // __METADATA_ID3_H__ mediatomb-0.12.1/src/metadata/id3_handler.cc0000664000076400007640000002613211352675002015526 00000000000000/*MT* MediaTomb - http://www.mediatomb.cc/ id3_handler.cc - this file is part of MediaTomb. Copyright (C) 2005 Gena Batyan , Sergey 'Jin' Bostandzhyan Copyright (C) 2006-2010 Gena Batyan , Sergey 'Jin' Bostandzhyan , Leonhard Wimmer MediaTomb is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. MediaTomb is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with MediaTomb; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. $Id: id3_handler.cc 2081 2010-03-23 20:18:00Z lww $ */ /// \file id3_handler.cc /// \brief Implementeation of the Id3Handler class. #ifdef HAVE_CONFIG_H #include "autoconfig.h" #endif #ifdef HAVE_ID3LIB #ifdef HAVE_CONFIG_H #undef HAVE_CONFIG_H // else utils.h from the id3 library tries to import "config.h" #include #include #define HAVE_CONFIG_H #else #include #include #endif #include "id3_handler.h" #include "string_converter.h" #include "common.h" #include "tools.h" #include "mem_io_handler.h" #include "content_manager.h" #include "config_manager.h" using namespace zmm; Id3Handler::Id3Handler() : MetadataHandler() { } char* ID3_GetFrameContent(const ID3_Tag *tag, ID3_FrameID frameID) { char *content = NULL; ID3_Frame *frame = NULL; if (tag != NULL && (frame = tag->Find(frameID)) != NULL) { content = ID3_GetString(frame, ID3FN_TEXT); } return content; } static void addID3Field(metadata_fields_t field, ID3_Tag *tag, Ref item) { String value; char* ID3_retval = NULL; Ref sc = StringConverter::m2i(); size_t genre; #if SIZEOF_SIZE_T > 4 long track; #else int track; #endif switch (field) { case M_TITLE: ID3_retval = ID3_GetTitle(tag); break; case M_ARTIST: ID3_retval = ID3_GetArtist(tag); break; case M_ALBUM: ID3_retval = ID3_GetAlbum(tag); break; case M_DATE: ID3_retval = ID3_GetYear(tag); value = ID3_retval; if (string_ok(value)) value = value + "-01-01"; else return; break; case M_GENRE: genre = ID3_GetGenreNum(tag); if (ID3_V1GENRE2DESCRIPTION(genre)) value = (char *)(ID3_V1GENRE2DESCRIPTION(genre)); if (!string_ok(value)) { ID3_retval = ID3_GetGenre(tag); value = ID3_retval; } break; case M_DESCRIPTION: ID3_retval = ID3_GetComment(tag); break; case M_TRACKNUMBER: track = ID3_GetTrackNum(tag); if (track > 0) { value = String::from(track); item->setTrackNumber((int)track); } else return; break; case M_AUTHOR: ID3_retval = ID3_GetFrameContent(tag, ID3FID_COMPOSER); break; case M_DIRECTOR: ID3_retval = ID3_GetFrameContent(tag, ID3FID_CONDUCTOR); break; // case M_OPUS: // ID3_retval = ID3_GetFrameContent(tag, ID3FID_CONTENTGROUP); // break; default: return; } if ((field != M_GENRE) && (field != M_DATE) && (field != M_TRACKNUMBER)) value = ID3_retval; if (ID3_retval) delete [] ID3_retval; value = trim_string(value); if (string_ok(value)) { item->setMetadata(MT_KEYS[field].upnp, sc->convert(value)); // log_debug("Setting metadata on item: %d, %s\n", field, sc->convert(value).c_str()); } } void Id3Handler::fillMetadata(Ref item) { ID3_Tag tag; const Mp3_Headerinfo* header; Ref > aux; Ref sc = StringConverter::m2i(); // the location has already been checked by the setMetadata function tag.Link(item->getLocation().c_str()); for (int i = 0; i < M_MAX; i++) addID3Field((metadata_fields_t) i, &tag, item); Ref cm = ConfigManager::getInstance(); aux = cm->getStringArrayOption(CFG_IMPORT_LIBOPTS_ID3_AUXDATA_TAGS_LIST); if (aux != nil) { const char *temp = NULL; for (int j = 0; j < aux->size(); j++) { String desiredFrame(aux->get(j)); if (string_ok(desiredFrame)) { ID3_Tag::Iterator* frameIter = tag.CreateIterator(); ID3_Frame* id3Frame = NULL; while (NULL != (id3Frame = frameIter->GetNext())) { String frameName(id3Frame->GetTextID()); if (string_ok(frameName) && (frameName == desiredFrame)) { ID3_Frame::Iterator* fieldIter = id3Frame->CreateIterator(); ID3_Field* id3Field = NULL; while (NULL != (id3Field = fieldIter->GetNext())) { if (id3Field->GetType() == ID3FTY_TEXTSTRING) { temp = id3Field->GetRawText(); if (temp != NULL) { String value(temp); if (string_ok(value)) { value = sc->convert(value); log_debug("Adding frame: %s with value %s\n", desiredFrame.c_str(), value.c_str()); item->setAuxData(desiredFrame, value); } } } } delete fieldIter; } } delete frameIter; } } } header = tag.GetMp3HeaderInfo(); if (header) { int temp; // note: UPnP requres bytes/second if ((header->vbr_bitrate) > 0) { temp = (header->vbr_bitrate) / 8; } else { temp = (header->bitrate) / 8; } if (temp > 0) { item->getResource(0)->addAttribute(MetadataHandler::getResAttrName(R_BITRATE), String::from(temp)); } if ((header->time) > 0) { item->getResource(0)->addAttribute(MetadataHandler::getResAttrName(R_DURATION), secondsToHMS(header->time)); } if ((header->frequency) > 0) { item->getResource(0)->addAttribute(MetadataHandler::getResAttrName(R_SAMPLEFREQUENCY), String::from((int)(header->frequency))); } temp = 0; switch(header->channelmode) { case MP3CHANNELMODE_STEREO: case MP3CHANNELMODE_JOINT_STEREO: case MP3CHANNELMODE_DUAL_CHANNEL: temp = 2; break; case MP3CHANNELMODE_SINGLE_CHANNEL: temp = 1; break; case MP3CHANNELMODE_FALSE: break; } if (temp > 0) { item->getResource(0)->addAttribute(MetadataHandler::getResAttrName(R_NRAUDIOCHANNELS), String::from(temp)); } } #ifdef HAVE_ID3LIB_ALBUMART // get album art // we have a bit of design problem here - the album art is actually not // a resource, but our architecture is built that way that we can only // serve resources, so we are going to bend this a little: // the album art will be saved as a resource, but the CdsResourceManager // will handle this special case and render the XML correctly... // \todo discuss the album art approach with Leo if (ID3_HasPicture(&tag)) { ID3_Frame* frame = NULL; frame = tag.Find(ID3FID_PICTURE); if (frame != NULL) { ID3_Field* art = frame->GetField(ID3FN_DATA); if (art != NULL) { Ref sc = StringConverter::m2i(); String art_mimetype = sc->convert(ID3_GetPictureMimeType(&tag)); if (!string_ok(art_mimetype) || (art_mimetype.index('/') == -1)) { #ifdef HAVE_MAGIC art_mimetype = ContentManager::getInstance()->getMimeTypeFromBuffer((void *)art->GetRawBinary(), art->Size()); if (!string_ok(art_mimetype)) #endif art_mimetype = _(MIMETYPE_DEFAULT); } // if we could not determine the mimetype, then there is no // point to add the resource - it's probably garbage if (art_mimetype != _(MIMETYPE_DEFAULT)) { Ref resource(new CdsResource(CH_ID3)); resource->addAttribute(MetadataHandler::getResAttrName(R_PROTOCOLINFO), renderProtocolInfo(art_mimetype)); resource->addParameter(_(RESOURCE_CONTENT_TYPE), _(ID3_ALBUM_ART)); item->addResource(resource); } } } } #endif tag.Clear(); } Ref Id3Handler::serveContent(Ref item, int resNum, off_t *data_size) { ID3_Tag tag; if (tag.Link(item->getLocation().c_str()) == 0) { throw _Exception(_("Id3Handler: could not open file: ") + item->getLocation()); } Ref res = item->getResource(resNum); String ctype = res->getParameters()->get(_(RESOURCE_CONTENT_TYPE)); if (ctype != ID3_ALBUM_ART) throw _Exception(_("Id3Handler: got unknown content type: ") + ctype); if (!ID3_HasPicture(&tag)) throw _Exception(_("Id3Handler: resource has no album art information")); ID3_Frame* frame = NULL; frame = tag.Find(ID3FID_PICTURE); if (frame == NULL) throw _Exception(_("Id3Handler: could not server album art - empty frame")); ID3_Field* art = frame->GetField(ID3FN_DATA); if (art == NULL) throw _Exception(_("Id3Handler: could not server album art - empty field")); Ref h(new MemIOHandler((void *)art->GetRawBinary(), art->Size())); *data_size = art->Size(); tag.Clear(); return h; } #endif // HAVE_ID3LIB mediatomb-0.12.1/src/metadata/taglib_handler.h0000664000076400007640000000323011352675002016145 00000000000000/*MT* MediaTomb - http://www.mediatomb.cc/ taglib_handler.h - this file is part of MediaTomb. Copyright (C) 2005 Gena Batyan , Sergey 'Jin' Bostandzhyan Copyright (C) 2006-2010 Gena Batyan , Sergey 'Jin' Bostandzhyan , Leonhard Wimmer MediaTomb is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. MediaTomb is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with MediaTomb; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. $Id: taglib_handler.h 2081 2010-03-23 20:18:00Z lww $ */ /// \file taglib_handler.h /// \brief Definition of the TagHandler class. #ifndef __METADATA_TAGLIB_H__ #define __METADATA_TAGLIB_H__ #include "metadata_handler.h" /// \brief This class is responsible for reading id3 or ogg tags metadata class TagHandler : public MetadataHandler { public: TagHandler(); virtual void fillMetadata(zmm::Ref item); virtual zmm::Ref serveContent(zmm::Ref item, int resNum, off_t *data_size); }; #endif // __METADATA_TAGLIB_H__ mediatomb-0.12.1/src/metadata/libexif_handler.h0000664000076400007640000000435411352675002016335 00000000000000/*MT* MediaTomb - http://www.mediatomb.cc/ libexif_handler.h - this file is part of MediaTomb. Copyright (C) 2005 Gena Batyan , Sergey 'Jin' Bostandzhyan Copyright (C) 2006-2010 Gena Batyan , Sergey 'Jin' Bostandzhyan , Leonhard Wimmer MediaTomb is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. MediaTomb is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with MediaTomb; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. $Id: libexif_handler.h 2081 2010-03-23 20:18:00Z lww $ */ /// \file libexif_handler.h /// \brief Definition of the LibExifHandler class. #ifndef __METADATA_LIBEXIF_H__ #define __METADATA_LIBEXIF_H__ #include "metadata_handler.h" #include #include #include "string_converter.h" /// \brief This class is responsible for reading exif header metadata via the /// libefix library class LibExifHandler : public MetadataHandler { protected: // image resolution in pixels // the problem is that I do not know when I encounter the // tags for X and Y, so I have to save the information // and in the very end - when I have both values - add the // appropriate resource zmm::String imageX; zmm::String imageY; void process_ifd (ExifContent *content, zmm::Ref item, zmm::Ref sc, zmm::Ref > auxtags); public: LibExifHandler(); virtual void fillMetadata(zmm::Ref item); virtual zmm::Ref serveContent(zmm::Ref item, int resNum, off_t *data_size); }; #endif // __METADATA_LIBEXIF_H__ mediatomb-0.12.1/src/metadata/libmp4v2_handler.cc0000664000076400007640000002101111352675002016475 00000000000000/*MT* MediaTomb - http://www.mediatomb.cc/ libmp4v2_handler.cc - this file is part of MediaTomb. Copyright (C) 2005 Gena Batyan , Sergey 'Jin' Bostandzhyan Copyright (C) 2006-2010 Gena Batyan , Sergey 'Jin' Bostandzhyan , Leonhard Wimmer MediaTomb is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. MediaTomb is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with MediaTomb; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. $Id: libmp4v2_handler.cc 2081 2010-03-23 20:18:00Z lww $ */ /// \file libmp4v2_handler.cc /// \brief Implementeation of the LibMP4V2Handler class. #ifdef HAVE_CONFIG_H #include "autoconfig.h" #endif #ifdef HAVE_LIBMP4V2 #include "libmp4v2_handler.h" #include "string_converter.h" #include "common.h" #include "tools.h" #include "mem_io_handler.h" #include "content_manager.h" #include "config_manager.h" // why does crap like that alsways happens with some Ubuntu package? #undef PACKAGE #undef PACKAGE_BUGREPORT #undef PACKAGE_NAME #undef PACKAGE_STRING #undef PACKAGE_TARNAME #undef VERSION #undef TRUE #undef FALSE #include LIBMP4V2_INCLUDE using namespace zmm; LibMP4V2Handler::LibMP4V2Handler() : MetadataHandler() { } static void addMetaField(metadata_fields_t field, MP4FileHandle mp4, Ref item) { String value; char* mp4_retval = NULL; u_int16_t track; u_int16_t total_tracks; Ref sc = StringConverter::i2i(); switch (field) { case M_TITLE: MP4GetMetadataName(mp4, &mp4_retval); break; case M_ARTIST: MP4GetMetadataArtist(mp4, &mp4_retval); break; case M_ALBUM: MP4GetMetadataAlbum(mp4, &mp4_retval); break; case M_DATE: MP4GetMetadataYear(mp4, &mp4_retval); if (mp4_retval) { value = mp4_retval; free(mp4_retval); if (string_ok(value)) value = value + "-01-01"; else return; } break; case M_GENRE: MP4GetMetadataGenre(mp4, &mp4_retval); break; case M_DESCRIPTION: MP4GetMetadataComment(mp4, &mp4_retval); break; case M_TRACKNUMBER: MP4GetMetadataTrack(mp4, &track, &total_tracks); if (track > 0) { value = String::from(track); item->setTrackNumber((int)track); } else return; break; default: return; } if ((field != M_DATE) && (field != M_TRACKNUMBER) && (mp4_retval)) { value = mp4_retval; free(mp4_retval); } value = trim_string(value); if (string_ok(value)) { item->setMetadata(MT_KEYS[field].upnp, sc->convert(value)); log_debug("mp4 handler: setting metadata on item: %d, %s\n", field, sc->convert(value).c_str()); } } void LibMP4V2Handler::fillMetadata(Ref item) { MP4FileHandle mp4; // the location has already been checked by the setMetadata function mp4 = MP4Read(item->getLocation().c_str()); if (mp4 == MP4_INVALID_FILE_HANDLE) { log_error("Skipping metadata extraction for file %s\n", item->getLocation().c_str()); return; } try { for (int i = 0; i < M_MAX; i++) addMetaField((metadata_fields_t) i, mp4, item); Ref cm = ConfigManager::getInstance(); // MP4GetTimeScale returns the time scale in units of ticks per // second for the mp4 file. Caveat: tracks may use the same time // scale as the movie or may use their own time scale. u_int32_t timescale = MP4GetTimeScale(mp4); // MP4GetDuration returns the maximum duration of all the tracks in // the specified mp4 file. // // Caveat: the duration is the movie (file) time scale units. MP4Duration duration = MP4GetDuration(mp4); duration = duration / timescale; if (duration > 0) item->getResource(0)->addAttribute(MetadataHandler::getResAttrName(R_DURATION), secondsToHMS(duration)); MP4TrackId tid = MP4FindTrackId(mp4, 0, MP4_AUDIO_TRACK_TYPE); if (tid != MP4_INVALID_TRACK_ID) { #ifdef HAVE_MP4_GET_TRACK_AUDIO_CHANNELS int temp = MP4GetTrackAudioChannels(mp4, tid); if (temp > 0) { item->getResource(0)->addAttribute(MetadataHandler::getResAttrName(R_NRAUDIOCHANNELS), String::from(temp)); timescale = MP4GetTrackTimeScale(mp4, tid); if (timescale > 0) item->getResource(0)->addAttribute(MetadataHandler::getResAttrName(R_SAMPLEFREQUENCY), String::from((unsigned int)timescale)); } #endif // note: UPnP requres bytes/second timescale = MP4GetTrackBitRate(mp4, tid); if (timescale > 0) { timescale = timescale / 8; item->getResource(0)->addAttribute(MetadataHandler::getResAttrName(R_BITRATE), String::from(timescale)); } } #if defined(HAVE_MAGIC) u_int8_t *art_data; u_int32_t art_data_len; String art_mimetype; #ifdef HAVE_MP4_GET_METADATA_COVER_ART_COUNT if (MP4GetMetadataCoverArtCount(mp4) && MP4GetMetadataCoverArt(mp4, &art_data, &art_data_len)) #else MP4GetMetadataCoverArt(mp4, &art_data, &art_data_len); #endif { if (art_data) { try { art_mimetype = ContentManager::getInstance()->getMimeTypeFromBuffer((void *)art_data, art_data_len); if (!string_ok(art_mimetype)) art_mimetype = _(MIMETYPE_DEFAULT); } catch (Exception ex) { free(art_data); throw ex; } free(art_data); if (art_mimetype != _(MIMETYPE_DEFAULT)) { Ref resource(new CdsResource(CH_MP4)); resource->addAttribute(MetadataHandler::getResAttrName(R_PROTOCOLINFO), renderProtocolInfo(art_mimetype)); resource->addParameter(_(RESOURCE_CONTENT_TYPE), _(ID3_ALBUM_ART)); item->addResource(resource); } } } #endif MP4Close(mp4); } catch (Exception ex) { MP4Close(mp4); throw ex; } } Ref LibMP4V2Handler::serveContent(Ref item, int resNum, off_t *data_size) { MP4FileHandle mp4 = MP4Read(item->getLocation().c_str()); if (mp4 == MP4_INVALID_FILE_HANDLE) { throw _Exception(_("LibMP4V2Handler: could not open file: ") + item->getLocation()); } Ref res = item->getResource(resNum); String ctype = res->getParameters()->get(_(RESOURCE_CONTENT_TYPE)); if (ctype != ID3_ALBUM_ART) throw _Exception(_("LibMP4V2Handler: got unknown content type: ") + ctype); #ifdef HAVE_MP4_GET_METADATA_COVER_ART_COUNT if (!MP4GetMetadataCoverArtCount(mp4)) throw _Exception(_("LibMP4V2Handler: resource has no album art information")); #endif u_int8_t *art_data; u_int32_t art_data_len; if (MP4GetMetadataCoverArt(mp4, &art_data, &art_data_len)) { if (art_data) { *data_size = (off_t)art_data_len; Ref h(new MemIOHandler((void *)art_data, art_data_len)); free(art_data); return h; } } throw _Exception(_("LibMP4V2Handler: could not serve album art " "for file") + item->getLocation() + " - embedded image not found"); } #endif // HAVE_LIBMP4V2 mediatomb-0.12.1/src/metadata/exiv2_handler.h0000664000076400007640000000320111352675002015736 00000000000000/*MT* MediaTomb - http://www.mediatomb.cc/ exiv2_handler.h - this file is part of MediaTomb. Copyright (C) 2005 Gena Batyan , Sergey 'Jin' Bostandzhyan Copyright (C) 2006-2010 Gena Batyan , Sergey 'Jin' Bostandzhyan , Leonhard Wimmer MediaTomb is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. MediaTomb is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with MediaTomb; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. $Id: exiv2_handler.h 2081 2010-03-23 20:18:00Z lww $ */ /// \file exiv2_handler.h /// \brief Definition of the Exiv2Handler class. #ifndef __METADATA_EXIV2_H__ #define __METADATA_EXIV2_H__ #include "metadata_handler.h" /// \brief This class is responsible for reading exif header metadata class Exiv2Handler : public MetadataHandler { public: Exiv2Handler(); virtual void fillMetadata(zmm::Ref item); virtual zmm::Ref serveContent(zmm::Ref item, int resNum); }; #endif // __METADATA_EXIV2_H__ mediatomb-0.12.1/src/metadata/dvd_handler.cc0000664000076400007640000001567511352675002015636 00000000000000/*MT* MediaTomb - http://www.mediatomb.cc/ dvd_handler.cc - this file is part of MediaTomb. Copyright (C) 2005 Gena Batyan , Sergey 'Jin' Bostandzhyan Copyright (C) 2006-2010 Gena Batyan , Sergey 'Jin' Bostandzhyan , Leonhard Wimmer MediaTomb is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. MediaTomb is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with MediaTomb; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. $Id: dvd_handler.cc 2081 2010-03-23 20:18:00Z lww $ */ /// \file dvd_handler.cc /// \brief Implementeation of the DVDHandler class. #ifdef HAVE_CONFIG_H #include "autoconfig.h" #endif #ifdef HAVE_LIBDVDNAV #include "dvd_handler.h" #include "string_converter.h" #include "common.h" #include "tools.h" #include "content_manager.h" #include "config_manager.h" #include "dvdnav_read.h" using namespace zmm; #define DVD "dvd" #define DVD_TITLE DVD "t" #define DVD_CHAPTER "ch" #define DVD_AUDIO_TRACK "at" #define DVD_DURATION "d" #define DVD_REST_DURATION "r" #define DVD_FORMAT "f" #define DVD_STREAM_ID "i" #define DVD_COUNT "c" #define DVD_CHANNELS "l" #define DVD_SAMPLE_FREQUENCY "q" #define DVD_LANGUAGE "g" #define DVD_MIMETYPE DVD "m" DVDHandler::DVDHandler() : MetadataHandler() { } String DVDHandler::renderKey(dvd_aux_key_names_t name, int title_idx, int chapter_idx, int audio_track_idx) { String key; switch (name) { case DVD_Title: key = _(DVD_TITLE); break; case DVD_Chapter: key = _(DVD DVD_CHAPTER); break; case DVD_AudioTrack: key = _(DVD DVD_AUDIO_TRACK); break; case DVD_AudioStreamID: key = _(DVD DVD_STREAM_ID); break; case DVD_TitleCount: key = _(DVD_TITLE) + _(DVD_COUNT); break; case DVD_TitleDuration: key = _(DVD_TITLE) + title_idx + _(DVD_DURATION); break; case DVD_ChapterCount: key = _(DVD_TITLE) + title_idx + _(DVD_CHAPTER) + chapter_idx + _(DVD_COUNT); break; case DVD_ChapterDuration: key = _(DVD_TITLE) + title_idx + _(DVD_CHAPTER) + chapter_idx + _(DVD_DURATION); case DVD_ChapterRestDuration: key = _(DVD_TITLE) + title_idx + _(DVD_CHAPTER) + chapter_idx + _(DVD_REST_DURATION); break; case DVD_AudioTrackCount: key = _(DVD_TITLE) + title_idx + _(DVD_AUDIO_TRACK) + _(DVD_COUNT); break; case DVD_AudioTrackFormat: key = _(DVD_TITLE) + title_idx + _(DVD_AUDIO_TRACK) + audio_track_idx + _(DVD_FORMAT); break; case DVD_AudioTrackStreamID: key = _(DVD_TITLE) + title_idx + _(DVD_AUDIO_TRACK) + audio_track_idx + _(DVD_STREAM_ID); break; case DVD_AudioTrackChannels: key = _(DVD_TITLE) + title_idx + _(DVD_AUDIO_TRACK) + audio_track_idx + _(DVD_CHANNELS); break; case DVD_AudioTrackSampleFreq: key = _(DVD_TITLE) + title_idx + _(DVD_AUDIO_TRACK) + audio_track_idx + _(DVD_SAMPLE_FREQUENCY); break; case DVD_AudioTrackLanguage: key = _(DVD_TITLE) + title_idx + _(DVD_AUDIO_TRACK) + audio_track_idx + _(DVD_LANGUAGE); break; default: throw _Exception(_("Invalid dvd aux key name!")); } return key; } void DVDHandler::fillMetadata(Ref item) { try { Ref dvd(new DVDNavReader(item->getLocation())); item->setFlag(OBJECT_FLAG_DVD_IMAGE); int titles = dvd->titleCount(); item->setAuxData(renderKey(DVD_TitleCount), String::from(titles)); for (int i = 0; i < titles; i++) { dvd->selectPGC(i, 0); item->setAuxData(renderKey(DVD_ChapterCount, i), String::from(dvd->chapterCount(i))); // if (dvd->titleDuration() > 0) // item->setAuxData(renderKey(DVD_TitleDuration, i), // secondsToHMS(dvd->titleDuration())); item->setAuxData(renderKey(DVD_AudioTrackCount, i), String::from(dvd->audioTrackCount())); for (int a = 0; a < dvd->audioTrackCount(); a++) { item->setAuxData(renderKey(DVD_AudioTrackFormat, i, 0, a), dvd->audioFormat(a)); item->setAuxData(renderKey(DVD_AudioTrackStreamID, i, 0, a), String::from(dvd->audioStreamID(a))); item->setAuxData(renderKey(DVD_AudioTrackChannels, i, 0, a), String::from(dvd->audioChannels(a))); item->setAuxData(renderKey(DVD_AudioTrackSampleFreq, i, 0, a), String::from(dvd->audioSampleFrequency(a))); item->setAuxData(renderKey(DVD_AudioTrackLanguage, i, 0, a), dvd->audioLanguage(a)); } #if 0 int secs = 0; for (int c = dvd->chapterCount(i)-1; c >= 0; c--) { int chap_secs = dvd->chapterDuration(c); secs = secs + chap_secs; log_debug("Chapter seconds: %d rest seconds: %d\n", chap_secs, secs); if (chap_secs > 0) item->setAuxData(renderKey(DVD_ChapterDuration, i, c), secondsToHMS(chap_secs)); if (secs > 0) item->setAuxData(renderKey(DVD_ChapterRestDuration, i, c), secondsToHMS(secs)); } #endif } // for titles log_debug("DVD image %s has %d titles\n", item->getLocation().c_str(), titles); } catch (Exception ex) { log_warning("Parsing ISO image failed (not a DVD?): %s\n", ex.getMessage().c_str()); } } Ref DVDHandler::serveContent(Ref item, int resNum, off_t *data_size) { *data_size = -1; return nil; } #endif // HAVE_DVD mediatomb-0.12.1/src/metadata/taglib_handler.cc0000664000076400007640000002267411352675002016320 00000000000000/*MT* MediaTomb - http://www.mediatomb.cc/ taglib_handler.cc - this file is part of MediaTomb. Copyright (C) 2005 Gena Batyan , Sergey 'Jin' Bostandzhyan Copyright (C) 2006-2010 Gena Batyan , Sergey 'Jin' Bostandzhyan , Leonhard Wimmer MediaTomb is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. MediaTomb is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with MediaTomb; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. $Id: taglib_handler.cc 2081 2010-03-23 20:18:00Z lww $ */ /// \file taglib_handler.cc /// \brief Implementeation of the TagHandler class. #ifdef HAVE_CONFIG_H #include "autoconfig.h" #endif #ifdef HAVE_TAGLIB #include #include #include #include #include #include #include #include #include #include "taglib_handler.h" #include "string_converter.h" #include "config_manager.h" #include "common.h" #include "tools.h" #include "mem_io_handler.h" #include "content_manager.h" using namespace zmm; TagHandler::TagHandler() : MetadataHandler() { } static void addField(metadata_fields_t field, TagLib::Tag *tag, Ref item) { TagLib::String val; String value; unsigned int i; if (tag == NULL) return; if (tag->isEmpty()) return; Ref sc = StringConverter::i2i(); // sure is sure switch (field) { case M_TITLE: val = tag->title(); break; case M_ARTIST: val = tag->artist(); break; case M_ALBUM: val = tag->album(); break; case M_DATE: i = tag->year(); if (i > 0) { value = String::from(i); if (string_ok(value)) value = value + _("-01-01"); } else return; break; case M_GENRE: val = tag->genre(); break; case M_DESCRIPTION: val = tag->comment(); break; case M_TRACKNUMBER: i = tag->track(); if (i > 0) { value = String::from(i); item->setTrackNumber((int)i); } else return; break; default: return; } if ((field != M_DATE) && (field != M_TRACKNUMBER)) value = val.toCString(true); value = trim_string(value); if (string_ok(value)) { item->setMetadata(MT_KEYS[field].upnp, sc->convert(value)); // log_debug("Setting metadata on item: %d, %s\n", field, sc->convert(value).c_str()); } } void TagHandler::fillMetadata(Ref item) { Ref > aux; Ref sc = StringConverter::i2i(); TagLib::FileRef f(item->getLocation().c_str()); if (f.isNull() || (!f.tag())) return; TagLib::Tag *tag = f.tag(); for (int i = 0; i < M_MAX; i++) addField((metadata_fields_t) i, tag, item); int temp; TagLib::AudioProperties *audioProps = f.audioProperties(); if (audioProps == NULL) return; // note: UPnP requres bytes/second temp = audioProps->bitrate() * 1024 / 8; if (temp > 0) { item->getResource(0)->addAttribute(MetadataHandler::getResAttrName(R_BITRATE), String::from(temp)); } temp = audioProps->length(); if (temp > 0) { item->getResource(0)->addAttribute(MetadataHandler::getResAttrName(R_DURATION), secondsToHMS(temp)); } temp = audioProps->sampleRate(); if (temp > 0) { item->getResource(0)->addAttribute(MetadataHandler::getResAttrName(R_SAMPLEFREQUENCY), String::from(temp)); } temp = audioProps->channels(); if (temp > 0) { item->getResource(0)->addAttribute(MetadataHandler::getResAttrName(R_NRAUDIOCHANNELS), String::from(temp)); } Ref mappings = ConfigManager::getInstance()->getDictionaryOption(CFG_IMPORT_MAPPINGS_MIMETYPE_TO_CONTENTTYPE_LIST); String content_type = mappings->get(item->getMimeType()); // we are done here, album art can only be retrieved from id3v2 if (content_type != CONTENT_TYPE_MP3) return; // did not yet found a way on how to get to the picture from the file // reference that we already have TagLib::MPEG::File mp(item->getLocation().c_str()); if (!mp.isValid() || !mp.ID3v2Tag()) return; //log_debug("Tag contains %i frame(s)\n", mp.ID3v2Tag()->frameListMap().size()); Ref cm = ConfigManager::getInstance(); aux = cm->getStringArrayOption(CFG_IMPORT_LIBOPTS_ID3_AUXDATA_TAGS_LIST); if (aux != nil) { for (int j = 0; j < aux->size(); j++) { String desiredFrame = aux->get(j); if (string_ok(desiredFrame)) { const TagLib::ID3v2::FrameList& allFrames = mp.ID3v2Tag()->frameList(); if (!allFrames.isEmpty()) { TagLib::ID3v2::FrameList::ConstIterator it = allFrames.begin(); for (; it != allFrames.end(); it++) { TagLib::String frameID((*it)->frameID(), TagLib::String::Latin1); //log_debug("Found frame: %s\n", frameID.toCString(true)); TagLib::ID3v2::TextIdentificationFrame *textFrame = dynamic_cast(*it); if (textFrame) { //log_debug("We have a TextIdentificationFrame\n"); if (frameID == desiredFrame.c_str()) { TagLib::String frameContents = textFrame->toString(); //log_debug("We have a match!!!!: %s\n", frameContents.toCString(true)); String value(frameContents.toCString(true), frameContents.size()); value = sc->convert(value); log_debug("Adding frame: %s with value %s\n", desiredFrame.c_str(), value.c_str()); item->setAuxData(desiredFrame, value); } } } } } } } TagLib::ID3v2::FrameList list = mp.ID3v2Tag()->frameList("APIC"); if (!list.isEmpty()) { TagLib::ID3v2::AttachedPictureFrame *art = static_cast(list.front()); if (art->picture().size() < 1) return; String art_mimetype = sc->convert(art->mimeType().toCString(true)); // saw that simply "PNG" was used with some mp3's, so mimetype setting // was probably invalid if (!string_ok(art_mimetype) || (art_mimetype.index('/') == -1)) { #ifdef HAVE_MAGIC art_mimetype = ContentManager::getInstance()->getMimeTypeFromBuffer((void *)art->picture().data(), art->picture().size()); if (!string_ok(art_mimetype)) #endif art_mimetype = _(MIMETYPE_DEFAULT); } // if we could not determine the mimetype, then there is no // point to add the resource - it's probably garbage if (art_mimetype != _(MIMETYPE_DEFAULT)) { Ref resource(new CdsResource(CH_ID3)); resource->addAttribute(MetadataHandler::getResAttrName(R_PROTOCOLINFO), renderProtocolInfo(art_mimetype)); resource->addParameter(_(RESOURCE_CONTENT_TYPE), _(ID3_ALBUM_ART)); item->addResource(resource); } } } Ref TagHandler::serveContent(Ref item, int resNum, off_t *data_size) { // we should only get mp3 files here TagLib::MPEG::File f(item->getLocation().c_str()); if (!f.isValid()) throw _Exception(_("TagHandler: could not open file: ") + item->getLocation()); if (!f.ID3v2Tag()) throw _Exception(_("TagHandler: resource has no album information")); TagLib::ID3v2::FrameList list = f.ID3v2Tag()->frameList("APIC"); if (list.isEmpty()) throw _Exception(_("TagHandler: resource has no album information")); TagLib::ID3v2::AttachedPictureFrame *art = static_cast(list.front()); Ref h(new MemIOHandler((void *)art->picture().data(), art->picture().size())); *data_size = art->picture().size(); return h; } #endif // HAVE_TAGLIB mediatomb-0.12.1/src/metadata/exiv2_handler.cc0000664000076400007640000001060011352675002016075 00000000000000/*MT* MediaTomb - http://www.mediatomb.cc/ exiv2_handler.cc - this file is part of MediaTomb. Copyright (C) 2005 Gena Batyan , Sergey 'Jin' Bostandzhyan Copyright (C) 2006-2010 Gena Batyan , Sergey 'Jin' Bostandzhyan , Leonhard Wimmer MediaTomb is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. MediaTomb is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with MediaTomb; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. $Id: exiv2_handler.cc 2081 2010-03-23 20:18:00Z lww $ */ /// \file exiv2_handler.cc /// \brief Implementeation of the Exiv2Handler class. #ifdef HAVE_CONFIG_H #include "autoconfig.h" #endif #ifdef HAVE_EXIV2 #include #include #include "exiv2_handler.h" #include "string_converter.h" #include "tools.h" using namespace zmm; Exiv2Handler::Exiv2Handler() : MetadataHandler() { } void Exiv2Handler::fillMetadata(Ref item) { Ref sc = StringConverter::m2i(); Exiv2::Image::AutoPtr image = Exiv2::ImageFactory::open(std::string(item->getLocation().c_str())); image->readMetadata(); Exiv2::ExifData &exifData = image->exifData(); // first retrieve jpeg comment String comment = (char *)image->comment().c_str(); if (exifData.empty()) { // no exiv2 record found in image return; } // get date/time Exiv2::ExifData::const_iterator md = exifData.findKey(Exiv2::ExifKey("Exif.Photo.DateTimeOriginal")); if (md != exifData.end()) { /// \todo convert date to ISO 8601 as required in the UPnP spec item->setMetadata(MT_KEYS[M_DATE].upnp, sc->convert((char *)md->toString().c_str())); } // if there was no jpeg coment, look if there is an exiv2 comment // should we override the normal jpeg comment, if there is an exiv2 one? if (!string_ok(comment)) { md = exifData.findKey(Exiv2::ExifKey("Exif.Photo.UserComment")); if (md != exifData.end()) comment = (char *)md->toString().c_str(); } // if the image has no comment, compose something nice out of the exiv information if (!string_ok(comment)) { String cam_model; String flash; String focal_length; md = exifData.findKey(Exiv2::ExifKey("Exif.Image.Model")); if (md != exifData.end()) cam_model = (char *)md->toString().c_str(); md = exifData.findKey(Exiv2::ExifKey("Exif.Photo.Flash")); if (md != exifData.end()) flash = (char *)md->toString().c_str(); md = exifData.findKey(Exiv2::ExifKey("Exif.Photo.FocalLength")); if (md != exifData.end()) { focal_length = (char *)md->toString().c_str(); md = exifData.findKey(Exiv2::ExifKey("Exif.Photo.FocalLengthIn35mmFilm")); if (md != exifData.end()) { focal_length = focal_length + " (35 mm equivalent: " + (char *)md->toString().c_str() + ")"; } } if (string_ok(cam_model)) comment = _("Taken with ") + cam_model; if (string_ok(flash)) { if (string_ok(comment)) comment = comment + ", Flash setting:" + flash; else comment = _("Flash setting: ") + flash; } if (string_ok(focal_length)) { if (string_ok(comment)) comment = comment + ", Focal length: " + focal_length; else comment = _("Focal length: ") + focal_length; } } if (string_ok(comment)) item->setMetadata(MT_KEYS[M_DESCRIPTION].upnp, sc->convert(comment)); } Ref Exiv2Handler::serveContent(Ref item, int resNum) { return nil; } #endif // HAVE_EXIV2 mediatomb-0.12.1/src/metadata/ffmpeg_handler.h0000664000076400007640000000352311352675002016154 00000000000000/*MT* MediaTomb - http://www.mediatomb.cc/ ffmpeg_handler.h - this file is part of MediaTomb. Copyright (C) 2005 Gena Batyan , Sergey 'Jin' Bostandzhyan Copyright (C) 2006-2010 Gena Batyan , Sergey 'Jin' Bostandzhyan , Leonhard Wimmer MediaTomb is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. MediaTomb is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with MediaTomb; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. $Id: ffmpeg_handler.h 2081 2010-03-23 20:18:00Z lww $ */ /* This code was contributed by Copyright (C) 2007 Ingo Preiml */ /// \file ffmpeg_handler.h /// \brief Definition of the FfmpegHandler class - getting metadata via /// ffmpeg library calls. #ifndef __FFMPEG_HANDLER_H__ #define __FFMPEG_HANDLER_H__ #include "metadata_handler.h" /// \brief This class is responsible for reading id3 tags metadata class FfmpegHandler : public MetadataHandler { public: FfmpegHandler(); virtual void fillMetadata(zmm::Ref item); virtual zmm::Ref serveContent(zmm::Ref item, int resNum, off_t *data_size); virtual zmm::String getMimeType(); }; #endif//__FFMPEG_HANDLER_H__ mediatomb-0.12.1/src/metadata/dvd_handler.h0000664000076400007640000000465511352675002015474 00000000000000/*MT* MediaTomb - http://www.mediatomb.cc/ dvd_handler.h - this file is part of MediaTomb. Copyright (C) 2005 Gena Batyan , Sergey 'Jin' Bostandzhyan Copyright (C) 2006-2010 Gena Batyan , Sergey 'Jin' Bostandzhyan , Leonhard Wimmer MediaTomb is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. MediaTomb is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with MediaTomb; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. $Id: dvd_handler.h 2081 2010-03-23 20:18:00Z lww $ */ /// \file dvd_handler.h /// \brief Definition of the DVD class. #ifndef __METADATA_DVD_H__ #define __METADATA_DVD_H__ #include "metadata_handler.h" #define DVD_AUXDATA_TITLE_COUNT "DVD_TITLES" #define DVD_AUXDATA_CHAPTERS "DVD_CHAPTERS" #define DVD_AUXDATA_AUDIO_TRACKS "DVD_AUDIO_TRACKS" typedef enum { DVD_Title, DVD_TitleDuration, DVD_TitleCount, DVD_Chapter, DVD_ChapterCount, DVD_ChapterDuration, DVD_ChapterRestDuration, DVD_AudioStreamID, DVD_AudioTrack, DVD_AudioTrackCount, DVD_AudioTrackFormat, DVD_AudioTrackStreamID, DVD_AudioTrackChannels, DVD_AudioTrackSampleFreq, DVD_AudioTrackLanguage, } dvd_aux_key_names_t; /// \brief This class is responsible for parsing DVDs and DVD ISO images class DVDHandler : public MetadataHandler { public: DVDHandler(); virtual void fillMetadata(zmm::Ref item); virtual zmm::Ref serveContent(zmm::Ref item, int resNum, off_t *data_size); /// \brief Helper function to construct the key names for DVD aux data static zmm::String renderKey(dvd_aux_key_names_t name, int title_idx = 0, int chapter_idx = 0, int audio_track_idx = 0); }; #endif // __METADATA_DVD_H__ mediatomb-0.12.1/src/metadata/libexif_handler.cc0000664000076400007640000004035711352675002016476 00000000000000/*MT* MediaTomb - http://www.mediatomb.cc/ libexif_handler.cc - this file is part of MediaTomb. Copyright (C) 2005 Gena Batyan , Sergey 'Jin' Bostandzhyan Copyright (C) 2006-2010 Gena Batyan , Sergey 'Jin' Bostandzhyan , Leonhard Wimmer MediaTomb is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. MediaTomb is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with MediaTomb; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. $Id: libexif_handler.cc 2081 2010-03-23 20:18:00Z lww $ */ /// \file libexif_handler.cc /// \brief Implementeation of the LibExifHandler class. #ifdef HAVE_CONFIG_H #include "autoconfig.h" #endif #ifdef HAVE_LIBEXIF #include "libexif_handler.h" #include "tools.h" #include "config_manager.h" #include "mem_io_handler.h" using namespace zmm; using namespace mxml; LibExifHandler::LibExifHandler() : MetadataHandler() { } static int getTagFromString(String tag) { if (tag == "EXIF_TAG_INTEROPERABILITY_INDEX") return EXIF_TAG_INTEROPERABILITY_INDEX; if (tag == "EXIF_TAG_INTEROPERABILITY_VERSION") return EXIF_TAG_INTEROPERABILITY_VERSION; if (tag == "EXIF_TAG_IMAGE_WIDTH") return EXIF_TAG_IMAGE_WIDTH; if (tag == "EXIF_TAG_IMAGE_LENGTH") return EXIF_TAG_IMAGE_LENGTH; if (tag == "EXIF_TAG_BITS_PER_SAMPLE") return EXIF_TAG_BITS_PER_SAMPLE; if (tag == "EXIF_TAG_COMPRESSION") return EXIF_TAG_COMPRESSION; if (tag == "EXIF_TAG_PHOTOMETRIC_INTERPRETATION") return EXIF_TAG_PHOTOMETRIC_INTERPRETATION; if (tag == "EXIF_TAG_FILL_ORDER") return EXIF_TAG_FILL_ORDER; if (tag == "EXIF_TAG_DOCUMENT_NAME") return EXIF_TAG_DOCUMENT_NAME; if (tag == "EXIF_TAG_IMAGE_DESCRIPTION") return EXIF_TAG_IMAGE_DESCRIPTION; if (tag == "EXIF_TAG_MAKE") return EXIF_TAG_MAKE; if (tag == "EXIF_TAG_MODEL") return EXIF_TAG_MODEL; if (tag == "EXIF_TAG_STRIP_OFFSETS") return EXIF_TAG_STRIP_OFFSETS; if (tag == "EXIF_TAG_ORIENTATION") return EXIF_TAG_ORIENTATION; if (tag == "EXIF_TAG_SAMPLES_PER_PIXEL") return EXIF_TAG_SAMPLES_PER_PIXEL; if (tag == "EXIF_TAG_ROWS_PER_STRIP") return EXIF_TAG_ROWS_PER_STRIP; if (tag == "EXIF_TAG_STRIP_BYTE_COUNTS") return EXIF_TAG_STRIP_BYTE_COUNTS; if (tag == "EXIF_TAG_X_RESOLUTION") return EXIF_TAG_X_RESOLUTION; if (tag == "EXIF_TAG_Y_RESOLUTION") return EXIF_TAG_Y_RESOLUTION; if (tag == "EXIF_TAG_PLANAR_CONFIGURATION") return EXIF_TAG_PLANAR_CONFIGURATION; if (tag == "EXIF_TAG_RESOLUTION_UNIT") return EXIF_TAG_RESOLUTION_UNIT; if (tag == "EXIF_TAG_TRANSFER_FUNCTION") return EXIF_TAG_TRANSFER_FUNCTION; if (tag == "EXIF_TAG_SOFTWARE") return EXIF_TAG_SOFTWARE; if (tag == "EXIF_TAG_DATE_TIME") return EXIF_TAG_DATE_TIME; if (tag == "EXIF_TAG_ARTIST") return EXIF_TAG_ARTIST; if (tag == "EXIF_TAG_WHITE_POINT") return EXIF_TAG_WHITE_POINT; if (tag == "EXIF_TAG_PRIMARY_CHROMATICITIES") return EXIF_TAG_PRIMARY_CHROMATICITIES; if (tag == "EXIF_TAG_TRANSFER_RANGE") return EXIF_TAG_TRANSFER_RANGE; if (tag == "EXIF_TAG_JPEG_PROC") return EXIF_TAG_JPEG_PROC; if (tag == "EXIF_TAG_JPEG_INTERCHANGE_FORMAT") return EXIF_TAG_JPEG_INTERCHANGE_FORMAT; if (tag == "EXIF_TAG_JPEG_INTERCHANGE_FORMAT_LENGTH") return EXIF_TAG_JPEG_INTERCHANGE_FORMAT_LENGTH; if (tag == "EXIF_TAG_YCBCR_COEFFICIENTS") return EXIF_TAG_YCBCR_COEFFICIENTS; if (tag == "EXIF_TAG_YCBCR_SUB_SAMPLING") return EXIF_TAG_YCBCR_SUB_SAMPLING; if (tag == "EXIF_TAG_YCBCR_POSITIONING") return EXIF_TAG_YCBCR_POSITIONING; if (tag == "EXIF_TAG_REFERENCE_BLACK_WHITE") return EXIF_TAG_REFERENCE_BLACK_WHITE; if (tag == "EXIF_TAG_RELATED_IMAGE_FILE_FORMAT") return EXIF_TAG_RELATED_IMAGE_FILE_FORMAT; if (tag == "EXIF_TAG_RELATED_IMAGE_WIDTH") return EXIF_TAG_RELATED_IMAGE_WIDTH; if (tag == "EXIF_TAG_RELATED_IMAGE_LENGTH") return EXIF_TAG_RELATED_IMAGE_LENGTH; if (tag == "EXIF_TAG_CFA_REPEAT_PATTERN_DIM") return EXIF_TAG_CFA_REPEAT_PATTERN_DIM; if (tag == "EXIF_TAG_CFA_PATTERN") return EXIF_TAG_CFA_PATTERN; if (tag == "EXIF_TAG_BATTERY_LEVEL") return EXIF_TAG_BATTERY_LEVEL; if (tag == "EXIF_TAG_COPYRIGHT") return EXIF_TAG_COPYRIGHT; if (tag == "EXIF_TAG_EXPOSURE_TIME") return EXIF_TAG_EXPOSURE_TIME; if (tag == "EXIF_TAG_FNUMBER") return EXIF_TAG_FNUMBER; if (tag == "EXIF_TAG_IPTC_NAA") return EXIF_TAG_IPTC_NAA; if (tag == "EXIF_TAG_EXIF_IFD_POINTER") return EXIF_TAG_EXIF_IFD_POINTER; if (tag == "EXIF_TAG_INTER_COLOR_PROFILE") return EXIF_TAG_INTER_COLOR_PROFILE; if (tag == "EXIF_TAG_EXPOSURE_PROGRAM") return EXIF_TAG_EXPOSURE_PROGRAM; if (tag == "EXIF_TAG_SPECTRAL_SENSITIVITY") return EXIF_TAG_SPECTRAL_SENSITIVITY; if (tag == "EXIF_TAG_GPS_INFO_IFD_POINTER") return EXIF_TAG_GPS_INFO_IFD_POINTER; if (tag == "EXIF_TAG_ISO_SPEED_RATINGS") return EXIF_TAG_ISO_SPEED_RATINGS; if (tag == "EXIF_TAG_OECF") return EXIF_TAG_OECF; if (tag == "EXIF_TAG_EXIF_VERSION") return EXIF_TAG_EXIF_VERSION; if (tag == "EXIF_TAG_DATE_TIME_ORIGINAL") return EXIF_TAG_DATE_TIME_ORIGINAL; if (tag == "EXIF_TAG_DATE_TIME_DIGITIZED") return EXIF_TAG_DATE_TIME_DIGITIZED; if (tag == "EXIF_TAG_COMPONENTS_CONFIGURATION") return EXIF_TAG_COMPONENTS_CONFIGURATION; if (tag == "EXIF_TAG_COMPRESSED_BITS_PER_PIXEL") return EXIF_TAG_COMPRESSED_BITS_PER_PIXEL; if (tag == "EXIF_TAG_SHUTTER_SPEED_VALUE") return EXIF_TAG_SHUTTER_SPEED_VALUE; if (tag == "EXIF_TAG_APERTURE_VALUE") return EXIF_TAG_APERTURE_VALUE; if (tag == "EXIF_TAG_BRIGHTNESS_VALUE") return EXIF_TAG_BRIGHTNESS_VALUE; if (tag == "EXIF_TAG_EXPOSURE_BIAS_VALUE") return EXIF_TAG_EXPOSURE_BIAS_VALUE; if (tag == "EXIF_TAG_MAX_APERTURE_VALUE") return EXIF_TAG_MAX_APERTURE_VALUE; if (tag == "EXIF_TAG_SUBJECT_DISTANCE") return EXIF_TAG_SUBJECT_DISTANCE; if (tag == "EXIF_TAG_METERING_MODE") return EXIF_TAG_METERING_MODE; if (tag == "EXIF_TAG_LIGHT_SOURCE") return EXIF_TAG_LIGHT_SOURCE; if (tag == "EXIF_TAG_FLASH") return EXIF_TAG_FLASH; if (tag == "EXIF_TAG_FOCAL_LENGTH") return EXIF_TAG_FOCAL_LENGTH; if (tag == "EXIF_TAG_SUBJECT_AREA") return EXIF_TAG_SUBJECT_AREA; if (tag == "EXIF_TAG_MAKER_NOTE") return EXIF_TAG_MAKER_NOTE; if (tag == "EXIF_TAG_USER_COMMENT") return EXIF_TAG_USER_COMMENT; /* if (tag == "EXIF_TAG_SUBSEC_TIME") return EXIF_TAG_SUBSEC_TIME; */ if (tag == "EXIF_TAG_SUB_SEC_TIME_ORIGINAL") return EXIF_TAG_SUB_SEC_TIME_ORIGINAL; if (tag == "EXIF_TAG_SUB_SEC_TIME_DIGITIZED") return EXIF_TAG_SUB_SEC_TIME_DIGITIZED; if (tag == "EXIF_TAG_FLASH_PIX_VERSION") return EXIF_TAG_FLASH_PIX_VERSION; if (tag == "EXIF_TAG_COLOR_SPACE") return EXIF_TAG_COLOR_SPACE; if (tag == "EXIF_TAG_PIXEL_X_DIMENSION") return EXIF_TAG_PIXEL_X_DIMENSION; if (tag == "EXIF_TAG_PIXEL_Y_DIMENSION") return EXIF_TAG_PIXEL_Y_DIMENSION; if (tag == "EXIF_TAG_RELATED_SOUND_FILE") return EXIF_TAG_RELATED_SOUND_FILE; if (tag == "EXIF_TAG_INTEROPERABILITY_IFD_POINTER") return EXIF_TAG_INTEROPERABILITY_IFD_POINTER; if (tag == "EXIF_TAG_FLASH_ENERGY") return EXIF_TAG_FLASH_ENERGY; if (tag == "EXIF_TAG_SPATIAL_FREQUENCY_RESPONSE") return EXIF_TAG_SPATIAL_FREQUENCY_RESPONSE; if (tag == "EXIF_TAG_FOCAL_PLANE_X_RESOLUTION") return EXIF_TAG_FOCAL_PLANE_X_RESOLUTION; if (tag == "EXIF_TAG_FOCAL_PLANE_Y_RESOLUTION") return EXIF_TAG_FOCAL_PLANE_Y_RESOLUTION; if (tag == "EXIF_TAG_FOCAL_PLANE_RESOLUTION_UNIT") return EXIF_TAG_FOCAL_PLANE_RESOLUTION_UNIT; if (tag == "EXIF_TAG_SUBJECT_LOCATION") return EXIF_TAG_SUBJECT_LOCATION; if (tag == "EXIF_TAG_EXPOSURE_INDEX") return EXIF_TAG_EXPOSURE_INDEX; if (tag == "EXIF_TAG_SENSING_METHOD") return EXIF_TAG_SENSING_METHOD; if (tag == "EXIF_TAG_FILE_SOURCE") return EXIF_TAG_FILE_SOURCE; if (tag == "EXIF_TAG_SCENE_TYPE") return EXIF_TAG_SCENE_TYPE; if (tag == "EXIF_TAG_NEW_CFA_PATTERN") return EXIF_TAG_NEW_CFA_PATTERN; if (tag == "EXIF_TAG_CUSTOM_RENDERED") return EXIF_TAG_CUSTOM_RENDERED; if (tag == "EXIF_TAG_EXPOSURE_MODE") return EXIF_TAG_CUSTOM_RENDERED; if (tag == "EXIF_TAG_WHITE_BALANCE") return EXIF_TAG_CUSTOM_RENDERED; if (tag == "EXIF_TAG_DIGITAL_ZOOM_RATIO") return EXIF_TAG_CUSTOM_RENDERED; if (tag == "EXIF_TAG_FOCAL_LENGTH_IN_35MM_FILM") return EXIF_TAG_FOCAL_LENGTH_IN_35MM_FILM; if (tag == "EXIF_TAG_SCENE_CAPTURE_TYPE") return EXIF_TAG_SCENE_CAPTURE_TYPE; if (tag == "EXIF_TAG_GAIN_CONTROL") return EXIF_TAG_GAIN_CONTROL; if (tag == "EXIF_TAG_CONTRAST") return EXIF_TAG_CONTRAST; if (tag == "EXIF_TAG_SATURATION") return EXIF_TAG_SATURATION; if (tag == "EXIF_TAG_SHARPNESS") return EXIF_TAG_SHARPNESS; if (tag == "EXIF_TAG_DEVICE_SETTING_DESCRIPTION") return EXIF_TAG_DEVICE_SETTING_DESCRIPTION; if (tag == "EXIF_TAG_SUBJECT_DISTANCE_RANGE") return EXIF_TAG_DEVICE_SETTING_DESCRIPTION; if (tag == "EXIF_TAG_IMAGE_UNIQUE_ID") return EXIF_TAG_IMAGE_UNIQUE_ID; log_warning("Ignoring unknown libexif tag: %s\n", tag.c_str()); return -1; } #ifdef EXIF_EGV_1 #define exif_egv(arg) exif_entry_get_value(arg) #endif #ifdef EXIF_EGV_3 #define BUFLEN 4096 char exif_entry_buffer[BUFLEN]; #define exif_egv(arg) exif_entry_get_value(arg, exif_entry_buffer, BUFLEN) #endif void LibExifHandler::process_ifd (ExifContent *content, Ref item, Ref sc, Ref > auxtags) { ExifEntry *e; unsigned int i; String value; String tmp; for (i = 0; i < content->count; i++) { e = content->entries[i]; // log_debug("Processing entry: %d\n", i); switch (e->tag) { case EXIF_TAG_DATE_TIME_ORIGINAL: value = (char *)exif_egv(e); value = trim_string(value); if (string_ok(value)) { value = sc->convert(value); //value = split_string(value, ' '); /// \todo convert date to ISO 8601 as required in the UPnP spec // from YYYY:MM:DD to YYYY-MM-DD if (value.length() >= 11) { value = value.substring(0, 4) + "-" + value.substring(5, 2) + "-" + value.substring(8, 2); item->setMetadata(MetadataHandler::getMetaFieldName(M_DATE), value); } } break; case EXIF_TAG_USER_COMMENT: value = (char *)exif_egv(e); value = trim_string(value); if (string_ok(value)) { value = sc->convert(value); item->setMetadata(MetadataHandler::getMetaFieldName(M_DESCRIPTION), value); } break; case EXIF_TAG_PIXEL_X_DIMENSION: value = (char *)exif_egv(e); value = trim_string(value); if (string_ok(value)) { value = sc->convert(value); imageX = value; } break; case EXIF_TAG_PIXEL_Y_DIMENSION: value = (char *)exif_egv(e); value = trim_string(value); if (string_ok(value)) { value = sc->convert(value); imageY = value; } break; default: break; } // if there are any auxilary tags that the user wants - add them if (auxtags != nil) { for (int j = 0; j < auxtags->size(); j++) { tmp = auxtags->get(j); if (string_ok(tmp)) { if (e->tag == getTagFromString(tmp)) { value = (char *)exif_egv(e); value = trim_string(value); if (string_ok(value)) { value = sc->convert(value); item->setAuxData(tmp, value); // log_debug(("Adding tag: %s with value %s\n", tmp.c_str(), value.c_str())); } } } } } } } void LibExifHandler::fillMetadata(Ref item) { ExifData *ed; Ref > aux; Ref sc = StringConverter::m2i(); ed = exif_data_new_from_file(item->getLocation().c_str()); if (!ed) { log_debug("Exif data not found, attempting to set resolution internally...\n"); set_jpeg_resolution_resource(item, 0); return; } Ref cm = ConfigManager::getInstance(); aux = cm->getStringArrayOption(CFG_IMPORT_LIBOPTS_EXIF_AUXDATA_TAGS_LIST); for (int i = 0; i < EXIF_IFD_COUNT; i++) { if (ed->ifd[i]) process_ifd (ed->ifd[i], item, sc, aux); } // we got the image resolution so we can add our resource if (string_ok(imageX) && string_ok(imageY)) { item->getResource(0)->addAttribute(MetadataHandler::getResAttrName(R_RESOLUTION), imageX + "x" + imageY); } else { set_jpeg_resolution_resource(item, 0); } if (ed->size) { try { Ref io_h(new MemIOHandler(ed->data, ed->size)); io_h->open(UPNP_READ); String th_resolution = get_jpeg_resolution(io_h); log_debug("RESOLUTION: %s\n", th_resolution.c_str()); Ref resource(new CdsResource(CH_LIBEXIF)); resource->addAttribute(MetadataHandler::getResAttrName(R_PROTOCOLINFO), renderProtocolInfo(item->getMimeType())); resource->addAttribute(MetadataHandler::getResAttrName(R_RESOLUTION), th_resolution); resource->addParameter(_(RESOURCE_CONTENT_TYPE), _(EXIF_THUMBNAIL)); item->addResource(resource); } catch (Exception e) { e.printStackTrace(); } } // (ed->size) exif_data_unref(ed); } Ref LibExifHandler::serveContent(Ref item, int resNum, off_t *data_size) { ExifData *ed; Ref res = item->getResource(resNum); String ctype = res->getParameters()->get(_(RESOURCE_CONTENT_TYPE)); if (ctype != EXIF_THUMBNAIL) throw _Exception(_("LibExifHandler: got unknown content type: ") + ctype); ed = exif_data_new_from_file(item->getLocation().c_str()); if (!ed) throw _Exception(_("LibExifHandler: resource has no exif information")); if (!(ed->size)) throw _Exception(_("LibExifHandler: resource has no exif thumbnail")); Ref h(new MemIOHandler(ed->data, ed->size)); *data_size = ed->size; exif_data_unref(ed); return h; } #endif // HAVE_LIBEXIF mediatomb-0.12.1/src/metadata/extractor_handler.cc0000664000076400007640000003232411352675002017062 00000000000000/*MT* MediaTomb - http://www.mediatomb.cc/ extractor_handler.cc - this file is part of MediaTomb. Copyright (C) 2005 Gena Batyan , Sergey 'Jin' Bostandzhyan Copyright (C) 2006-2010 Gena Batyan , Sergey 'Jin' Bostandzhyan , Leonhard Wimmer MediaTomb is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. MediaTomb is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with MediaTomb; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. $Id: extractor_handler.cc 2081 2010-03-23 20:18:00Z lww $ */ /// \file extractor_handler.cc /// \brief Implementeation of the ExtractorHandler class. #ifdef HAVE_CONFIG_H #include "autoconfig.h" #endif #ifdef HAVE_LIBEXTRACTOR #include #include "config_manager.h" #include "extractor_handler.h" #include "string_converter.h" #include "common.h" #include "tools.h" #include "rexp.h" #include "mxml/mxml.h" using namespace zmm; using namespace mxml; ExtractorHandler::ExtractorHandler() : MetadataHandler() { } static EXTRACTOR_KeywordType getTagFromString(String tag) { if (tag == "EXTRACTOR_UNKNOWN") return EXTRACTOR_UNKNOWN; if (tag == "EXTRACTOR_FILENAME") return EXTRACTOR_FILENAME; if (tag == "EXTRACTOR_MIMETYPE") return EXTRACTOR_MIMETYPE; if (tag == "EXTRACTOR_TITLE") return EXTRACTOR_TITLE; if (tag == "EXTRACTOR_AUTHOR") return EXTRACTOR_AUTHOR; if (tag == "EXTRACTOR_ARTIST") return EXTRACTOR_ARTIST; if (tag == "EXTRACTOR_DESCRIPTION") return EXTRACTOR_DESCRIPTION; if (tag == "EXTRACTOR_COMMENT") return EXTRACTOR_COMMENT; if (tag == "EXTRACTOR_DATE") return EXTRACTOR_DATE; if (tag == "EXTRACTOR_PUBLISHER") return EXTRACTOR_PUBLISHER; if (tag == "EXTRACTOR_LANGUAGE") return EXTRACTOR_LANGUAGE; if (tag == "EXTRACTOR_ALBUM") return EXTRACTOR_ALBUM; if (tag == "EXTRACTOR_GENRE") return EXTRACTOR_GENRE; if (tag == "EXTRACTOR_LOCATION") return EXTRACTOR_LOCATION; if (tag == "EXTRACTOR_VERSIONNUMBER") return EXTRACTOR_VERSIONNUMBER; if (tag == "EXTRACTOR_ORGANIZATION") return EXTRACTOR_ORGANIZATION; if (tag == "EXTRACTOR_COPYRIGHT") return EXTRACTOR_COPYRIGHT; if (tag == "EXTRACTOR_SUBJECT") return EXTRACTOR_SUBJECT; if (tag == "EXTRACTOR_KEYWORDS") return EXTRACTOR_KEYWORDS; if (tag == "EXTRACTOR_CONTRIBUTOR") return EXTRACTOR_CONTRIBUTOR; if (tag == "EXTRACTOR_RESOURCE_TYPE") return EXTRACTOR_RESOURCE_TYPE; if (tag == "EXTRACTOR_FORMAT") return EXTRACTOR_FORMAT; if (tag == "EXTRACTOR_RESOURCE_IDENTIFIER") return EXTRACTOR_RESOURCE_IDENTIFIER; if (tag == "EXTRACTOR_SOURCE") return EXTRACTOR_SOURCE; if (tag == "EXTRACTOR_RELATION") return EXTRACTOR_RELATION; if (tag == "EXTRACTOR_COVERAGE") return EXTRACTOR_COVERAGE; if (tag == "EXTRACTOR_SOFTWARE") return EXTRACTOR_SOFTWARE; if (tag == "EXTRACTOR_DISCLAIMER") return EXTRACTOR_DISCLAIMER; if (tag == "EXTRACTOR_WARNING") return EXTRACTOR_WARNING; if (tag == "EXTRACTOR_TRANSLATED") return EXTRACTOR_TRANSLATED; if (tag == "EXTRACTOR_CREATION_DATE") return EXTRACTOR_CREATION_DATE; if (tag == "EXTRACTOR_MODIFICATION_DATE") return EXTRACTOR_MODIFICATION_DATE; if (tag == "EXTRACTOR_CREATOR") return EXTRACTOR_CREATOR; if (tag == "EXTRACTOR_PRODUCER") return EXTRACTOR_PRODUCER; if (tag == "EXTRACTOR_PAGE_COUNT") return EXTRACTOR_PAGE_COUNT; if (tag == "EXTRACTOR_PAGE_ORIENTATION") return EXTRACTOR_PAGE_ORIENTATION; if (tag == "EXTRACTOR_PAPER_SIZE") return EXTRACTOR_PAPER_SIZE; if (tag == "EXTRACTOR_USED_FONTS") return EXTRACTOR_USED_FONTS; if (tag == "EXTRACTOR_PAGE_ORDER") return EXTRACTOR_PAGE_ORDER; if (tag == "EXTRACTOR_CREATED_FOR") return EXTRACTOR_CREATED_FOR; if (tag == "EXTRACTOR_MAGNIFICATION") return EXTRACTOR_MAGNIFICATION; if (tag == "EXTRACTOR_RELEASE") return EXTRACTOR_RELEASE; if (tag == "EXTRACTOR_GROUP") return EXTRACTOR_GROUP; if (tag == "EXTRACTOR_SIZE") return EXTRACTOR_SIZE; if (tag == "EXTRACTOR_SUMMARY") return EXTRACTOR_SUMMARY; if (tag == "EXTRACTOR_PACKAGER") return EXTRACTOR_PACKAGER; if (tag == "EXTRACTOR_VENDOR") return EXTRACTOR_VENDOR; if (tag == "EXTRACTOR_LICENSE") return EXTRACTOR_LICENSE; if (tag == "EXTRACTOR_DISTRIBUTION") return EXTRACTOR_DISTRIBUTION; if (tag == "EXTRACTOR_BUILDHOST") return EXTRACTOR_BUILDHOST; if (tag == "EXTRACTOR_OS") return EXTRACTOR_OS; if (tag == "EXTRACTOR_DEPENDENCY") return EXTRACTOR_DEPENDENCY; if (tag == "EXTRACTOR_HASH_MD4") return EXTRACTOR_HASH_MD4; if (tag == "EXTRACTOR_HASH_MD5") return EXTRACTOR_HASH_MD5; if (tag == "EXTRACTOR_HASH_SHA0") return EXTRACTOR_HASH_SHA0; if (tag == "EXTRACTOR_HASH_SHA1") return EXTRACTOR_HASH_SHA1; if (tag == "EXTRACTOR_HASH_RMD160") return EXTRACTOR_HASH_RMD160; if (tag == "EXTRACTOR_RESOLUTION") return EXTRACTOR_RESOLUTION; if (tag == "EXTRACTOR_CATEGORY") return EXTRACTOR_CATEGORY; if (tag == "EXTRACTOR_BOOKTITLE") return EXTRACTOR_BOOKTITLE; if (tag == "EXTRACTOR_PRIORITY") return EXTRACTOR_PRIORITY; if (tag == "EXTRACTOR_CONFLICTS") return EXTRACTOR_CONFLICTS; if (tag == "EXTRACTOR_REPLACES") return EXTRACTOR_REPLACES; if (tag == "EXTRACTOR_PROVIDES") return EXTRACTOR_PROVIDES; if (tag == "EXTRACTOR_CONDUCTOR") return EXTRACTOR_CONDUCTOR; if (tag == "EXTRACTOR_INTERPRET") return EXTRACTOR_INTERPRET; if (tag == "EXTRACTOR_OWNER") return EXTRACTOR_OWNER; if (tag == "EXTRACTOR_LYRICS") return EXTRACTOR_LYRICS; if (tag == "EXTRACTOR_MEDIA_TYPE") return EXTRACTOR_MEDIA_TYPE; if (tag == "EXTRACTOR_CONTACT") return EXTRACTOR_CONTACT; if (tag == "EXTRACTOR_THUMBNAIL_DATA") return EXTRACTOR_THUMBNAIL_DATA; #ifdef EXTRACTOR_GE_0_5_2 if (tag == "EXTRACTOR_PUBLICATION_DATE") return EXTRACTOR_PUBLICATION_DATE; if (tag == "EXTRACTOR_CAMERA_MAKE") return EXTRACTOR_CAMERA_MAKE; if (tag == "EXTRACTOR_CAMERA_MODEL") return EXTRACTOR_CAMERA_MODEL; if (tag == "EXTRACTOR_EXPOSURE") return EXTRACTOR_EXPOSURE; if (tag == "EXTRACTOR_APERTURE") return EXTRACTOR_APERTURE; if (tag == "EXTRACTOR_EXPOSURE_BIAS") return EXTRACTOR_EXPOSURE_BIAS; if (tag == "EXTRACTOR_FLASH") return EXTRACTOR_FLASH; if (tag == "EXTRACTOR_FLASH_BIAS") return EXTRACTOR_FLASH_BIAS; if (tag == "EXTRACTOR_FOCAL_LENGTH") return EXTRACTOR_FOCAL_LENGTH; if (tag == "EXTRACTOR_FOCAL_LENGTH_35MM") return EXTRACTOR_FOCAL_LENGTH_35MM; if (tag == "EXTRACTOR_ISO_SPEED") return EXTRACTOR_ISO_SPEED; if (tag == "EXTRACTOR_EXPOSURE_MODE") return EXTRACTOR_EXPOSURE_MODE; if (tag == "EXTRACTOR_METERING_MODE") return EXTRACTOR_METERING_MODE; if (tag == "EXTRACTOR_MACRO_MODE") return EXTRACTOR_MACRO_MODE; if (tag == "EXTRACTOR_IMAGE_QUALITY") return EXTRACTOR_IMAGE_QUALITY; if (tag == "EXTRACTOR_WHITE_BALANCE") return EXTRACTOR_WHITE_BALANCE; if (tag == "EXTRACTOR_ORIENTATION") return EXTRACTOR_ORIENTATION; #endif // EXTRACTOR_GE_0_5_2 log_warning("Ignoring unknown libextractor tag: %s\n", tag.c_str()); return EXTRACTOR_UNKNOWN; } static void addMetaField(metadata_fields_t field, EXTRACTOR_KeywordList *keywords, Ref item, Ref sc) { String value; const char *temp = NULL; /// \todo check if UTF-8 conversion is needed, may already be in UTF-8 switch (field) { case M_TITLE: temp = EXTRACTOR_extractLast(EXTRACTOR_TITLE, keywords); break; case M_ARTIST: temp = EXTRACTOR_extractLast(EXTRACTOR_ARTIST, keywords); break; case M_ALBUM: temp = EXTRACTOR_extractLast(EXTRACTOR_ALBUM, keywords); break; case M_DATE: temp = EXTRACTOR_extractLast(EXTRACTOR_DATE, keywords); break; case M_GENRE: temp = EXTRACTOR_extractLast(EXTRACTOR_GENRE, keywords); break; case M_DESCRIPTION: temp = EXTRACTOR_extractLast(EXTRACTOR_DESCRIPTION, keywords); if (temp == NULL) temp = EXTRACTOR_extractLast(EXTRACTOR_COMMENT, keywords); break; default: return; } if (temp != NULL) value = temp; value = trim_string(value); if (string_ok(value)) { item->setMetadata(MT_KEYS[field].upnp, sc->convert(value)); // log_debug("Setting metadata on item: %d, %s\n", field, sc->convert(value).c_str()); } } static void addResourceField(resource_attributes_t attr, EXTRACTOR_KeywordList *keywords, Ref item, Ref sc) { String value; const char *temp = NULL; switch (attr) { case R_RESOLUTION: temp = EXTRACTOR_extractLast(EXTRACTOR_SIZE, keywords); break; /* case R_SIZE: temp = EXTRACTOR_extractLast(EXTRACTOR_SIZE, keywords); break; */ default: return; } if (temp != NULL) value = temp; if (string_ok(value)) { item->getResource(0)->addAttribute(MetadataHandler::getResAttrName(attr), value); } } Ref ReAudioFormat; EXTRACTOR_ExtractorList *extractors = NULL; bool load_libraries_failed = false; void ExtractorHandler::fillMetadata(Ref item) { if (load_libraries_failed) return; Ref > aux; Ref sc = StringConverter::i2i(); if (! extractors) { extractors = EXTRACTOR_loadDefaultLibraries(); if (! extractors) load_libraries_failed = true; } EXTRACTOR_KeywordList *keywords = EXTRACTOR_getKeywords(extractors, item->getLocation().c_str()); //EXTRACTOR_printKeywords(stdout, keywords); for (int i = 0; i < M_MAX; i++) addMetaField((metadata_fields_t)i, keywords, item, sc); for (int i = 0; i < R_MAX; i++) addResourceField((resource_attributes_t)i, keywords, item, sc); Ref cm = ConfigManager::getInstance(); aux = cm->getStringArrayOption(CFG_IMPORT_LIBOPTS_EXTRACTOR_AUXDATA_TAGS_LIST); if (aux != nil) { String value; String tmp; const char *temp = NULL; for (int j = 0; j < aux->size(); j++) { tmp = aux->get(j); if (string_ok(tmp)) { temp = EXTRACTOR_extractLast(getTagFromString(tmp), keywords); if (temp != NULL) { value = temp; if (string_ok(value)) { value = sc->convert(value); item->setAuxData(tmp, value); // log_debug(("Adding tag: %s with value %s\n", tmp.c_str(), value.c_str())); } } } } } if (ReAudioFormat == nil) { ReAudioFormat = Ref(new RExp()); // 64 kbps, 44100 hz, 8m30 stereo ReAudioFormat->compile(_("([0-9]+)\\s+kbps,\\s*([0-9]+)\\s+hz,\\s*" "(([0-9]+)h)?([0-9]+)m([0-9]+)\\s(\\S+)"), "i"); } /* temp = EXTRACTOR_extractLast(EXTRACTOR_FORMAT, keywords); log_debug("EXTRACTOR_FORMAT: %s\n", temp); if (temp) { Ref matcher = ReAudioFormat->match((char *)temp); if (matcher != nil) { log_debug(("BR:%s FR:%s H:%s M:%s S:%s TYPE:%s\n", matcher->group(1).c_str(), matcher->group(2).c_str(), matcher->group(4).c_str(), matcher->group(5).c_str(), matcher->group(6).c_str(), matcher->group(7).c_str())); } else { log_debug(("format pattern unmatched!")); } } */ EXTRACTOR_freeKeywords(keywords); // commented out for the sake of efficiency // EXTRACTOR_removeAll(extractors); } Ref ExtractorHandler::serveContent(Ref item, int resNum, off_t *data_size) { *data_size = -1; return nil; } #endif // HAVE_EXTRACTOR mediatomb-0.12.1/src/metadata/libmp4v2_handler.h0000664000076400007640000000324511352675002016350 00000000000000/*MT* MediaTomb - http://www.mediatomb.cc/ libmp4v2_handler.h - this file is part of MediaTomb. Copyright (C) 2005 Gena Batyan , Sergey 'Jin' Bostandzhyan Copyright (C) 2006-2010 Gena Batyan , Sergey 'Jin' Bostandzhyan , Leonhard Wimmer MediaTomb is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. MediaTomb is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with MediaTomb; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. $Id: libmp4v2_handler.h 2081 2010-03-23 20:18:00Z lww $ */ /// \file libmp4v2_handler.h /// \brief Definition of the LibMP4V2 class. #ifndef __METADATA_LIBMP4V2_H__ #define __METADATA_LIBMP4V2_H__ #include "metadata_handler.h" /// \brief This class is responsible for reading id3 tags metadata class LibMP4V2Handler : public MetadataHandler { public: LibMP4V2Handler(); virtual void fillMetadata(zmm::Ref item); virtual zmm::Ref serveContent(zmm::Ref item, int resNum, off_t *data_size); }; #endif // __METADATA_LIBMP4V2_H__ mediatomb-0.12.1/src/metadata/ffmpeg_handler.cc0000664000076400007640000002557711352675002016327 00000000000000/*MT* MediaTomb - http://www.mediatomb.cc/ ffmpeg_handler.cc - this file is part of MediaTomb. Copyright (C) 2005 Gena Batyan , Sergey 'Jin' Bostandzhyan Copyright (C) 2006-2010 Gena Batyan , Sergey 'Jin' Bostandzhyan , Leonhard Wimmer MediaTomb is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. MediaTomb is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with MediaTomb; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. $Id: ffmpeg_handler.cc 2081 2010-03-23 20:18:00Z lww $ */ /* This code was contributed by Copyright (C) 2007 Ingo Preiml */ /// \file ffmpeg_handler.cc /// \brief Implementeation of the FfmpegHandler class. // Information about the stream are to be found in the structure // AVFormatContext, defined in libavformat/avformat.h:335 // and in the structure // AVCodecContext, defined in libavcodec/avcodec.h:722 // in the ffmpeg sources #ifdef HAVE_CONFIG_H #include "autoconfig.h" #endif #ifdef HAVE_FFMPEG // ffmpeg needs the following sources // INT64_C is not defined in ffmpeg/avformat.h but is needed // macro defines included via autoconfig.h #include //#ifdef FFMPEG_NEEDS_EXTERN_C extern "C" { //#endif #include AVFORMAT_INCLUDE //#ifdef FFMPEG_NEEDS_EXTERN_C } // extern "C" //#endif #ifdef HAVE_FFMPEGTHUMBNAILER #include #endif #include "config_manager.h" #include "ffmpeg_handler.h" #include "string_converter.h" #include "common.h" #include "tools.h" #include "rexp.h" //#include "mxml/mxml.h" #include "mem_io_handler.h" using namespace zmm; //using namespace mxml; // Default constructor FfmpegHandler::FfmpegHandler() : MetadataHandler() { } static void addFfmpegMetadataFields(Ref item, AVFormatContext *pFormatCtx) { Ref sc = StringConverter::m2i(); if (strlen(pFormatCtx->title) > 0) { log_debug("Added metadata title: %s\n", pFormatCtx->title); item->setMetadata(MT_KEYS[M_TITLE].upnp, sc->convert(pFormatCtx->title)); } if (strlen(pFormatCtx->author) > 0) { log_debug("Added metadata author: %s\n", pFormatCtx->author); item->setMetadata(MT_KEYS[M_ARTIST].upnp, sc->convert(pFormatCtx->author)); } if (strlen(pFormatCtx->album) > 0) { log_debug("Added metadata album: %s\n", pFormatCtx->album); item->setMetadata(MT_KEYS[M_ALBUM].upnp, sc->convert(pFormatCtx->album)); } if (pFormatCtx->year > 0) { log_debug("Added metadata year: %d\n", pFormatCtx->year); item->setMetadata(MT_KEYS[M_DATE].upnp, sc->convert(String::from(pFormatCtx->year))); } if (strlen(pFormatCtx->genre) > 0) { log_debug("Added metadata genre: %s\n", pFormatCtx->genre); item->setMetadata(MT_KEYS[M_GENRE].upnp, sc->convert(pFormatCtx->genre)); } if (strlen(pFormatCtx->comment) > 0) { log_debug("Added metadata comment: %s\n", pFormatCtx->comment); item->setMetadata(MT_KEYS[M_DESCRIPTION].upnp, sc->convert(pFormatCtx->comment)); } if (pFormatCtx->track > 0) { log_debug("Added metadata track: %d\n", pFormatCtx->track); item->setMetadata(MT_KEYS[M_TRACKNUMBER].upnp, sc->convert(String::from(pFormatCtx->track))); } } // ffmpeg library calls static void addFfmpegResourceFields(Ref item, AVFormatContext *pFormatCtx, int *x, int *y) { unsigned int i; int hours, mins, secs, us; int audioch = 0, samplefreq = 0; bool audioset, videoset; String resolution; char duration[15]; // Initialize the buffers duration[0] = 0; *x = 0; *y = 0; // duration secs = pFormatCtx->duration / AV_TIME_BASE; us = pFormatCtx->duration % AV_TIME_BASE; mins = secs / 60; secs %= 60; hours = mins / 60; mins %= 60; if ((hours + mins + secs) > 0) { sprintf(duration, "%02d:%02d:%02d.%01d", hours, mins, secs, (10 * us) / AV_TIME_BASE); log_debug("Added duration: %s\n", duration); item->getResource(0)->addAttribute(MetadataHandler::getResAttrName(R_DURATION), duration); } // bitrate if (pFormatCtx->bit_rate > 0) { log_debug("Added overall bitrate: %d kb/s\n", pFormatCtx->bit_rate/1000); item->getResource(0)->addAttribute(MetadataHandler::getResAttrName(R_BITRATE), String::from(pFormatCtx->bit_rate/1000)); } // video resolution, audio sampling rate, nr of audio channels audioset = false; videoset = false; for(i=0; inb_streams; i++) { AVStream *st = pFormatCtx->streams[i]; if((st != NULL) && (videoset == false) && (st->codec->codec_type == CODEC_TYPE_VIDEO)) { if (st->codec->codec_tag > 0) { char fourcc[5]; fourcc[0] = st->codec->codec_tag; fourcc[1] = st->codec->codec_tag >> 8; fourcc[2] = st->codec->codec_tag >> 16; fourcc[3] = st->codec->codec_tag >> 24; fourcc[4] = '\0'; log_debug("FourCC: %x = %s\n", st->codec->codec_tag, fourcc); String fcc = fourcc; if (string_ok(fcc)) item->getResource(0)->addOption(_(RESOURCE_OPTION_FOURCC), fcc); } if ((st->codec->width > 0) && (st->codec->height > 0)) { resolution = String::from(st->codec->width) + "x" + String::from(st->codec->height); log_debug("Added resolution: %s pixel\n", resolution.c_str()); item->getResource(0)->addAttribute(MetadataHandler::getResAttrName(R_RESOLUTION), resolution); videoset = true; *x = st->codec->width; *y = st->codec->height; } } if(st->codec->codec_type == CODEC_TYPE_AUDIO) { // Increase number of audiochannels audioch++; // Get the sample rate if ((audioset == false) && (st->codec->sample_rate > 0)) { samplefreq = st->codec->sample_rate; if (samplefreq > 0) { log_debug("Added sample frequency: %d Hz\n", samplefreq); item->getResource(0)->addAttribute(MetadataHandler::getResAttrName(R_SAMPLEFREQUENCY), String::from(samplefreq)); audioset = true; } } } } if (audioch > 0) { log_debug("Added number of audio channels: %d\n", audioch); item->getResource(0)->addAttribute(MetadataHandler::getResAttrName(R_NRAUDIOCHANNELS), String::from(audioch)); } } // addFfmpegResourceFields /*double time_to_double(struct timeval time) { return time.tv_sec + (time.tv_usec / 1000000.0); }*/ // Stub for suppressing ffmpeg error messages during matadata extraction void FfmpegNoOutputStub(void* ptr, int level, const char* fmt, va_list vl) { // do nothing } void FfmpegHandler::fillMetadata(Ref item) { log_debug("Running ffmpeg handler on %s\n", item->getLocation().c_str()); int x = 0; int y = 0; AVFormatContext *pFormatCtx; // Suppress all log messages av_log_set_callback(FfmpegNoOutputStub); // Register all formats and codecs av_register_all(); // Open video file if (av_open_input_file(&pFormatCtx, item->getLocation().c_str(), NULL, 0, NULL) != 0) return; // Couldn't open file // Retrieve stream information if (av_find_stream_info(pFormatCtx) < 0) { av_close_input_file(pFormatCtx); return; // Couldn't find stream information } // Add metadata using ffmpeg library calls addFfmpegMetadataFields(item, pFormatCtx); // Add resources using ffmpeg library calls addFfmpegResourceFields(item, pFormatCtx, &x, &y); // Close the video file av_close_input_file(pFormatCtx); } Ref FfmpegHandler::serveContent(Ref item, int resNum, off_t *data_size) { *data_size = -1; #ifdef HAVE_FFMPEGTHUMBNAILER Ref cfg = ConfigManager::getInstance(); if (!cfg->getBoolOption(CFG_SERVER_EXTOPTS_FFMPEGTHUMBNAILER_ENABLED)) return nil; #ifdef FFMPEGTHUMBNAILER_OLD_API video_thumbnailer *th = create_thumbnailer(); image_data *img = create_image_data(); #else video_thumbnailer *th = video_thumbnailer_create(); image_data *img = video_thumbnailer_create_image_data(); #endif // old api th->seek_percentage = cfg->getIntOption(CFG_SERVER_EXTOPTS_FFMPEGTHUMBNAILER_SEEK_PERCENTAGE); if (cfg->getBoolOption(CFG_SERVER_EXTOPTS_FFMPEGTHUMBNAILER_FILMSTRIP_OVERLAY)) th->overlay_film_strip = 1; else th->overlay_film_strip = 0; th->thumbnail_size = cfg->getIntOption(CFG_SERVER_EXTOPTS_FFMPEGTHUMBNAILER_THUMBSIZE); th->thumbnail_image_quality = cfg->getIntOption(CFG_SERVER_EXTOPTS_FFMPEGTHUMBNAILER_IMAGE_QUALITY); th->thumbnail_image_type = Jpeg; log_debug("Generating thumbnail for file: %s\n", item->getLocation().c_str()); #ifdef FFMPEGTHUMBNAILER_OLD_API if (generate_thumbnail_to_buffer(th, item->getLocation().c_str(), img) != 0) #else if (video_thumbnailer_generate_thumbnail_to_buffer(th, item->getLocation().c_str(), img) != 0) #endif // old api throw _Exception(_("Could not generate thumbnail for ") + item->getLocation()); *data_size = (off_t)img->image_data_size; Ref h(new MemIOHandler((void *)img->image_data_ptr, img->image_data_size)); #ifdef FFMPEGTHUMBNAILER_OLD_API destroy_image_data(img); destroy_thumbnailer(th); #else video_thumbnailer_destroy_image_data(img); video_thumbnailer_destroy(th); #endif// old api return h; #else return nil; #endif } String FfmpegHandler::getMimeType() { Ref cfg = ConfigManager::getInstance(); Ref mappings = cfg->getDictionaryOption(CFG_IMPORT_MAPPINGS_MIMETYPE_TO_CONTENTTYPE_LIST); String thumb_mimetype = mappings->get(_(CONTENT_TYPE_JPG)); if (!string_ok(thumb_mimetype)) thumb_mimetype = _("image/jpeg"); return thumb_mimetype; } #endif // HAVE_FFMPEG mediatomb-0.12.1/src/metadata/extractor_handler.h0000664000076400007640000000337211352675002016725 00000000000000/*MT* MediaTomb - http://www.mediatomb.cc/ extractor_handler.h - this file is part of MediaTomb. Copyright (C) 2005 Gena Batyan , Sergey 'Jin' Bostandzhyan Copyright (C) 2006-2010 Gena Batyan , Sergey 'Jin' Bostandzhyan , Leonhard Wimmer MediaTomb is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. MediaTomb is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with MediaTomb; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. $Id: extractor_handler.h 2081 2010-03-23 20:18:00Z lww $ */ /// \file extractor_handler.h /// \brief Definition of the ExtractorHandler class - getting metadata via /// libextractor. #ifndef __METADATA_EXTRACTOR_H__ #define __METADATA_EXTRACTOR_H__ #include "metadata_handler.h" /// \brief This class is responsible for reading metadata tags via the /// extractor library. class ExtractorHandler : public MetadataHandler { public: ExtractorHandler(); virtual void fillMetadata(zmm::Ref item); virtual zmm::Ref serveContent(zmm::Ref item, int resNum, off_t *data_size); }; #endif // __METADATA_EXTRACTOR_H__ mediatomb-0.12.1/src/tools.cc0000664000076400007640000011765411352675003012745 00000000000000/*MT* MediaTomb - http://www.mediatomb.cc/ tools.cc - this file is part of MediaTomb. Copyright (C) 2005 Gena Batyan , Sergey 'Jin' Bostandzhyan Copyright (C) 2006-2010 Gena Batyan , Sergey 'Jin' Bostandzhyan , Leonhard Wimmer MediaTomb is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. MediaTomb is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with MediaTomb; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. $Id: tools.cc 2081 2010-03-23 20:18:00Z lww $ */ /// \file tools.cc #ifdef HAVE_CONFIG_H #include "autoconfig.h" #endif #include "tools.h" #include #include #include #include #include #include #include #include #include #include #include "config_manager.h" #ifndef SOLARIS #include #else #include #include #include #endif #include "md5/md5.h" #include "file_io_handler.h" #include "metadata_handler.h" #define WHITE_SPACE " \t\r\n" using namespace zmm; static const char *HEX_CHARS = "0123456789abcdef"; Ref > split_string(String str, char sep, bool empty) { Ref > ret(new Array()); char *data = str.c_str(); char *end = data + str.length(); while (data < end) { char *pos = strchr(data, sep); if (pos == NULL) { String part = data; ret->append(part); data = end; } else if (pos == data) { data++; if ((data < end) && empty) ret->append(_("")); } else { String part(data, pos - data); ret->append(part); data = pos + 1; } } return ret; } Ref > split_path(String str) { if (! string_ok(str)) throw _Exception(_("invalid path given to split_path")); Ref > ret(new Array()); int pos = str.rindex(DIR_SEPARATOR); const char *data = str.c_str(); if (pos < 0) throw _Exception(_("relative path given to split_path: ") + str); if (pos == 0) { /* there is only one separator at the beginning "/..." or "/" */ ret->append(_(_DIR_SEPARATOR)); String filename = data + 1; ret->append(filename); } else { String path(data, pos); ret->append(path); String filename = data + pos + 1; ret->append(filename); } return ret; } String trim_string(String str) { if (str == nil) return nil; int i; int start = 0; int end = 0; int len = str.length(); char *buf = str.c_str(); for (i = 0; i < len; i++) { if (! strchr(WHITE_SPACE, buf[i])) { start = i; break; } } if (i >= len) return _(""); for (i = len - 1; i >= start; i--) { if (! strchr(WHITE_SPACE, buf[i])) { end = i + 1; break; } } return str.substring(start, end - start); } bool check_path(String path, bool needDir) { int ret = 0; struct stat statbuf; ret = stat(path.c_str(), &statbuf); if (ret != 0) return false; if ((needDir && (!S_ISDIR(statbuf.st_mode))) || (!needDir && (S_ISDIR(statbuf.st_mode)))) return false; return true; } time_t check_path_ex(String path, bool needDir, bool existenceUnneeded, off_t *filesize) { int ret = 0; struct stat statbuf; if (filesize != NULL) *filesize = 0; ret = stat(path.c_str(), &statbuf); if (ret != 0) { if (existenceUnneeded && (errno == ENOENT)) return 0; throw _Exception(path + " : " + errno + (int)existenceUnneeded+ " x " + mt_strerror(errno)); } if (needDir && (!S_ISDIR(statbuf.st_mode))) throw _Exception(_("Not a directory: ") + path); if (!needDir && (S_ISDIR(statbuf.st_mode))) throw _Exception(_("Not a file: ") + path); if ((filesize != NULL) && S_ISREG(statbuf.st_mode)) *filesize = statbuf.st_size; return statbuf.st_mtime; } bool is_executable(String path, int *err) { int ret = access(path.c_str(), R_OK | X_OK); if (err != NULL) *err = errno; if (ret == 0) return true; else return false; } String find_in_path(String exec) { String PATH = getenv("PATH"); if (!string_ok(PATH)) return nil; Ref st(new StringTokenizer(PATH)); String path = nil; String next; do { if (path == nil) path = st->nextToken(_(":")); next = st->nextToken(_(":")); if (path == nil) break; if ((next != nil) && !next.startsWith(_("/"))) { path = path + _(":") + next; next = nil; } String check = path + _("/") + exec; if (check_path(check)) return check; if (next != nil) path = next; else path = nil; } while (path != nil); return nil; } bool string_ok(String str) { if ((str == nil) || (str == "")) return false; return true; } bool string_ok(Ref str) { if ((str == nil) || (str->length()<=0)) return false; else return true; } void string_ok_ex(String str) { if ((str == nil) || (str == "")) throw _Exception(_("Empty string")); } String http_redirect_to(String ip, String port, String page) { return _(""; } String hex_encode(void *data, int len) { unsigned char *chars; int i; unsigned char hi, lo; Ref buf(new StringBuffer(len * 2)); chars = (unsigned char *)data; for (i = 0; i < len; i++) { unsigned char c = chars[i]; hi = c >> 4; lo = c & 0xF; *buf << HEX_CHARS[hi] << HEX_CHARS[lo]; } return buf->toString(); } String hex_decode_string(String encoded) { char *ptr = encoded.c_str(); int len = encoded.length(); Ref buf(new StringBuffer(len / 2)); for (int i = 0; i < len; i += 2) { const char *chi = strchr(HEX_CHARS, ptr[i]); const char *clo = strchr(HEX_CHARS, ptr[i + 1]); int hi, lo; if (chi) hi = chi - HEX_CHARS; else hi = 0; if (clo) lo = clo - HEX_CHARS; else lo = 0; char ch = (char)(hi << 4 | lo); *buf << ch; } return buf->toString(); } struct randomizer { struct timeval tv; int salt; }; String hex_md5(void *data, int length) { char md5buf[16]; md5_state_t ctx; md5_init(&ctx); md5_append(&ctx, (unsigned char *)data, length); md5_finish(&ctx, (unsigned char *)md5buf); return hex_encode(md5buf, 16); } String hex_string_md5(String str) { return hex_md5(str.c_str(), str.length()); } String generate_random_id() { struct randomizer st; gettimeofday(&st.tv, NULL); st.salt = rand(); return hex_md5(&st, sizeof(st)); } static const char *hex = "0123456789ABCDEF"; String url_escape(String str) { char *data = str.c_str(); int len = str.length(); Ref buf(new StringBuffer(len)); for (int i = 0; i < len; i++) { unsigned char c = (unsigned char)data[i]; if ((c >= '0' && c <= '9') || (c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z') || c == '_' || c == '-') { *buf << (char)c; } else { int hi = c >> 4; int lo = c & 15; *buf << '%' << hex[hi] << hex[lo]; } } return buf->toString(); } String url_unescape(String str) { char *data = str.c_str(); int len = str.length(); Ref buf(new StringBuffer(len)); int i = 0; while (i < len) { char c = data[i++]; if (c == '%') { if (i + 2 > len) break; // avoid buffer overrun char chi = data[i++]; char clo = data[i++]; int hi, lo; const char *pos; pos = strchr(hex, chi); if (!pos) hi = 0; else hi = pos - hex; pos = strchr(hex, clo); if (!pos) lo = 0; else lo = pos - hex; int ascii = (hi << 4) | lo; *buf << (char)ascii; } else if (c == '+') { *buf << ' '; } else { *buf << c; } } return buf->toString(); } String mime_types_to_CSV(Ref > mimeTypes) { Ref buf(new StringBuffer()); for (int i = 0; i < mimeTypes->size(); i++) { if (i > 0) *buf << ","; String mimeType = mimeTypes->get(i); *buf << "http-get:*:" << mimeType << ":*"; } return buf->toString(); } String mt_strerror(int mt_errno) { #ifdef DONT_USE_YET_HAVE_STRERROR_R char *buffer = (char *)MALLOC(512); char *err_str; #ifdef STRERROR_R_CHAR_P err_str = strerror_r(errno, buffer, 512); if (err_str == NULL) err_str = buffer; #else int ret = strerror_r(errno, buffer, 512); if (ret < 0) return _("cannot get error string: error while calling XSI-compliant strerror_r"); err_str = buffer; #endif String errStr(err_str); FREE(buffer); return errStr; #else return strerror(errno); #endif } String read_text_file(String path) { FILE *f = fopen(path.c_str(), "r"); if (!f) { throw _Exception(_("read_text_file: could not open ") + path + " : " + mt_strerror(errno)); } Ref buf(new StringBuffer()); char *buffer = (char *)MALLOC(1024); size_t bytesRead; while((bytesRead = fread(buffer, 1, 1024, f)) > 0) { buf->concat(buffer, bytesRead); } fclose(f); FREE(buffer); return buf->toString(); } void write_text_file(String path, String contents) { int bytesWritten; FILE *f = fopen(path.c_str(), "w"); if (!f) { throw _Exception(_("write_text_file: could not open ") + path + " : " + mt_strerror(errno)); } bytesWritten = fwrite(contents.c_str(), 1, contents.length(), f); if (bytesWritten < contents.length()) { fclose(f); if (bytesWritten >= 0) throw _Exception(_("write_text_file: incomplete write to ") + path + " : "); else throw _Exception(_("write_text_file: error writing to ") + path + " : " + mt_strerror(errno)); } fclose(f); } void copy_file(String from, String to) { FILE *f = fopen(from.c_str(), "r"); if (!f) { throw _Exception(_("copy_file: could not open ") + from + " for read: " + mt_strerror(errno)); } FILE *t = fopen(to.c_str(), "w"); if (!t) { fclose(f); throw _Exception(_("copy_file: could not open ") + to + " for write: " + mt_strerror(errno)); } char *buffer = (char *)MALLOC(1024); size_t bytesRead = 0; size_t bytesWritten = 0; while(bytesRead == bytesWritten && ! feof(f) && ! ferror(f) && ! ferror(t) && (bytesRead = fread(buffer, 1, 1024, f)) > 0) { bytesWritten = fwrite(buffer, 1, bytesRead, t); } FREE(buffer); if (ferror(f) || ferror(t)) { int my_errno = errno; fclose(f); fclose(t); throw _Exception(_("copy_file: error while copying ") + from + " to " + to + ": " + mt_strerror(my_errno)); } fclose(f); fclose(t); } /* sorting */ int StringBaseComparator(void *arg1, void *arg2) { return strcmp(((StringBase *)arg1)->data, ((StringBase *)arg2)->data); } static void quicksort_impl(COMPARABLE *a, int lo0, int hi0, COMPARATOR comparator) { int lo = lo0; int hi = hi0; if (lo >= hi) return; if( lo == hi - 1 ) { // sort a two element list by swapping if necessary // if (a[lo] > a[hi]) if (comparator(a[lo], a[hi]) > 0) { COMPARABLE T = a[lo]; a[lo] = a[hi]; a[hi] = T; } return; } // Pick a pivot and move it out of the way COMPARABLE pivot = a[(lo + hi) / 2]; a[(lo + hi) / 2] = a[hi]; a[hi] = pivot; while( lo < hi ) { /* Search forward from a[lo] until an element is found that is greater than the pivot or lo >= hi */ // while (a[lo] <= pivot && lo < hi) while (comparator(a[lo], pivot) <= 0 && lo < hi) { lo++; } /* Search backward from a[hi] until element is found that is less than the pivot, or lo >= hi */ // while (pivot <= a[hi] && lo < hi ) while (comparator(pivot, a[hi]) <= 0 && lo < hi) { hi--; } /* Swap elements a[lo] and a[hi] */ if( lo < hi ) { COMPARABLE T = a[lo]; a[lo] = a[hi]; a[hi] = T; } } /* Put the median in the "center" of the list */ a[hi0] = a[hi]; a[hi] = pivot; /* * Recursive calls, elements a[lo0] to a[lo-1] are less than or * equal to pivot, elements a[hi+1] to a[hi0] are greater than * pivot. */ quicksort_impl(a, lo0, lo-1, comparator); quicksort_impl(a, hi+1, hi0, comparator); } void quicksort(COMPARABLE *arr, int size, COMPARATOR comparator) { quicksort_impl(arr, 0, size - 1, comparator); } String renderProtocolInfo(String mimetype, String protocol, String extend) { if (string_ok(mimetype) && string_ok(protocol)) { if (string_ok(extend)) return protocol + ":*:" + mimetype + ":" + extend; else return protocol + ":*:" + mimetype + ":*"; } else return _("http-get:*:*:*"); } String getMTFromProtocolInfo(String protocol) { Ref > parts = split_string(protocol, ':'); if (parts->size() > 2) return parts->get(2); else return nil; } String getProtocol(String protocolInfo) { String protocol; int pos = protocolInfo.index(':'); if (pos <= 0) protocol = _("http-get"); else protocol = protocolInfo.substring(0, pos); return protocol; } String secondsToHMS(int seconds) { int h, m, s; s = seconds % 60; seconds /= 60; m = seconds % 60; h = seconds / 60; // XXX:XX:XX char *str = (char *)malloc(10); sprintf(str, "%02d:%02d:%02d", h, m, s); return String::take(str); } int HMSToSeconds(String time) { if (!string_ok(time)) { log_warning("Could not convert time representation to seconds!\n"); return 0; } int hours = 0; int minutes = 0; int seconds = 0; sscanf(time.c_str(), "%d:%d:%d", &hours, &minutes, &seconds); return (hours * 3600) + (minutes * 60) + seconds; } #ifdef HAVE_MAGIC String get_mime_type(magic_set *ms, Ref reMimetype, String file) { if (ms == NULL) return nil; char *mt = (char *)magic_file(ms, file.c_str()); if (mt == NULL) { log_error("magic_file: %s\n", magic_error(ms)); return nil; } String mime_type = mt; Ref matcher = reMimetype->matcher(mime_type, 2); if (matcher->next()) return matcher->group(1); log_warning("filemagic returned invalid mimetype for %s\n%s\n", file.c_str(), mt); return nil; } String get_mime_type_from_buffer(magic_set *ms, Ref reMimetype, void *buffer, size_t length) { if (ms == NULL) return nil; char *mt = (char *)magic_buffer(ms, buffer, length); if (mt == NULL) { log_error("magic_file: %s\n", magic_error(ms)); return nil; } String mime_type = mt; Ref matcher = reMimetype->matcher(mime_type, 2); if (matcher->next()) return matcher->group(1); log_warning("filemagic returned invalid mimetype for the given buffer%s\n", mt); return nil; } #endif void set_jpeg_resolution_resource(Ref item, int res_num) { try { Ref fio_h(new FileIOHandler(item->getLocation())); fio_h->open(UPNP_READ); String resolution = get_jpeg_resolution(fio_h); if (res_num >= item->getResourceCount()) throw _Exception(_("Invalid resource index")); item->getResource(res_num)->addAttribute(MetadataHandler::getResAttrName(R_RESOLUTION), resolution); } catch (Exception e) { e.printStackTrace(); } } bool check_resolution(String resolution, int *x, int *y) { if (x != NULL) *x = 0; if (y != NULL) *y = 0; Ref > parts = split_string(resolution, 'x'); if (parts->size() != 2) return false; if (string_ok(parts->get(0)) && string_ok(parts->get(1))) { int _x = _(parts->get(0)->data).toInt(); int _y = _(parts->get(1)->data).toInt(); if ((_x > 0) && (_y > 0)) { if (x != NULL) *x = _x; if (y != NULL) *y = _y; return true; } } return false; } String escape(String string, char escape_char, char to_escape) { Ref stringBase(new StringBase(string.length() * 2)); char *str = stringBase->data; int len = string.length(); bool possible_more_esc = true; bool possible_more_char = true; int last = 0; do { int next_esc = -1; if (possible_more_esc) { next_esc = string.index(last, escape_char); if (next_esc < 0) possible_more_esc = false; } int next = -1; if (possible_more_char) { next = string.index(last, to_escape); if (next < 0) possible_more_char = false; } if (next < 0 || (next_esc >= 0 && next_esc < next)) { next = next_esc; } if (next < 0) next = len; int cpLen = next - last; if (cpLen > 0) { strncpy(str, string.charPtrAt(last), cpLen); str += cpLen; } if (next < len) { *(str++) = '\\'; *(str++) = string.charAt(next); } last = next; last++; } while (last < len); *str = '\0'; stringBase->len = strlen(stringBase->data); return stringBase->data; } String unescape(String string, char escape) { Ref stringBase(new StringBase(string.length())); char *str = stringBase->data; int len = string.length(); int last = -1; do { int next = string.index(last + 1, escape); if (next < 0) next = len; if (last < 0) last = 0; int cpLen = next - last; if (cpLen > 0) strncpy(str, string.charPtrAt(last), cpLen); str += cpLen; last = next; last++; } while (last < len); *str = '\0'; stringBase->len = strlen(stringBase->data); return String(stringBase); } /* String xml_unescape(String string) { Ref buf(new StringBuffer(string.length())); signed char *ptr = (signed char *)string.c_str(); while (*ptr) { if (*ptr == '&') { if ((*(ptr + 1) == 'l') && (*(ptr + 2) == 't') && (*(ptr + 3) == ';')) { *buf << '<'; ptr = ptr + 3; } else if ((*(ptr + 1) == 'g') && (*(ptr + 2) == 't') && (*(ptr + 3) == ';')) { *buf << '>'; ptr = ptr + 3; } else if ((*(ptr + 1) == 'q') && (*(ptr + 2) == 'u') && (*(ptr + 3) == 'o') && (*(ptr + 4) == 't') && (*(ptr + 5) == ';')) { *buf << '"'; ptr = ptr + 5; } else if (*(ptr + 1) == 'a') { if ((*(ptr + 2) == 'm') && (*(ptr + 3) == 'p') && (*(ptr + 4) == ';')) { *buf << '&'; ptr = ptr + 4; } else if ((*(ptr + 2) == 'p') && (*(ptr + 3) == 'o') && (*(ptr + 4) == 's') && (*(ptr + 5) == ';')) { *buf << '\''; ptr = ptr + 5; } } else *buf << *ptr; } else *buf << *ptr; ptr++; } return buf->toString(); } */ String unescape_amp(String string) { if (string == nil) return nil; Ref stringBase(new StringBase(string.length())); char *str = stringBase->data; int len = string.length(); int last = 0; do { int skip = 0; int next = last - 1; do { next = string.index(next + 1, '&'); if ((next < len) && (string.charAt(next + 1) == 'a') && (string.charAt(next + 2) == 'm') && (string.charAt(next + 3) == 'p') && (string.charAt(next + 4) == ';')) { skip = 4; } } while(next > 0 && skip == 0); if (next < 0) next = len; int cpLen = next - last + 1; strncpy(str, string.charPtrAt(last), cpLen); str += cpLen; last = next + skip + 1; } while (last <= len); stringBase->len = str - stringBase->data - 1; assert(stringBase->len == (int)strlen(stringBase->data)); return String(stringBase); } String fallbackString(String first, String fallback) { if (first==nil) return fallback; return first; } unsigned int stringHash(String str) { unsigned int hash = 5381; unsigned char *data = (unsigned char *)str.c_str(); int c; while ((c = *data++)) hash = ((hash << 5) + hash) ^ c; /* (hash * 33) ^ c */ return hash; } String intArrayToCSV(int *array, int size) { if (size <= 0) return nil; Ref buf(new StringBuffer()); for (int i = 0; i < size; i++) *buf << ',' << array[i]; return buf->toString(1); } void getTimespecNow(struct timespec *ts) { struct timeval tv; int ret = gettimeofday(&tv, NULL); if (ret != 0) throw _Exception(_("gettimeofday failed: ") + mt_strerror(errno)); ts->tv_sec = tv.tv_sec; ts->tv_nsec = tv.tv_usec * 1000; } long getDeltaMillis(struct timespec *first) { struct timespec now; getTimespecNow(&now); return getDeltaMillis(first, &now); } long getDeltaMillis(struct timespec *first, struct timespec *second) { return (second->tv_sec - first->tv_sec) * 1000 + (second->tv_nsec - first->tv_nsec) / 1000000; } void getTimespecAfterMillis(long delta, struct timespec *ret, struct timespec *start) { struct timespec now; if (start == NULL) { getTimespecNow(&now); start = &now; } ret->tv_sec = start->tv_sec + delta / 1000; ret->tv_nsec = (start->tv_nsec + (delta % 1000) * 1000000); if (ret->tv_nsec >= 1000000000) // >= 1 second { ret->tv_sec ++; ret->tv_nsec -= 1000000000; } //log_debug("timespec: sec: %ld, nsec: %ld\n", ret->tv_sec, ret->tv_nsec); } int compareTimespecs(struct timespec *a, struct timespec *b) { if (a->tv_sec < b->tv_sec) return 1; if (a->tv_sec > b->tv_sec) return -1; if (a->tv_nsec < b->tv_nsec) return 1; if (a->tv_nsec > b->tv_nsec) return -1; return 0; } String normalizePath(String path) { log_debug("Normalizing path: %s\n", path.c_str()); int length = path.length(); Ref result(new StringBase(length)); int avarageExpectedSlashes = length/5; if (avarageExpectedSlashes < 3) avarageExpectedSlashes = 3; Ref > separatorLocations(new BaseStack(avarageExpectedSlashes, -1)); char *str = result->data; //int len = string.length(); #ifndef __CYGWIN__ if (path.charAt(0) != DIR_SEPARATOR) #else #error !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! this function is not finished for Cygwin for (int i = 0; i < 20; i++) print_backtrace(); /// \todo this doesn't seem to be correct... if ((!path.length() > 1) && (path.charAt(1) != ':')) #endif throw _Exception(_("Relative paths are not allowed!\n")); int next = 1; do { while (next < length && path.charAt(next) == DIR_SEPARATOR) next++; if (next >= length) break; int next_sep = path.index(next, DIR_SEPARATOR); if (next_sep < 0) next_sep = length; if (next_sep == next + 1 && path.charAt(next) == '.') { // "." - can be ignored } else if (next_sep == next + 2 && next + 1 < length && path.charAt(next) == '.' && path.charAt(next + 1) == '.') { // ".." // go back one part int lastSepLocation = separatorLocations->pop(); if (lastSepLocation < 0) lastSepLocation = 0; str = result->data + lastSepLocation; } else { // normal part separatorLocations->push(str - result->data); *(str++) = DIR_SEPARATOR; int cpLen = next_sep - next; strncpy(str, path.charPtrAt(next), cpLen); str += cpLen; } next = next_sep + 1; } while(next < length); if (str == result->data) *(str++) = DIR_SEPARATOR; *str = 0; result->len = strlen(result->data); return String(result); } String interfaceToIP(String interface) { #if defined(__CYGWIN__) struct hostent *h=NULL; struct sockaddr_in LocalAddr; char *hostname = (char *)MALLOC(256); if (!hostname) return nil; gethostname(hostname, 255); hostname[255] = '\0'; h=gethostbyname(hostname); free(hostname); if (h != NULL) { memcpy(&LocalAddr.sin_addr, h->h_addr_list[0],4); return String(inet_ntoa(LocalAddr.sin_addr)); } return nil; #else struct if_nameindex *iflist = NULL; struct if_nameindex *iflist_free = NULL; struct ifreq if_request; struct sockaddr_in local_address; int local_socket; if (!string_ok(interface)) return nil; local_socket = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP); if (local_socket < 0) { log_error("Could not create local socket: %s\n", mt_strerror(errno).c_str()); return nil; } iflist = iflist_free = if_nameindex(); if (iflist == NULL) { log_error("Could not get interface list: %s\n", mt_strerror(errno).c_str()); close(local_socket); return nil; } while (iflist->if_index || iflist->if_name) { if (interface == iflist->if_name) { strncpy(if_request.ifr_name, iflist->if_name, IF_NAMESIZE); if (ioctl(local_socket, SIOCGIFADDR, &if_request) != 0) { log_error("Could not determine interface address: %s\n", mt_strerror(errno).c_str()); close(local_socket); if_freenameindex(iflist_free); return nil; } memcpy(&local_address, &if_request.ifr_addr, sizeof(if_request.ifr_addr)); String ip = inet_ntoa(local_address.sin_addr); if_freenameindex(iflist_free); close(local_socket); return ip; } iflist++; } close(local_socket); if_freenameindex(iflist_free); return nil; #endif } bool validateYesNo(String value) { if ((value != "yes") && (value != "no")) return false; else return true; } Ref > parseCommandLine(String line, String in, String out) { Ref > params = split_string(line, ' '); if ((in == nil) && (out == nil)) return params; for (int i = 0; i < params->size(); i++) { String param = params->get(i); String newParam = param.replace(_("%in"), in); newParam = newParam.replace(_("%out"), out); if (param != newParam) params->set(newParam, i); } return params; } // The tempName() function is borrowed from gfileutils.c from the glibc package /* gfileutils.c - File utility functions * * Copyright 2000 Red Hat, Inc. * * GLib 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. * * GLib is distributed in the hope that 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 GLib; see the file COPYING.LIB. If not, * write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, * Boston, MA 02111-1307, USA. */ /* * create_temp_file based on the mkstemp implementation from the GNU C library. * Copyright (C) 1991,92,93,94,95,96,97,98,99 Free Software Foundation, Inc. */ // tempName is based on create_temp_file, see (C) above String tempName(String leadPath, char *tmpl) { char *XXXXXX; int count; static const char letters[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"; static const int NLETTERS = sizeof (letters) - 1; long value; struct timeval tv; static int counter = 0; struct stat statbuf; int ret = 0; /* find the last occurrence of "XXXXXX" */ XXXXXX = strstr (tmpl, "XXXXXX"); if (!XXXXXX || strncmp (XXXXXX, "XXXXXX", 6)) { return nil; } /* Get some more or less random data. */ gettimeofday(&tv, NULL); value = (tv.tv_usec ^ tv.tv_sec) + counter++; for (count = 0; count < 100; value += 7777, ++count) { long v = value; /* Fill in the random bits. */ XXXXXX[0] = letters[v % NLETTERS]; v /= NLETTERS; XXXXXX[1] = letters[v % NLETTERS]; v /= NLETTERS; XXXXXX[2] = letters[v % NLETTERS]; v /= NLETTERS; XXXXXX[3] = letters[v % NLETTERS]; v /= NLETTERS; XXXXXX[4] = letters[v % NLETTERS]; v /= NLETTERS; XXXXXX[5] = letters[v % NLETTERS]; String check = leadPath + tmpl; ret = stat(check.c_str(), &statbuf); if (ret != 0) { if ((errno == ENOENT) || (errno == ENOTDIR)) return check; else return nil; } } /* We got out of the loop because we ran out of combinations to try. */ return nil; } bool isTheora(String ogg_filename) { FILE *f; char buffer[7]; f = fopen(ogg_filename.c_str(), "rb"); if (!f) { throw _Exception(_("Error opening ") + ogg_filename + _(" : ") + mt_strerror(errno)); } if (fread(buffer, 1, 4, f) != 4) { fclose(f); throw _Exception(_("Error reading ") + ogg_filename); } if (memcmp(buffer, "OggS", 4) != 0) { fclose(f); return false; } if (fseek(f, 28, SEEK_SET) != 0) { fclose(f); throw _Exception(_("Incomplete file ") + ogg_filename); } if (fread(buffer, 1, 7, f) != 7) { fclose(f); throw _Exception(_("Error reading ") + ogg_filename); } if (memcmp(buffer, "\x80theora", 7) != 0) { fclose(f); return false; } fclose(f); return true; } String get_last_path(String location) { String path; int last_slash = location.rindex(DIR_SEPARATOR); if (last_slash > 0) { path = location.substring(0, last_slash); int slash = path.rindex(DIR_SEPARATOR); if ((slash >= 0) && ((slash + 1) < path.length())) path = path.substring(slash+1); } return path; } ssize_t getValidUTF8CutPosition(zmm::String str, size_t cutpos) { ssize_t pos = -1; size_t len = str.length(); if ((len == 0) || (cutpos > len)) return pos; printf("Character at cut position: %0x\n", (char)str.charAt(cutpos)); printf("Character at cut-1 position: %0x\n", (char)str.charAt(cutpos-1)); printf("Character at cut-2 position: %0x\n", (char)str.charAt(cutpos-2)); printf("Character at cut-3 position: %0x\n", (char)str.charAt(cutpos-3)); // > 0x7f, we are dealing with a non-ascii character if (str.charAt(cutpos) & 0x80) { // check if we are at byte 2 if (((cutpos-1) >= 0) && (((str.charAt(cutpos-1) & 0xc2) == 0xc2) || ((str.charAt(cutpos-1) & 0xe2) == 0xe2) || ((str.charAt(cutpos-1) & 0xf0) == 0xf0))) pos = cutpos - 1; // check if we are at byte 3 else if (((cutpos - 2) >= 0) && (((str.charAt(cutpos-2) & 0xe2) == 0xe2) || ((str.charAt(cutpos-2) & 0xf0) == 0xf0))) pos = cutpos - 2; // we must be at byte 4 then... else if ((cutpos - 3) >= 0) pos = cutpos - 3; } else pos = cutpos; return pos; } #ifdef EXTEND_PROTOCOLINFO String getDLNAtransferHeader(String mimeType, String header) { if (ConfigManager::getInstance()->getBoolOption(CFG_SERVER_EXTEND_PROTOCOLINFO)) { String transfer_parameter; if (mimeType.startsWith(_("image"))) transfer_parameter = _(D_HTTP_TRANSFER_MODE_INTERACTIVE); else if (mimeType.startsWith(_("audio")) || mimeType.startsWith(_("video"))) transfer_parameter = _(D_HTTP_TRANSFER_MODE_STREAMING); if (string_ok(transfer_parameter)) { if (string_ok(header)) header = header + _("\r\n"); header = header + D_HTTP_TRANSFER_MODE_HEADER + transfer_parameter; } } return header; } #endif #ifndef HAVE_FFMPEG String getAVIFourCC(zmm::String avi_filename) { #define FCC_OFFSET 0xbc char *buffer; FILE *f = fopen(avi_filename.c_str(), "rb"); if (!f) throw _Exception(_("could not open file ") + avi_filename + " : " + mt_strerror(errno)); buffer = (char *)MALLOC(FCC_OFFSET+6); if (buffer == NULL) { fclose(f); throw _Exception(_("Out of memory when allocating buffer for file ") + avi_filename); } size_t rb = fread(buffer, 1, FCC_OFFSET+4, f); fclose(f); if (rb != FCC_OFFSET+4) { free(buffer); throw _Exception(_("could not read header of ") + avi_filename + " : " + mt_strerror(errno)); } buffer[FCC_OFFSET+5] = '\0'; if (strncmp(buffer, "RIFF", 4) != 0) { free(buffer); return nil; } if (strncmp(buffer+8, "AVI ", 4) != 0) { free(buffer); return nil; } String fourcc = String(buffer+FCC_OFFSET, 4); free(buffer); if (string_ok(fourcc)) return fourcc; else return nil; } #endif #ifdef TOMBDEBUG void profiling_thread_check(struct profiling_t *data) { if (data->thread != pthread_self()) { log_debug("profiling_..() called from a different thread than profiling_init was called! (init: %d; this: %d) - aborting...\n", data->thread, pthread_self()); print_backtrace(); abort(); return; } } void profiling_start(struct profiling_t *data) { profiling_thread_check(data); if (data->running) { log_debug("profiling_start() called on an already running profile! - aborting...\n"); print_backtrace(); abort(); return; } data->running = true; getTimespecNow(&(data->last_start)); } void profiling_end(struct profiling_t *data) { profiling_thread_check(data); struct timespec now; getTimespecNow(&now); if (! data->running) { log_debug("profiling_end() called on a not-running profile! - aborting...\n"); print_backtrace(); abort(); return; } struct timespec *sum = &(data->sum); struct timespec *last_start = &(data->last_start); sum->tv_sec += now.tv_sec - last_start->tv_sec; //log_debug("!!!!!! adding %d sec\n", now.tv_sec - last_start->tv_sec); if (now.tv_nsec >= last_start->tv_nsec) { sum->tv_nsec += now.tv_nsec - last_start->tv_nsec; //log_debug("adding %ld nsec\n", now.tv_nsec - last_start->tv_nsec); } else { sum->tv_nsec += 1000000000L - last_start->tv_nsec + now.tv_nsec; sum->tv_sec --; } if(sum->tv_nsec >= 1000000000L) { sum->tv_nsec -= 1000000000L; sum->tv_sec ++; } data->running = false; } void profiling_print(struct profiling_t *data) { if (data->running) { log_debug("profiling_print() called on running profile! - aborting...\n"); print_backtrace(); abort(); return; } //log_debug("\n!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\nPROFILING: took %ld sec %ld nsec thread %u\n", data->sum.tv_sec, data->sum.tv_nsec, pthread_self()); log_debug("PROFILING: took %ld sec %ld nsec\n", data->sum.tv_sec, data->sum.tv_nsec); } #endif #ifdef SOPCAST /// \brief int find_local_port(unsigned short range_min, unsigned short range_max) { int fd; int retry_count = 0; int port; struct sockaddr_in server_addr; struct hostent *server; if (range_min > range_max) { log_error("min port range > max port range!\n"); return -1; } do { port = rand () % (range_max - range_min) + range_min; fd = socket(AF_INET, SOCK_STREAM, 0); if (fd < 0) { log_error("could not determine free port: " "error creating socket (%s)\n", mt_strerror(errno).c_str()); return -1; } server = gethostbyname("127.0.0.1"); if (server == NULL) { log_error("could not resolve localhost\n"); close(fd); return -1; } memset(&server_addr, 0, sizeof(server_addr)); server_addr.sin_family = AF_INET; memcpy(&server_addr.sin_addr.s_addr, server->h_addr, server->h_length); server_addr.sin_port = htons(port); if (connect(fd, (struct sockaddr *)&server_addr, sizeof(server_addr)) == -1) { close(fd); return port; } retry_count++; } while (retry_count < USHRT_MAX); log_error("Could not find free port on localhost\n"); return -1; } #endif mediatomb-0.12.1/src/process_executor.h0000664000076400007640000000321111352675003015022 00000000000000/*MT* MediaTomb - http://www.mediatomb.cc/ process_executor.h - this file is part of MediaTomb. Copyright (C) 2005 Gena Batyan , Sergey 'Jin' Bostandzhyan Copyright (C) 2006-2010 Gena Batyan , Sergey 'Jin' Bostandzhyan , Leonhard Wimmer MediaTomb is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. MediaTomb is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with MediaTomb; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. $Id: process_executor.h 2081 2010-03-23 20:18:00Z lww $ */ /// \file process_executor.h #ifndef __PROCESS_EXECUTOR_H__ #define __PROCESS_EXECUTOR_H__ #include "executor.h" class ProcessExecutor : public Executor { public: ProcessExecutor(zmm::String command, zmm::Ref > arglist); virtual bool isAlive(); virtual bool kill(); virtual int getStatus(); virtual ~ProcessExecutor(); protected: pid_t process_id; int exit_status; }; #endif // __PROCESS_EXECUTOR_H__ mediatomb-0.12.1/src/buffered_io_handler.cc0000664000076400007640000001501011352675003015532 00000000000000/*MT* MediaTomb - http://www.mediatomb.cc/ buffered_io_handler.cc - this file is part of MediaTomb. Copyright (C) 2005 Gena Batyan , Sergey 'Jin' Bostandzhyan Copyright (C) 2006-2010 Gena Batyan , Sergey 'Jin' Bostandzhyan , Leonhard Wimmer MediaTomb is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. MediaTomb is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with MediaTomb; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. $Id: buffered_io_handler.cc 2081 2010-03-23 20:18:00Z lww $ */ /// \file buffered_io_handler.cc #ifdef HAVE_CONFIG_H #include "autoconfig.h" #endif #include "buffered_io_handler.h" #include "tools.h" using namespace zmm; BufferedIOHandler::BufferedIOHandler(Ref underlyingHandler, size_t bufSize, size_t maxChunkSize, size_t initialFillSize) : IOHandlerBufferHelper(bufSize, initialFillSize) { if (underlyingHandler == nil) throw _Exception(_("underlyingHandler must not be nil")); if (maxChunkSize <= 0) throw _Exception(_("maxChunkSize must be positive")); this->underlyingHandler = underlyingHandler; this->maxChunkSize = maxChunkSize; // test it first! //seekEnabled = true; } void BufferedIOHandler::open(IN enum UpnpOpenFileMode mode) { // do the open here instead of threadProc() because it may throw an exception underlyingHandler->open(mode); IOHandlerBufferHelper::open(mode); } void BufferedIOHandler::close() { IOHandlerBufferHelper::close(); // do the close here instead of threadProc() because it may throw an exception underlyingHandler->close(); } void BufferedIOHandler::threadProc() { int readBytes; size_t maxWrite; #ifdef TOMBDEBUG struct timespec last_log; bool first_log = true; #endif AUTOLOCK(mutex); do { #ifdef TOMBDEBUG if (first_log || getDeltaMillis(&last_log) > 1000) { if (first_log) first_log = false; getTimespecNow(&last_log); float percentFillLevel = 0; if (! empty) { int currentFillSize = b - a; if (currentFillSize <= 0) currentFillSize += bufSize; percentFillLevel = ((float)currentFillSize / (float)bufSize) * 100; } log_debug("buffer fill level: %3.2f%% (bufSize: %d; a: %d; b: %d)\n", percentFillLevel, bufSize, a, b); } #endif if (empty) a = b = 0; if (doSeek && ! empty && ( seekWhence == SEEK_SET || (seekWhence == SEEK_CUR && seekOffset > 0) ) ) { int currentFillSize = b - a; if (currentFillSize <= 0) currentFillSize += bufSize; int relSeek = seekOffset; if (seekWhence == SEEK_SET) relSeek -= posRead; if (relSeek <= currentFillSize) { // we have everything we need in the buffer already a += relSeek; posRead += relSeek; if (a >= bufSize) a -= bufSize; if (a == b) { empty = true; a = b = 0; } /// \todo do we need to wait for initialFillSize again? doSeek = false; cond->signal(); } } // note: seeking could be optimized some more (backward seeking) // but this should suffice for now if (doSeek) { // seek not been processed yet try { underlyingHandler->seek(seekOffset, seekWhence); empty = true; a = b = 0; } catch (Exception e) { log_error("Error while seeking in buffer: %s\n", e.getMessage().c_str()); e.printStackTrace(); } /// \todo should we do that? waitForInitialFillSize = (initialFillSize > 0); doSeek = false; cond->signal(); } maxWrite = (empty ? bufSize : (a < b ? bufSize - b : a - b)); if (maxWrite == 0) { cond->wait(); } else { AUTOUNLOCK(); size_t chunkSize = (maxChunkSize > maxWrite ? maxWrite : maxChunkSize); readBytes = underlyingHandler->read(buffer + b, chunkSize); AUTORELOCK(); if (readBytes > 0) { b += readBytes; assert(b <= bufSize); if (b == bufSize) b = 0; if (empty) { empty = false; cond->signal(); } if (waitForInitialFillSize) { int currentFillSize = b - a; if (currentFillSize <= 0) currentFillSize += bufSize; if ((size_t)currentFillSize >= initialFillSize) { log_debug("buffer: initial fillsize reached\n"); waitForInitialFillSize = false; cond->signal(); } } } else if (readBytes == CHECK_SOCKET) { checkSocket = true; cond->signal(); } } } while((maxWrite == 0 || readBytes > 0 || readBytes == CHECK_SOCKET) && ! threadShutdown); if (! threadShutdown) { if (readBytes == 0) eof = true; if (readBytes < 0) readError = true; } // ensure that read() doesn't wait for me to fill the buffer cond->signal(); } mediatomb-0.12.1/src/file_request_handler.cc0000664000076400007640000005421611352675003015763 00000000000000/*MT* MediaTomb - http://www.mediatomb.cc/ file_request_handler.cc - this file is part of MediaTomb. Copyright (C) 2005 Gena Batyan , Sergey 'Jin' Bostandzhyan Copyright (C) 2006-2010 Gena Batyan , Sergey 'Jin' Bostandzhyan , Leonhard Wimmer MediaTomb is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. MediaTomb is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with MediaTomb; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. $Id: file_request_handler.cc 2081 2010-03-23 20:18:00Z lww $ */ /// \file file_request_handler.cc #ifdef HAVE_CONFIG_H #include "autoconfig.h" #endif #include "server.h" #include #include #include #include #include #include "common.h" #include "storage.h" #include "cds_objects.h" #include "process.h" #include "update_manager.h" #include "session_manager.h" #include "ixml.h" #include "file_io_handler.h" #include "dictionary.h" #include "file_request_handler.h" #include "metadata_handler.h" #include "tools.h" #include "play_hook.h" #ifdef HAVE_LIBDVDNAV #include "dvd_io_handler.h" #include "fd_io_handler.h" #include "metadata/dvd_handler.h" #include "mpegremux_processor.h" #include "thread_executor.h" #include "io_handler_chainer.h" #endif #ifdef EXTERNAL_TRANSCODING #include "transcoding/transcode_dispatcher.h" #endif using namespace zmm; using namespace mxml; FileRequestHandler::FileRequestHandler() : RequestHandler() { } void FileRequestHandler::get_info(IN const char *filename, OUT struct File_Info *info) { log_debug("start\n"); String mimeType; int objectID; #ifdef EXTERNAL_TRANSCODING String tr_profile; #endif struct stat statbuf; int ret = 0; bool is_srt = false; String parameters = (filename + strlen(LINK_FILE_REQUEST_HANDLER)); Ref dict(new Dictionary()); dict->decodeSimple(parameters); log_debug("full url (filename): %s, parameters: %s\n", filename, parameters.c_str()); String objID = dict->get(_("object_id")); if (objID == nil) { //log_error("object_id not found in url\n"); throw _Exception(_("get_info: object_id not found")); } else objectID = objID.toInt(); //log_debug("got ObjectID: [%s]\n", object_id.c_str()); Ref storage = Storage::getInstance(); Ref obj = storage->loadObject(objectID); int objectType = obj->getObjectType(); if (!IS_CDS_ITEM(objectType)) { throw _Exception(_("requested object is not an item")); } Ref item = RefCast(obj, CdsItem); String path = item->getLocation(); // determining which resource to serve int res_id = 0; String s_res_id = dict->get(_(URL_RESOURCE_ID)); #ifdef EXTERNAL_TRANSCODING if (string_ok(s_res_id) && (s_res_id != _(URL_VALUE_TRANSCODE_NO_RES_ID))) #else if (string_ok(s_res_id)) #endif res_id = s_res_id.toInt(); else res_id = -1; String ext = dict->get(_("ext")); int edot = ext.rindex('.'); if (edot > -1) ext = ext.substring(edot); if ((ext == ".srt") || (ext == ".ssa") || (ext == ".smi") || (ext == ".sub")) { int dot = path.rindex('.'); if (dot > -1) { path = path.substring(0, dot); } path = path + ext; mimeType = _(MIMETYPE_TEXT); // reset resource id res_id = 0; is_srt = true; } ret = stat(path.c_str(), &statbuf); if (ret != 0) { if (is_srt) throw SubtitlesNotFoundException(_("Subtitle file ") + path + " is not available."); else throw _Exception(_("Failed to open ") + path + " - " + strerror(errno)); } if (access(path.c_str(), R_OK) == 0) { info->is_readable = 1; } else { info->is_readable = 0; } String header; log_debug("path: %s\n", path.c_str()); int slash_pos = path.rindex(DIR_SEPARATOR); if (slash_pos >= 0) { if (slash_pos < path.length()-1) { slash_pos++; header = _("Content-Disposition: attachment; filename=\"") + path.substring(slash_pos) + _("\""); } } #ifdef EXTERNAL_TRANSCODING tr_profile = dict->get(_(URL_PARAM_TRANSCODE_PROFILE_NAME)); #endif info->http_header = NULL; // for transcoded resourecs res_id will always be negative log_debug("fetching resource id %d\n", res_id); String rh = dict->get(_(RESOURCE_HANDLER)); if (((res_id > 0) && (res_id < item->getResourceCount())) || ((res_id > 0) && string_ok(rh))) { log_debug("setting content length to unknown\n"); /// \todo we could figure out the content length... info->file_length = -1; int res_handler; if (string_ok(rh)) res_handler = rh.toInt(); else { Ref resource = item->getResource(res_id); res_handler = resource->getHandlerType(); // http-get:*:image/jpeg:* String protocolInfo = item->getResource(res_id)->getAttributes()->get(_("protocolInfo")); if (protocolInfo != nil) { mimeType = getMTFromProtocolInfo(protocolInfo); } } Ref h = MetadataHandler::createHandler(res_handler); if (!string_ok(mimeType)) mimeType = h->getMimeType(); /* Ref io_handler = */ h->serveContent(item, res_id, &(info->file_length)); } else { #ifdef EXTERNAL_TRANSCODING if (!is_srt && string_ok(tr_profile)) { Ref tp = ConfigManager::getInstance()->getTranscodingProfileListOption(CFG_TRANSCODING_PROFILE_LIST)->getByName(tr_profile); if (tp == nil) throw _Exception(_("Transcoding of file ") + path + " but no profile matching the name " + tr_profile + " found"); mimeType = tp->getTargetMimeType(); Ref mappings = ConfigManager::getInstance()->getDictionaryOption(CFG_IMPORT_MAPPINGS_MIMETYPE_TO_CONTENTTYPE_LIST); if (mappings->get(mimeType) == CONTENT_TYPE_PCM) { String freq = item->getResource(0)->getAttribute(MetadataHandler::getResAttrName(R_SAMPLEFREQUENCY)); String nrch = item->getResource(0)->getAttribute(MetadataHandler::getResAttrName(R_NRAUDIOCHANNELS)); if (string_ok(freq)) mimeType = mimeType + _(";rate=") + freq; if (string_ok(nrch)) mimeType = mimeType + _(";channels=") + nrch; } info->file_length = -1; } else #endif #ifdef HAVE_LIBDVDNAV if (!is_srt && item->getFlag(OBJECT_FLAG_DVD_IMAGE)) { String tmp = dict->get(DVDHandler::renderKey(DVD_Title)); if (!string_ok(tmp)) throw _Exception(_("DVD Image requested but title parameter is missing!")); int title = tmp.toInt(); if (title < 0) throw _Exception(_("DVD Image - requested invalid title!")); tmp = dict->get(DVDHandler::renderKey(DVD_Chapter)); if (!string_ok(tmp)) throw _Exception(_("DVD Image requested but chapter parameter is missing!")); int chapter = tmp.toInt(); if (chapter < 0) throw _Exception(_("DVD Image - requested invalid chapter!")); // actually we are retrieving the stream id here tmp = dict->get(DVDHandler::renderKey(DVD_AudioStreamID)); if (!string_ok(tmp)) throw _Exception(_("DVD Image requested but audio track parameter is missing!")); int audio_track = tmp.toInt(); if (audio_track < 0) throw _Exception(_("DVD Image - requested invalid audio stream ID!")); /// \todo make sure we can seek in the streams info->file_length = -1; header = nil; } else #endif { info->file_length = statbuf.st_size; // if we are dealing with a regular file we should add the // Accept-Ranges: bytes header, in order to indicate that we support // seeking if (S_ISREG(statbuf.st_mode)) { if (string_ok(header)) header = header + _("\r\n"); header = header + _("Accept-Ranges: bytes"); /// \todo turned out that we are not always allowed to add this /// header, since chunked encoding may be active and we do not /// know that here } } if (!string_ok(mimeType)) mimeType = item->getMimeType(); //log_debug("sizeof off_t %d, statbuf.st_size %d\n", sizeof(off_t), sizeof(statbuf.st_size)); //log_debug("get_info: file_length: " OFF_T_SPRINTF "\n", statbuf.st_size); } #ifdef EXTEND_PROTOCOLINFO header = getDLNAtransferHeader(mimeType, header); #endif if (string_ok(header)) info->http_header = ixmlCloneDOMString(header.c_str()); info->last_modified = statbuf.st_mtime; info->is_directory = S_ISDIR(statbuf.st_mode); info->content_type = ixmlCloneDOMString(mimeType.c_str()); // log_debug("get_info: Requested %s, ObjectID: %s, Location: %s\n, MimeType: %s\n", // filename, object_id.c_str(), path.c_str(), info->content_type); log_debug("web_get_info(): end\n"); } Ref FileRequestHandler::open(IN const char *filename, OUT struct File_Info *info, IN enum UpnpOpenFileMode mode) { int objectID; String mimeType; int ret; bool is_srt = false; #ifdef EXTERNAL_TRANSCODING String tr_profile; #endif log_debug("start\n"); struct stat statbuf; // Currently we explicitly do not support UPNP_WRITE // due to security reasons. if (mode != UPNP_READ) throw _Exception(_("UPNP_WRITE unsupported")); String url_path, parameters; parameters = (filename + strlen(LINK_FILE_REQUEST_HANDLER)); Ref dict(new Dictionary()); dict->decodeSimple(parameters); log_debug("full url (filename): %s, parameters: %s\n", filename, parameters.c_str()); String objID = dict->get(_("object_id")); if (objID == nil) { throw _Exception(_("object_id not found")); } else objectID = objID.toInt(); log_debug("Opening media file with object id %d\n", objectID); Ref storage = Storage::getInstance(); Ref obj = storage->loadObject(objectID); int objectType = obj->getObjectType(); if (!IS_CDS_ITEM(objectType)) { throw _Exception(_("requested object is not an item")); } // determining which resource to serve int res_id = 0; String s_res_id = dict->get(_(URL_RESOURCE_ID)); #ifdef EXTERNAL_TRANSCODING if (string_ok(s_res_id) && (s_res_id != _(URL_VALUE_TRANSCODE_NO_RES_ID))) #else if (string_ok(s_res_id)) #endif res_id = s_res_id.toInt(); else res_id = -1; // update item info by running action if (IS_CDS_ACTIVE_ITEM(objectType) && (res_id == 0)) // check - if thumbnails, then no action, just show { Ref aitem = RefCast(obj, CdsActiveItem); Ref inputElement = UpnpXML_DIDLRenderObject(obj, true); inputElement->setAttribute(_(XML_DC_NAMESPACE_ATTR), _(XML_DC_NAMESPACE)); inputElement->setAttribute(_(XML_UPNP_NAMESPACE_ATTR), _(XML_UPNP_NAMESPACE)); String action = aitem->getAction(); String input = inputElement->print(); String output; log_debug("Script input: %s\n", input.c_str()); if(strncmp(action.c_str(), "http://", 7)) { #ifdef TOMBDEBUG struct timespec before; getTimespecNow(&before); #endif output = run_simple_process(action, _("run"), input); #ifdef TOMBDEBUG long delta = getDeltaMillis(&before); log_debug("script executed in %ld milliseconds\n", delta); #endif } else { /// \todo actually fetch... log_debug("fetching %s\n", action.c_str()); output = input; } log_debug("Script output: %s\n", output.c_str()); Ref clone = CdsObject::createObject(objectType); aitem->copyTo(clone); UpnpXML_DIDLUpdateObject(clone, output); if (! aitem->equals(clone, true)) // check for all differences { Ref um = UpdateManager::getInstance(); Ref sm = SessionManager::getInstance(); log_debug("Item changed, updating database\n"); int containerChanged = INVALID_OBJECT_ID; storage->updateObject(clone, &containerChanged); um->containerChanged(containerChanged); sm->containerChangedUI(containerChanged); if (! aitem->equals(clone)) // check for visible differences { log_debug("Item changed visually, updating parent\n"); um->containerChanged(clone->getParentID(), FLUSH_ASAP); } obj = clone; } else { log_debug("Item untouched...\n"); } } Ref item = RefCast(obj, CdsItem); String path = item->getLocation(); String ext = dict->get(_("ext")); int edot = ext.rindex('.'); if (edot > -1) ext = ext.substring(edot); if ((ext == ".srt") || (ext == ".ssa") || (ext == ".smi") || (ext == ".sub")) { int dot = path.rindex('.'); if (dot > -1) { path = path.substring(0, dot); } path = path + ext; mimeType = _(MIMETYPE_TEXT); // reset resource id res_id = 0; is_srt = true; } ret = stat(path.c_str(), &statbuf); if (ret != 0) { if (is_srt) throw SubtitlesNotFoundException(_("Subtitle file ") + path + " is not available."); else throw _Exception(_("Failed to open ") + path + " - " + strerror(errno)); } if (access(path.c_str(), R_OK) == 0) { info->is_readable = 1; } else { info->is_readable = 0; } String header; info->last_modified = statbuf.st_mtime; info->is_directory = S_ISDIR(statbuf.st_mode); log_debug("path: %s\n", path.c_str()); int slash_pos = path.rindex(DIR_SEPARATOR); if (slash_pos >= 0) { if (slash_pos < path.length()-1) { slash_pos++; header = _("Content-Disposition: attachment; filename=\"") + path.substring(slash_pos) + _("\""); } } log_debug("fetching resource id %d\n", res_id); #ifdef EXTERNAL_TRANSCODING tr_profile = dict->get(_(URL_PARAM_TRANSCODE_PROFILE_NAME)); if (string_ok(tr_profile)) { if (res_id != (-1)) throw _Exception(_("Invalid resource ID given!")); } else { if (res_id == -1) throw _Exception(_("Invalid resource ID given!")); } #endif info->http_header = NULL; // Per default and in case of a bad resource ID, serve the file // itself // some resources are created dynamically and not saved in the database, // so we can not load such a resource for a particular item, we will have // to trust the resource handler parameter String rh = dict->get(_(RESOURCE_HANDLER)); if (((res_id > 0) && (res_id < item->getResourceCount())) || ((res_id > 0) && string_ok(rh))) { info->file_length = -1; int res_handler; if (string_ok(rh)) res_handler = rh.toInt(); else { Ref resource = item->getResource(res_id); res_handler = resource->getHandlerType(); // http-get:*:image/jpeg:* String protocolInfo = item->getResource(res_id)->getAttributes()->get(_("protocolInfo")); if (protocolInfo != nil) { mimeType = getMTFromProtocolInfo(protocolInfo); } } Ref h = MetadataHandler::createHandler(res_handler); if (!string_ok(mimeType)) mimeType = h->getMimeType(); #ifdef EXTEND_PROTOCOLINFO header = getDLNAtransferHeader(mimeType, header); #endif if (string_ok(header)) info->http_header = ixmlCloneDOMString(header.c_str()); info->content_type = ixmlCloneDOMString(mimeType.c_str()); Ref io_handler = h->serveContent(item, res_id, &(info->file_length)); io_handler->open(mode); return io_handler; } else { #ifdef EXTERNAL_TRANSCODING if (!is_srt && string_ok(tr_profile)) { Ref tr_d(new TranscodeDispatcher()); Ref tp = ConfigManager::getInstance()->getTranscodingProfileListOption(CFG_TRANSCODING_PROFILE_LIST)->getByName(tr_profile); return tr_d->open(tp, path, RefCast(item, CdsObject), info); } else #endif #ifdef HAVE_LIBDVDNAV if (!is_srt && item->getFlag(OBJECT_FLAG_DVD_IMAGE)) { String tmp = dict->get(DVDHandler::renderKey(DVD_Title)); if (!string_ok(tmp)) throw _Exception(_("DVD Image requested but title parameter is missing!")); int title = tmp.toInt(); if (title < 0) throw _Exception(_("DVD Image - requested invalid title!")); tmp = dict->get(DVDHandler::renderKey(DVD_Chapter)); if (!string_ok(tmp)) throw _Exception(_("DVD Image requested but chapter parameter is missing!")); int chapter = tmp.toInt(); if (chapter < 0) throw _Exception(_("DVD Image - requested invalid chapter!")); // actually we are retrieving the audio stream id here tmp = dict->get(DVDHandler::renderKey(DVD_AudioStreamID)); if (!string_ok(tmp)) throw _Exception(_("DVD Image requested but audio track parameter is missing!")); int audio_track = tmp.toInt(); if (audio_track < 0) throw _Exception(_("DVD Image - requested invalid audio stream ID!")); /// \todo make sure we can seek in the streams info->file_length = -1; info->force_chunked = 1; header = nil; if (mimeType == nil) mimeType = item->getMimeType(); info->content_type = ixmlCloneDOMString(mimeType.c_str()); log_debug("Serving dvd image %s Title: %d Chapter: %d\n", path.c_str(), title, chapter); /// \todo add angle support Ref dvd_io_handler(new DVDIOHandler(path, title, chapter, audio_track)); int from_dvd_fd[2]; if (pipe(from_dvd_fd) == -1) throw _Exception(_("Failed to create DVD input pipe!")); int from_remux_fd[2]; if (pipe(from_remux_fd) == -1) { close(from_dvd_fd[0]); close(from_dvd_fd[1]); throw _Exception(_("Failed to create remux output pipe!")); } Ref fd_writer(new FDIOHandler(from_dvd_fd[1])); Ref from_dvd(new IOHandlerChainer(dvd_io_handler, fd_writer, 16384)); Ref fd_reader(new FDIOHandler(from_remux_fd[0])); fd_reader->open(mode); Ref remux(new MPEGRemuxProcessor(from_dvd_fd[0], from_remux_fd[1], (unsigned char)audio_track)); RefCast(fd_reader, FDIOHandler)->addReference(RefCast(remux, Object)); RefCast(fd_reader, FDIOHandler)->addReference(RefCast(from_dvd, Object)); RefCast(fd_reader, FDIOHandler)->addReference(RefCast(fd_writer, Object)); RefCast(fd_reader, FDIOHandler)->closeOther(fd_writer); PlayHook::getInstance()->trigger(obj); return fd_reader; } else #endif { if (mimeType == nil) mimeType = item->getMimeType(); info->file_length = statbuf.st_size; info->content_type = ixmlCloneDOMString(mimeType.c_str()); log_debug("Adding content disposition header: %s\n", header.c_str()); // if we are dealing with a regular file we should add the // Accept-Ranges: bytes header, in order to indicate that we support // seeking if (S_ISREG(statbuf.st_mode)) { if (string_ok(header)) header = header + _("\r\n"); header = header + _("Accept-Ranges: bytes"); } #ifdef EXTEND_PROTOCOLINFO header = getDLNAtransferHeader(mimeType, header); #endif if (string_ok(header)) info->http_header = ixmlCloneDOMString(header.c_str()); Ref io_handler(new FileIOHandler(path)); io_handler->open(mode); PlayHook::getInstance()->trigger(obj); return io_handler; } } } mediatomb-0.12.1/src/server.cc0000664000076400007640000003555411352675003013111 00000000000000/*MT* MediaTomb - http://www.mediatomb.cc/ server.cc - this file is part of MediaTomb. Copyright (C) 2005 Gena Batyan , Sergey 'Jin' Bostandzhyan Copyright (C) 2006-2010 Gena Batyan , Sergey 'Jin' Bostandzhyan , Leonhard Wimmer MediaTomb is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. MediaTomb is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with MediaTomb; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. $Id: server.cc 2081 2010-03-23 20:18:00Z lww $ */ /// \file server.cc #ifdef HAVE_CONFIG_H #include "autoconfig.h" #endif #ifdef HAVE_CURL #include #endif #ifdef HAVE_LASTFMLIB #include "lastfm_scrobbler.h" #endif #include "server.h" #include "web_callbacks.h" #include "content_manager.h" #include "update_manager.h" #include "dictionary.h" #include "upnp_xml.h" #include "tools.h" using namespace zmm; using namespace mxml; Ref Server::storage = nil; SINGLETON_MUTEX(Server, false); static int static_upnp_callback(Upnp_EventType eventtype, void *event, void *cookie) { return Server::getInstance()->upnp_callback(eventtype, event, cookie); } void Server::static_cleanup_callback() { if (storage != nil) { try { storage->threadCleanup(); } catch (Exception ex) {} } } Server::Server() : Singleton() { server_shutdown_flag = false; } void Server::init() { virtual_directory = _(SERVER_VIRTUAL_DIR); ContentDirectoryService::setStaticArgs(_(DESC_CDS_SERVICE_TYPE), _(DESC_CDS_SERVICE_ID)); cds = ContentDirectoryService::getInstance(); ConnectionManagerService::setStaticArgs(_(DESC_CM_SERVICE_TYPE), _(DESC_CM_SERVICE_ID)); cmgr = ConnectionManagerService::getInstance(); #if defined(ENABLE_MRREG) MRRegistrarService::setStaticArgs(_(DESC_MRREG_SERVICE_TYPE), _(DESC_MRREG_SERVICE_ID)); mrreg = MRRegistrarService::getInstance(); #endif Ref config = ConfigManager::getInstance(); serverUDN = config->getOption(CFG_SERVER_UDN); alive_advertisement = config->getIntOption(CFG_SERVER_ALIVE_INTERVAL); #ifdef HAVE_CURL curl_global_init(CURL_GLOBAL_ALL); #endif #ifdef HAVE_LASTFMLIB LastFm::getInstance(); #endif } void Server::upnp_init(String iface, String ip_address, int port) { int ret = 0; // general purpose error code String ip; log_debug("start\n"); Ref config = ConfigManager::getInstance(); if (!string_ok(iface)) iface = config->getOption(CFG_SERVER_NETWORK_INTERFACE); if (!string_ok(ip_address)) ip = config->getOption(CFG_SERVER_IP); else ip = ip_address; if (string_ok(ip) && string_ok(iface)) throw _Exception(_("You can not specify interface and IP at the same time!")); if (!string_ok(ip)) ip = interfaceToIP(iface); if (string_ok(iface) && !string_ok(ip)) throw _Exception(_("Could not find interface: ") + iface); /* // without this lod_debug coredumped on Solaris... if (iface == nil) iface = _(""); if (ip == nil) ip = _(""); log_debug("interface: %s ip: %s\n", iface.c_str(), ip.c_str()); if (ip == "") ip = nil; */ if (port < 0) { port = config->getIntOption(CFG_SERVER_PORT); } if (port < 0) port = 0; void *cb = NULL; // this is important, so the storage lives a little longer when // shutdown is initiated storage = Storage::getInstance(); if (storage->threadCleanupRequired()) cb = (void *)static_cleanup_callback; ret = UpnpInit(ip.c_str(), port, 0, cb); if (ret != UPNP_E_SUCCESS) { throw _UpnpException(ret, _("upnp_init: UpnpInit failed")); } port = UpnpGetServerPort(); log_info("Initialized port: %d\n", port); if (!string_ok(ip)) { ip = UpnpGetServerIpAddress(); } log_info("Server bound to: %s\n", ip.c_str()); virtual_url = _("http://") + ip + ":" + port + "/" + virtual_directory; // next set webroot directory String web_root = config->getOption(CFG_SERVER_WEBROOT); if (!string_ok(web_root)) { throw _Exception(_("invalid web server root directory")); } ret = UpnpSetWebServerRootDir(web_root.c_str()); if (ret != UPNP_E_SUCCESS) { throw _UpnpException(ret, _("upnp_init: UpnpSetWebServerRootDir failed")); } log_debug("webroot: %s\n", web_root.c_str()); Ref > arr = config->getStringArrayOption(CFG_SERVER_CUSTOM_HTTP_HEADERS); if (arr != nil) { String tmp; for (int i = 0; i < arr->size(); i++) { tmp = arr->get(i); if (string_ok(tmp)) { log_info("Adding HTTP header \"%s\"\n", tmp.c_str()); ret = UpnpAddCustomHTTPHeader(tmp.c_str()); if (ret != UPNP_E_SUCCESS) { throw _UpnpException(ret, _("upnp_init: UpnpAddCustomHTTPHeader failed")); } } } } ret = UpnpAddVirtualDir(virtual_directory.c_str()); if (ret != UPNP_E_SUCCESS) { throw _UpnpException(ret, _("upnp_init: UpnpAddVirtualDir failed")); } ret = register_web_callbacks(); if (ret != UPNP_E_SUCCESS) { throw _UpnpException(ret, _("upnp_init: UpnpSetVirtualDirCallbacks failed")); } String presentationURL = config->getOption(CFG_SERVER_PRESENTATION_URL); if (!string_ok(presentationURL)) { presentationURL = _("http://") + ip + ":" + port + "/"; } else { String appendto = config->getOption(CFG_SERVER_APPEND_PRESENTATION_URL_TO); if (appendto == "ip") { presentationURL = _("http://") + ip + ":" + presentationURL; } else if (appendto == "port") { presentationURL = _("http://") + ip + ":" + port + "/" + presentationURL; } // else appendto is none and we take the URL as it entered by user } // register root device with the library String device_description = _("\n") + UpnpXML_RenderDeviceDescription(presentationURL)->print(); //log_debug("DEVICE DESCRIPTION: \n%s\n", device_description.c_str()); // register root device with the library ret = UpnpRegisterRootDevice2(UPNPREG_BUF_DESC, device_description.c_str(), device_description.length() + 1, true, static_upnp_callback, &device_handle, &device_handle); if (ret != UPNP_E_SUCCESS) { throw _UpnpException(ret, _("upnp_init: UpnpRegisterRootDevice failed")); } // now unregister in order to cleanup previous instances // that might still be there due to crash/unclean shutdown/network interruptions ret = UpnpUnRegisterRootDevice(device_handle); if (ret != UPNP_E_SUCCESS) { throw _UpnpException(ret, _("upnp_init: unregistering failed")); } // and register again, we should be clean now ret = UpnpRegisterRootDevice2(UPNPREG_BUF_DESC, device_description.c_str(), device_description.length() + 1, true, static_upnp_callback, &device_handle, &device_handle); if (ret != UPNP_E_SUCCESS) { throw _UpnpException(ret, _("upnp_init: UpnpRegisterRootDevice failed")); } // send advertisements every 180secs ret = UpnpSendAdvertisement(device_handle, alive_advertisement); if (ret != UPNP_E_SUCCESS) { throw _UpnpException(ret, _("upnp_init: UpnpSendAdvertisement failed")); } // initializing UpdateManager UpdateManager::getInstance(); // initializing ContentManager ContentManager::getInstance(); config->writeBookmark(ip, String::from(port)); log_info("MediaTomb Web UI can be reached by following this link:\n"); log_info("http://%s:%d/\n", ip.c_str(), port); log_debug("end\n"); } bool Server::getShutdownStatus() { return server_shutdown_flag; } void Server::shutdown() { int ret = 0; // return code /* ContentManager::getInstance()->shutdown(); UpdateManager::getInstance()->shutdown(); Storage::getInstance()->shutdown(); */ server_shutdown_flag = true; log_debug("start\n"); // unregister device ret = UpnpUnRegisterRootDevice(device_handle); if (ret != UPNP_E_SUCCESS) { throw _UpnpException(ret, _("upnp_cleanup: UpnpUnRegisterRootDevice failed")); } #ifdef HAVE_CURL curl_global_cleanup(); #endif log_debug("now calling upnp finish\n"); UpnpFinish(); storage = nil; log_debug("end\n"); } String Server::getVirtualURL() { return virtual_url; } int Server::upnp_callback(Upnp_EventType eventtype, void *event, void *cookie) { int ret = UPNP_E_SUCCESS; // general purpose return code log_debug("start\n"); // check parameters if (event == NULL) { log_debug("upnp_callback: NULL event structure\n"); return UPNP_E_BAD_REQUEST; } // log_info("event is ok\n"); // get device wide mutex (have to figure out what the hell that is) AUTOLOCK(mutex); // log_info("got device mutex\n"); // dispatch event based on event type switch (eventtype) { case UPNP_CONTROL_ACTION_REQUEST: // a CP is invoking an action // log_info("UPNP_CONTROL_ACTION_REQUEST\n"); try { Ref request(new ActionRequest((struct Upnp_Action_Request *)event)); upnp_actions(request); request->update(); // set in update() ((struct Upnp_Action_Request *)event)->ErrCode = ret; } catch(UpnpException upnp_e) { ret = upnp_e.getErrorCode(); ((struct Upnp_Action_Request *)event)->ErrCode = ret; } catch(Exception e) { log_info("Exception: %s\n", e.getMessage().c_str()); } break; case UPNP_EVENT_SUBSCRIPTION_REQUEST: // a cp wants a subscription // log_info("UPNP_EVENT_SUBSCRIPTION_REQUEST\n"); try { Ref request(new SubscriptionRequest((struct Upnp_Subscription_Request *)event)); upnp_subscriptions(request); } catch(UpnpException upnp_e) { ret = upnp_e.getErrorCode(); } break; default: // unhandled event type log_warning("unsupported event type: %d\n", eventtype); ret = UPNP_E_BAD_REQUEST; break; } log_debug("returning %d\n", ret); return ret; } UpnpDevice_Handle Server::getDeviceHandle() { return device_handle; } zmm::String Server::getIP() { return UpnpGetServerIpAddress(); } zmm::String Server::getPort() { return String::from(UpnpGetServerPort()); } void Server::upnp_actions(Ref request) { log_debug("start\n"); // make sure the request is for our device if (request->getUDN() != serverUDN) { // not for us throw _UpnpException(UPNP_E_BAD_REQUEST, _("upnp_actions: request not for this device")); } // we need to match the serviceID to one of our services if (request->getServiceID() == DESC_CM_SERVICE_ID) { // this call is for the lifetime stats service // log_debug("request for connection manager service\n"); cmgr->process_action_request(request); } else if (request->getServiceID() == DESC_CDS_SERVICE_ID) { // this call is for the toaster control service // log_debug("upnp_actions: request for content directory service\n"); cds->process_action_request(request); } #if defined(ENABLE_MRREG) else if (request->getServiceID() == DESC_MRREG_SERVICE_ID) { mrreg->process_action_request(request); } #endif else { // cp is asking for a nonexistent service, or for a service // that does not support any actions throw _UpnpException(UPNP_E_BAD_REQUEST, _("Service does not exist or action not supported")); } } void Server::upnp_subscriptions(Ref request) { // make sure that the request is for our device if (request->getUDN() != serverUDN) { // not for us // log_debug("upnp_subscriptions: request not for this device\n"); throw _UpnpException(UPNP_E_BAD_REQUEST, _("upnp_actions: request not for this device")); } // we need to match the serviceID to one of our services if (request->getServiceID() == DESC_CDS_SERVICE_ID) { // this call is for the content directory service // log_debug("upnp_subscriptions: request for content directory service\n"); cds->process_subscription_request(request); } else if (request->getServiceID() == DESC_CM_SERVICE_ID) { // this call is for the connection manager service // log_debug("upnp_subscriptions: request for connection manager service\n"); cmgr->process_subscription_request(request); } #if defined(ENABLE_MRREG) else if (request->getServiceID() == DESC_MRREG_SERVICE_ID) { mrreg->process_subscription_request(request); } #endif else { // cp asks for a nonexistent service or for a service that // does not support subscriptions throw _UpnpException(UPNP_E_BAD_REQUEST, _("Service does not exist or subscriptions not supported")); } } mediatomb-0.12.1/src/upnp_mrreg_actions.cc0000664000076400007640000000614611352675003015474 00000000000000/*MT* MediaTomb - http://www.mediatomb.cc/ upnp_mrreg_actions.cc - this file is part of MediaTomb. Copyright (C) 2005 Gena Batyan , Sergey 'Jin' Bostandzhyan Copyright (C) 2006-2010 Gena Batyan , Sergey 'Jin' Bostandzhyan , Leonhard Wimmer MediaTomb is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. MediaTomb is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with MediaTomb; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. $Id: upnp_mrreg_actions.cc 2081 2010-03-23 20:18:00Z lww $ */ /// \file upnp_mrreg_actions.cc #ifdef HAVE_CONFIG_H #include "autoconfig.h" #endif #if defined(ENABLE_MRREG) #include "tools.h" #include "upnp_mrreg.h" #include "storage.h" using namespace zmm; using namespace mxml; void MRRegistrarService::upnp_action_IsAuthorized(Ref request) { log_debug("start\n"); Ref response; response = UpnpXML_CreateResponse(request->getActionName(), serviceType); response->appendTextChild(_("Result"), _("1")); request->setResponse(response); request->setErrorCode(UPNP_E_SUCCESS); log_debug("end\n"); } void MRRegistrarService::upnp_action_RegisterDevice(Ref request) { log_debug("start\n"); request->setErrorCode(UPNP_E_NOT_EXIST); log_debug("upnp_action_GetCurrentConnectionInfo: end\n"); } void MRRegistrarService::upnp_action_IsValidated(Ref request) { log_debug("start\n"); Ref response; response = UpnpXML_CreateResponse(request->getActionName(), serviceType); response->appendTextChild(_("Result"), _("1")); request->setResponse(response); request->setErrorCode(UPNP_E_SUCCESS); log_debug("end\n"); } void MRRegistrarService::process_action_request(Ref request) { log_debug("start\n"); if (request->getActionName() == "IsAuthorized") { upnp_action_IsAuthorized(request); } else if (request->getActionName() == "RegisterDevice") { upnp_action_RegisterDevice(request); } else if (request->getActionName() == "IsValidated") { upnp_action_IsValidated(request); } else { // invalid or unsupported action log_debug("unrecognized action %s\n", request->getActionName().c_str()); request->setErrorCode(UPNP_E_INVALID_ACTION); //throw UpnpException(UPNP_E_INVALID_ACTION, _("unrecognized action")); } log_debug("end\n"); } #endif // ENABLE_MRREG mediatomb-0.12.1/src/memory.cc0000664000076400007640000001160011352675003013075 00000000000000/*MT* MediaTomb - http://www.mediatomb.cc/ memory.cc - this file is part of MediaTomb. Copyright (C) 2005 Gena Batyan , Sergey 'Jin' Bostandzhyan Copyright (C) 2006-2010 Gena Batyan , Sergey 'Jin' Bostandzhyan , Leonhard Wimmer MediaTomb is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. MediaTomb is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with MediaTomb; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. $Id: memory.cc 2081 2010-03-23 20:18:00Z lww $ */ /// \file memory.cc #ifdef HAVE_CONFIG_H #include "autoconfig.h" #endif #include #include "memory.h" #ifndef HAVE_MALLOC void *rpl_malloc(size_t size) { if (size == 0) ++size; return malloc(size); } #endif #ifndef HAVE_REALLOC void *rpl_realloc(void *p, size_t size) { if (size == 0) ++size; return realloc(p, size); } #endif /* calloc() function that is glibc compatible. This wrapper function is required at least on Tru64 UNIX 5.1. Copyright (C) 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. */ /* written by Jim Meyering */ /* Allocate and zero-fill an NxS-byte block of memory from the heap. If N or S is zero, allocate and zero-fill a 1-byte block. */ #if defined(TOMBDEBUG) && ! defined (MEMPROF) #include "logger.h" #endif #ifndef HAVE_CALLOC void *rpl_calloc(size_t n, size_t s) { size_t bytes; if (n == 0 || s == 0) return calloc (1, 1); /* Defend against buggy calloc implementations that mishandle size_t overflow. */ bytes = n * s; if (bytes / s != n) return NULL; return calloc (n, s); } #endif #ifdef MEMPROF static int mallocCount = 0; static int freeCount = 0; static int totalAlloc = 0; static int curAlloc = 0; static int maxAlloc = 0; static void print_stats() { printf("MAL:%d FRE:%d CUR:%d TOT:%d MAX:%d\n", mallocCount, freeCount, curAlloc, totalAlloc, maxAlloc); } void *MALLOC(size_t size) { mallocCount++; totalAlloc += size; curAlloc += size; if (curAlloc > maxAlloc) maxAlloc = curAlloc; void *ptr = malloc(size + sizeof(int)); *((int *)ptr) = size; print_stats(); return ( (void *)((int *)ptr + 1) ); } void *CALLOC(size_t nmemb, size_t size) { mallocCount++; totalAlloc += size * nmemb; curAlloc += size * nmemb; if (curAlloc > maxAlloc) maxAlloc = curAlloc; void *ptr = calloc(nmemb, size + sizeof(int)); *((int *)ptr) = size; print_stats(); return ( (void *)((int *)ptr + 1) ); } void *REALLOC(void *ptr, size_t size) { freeCount++; mallocCount++; int previous = *((int *)ptr - 1); totalAlloc += size - previous; curAlloc += size - previous; if (curAlloc > maxAlloc) maxAlloc = curAlloc; ptr = realloc((void *)((int *)ptr - 1), size + sizeof(int)); *((int *)ptr) = size; print_stats(); return ( (void *)((int *)ptr + 1) ); } void FREE(void *ptr) { freeCount++; int size = *((int *)ptr - 1); curAlloc -= size; print_stats(); return free( (void *)((int *)ptr - 1) ); } #else #ifdef TOMBDEBUG void *MALLOC(size_t size) { #ifdef DEBUG_MALLOC_0 if (size <= 0) { printf("malloc called with 0! aborting...\n"); _print_backtrace(stderr); abort(); } #endif return malloc(size); } void *REALLOC(void *ptr, size_t size) { #ifdef DEBUG_MALLOC_0 if (size <= 0) { printf("realloc called with 0! aborting...\n"); _print_backtrace(stderr); abort(); } #endif return realloc(ptr, size); } #endif // TOMBDEBUG #endif // MEMPROF mediatomb-0.12.1/src/url.cc0000664000076400007640000001622411352675003012376 00000000000000/*MT* MediaTomb - http://www.mediatomb.cc/ url.cc - this file is part of MediaTomb. Copyright (C) 2005 Gena Batyan , Sergey 'Jin' Bostandzhyan Copyright (C) 2006-2010 Gena Batyan , Sergey 'Jin' Bostandzhyan , Leonhard Wimmer MediaTomb is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. MediaTomb is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with MediaTomb; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. $Id: url.cc 2081 2010-03-23 20:18:00Z lww $ */ /// \file url.cc #ifdef HAVE_CONFIG_H #include "autoconfig.h" #endif #ifdef HAVE_CURL #include #include "common.h" #include "rexp.h" #include "url.h" #include "tools.h" #include "config_manager.h" using namespace zmm; URL::URL(size_t buffer_hint) { this->buffer_hint = buffer_hint; } Ref URL::download(String URL, long *HTTP_retcode, CURL *curl_handle, bool only_header, bool verbose, bool redirect) { CURLcode res; bool cleanup = false; char error_buffer[CURL_ERROR_SIZE] = {'\0'}; if (curl_handle == NULL) { curl_handle = curl_easy_init(); cleanup = true; if (curl_handle == NULL) throw _Exception(_("Invalid curl handle!\n")); } Ref buffer(new StringBuffer(buffer_hint)); curl_easy_reset(curl_handle); if (verbose) { bool logEnabled; #ifdef TOMBDEBUG logEnabled = !ConfigManager::isDebugLogging(); #else logEnabled = ConfigManager::isDebugLogging(); #endif if (logEnabled) curl_easy_setopt(curl_handle, CURLOPT_VERBOSE, 1); } // some web sites send unexpected stuff, seems they need a user agent // that they know... curl_easy_setopt(curl_handle, CURLOPT_USERAGENT, "Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.6) Gecko/20091216 Fedora/3.5.6-1.fc12 Firefox/3.5.6"); curl_easy_setopt(curl_handle, CURLOPT_URL, URL.c_str()); curl_easy_setopt(curl_handle, CURLOPT_ERRORBUFFER, error_buffer); curl_easy_setopt(curl_handle, CURLOPT_CONNECTTIMEOUT, 20); // seconds /// \todo it would be a good idea to allow both variants, i.e. retrieve /// the headers and data in one go when needed if (only_header) { curl_easy_setopt(curl_handle, CURLOPT_NOBODY, 1); curl_easy_setopt(curl_handle, CURLOPT_HEADERFUNCTION, URL::dl); curl_easy_setopt(curl_handle, CURLOPT_HEADERDATA, (void *)buffer.getPtr()); } else { curl_easy_setopt(curl_handle, CURLOPT_WRITEFUNCTION, URL::dl); curl_easy_setopt(curl_handle, CURLOPT_WRITEDATA, (void *)buffer.getPtr()); } if (redirect) { curl_easy_setopt(curl_handle, CURLOPT_FOLLOWLOCATION, 1); curl_easy_setopt(curl_handle, CURLOPT_MAXREDIRS, -1); } res = curl_easy_perform(curl_handle); if (res != CURLE_OK) { log_error("%s\n", error_buffer); if (cleanup) curl_easy_cleanup(curl_handle); throw _Exception(error_buffer); } res = curl_easy_getinfo(curl_handle, CURLINFO_RESPONSE_CODE, HTTP_retcode); if (res != CURLE_OK) { log_error("%s\n", error_buffer); if (cleanup) curl_easy_cleanup(curl_handle); throw _Exception(error_buffer); } if (cleanup) curl_easy_cleanup(curl_handle); return buffer; } Ref URL::getInfo(String URL, CURL *curl_handle) { long retcode; bool cleanup = false; CURLcode res; double cl; char *ct; char *c_url; char error_buffer[CURL_ERROR_SIZE] = {'\0'}; String mt; String used_url; if (curl_handle == NULL) { curl_handle = curl_easy_init(); cleanup = true; if (curl_handle == NULL) throw _Exception(_("Invalid curl handle!\n")); } Ref buffer = download(URL, &retcode, curl_handle, true, true, true); if (retcode != 200) { if (cleanup) curl_easy_cleanup(curl_handle); throw _Exception(_("Error retrieving information from ") + URL + _(" HTTP return code: ") + String::from(retcode)); } /* Ref getMT(new RExp()); try { getMT->compile(_("\nContent-Type: ([^\n]+)\n"), REG_ICASE); } catch (Exception ex) { if (cleanup) curl_easy_cleanup(curl_handle); throw ex; } Ref matcher = getMT->matcher(buffer->toString()); String mt; if (matcher->next()) mt = trim_string(matcher->group(1)); else mt = _(MIMETYPE_DEFAULT); log_debug("Extracted content type: %s\n", mt.c_str()); Ref getCL(new RExp()); try { getCL->compile(_("\nContent-Length: ([^\n]+)\n"), REG_ICASE); } catch (Exception ex) { if (cleanup) curl_easy_cleanup(curl_handle); throw ex; } matcher = getCL->matcher(buffer->toString()); off_t cl; if (matcher->next()) cl = trim_string(matcher->group(1)).toOFF_T(); else cl = -1; */ res = curl_easy_getinfo(curl_handle, CURLINFO_CONTENT_LENGTH_DOWNLOAD, &cl); if (res != CURLE_OK) { log_error("%s\n", error_buffer); if (cleanup) curl_easy_cleanup(curl_handle); throw _Exception(error_buffer); } res = curl_easy_getinfo(curl_handle, CURLINFO_CONTENT_TYPE, &ct); if (res != CURLE_OK) { log_error("%s\n", error_buffer); if (cleanup) curl_easy_cleanup(curl_handle); throw _Exception(error_buffer); } if (ct == NULL) mt = _(MIMETYPE_DEFAULT); else mt = ct; log_debug("Extracted content length: %lld\n", (long long)cl); res = curl_easy_getinfo(curl_handle, CURLINFO_EFFECTIVE_URL, &c_url); if (res != CURLE_OK) { log_error("%s\n", error_buffer); if (cleanup) curl_easy_cleanup(curl_handle); throw _Exception(error_buffer); } if (c_url == NULL) used_url = URL; else used_url = c_url; Ref st(new Stat(used_url, (off_t)cl, mt)); if (cleanup) curl_easy_cleanup(curl_handle); return st; } size_t URL::dl(void *buf, size_t size, size_t nmemb, void *data) { StringBuffer *buffer = (StringBuffer *)data; if (buffer == NULL) return 0; size_t s = size * nmemb; *buffer << String((char *)buf, s); return s; } #endif//HAVE_CURL mediatomb-0.12.1/src/process_io_handler.cc0000664000076400007640000002610411352675003015434 00000000000000/*MT* MediaTomb - http://www.mediatomb.cc/ process_io_handler.cc - this file is part of MediaTomb. Copyright (C) 2005 Gena Batyan , Sergey 'Jin' Bostandzhyan Copyright (C) 2006-2010 Gena Batyan , Sergey 'Jin' Bostandzhyan , Leonhard Wimmer MediaTomb is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. MediaTomb is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with MediaTomb; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. $Id: process_io_handler.cc 2081 2010-03-23 20:18:00Z lww $ */ /// \file process_io_handler.cc #ifdef HAVE_CONFIG_H #include "autoconfig.h" #endif #ifdef EXTERNAL_TRANSCODING #include #include #include #include #include #include "common.h" #include "process_io_handler.h" #include "process.h" #include "content_manager.h" // after MAX_TIMEOUTS we will tell libupnp to check the socket, // this will make sure that we do not block the read and allow libupnp to // call our close() callback #define MAX_TIMEOUTS 2 // maximum allowe consecutive timeouts using namespace zmm; ProcListItem::ProcListItem(Ref exec, bool abortOnDeath) { executor = exec; abort = abortOnDeath; } Ref ProcListItem::getExecutor() { return executor; } bool ProcListItem::abortOnDeath() { return abort; } bool ProcessIOHandler::abort() { bool abort = false; if (proclist == nil) return abort; for (int i = 0; i < proclist->size(); i++) { Ref exec = proclist->get(i)->getExecutor(); if ((exec != nil) && (!exec->isAlive())) { if (proclist->get(i)->abortOnDeath()) abort = true; break; } } return abort; } void ProcessIOHandler::killall() { if (proclist == nil) return; for (int i = 0; i < proclist->size(); i++) { Ref exec = proclist->get(i)->getExecutor(); if (exec != nil) exec->kill(); } } void ProcessIOHandler::registerAll() { if (main_proc != nil) ContentManager::getInstance()->registerExecutor(main_proc); if (proclist == nil) return; for (int i = 0; i < proclist->size(); i++) { Ref exec = proclist->get(i)->getExecutor(); if (exec != nil) ContentManager::getInstance()->registerExecutor(exec); } } void ProcessIOHandler::unregisterAll() { if (main_proc != nil) ContentManager::getInstance()->unregisterExecutor(main_proc); if (proclist == nil) return; for (int i = 0; i < proclist->size(); i++) { Ref exec = proclist->get(i)->getExecutor(); if (exec != nil) ContentManager::getInstance()->unregisterExecutor(exec); } } ProcessIOHandler::ProcessIOHandler(String filename, zmm::Ref main_proc, zmm::Ref > proclist, bool ignoreSeek) : IOHandler() { this->filename = filename; this->proclist = proclist; this->main_proc = main_proc; this->ignore_seek = ignoreSeek; if ((main_proc != nil) && ((!main_proc->isAlive() || abort()))) { killall(); throw _Exception(_("process terminated early")); } /* if (mkfifo(filename.c_str(), O_RDWR) == -1) { log_error("Failed to create fifo: %s\n", strerror(errno)); killall(); if (main_proc != nil) main_proc->kill(); throw _Exception(_("Could not create reader fifo!\n")); } */ registerAll(); } void ProcessIOHandler::open(IN enum UpnpOpenFileMode mode) { if ((main_proc != nil) && ((!main_proc->isAlive() || abort()))) { killall(); throw _Exception(_("process terminated early")); } if (mode == UPNP_READ) fd = ::open(filename.c_str(), O_RDONLY | O_NONBLOCK); else if (mode == UPNP_WRITE) fd = ::open(filename.c_str(), O_WRONLY | O_NONBLOCK); else fd = -1; if (fd == -1) { if (errno == ENXIO) { throw _TryAgainException(_("open failed: ") + strerror(errno)); } killall(); if (main_proc != nil) main_proc->kill(); unlink(filename.c_str()); throw _Exception(_("open: failed to open: ") + filename.c_str()); } } int ProcessIOHandler::read(OUT char *buf, IN size_t length) { fd_set readSet; struct timeval timeout; ssize_t bytes_read = 0; int num_bytes = 0; char* p_buffer = buf; int exit_status = EXIT_SUCCESS; int ret = 0; int timeout_count = 0; while (true) { FD_ZERO(&readSet); FD_SET(fd, &readSet); timeout.tv_sec = FIFO_READ_TIMEOUT; timeout.tv_usec = 0; ret = select(fd + 1, &readSet, NULL, NULL, &timeout); if (ret == -1) { if (errno == EINTR) continue; } // timeout if (ret == 0) { if (main_proc != nil) { bool main_ok = main_proc->isAlive(); if (!main_ok || abort()) { if (!main_ok) { exit_status = main_proc->getStatus(); log_debug("process exited with status %d\n", exit_status); killall(); if (exit_status == EXIT_SUCCESS) return 0; else return -1; } else { main_proc->kill(); killall(); return -1; } } } else { killall(); return 0; } timeout_count++; if (timeout_count > MAX_TIMEOUTS) { log_debug("max timeouts, checking socket!\n"); return CHECK_SOCKET; } } if (FD_ISSET(fd, &readSet)) { timeout_count = 0; bytes_read = ::read(fd, p_buffer, length); if (bytes_read == 0) break; if (bytes_read < 0) { log_debug("aborting read!!!\n"); return -1; } num_bytes = num_bytes + bytes_read; length = length - bytes_read; if (length <= 0) break; p_buffer = buf + num_bytes; } } if (num_bytes < 0) { // not sure what we return here since no way of knowing about feof // actually that will depend on the ret code of the process ret = -1; if (main_proc != nil) { if (!main_proc->isAlive()) { if (main_proc->getStatus() == EXIT_SUCCESS) ret = 0; } else { main_proc->kill(); } } else ret = 0; killall(); return ret; } return num_bytes; } int ProcessIOHandler::write(IN char *buf, IN size_t length) { fd_set writeSet; struct timeval timeout; ssize_t bytes_written = 0; int num_bytes = 0; char* p_buffer = buf; int exit_status = EXIT_SUCCESS; int ret = 0; while (true) { FD_ZERO(&writeSet); FD_SET(fd, &writeSet); timeout.tv_sec = FIFO_WRITE_TIMEOUT; timeout.tv_usec = 0; ret = select(fd + 1, NULL, &writeSet, NULL, &timeout); if (ret == -1) { if (errno == EINTR) { continue; } } // timeout if (ret == 0) { if (main_proc != nil) { bool main_ok = main_proc->isAlive(); if (!main_ok || abort()) { if (!main_ok) { exit_status = main_proc->getStatus(); log_debug("process exited with status %d\n", exit_status); killall(); if (exit_status == EXIT_SUCCESS) return 0; else return -1; } else { main_proc->kill(); killall(); return -1; } } } else { killall(); return 0; } } if (FD_ISSET(fd, &writeSet)) { bytes_written= ::write(fd, p_buffer, length); if (bytes_written == 0) break; if (bytes_written < 0) { log_debug("aborting write!!!\n"); return -1; } num_bytes = num_bytes + bytes_written; length = length - bytes_written; if (length <= 0) break; p_buffer = buf + num_bytes; } } if (num_bytes < 0) { // not sure what we return here since no way of knowing about feof // actually that will depend on the ret code of the process ret = -1; if (main_proc != nil) { if (!main_proc->isAlive()) { if (main_proc->getStatus() == EXIT_SUCCESS) ret = 0; } else { main_proc->kill(); } } else ret = 0; killall(); return ret; } return num_bytes; } void ProcessIOHandler::seek(IN off_t offset, IN int whence) { // we know we can not seek in a fifo, but the PS3 asks for a hack... if (!ignore_seek) throw _Exception(_("fseek failed")); } void ProcessIOHandler::close() { bool ret; log_debug("terminating process, closing %s\n", this->filename.c_str()); unregisterAll(); if (main_proc != nil) { ret = main_proc->kill(); } else ret = true; killall(); ::close(fd); unlink(filename.c_str()); if (!ret) throw _Exception(_("failed to kill process!")); } ProcessIOHandler::~ProcessIOHandler() { try { close(); } catch (Exception ex) {} } #endif // EXTERNAL_TRANSCODING mediatomb-0.12.1/src/file_io_handler.cc0000664000076400007640000000544411352675003014701 00000000000000/*MT* MediaTomb - http://www.mediatomb.cc/ file_io_handler.cc - this file is part of MediaTomb. Copyright (C) 2005 Gena Batyan , Sergey 'Jin' Bostandzhyan Copyright (C) 2006-2010 Gena Batyan , Sergey 'Jin' Bostandzhyan , Leonhard Wimmer MediaTomb is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. MediaTomb is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with MediaTomb; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. $Id: file_io_handler.cc 2081 2010-03-23 20:18:00Z lww $ */ /// \file file_io_handler.cc #ifdef HAVE_CONFIG_H #include "autoconfig.h" #endif #include "server.h" #include #include #include #include #include #include "common.h" #include "storage.h" #include "cds_objects.h" #include "process.h" #include "update_manager.h" #include "ixml.h" #include "file_io_handler.h" #include "dictionary.h" using namespace zmm; using namespace mxml; FileIOHandler::FileIOHandler(String filename) : IOHandler() { this->filename = filename; } void FileIOHandler::open(IN enum UpnpOpenFileMode mode) { if (mode == UPNP_READ) { f = fopen(filename.c_str(), "rb"); } else if (mode == UPNP_WRITE) { f = fopen(filename.c_str(), "wb"); } else { throw _Exception(_("FileIOHandler::open: invdalid read/write mode")); } if (f == NULL) { throw _Exception(_("FileIOHandler::open: failed to open: ") + filename.c_str()); } } int FileIOHandler::read(OUT char *buf, IN size_t length) { int ret = 0; ret = fread(buf, sizeof(char), length, f); if (ret <= 0) { if (feof(f)) return 0; if (ferror(f)) return -1; } return ret; } int FileIOHandler::write(IN char *buf, IN size_t length) { int ret = 0; ret = fwrite(buf, sizeof(char), length, f); return ret; } void FileIOHandler::seek(IN off_t offset, IN int whence) { if (fseeko(f, offset, whence) != 0) { throw _Exception(_("fseek failed")); } } void FileIOHandler::close() { if (fclose(f) != 0) { throw _Exception(_("fclose failed")); } f = NULL; } mediatomb-0.12.1/src/io_handler_buffer_helper.h0000664000076400007640000000603011352675003016424 00000000000000/*MT* MediaTomb - http://www.mediatomb.cc/ io_handler_buffer_helper.h - this file is part of MediaTomb. Copyright (C) 2005 Gena Batyan , Sergey 'Jin' Bostandzhyan Copyright (C) 2006-2010 Gena Batyan , Sergey 'Jin' Bostandzhyan , Leonhard Wimmer MediaTomb is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. MediaTomb is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with MediaTomb; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. $Id: io_handler_buffer_helper.h 2081 2010-03-23 20:18:00Z lww $ */ /// \file io_handler_buffer_helper.h #ifndef __IO_HANDLER_BUFFER_HELPER_H__ #define __IO_HANDLER_BUFFER_HELPER_H__ #include #include "common.h" #include "upnp.h" #include "io_handler.h" #include "sync.h" /// \brief a IOHandler with buffer support /// the buffer is only for read(). write() is not supported /// the public functions of this class are *not* thread safe! class IOHandlerBufferHelper : public IOHandler { public: /// \brief get an instance of a IOHandlerBufferHelper /// \param bufSize the size of the buffer in bytes /// \param maxChunkSize the maximum size of the chunks which are read by the buffer /// \param initialFillSize the number of bytes which have to be in the buffer /// before the first read at the very beginning or after a seek returns; /// 0 disables the delay IOHandlerBufferHelper(size_t bufSize, size_t initialFillSize); virtual ~IOHandlerBufferHelper(); // inherited from IOHandler virtual void open(enum UpnpOpenFileMode mode); virtual int read(char *buf, size_t length); virtual void seek(off_t offset, int whence); virtual void close(); protected: size_t bufSize; size_t initialFillSize; char* buffer; bool isOpen; bool eof; bool readError; bool waitForInitialFillSize; bool signalAfterEveryRead; bool checkSocket; // buffer stuff.. bool empty; size_t a; size_t b; off_t posRead; // seek stuff... bool seekEnabled; bool doSeek; off_t seekOffset; int seekWhence; // thread stuff.. void startBufferThread(); void stopBufferThread(); static void *staticThreadProc(void *arg); virtual void threadProc() = 0; pthread_t bufferThread; bool threadShutdown; zmm::Ref cond; zmm::Ref mutex; }; #endif // __IO_HANDLER_BUFFER_HELPER_H__ mediatomb-0.12.1/src/upnp_cds_actions.cc0000664000076400007640000001566511352675003015137 00000000000000/*MT* MediaTomb - http://www.mediatomb.cc/ upnp_cds_actions.cc - this file is part of MediaTomb. Copyright (C) 2005 Gena Batyan , Sergey 'Jin' Bostandzhyan Copyright (C) 2006-2010 Gena Batyan , Sergey 'Jin' Bostandzhyan , Leonhard Wimmer MediaTomb is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. MediaTomb is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with MediaTomb; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. $Id: upnp_cds_actions.cc 2081 2010-03-23 20:18:00Z lww $ */ /// \file upnp_cds_actions.cc #ifdef HAVE_CONFIG_H #include "autoconfig.h" #endif #include "upnp_cds.h" #include "server.h" #include "storage.h" using namespace zmm; using namespace mxml; void ContentDirectoryService::upnp_action_Browse(Ref request) { log_debug("start\n"); Ref storage = Storage::getInstance(); Ref req = request->getRequest(); String objID = req->getChildText(_("ObjectID")); int objectID; String BrowseFlag = req->getChildText(_("BrowseFlag")); //String Filter; // not yet supported String StartingIndex = req->getChildText(_("StartingIndex")); String RequestedCount = req->getChildText(_("RequestedCount")); // String SortCriteria; // not yet supported //log_debug("Browse received parameters: ObjectID [%s] BrowseFlag [%s] StartingIndex [%s] RequestedCount [%s]\n", // ObjectID.c_str(), BrowseFlag.c_str(), StartingIndex.c_str(), RequestedCount.c_str()); if (objID == nil) throw UpnpException(UPNP_E_NO_SUCH_ID, _("empty object id")); else objectID = objID.toInt(); unsigned int flag = BROWSE_ITEMS | BROWSE_CONTAINERS | BROWSE_EXACT_CHILDCOUNT; if(BrowseFlag == "BrowseDirectChildren") flag |= BROWSE_DIRECT_CHILDREN; else if (BrowseFlag != "BrowseMetadata") throw UpnpException(UPNP_SOAP_E_INVALID_ARGS, _("invalid browse flag: ") + BrowseFlag); Ref parent = storage->loadObject(objectID); if ((parent->getClass() == UPNP_DEFAULT_CLASS_MUSIC_ALBUM) || (parent->getClass() == UPNP_DEFAULT_CLASS_PLAYLIST_CONTAINER)) flag |= BROWSE_TRACK_SORT; if (ConfigManager::getInstance()->getBoolOption(CFG_SERVER_HIDE_PC_DIRECTORY)) flag |= BROWSE_HIDE_FS_ROOT; Ref param(new BrowseParam(objectID, flag)); param->setStartingIndex(StartingIndex.toInt()); param->setRequestedCount(RequestedCount.toInt()); Ref > arr; try { arr = storage->browse(param); } catch (Exception e) { throw UpnpException(UPNP_E_NO_SUCH_ID, _("no such object")); } Ref didl_lite (new Element(_("DIDL-Lite"))); didl_lite->setAttribute(_(XML_NAMESPACE_ATTR), _(XML_DIDL_LITE_NAMESPACE)); didl_lite->setAttribute(_(XML_DC_NAMESPACE_ATTR), _(XML_DC_NAMESPACE)); didl_lite->setAttribute(_(XML_UPNP_NAMESPACE_ATTR), _(XML_UPNP_NAMESPACE)); Ref cfg = ConfigManager::getInstance(); for(int i = 0; i < arr->size(); i++) { Ref obj = arr->get(i); if (cfg->getBoolOption(CFG_SERVER_EXTOPTS_MARK_PLAYED_ITEMS_ENABLED) && obj->getFlag(OBJECT_FLAG_PLAYED)) { String title = obj->getTitle(); if (cfg->getBoolOption(CFG_SERVER_EXTOPTS_MARK_PLAYED_ITEMS_STRING_MODE_PREPEND)) title = cfg->getOption(CFG_SERVER_EXTOPTS_MARK_PLAYED_ITEMS_STRING) + title; else title = title + cfg->getOption(CFG_SERVER_EXTOPTS_MARK_PLAYED_ITEMS_STRING); obj->setTitle(title); } Ref didl_object = UpnpXML_DIDLRenderObject(obj, false, stringLimit); didl_lite->appendElementChild(didl_object); } Ref response; response = UpnpXML_CreateResponse(request->getActionName(), serviceType); response->appendTextChild(_("Result"), didl_lite->print()); response->appendTextChild(_("NumberReturned"), String::from(arr->size())); response->appendTextChild(_("TotalMatches"), String::from(param->getTotalMatches())); response->appendTextChild(_("UpdateID"), String::from(systemUpdateID)); request->setResponse(response); log_debug("end\n"); } void ContentDirectoryService::upnp_action_GetSearchCapabilities(Ref request) { log_debug("start\n"); Ref response; response = UpnpXML_CreateResponse(request->getActionName(), serviceType); response->appendTextChild(_("SearchCaps"), _("")); request->setResponse(response); log_debug("end\n"); } void ContentDirectoryService::upnp_action_GetSortCapabilities(Ref request) { log_debug("start\n"); Ref response; response = UpnpXML_CreateResponse(request->getActionName(), serviceType); response->appendTextChild(_("SortCaps"), _("")); request->setResponse(response); log_debug("end\n"); } void ContentDirectoryService::upnp_action_GetSystemUpdateID(Ref request) { log_debug("start\n"); Ref response; response = UpnpXML_CreateResponse(request->getActionName(), serviceType); response->appendTextChild(_("Id"), String::from(systemUpdateID)); request->setResponse(response); log_debug("end\n"); } void ContentDirectoryService::process_action_request(Ref request) { log_debug("start\n"); if (request->getActionName() == "Browse") { upnp_action_Browse(request); } else if (request->getActionName() == "GetSearchCapabilities") { upnp_action_GetSearchCapabilities(request); } else if (request->getActionName() == "GetSortCapabilities") { upnp_action_GetSortCapabilities(request); } else if (request->getActionName() == "GetSystemUpdateID") { upnp_action_GetSystemUpdateID(request); } else { // invalid or unsupported action log_debug("unrecognized action %s\n", request->getActionName().c_str()); request->setErrorCode(UPNP_E_INVALID_ACTION); // throw UpnpException(UPNP_E_INVALID_ACTION, _("unrecognized action")); } log_debug("ContentDirectoryService::process_action_request: end\n"); } mediatomb-0.12.1/src/weborama_service.h0000664000076400007640000001023111352675141014746 00000000000000/*MT* MediaTomb - http://www.mediatomb.cc/ weborama_service.h - this file is part of MediaTomb. Copyright (C) 2005 Gena Batyan , Sergey 'Jin' Bostandzhyan Copyright (C) 2006-2010 Gena Batyan , Sergey 'Jin' Bostandzhyan , Leonhard Wimmer MediaTomb is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. MediaTomb is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with MediaTomb; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. $Id: weborama_service.h 2083 2010-03-25 14:58:48Z jin_eld $ */ /// \file weborama_service.h /// \brief Definition of the WeboramaService class. #ifdef WEBORAMA #ifndef __WEBORAMA_SERVICE_H__ #define __WEBORAMA_SERVICE_H__ #include "zmm/zmm.h" #include "mxml/mxml.h" #include "online_service.h" #include "url.h" #include "dictionary.h" #include typedef enum { WR_mood_calm_positive = 0, WR_mood_positive, WR_mood_energetic_positive, WR_mood_calm, WR_mood_neutral, WR_mood_energetic, WR_mood_calm_dark, WR_mood_dark, WR_mood_energetic_dark, WR_mood_none, } wr_mood_t; typedef enum { WR_genre_electronic = 0, WR_genre_alternative, WR_genre_jazz, WR_genre_metal, WR_genre_death_metal, WR_genre_pop, WR_genre_punk, WR_genre_rhytm_and_blues, WR_genre_rap, WR_genre_reggae, WR_genre_rock, WR_genre_classic, WR_genre_soundtrack, WR_genre_retro, WR_genre_russian_rock, WR_genre_russian_pop, WR_genre_chanson, WR_genre_folk, WR_genre_none, } wr_genre_t; /// \brief This is an interface for all online services, the function /// handles adding/refreshing content in the database. class WeboramaService : public OnlineService { public: WeboramaService(); ~WeboramaService(); /// \brief Retrieves user specified content from the service and adds /// the items to the database. virtual bool refreshServiceData(zmm::Ref layout); /// \brief Get the type of the service (i.e. Weborama, Shoutcast, etc.) virtual service_type_t getServiceType(); /// \brief Get the human readable name for the service virtual zmm::String getServiceName(); /// \brief Parse the xml fragment from the configuration and gather /// the user settings in a service task structure. virtual zmm::Ref defineServiceTask(zmm::Ref xmlopt, zmm::Ref params); protected: // the handle *must never be used from multiple threads* CURL *curl_handle; // safeguard to ensure the above pthread_t pid; // url retriever class zmm::Ref url; /// \brief This function will retrieve the XML according to the parametrs zmm::Ref getData(zmm::Ref params); /// \brief task that we will be working with when refreshServiceData is /// called. int current_task; class WeboramaTask : public zmm::Object { public: WeboramaTask(); /// \brief Name of the task as defined by the user. zmm::String name; /// \brief Weborama API URL parameters zmm::Ref parameters; /// \brief Amount of items that we are allowed to get. int amount; /// \brief Amount of items that have been fetched. int amount_fetched; /// \brief Starting index of the item to fetch int start_index; }; wr_mood_t getMood(zmm::Ref xml); wr_genre_t getGenre(zmm::String genre); int getGenreID(wr_genre_t genre); }; #endif//__ONLINE_SERVICE_H__ #endif//WEBORAMA mediatomb-0.12.1/src/logger.cc0000664000076400007640000000773211352675003013057 00000000000000/*MT* MediaTomb - http://www.mediatomb.cc/ logger.cc - this file is part of MediaTomb. Copyright (C) 2005 Gena Batyan , Sergey 'Jin' Bostandzhyan Copyright (C) 2006-2010 Gena Batyan , Sergey 'Jin' Bostandzhyan , Leonhard Wimmer MediaTomb is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. MediaTomb is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with MediaTomb; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. $Id: logger.cc 2081 2010-03-23 20:18:00Z lww $ */ /// \file logger.cc #ifdef HAVE_CONFIG_H #include "autoconfig.h" #endif #include #include #include #include #include #include #ifdef HAVE_EXECINFO_H #include #endif #include "logger.h" #include "config_manager.h" FILE *LOG_FILE = stderr; #define FLUSHIT fflush(LOG_FILE); #define LOGCHECK if (!LOG_FILE) return; void log_open(char *filename) { LOG_FILE = fopen(filename, "a"); if (! LOG_FILE) { fprintf(stderr, "Could not open log file %s : %s\n", filename, strerror(errno)); exit(1); } } void log_close() { if (LOG_FILE) { fclose(LOG_FILE); LOG_FILE = NULL; } } static void log_stamp(const char *type) { time_t unx; struct tm t; time(&unx); localtime_r(&unx, &t); fprintf(LOG_FILE, "%.4d-%.2d-%.2d %.2d:%.2d:%.2d %*s: ", t.tm_year + 1900, t.tm_mon + 1, t.tm_mday, t.tm_hour, t.tm_min, t.tm_sec, 7, // max length we have is "WARNING" type); } void _log_info(const char *format, ...) { va_list ap; LOGCHECK va_start(ap, format); log_stamp("INFO"); vfprintf(LOG_FILE, format, ap); FLUSHIT va_end(ap); } void _log_warning(const char *format, ...) { va_list ap; LOGCHECK va_start(ap, format); log_stamp("WARNING"); vfprintf(LOG_FILE, format, ap); FLUSHIT va_end(ap); } void _log_error(const char *format, ...) { va_list ap; LOGCHECK va_start(ap, format); log_stamp("ERROR"); vfprintf(LOG_FILE, format, ap); FLUSHIT va_end(ap); } void _log_js(const char *format, ...) { va_list ap; LOGCHECK va_start(ap, format); log_stamp("JS"); vfprintf(LOG_FILE, format, ap); FLUSHIT va_end(ap); } void _log_debug(const char *format, const char *file, int line, const char *function, ...) { bool enabled; #ifdef TOMBDEBUG enabled = !ConfigManager::isDebugLogging(); #else enabled = ConfigManager::isDebugLogging(); #endif if (enabled) { va_list ap; LOGCHECK va_start(ap, function); log_stamp("DEBUG"); fprintf(LOG_FILE, "[%s:%d] %s(): ", file, line, function); vfprintf(LOG_FILE, format, ap); FLUSHIT va_end(ap); } } void _print_backtrace(FILE* file) { #if defined HAVE_BACKTRACE && defined HAVE_BACKTRACE_SYMBOLS bool enabled; #ifdef TOMBDEBUG enabled = !ConfigManager::isDebugLogging(); #else enabled = ConfigManager::isDebugLogging(); #endif if (enabled) { void* b[100]; int size = backtrace(b, 100); char **s = backtrace_symbols(b, size); for(int i = 0; i < size; i++) fprintf(file, "_STRACE_ %i %s\n", i, s[i]); free(s); } #endif } mediatomb-0.12.1/src/layout/0000775000076400007640000000000011357204746012664 500000000000000mediatomb-0.12.1/src/layout/js_layout.h0000664000076400007640000000302211352675000014751 00000000000000/*MT* MediaTomb - http://www.mediatomb.cc/ js_layout.h - this file is part of MediaTomb. Copyright (C) 2005 Gena Batyan , Sergey 'Jin' Bostandzhyan Copyright (C) 2006-2010 Gena Batyan , Sergey 'Jin' Bostandzhyan , Leonhard Wimmer MediaTomb is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. MediaTomb is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with MediaTomb; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. $Id: js_layout.h 2081 2010-03-23 20:18:00Z lww $ */ /// \file js_layout.h #ifndef __JS_LAYOUT_H__ #define __JS_LAYOUT_H__ #include "layout.h" #include "scripting/import_script.h" class JSLayout : public Layout { protected: zmm::Ref import_script; public: JSLayout(); virtual ~JSLayout(); virtual void processCdsObject(zmm::Ref obj, zmm::String rootpath); }; #endif // __JS_LAYOUT_H__ mediatomb-0.12.1/src/layout/fallback_layout.cc0000664000076400007640000005545111352675000016247 00000000000000/*MT* MediaTomb - http://www.mediatomb.cc/ fallback_layout.cc - this file is part of MediaTomb. Copyright (C) 2005 Gena Batyan , Sergey 'Jin' Bostandzhyan Copyright (C) 2006-2010 Gena Batyan , Sergey 'Jin' Bostandzhyan , Leonhard Wimmer MediaTomb is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. MediaTomb is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with MediaTomb; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. $Id: fallback_layout.cc 2081 2010-03-23 20:18:00Z lww $ */ /// \file fallback_layout.cc #ifdef HAVE_CONFIG_H #include "autoconfig.h" #endif #include "fallback_layout.h" #include "content_manager.h" #include "config_manager.h" #include "metadata_handler.h" #include "string_converter.h" #include "tools.h" #ifdef HAVE_LIBDVDNAV #include "metadata/dvd_handler.h" #endif #ifdef ONLINE_SERVICES #include "online_service.h" #ifdef YOUTUBE #include "youtube_content_handler.h" #include "youtube_service.h" #endif #ifdef WEBORAMA #include "weborama_content_handler.h" #endif #ifdef SOPCAST #include "sopcast_content_handler.h" #endif #ifdef ATRAILERS #include "atrailers_content_handler.h" #endif #endif//ONLINE_SERVICES using namespace zmm; void FallbackLayout::add(Ref obj, int parentID, bool use_ref) { obj->setParentID(parentID); if (use_ref) obj->setFlag(OBJECT_FLAG_USE_RESOURCE_REF); obj->setID(INVALID_OBJECT_ID); ContentManager::getInstance()->addObject(obj); } zmm::String FallbackLayout::esc(zmm::String str) { return escape(str, VIRTUAL_CONTAINER_ESCAPE, VIRTUAL_CONTAINER_SEPARATOR); } void FallbackLayout::addVideo(zmm::Ref obj, String rootpath) { Ref f2i = StringConverter::f2i(); int id = ContentManager::getInstance()->addContainerChain(_("/Video/All Video")); if (obj->getID() != INVALID_OBJECT_ID) { obj->setRefID(obj->getID()); add(obj, id); } else { add(obj, id); obj->setRefID(obj->getID()); } String dir; if (string_ok(rootpath)) { rootpath = rootpath.substring(0, rootpath.rindex(DIR_SEPARATOR)); dir = obj->getLocation().substring(rootpath.length(), obj->getLocation().rindex(DIR_SEPARATOR)-rootpath.length()); if (dir.startsWith(_DIR_SEPARATOR)) dir = dir.substring(1); dir = f2i->convert(dir); } else dir = esc(f2i->convert(get_last_path(obj->getLocation()))); if (string_ok(dir)) { id = ContentManager::getInstance()->addContainerChain(_("/Video/Directories/") + dir); add(obj, id); } } #ifdef HAVE_LIBDVDNAV Ref FallbackLayout::prepareChapter(Ref obj, int title_idx, int chapter_idx) { String chapter_name = _("Chapter "); obj->getResource(0)->addParameter(DVDHandler::renderKey(DVD_Chapter), String::from(chapter_idx)); if (chapter_idx < 9) chapter_name = chapter_name + _("0") + (chapter_idx + 1); // remap else chapter_name = chapter_name + (chapter_idx + 1); obj->setTitle(chapter_name); // String tmp = obj->getAuxData(DVDHandler::renderKey(DVD_ChapterRestDuration, // title_idx, chapter_idx)); // if (string_ok(tmp)) // obj->getResource(0)->addAttribute(MetadataHandler::getResAttrName(R_DURATION), tmp); return obj; } void FallbackLayout::addDVD(Ref obj) { #define DVD_VPATH "/Video/DVD/" int dot = obj->getTitle().rindex('.'); int pcd_id = obj->getID(); String dvd_name; if (dot > -1) dvd_name = obj->getTitle().substring(0, dot); else dvd_name = obj->getTitle(); String dvd_container = _(DVD_VPATH) + esc(dvd_name); Ref cm = ContentManager::getInstance(); int id = cm->addContainerChain(dvd_container, nil, pcd_id); // we get the main object here, so the object that we will add below // will be a reference of the main object, that's why we set the ref // id to the object id - the add function will clear out the object // id if (obj->getID() != INVALID_OBJECT_ID) { obj->setRefID(obj->getID()); add(obj, id); } // the object is not yet in the database (probably we got it from a // playlist script, so we set the ref id after adding - it will be used // for all consequent virtual objects else { add(obj, id); obj->setRefID(obj->getID()); } dvd_container = dvd_container + _("/"); int title_count = obj->getAuxData(DVDHandler::renderKey(DVD_TitleCount)).toInt(); // set common item attributes RefCast(obj, CdsItem)->setMimeType(mpeg_mimetype); obj->getResource(0)->addAttribute(MetadataHandler::getResAttrName(R_PROTOCOLINFO), renderProtocolInfo(RefCast(obj, CdsItem)->getMimeType())); obj->setClass(_(UPNP_DEFAULT_CLASS_VIDEO_ITEM)); /// \todo this has to be changed once we add seeking obj->getResource(0)->removeAttribute(MetadataHandler::getResAttrName(R_SIZE)); for (int t = 0; t < title_count; t++) { int audio_track_count = obj->getAuxData(DVDHandler::renderKey(DVD_AudioTrackCount, t)).toInt(); obj->getResource(0)->addParameter(DVDHandler::renderKey(DVD_Title), String::from(t)); for (int a = 0; a < audio_track_count; a++) { // set common audio track resource attributes obj->getResource(0)->addParameter(DVDHandler::renderKey(DVD_AudioStreamID), obj->getAuxData(DVDHandler::renderKey(DVD_AudioTrackStreamID, t, 0, a))); String tmp = obj->getAuxData(DVDHandler::renderKey(DVD_AudioTrackChannels, t, 0, a)); if (string_ok(tmp)) { obj->getResource(0)->addAttribute(MetadataHandler::getResAttrName(R_NRAUDIOCHANNELS), tmp); log_debug("Setting Audio Channels, object %s - num: %s\n", obj->getLocation().c_str(), tmp.c_str()); } tmp = obj->getAuxData(DVDHandler::renderKey(DVD_AudioTrackSampleFreq, t, 0, a)); if (string_ok(tmp)) obj->getResource(0)->addAttribute(MetadataHandler::getResAttrName(R_SAMPLEFREQUENCY), tmp); String title_container = _("Titles/"); String title_name; if (t < 9) // 9 because of later remapping title_name = _("Title 0") + (t + 1); // remap else title_name = _("Title ") + (t + 1); // remap String format = obj->getAuxData(DVDHandler::renderKey(DVD_AudioTrackFormat, t, 0, a)); String language = obj->getAuxData(DVDHandler::renderKey(DVD_AudioTrackLanguage, t, 0, a)); title_container = title_container + title_name; title_container = title_container + _(" - Audio Track ") + (a + 1); if (string_ok(format)) title_container = title_container + _(" - ") + esc(format); if (string_ok(language)) title_container = title_container + _(" - ") + esc(language); title_container = dvd_container + title_container; id = cm->addContainerChain(title_container, nil, pcd_id); int chapter_count = obj->getAuxData(DVDHandler::renderKey(DVD_ChapterCount, t)).toInt(); for (int c = 0; c < chapter_count; c++) { prepareChapter(obj, t, c); add(obj, id, false); } if (string_ok(language)) { String language_container = _("Languages/"); String chain = dvd_container + language_container + esc(language) + _("/") + title_name; chain = chain + _(" - Audio Track ") + (a + 1); if (string_ok(format)) chain = chain + _(" - ") + esc(format); id = cm->addContainerChain(chain, nil, pcd_id); for (int c = 0; c < chapter_count; c++) { prepareChapter(obj, t, c); add(obj, id, false); } } if (string_ok(format)) { String format_container = _("Audio Formats/"); String chain = dvd_container + format_container + esc(format) + _("/") + title_name; chain = chain + _(" - Audio Track ") + (a + 1); if (string_ok(language)) chain = chain + _(" - ") + esc(language); id = cm->addContainerChain(chain, nil, pcd_id); for (int c = 0; c < chapter_count; c++) { prepareChapter(obj, t, c); add(obj, id, false); } } // format } // audio track count } // title count } #endif void FallbackLayout::addImage(Ref obj, String rootpath) { int id; Ref f2i = StringConverter::f2i(); id = ContentManager::getInstance()->addContainerChain(_("/Photos/All Photos")); if (obj->getID() != INVALID_OBJECT_ID) { obj->setRefID(obj->getID()); add(obj, id); } else { add(obj, id); obj->setRefID(obj->getID()); } Ref meta = obj->getMetadata(); String date = meta->get(MetadataHandler::getMetaFieldName(M_DATE)); if (string_ok(date)) { String year, month; int m = -1; int y = date.index('-'); if (y > 0) { year = date.substring(0, y); month = date.substring(y + 1); m = month.index('-'); if (m > 0) month = month.substring(0, m); } String chain; if ((y > 0) && (m > 0)) { chain = _("/Photos/Year/") + esc(year) + "/" + esc(month); id = ContentManager::getInstance()->addContainerChain(chain); add(obj, id); } chain = _("/Photos/Date/") + esc(date); id = ContentManager::getInstance()->addContainerChain(chain); add(obj, id); } String dir; if (string_ok(rootpath)) { rootpath = rootpath.substring(0, rootpath.rindex(DIR_SEPARATOR)); dir = obj->getLocation().substring(rootpath.length(), obj->getLocation().rindex(DIR_SEPARATOR)-rootpath.length()); if (dir.startsWith(_DIR_SEPARATOR)) dir = dir.substring(1); dir = f2i->convert(dir); } else dir = esc(f2i->convert(get_last_path(obj->getLocation()))); if (string_ok(dir)) { id = ContentManager::getInstance()->addContainerChain(_("/Photos/Directories/") + dir); add(obj, id); } } void FallbackLayout::addAudio(zmm::Ref obj) { String desc; String chain; String artist_full; String album_full; int id; Ref meta = obj->getMetadata(); String title = meta->get(MetadataHandler::getMetaFieldName(M_TITLE)); if (!string_ok(title)) title = obj->getTitle(); String artist = meta->get(MetadataHandler::getMetaFieldName(M_ARTIST)); if (string_ok(artist)) { artist_full = artist; desc = artist; } else artist = _("Unknown"); String album = meta->get(MetadataHandler::getMetaFieldName(M_ALBUM)); if (string_ok(album)) { desc = desc + _(", ") + album; album_full = album; } else { album = _("Unknown"); } if (string_ok(desc)) desc = desc + _(", "); desc = desc + title; String date = meta->get(MetadataHandler::getMetaFieldName(M_DATE)); if (string_ok(date)) { int i = date.index('-'); if (i > 0) date = date.substring(0, i); desc = desc + _(", ") + date; } else date = _("Unknown"); String genre = meta->get(MetadataHandler::getMetaFieldName(M_GENRE)); if (string_ok(genre)) desc = desc + ", " + genre; else genre = _("Unknown"); String description = meta->get(MetadataHandler::getMetaFieldName(M_DESCRIPTION)); if (!string_ok(description)) { meta->put(MetadataHandler::getMetaFieldName(M_DESCRIPTION), desc); obj->setMetadata(meta); } id = ContentManager::getInstance()->addContainerChain(_("/Audio/All Audio")); obj->setTitle(title); // we get the main object here, so the object that we will add below // will be a reference of the main object, that's why we set the ref // id to the object id - the add function will clear out the object // id if (obj->getID() != INVALID_OBJECT_ID) { obj->setRefID(obj->getID()); add(obj, id); } // the object is not yet in the database (probably we got it from a // playlist script, so we set the ref id after adding - it will be used // for all consequent virtual objects else { add(obj, id); obj->setRefID(obj->getID()); } artist = esc(artist); chain = _("/Audio/Artists/") + artist + "/All Songs"; id = ContentManager::getInstance()->addContainerChain(chain); add(obj, id); String temp; if (string_ok(artist_full)) temp = artist_full; if (string_ok(album_full)) temp = temp + " - " + album_full + " - "; else temp = temp + " - "; album = esc(album); chain = _("/Audio/Artists/") + artist + _("/") + album; id = ContentManager::getInstance()->addContainerChain(chain, _(UPNP_DEFAULT_CLASS_MUSIC_ALBUM)); add(obj, id); chain = _("/Audio/Albums/") + album; id = ContentManager::getInstance()->addContainerChain(chain, _(UPNP_DEFAULT_CLASS_MUSIC_ALBUM)); add(obj, id); chain = _("/Audio/Genres/") + esc(genre); id = ContentManager::getInstance()->addContainerChain(chain, _(UPNP_DEFAULT_CLASS_MUSIC_GENRE)); add(obj, id); chain = _("/Audio/Year/") + esc(date); id = ContentManager::getInstance()->addContainerChain(chain); add(obj, id); obj->setTitle(temp + title); id = ContentManager::getInstance()->addContainerChain(_("/Audio/All - full name")); add(obj, id); chain = _("/Audio/Artists/") + artist + "/All - full name"; id = ContentManager::getInstance()->addContainerChain(chain); add(obj, id); } #ifdef YOUTUBE void FallbackLayout::addYouTube(zmm::Ref obj) { #define YT_VPATH "/Online Services/YouTube" String chain; String temp; int id; bool ref_set = false; if (obj->getID() != INVALID_OBJECT_ID) { obj->setRefID(obj->getID()); ref_set = true; } temp = obj->getAuxData(_(YOUTUBE_AUXDATA_AVG_RATING)); if (string_ok(temp)) { int rating = (int)temp.toDouble(); if (rating > 3) { chain = _(YT_VPATH "/Rating/") + esc(String::from(rating)); id = ContentManager::getInstance()->addContainerChain(chain); add(obj, id, ref_set); if (!ref_set) { obj->setRefID(obj->getID()); ref_set = true; } } } temp = obj->getAuxData(_(YOUTUBE_AUXDATA_REQUEST)); if (string_ok(temp)) { yt_requests_t req = (yt_requests_t)temp.toInt(); temp = YouTubeService::getRequestName(req); String subName = obj->getAuxData(_(YOUTUBE_AUXDATA_SUBREQUEST_NAME)); String feedName = obj->getAuxData(_(YOUTUBE_AUXDATA_FEED)); String region = obj->getAuxData(_(YOUTUBE_AUXDATA_REGION)); chain = _(YT_VPATH) + '/' + esc(temp); if (string_ok(subName)) chain = chain + '/' + esc(subName); if (string_ok(feedName)) chain = chain + '/' + esc(feedName); if (string_ok(region)) { yt_regions_t reg = (yt_regions_t)region.toInt(); if (reg != YT_region_none) { region = YouTubeService::getRegionName(reg); if (string_ok(region)); chain = chain + '/' + esc(region); } } id = ContentManager::getInstance()->addContainerChain(chain); add(obj, id, ref_set); } } #endif #ifdef SOPCAST void FallbackLayout::addSopCast(zmm::Ref obj) { #define SP_VPATH "/Online Services/SopCast" String chain; String temp; int id; bool ref_set = false; if (obj->getID() != INVALID_OBJECT_ID) { obj->setRefID(obj->getID()); ref_set = true; } chain = _(SP_VPATH "/" "All Channels"); id = ContentManager::getInstance()->addContainerChain(chain); add(obj, id, ref_set); if (!ref_set) { obj->setRefID(obj->getID()); ref_set = true; } temp = obj->getAuxData(_(SOPCAST_AUXDATA_GROUP)); if (string_ok(temp)) { chain = _(SP_VPATH "/" "Groups" "/") + esc(temp); id = ContentManager::getInstance()->addContainerChain(chain); add(obj, id, ref_set); } } #endif #ifdef WEBORAMA void FallbackLayout::addWeborama(zmm::Ref obj) { #define WB_VPATH "/Online Services/Weborama" String chain; String temp; int id; bool ref_set = false; if (obj->getID() != INVALID_OBJECT_ID) { obj->setRefID(obj->getID()); ref_set = true; } temp = obj->getAuxData(_(WEBORAMA_AUXDATA_REQUEST_NAME)); if (!string_ok(temp)) { log_warning("Skipping Weborama item %s: missing playlist name\n", obj->getTitle().c_str()); return; } chain = _(WB_VPATH "/") + esc(temp); id = ContentManager::getInstance()->addContainerChain(chain, _(UPNP_DEFAULT_CLASS_PLAYLIST_CONTAINER)); add(obj, id, ref_set); } #endif #ifdef ATRAILERS void FallbackLayout::addATrailers(zmm::Ref obj) { #define AT_VPATH "/Online Services/Apple Trailers" String chain; String temp; int id = ContentManager::getInstance()->addContainerChain(_(AT_VPATH "/All Trailers")); if (obj->getID() != INVALID_OBJECT_ID) { obj->setRefID(obj->getID()); add(obj, id); } else { add(obj, id); obj->setRefID(obj->getID()); } Ref meta = obj->getMetadata(); temp = meta->get(MetadataHandler::getMetaFieldName(M_GENRE)); if (string_ok(temp)) { Ref st(new StringTokenizer(temp)); String genre; String next; do { if (!string_ok(genre)) genre = st->nextToken(_(",")); next = st->nextToken(_(",")); genre = trim_string(genre); if (!string_ok(genre)) break; id = ContentManager::getInstance()->addContainerChain(_(AT_VPATH "/Genres/") + esc(genre)); add(obj, id); if (string_ok(next)) genre = next; else genre = nil; } while (genre != nil); } temp = meta->get(MetadataHandler::getMetaFieldName(M_DATE)); if (string_ok(temp) && temp.length() >= 7) { id = ContentManager::getInstance()->addContainerChain(_(AT_VPATH "/Release Date/") + esc(temp.substring(0, 7))); add(obj, id); } temp = obj->getAuxData(_(ATRAILERS_AUXDATA_POST_DATE)); if (string_ok(temp) && temp.length() >= 7) { id = ContentManager::getInstance()->addContainerChain(_(AT_VPATH "/Post Date/") + esc(temp.substring(0, 7))); add(obj, id); } } #endif FallbackLayout::FallbackLayout() : Layout() { #ifdef ENABLE_PROFILING PROF_INIT_GLOBAL(layout_profiling, "fallback layout"); #endif #ifdef HAVE_LIBDVDNAV Ref mappings = ConfigManager::getInstance()->getDictionaryOption(CFG_IMPORT_MAPPINGS_MIMETYPE_TO_CONTENTTYPE_LIST); mpeg_mimetype = mappings->get(_(CONTENT_TYPE_MPEG)); if (!string_ok(mpeg_mimetype)) mpeg_mimetype = _("video/mpeg"); #endif } void FallbackLayout::processCdsObject(zmm::Ref obj, String rootpath) { log_debug("Process CDS Object: %s\n", obj->getTitle().c_str()); #ifdef ENABLE_PROFILING PROF_START(&layout_profiling); #endif Ref clone = CdsObject::createObject(obj->getObjectType()); obj->copyTo(clone); clone->setVirtual(1); #ifdef ONLINE_SERVICES if (clone->getFlag(OBJECT_FLAG_ONLINE_SERVICE)) { service_type_t service = (service_type_t)(clone->getAuxData(_(ONLINE_SERVICE_AUX_ID)).toInt()); switch (service) { #ifdef YOUTUBE case OS_YouTube: addYouTube(clone); break; #endif #ifdef SOPCAST case OS_SopCast: addSopCast(clone); break; #endif #ifdef WEBORAMA case OS_Weborama: addWeborama(clone); break; #endif #ifdef ATRAILERS case OS_ATrailers: addATrailers(clone); break; #endif case OS_Max: default: log_warning("No handler for service type\n"); break; } } else { #endif String mimetype = RefCast(obj, CdsItem)->getMimeType(); Ref mappings = ConfigManager::getInstance()->getDictionaryOption( CFG_IMPORT_MAPPINGS_MIMETYPE_TO_CONTENTTYPE_LIST); String content_type = mappings->get(mimetype); if (mimetype.startsWith(_("video"))) addVideo(clone, rootpath); else if (mimetype.startsWith(_("image"))) addImage(clone, rootpath); else if ((mimetype.startsWith(_("audio")) && (content_type != CONTENT_TYPE_PLAYLIST))) addAudio(clone); else if (content_type == CONTENT_TYPE_OGG) { if (obj->getFlag(OBJECT_FLAG_OGG_THEORA)) addVideo(clone, rootpath); else addAudio(clone); } #ifdef HAVE_LIBDVDNAV else if (content_type == CONTENT_TYPE_DVD) addDVD(clone); #endif #ifdef ONLINE_SERVICES } #endif #ifdef ENABLE_PROFILING PROF_END(&layout_profiling); #endif } #ifdef ENABLE_PROFILING FallbackLayout::~FallbackLayout() { PROF_PRINT(&layout_profiling); } #endif mediatomb-0.12.1/src/layout/layout.h0000664000076400007640000000261011352675000014257 00000000000000/*MT* MediaTomb - http://www.mediatomb.cc/ layout.h - this file is part of MediaTomb. Copyright (C) 2005 Gena Batyan , Sergey 'Jin' Bostandzhyan Copyright (C) 2006-2010 Gena Batyan , Sergey 'Jin' Bostandzhyan , Leonhard Wimmer MediaTomb is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. MediaTomb is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with MediaTomb; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. $Id: layout.h 2081 2010-03-23 20:18:00Z lww $ */ /// \file layout.h #ifndef __LAYOUT_H__ #define __LAYOUT_H__ #include "cds_objects.h" class Layout : public zmm::Object { public: virtual void processCdsObject(zmm::Ref obj, zmm::String rootpath) = 0; }; #endif // __LAYOUT_H__ mediatomb-0.12.1/src/layout/fallback_layout.h0000664000076400007640000000475311352675000016110 00000000000000/*MT* MediaTomb - http://www.mediatomb.cc/ fallback_layout.h - this file is part of MediaTomb. Copyright (C) 2005 Gena Batyan , Sergey 'Jin' Bostandzhyan Copyright (C) 2006-2010 Gena Batyan , Sergey 'Jin' Bostandzhyan , Leonhard Wimmer MediaTomb is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. MediaTomb is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with MediaTomb; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. $Id: fallback_layout.h 2081 2010-03-23 20:18:00Z lww $ */ /// \file fallback_layout.h #ifndef __FALLBACK_LAYOUT_H__ #define __FALLBACK_LAYOUT_H__ #include "layout.h" #include "cds_objects.h" #ifdef ENABLE_PROFILING #include "tools.h" #endif class FallbackLayout : public Layout { public: FallbackLayout(); virtual void processCdsObject(zmm::Ref obj, zmm::String rootpath); #ifdef ENABLE_PROFILING virtual ~FallbackLayout(); #endif protected: void add(zmm::Ref obj, int parentID, bool use_ref = true); zmm::String esc(zmm::String str); void addVideo(zmm::Ref obj, zmm::String rootpath); void addImage(zmm::Ref obj, zmm::String rootpath); void addAudio(zmm::Ref obj); #ifdef HAVE_LIBDVDNAV zmm::Ref prepareChapter(zmm::Ref obj, int title_idx, int chapter_idx); void addDVD(zmm::Ref obj); zmm::String mpeg_mimetype; #endif #ifdef YOUTUBE void addYouTube(zmm::Ref obj); #endif #ifdef SOPCAST void addSopCast(zmm::Ref obj); #endif #ifdef WEBORAMA void addWeborama(zmm::Ref obj); #endif #ifdef ATRAILERS void addATrailers(zmm::Ref obj); #endif #ifdef ENABLE_PROFILING bool profiling_initialized; profiling_t layout_profiling; #endif }; #endif // __FALLBACK_LAYOUT_H__ mediatomb-0.12.1/src/layout/js_layout.cc0000664000076400007640000000323111352675000015111 00000000000000/*MT* MediaTomb - http://www.mediatomb.cc/ js_layout.cc - this file is part of MediaTomb. Copyright (C) 2005 Gena Batyan , Sergey 'Jin' Bostandzhyan Copyright (C) 2006-2010 Gena Batyan , Sergey 'Jin' Bostandzhyan , Leonhard Wimmer MediaTomb is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. MediaTomb is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with MediaTomb; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. $Id: js_layout.cc 2081 2010-03-23 20:18:00Z lww $ */ /// \file js_layout.cc #ifdef HAVE_CONFIG_H #include "autoconfig.h" #endif #ifdef HAVE_JS #include "js_layout.h" #include "scripting/runtime.h" using namespace zmm; JSLayout::JSLayout() : Layout() { import_script = Ref(new ImportScript(Runtime::getInstance())); } JSLayout::~JSLayout() { } void JSLayout::processCdsObject(Ref obj, String rootpath) { if (import_script == nil) return; import_script->processCdsObject(obj, rootpath); } #endif // HAVE_JS mediatomb-0.12.1/src/atrailers_service.cc0000664000076400007640000001353011352675003015277 00000000000000/*MT* MediaTomb - http://www.mediatomb.cc/ atrailers_service.cc - this file is part of MediaTomb. Copyright (C) 2005 Gena Batyan , Sergey 'Jin' Bostandzhyan Copyright (C) 2006-2010 Gena Batyan , Sergey 'Jin' Bostandzhyan , Leonhard Wimmer MediaTomb is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. MediaTomb is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with MediaTomb; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. $Id: atrailers_service.cc 2081 2010-03-23 20:18:00Z lww $ */ /// \file atrailers_service.cc #ifdef HAVE_CONFIG_H #include "autoconfig.h" #endif #ifdef ATRAILERS #include "zmm/zmm.h" #include "atrailers_service.h" #include "atrailers_content_handler.h" #include "content_manager.h" #include "string_converter.h" #include "config_manager.h" #include "config_options.h" #include "server.h" using namespace zmm; using namespace mxml; #define ATRAILERS_SERVICE_URL_640 "http://www.apple.com/trailers/home/xml/current.xml" #define ATRAILERS_SERVICE_URL_720P "http://www.apple.com/trailers/home/xml/current_720p.xml" ATrailersService::ATrailersService() { url = Ref(new URL()); pid = 0; curl_handle = curl_easy_init(); if (!curl_handle) throw _Exception(_("failed to initialize curl!\n")); if (ConfigManager::getInstance()->getOption(CFG_ONLINE_CONTENT_ATRAILERS_RESOLUTION) == "640") service_url = _(ATRAILERS_SERVICE_URL_640); else service_url = _(ATRAILERS_SERVICE_URL_720P); } ATrailersService::~ATrailersService() { if (curl_handle) curl_easy_cleanup(curl_handle); } service_type_t ATrailersService::getServiceType() { return OS_ATrailers; } String ATrailersService::getServiceName() { return _("Apple Trailers"); } Ref ATrailersService::defineServiceTask(Ref xmlopt, Ref params) { // there are no configurable tasks here, we fetch an XML and parse it return nil; } Ref ATrailersService::getData() { long retcode; Ref sc = StringConverter::i2i(); Ref buffer; try { log_debug("DOWNLOADING URL: %s\n", service_url.c_str()); buffer = url->download(service_url, &retcode, curl_handle, false, true, true); } catch (Exception ex) { log_error("Failed to download Apple Trailers XML data: %s\n", ex.getMessage().c_str()); return nil; } if (buffer == nil) return nil; if (retcode != 200) return nil; log_debug("GOT BUFFER\n%s\n", buffer->toString().c_str()); Ref parser(new Parser()); try { return parser->parseString(sc->convert(buffer->toString()))->getRoot(); } catch (ParseException pe) { log_error("Error parsing Apple Trailers XML %s line %d:\n%s\n", pe.context->location.c_str(), pe.context->line, pe.getMessage().c_str()); return nil; } catch (Exception ex) { log_error("Error parsing Apple Trailers XML %s\n", ex.getMessage().c_str()); return nil; } return nil; } bool ATrailersService::refreshServiceData(Ref layout) { log_debug("Refreshing Apple Trailers\n"); // the layout is in full control of the service items // this is a safeguard to ensure that this class is not called from // multiple threads - it is not allowed to use the same curl handle // from multiple threads // we do it here because the handle is initialized in a different thread // which is OK if (pid == 0) pid = pthread_self(); if (pid != pthread_self()) throw _Exception(_("Not allowed to call refreshServiceData from different threads!")); Ref reply = getData(); Ref sc(new ATrailersContentHandler()); if (reply != nil) sc->setServiceContent(reply); else { log_debug("Failed to get XML content from Trailers service\n"); throw _Exception(_("Failed to get XML content from Trailers service")); } Ref obj; do { obj = sc->getNextObject(); if (obj == nil) break; obj->setVirtual(true); Ref old = Storage::getInstance()->loadObjectByServiceID(RefCast(obj, CdsItem)->getServiceID()); if (old == nil) { log_debug("Adding new Trailers object\n"); if (layout != nil) layout->processCdsObject(obj, nil); } else { log_debug("Updating existing Trailers object\n"); obj->setID(old->getID()); obj->setParentID(old->getParentID()); struct timespec oldt, newt; oldt.tv_nsec = 0; oldt.tv_sec = old->getAuxData(_(ONLINE_SERVICE_LAST_UPDATE)).toLong(); newt.tv_nsec = 0; newt.tv_sec = obj->getAuxData(_(ONLINE_SERVICE_LAST_UPDATE)).toLong(); ContentManager::getInstance()->updateObject(obj); } if (Server::getInstance()->getShutdownStatus()) return false; } while (obj != nil); return false; } #endif//ATRAILERS mediatomb-0.12.1/src/upnp_mrreg_subscriptions.cc0000664000076400007640000000650511352675003016742 00000000000000/*MT* MediaTomb - http://www.mediatomb.cc/ upnp_mrreg_subscriptions.cc - this file is part of MediaTomb. Copyright (C) 2005 Gena Batyan , Sergey 'Jin' Bostandzhyan Copyright (C) 2006-2010 Gena Batyan , Sergey 'Jin' Bostandzhyan , Leonhard Wimmer MediaTomb is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. MediaTomb is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with MediaTomb; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. $Id: upnp_mrreg_subscriptions.cc 2081 2010-03-23 20:18:00Z lww $ */ /// \file upnp_mrreg_subscriptions.cc #ifdef HAVE_CONFIG_H #include "autoconfig.h" #endif #if defined(ENABLE_MRREG) #include "tools.h" #include "upnp_mrreg.h" #include "server.h" #include "upnp_xml.h" #include "ixml.h" #include "storage.h" using namespace zmm; using namespace mxml; void MRRegistrarService::process_subscription_request(zmm::Ref request) { int err; IXML_Document *event = NULL; Ref propset, property; propset = UpnpXML_CreateEventPropertySet(); property = propset->getFirstElementChild(); property->appendTextChild(_("ValidationRevokedUpdateID"), _("0")); property->appendTextChild(_("ValidationSucceededUpdateID"), _("0")); property->appendTextChild(_("AuthorizationDeniedUpdateID"), _("0")); property->appendTextChild(_("AuthorizationGrantedUpdateID"), _("0")); String xml = propset->print(); err = ixmlParseBufferEx(xml.c_str(), &event); if (err != IXML_SUCCESS) { throw UpnpException(UPNP_E_SUBSCRIPTION_FAILED, _("Could not convert property set to ixml")); } UpnpAcceptSubscriptionExt(Server::getInstance()->getDeviceHandle(), ConfigManager::getInstance()->getOption(CFG_SERVER_UDN).c_str(), serviceID.c_str(), event, request->getSubscriptionID().c_str()); ixmlDocument_free(event); } #if 0 void MRRegistrarService::subscription_update(String sourceProtocol_CSV) { int err; IXML_Document *event = NULL; Ref propset, property; propset = UpnpXML_CreateEventPropertySet(); property = propset->getFirstChild(); property->appendTextChild(_("SourceProtocolInfo"), sourceProtocol_CSV); String xml = propset->print(); err = ixmlParseBufferEx(xml.c_str(), &event); if (err != IXML_SUCCESS) { /// \todo add another error code throw UpnpException(UPNP_E_SUBSCRIPTION_FAILED, _("Could not convert property set to ixml")); } UpnpNotifyExt(Server::getInstance()->getDeviceHandle(), ConfigManager::getInstance()->getOption(CFG_SERVER_UDN).c_str(), serviceID.c_str(), event); ixmlDocument_free(event); } #endif #endif // ENABLE_MRREG mediatomb-0.12.1/src/timer.cc0000664000076400007640000001015611352675003012712 00000000000000/*MT* MediaTomb - http://www.mediatomb.cc/ timer.cc - this file is part of MediaTomb. Copyright (C) 2005 Gena Batyan , Sergey 'Jin' Bostandzhyan Copyright (C) 2006-2010 Gena Batyan , Sergey 'Jin' Bostandzhyan , Leonhard Wimmer MediaTomb is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. MediaTomb is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with MediaTomb; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. $Id: timer.cc 2081 2010-03-23 20:18:00Z lww $ */ /// \file timer.cc #ifdef HAVE_CONFIG_H #include "autoconfig.h" #endif #include "timer.h" using namespace zmm; SINGLETON_MUTEX(Timer, true); template <> Ref > > > Timer::getAppropriateSubscribers >() { if (subscribersSingleton == nil) throw _Exception(_("timer already inactive!")); return subscribersSingleton; } template <> Ref > > Timer::getAppropriateSubscribers() { if (subscribersObject == nil) throw _Exception(_("timer already inactive!")); return subscribersObject; } Timer::Timer() : Singleton() { subscribersSingleton = Ref > > >(new Array > >); subscribersObject = Ref > >(new Array >); cond = Ref(new Cond(mutex)); } void Timer::triggerWait() { log_debug("triggerWait. - %d subscriber(s)\n", subscribersSingleton->size()); AUTOLOCK(mutex); if (subscribersSingleton->size() > 0 || subscribersObject->size() > 0) { struct timespec *timeout = getNextNotifyTime(); struct timespec now; getTimespecNow(&now); if (compareTimespecs(timeout, &now) < 0) { log_debug("sleeping...\n"); int ret = cond->timedwait(timeout); if (ret != 0 && ret != ETIMEDOUT) { log_debug("pthread_cond_timedwait returned errorcode %d\n", ret); throw _Exception(_("pthread_cond_timedwait returned errorcode ") + ret); } if (ret == ETIMEDOUT) { notify >(); notify(); } } else { notify >(); notify(); } } else { log_debug("nothing to do, sleeping...\n"); cond->wait(); } } struct timespec * Timer::getNextNotifyTime() { struct timespec *nextTime = NULL; for(int i = 0; i < subscribersSingleton->size(); i++) { struct timespec *nextNotify = subscribersSingleton->get(i)->getNextNotify(); if (nextTime == NULL || compareTimespecs(nextNotify, nextTime) > 0) { nextTime = nextNotify; } } for(int i = 0; i < subscribersObject->size(); i++) { struct timespec *nextNotify = subscribersObject->get(i)->getNextNotify(); if (nextTime == NULL || compareTimespecs(nextNotify, nextTime) > 0) { nextTime = nextNotify; } } return nextTime; } void Timer::shutdown() { subscribersSingleton = nil; subscribersObject = nil; log_debug("finished.\n"); } mediatomb-0.12.1/src/logger.h0000664000076400007640000000506111352675003012712 00000000000000/*MT* MediaTomb - http://www.mediatomb.cc/ logger.h - this file is part of MediaTomb. Copyright (C) 2005 Gena Batyan , Sergey 'Jin' Bostandzhyan Copyright (C) 2006-2010 Gena Batyan , Sergey 'Jin' Bostandzhyan , Leonhard Wimmer MediaTomb is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. MediaTomb is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with MediaTomb; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. $Id: logger.h 2081 2010-03-23 20:18:00Z lww $ */ /// \file logger.h #ifndef __LOGGER_H__ #define __LOGGER_H__ #include extern FILE *LOG_FILE; void log_open(char *filename); void log_close(); //#define LOG_ENABLED #define LOG_FLUSH 1 #ifdef LOG_ENABLED #define log_info(format, ...) _log_info(format, ## __VA_ARGS__) #define log_warning(format, ...) _log_warning(format, ## __VA_ARGS__) #define log_error(format, ...) _log_error(format, ## __VA_ARGS__) #define log_js(format, ...) _log_js(format, ## __VA_ARGS__) #ifdef DEBUG_LOG_ENABLED #define log_debug(format, ...) _log_debug(format, __FILE__, __LINE__, __func__, ## __VA_ARGS__) #define print_backtrace() _print_backtrace() #else #ifdef TOMBDEBUG #define log_debug(format, ...) _log_debug(format, __FILE__, __LINE__, __func__, ## __VA_ARGS__) #define print_backtrace() _print_backtrace() #else #define log_debug(format, ...) #define print_backtrace() #endif #endif #else #define log_info(format, ...) #define log_warning(format, ...) #define log_error(format, ...) #define log_js(format, ...) #define log_debug(format, ...) #define print_backtrace() #endif void _log_info(const char *format, ...); void _log_warning(const char *format, ...); void _log_error(const char *format, ...); void _log_js(const char *format, ...); void _log_debug(const char *format, const char* file, int line, const char *function, ...); void _print_backtrace(FILE* file = LOG_FILE); #endif // __LOGGER_H__ mediatomb-0.12.1/src/uuid/0000775000076400007640000000000011357204747012316 500000000000000mediatomb-0.12.1/src/uuid/pack.c0000664000076400007640000000155411351644352013317 00000000000000/* * Internal routine for packing UUID's * * Copyright (C) 1996, 1997 Theodore Ts'o. * * %Begin-Header% * This file may be redistributed under the terms of the GNU * Library General Public License. * %End-Header% */ #include #include "uuidP.h" void uuid_pack2(const struct uuid *uu, uuid_t ptr) { __u32 tmp; unsigned char *out = ptr; tmp = uu->time_low; out[3] = (unsigned char) tmp; tmp >>= 8; out[2] = (unsigned char) tmp; tmp >>= 8; out[1] = (unsigned char) tmp; tmp >>= 8; out[0] = (unsigned char) tmp; tmp = uu->time_mid; out[5] = (unsigned char) tmp; tmp >>= 8; out[4] = (unsigned char) tmp; tmp = uu->time_hi_and_version; out[7] = (unsigned char) tmp; tmp >>= 8; out[6] = (unsigned char) tmp; tmp = uu->clock_seq; out[9] = (unsigned char) tmp; tmp >>= 8; out[8] = (unsigned char) tmp; memcpy(out+10, uu->node, 6); } mediatomb-0.12.1/src/uuid/isnull.c0000664000076400007640000000070611351644352013705 00000000000000/* * isnull.c --- Check whether or not the UUID is null * * Copyright (C) 1996, 1997 Theodore Ts'o. * * %Begin-Header% * This file may be redistributed under the terms of the GNU * Library General Public License. * %End-Header% */ #include "uuidP.h" /* Returns 1 if the uuid is the NULL uuid */ int uuid_is_null(const uuid_t uu) { const unsigned char *cp; int i; for (i=0, cp = uu; i < 16; i++) if (*cp++) return 0; return 1; } mediatomb-0.12.1/src/uuid/gen_uuid.c0000664000076400007640000001420411351644352014174 00000000000000/* * gen_uuid.c --- generate a DCE-compatible uuid * * Copyright (C) 1996, 1997, 1998, 1999 Theodore Ts'o. * * %Begin-Header% * This file may be redistributed under the terms of the GNU * Library General Public License. * %End-Header% */ /* * Force inclusion of SVID stuff since we need it if we're compiling in * gcc-wall wall mode */ #define _SVID_SOURCE #include "autoconfig.h" #ifdef HAVE_UNISTD_H #include #endif #ifdef HAVE_STDLIB_H #include #endif #include #include #include #include #include #include #include #ifdef HAVE_SYS_IOCTL_H #include #endif #ifdef HAVE_SYS_SOCKET_H #include #endif #ifdef HAVE_SYS_SOCKIO_H #include #endif #ifdef HAVE_NET_IF_H #include #endif #ifdef HAVE_NETINET_IN_H #include #endif #include "uuidP.h" #ifdef HAVE_SRANDOM #define srand(x) srandom(x) #define rand() random() #endif static int get_random_fd(void) { struct timeval tv; static int fd = -2; int i; if (fd == -2) { gettimeofday(&tv, 0); fd = open("/dev/urandom", O_RDONLY); if (fd == -1) fd = open("/dev/random", O_RDONLY); //fd = open("/dev/random", O_RDONLY | O_NONBLOCK); srand((getpid() << 16) ^ getuid() ^ tv.tv_sec ^ tv.tv_usec); } /* Crank the random number generator a few times */ gettimeofday(&tv, 0); for (i = (tv.tv_sec ^ tv.tv_usec) & 0x1F; i > 0; i--) rand(); return fd; } /* * Generate a series of random bytes. Use /dev/urandom if possible, * and if not, use srandom/random. */ static void get_random_bytes(void *buf, int nbytes) { int i, n = nbytes, fd = get_random_fd(); int lose_counter = 0; unsigned char *cp = (unsigned char *) buf; if (fd >= 0) { while (n > 0) { i = read(fd, cp, n); if (i <= 0) { if (lose_counter++ > 16) break; continue; } n -= i; cp += i; lose_counter = 0; } } /* * We do this all the time, but this is the only source of * randomness if /dev/random/urandom is out to lunch. */ for (cp = buf, i = 0; i < nbytes; i++) *cp++ ^= (rand() >> 7) & 0xFF; return; } /* * Get the ethernet hardware address, if we can find it... */ static int get_node_id(unsigned char *node_id) { #ifdef HAVE_NET_IF_H int sd; struct ifreq ifr, *ifrp; struct ifconf ifc; char buf[1024]; int n, i; unsigned char *a; /* * BSD 4.4 defines the size of an ifreq to be * max(sizeof(ifreq), sizeof(ifreq.ifr_name)+ifreq.ifr_addr.sa_len * However, under earlier systems, sa_len isn't present, so the size is * just sizeof(struct ifreq) */ #ifdef HAVE_SA_LEN #ifndef max #define max(a,b) ((a) > (b) ? (a) : (b)) #endif #define ifreq_size(i) max(sizeof(struct ifreq),\ sizeof((i).ifr_name)+(i).ifr_addr.sa_len) #else #define ifreq_size(i) sizeof(struct ifreq) #endif /* HAVE_SA_LEN*/ sd = socket(AF_INET, SOCK_DGRAM, IPPROTO_IP); if (sd < 0) { return -1; } memset(buf, 0, sizeof(buf)); ifc.ifc_len = sizeof(buf); ifc.ifc_buf = buf; if (ioctl (sd, SIOCGIFCONF, (char *)&ifc) < 0) { close(sd); return -1; } n = ifc.ifc_len; for (i = 0; i < n; i+= ifreq_size(*ifr) ) { ifrp = (struct ifreq *)((char *) ifc.ifc_buf+i); strncpy(ifr.ifr_name, ifrp->ifr_name, IFNAMSIZ); #ifdef SIOCGIFHWADDR if (ioctl(sd, SIOCGIFHWADDR, &ifr) < 0) continue; a = (unsigned char *) &ifr.ifr_hwaddr.sa_data; #else #ifdef SIOCGENADDR if (ioctl(sd, SIOCGENADDR, &ifr) < 0) continue; a = (unsigned char *) ifr.ifr_enaddr; #else /* * XXX we don't have a way of getting the hardware * address */ close(sd); return 0; #endif /* SIOCGENADDR */ #endif /* SIOCGIFHWADDR */ if (!a[0] && !a[1] && !a[2] && !a[3] && !a[4] && !a[5]) continue; if (node_id) { memcpy(node_id, a, 6); close(sd); return 1; } } close(sd); #endif return 0; } /* Assume that the gettimeofday() has microsecond granularity */ #define MAX_ADJUSTMENT 10 static int get_clock(__u32 *clock_high, __u32 *clock_low, __u16 *ret_clock_seq) { static int adjustment = 0; static struct timeval last = {0, 0}; static __u16 clock_seq; struct timeval tv; unsigned long long clock_reg; try_again: gettimeofday(&tv, 0); if ((last.tv_sec == 0) && (last.tv_usec == 0)) { get_random_bytes(&clock_seq, sizeof(clock_seq)); clock_seq &= 0x1FFF; last = tv; last.tv_sec--; } if ((tv.tv_sec < last.tv_sec) || ((tv.tv_sec == last.tv_sec) && (tv.tv_usec < last.tv_usec))) { clock_seq = (clock_seq+1) & 0x1FFF; adjustment = 0; last = tv; } else if ((tv.tv_sec == last.tv_sec) && (tv.tv_usec == last.tv_usec)) { if (adjustment >= MAX_ADJUSTMENT) goto try_again; adjustment++; } else { adjustment = 0; last = tv; } clock_reg = tv.tv_usec*10 + adjustment; clock_reg += ((unsigned long long) tv.tv_sec)*10000000; clock_reg += (((unsigned long long) 0x01B21DD2) << 32) + 0x13814000; *clock_high = clock_reg >> 32; *clock_low = clock_reg; *ret_clock_seq = clock_seq; return 0; } void uuid_generate_time(uuid_t out) { static unsigned char node_id[6]; static int has_init = 0; struct uuid uu; __u32 clock_mid; if (!has_init) { if (get_node_id(node_id) <= 0) { get_random_bytes(node_id, 6); /* * Set multicast bit, to prevent conflicts * with IEEE 802 addresses obtained from * network cards */ node_id[0] |= 0x01; } has_init = 1; } get_clock(&clock_mid, &uu.time_low, &uu.clock_seq); uu.clock_seq |= 0x8000; uu.time_mid = (__u16) clock_mid; uu.time_hi_and_version = (clock_mid >> 16) | 0x1000; memcpy(uu.node, node_id, 6); uuid_pack2(&uu, out); } void uuid_generate_random(uuid_t out) { uuid_t buf; struct uuid uu; get_random_bytes(buf, sizeof(buf)); uuid_unpack2(buf, &uu); uu.clock_seq = (uu.clock_seq & 0x3FFF) | 0x8000; uu.time_hi_and_version = (uu.time_hi_and_version & 0x0FFF) | 0x4000; uuid_pack2(&uu, out); } /* * This is the generic front-end to uuid_generate_random and * uuid_generate_time. It uses uuid_generate_random only if * /dev/urandom is available, since otherwise we won't have * high-quality randomness. */ void uuid_generate(uuid_t out) { if (get_random_fd() >= 0) uuid_generate_random(out); else uuid_generate_time(out); } mediatomb-0.12.1/src/uuid/uuid_time.c0000664000076400007640000000544111351644352014364 00000000000000/* * uuid_time.c --- Interpret the time field from a uuid. This program * violates the UUID abstraction barrier by reaching into the guts * of a UUID and interpreting it. * * Copyright (C) 1998, 1999 Theodore Ts'o. * * %Begin-Header% * This file may be redistributed under the terms of the GNU * Library General Public License. * %End-Header% */ #include #include #include #include #include #include #include "uuidP.h" time_t uuid_time(const uuid_t uu, struct timeval *ret_tv) { struct uuid uuid; __u32 high; struct timeval tv; unsigned long long clock_reg; uuid_unpack2(uu, &uuid); high = uuid.time_mid | ((uuid.time_hi_and_version & 0xFFF) << 16); clock_reg = uuid.time_low | ((unsigned long long) high << 32); clock_reg -= (((unsigned long long) 0x01B21DD2) << 32) + 0x13814000; tv.tv_sec = clock_reg / 10000000; tv.tv_usec = (clock_reg % 10000000) / 10; if (ret_tv) *ret_tv = tv; return tv.tv_sec; } int uuid_type(const uuid_t uu) { struct uuid uuid; uuid_unpack2(uu, &uuid); return ((uuid.time_hi_and_version >> 12) & 0xF); } int uuid_variant(const uuid_t uu) { struct uuid uuid; int var; uuid_unpack2(uu, &uuid); var = uuid.clock_seq; if ((var & 0x8000) == 0) return UUID_VARIANT_NCS; if ((var & 0x4000) == 0) return UUID_VARIANT_DCE; if ((var & 0x2000) == 0) return UUID_VARIANT_MICROSOFT; return UUID_VARIANT_OTHER; } #ifdef DEBUG static const char *variant_string(int variant) { switch (variant) { case UUID_VARIANT_NCS: return "NCS"; case UUID_VARIANT_DCE: return "DCE"; case UUID_VARIANT_MICROSOFT: return "Microsoft"; default: return "Other"; } } int main(int argc, char **argv) { uuid_t buf; time_t time_reg; struct timeval tv; int type, variant; if (argc != 2) { fprintf(stderr, "Usage: %s uuid\n", argv[0]); exit(1); } if (uuid_parse(argv[1], buf)) { fprintf(stderr, "Invalid UUID: %s\n", argv[1]); exit(1); } variant = uuid_variant(buf); type = uuid_type(buf); time_reg = uuid_time(buf, &tv); printf("UUID variant is %d (%s)\n", variant, variant_string(variant)); if (variant != UUID_VARIANT_DCE) { printf("Warning: This program only knows how to interpret " "DCE UUIDs.\n\tThe rest of the output is likely " "to be incorrect!!\n"); } printf("UUID type is %d", type); switch (type) { case 1: printf(" (time based)\n"); break; case 2: printf(" (DCE)\n"); break; case 3: printf(" (name-based)\n"); break; case 4: printf(" (random)\n"); break; default: printf("\n"); } if (type != 1) { printf("Warning: not a time-based UUID, so UUID time " "decoding will likely not work!\n"); } printf("UUID time is: (%ld, %ld): %s\n", tv.tv_sec, tv.tv_usec, ctime(&time_reg)); return 0; } #endif mediatomb-0.12.1/src/uuid/unparse.c0000664000076400007640000000116311351644352014052 00000000000000/* * unparse.c -- convert a UUID to string * * Copyright (C) 1996, 1997 Theodore Ts'o. * * %Begin-Header% * This file may be redistributed under the terms of the GNU * Library General Public License. * %End-Header% */ #include #include "uuidP.h" void uuid_unparse(const uuid_t uu, char *out) { struct uuid uuid; uuid_unpack2(uu, &uuid); sprintf(out, "%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x", uuid.time_low, uuid.time_mid, uuid.time_hi_and_version, uuid.clock_seq >> 8, uuid.clock_seq & 0xFF, uuid.node[0], uuid.node[1], uuid.node[2], uuid.node[3], uuid.node[4], uuid.node[5]); } mediatomb-0.12.1/src/uuid/copy.c0000664000076400007640000000063011351644352013345 00000000000000/* * copy.c --- copy UUIDs * * Copyright (C) 1996, 1997 Theodore Ts'o. * * %Begin-Header% * This file may be redistributed under the terms of the GNU * Library General Public License. * %End-Header% */ #include "uuidP.h" void uuid_copy(uuid_t dst, const uuid_t src) { unsigned char *cp1; const unsigned char *cp2; int i; for (i=0, cp1 = dst, cp2 = src; i < 16; i++) *cp1++ = *cp2++; } mediatomb-0.12.1/src/uuid/compare.c0000664000076400007640000000144311351644352014024 00000000000000/* * compare.c --- compare whether or not two UUID's are the same * * Returns 0 if the two UUID's are different, and 1 if they are the same. * * Copyright (C) 1996, 1997 Theodore Ts'o. * * %Begin-Header% * This file may be redistributed under the terms of the GNU * Library General Public License. * %End-Header% */ #include "uuidP.h" #include #define UUCMP(u1,u2) if (u1 != u2) return((u1 < u2) ? -1 : 1); int uuid_compare(const uuid_t uu1, const uuid_t uu2) { struct uuid uuid1, uuid2; uuid_unpack2(uu1, &uuid1); uuid_unpack2(uu2, &uuid2); UUCMP(uuid1.time_low, uuid2.time_low); UUCMP(uuid1.time_mid, uuid2.time_mid); UUCMP(uuid1.time_hi_and_version, uuid2.time_hi_and_version); UUCMP(uuid1.clock_seq, uuid2.clock_seq); return memcmp(uuid1.node, uuid2.node, 6); } mediatomb-0.12.1/src/uuid/unpack.c0000664000076400007640000000131511351644352013655 00000000000000/* * Internal routine for unpacking UUID * * Copyright (C) 1996, 1997 Theodore Ts'o. * * %Begin-Header% * This file may be redistributed under the terms of the GNU * Library General Public License. * %End-Header% */ #include #include "uuidP.h" void uuid_unpack2(const uuid_t in, struct uuid *uu) { const __u8 *ptr = in; __u32 tmp; tmp = *ptr++; tmp = (tmp << 8) | *ptr++; tmp = (tmp << 8) | *ptr++; tmp = (tmp << 8) | *ptr++; uu->time_low = tmp; tmp = *ptr++; tmp = (tmp << 8) | *ptr++; uu->time_mid = tmp; tmp = *ptr++; tmp = (tmp << 8) | *ptr++; uu->time_hi_and_version = tmp; tmp = *ptr++; tmp = (tmp << 8) | *ptr++; uu->clock_seq = tmp; memcpy(uu->node, ptr, 6); } mediatomb-0.12.1/src/uuid/uuid.h0000664000076400007640000000233411351644352013351 00000000000000/* * Public include file for the UUID library * * Copyright (C) 1996, 1997, 1998 Theodore Ts'o. * * %Begin-Header% * This file may be redistributed under the terms of the GNU * Library General Public License. * %End-Header% */ #ifndef _UUID_UUID_H #define _UUID_UUID_H #include #include #include typedef unsigned char uuid_t[16]; /* UUID Variant definitions */ #define UUID_VARIANT_NCS 0 #define UUID_VARIANT_DCE 1 #define UUID_VARIANT_MICROSOFT 2 #define UUID_VARIANT_OTHER 3 #ifdef __cplusplus extern "C" { #endif /* clear.c */ void uuid_clear(uuid_t uu); /* compare.c */ int uuid_compare(const uuid_t uu1, const uuid_t uu2); /* copy.c */ void uuid_copy(uuid_t dst, const uuid_t src); /* gen_uuid.c */ void uuid_generate(uuid_t out); void uuid_generate_random(uuid_t out); void uuid_generate_time(uuid_t out); /* isnull.c */ int uuid_is_null(const uuid_t uu); /* parse.c */ int uuid_parse(const char *in, uuid_t uu); /* unparse.c */ void uuid_unparse(const uuid_t uu, char *out); /* uuid_time.c */ time_t uuid_time(const uuid_t uu, struct timeval *ret_tv); int uuid_type(const uuid_t uu); int uuid_variant(const uuid_t uu); #ifdef __cplusplus } #endif #endif /* _UUID_UUID_H */ mediatomb-0.12.1/src/uuid/parse.c0000664000076400007640000000204011351644352013502 00000000000000/* * parse.c --- UUID parsing * * Copyright (C) 1996, 1997 Theodore Ts'o. * * %Begin-Header% * This file may be redistributed under the terms of the GNU * Library General Public License. * %End-Header% */ #include #include #include #include #include "uuidP.h" int uuid_parse(const char *in, uuid_t uu) { struct uuid uuid; int i; const char *cp; char buf[3]; if (strlen(in) != 36) return -1; for (i=0, cp = in; i <= 36; i++,cp++) { if ((i == 8) || (i == 13) || (i == 18) || (i == 23)) { if (*cp == '-') continue; else return -1; } if (i== 36) if (*cp == 0) continue; if (!isxdigit(*cp)) return -1; } uuid.time_low = strtoul(in, NULL, 16); uuid.time_mid = strtoul(in+9, NULL, 16); uuid.time_hi_and_version = strtoul(in+14, NULL, 16); uuid.clock_seq = strtoul(in+19, NULL, 16); cp = in+24; buf[2] = 0; for (i=0; i < 6; i++) { buf[0] = *cp++; buf[1] = *cp++; uuid.node[i] = strtoul(buf, NULL, 16); } uuid_pack2(&uuid, uu); return 0; } mediatomb-0.12.1/src/uuid/clear.c0000664000076400007640000000046411351644352013466 00000000000000/* * clear.c -- Clear a UUID * * Copyright (C) 1996, 1997 Theodore Ts'o. * * %Begin-Header% * This file may be redistributed under the terms of the GNU * Library General Public License. * %End-Header% */ #include "string.h" #include "uuidP.h" void uuid_clear(uuid_t uu) { memset(uu, 0, 16); } mediatomb-0.12.1/src/uuid/uuidP.h0000664000076400007640000000122611351644352013470 00000000000000/* * uuid.h -- private header file for uuids * * Copyright (C) 1996, 1997 Theodore Ts'o. * * %Begin-Header% * This file may be redistributed under the terms of the GNU * Library General Public License. * %End-Header% */ #include #include "uuid_types.h" #include "uuid.h" /* * Offset between 15-Oct-1582 and 1-Jan-70 */ #define TIME_OFFSET_HIGH 0x01B21DD2 #define TIME_OFFSET_LOW 0x13814000 struct uuid { __u32 time_low; __u16 time_mid; __u16 time_hi_and_version; __u16 clock_seq; __u8 node[6]; }; /* * prototypes */ void uuid_pack2(const struct uuid *uu, uuid_t ptr); void uuid_unpack2(const uuid_t in, struct uuid *uu); mediatomb-0.12.1/src/uuid/uuid_types.h0000664000076400007640000000212311351644352014571 00000000000000/* * If linux/types.h is already been included, assume it has defined * everything we need. (cross fingers) Other header files may have * also defined the types that we need. */ #if (!defined(_LINUX_TYPES_H) && !defined(_BLKID_TYPES_H) && \ !defined(_UUID_TYPES) && !defined(_EXT2_TYPES_H)) #define _UUID_TYPES_H typedef unsigned char __u8; typedef signed char __s8; #if (4 == 8) typedef int __s64; typedef unsigned int __u64; #elif (4 == 8) typedef long __s64; typedef unsigned long __u64; #elif (8 == 8) #if defined(__GNUC__) typedef __signed__ long long __s64; #else typedef signed long long __s64; #endif typedef unsigned long long __u64; #endif #if (4 == 2) typedef int __s16; typedef unsigned int __u16; #elif (2 == 2) typedef short __s16; typedef unsigned short __u16; #else ?==error: undefined 16 bit type #endif #if (4 == 4) typedef int __s32; typedef unsigned int __u32; #elif (4 == 4) typedef long __s32; typedef unsigned long __u32; #elif (2 == 4) typedef short __s32; typedef unsigned short __u32; #else ?== error: undefined 32 bit type #endif #endif /* _*_TYPES_H */ mediatomb-0.12.1/src/io_handler_buffer_helper.cc0000664000076400007640000001426411352675003016572 00000000000000/*MT* MediaTomb - http://www.mediatomb.cc/ io_handler_buffer_helper.cc - this file is part of MediaTomb. Copyright (C) 2005 Gena Batyan , Sergey 'Jin' Bostandzhyan Copyright (C) 2006-2010 Gena Batyan , Sergey 'Jin' Bostandzhyan , Leonhard Wimmer MediaTomb is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. MediaTomb is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with MediaTomb; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. $Id: io_handler_buffer_helper.cc 2081 2010-03-23 20:18:00Z lww $ */ /// \file io_handler_buffer_helper.cc #ifdef HAVE_CONFIG_H #include "autoconfig.h" #endif #include "io_handler_buffer_helper.h" #include "config_manager.h" #include "tools.h" using namespace zmm; IOHandlerBufferHelper::IOHandlerBufferHelper(size_t bufSize, size_t initialFillSize) : IOHandler() { if (bufSize <=0) throw _Exception(_("bufSize must be positive")); if (initialFillSize < 0 || initialFillSize > bufSize) throw _Exception(_("initialFillSize must be non-negative and must be lesser than or equal to the size of the buffer")); mutex = Ref(new Mutex()); cond = Ref(new Cond(mutex)); this->bufSize = bufSize; this->initialFillSize = initialFillSize; waitForInitialFillSize = (initialFillSize > 0); buffer = NULL; isOpen = false; threadShutdown = false; eof = false; readError = false; a = b = posRead = 0; empty = true; signalAfterEveryRead = false; checkSocket = false; seekEnabled = false; doSeek = false; } void IOHandlerBufferHelper::open(IN enum UpnpOpenFileMode mode) { if (isOpen) throw _Exception(_("tried to reopen an open IOHandlerBufferHelper")); buffer = (char *)MALLOC(bufSize); if (buffer == NULL) throw _Exception(_("Failed to allocate memory for transcoding buffer!")); startBufferThread(); isOpen = true; } IOHandlerBufferHelper::~IOHandlerBufferHelper() { if (isOpen) close(); } int IOHandlerBufferHelper::read(OUT char *buf, IN size_t length) { // check read on closed BufferedIOHandler assert(isOpen); // length must be positive assert(length > 0); AUTOLOCK(mutex); while ((empty || waitForInitialFillSize) && ! (threadShutdown || eof || readError)) { if (checkSocket) { checkSocket = false; return CHECK_SOCKET; } else cond->wait(); } if (readError || threadShutdown) return -1; if (empty && eof) return 0; size_t bLocal = b; AUTOUNLOCK(); // we ensured with the while above that the buffer isn't empty int currentFillSize = bLocal - a; if (currentFillSize <= 0) currentFillSize += bufSize; size_t maxRead1 = (a < bLocal ? bLocal - a : bufSize - a); size_t read1 = (maxRead1 > length ? length : maxRead1); size_t maxRead2 = currentFillSize - read1; size_t read2 = (read1 < length ? length - read1 : 0); if (read2 > maxRead2) read2 = maxRead2; memcpy(buf, buffer + a, read1); if (read2) memcpy(buf + read1, buffer, read2); size_t didRead = read1+read2; AUTORELOCK(); bool signalled = false; // was the buffer full or became it "full" while we read? if (signalAfterEveryRead || a == b) { cond->signal(); signalled = true; } a += didRead; if (a >= bufSize) a -= bufSize; if (a == b) { empty = true; if (! signalled) cond->signal(); } posRead += didRead; return didRead; } void IOHandlerBufferHelper::seek(IN off_t offset, IN int whence) { log_debug("seek called: %lld %d\n", offset, whence); if (! seekEnabled) throw _Exception(_("seek currently disabled in this IOHandlerBufferHelper")); assert(isOpen); // check for valid input assert(whence == SEEK_SET || whence == SEEK_CUR || whence == SEEK_END); assert(whence != SEEK_SET || offset >= 0); assert(whence != SEEK_END || offset <= 0); // do nothing in this case if (whence == SEEK_CUR && offset == 0) return; AUTOLOCK(mutex); // if another seek isn't processed yet - well we don't care as this new seek // will change the position anyway doSeek = true; seekOffset = offset; seekWhence = whence; // tell the probably sleeping thread to process our seek cond->signal(); // wait until the seek has been processed while(doSeek && ! (threadShutdown || eof || readError)) cond->wait(); } void IOHandlerBufferHelper::close() { if (! isOpen) throw _Exception(_("close called on closed IOHandlerBufferHelper")); isOpen = false; stopBufferThread(); FREE(buffer); buffer = NULL; } // thread stuff... void IOHandlerBufferHelper::startBufferThread() { pthread_create( &bufferThread, NULL, // attr IOHandlerBufferHelper::staticThreadProc, this ); } void IOHandlerBufferHelper::stopBufferThread() { AUTOLOCK(mutex); threadShutdown = true; cond->signal(); AUTOUNLOCK(); if (bufferThread) pthread_join(bufferThread, NULL); bufferThread = 0; } void *IOHandlerBufferHelper::staticThreadProc(void *arg) { log_debug("starting buffer thread... thread: %d\n", pthread_self()); IOHandlerBufferHelper *inst = (IOHandlerBufferHelper *)arg; inst->threadProc(); log_debug("buffer thread shut down. thread: %d\n", pthread_self()); pthread_exit(NULL); return NULL; } mediatomb-0.12.1/src/sopcast_service.cc0000664000076400007640000001274611352675003014775 00000000000000/*MT* MediaTomb - http://www.mediatomb.cc/ sopcast_service.cc - this file is part of MediaTomb. Copyright (C) 2005 Gena Batyan , Sergey 'Jin' Bostandzhyan Copyright (C) 2006-2010 Gena Batyan , Sergey 'Jin' Bostandzhyan , Leonhard Wimmer MediaTomb is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. MediaTomb is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with MediaTomb; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. $Id: sopcast_service.cc 2081 2010-03-23 20:18:00Z lww $ */ /// \file sopcast_service.cc #ifdef HAVE_CONFIG_H #include "autoconfig.h" #endif #ifdef SOPCAST #include "zmm/zmm.h" #include "sopcast_service.h" #include "sopcast_content_handler.h" #include "content_manager.h" #include "string_converter.h" #include "config_manager.h" #include "server.h" using namespace zmm; using namespace mxml; #define SOPCAST_CHANNEL_URL "http://www.sopcast.com/gchlxml" SopCastService::SopCastService() { url = Ref(new URL()); pid = 0; curl_handle = curl_easy_init(); if (!curl_handle) throw _Exception(_("failed to initialize curl!\n")); } SopCastService::~SopCastService() { if (curl_handle) curl_easy_cleanup(curl_handle); } service_type_t SopCastService::getServiceType() { return OS_SopCast; } String SopCastService::getServiceName() { return _("SopCast"); } Ref SopCastService::defineServiceTask(Ref xmlopt, Ref params) { return nil; } Ref SopCastService::getData() { long retcode; Ref sc = StringConverter::i2i(); Ref buffer; try { log_debug("DOWNLOADING URL: %s\n", SOPCAST_CHANNEL_URL); buffer = url->download(_(SOPCAST_CHANNEL_URL), &retcode, curl_handle, false, true, true); } catch (Exception ex) { log_error("Failed to download SopCast XML data: %s\n", ex.getMessage().c_str()); return nil; } if (buffer == nil) return nil; if (retcode != 200) return nil; log_debug("GOT BUFFER\n%s\n", buffer->toString().c_str()); Ref parser(new Parser()); try { return parser->parseString(sc->convert(buffer->toString()))->getRoot(); } catch (ParseException pe) { log_error("Error parsing SopCast XML %s line %d:\n%s\n", pe.context->location.c_str(), pe.context->line, pe.getMessage().c_str()); return nil; } catch (Exception ex) { log_error("Error parsing SopCast XML %s\n", ex.getMessage().c_str()); return nil; } return nil; } bool SopCastService::refreshServiceData(Ref layout) { log_debug("Refreshing SopCast service\n"); // the layout is in full control of the service items // this is a safeguard to ensure that this class is not called from // multiple threads - it is not allowed to use the same curl handle // from multiple threads // we do it here because the handle is initialized in a different thread // which is OK if (pid == 0) pid = pthread_self(); if (pid != pthread_self()) throw _Exception(_("Not allowed to call refreshServiceData from different threads!")); Ref reply = getData(); Ref sc(new SopCastContentHandler()); if (reply != nil) sc->setServiceContent(reply); else { log_debug("Failed to get XML content from SopCast service\n"); throw _Exception(_("Failed to get XML content from SopCast service")); } Ref obj; do { /// \todo add try/catch here and a possibility do find out if we /// may request more stuff or if we are at the end of the list obj = sc->getNextObject(); if (obj == nil) break; obj->setVirtual(true); Ref old = Storage::getInstance()->loadObjectByServiceID(RefCast(obj, CdsItem)->getServiceID()); if (old == nil) { log_debug("Adding new SopCast object\n"); if (layout != nil) layout->processCdsObject(obj, nil); } else { log_debug("Updating existing SopCast object\n"); obj->setID(old->getID()); obj->setParentID(old->getParentID()); struct timespec oldt, newt; oldt.tv_nsec = 0; oldt.tv_sec = old->getAuxData(_(ONLINE_SERVICE_LAST_UPDATE)).toLong(); newt.tv_nsec = 0; newt.tv_sec = obj->getAuxData(_(ONLINE_SERVICE_LAST_UPDATE)).toLong(); ContentManager::getInstance()->updateObject(obj); } if (Server::getInstance()->getShutdownStatus()) return false; } while (obj != nil); return false; } #endif//SOPCAST mediatomb-0.12.1/src/weborama_service.cc0000664000076400007640000004627411352675141015124 00000000000000/*MT* MediaTomb - http://www.mediatomb.cc/ weborama_service.cc - this file is part of MediaTomb. Copyright (C) 2005 Gena Batyan , Sergey 'Jin' Bostandzhyan Copyright (C) 2006-2010 Gena Batyan , Sergey 'Jin' Bostandzhyan , Leonhard Wimmer MediaTomb is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. MediaTomb is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with MediaTomb; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. $Id: weborama_service.cc 2083 2010-03-25 14:58:48Z jin_eld $ */ /// \file weborama_service.cc #ifdef HAVE_CONFIG_H #include "autoconfig.h" #endif #ifdef WEBORAMA #include "zmm/zmm.h" #include "weborama_service.h" #include "weborama_content_handler.h" #include "content_manager.h" #include "string_converter.h" #include "config_manager.h" #include "config_options.h" #include "server.h" using namespace zmm; using namespace mxml; #define WEBORAMA_SERVICE_URL "www.weborama.ru/modules/player/index_xspf.php" /// \todo ask Nick if this value makes sense #define DEFAULT_PER_TASK_AMOUNT (1000) #define WEBORAMA_VALUE_PER_REQUEST_MAX (100) // Weborama defines #define FILTER_OPTION_FAVORITE "favourite" #define FILTER_OPTION_FRIENDS "friends" #define FILTER_OPTION_USERID "userId" #define FILTER_OPTION_UPLOADED "uploaded" //#define FILTER_OPTION_USER_COUNT "user_count" #define FILTER_OPTION_USER_LAST "used_last" #define FILTER_OPTION_ALL "all" #define FILTER_OPTION_GENREID "genreId" #define FILTER_OPTION_SORT "sort" #define FILTER_SEPARATOR ";" #define FILTER_VALUE_SEPARATOR ":" #define PARAM_LIMIT "limit" #define PARAM_OFFSET "offset" #define PARAM_COVER_SIZE "coverSize" #define PARAM_FILTER "filter" #define PARAM_TYPE "type" #define PARAM_MOOD "mood" #define PARAM_ACTION "action" #define PARAM_ID "id" #define VALUE_COVER_SIZE_DLNA "160" #define VALUE_TYPE_PLAYLIST "playlist" #define VALUE_TYPE_AUDIO "audio" // config.xml defines #define CFG_REQUEST_PLAYLIST "playlist" #define CFG_SECTION_FILTER "filter" #define CFG_SECTION_GENRES "genres" #define CFG_SECTION_SORT "sort" #define CFG_SECTION_TYPE "type" #define CFG_SORT_FAVORITE "favorite" #define CFG_SORT_FRIENDS "friends" #define CFG_SORT_UPLOADED "uploaded" #define CFG_SORT_USED_LAST "used_last" #define CFG_SORT_ALL "all" #define CFG_OPTION_PLAYLIST_NAME "name" #define CFG_MOOD_0 "calm-positive" #define CFG_MOOD_1 "positive" #define CFG_MOOD_2 "energetic-positive" #define CFG_MOOD_3 "calm" #define CFG_MOOD_4 "neutral" #define CFG_MOOD_5 "energetic" #define CFG_MOOD_6 "calm-dark" #define CFG_MOOD_7 "dark" #define CFG_MOOD_8 "energetic-dark" #define CFG_TYPE_AUDIO "audio" #define CFG_TYPE_PLAYLIST "playlist" #define CFG_TYPE_ALBUM "album" /* Электронная 67 Русская попса 400 Альтернатива 60 Саундтрек 353 Джаз 65 Русский рок 315 Металл 272 Ретро 568 Поп 69 Панк 388 Ритм энд блюз 738 Рэп 593 Регги 699 Рок 68 Классическая 976 Шансон 566 Фолк 63 */ #define CFG_GENRE_ELECT "electronic" #define CFG_GENRE_ALT "alternative" #define CFG_GENRE_JAZZ "jazz" #define CFG_GENRE_METAL "metal" #define CFG_GENRE_DMETAL "death-metal" #define CFG_GENRE_POP "pop" #define CFG_GENRE_PUNK "punk" #define CFG_GENRE_RNB "rhytm-and-blues" #define CFG_GENRE_RAP "rap" #define CFG_GENRE_REG "reggae" #define CFG_GENRE_ROCK "rock" #define CFG_GENRE_CLAS "classic" #define CFG_GENRE_ST "soundtrack" #define CFG_GENRE_RETRO "retro" #define CFG_GENRE_RUSROCK "russian-rock" #define CFG_GENRE_RUSPOP "russian-pop" #define CFG_GENRE_CHAN "chanson" #define CFG_GENRE_FOLK "folk" typedef struct wr_mood wr_mood; struct wr_mood { wr_mood_t mood; const char *cfg_name; const char *aux_name; }; wr_mood WR_mood[] = { { WR_mood_calm_positive, CFG_MOOD_0, "Calm-Positive" }, { WR_mood_positive, CFG_MOOD_1, "Positive" }, { WR_mood_energetic_positive, CFG_MOOD_2, "Energetic-Positive" }, { WR_mood_calm, CFG_MOOD_3, "Calm" }, { WR_mood_neutral, CFG_MOOD_4, "Neutral" }, { WR_mood_energetic, CFG_MOOD_5, "Energetic" }, { WR_mood_calm_dark, CFG_MOOD_6, "Calm-Dark" }, { WR_mood_dark, CFG_MOOD_7, "Dark" }, { WR_mood_energetic_dark, CFG_MOOD_8, "Energetic-Dark" }, { WR_mood_none, NULL, NULL }, }; typedef struct wr_genre wr_genre; struct wr_genre { wr_genre_t genre; int id; const char *cfg_name; const char *aux_name; }; wr_genre WR_genre[] = { { WR_genre_electronic, 67, CFG_GENRE_ELECT, "Electronic" }, { WR_genre_alternative, 60, CFG_GENRE_ALT, "Alternative" }, { WR_genre_jazz, 65, CFG_GENRE_JAZZ, "Jazz" }, { WR_genre_metal, 181, CFG_GENRE_METAL, "Metal" }, { WR_genre_death_metal, 549, CFG_GENRE_DMETAL, "Death Metal" }, { WR_genre_pop, 69, CFG_GENRE_POP, "Pop" }, { WR_genre_punk, 388, CFG_GENRE_PUNK, "Punk" }, { WR_genre_rhytm_and_blues, 738, CFG_GENRE_RNB, "Rhytm And Blues" }, { WR_genre_rap, 593, CFG_GENRE_RAP, "Rap" }, { WR_genre_reggae, 699, CFG_GENRE_REG, "Reggae" }, { WR_genre_rock, 68, CFG_GENRE_ROCK, "Rock" }, { WR_genre_classic, 976, CFG_GENRE_CLAS, "Classic" }, { WR_genre_soundtrack, 353, CFG_GENRE_ST, "Soundtrack" }, { WR_genre_retro, 568, CFG_GENRE_RETRO, "Retro" }, { WR_genre_russian_rock, 315, CFG_GENRE_RUSROCK, "Russian Rock" }, { WR_genre_russian_pop, 400, CFG_GENRE_RUSPOP, "Russian Pop" }, { WR_genre_chanson, 566, CFG_GENRE_CHAN, "Chanson" }, { WR_genre_folk, 63, CFG_GENRE_FOLK, "Folk" }, { WR_genre_none, -1, NULL, NULL }, }; WeboramaService::WeboramaService() { url = Ref(new URL()); pid = 0; curl_handle = curl_easy_init(); if (!curl_handle) throw _Exception(_("failed to initialize curl!\n")); current_task = 0; } WeboramaService::~WeboramaService() { if (curl_handle) curl_easy_cleanup(curl_handle); } WeboramaService::WeboramaTask::WeboramaTask() { parameters = zmm::Ref(new Dictionary()); amount = 0; amount_fetched = 0; start_index = 0; } service_type_t WeboramaService::getServiceType() { return OS_Weborama; } String WeboramaService::getServiceName() { return _("Weborama"); } wr_mood_t WeboramaService::getMood(Ref xml) { String temp = xml->getAttribute(_("mood")); if (!string_ok(temp)) return WR_mood_none; int i = temp.toInt(); if ((i < 0) || (i >= WR_mood_none)) throw _Exception(_("Weborama: invalid mood specified for tag <") + xml->getName() + ">"); return WR_mood[i].mood; } wr_genre_t WeboramaService::getGenre(String genre) { if (!string_ok(genre)) return WR_genre_none; for (int i = (int)WR_genre_electronic; i < (int)WR_genre_none; i++) { if (genre == WR_genre[i].cfg_name) return WR_genre[i].genre; } return WR_genre_none; } int WeboramaService::getGenreID(wr_genre_t genre) { if (((int)genre < 0) || ((int)genre > WR_genre_none)) return -1; return WR_genre[genre].id; } Ref WeboramaService::defineServiceTask(Ref xmlopt, Ref params) { Ref task(new WeboramaTask()); String temp = xmlopt->getName(); task->parameters->put(_(PARAM_COVER_SIZE), _(VALUE_COVER_SIZE_DLNA)); task->amount = DEFAULT_PER_TASK_AMOUNT; if (temp == CFG_REQUEST_PLAYLIST) { task->name = getCheckAttr(xmlopt, _(CFG_OPTION_PLAYLIST_NAME)); Ref type = xmlopt->getChildByName(_(CFG_SECTION_TYPE)); if (type != nil) { String id = type->getAttribute(_("id")); temp = type->getText(); if (string_ok(temp)) { if ((temp != CFG_TYPE_ALBUM) && (temp != CFG_TYPE_AUDIO) && (temp != CFG_TYPE_PLAYLIST)) throw _Exception(_("Weborama: ") + temp + _(" type is invalid!")); if (((temp == CFG_TYPE_ALBUM) || (temp == CFG_TYPE_AUDIO)) && (!string_ok(id) || id == "0")) { throw _Exception(_("Weborama: ") + temp + _(" type requires a valid id parameter!")); } task->parameters->put(_(PARAM_TYPE), temp); if (string_ok(id)) task->parameters->put(_(PARAM_ID), id); } } wr_mood_t mood = getMood(xmlopt); if (mood != WR_mood_none) task->parameters->put(_(PARAM_MOOD), String::from((int)mood)); Ref filter = xmlopt->getChildByName(_(CFG_SECTION_FILTER)); if (filter != nil) { String filters; String genres = filter->getChildText(_(CFG_SECTION_GENRES)); if (string_ok(genres)) { String g; Ref > parts = split_string(genres, ','); for (int i = 0; i < parts->size(); i++) { wr_genre_t genre = getGenre(parts->get(i)); if (genre == WR_genre_none) continue; g = g + String::from(getGenreID(genre)) + _(","); } if (string_ok(g)) filters = _(FILTER_OPTION_GENREID) + _(FILTER_VALUE_SEPARATOR) + g.substring(0, g.length()-1); } Ref sort_tag = filter->getChildByName(_("sort")); if (sort_tag != nil) { String user_id = sort_tag->getAttribute(_("user-id")); String sort = sort_tag->getText(); if (string_ok(sort)) { if (!string_ok(user_id)) throw _Exception(_("Weborama: sort option requires a " "valid user-id setting!")); if ((sort != CFG_SORT_FAVORITE) && (sort != CFG_SORT_FRIENDS) && (sort != CFG_SORT_UPLOADED) && (sort != CFG_SORT_USED_LAST) && (sort != CFG_SORT_ALL)) throw _Exception(_("Weborama: ") + sort + _(" sort is invalid!")); // ok, this is a little hack'ish, but so far the config // names match nicely with the actual parameters... // all but one if (sort == CFG_SORT_FAVORITE) sort = _(FILTER_OPTION_FAVORITE); if (string_ok(filters)) filters = filters + _(FILTER_SEPARATOR); filters = filters + _(FILTER_OPTION_SORT) + _(FILTER_VALUE_SEPARATOR) + sort + _(FILTER_SEPARATOR) + _(FILTER_OPTION_USERID) + user_id; } } if (string_ok(filters)) task->parameters->put(_(PARAM_FILTER), filters); } temp = xmlopt->getAttribute(_("amount")); if (string_ok(temp)) { int amount = temp.toInt(); if (amount < 0) throw _Exception(_("Weborama: invalid amount specified for task ") + xmlopt->getName()); task->amount = amount; } else task->amount = DEFAULT_PER_TASK_AMOUNT; } else return nil; return RefCast(task, Object); } Ref WeboramaService::getData(Ref params) { long retcode; Ref sc = StringConverter::i2i(); Ref buffer; try { String URL = _(WEBORAMA_SERVICE_URL) + _("?") + params->encode(); log_debug("DOWNLOADING URL: %s\n", URL.c_str()); buffer = url->download(URL, &retcode, curl_handle, false, true, true); } catch (Exception ex) { log_error("Failed to download Weborama XML data: %s\n", ex.getMessage().c_str()); return nil; } if (buffer == nil) return nil; if (retcode != 200) return nil; log_debug("GOT BUFFER\n%s\n", buffer->toString().c_str()); Ref parser(new Parser()); try { return parser->parseString(sc->convert(buffer->toString()))->getRoot(); } catch (ParseException pe) { log_error("Error parsing Weborama XML %s line %d:\n%s\n", pe.context->location.c_str(), pe.context->line, pe.getMessage().c_str()); return nil; } catch (Exception ex) { log_error("Error parsing Weborama XML %s\n", ex.getMessage().c_str()); return nil; } return nil; } bool WeboramaService::refreshServiceData(Ref layout) { log_debug("Refreshing Weborama service\n"); // the layout is in full control of the service items // this is a safeguard to ensure that this class is not called from // multiple threads - it is not allowed to use the same curl handle // from multiple threads // we do it here because the handle is initialized in a different thread // which is OK if (pid == 0) pid = pthread_self(); if (pid != pthread_self()) throw _Exception(_("Not allowed to call refreshServiceData from different threads!")); Ref config = ConfigManager::getInstance(); Ref > tasklist = config->getObjectArrayOption(CFG_ONLINE_CONTENT_WEBORAMA_TASK_LIST); if (tasklist->size() == 0) throw _Exception(_("Not specified what content to fetch!")); Ref task = RefCast(tasklist->get(current_task), WeboramaTask); if (task == nil) throw _Exception(_("Encountered invalid task!")); if (task->amount_fetched < task->amount) { task->start_index = task->amount_fetched; task->parameters->put(_(PARAM_OFFSET), String::from(task->start_index)); if ((task->amount - task->amount_fetched) >= WEBORAMA_VALUE_PER_REQUEST_MAX) { task->parameters->put(_(PARAM_LIMIT), String::from(WEBORAMA_VALUE_PER_REQUEST_MAX)); } else if ((task->amount - task->amount_fetched) < WEBORAMA_VALUE_PER_REQUEST_MAX) { task->parameters->put(_(PARAM_LIMIT), String::from(task->amount - task->amount_fetched)); } } bool b = false; Ref reply = getData(task->parameters); Ref sc(new WeboramaContentHandler()); if (reply != nil) b = sc->setServiceContent(reply); else { log_debug("Failed to get XML content from Weborama service\n"); throw _Exception(_("Failed to get XML content from Weborama service")); } if (!b) { log_debug("End of pages\n"); task->amount_fetched = 0; task->start_index = 0; current_task++; if (current_task >= tasklist->size()) { current_task = 0; return false; } return true; } /// \todo make sure the CdsResourceManager knows whats going on, /// since those items do not contain valid links but need to be /// processed later on (i.e. need to figure out the real link to the flv) Ref obj; do { obj = sc->getNextObject(); if (obj == nil) { if (task->amount_fetched < task->amount) return true; else break; } obj->setVirtual(true); obj->setAuxData(_(WEBORAMA_AUXDATA_REQUEST_NAME), task->name); RefCast(obj, CdsItemExternalURL)->setTrackNumber(task->amount_fetched+1); Ref old = Storage::getInstance()->loadObjectByServiceID(RefCast(obj, CdsItem)->getServiceID()); if (old == nil) { log_debug("Adding new Weborama object\n"); if (layout != nil) layout->processCdsObject(obj, nil); } else { log_debug("Updating existing Weborama object\n"); obj->setID(old->getID()); obj->setParentID(old->getParentID()); struct timespec oldt, newt; oldt.tv_nsec = 0; oldt.tv_sec = old->getAuxData(_(ONLINE_SERVICE_LAST_UPDATE)).toLong(); newt.tv_nsec = 0; newt.tv_sec = obj->getAuxData(_(ONLINE_SERVICE_LAST_UPDATE)).toLong(); ContentManager::getInstance()->updateObject(obj); } task->amount_fetched++; if (task->amount_fetched >= task->amount) { task->amount_fetched = 0; task->start_index = 0; current_task++; if (current_task >= tasklist->size()) { current_task = 0; return false; } } if (Server::getInstance()->getShutdownStatus()) return false; } while (obj != nil); current_task++; if (current_task >= tasklist->size()) { current_task = 0; return false; } return false; } #endif//WEBORAMA mediatomb-0.12.1/src/reentrant_array.h0000664000076400007640000000602411352675003014633 00000000000000/*MT* MediaTomb - http://www.mediatomb.cc/ reentrant_array.h - this file is part of MediaTomb. Copyright (C) 2005 Gena Batyan , Sergey 'Jin' Bostandzhyan Copyright (C) 2006-2010 Gena Batyan , Sergey 'Jin' Bostandzhyan , Leonhard Wimmer MediaTomb is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. MediaTomb is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with MediaTomb; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. $Id: reentrant_array.h 2081 2010-03-23 20:18:00Z lww $ */ /// \file reentrant_array.h /// \brief Definiton of the ReentrantArray class. #ifndef __REENTRANT_ARRAY_H__ #define __REENTRANT_ARRAY_H__ #include "zmmf/zmmf.h" #include "sync.h" /// \brief Reentrant version of the object array template class ReentrantArray : public zmm::Array { public: ReentrantArray() : zmm::Array() { mutex = zmm::Ref(new Mutex()); } ReentrantArray(int capacity) : zmm::Array(capacity) { mutex = zmm::Ref(new Mutex()); } inline void append(zmm::Ref el) { mutex->lock(); zmm::Array::append(el); mutex->unlock(); } inline void set(zmm::Ref el, int index) { mutex->lock(); zmm::Array::set(el, index); mutex->unlock(); } inline zmm::Ref get(int index) { zmm::Ref ret; mutex->lock(); ret = zmm::Array::get(index); mutex->unlock(); return ret; } inline void remove(int index, int count=1) { mutex->lock(); zmm::Array::set(index, count); mutex->unlock(); } inline void removeUnordered(int index) { mutex->lock(); zmm::Array::removeUnordered(index); mutex->unlock(); } inline void insert(int index, zmm::Ref el) { mutex->lock(); zmm::Array::insert(index, el); mutex->unlock(); } inline int size() { int size; mutex->lock(); size = zmm::Array::size(); mutex->unlock(); return size; } inline void clear() { mutex->lock(); zmm::Array::clear(); mutex->unlock(); } inline void optimize() { mutex->lock(); zmm::Array::optimize(); mutex->unlock(); } protected: zmm::Ref mutex; }; #endif // __REENTRANT_ARRAY_H__ mediatomb-0.12.1/src/upnp_xml.h0000664000076400007640000000715411352675003013302 00000000000000/*MT* MediaTomb - http://www.mediatomb.cc/ upnp_xml.h - this file is part of MediaTomb. Copyright (C) 2005 Gena Batyan , Sergey 'Jin' Bostandzhyan Copyright (C) 2006-2010 Gena Batyan , Sergey 'Jin' Bostandzhyan , Leonhard Wimmer MediaTomb is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. MediaTomb is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with MediaTomb; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. $Id: upnp_xml.h 2081 2010-03-23 20:18:00Z lww $ */ /// \file upnp_xml.h /// \brief Provides various XML related functions, basically a toolkit. #ifndef __UPNP_XML_H__ #define __UPNP_XML_H__ #include "common.h" #include "mxml/mxml.h" #include "cds_objects.h" /// \brief Renders XML for the action response header. /// \param actionName Name of the action. /// \param serviceType Type of service. /// \return mxml::Element representing the newly created XML. /// /// Basically it renders an XML that looks like the following: /// /// Further response information (various parameters, DIDL-Lite or /// whatever can then be adapted to it. zmm::Ref UpnpXML_CreateResponse(zmm::String actionName, zmm::String serviceType); /// \brief Renders the DIDL-Lite representation of an object in the content directory. /// \param obj Object to be rendered as XML. /// \param renderActions If true, also render special elements of an active item. /// \return mxml::Element representing the newly created XML. /// /// This function looks at the object, and renders the DIDL-Lite representation of it - /// either a container or an item. The renderActions parameter tells us whether to also /// show the special fields of an active item in the XML. This is currently used when /// providing the XML representation of an active item to a trigger/toggle script. zmm::Ref UpnpXML_DIDLRenderObject(zmm::Ref obj, bool renderActions = false, int stringLimit = -1); /// \todo change the text string to element, parsing should be done outside void UpnpXML_DIDLUpdateObject(zmm::Ref obj, zmm::String text); /// \brief Renders XML for the event property set. /// \return mxml::Element representing the newly created XML. zmm::Ref UpnpXML_CreateEventPropertySet(); /// \brief Renders the device description XML. /// \return mxml::Element representing the newly created device description. /// /// Some elements are statically defined in common.h, others are loaded /// from the config with the help of the ConfigManager. zmm::Ref UpnpXML_RenderDeviceDescription(zmm::String presentationUTL = nil); /// \brief Renders a resource tag (part of DIDL-Lite XML) /// \param URL download location of the item (will be child element of the tag) /// \param attributes Dictionary containing the tag attributes (like resolution, etc.) zmm::Ref UpnpXML_DIDLRenderResource(zmm::String URL, zmm::Ref attributes); #endif // __UPNP_XML_H__ mediatomb-0.12.1/src/update_manager.h0000664000076400007640000000405411352675003014410 00000000000000/*MT* MediaTomb - http://www.mediatomb.cc/ update_manager.h - this file is part of MediaTomb. Copyright (C) 2005 Gena Batyan , Sergey 'Jin' Bostandzhyan Copyright (C) 2006-2010 Gena Batyan , Sergey 'Jin' Bostandzhyan , Leonhard Wimmer MediaTomb is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. MediaTomb is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with MediaTomb; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. $Id: update_manager.h 2081 2010-03-23 20:18:00Z lww $ */ /// \file update_manager.h #ifndef __UPDATE_MANAGER_H__ #define __UPDATE_MANAGER_H__ #include "common.h" #include "singleton.h" #include "hash.h" #include "sync.h" #define FLUSH_ASAP 2 #define FLUSH_SPEC 1 class UpdateManager : public Singleton { public: UpdateManager(); virtual void shutdown(); virtual void init(); void containerChanged(int objectID, int flushPolicy = FLUSH_SPEC); void containersChanged(zmm::Ref objectIDs, int flushPolicy = FLUSH_SPEC); protected: pthread_t updateThread; zmm::Ref cond; zmm::Ref > objectIDHash; bool shutdownFlag; int flushPolicy; int lastContainerChanged; static void *staticThreadProc(void *arg); void threadProc(); inline bool haveUpdates() { return (objectIDHash->size() > 0); } }; #endif // __UPDATE_MANAGER_H__ mediatomb-0.12.1/src/action_request.h0000664000076400007640000000760311352675003014464 00000000000000/*MT* MediaTomb - http://www.mediatomb.cc/ action_request.h - this file is part of MediaTomb. Copyright (C) 2005 Gena Batyan , Sergey 'Jin' Bostandzhyan Copyright (C) 2006-2010 Gena Batyan , Sergey 'Jin' Bostandzhyan , Leonhard Wimmer MediaTomb is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. MediaTomb is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with MediaTomb; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. $Id: action_request.h 2081 2010-03-23 20:18:00Z lww $ */ /// \file action_request.h /// \brief Definition of the ActionRequest class. #ifndef __ACTION_REQUEST_H__ #define __ACTION_REQUEST_H__ #include "common.h" #include "upnp.h" #include "mxml/mxml.h" /// \brief This class represents the Upnp_Action_Request type from the SDK. /// /// When we get a Upnp_Action_Request from the SDK we convert it to our /// structure. The idea is to get the XML of the request, process it outside /// of the class, create a response XML and put it back in. Before pasing /// *upnp_request back to the SDK the update() function MUST be called. class ActionRequest : public zmm::Object { protected: /// \brief Upnp_Action_Request that comes from the SDK. Upnp_Action_Request *upnp_request; /// \brief Error code that is returned to the SDK. int errCode; /// \brief Name of the action. /// /// Returned by getActionName() zmm::String actionName; /// \brief UDN of the recepient device (it should be our UDN) /// /// Returned by getUDN() zmm::String UDN; /// \brief ID of the service. /// /// Returned by getServiceID() zmm::String serviceID; /// \brief XML holding the request that comes to us. /// /// Returned by getRequest() zmm::Ref request; /// \brief XML holding the response, we fill it in. /// /// Set by setResponse() zmm::Ref response; public: /// \brief The Constructor takes the values from the upnp_request and fills in internal variables. /// \param *upnp_request Pointer to the Upnp_Action_Request structure. ActionRequest(Upnp_Action_Request *upnp_request); /// \brief Returns the name of the action. zmm::String getActionName(); /// \brief Returns the UDN of the recepient device (should be ours) zmm::String getUDN(); /// \brief Returns the ID of the service (the action is for this service id) zmm::String getServiceID(); /// \brief Returns the XML representation of the request. zmm::Ref getRequest(); /// \brief Sets the response (XML created outside as the answer to the request) /// \param response XML holding the action response. void setResponse(zmm::Ref response); /// \brief Set the error code for the SDK. /// \param errCode UPnP error code. /// /// In case there was an error processing the request, we can return the /// appropriate error code to the SDK. void setErrorCode(int errCode); /// \brief Updates the upnp_request structure. /// /// This function writes all changed values into the upnp_request structure, and /// must be called at the very end before giving *upnp_request back to the SDK. void update(); }; #endif // __ACTION_REQUEST_H__ mediatomb-0.12.1/src/process_io_handler.h0000664000076400007640000000776011352675003015305 00000000000000/*MT* MediaTomb - http://www.mediatomb.cc/ process_io_handler.h - this file is part of MediaTomb. Copyright (C) 2005 Gena Batyan , Sergey 'Jin' Bostandzhyan Copyright (C) 2006-2010 Gena Batyan , Sergey 'Jin' Bostandzhyan , Leonhard Wimmer MediaTomb is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. MediaTomb is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with MediaTomb; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. $Id: process_io_handler.h 2081 2010-03-23 20:18:00Z lww $ */ /// \file process_io_handler.h /// \brief Definition of the ProcessIOHandler class. #ifndef __PROCESS_IO_HANDLER_H__ #define __PROCESS_IO_HANDLER_H__ #include "common.h" #include "io_handler.h" #include "executor.h" #define FIFO_READ_TIMEOUT 2 #define FIFO_WRITE_TIMEOUT 2 class ProcListItem : public zmm::Object { public: ProcListItem(zmm::Ref exec, bool abortOnDeath = false); zmm::Ref getExecutor(); bool abortOnDeath(); protected: zmm::Ref executor; bool abort; }; /// \brief Allows the web server to read from a fifo. class ProcessIOHandler : public IOHandler { public: /// \brief Sets the filename to work with. /// \param filename to read the data from /// \param proclist associated processes that will be terminated once /// they are no longer needed ProcessIOHandler(zmm::String filename, zmm::Ref main_proc, zmm::Ref > proclist = nil, bool ignoreSeek = false); /// \brief Opens file for reading (writing is not supported) virtual void open(IN enum UpnpOpenFileMode mode); /// \brief Reads a previously opened file sequentially. /// \param buf Data from the file will be copied into this buffer. /// \param length Number of bytes to be copied into the buffer. virtual int read(OUT char *buf, IN size_t length); /// \brief Writes to a previously opened file. /// \param buf Data from the buffer will be written to the file. /// \param length Number of bytes to be written from the buffer. /// \return number of bytes written. virtual int write(OUT char *buf, IN size_t length); /// \brief Performs seek on an open file. /// \param offset Number of bytes to move in the file. For seeking forwards /// positive values are used, for seeking backwards - negative. Offset must /// be positive if origin is set to SEEK_SET /// \param whence The position to move relative to. SEEK_CUR to move relative /// to current position, SEEK_END to move relative to the end of file, /// SEEK_SET to specify an absolute offset. virtual void seek(IN off_t offset, IN int whence); /// \brief Close a previously opened file and kills the kill_pid process virtual void close(); ~ProcessIOHandler(); protected: /// \brief List of associated processes. zmm::Ref > proclist; /// \brief Main process used for reading zmm::Ref main_proc; /// \brief name of the file or fifo to read the data from zmm::String filename; /// \brief file descriptor int fd; /// \brief if this flag is set seek on a fifo will not return an error bool ignore_seek; bool abort(); void killall(); void registerAll(); void unregisterAll(); }; #endif // __PROCESS_IO_HANDLER_H__ mediatomb-0.12.1/src/cds_objects.h0000664000076400007640000005062511352675003013723 00000000000000/*MT* MediaTomb - http://www.mediatomb.cc/ cds_objects.h - this file is part of MediaTomb. Copyright (C) 2005 Gena Batyan , Sergey 'Jin' Bostandzhyan Copyright (C) 2006-2010 Gena Batyan , Sergey 'Jin' Bostandzhyan , Leonhard Wimmer MediaTomb is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. MediaTomb is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with MediaTomb; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. $Id: cds_objects.h 2081 2010-03-23 20:18:00Z lww $ */ /// \file cds_objects.h /// \brief Definition for the CdsObject, CdsItem, CdsActiveItem and CdsContainer classes. #ifndef __CDS_OBJECTS_H__ #define __CDS_OBJECTS_H__ #include "common.h" #include "dictionary.h" #include "cds_resource.h" // ATTENTION: These values need to be changed in web/js/items.js too. #define OBJECT_TYPE_CONTAINER 0x00000001 #define OBJECT_TYPE_ITEM 0x00000002 #define OBJECT_TYPE_ACTIVE_ITEM 0x00000004 #define OBJECT_TYPE_ITEM_EXTERNAL_URL 0x00000008 #define OBJECT_TYPE_ITEM_INTERNAL_URL 0x00000010 #define STRING_OBJECT_TYPE_CONTAINER "container" #define STRING_OBJECT_TYPE_ITEM "item" #define STRING_OBJECT_TYPE_ACTIVE_ITEM "active_item" #define STRING_OBJECT_TYPE_EXTERNAL_URL "external_url" #define STRING_OBJECT_TYPE_INTERNAL_URL "internal_url" #define IS_CDS_CONTAINER(type) (type & OBJECT_TYPE_CONTAINER) #define IS_CDS_ITEM(type) (type & OBJECT_TYPE_ITEM) #define IS_CDS_ACTIVE_ITEM(type) (type & OBJECT_TYPE_ACTIVE_ITEM) #define IS_CDS_ITEM_EXTERNAL_URL(type) (type & OBJECT_TYPE_ITEM_EXTERNAL_URL) #define IS_CDS_ITEM_INTERNAL_URL(type) (type & OBJECT_TYPE_ITEM_INTERNAL_URL) #define IS_CDS_PURE_ITEM(type) (type == OBJECT_TYPE_ITEM) #define OBJECT_FLAG_RESTRICTED 0x00000001 #define OBJECT_FLAG_SEARCHABLE 0x00000002 #define OBJECT_FLAG_USE_RESOURCE_REF 0x00000004 #define OBJECT_FLAG_PERSISTENT_CONTAINER 0x00000008 #define OBJECT_FLAG_PLAYLIST_REF 0x00000010 #define OBJECT_FLAG_PROXY_URL 0x00000020 #define OBJECT_FLAG_ONLINE_SERVICE 0x00000040 #define OBJECT_FLAG_OGG_THEORA 0x00000080 #define OBJECT_FLAG_DVD_IMAGE 0x00000100 #define OBJECT_FLAG_PLAYED 0x00000200 #define OBJECT_AUTOSCAN_NONE 0 #define OBJECT_AUTOSCAN_UI 1 #define OBJECT_AUTOSCAN_CFG 2 int CdsObjectTitleComparator(void *arg1, void *arg2); /// \brief Generic object in the Content Directory. class CdsObject : public zmm::Object { protected: /// \brief ID of the object in the content directory int id; /// \brief ID of the referenced object int refID; /// \brief ID of the object's parent int parentID; /// \brief dc:title zmm::String title; /// \brief upnp:class zmm::String upnpClass; /// \brief Physical location of the media. zmm::String location; /// \brief virtual object flag int virt; /// \brief type of the object: item, container, etc. unsigned int objectType; /// \brief field which can hold various flags for the object unsigned int objectFlags; /// \brief flag that allows to sort objects within a container int sortPriority; zmm::Ref metadata; zmm::Ref auxdata; zmm::Ref > resources; public: /// \brief Constructor. Sets the default values. CdsObject(); /// \brief Set the object ID. /// /// ID is the object ID that is used by the UPnP Content Directory service. inline void setID(int id) { this->id = id; } /// \brief Retrieve the object ID. /// /// ID is the object ID that is used by the UPnP Content Directory service. inline int getID() { return id; } /// \brief Set the reference object ID. /// /// This is the reference ID that is used by the UPnP Content Directory service. /// It also links the reference and the original objects in the database. inline void setRefID(int refID) { this->refID = refID; } /// \brief Retrieve the reference object ID. /// /// This is the reference ID that is used by the UPnP Content Directory service. /// It also links the reference and the original objects in the database. inline int getRefID() { return refID; } /// \brief Set the parent ID of the object. inline void setParentID(int parentID) { this->parentID = parentID; } /// \brief Retrieve the objects parent ID. inline int getParentID() { return parentID; } /// \brief Set the restricted flag. inline void setRestricted(bool restricted) { changeFlag(OBJECT_FLAG_RESTRICTED, restricted); } /// \brief Query the restricted flag. inline bool isRestricted() { return getFlag(OBJECT_FLAG_RESTRICTED); } /// \brief Set the object title (dc:title) inline void setTitle(zmm::String title) { this->title = title; } /// \brief Retrieve the title. inline zmm::String getTitle() { return title; } /// \brief set the upnp:class inline void setClass(zmm::String upnpClass) { this->upnpClass = upnpClass; } /// \brief Retrieve class inline zmm::String getClass() { return upnpClass; } /// \brief Set the physical location of the media (usually an absolute path) inline void setLocation(zmm::String location) { this->location = location; } /// \brief Retrieve media location. inline zmm::String getLocation() { return location; } /// \brief Set the virtual flag. inline void setVirtual(bool virt) { this->virt = virt; } /// \brief Query the virtual flag. inline bool isVirtual() { return virt; } /// \brief Query information on object type: item, container, etc. inline unsigned int getObjectType() { return objectType; } /// \brief Retrive sort priority setting. inline int getSortPriority() { return sortPriority; } /// \brief Set the sort prioroty of an object. inline void setSortPriority(int sortPriority) { this->sortPriority = sortPriority; } /// \brief Get flags of an object. inline unsigned int getFlags() { return objectFlags; } /// \brief Get a flag of an object. inline unsigned int getFlag(unsigned int mask) { return objectFlags & mask; } /// \brief Set flags for the object. inline void setFlags(unsigned int objectFlags) { this->objectFlags = objectFlags; } /// \biref Set a flag of the object. inline void setFlag(unsigned int mask) { objectFlags |= mask; } /// \biref Set a flag of the object. inline void changeFlag(unsigned int mask, bool value) { if (value) setFlag(mask); else clearFlag(mask); } /// \biref Clears a flag of the object. inline void clearFlag(unsigned int mask) { objectFlags &= ~mask; } /// \brief Query single metadata value. inline zmm::String getMetadata(zmm::String key) { return metadata->get(key); } /// \brief Query entire metadata dictionary. inline zmm::Ref getMetadata() { return metadata; } /// \brief Set entire metadata dictionary. inline void setMetadata(zmm::Ref metadata) { this->metadata = metadata; } /// \brief Set a single metadata value. inline void setMetadata(zmm::String key, zmm::String value) { metadata->put(key, value); } /// \brief Removes metadata with the given key inline void removeMetadata(zmm::String key) { metadata->remove(key); } /// \brief Query single auxdata value. inline zmm::String getAuxData(zmm::String key) { return auxdata->get(key); } /// \brief Query entire auxdata dictionary. inline zmm::Ref getAuxData() { return auxdata; } /// \brief Set a single auxdata value. inline void setAuxData(zmm::String key, zmm::String value) { auxdata->put(key, value); } /// \brief Set entire auxdata dictionary. inline void setAuxData(zmm::Ref auxdata) { this->auxdata = auxdata; } /// \brief Removes auxdata with the given key inline void removeAuxData(zmm::String key) { auxdata->remove(key); } /// \brief Get number of resource tags inline int getResourceCount() { return resources->size(); } /// \brief Query resources inline zmm::Ref > getResources() { return resources; } /// \brief Set resources inline void setResources(zmm::Ref > res) { resources = res; } /// \brief Query resource tag with the given index inline zmm::Ref getResource(int index) { return resources->get(index); } /// \brief Add resource tag inline void addResource(zmm::Ref resource) { resources->append(resource); } /// \brief Insert resource tag at index inline void insertResource(int index, zmm::Ref resource) { resources->insert(index, resource); } /// \brief Copies all object properties to another object. /// \param obj target object (clone) virtual void copyTo(zmm::Ref obj); /// \brief Checks if current object is equal to obj. /// \param obj object to check against /// \param exactly tells to check really everything or only the "public" version /// /// The difference between setting this flag to true or false is following: /// exactly=true checks all fields, also internal ones, exactly=false checks /// only the fields that will be visible in DIDL-Lite virtual int equals(zmm::Ref obj, bool exactly=false); /// \brief Checks if current object has the same resources as obj /// \param obj object to check against int resourcesEqual(zmm::Ref obj); /// \brief Checks if the minimum required parameters for the object have been set and are valid. virtual void validate(); /// \brief Frees unnecessary memory void optimize(); static zmm::Ref createObject(unsigned int objectType); /// \brief Returns the path to the object as it appears in the database tree. virtual zmm::String getVirtualPath() = 0; static zmm::String mapObjectType(int objectType); static int remapObjectType(zmm::String objectType); friend int CdsObjectTitleComparator(void *arg1, void *arg2); }; /// \brief An Item in the content directory. class CdsItem : public CdsObject { protected: /// \brief mime-type of the media. zmm::String mimeType; int trackNumber; /// \brief unique service ID zmm::String serviceID; public: /// \brief Constructor, sets the object type and default upnp:class (object.item) CdsItem(); /// \brief Set mime-type information of the media. inline void setMimeType(zmm::String mimeType) { this->mimeType = mimeType; } /// \brief Query mime-type information. inline zmm::String getMimeType() { return mimeType; } /// \brief Sets the upnp:originalTrackNumber property inline void setTrackNumber(int trackNumber) { this->trackNumber = trackNumber; } inline int getTrackNumber() { return trackNumber; } /// \brief Copies all object properties to another object. /// \param obj target object (clone) virtual void copyTo(zmm::Ref obj); /// \brief Checks if current object is equal to obj. /// /// See description for CdsObject::equals() for details. virtual int equals(zmm::Ref obj, bool exactly=false); /// \brief Checks if the minimum required parameters for the object have been set and are valid. virtual void validate(); /// \brief Returns the path to the object as it appears in the database tree. virtual zmm::String getVirtualPath(); /// \brief Set the unique service ID. inline void setServiceID(zmm::String serviceID) { this->serviceID = serviceID; } /// \brief Retrieve the unique service ID. inline zmm::String getServiceID() { return serviceID; } }; /// \brief An Active Item in the content directory. /// /// An active item is something very special, and it is not defined within UPnP. /// From the UPnP point of view it is a normal Item, but internally it does /// a little more. /// When an ActiveItem is played back (HTTP GET request for it's URL), a /// script is executed on the server. /// The script gets an XML representation of the item (actually a DIDL-Lite render) /// to the standard input, and has to return an appropriate XML to the standard /// output. The script may change most of the values of the Item. The only /// protected fields are object ID and parent ID. In case changes have taken /// place, a container update is issued. /// /// You could use ActiveItems for a variety of things, implementing /// "toggle" items (ones that change between "on" and "off" with each activation) /// or just "trigger" items that do not change visible but trigger events on the /// server. For example, you could write a script and create an item to /// shutdown your PC when this item is played. /// /// We plan to extend the ActiveItem functionality, allowing to control /// various server settings, and also being more flexible on the time /// of script execution (execute script before or after serving the media, etc.) class CdsActiveItem : public CdsItem { protected: /// \brief action to be executed (an absolute path to a script that will process the XML) zmm::String action; /// \brief a field where you can save any string you wnat. zmm::String state; public: /// \brief Constructor, sets the object type. CdsActiveItem(); /// \brief Sets the action for the item. /// \param action absolute path to the script that will process the XML data. inline void setAction(zmm::String action) { this->action = action; } /// \brief Get the path of the action script. inline zmm::String getAction() { return action; } /// \brief Set action state. /// \param state any string you want. /// /// This is quite useful to let the script identify what state the item is in. /// Think of it as a cookie (did I already mention that I hate web cookies?) inline void setState(zmm::String state) { this->state = state; } /// \brief Retrieve the item state. inline zmm::String getState() { return state; } /// \brief Copies all object properties to another object. /// \param obj target object (clone) virtual void copyTo(zmm::Ref obj); /// \brief Checks if current object is equal to obj. /// /// See description for CdsObject::equals() for details. virtual int equals(zmm::Ref obj, bool exactly=false); /// \brief Checks if the minimum required parameters for the object have been set and are valid. virtual void validate(); }; /// \brief An item that is accessible via a URL. class CdsItemExternalURL : public CdsItem { public: /// \brief Constructor, sets the object type. CdsItemExternalURL(); /// \brief Sets the URL for the item. /// \param URL full url to the item: http://somewhere.com/something.mpg inline void setURL(zmm::String URL) { this->location = URL; } /// \brief Get the URL of the item. inline zmm::String getURL() { return location; } /// \brief Copies all object properties to another object. /// \param obj target object (clone) //virtual void copyTo(zmm::Ref obj); /// \brief Checks if current object is equal to obj. /// /// See description for CdsObject::equals() for details. //virtual int equals(zmm::Ref obj, bool exactly=false); /// \brief Checks if the minimum required parameters for the object have been set and are valid. virtual void validate(); }; /// \brief An item that is pointing to a file located in the "servedir" /// directory. /// /// This implementation will alow to easily launch Java games on the /// Streamium media renderer. Why "internal URL"? The port of the server /// can change upon restarts, I have seen that the SDK often binds to /// a new port (no matter what is configured). The location of an /// internal URL will be specified as /mystuff/myfile.txt and will /// resolve to http://serverip:serverport/content/serve/mystuff/myfile.txt class CdsItemInternalURL : public CdsItemExternalURL { public: /// \brief Constructor, sets the object type. CdsItemInternalURL(); /// \brief Checks if the minimum required parameters for the object have been set and are valid. virtual void validate(); }; /* /// \brief A Dynamic Item in the content directory. /// /// A Dynamic Item differs from a regular Item in the way that /// it's content is entirely dynamic and is being built on the fly /// during request class CdsDynamicItem : public CdsItem { protected: /// \brief action to be executed (an absolute path to a script that will process the XML) zmm::String ; /// \brief a field where you can save any string you wnat. zmm::String properties; public: /// \brief Constructor, sets the object type. CdsActiveItem(); /// \brief Sets the action for the item. /// \param action absolute path to the script that will process the XML data. void setAction(zmm::String action); /// \brief Get the path of the action script. zmm::String getAction(); /// \brief Set action state. /// \param state any string you want. /// /// This is quite useful to let the script identify what state the item is in. /// Think of it as a cookie (did I already mention that I hate web cookies?) void setState(zmm::String state); /// \brief Retrieve the item state. zmm::String getState(); /// \brief Copies all object properties to another object. /// \param obj target object (clone) virtual void copyTo(zmm::Ref obj); /// \brief Checks if current object is equal to obj. /// /// See description for CdsObject::equals() for details. virtual int equals(zmm::Ref obj, bool exactly=false); /// \brief Checks if the minimum required parameters for the object have been set and are valid. virtual void validate(); }; */ /// \brief A container in the content directory. class CdsContainer : public CdsObject { protected: /// \brief container update id. int updateID; /// \brief childCount attribute int childCount; /// \brief wheather this container is an autoscan start point. int autoscanType; public: /// \brief Constructor, initializes default values for the flags and sets the object type. CdsContainer(); /// \brief Set the searchable flag. inline void setSearchable(bool searchable) { changeFlag(OBJECT_FLAG_SEARCHABLE, searchable); } /// \brief Query searchable flag. inline int isSearchable() { return getFlag(OBJECT_FLAG_SEARCHABLE); } /// \brief Set the container update ID value. inline void setUpdateID(int updateID) { this->updateID = updateID; } /// \brief Query container update ID value. inline int getUpdateID() { return updateID; } /// \brief Set container childCount attribute. inline void setChildCount(int childCount) { this->childCount = childCount; } /// \brief Retrieve number of children inline int getChildCount() { return childCount; } /// \brief returns wheather this container is an autoscan start point. inline int getAutoscanType() { return autoscanType; } /// \brief sets wheather this container is an autoscan start point. inline void setAutoscanType(int type) { autoscanType = type; } /// \brief Copies all object properties to another object. /// \param obj target object (clone) virtual void copyTo(zmm::Ref obj); /// \brief Checks if current object is equal to obj. /// /// See description for CdsObject::equals() for details. virtual int equals(zmm::Ref obj, bool exactly=false); /// \brief Checks if the minimum required parameters for the object have been set and are valid. virtual void validate(); /// \brief Returns the path to the object as it appears in the database tree. virtual zmm::String getVirtualPath(); }; #endif // __CDS_OBJECTS_H__ mediatomb-0.12.1/src/zmm/0000775000076400007640000000000011357204747012153 500000000000000mediatomb-0.12.1/src/zmm/zmm.h0000664000076400007640000000251611352675000013040 00000000000000/*MT* MediaTomb - http://www.mediatomb.cc/ zmm.h - this file is part of MediaTomb. Copyright (C) 2005 Gena Batyan , Sergey 'Jin' Bostandzhyan Copyright (C) 2006-2010 Gena Batyan , Sergey 'Jin' Bostandzhyan , Leonhard Wimmer MediaTomb is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. MediaTomb is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with MediaTomb; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. $Id: zmm.h 2081 2010-03-23 20:18:00Z lww $ */ /// \file zmm.h #ifndef __ZMM_H__ #define __ZMM_H__ #include "nil.h" #include "null.h" #include "object.h" #include "ref.h" #include "strings.h" #include "stringbuffer.h" #endif // __ZMM_H__ mediatomb-0.12.1/src/zmm/atomic.h0000664000076400007640000000625211352675000013512 00000000000000/*MT* MediaTomb - http://www.mediatomb.cc/ atomic.h - this file is part of MediaTomb. Copyright (C) 2005 Gena Batyan , Sergey 'Jin' Bostandzhyan Copyright (C) 2006-2010 Gena Batyan , Sergey 'Jin' Bostandzhyan , Leonhard Wimmer MediaTomb is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. MediaTomb is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with MediaTomb; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. $Id: atomic.h 2081 2010-03-23 20:18:00Z lww $ */ /// \file atomic.h #ifndef __ATOMIC_H__ #define __ATOMIC_H__ typedef struct { volatile int x; } mt_atomic_t; //#define ATOMIC_INIT(y) {(y)} static inline void atomic_set(mt_atomic_t *at, int val) { at->x = val; } static inline int atomic_get(mt_atomic_t *at) { return (at->x); } #undef ATOMIC_DEFINED #ifdef ATOMIC_X86_SMP #ifdef ATOMIC_X86 #error ATOMIC_X86_SMP and ATOMIC_X86 are defined at the same time! #endif #define ASM_LOCK "lock; " #endif #ifdef ATOMIC_X86 #define ASM_LOCK #endif #if defined(ATOMIC_X86_SMP) || defined(ATOMIC_X86) #define ATOMIC_DEFINED static inline void atomic_inc(mt_atomic_t *at) { __asm__ __volatile__( ASM_LOCK "incl %0" :"=m" (at->x) :"m" (at->x) :"cc" ); } static inline bool atomic_dec(mt_atomic_t *at) { unsigned char c; __asm__ __volatile__( ASM_LOCK "decl %0; sete %1" :"=m" (at->x), "=g" (c) :"m" (at->x) :"cc" ); return (c!=0); } #endif #ifdef ATOMIC_TORTURE #ifdef ATOMIC_DEFINED #error ATOMIC_X86(_SMP) and ATOMIC_TORTURE are defined at the same time! #else #define ATOMIC_DEFINED #endif // this is NOT atomic in most cases! Don't use ATOMIC_TORTURE! static inline void atomic_inc(mt_atomic_t *at) { at->x++; } static inline bool atomic_dec(mt_atomic_t *at) { return ((--at->x) == 0); } #endif #ifndef ATOMIC_DEFINED #include #define ATOMIC_NEED_MUTEX static inline void atomic_inc(mt_atomic_t *at, pthread_mutex_t *mutex) { pthread_mutex_lock(mutex); at->x++; pthread_mutex_unlock(mutex); } static inline bool atomic_dec(mt_atomic_t *at, pthread_mutex_t *mutex) { pthread_mutex_lock(mutex); int newval = (--at->x); pthread_mutex_unlock(mutex); return (newval == 0); } #else #undef ATOMIC_DEFINED #endif #endif // __ATOMIC_H__ mediatomb-0.12.1/src/zmm/object.h0000664000076400007640000000320511352675000013477 00000000000000/*MT* MediaTomb - http://www.mediatomb.cc/ object.h - this file is part of MediaTomb. Copyright (C) 2005 Gena Batyan , Sergey 'Jin' Bostandzhyan Copyright (C) 2006-2010 Gena Batyan , Sergey 'Jin' Bostandzhyan , Leonhard Wimmer MediaTomb is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. MediaTomb is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with MediaTomb; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. $Id: object.h 2081 2010-03-23 20:18:00Z lww $ */ /// \file object.h #ifndef __ZMM_OBJECT_H__ #define __ZMM_OBJECT_H__ #include // for size_t #include "atomic.h" namespace zmm { class Object { public: Object(); virtual ~Object(); void retain(); void release(); int getRefCount(); static void* operator new (size_t size); static void operator delete (void *ptr); protected: mt_atomic_t _ref_count; #ifdef ATOMIC_NEED_MUTEX pthread_mutex_t mutex; #endif }; } // namespace #endif // __ZMM_OBJECT_H__ mediatomb-0.12.1/src/zmm/stringbuffer.h0000664000076400007640000000467311352675000014743 00000000000000/*MT* MediaTomb - http://www.mediatomb.cc/ stringbuffer.h - this file is part of MediaTomb. Copyright (C) 2005 Gena Batyan , Sergey 'Jin' Bostandzhyan Copyright (C) 2006-2010 Gena Batyan , Sergey 'Jin' Bostandzhyan , Leonhard Wimmer MediaTomb is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. MediaTomb is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with MediaTomb; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. $Id: stringbuffer.h 2081 2010-03-23 20:18:00Z lww $ */ /// \file stringbuffer.h #ifndef __ZMM_STRINGBUFFER_H__ #define __ZMM_STRINGBUFFER_H__ #include "strings.h" #define DEFAULT_STRINGBUFFER_CAPACITY 16 #define STRINGBUFFER_CAPACITY_INCREMENT (1.25) namespace zmm { class StringBuffer : public Object { protected: char *data; int capacity; int len; public: StringBuffer(); StringBuffer(int capacity); virtual ~StringBuffer(); StringBuffer &operator<<(String other); StringBuffer &operator<<(Ref other); StringBuffer &operator<<(const char *str); StringBuffer &operator<<(signed char *str); StringBuffer &operator<<(signed char chr); StringBuffer &operator<<(char chr); StringBuffer &operator<<(int x); StringBuffer &operator<<(unsigned int x); void concat(Ref other, int offset = 0); void concat(char *str, int length); int length(); int getCapacity() { return capacity; } void setLength(int newLength); char *c_str(int offset = 0); String toString(); String toString(int offset); void clear(); void ensureCapacity(int neededCapacity); void setCharAt(int index, char c); protected: inline void addCapacity(int increment) { ensureCapacity(len + increment); } }; } // namespace #endif // __ZMM_STRINGBUFFER_H__ mediatomb-0.12.1/src/zmm/ref.h0000664000076400007640000000516311352675000013012 00000000000000/*MT* MediaTomb - http://www.mediatomb.cc/ ref.h - this file is part of MediaTomb. Copyright (C) 2005 Gena Batyan , Sergey 'Jin' Bostandzhyan Copyright (C) 2006-2010 Gena Batyan , Sergey 'Jin' Bostandzhyan , Leonhard Wimmer MediaTomb is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. MediaTomb is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with MediaTomb; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. $Id: ref.h 2081 2010-03-23 20:18:00Z lww $ */ /// \file ref.h #ifndef __ZMM_REF_H__ #define __ZMM_REF_H__ #include "nil.h" namespace zmm { template class Ref { public: Ref(const Ref& other) { _ptr = other._ptr; if(_ptr) _ptr->retain(); } explicit Ref(T* ptr = NULL) : _ptr(ptr) { if(ptr) ptr->retain(); } Ref(NIL_VAR) { _ptr = NULL; } ~Ref() { if(_ptr) _ptr->release(); } Ref& operator=(const Ref& other) { if (this == &other) return *this; if(_ptr) _ptr->release(); _ptr = other._ptr; if(_ptr) _ptr->retain(); return *this; } inline Ref& operator=(NIL_VAR) { if(_ptr) _ptr->release(); _ptr = NULL; return *this; } inline T& operator*() const { return *_ptr; } inline T* operator->() const { return _ptr; } inline T* getPtr() { return _ptr; } inline int operator==(NIL_VAR) { return (_ptr == NULL); } inline int operator!=(NIL_VAR) { return (_ptr != NULL); } inline int operator==(const Ref& other) { return (_ptr == other._ptr); } inline int operator!=(const Ref& other) { return (_ptr != other._ptr); } protected: T* _ptr; }; } // namespace #define RefCast(ref, klass) zmm::Ref((klass *)ref.getPtr()) #endif // __ZMM_REF_H__ mediatomb-0.12.1/src/zmm/strings.cc0000664000076400007640000003001011352675000014052 00000000000000/*MT* MediaTomb - http://www.mediatomb.cc/ strings.cc - this file is part of MediaTomb. Copyright (C) 2005 Gena Batyan , Sergey 'Jin' Bostandzhyan Copyright (C) 2006-2010 Gena Batyan , Sergey 'Jin' Bostandzhyan , Leonhard Wimmer MediaTomb is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. MediaTomb is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with MediaTomb; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. $Id: strings.cc 2081 2010-03-23 20:18:00Z lww $ */ /// \file strings.cc #ifdef HAVE_CONFIG_H #include "autoconfig.h" #endif #include #include "memory.h" #include "strings.h" using namespace zmm; StringBase::StringBase(int capacity) : Object() { len = capacity; data = (char *)MALLOC((len + 1) * sizeof(char)); store = true; } StringBase::StringBase(const char *str) : Object() { len = (int)strlen(str); data = (char *)MALLOC((len + 1) * sizeof(char)); strcpy(data, str); store = true; } StringBase::StringBase(const char *str, int len) : Object() { this->len = len; data = (char *)MALLOC((len + 1) * sizeof(char)); memcpy(data, str, len); data[len] = 0; store = true; } StringBase::~StringBase() { if (store) FREE(data); } bool StringBase::startsWith(StringBase *other) { return (!strncmp(data, other->data, other->len)); } String::String() { base = NULL; } String::String(int capacity) { base = new StringBase(capacity); base->retain(); } String::String(const char *str) { if(str) { base = new StringBase(str); base->retain(); } else base = NULL; } String::String(const char *str, int len) { if(str) { base = new StringBase(str, len); base->retain(); } else base = NULL; } String::String(char ch) { base = new StringBase(&ch, 1); base->retain(); } String::String(const String &other) { base = other.base; if(base) base->retain(); } String::String(StringBase *other) { base = other; if(base) base->retain(); } String::String(Ref other) { base = other.getPtr(); if(base) base->retain(); } String::~String() { if(base) base->release(); } int String::length() { if(base) return base->len; else return 0; } char *String::c_str() { if(base) return base->data; else return NULL; } String String::operator+(String other) { if(! other.base) return *this; if(! base) return other; int len = base->len; int otherLen = other.base->len; String res(len + otherLen); strcpy(res.base->data, base->data); strcpy(res.base->data + len, other.base->data); return res; } String String::operator+(const char *other) { if(! other) return *this; if(! base) return String::copy(other); int len = base->len; int otherLen = (int)strlen(other); String res(len + otherLen); strcpy(res.base->data, base->data); strcpy(res.base->data + len, other); return res; } String String::operator+(char chr) { char str[2]; str[0] = chr; str[1] = 0; return operator+(str); } String String::operator+(int x) { return operator+(from(x)); } String String::operator+(unsigned int x) { return operator+(from(x)); } String String::operator+(double x) { return operator+(from(x)); } String String::from(int x) { StringBase *b = new StringBase(MAX_INT_STRING_LENGTH); b->len = sprintf(b->data, "%d", x); return (String(b)); } String String::from(unsigned int x) { StringBase *b = new StringBase(MAX_INT_STRING_LENGTH); b->len = sprintf(b->data, "%u", x); return (String(b)); } String String::from(long x) { StringBase *b = new StringBase(MAX_LONG_STRING_LENGTH); b->len = sprintf(b->data, "%ld", x); return (String(b)); } String String::from(unsigned long x) { StringBase *b = new StringBase(MAX_LONG_STRING_LENGTH); b->len = sprintf(b->data, "%ld", x); return (String(b)); } String String::from(double x) { StringBase *b = new StringBase(MAX_DOUBLE_STRING_LENGTH); b->len = sprintf(b->data, "%lf", x); return (String(b)); } String String::from(long long x) { StringBase *b = new StringBase(MAX_LONG_LONG_STRING_LENGTH); b->len = sprintf(b->data, "%lld", x); return (String(b)); } /* String String::from(int64_t x) { StringBase *b = new StringBase(MAX_INT64_T_STRING_LENGTH); b->len = sprintf(b->data, "%"PRIx64, x); return (String(b)); } */ String String::allocate(int size) { return String(new StringBase(size)); } String String::take(const char *data) { StringBase *base = new StringBase(); base->data = (char *)data; base->len = strlen(data); base->store = true; return String(base); } String String::take(const char *data, int length) { StringBase *base = new StringBase(); base->data = (char *)data; base->len = length; base->store = true; return String(base); } String String::refer(const char *data) { StringBase *base = new StringBase(); base->data = (char *)data; base->len = strlen(data); base->store = false; return String(base); } String String::refer(const char *data, int len) { StringBase *base = new StringBase(); base->data = (char *)data; base->len = len; base->store = false; return String(base); } String String::copy(const char *data) { if (data) { StringBase *base = new StringBase(data); return String(base); } else return String(); } int String::operator==(String other) { if(! base && ! other.base) return 1; if(base && other.base) return ( ! strcmp(base->data, other.base->data) ); return 0; } int String::operator==(const char *other) { if(! base && ! other) return 1; if(base && other) return ( ! strcmp(base->data, other ) ); return 0; } int String::operator==(char c) { if(! base || base->len != 1) return 0; return (c == *(base->data)); } String& String::operator=(const char *str) { if (base) base->release(); if (str) { base = new StringBase(str); base->retain(); } else base = NULL; return *this; } String& String::operator=(String other) { if (this == &other) return *this; if(base) base->release(); base = other.base; if(base) base->retain(); return *this; } int String::equals(String other, bool ignoreCase) { if(! base && ! other.base) return 1; if (ignoreCase) { if(base && other.base) return ( ! strcasecmp(base->data, other.base->data) ); } else return (operator==(other)); return 0; } String String::toLower() { if (!base) return nil; String result = String(base->data, base->len); for (int i = 0; i < result.base->len; i++) { result.base->data[i] = tolower(result.base->data[i]); } return result; } String String::toUpper() { if (!base) return nil; String result = String(base->data, base->len); for (int i = 0; i < base->len; i++) { result.base->data[i] = toupper(result.base->data[i]); } return result; } long String::toLong() { if(! base) return 0; char *endptr; long res = (int)strtol(base->data, &endptr, 10); if(*endptr) return 0; // TODO: throw exception return res; } double String::toDouble() { if(! base) return 0; char *endptr; double res = strtod(base->data, &endptr); if(*endptr) return 0; // TODO: throw exception return res; } off_t String::toOFF_T() { if(! base) return 0; #if SIZEOF_OFF_T > 4 char *endptr; off_t res = strtoll(base->data, &endptr, 10); if(*endptr) return 0; return res; // TODO: throw exceptoin #else return toLong(); #endif } String String::substring(int from) { if(! base) return nil; int count = base->len - from; return substring(from, count); } String String::substring(int from, int count) { if(! base || count < 0) return nil; if(count == 0) return _(""); if(from + count > base->len) count = base->len - from; String res(count); strncpy(res.base->data, base->data + from, count); *(res.base->data + count) = 0; return res; } int String::index(int start, char ch) { if(! base) return -1; if (start < 0 || start + 1 > base->len) return -1; char *pos = ::strchr(base->data + start, ch); if (pos) return pos - base->data; else return -1; } int String::rindex(char ch) { if(! base) return -1; char *pos = ::strrchr(base->data, ch); if (pos) return pos - base->data; else return -1; } int String::rindex(int end, char ch) { if(! base) return -1; if (end < 0 || end + 1 > base->len) return -1; for (char *pos = base->data + end; pos >= base->data; pos--) { if (*pos == ch) return pos - base->data; } return -1; } String String::reduce(char ch) { if (!base) return nil; char *pos = ::strchr(base->data, ch); if (!pos) return *this; String res(base->len); char *pos2 = res.base->data; char *pos3 = base->data; do { if (*(pos + 1) == ch) { if (pos-pos3 == 0) { *pos2 = ch; pos2++; } else { strncpy(pos2, pos3, (pos-pos3)+1); pos2 = pos2 + ((pos-pos3)+1); } while (*pos == ch) pos++; pos3 = pos; if (*pos == '\0') { *pos2 = '\0'; break; } pos = ::strchr(pos, ch); } else { pos++; if (*pos == '\0') break; pos = ::strchr(pos, ch); } } while (pos); if ((base->data)+(base->len)-pos3) strncpy(pos2, pos3, (base->data)+(base->len)-pos3); pos2[(base->data)+(base->len)-pos3] = 0; res.updateLength(); return res; } int String::find(const char *needle) { if (!base) return -1; char *pos = strstr(base->data, needle); if (pos) { return (pos-(base->data)); } else return -1; } int String::find(String needle) { return find(needle.base->data); } String String::replace(String needle, String replacement) { if (! replacement.base || ! needle.base) return nil; int pos = find(needle); if (pos < 0) return *this; String res(base->len + replacement.base->len - needle.base->len); strncpy(res.base->data, base->data, pos); strncpy(res.base->data + pos, replacement.base->data, replacement.base->len); strncpy(res.base->data + pos + replacement.base->len, base->data + pos + needle.base->len, base->len - pos - needle.base->len); res.base->data[res.base->len] = 0; return res; } String String::replaceChar(char needle, char replacement) { if ((needle == '\0') || (replacement == '\0')) return *this; String res(base->len); for (int i = 0; i < res.base->len; i++) { if (base->data[i] == needle) res.base->data[i] = replacement; else res.base->data[i] = base->data[i]; } res.base->data[res.base->len] = 0; return res; } mediatomb-0.12.1/src/zmm/nil.h0000664000076400007640000000256511352675000013023 00000000000000/*MT* MediaTomb - http://www.mediatomb.cc/ nil.h - this file is part of MediaTomb. Copyright (C) 2005 Gena Batyan , Sergey 'Jin' Bostandzhyan Copyright (C) 2006-2010 Gena Batyan , Sergey 'Jin' Bostandzhyan , Leonhard Wimmer MediaTomb is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. MediaTomb is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with MediaTomb; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. $Id: nil.h 2081 2010-03-23 20:18:00Z lww $ */ /// \file nil.h #ifndef __ZMM_NIL_H__ #define __ZMM_NIL_H__ struct nil_struct_t { int dummy1; char dummy2; }; typedef struct nil_struct_t * NIL_VAR; extern NIL_VAR nil_inst; #define nil nil_inst #endif // __ZMM_NIL_H__ mediatomb-0.12.1/src/zmm/null.h0000664000076400007640000000245211352675000013206 00000000000000/*MT* MediaTomb - http://www.mediatomb.cc/ null.h - this file is part of MediaTomb. Copyright (C) 2005 Gena Batyan , Sergey 'Jin' Bostandzhyan Copyright (C) 2006-2010 Gena Batyan , Sergey 'Jin' Bostandzhyan , Leonhard Wimmer MediaTomb is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. MediaTomb is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with MediaTomb; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. $Id: null.h 2081 2010-03-23 20:18:00Z lww $ */ /// \file null.h #ifndef __ZMM_NULL_H__ #define __ZMM_NULL_H__ // #define NULL ((void *)(0)) #ifndef NULL #define NULL 0 #endif #endif // __ZMM_NULL_H__ mediatomb-0.12.1/src/zmm/object.cc0000664000076400007640000000402011352675000013631 00000000000000/*MT* MediaTomb - http://www.mediatomb.cc/ object.cc - this file is part of MediaTomb. Copyright (C) 2005 Gena Batyan , Sergey 'Jin' Bostandzhyan Copyright (C) 2006-2010 Gena Batyan , Sergey 'Jin' Bostandzhyan , Leonhard Wimmer MediaTomb is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. MediaTomb is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with MediaTomb; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. $Id: object.cc 2081 2010-03-23 20:18:00Z lww $ */ /// \file object.cc #ifdef HAVE_CONFIG_H #include "autoconfig.h" #endif #include #include #include "object.h" #include "memory.h" using namespace zmm; Object::Object() { atomic_set(&_ref_count, 0); #ifdef ATOMIC_NEED_MUTEX pthread_mutex_init(&mutex, NULL); #endif } Object::~Object() { #ifdef ATOMIC_NEED_MUTEX pthread_mutex_destroy(&mutex); #endif } void Object::retain() { #ifdef ATOMIC_NEED_MUTEX atomic_inc(&_ref_count, &mutex); #else atomic_inc(&_ref_count); #endif } void Object::release() { #ifdef ATOMIC_NEED_MUTEX if(atomic_dec(&_ref_count, &mutex)) #else if(atomic_dec(&_ref_count)) #endif { delete this; } } int Object::getRefCount() { return atomic_get(&_ref_count); } void* Object::operator new (size_t size) { return MALLOC(size); } void Object::operator delete (void *ptr) { FREE(ptr); } mediatomb-0.12.1/src/zmm/strings.h0000664000076400007640000001257511352675000013734 00000000000000/*MT* MediaTomb - http://www.mediatomb.cc/ strings.h - this file is part of MediaTomb. Copyright (C) 2005 Gena Batyan , Sergey 'Jin' Bostandzhyan Copyright (C) 2006-2010 Gena Batyan , Sergey 'Jin' Bostandzhyan , Leonhard Wimmer MediaTomb is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. MediaTomb is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with MediaTomb; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. $Id: strings.h 2081 2010-03-23 20:18:00Z lww $ */ /// \file strings.h #ifndef __ZMM_STRINGS_H__ #define __ZMM_STRINGS_H__ #include #include #include #include #include "object.h" #include "ref.h" #define _(str) zmm::String::refer(str) //#define _(str) str #define MAX_INT_STRING_LENGTH 12 //max ulong: 12345678901234567890 ??? #define MAX_LONG_STRING_LENGTH 22 #define MAX_DOUBLE_STRING_LENGTH 24 #define MAX_LONG_LONG_STRING_LENGTH 24 #define MAX_INT64_T_STRING_LENGTH 24 namespace zmm { class StringBase : public Object { public: char *data; int len; bool store; // if true, the object is responsible for freeing data StringBase(int capacity); StringBase(const char *str); StringBase(const char *str, int len); bool startsWith(StringBase *other); virtual ~StringBase(); protected: inline StringBase() : Object() {} friend class String; }; class StringBuffer; class String { protected: StringBase *base; public: String(); String(const char *str); explicit String(char ch); String(const char *str, int len); String(const String &other); String(StringBase *other); String(Ref other); inline StringBase *getBase() { return base; } inline String(NIL_VAR) { base = NULL; } ~String(); String &operator=(const char *str); String &operator=(String other); inline String &operator=(NIL_VAR) { if(base) base->release(); base = NULL; return *this; } String operator+(String other); String operator+(const char *str); String operator+(char chr); String operator+(int x); String operator+(unsigned int x); String operator+(double x); int operator==(String other); int operator==(const char *str); int operator==(char c); inline int operator!=(String other) { return ! operator==(other); } inline int operator!=(const char *str) { return ! operator==(str); } inline int operator!=(char c) { return ! operator==(c); } inline int operator==(NIL_VAR) { return (base == NULL); } inline int operator!=(NIL_VAR) { return (base != NULL); } inline operator Ref() { return Ref(base); } int equals(String other, bool ignoreCase = false); String toLower(); String toUpper(); String substring(int from); String substring(int from, int count); /// \brief reduces multiple consecutive occurences of the character ch /// to one occurence /// \param ch the character to reduce /// \return the new string, with ch reduced String reduce(char ch); inline char charAt(int index) { return base->data[index]; } inline char *charPtrAt(int index) { return base->data + index; } inline int index(char ch) { return index(0, ch); } int index(int start, char ch); int rindex(char ch); int rindex(int end, char ch); long toLong(); off_t toOFF_T(); inline int toInt() { return (int)toLong(); } inline unsigned int toUInt() { return (unsigned int)toLong(); } double toDouble(); int length(); inline void setLength(int length) { base->len = length; } char *c_str(); inline void updateLength() { base->len = strlen(base->data); } bool startsWith(String str) { return base->startsWith(str.base); } int find(const char *needle); int find(String needle); String replace(String needle, String replacement); String replaceChar(char needle , char replacement); static String from(int x); static String from(unsigned int x); static String from(long x); static String from(unsigned long x); static String from(double x); static String from(long long x); static String allocate(int size); static String take(const char *data, int length); static String take(const char *data); static String refer(const char *str); static String refer(const char *str, int len); static String copy(const char *str); protected: String(int capacity); friend class StringBuffer; }; }; // namespace #endif // __STRINGS_H__ mediatomb-0.12.1/src/zmm/stringbuffer.cc0000664000076400007640000001145011352675000015070 00000000000000/*MT* MediaTomb - http://www.mediatomb.cc/ stringbuffer.cc - this file is part of MediaTomb. Copyright (C) 2005 Gena Batyan , Sergey 'Jin' Bostandzhyan Copyright (C) 2006-2010 Gena Batyan , Sergey 'Jin' Bostandzhyan , Leonhard Wimmer MediaTomb is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. MediaTomb is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with MediaTomb; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. $Id: stringbuffer.cc 2081 2010-03-23 20:18:00Z lww $ */ /// \file stringbuffer.cc #ifdef HAVE_CONFIG_H #include "autoconfig.h" #endif #include "stringbuffer.h" #include #include "memory.h" #include "strings.h" #include "exceptions.h" using namespace zmm; StringBuffer::StringBuffer() { capacity = DEFAULT_STRINGBUFFER_CAPACITY; data = (char *)MALLOC((capacity + 1) * sizeof(char)); len = 0; data[len] = 0; } StringBuffer::StringBuffer(int capacity) { this->capacity = capacity; data = (char *)MALLOC((capacity + 1) * sizeof(char)); len = 0; data[len] = 0; } StringBuffer::~StringBuffer() { FREE(data); } StringBuffer &StringBuffer::operator<<(String other) { int otherLen = other.length(); if(otherLen > 0) { addCapacity(otherLen); strcpy(data + len, other.base->data); len += otherLen; } return *this; } StringBuffer &StringBuffer::operator<<(Ref other) { concat(other, 0); return *this; } StringBuffer &StringBuffer::operator<<(const char *str) { if(! str) return *this; int otherLen = (int)strlen(str); if(otherLen) { addCapacity(otherLen); strcpy(data + len, str); len += otherLen; } return *this; } StringBuffer &StringBuffer::operator<<(signed char *str) { return operator<<((char *)str); } StringBuffer &StringBuffer::operator<<(char chr) { addCapacity(1); data[len] = chr; len++; data[len] = 0; return *this; } StringBuffer &StringBuffer::operator<<(signed char chr) { return operator<<((char)chr); } StringBuffer &StringBuffer::operator<<(int x) { addCapacity(MAX_INT_STRING_LENGTH); char *dest = data + len; sprintf(dest, "%d", x); len += (int)strlen(dest); return *this; } StringBuffer &StringBuffer::operator<<(unsigned int x) { addCapacity(MAX_INT_STRING_LENGTH); char *dest = data + len; sprintf(dest, "%u", x); len += (int)strlen(dest); return *this; } void StringBuffer::concat(Ref other, int offset) { int otherLen = other->length(); if(otherLen > 0) { if (offset >= otherLen) throw _Exception(_("illegal offset")); otherLen -= offset; addCapacity(otherLen); strcpy(data + len, other->c_str() + offset); len += otherLen; } } void StringBuffer::concat(char *str, int length) { if(str && length) { addCapacity(length); strncpy(data + len, str, length); len += length; data[len] = 0; } } int StringBuffer::length() { return len; } void StringBuffer::setLength(int newLength) { if (newLength > len) ensureCapacity(newLength); this->len = newLength; data[len] = 0; } char *StringBuffer::c_str(int offset) { if (offset > len || offset < 0) throw _Exception(_("illegal offset")); return data + offset; } String StringBuffer::toString() { return String(data, len); } String StringBuffer::toString(int offset) { if (offset > len || offset < 0) throw _Exception(_("illegal offset")); return String(data + offset, len - offset); } void StringBuffer::setCharAt(int index, char c) { if (index > len || index < 0) throw _Exception(_("illegal index")); data[index] = c; } void StringBuffer::clear() { len = 0; data[len] = 0; } void StringBuffer::ensureCapacity(int neededCapacity) { if(neededCapacity > capacity) { int newCapacity = (int)(capacity * STRINGBUFFER_CAPACITY_INCREMENT); if(neededCapacity > newCapacity) newCapacity = neededCapacity; capacity = newCapacity; data = (char *)REALLOC(data, (capacity + 1) * sizeof(char)); } } mediatomb-0.12.1/src/zmm/nil.cc0000664000076400007640000000241211352675000013150 00000000000000/*MT* MediaTomb - http://www.mediatomb.cc/ nil.cc - this file is part of MediaTomb. Copyright (C) 2005 Gena Batyan , Sergey 'Jin' Bostandzhyan Copyright (C) 2006-2010 Gena Batyan , Sergey 'Jin' Bostandzhyan , Leonhard Wimmer MediaTomb is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. MediaTomb is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with MediaTomb; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. $Id: nil.cc 2081 2010-03-23 20:18:00Z lww $ */ /// \file nil.cc #ifdef HAVE_CONFIG_H #include "autoconfig.h" #endif #include "nil.h" struct nil_struct_t *nil_inst; mediatomb-0.12.1/src/mpegdemux/0000775000076400007640000000000011357204746013342 500000000000000mediatomb-0.12.1/src/mpegdemux/mpegdemux.h0000664000076400007640000000132011351644351015414 00000000000000/* * MT * * */ #ifndef __MPEGDEMUX_H__ #define __MPEGDEMUX_H__ #ifdef __cplusplus extern "C" { #endif /// \brief Remuxes an MPEG2 stream and keeps only the video and audio streams /// that are given by the ID. // /// \param fd_in Already opened file descriptor for reading the input stream. /// \param fd_out Already opeend file descriptor for writing the remuxed data. /// \param keep_video_id id of the video that should be kept. /// \param keep_audio_id id of the audio stream taht should be kept. /// \return 0 on success. int remux_mpeg(int fd_in, int fd_out, unsigned char keep_video_id, unsigned char keep_audio_id); #ifdef __cplusplus } // extern "C" #endif #endif mediatomb-0.12.1/src/mpegdemux/buffer.h0000664000076400007640000000444511351644351014705 00000000000000/***************************************************************************** * mpegdemux * *****************************************************************************/ /***************************************************************************** * File name: buffer.h * * Created: 2003-04-08 by Hampa Hug * * Last modified: 2003-04-08 by Hampa Hug * * Copyright: (C) 2003 by Hampa Hug * *****************************************************************************/ /***************************************************************************** * This program is free software. You can redistribute it and / or modify it * * under the terms of the GNU General Public License version 2 as published * * by the Free Software Foundation. * * * * This program is distributed in the hope that it will be useful, but * * WITHOUT ANY WARRANTY, without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General * * Public License for more details. * *****************************************************************************/ /* $Id: buffer.h 67 2004-01-02 18:20:15Z hampa $ */ // The code has been modified to use file descriptors instead of FILE streams. // Only functionality needed in MediaTomb remains, all extra features are // stripped out. #ifndef MPEGDEMUX_BUFFER_H #define MPEGDEMUX_BUFFER_H 1 #include "mpeg_parse.h" typedef struct { unsigned char *buf; unsigned cnt; unsigned max; } mpeg_buffer_t; void mpeg_buf_init (mpeg_buffer_t *buf); void mpeg_buf_free (mpeg_buffer_t *buf); void mpeg_buf_clear (mpeg_buffer_t *buf); int mpeg_buf_set_max (mpeg_buffer_t *buf, unsigned max); int mpeg_buf_set_cnt (mpeg_buffer_t *buf, unsigned cnt); int mpeg_buf_read (mpeg_buffer_t *buf, mpeg_demux_t *mpeg, unsigned cnt); int mpeg_buf_write (mpeg_buffer_t *buf, int fd); int mpeg_buf_write_clear (mpeg_buffer_t *buf, int fd); #endif mediatomb-0.12.1/src/mpegdemux/mpegdemux_internal.h0000664000076400007640000000450611351644351017321 00000000000000/***************************************************************************** * mpegdemux * *****************************************************************************/ /***************************************************************************** * File name: mpegdemux.h * * Created: 2003-02-01 by Hampa Hug * * Last modified: 2004-04-08 by Hampa Hug * * Copyright: (C) 2003-2004 Hampa Hug * *****************************************************************************/ /***************************************************************************** * This program is free software. You can redistribute it and / or modify it * * under the terms of the GNU General Public License version 2 as published * * by the Free Software Foundation. * * * * This program is distributed in the hope that it will be useful, but * * WITHOUT ANY WARRANTY, without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General * * Public License for more details. * *****************************************************************************/ /* $Id: mpegdemux.h 78 2004-04-08 18:57:31Z hampa $ */ // The code has been modified to use file descriptors instead of FILE streams. // Only functionality needed in MediaTomb remains, all extra features are // stripped out. #ifndef MPEGDEMUX_INTERNAL_H #define MPEGDEMUX_INTERNAL_H 1 #define PAR_STREAM_EXCLUDE 1 #define PAR_MODE_SCAN 0 #define PAR_MODE_LIST 1 #define PAR_MODE_REMUX 2 #define PAR_MODE_DEMUX 3 extern unsigned char par_stream[256]; extern unsigned char par_substream[256]; extern unsigned char par_invalid[256]; extern int par_empty_pack; extern int par_drop; extern int par_dvdac3; char *mpeg_get_name (const char *base, unsigned sid); int mpeg_stream_excl (unsigned char sid, unsigned char ssid); int mpeg_packet_check (mpeg_demux_t *mpeg); int mpeg_copy (mpeg_demux_t *mpeg, int fd, unsigned n); #endif mediatomb-0.12.1/src/mpegdemux/mpeg_remux.h0000664000076400007640000000346611351644351015606 00000000000000/***************************************************************************** * mpegdemux * *****************************************************************************/ /***************************************************************************** * File name: mpeg_remux.h * * Created: 2003-02-02 by Hampa Hug * * Last modified: 2003-03-02 by Hampa Hug * * Copyright: (C) 2003 by Hampa Hug * *****************************************************************************/ /***************************************************************************** * This program is free software. You can redistribute it and / or modify it * * under the terms of the GNU General Public License version 2 as published * * by the Free Software Foundation. * * * * This program is distributed in the hope that it will be useful, but * * WITHOUT ANY WARRANTY, without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General * * Public License for more details. * *****************************************************************************/ /* $Id: mpeg_remux.h 67 2004-01-02 18:20:15Z hampa $ */ // The code has been modified to use file descriptors instead of FILE streams. // Only functionality needed in MediaTomb remains, all extra features are // stripped out. #ifndef MPEGDEMUX_MPEG_REMUX_H #define MPEGDEMUX_MPEG_REMUX_H 1 int mpeg_remux (int inp, int out); #endif mediatomb-0.12.1/src/mpegdemux/buffer.c0000664000076400007640000000652511351644351014701 00000000000000/***************************************************************************** * mpegdemux * *****************************************************************************/ /***************************************************************************** * File name: buffer.c * * Created: 2003-04-08 by Hampa Hug * * Last modified: 2003-04-08 by Hampa Hug * * Copyright: (C) 2003 by Hampa Hug * *****************************************************************************/ /***************************************************************************** * This program is free software. You can redistribute it and / or modify it * * under the terms of the GNU General Public License version 2 as published * * by the Free Software Foundation. * * * * This program is distributed in the hope that it will be useful, but * * WITHOUT ANY WARRANTY, without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General * * Public License for more details. * *****************************************************************************/ /* $Id: buffer.c 67 2004-01-02 18:20:15Z hampa $ */ // The code has been modified to use file descriptors instead of FILE streams. // Only functionality needed in MediaTomb remains, all extra features are // stripped out. #ifdef HAVE_CONFIG_H #include "autoconfig.h" #endif #ifdef HAVE_LIBDVDNAV #include #include #include "buffer.h" void mpeg_buf_init (mpeg_buffer_t *buf) { buf->buf = NULL; buf->max = 0; buf->cnt = 0; } void mpeg_buf_free (mpeg_buffer_t *buf) { free (buf->buf); buf->buf = NULL; buf->cnt = 0; buf->max = 0; } void mpeg_buf_clear (mpeg_buffer_t *buf) { buf->cnt = 0; } int mpeg_buf_set_max (mpeg_buffer_t *buf, unsigned max) { if (buf->max == max) { return (0); } if (max == 0) { free (buf->buf); buf->max = 0; buf->cnt = 0; return (0); } buf->buf = (unsigned char *) realloc (buf->buf, max); if (buf->buf == NULL) { buf->max = 0; buf->cnt = 0; return (1); } buf->max = max; if (buf->cnt > max) { buf->cnt = max; } return (0); } int mpeg_buf_set_cnt (mpeg_buffer_t *buf, unsigned cnt) { if (cnt > buf->max) { if (mpeg_buf_set_max (buf, cnt)) { return (1); } } buf->cnt = cnt; return (0); } int mpeg_buf_read (mpeg_buffer_t *buf, mpeg_demux_t *mpeg, unsigned cnt) { if (mpeg_buf_set_cnt (buf, cnt)) { return (1); } buf->cnt = mpegd_read (mpeg, buf->buf, cnt); if (buf->cnt != cnt) { return (1); } return (0); } int mpeg_buf_write (mpeg_buffer_t *buf, int fd) { if (buf->cnt > 0) { if (write (fd, buf->buf, buf->cnt) != buf->cnt) { return (1); } } return (0); } int mpeg_buf_write_clear (mpeg_buffer_t *buf, int fd) { if (buf->cnt > 0) { if (write (fd, buf->buf, buf->cnt) != buf->cnt) { buf->cnt = 0; return (1); } } buf->cnt = 0; return (0); } #endif//HAVE_LIBDVDNAV mediatomb-0.12.1/src/mpegdemux/mpeg_parse.c0000664000076400007640000003210311352675002015537 00000000000000/***************************************************************************** * mpegdemux * *****************************************************************************/ /***************************************************************************** * File name: mpeg_parse.c * * Created: 2003-02-01 by Hampa Hug * * Last modified: 2003-09-10 by Hampa Hug * * Copyright: (C) 2003 by Hampa Hug * *****************************************************************************/ /***************************************************************************** * This program is free software. You can redistribute it and / or modify it * * under the terms of the GNU General Public License version 2 as published * * by the Free Software Foundation. * * * * This program is distributed in the hope that it will be useful, but * * WITHOUT ANY WARRANTY, without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General * * Public License for more details. * *****************************************************************************/ /* $Id: mpeg_parse.c 67 2004-01-02 18:20:15Z hampa $ */ // The code has been modified to use file descriptors instead of FILE streams. // Only functionality needed in MediaTomb remains, all extra features are // stripped out. #ifdef HAVE_CONFIG_H #include "autoconfig.h" #endif #ifdef HAVE_LIBDVDNAV #include #include #include #include #include #include #include "mpeg_parse.h" mpeg_demux_t *mpegd_open_fd (mpeg_demux_t *mpeg, int fd, int close_file) { if (mpeg == NULL) { mpeg = (mpeg_demux_t *) malloc (sizeof (mpeg_demux_t)); if (mpeg == NULL) { return (NULL); } mpeg->free = 1; } else { mpeg->free = 0; } mpeg->fd = fd; mpeg->close = close_file; mpeg->ofs = 0; mpeg->buf_i = 0; mpeg->buf_n = 0; mpeg->ext = -1; mpeg->mpeg_skip = NULL; mpeg->mpeg_system_header = NULL; mpeg->mpeg_packet = NULL; mpeg->mpeg_packet_check = NULL; mpeg->mpeg_pack = NULL; mpeg->mpeg_end = NULL; mpegd_reset_stats (mpeg); return (mpeg); } mpeg_demux_t *mpegd_open (mpeg_demux_t *mpeg, const char *fname) { int fd; fd = open (fname, O_RDONLY); if (fd == -1) { return (NULL); } mpeg = mpegd_open_fd (mpeg, fd, 1); return (mpeg); } void mpegd_close (mpeg_demux_t *mpeg) { if (mpeg->close) { close (mpeg->fd); } if (mpeg->free) { free (mpeg); } } void mpegd_reset_stats (mpeg_demux_t *mpeg) { unsigned i; mpeg->shdr_cnt = 0; mpeg->pack_cnt = 0; mpeg->packet_cnt = 0; mpeg->end_cnt = 0; mpeg->skip_cnt = 0; for (i = 0; i < 256; i++) { mpeg->streams[i].packet_cnt = 0; mpeg->streams[i].size = 0; mpeg->substreams[i].packet_cnt = 0; mpeg->substreams[i].size = 0; } } static int mpegd_buffer_fill (mpeg_demux_t *mpeg) { unsigned i, n; size_t r; if ((mpeg->buf_i > 0) && (mpeg->buf_n > 0)) { for (i = 0; i < mpeg->buf_n; i++) { mpeg->buf[i] = mpeg->buf[mpeg->buf_i + i]; } } mpeg->buf_i = 0; n = MPEG_DEMUX_BUFFER - mpeg->buf_n; if (n > 0) { r = read (mpeg->fd, mpeg->buf + mpeg->buf_n, n); if (r < 0) { return (1); } mpeg->buf_n += (unsigned) r; } return (0); } static int mpegd_need_bits (mpeg_demux_t *mpeg, unsigned n) { n = (n + 7) / 8; if (n > mpeg->buf_n) { mpegd_buffer_fill (mpeg); } if (n > mpeg->buf_n) { return (1); } return (0); } unsigned long mpegd_get_bits (mpeg_demux_t *mpeg, unsigned i, unsigned n) { unsigned long r; unsigned long v, m; unsigned b_i, b_n; unsigned char *buf; if (mpegd_need_bits (mpeg, i + n)) { return (0); } buf = mpeg->buf + mpeg->buf_i; r = 0; /* aligned bytes */ if (((i | n) & 7) == 0) { i = i / 8; n = n / 8; while (n > 0) { r = (r << 8) | buf[i]; i += 1; n -= 1; } return (r); } while (n > 0) { b_n = 8 - (i & 7); if (b_n > n) { b_n = n; } b_i = 8 - (i & 7) - b_n; m = (1 << b_n) - 1; v = (buf[i >> 3] >> b_i) & m; r = (r << b_n) | v; i += b_n; n -= b_n; } return (r); } int mpegd_skip (mpeg_demux_t *mpeg, unsigned n) { size_t r; mpeg->ofs += n; if (n <= mpeg->buf_n) { mpeg->buf_i += n; mpeg->buf_n -= n; return (0); } n -= mpeg->buf_n; mpeg->buf_i = 0; mpeg->buf_n = 0; while (n > 0) { if (n <= MPEG_DEMUX_BUFFER) { r = read (mpeg->fd ,mpeg->buf, n); } else { r = read (mpeg->fd, mpeg->buf, MPEG_DEMUX_BUFFER); } if (r <= 0) { return (1); } n -= (unsigned) r; } return (0); } unsigned mpegd_read (mpeg_demux_t *mpeg, void *buf, unsigned n) { unsigned ret; unsigned i; unsigned char *tmp; tmp = (unsigned char *) buf; i = (n < mpeg->buf_n) ? n : mpeg->buf_n; ret = i; if (i > 0) { memcpy (tmp, &mpeg->buf[mpeg->buf_i], i); tmp += i; mpeg->buf_i += i; mpeg->buf_n -= i; n -= i; } if (n > 0) { ret += read (mpeg->fd, tmp, n); } mpeg->ofs += ret; return (ret); } int mpegd_set_offset (mpeg_demux_t *mpeg, unsigned long long ofs) { if (ofs == mpeg->ofs) { return (0); } if (ofs > mpeg->ofs) { return (mpegd_skip (mpeg, (unsigned long) (ofs - mpeg->ofs))); } return (1); } static int mpegd_seek_header (mpeg_demux_t *mpeg) { unsigned long long ofs; while (mpegd_get_bits (mpeg, 0, 24) != 1) { ofs = mpeg->ofs + 1; if (mpeg->mpeg_skip != NULL) { if (mpeg->mpeg_skip (mpeg)) { return (1); } } if (mpegd_set_offset (mpeg, ofs)) { return (1); } mpeg->skip_cnt += 1; } return (0); } static int mpegd_parse_system_header (mpeg_demux_t *mpeg) { unsigned long long ofs; mpeg->shdr.size = mpegd_get_bits (mpeg, 32, 16) + 6; mpeg->shdr.fixed = mpegd_get_bits (mpeg, 78, 1); mpeg->shdr.csps = mpegd_get_bits (mpeg, 79, 1); mpeg->shdr_cnt += 1; ofs = mpeg->ofs + mpeg->shdr.size; if (mpeg->mpeg_system_header != NULL) { if (mpeg->mpeg_system_header (mpeg)) { return (1); } } mpegd_set_offset (mpeg, ofs); return (0); } static int mpegd_parse_packet1 (mpeg_demux_t *mpeg, unsigned i) { unsigned val; unsigned long long tmp; mpeg->packet.type = 1; if (mpegd_get_bits (mpeg, i, 2) == 0x01) { i += 16; } val = mpegd_get_bits (mpeg, i, 8); if ((val & 0xf0) == 0x20) { tmp = mpegd_get_bits (mpeg, i + 4, 3); tmp = (tmp << 15) | mpegd_get_bits (mpeg, i + 8, 15); tmp = (tmp << 15) | mpegd_get_bits (mpeg, i + 24, 15); mpeg->packet.have_pts = 1; mpeg->packet.pts = tmp; i += 40; } else if ((val & 0xf0) == 0x30) { tmp = mpegd_get_bits (mpeg, i + 4, 3); tmp = (tmp << 15) | mpegd_get_bits (mpeg, i + 8, 15); tmp = (tmp << 15) | mpegd_get_bits (mpeg, i + 24, 15); mpeg->packet.have_pts = 1; mpeg->packet.pts = tmp; tmp = mpegd_get_bits (mpeg, i + 44, 3); tmp = (tmp << 15) | mpegd_get_bits (mpeg, i + 48, 15); tmp = (tmp << 15) | mpegd_get_bits (mpeg, i + 64, 15); mpeg->packet.have_dts = 1; mpeg->packet.dts = tmp; i += 80; } else if (val == 0x0f) { i += 8; } mpeg->packet.offset = i / 8; return (0); } static int mpegd_parse_packet2 (mpeg_demux_t *mpeg, unsigned i) { unsigned pts_dts_flag; unsigned cnt; unsigned long long tmp; mpeg->packet.type = 2; pts_dts_flag = mpegd_get_bits (mpeg, i + 8, 2); cnt = mpegd_get_bits (mpeg, i + 16, 8); if (pts_dts_flag == 0x02) { if (mpegd_get_bits (mpeg, i + 24, 4) == 0x02) { tmp = mpegd_get_bits (mpeg, i + 28, 3); tmp = (tmp << 15) | mpegd_get_bits (mpeg, i + 32, 15); tmp = (tmp << 15) | mpegd_get_bits (mpeg, i + 48, 15); mpeg->packet.have_pts = 1; mpeg->packet.pts = tmp; } } else if ((pts_dts_flag & 0x03) == 0x03) { if (mpegd_get_bits (mpeg, i + 24, 4) == 0x03) { tmp = mpegd_get_bits (mpeg, i + 28, 3); tmp = (tmp << 15) | mpegd_get_bits (mpeg, i + 32, 15); tmp = (tmp << 15) | mpegd_get_bits (mpeg, i + 48, 15); mpeg->packet.have_pts = 1; mpeg->packet.pts = tmp; } if (mpegd_get_bits (mpeg, i + 64, 4) == 0x01) { tmp = mpegd_get_bits (mpeg, i + 68, 3); tmp = (tmp << 15) | mpegd_get_bits (mpeg, i + 72, 15); tmp = (tmp << 15) | mpegd_get_bits (mpeg, i + 88, 15); mpeg->packet.have_dts = 1; mpeg->packet.dts = tmp; } } i += 8 * (cnt + 3); mpeg->packet.offset = i / 8; return (0); } static int mpegd_parse_packet (mpeg_demux_t *mpeg) { unsigned i; unsigned sid, ssid; unsigned long long ofs; mpeg->packet.type = 0; sid = mpegd_get_bits (mpeg, 24, 8); ssid = 0; mpeg->packet.sid = sid; mpeg->packet.ssid = ssid; mpeg->packet.size = mpegd_get_bits (mpeg, 32, 16) + 6; mpeg->packet.offset = 6; mpeg->packet.have_pts = 0; mpeg->packet.pts = 0; mpeg->packet.have_dts = 0; mpeg->packet.dts = 0; i = 48; if (((sid >= 0xc0) && (sid < 0xf0)) || (sid == 0xbd)) { while (mpegd_get_bits (mpeg, i, 8) == 0xff) { if (i > (48 + 16 * 8)) { break; } i += 8; } if (mpegd_get_bits (mpeg, i, 2) == 0x02) { if (mpegd_parse_packet2 (mpeg, i)) { return (1); } } else { if (mpegd_parse_packet1 (mpeg, i)) { return (1); } } } else if (sid == 0xbe) { mpeg->packet.type = 1; } if (sid == 0xbd) { ssid = mpegd_get_bits (mpeg, 8 * mpeg->packet.offset, 8); mpeg->packet.ssid = ssid; } if ((mpeg->mpeg_packet_check != NULL) && mpeg->mpeg_packet_check (mpeg)) { if (mpegd_skip (mpeg, 1)) { return (1); } } else { mpeg->packet_cnt += 1; mpeg->streams[sid].packet_cnt += 1; mpeg->streams[sid].size += mpeg->packet.size - mpeg->packet.offset; if (sid == 0xbd) { mpeg->substreams[ssid].packet_cnt += 1; mpeg->substreams[ssid].size += mpeg->packet.size - mpeg->packet.offset; } ofs = mpeg->ofs + mpeg->packet.size; if (mpeg->mpeg_packet != NULL) { if (mpeg->mpeg_packet (mpeg)) { return (1); } } mpegd_set_offset (mpeg, ofs); } return (0); } static int mpegd_parse_pack (mpeg_demux_t *mpeg) { unsigned sid; unsigned long long ofs; if (mpegd_get_bits (mpeg, 32, 4) == 0x02) { mpeg->pack.type = 1; mpeg->pack.scr = mpegd_get_bits (mpeg, 36, 3); mpeg->pack.scr = (mpeg->pack.scr << 15) | mpegd_get_bits (mpeg, 40, 15); mpeg->pack.scr = (mpeg->pack.scr << 15) | mpegd_get_bits (mpeg, 56, 15); mpeg->pack.mux_rate = mpegd_get_bits (mpeg, 73, 22); mpeg->pack.stuff = 0; mpeg->pack.size = 12; } else if (mpegd_get_bits (mpeg, 32, 2) == 0x01) { mpeg->pack.type = 2; mpeg->pack.scr = mpegd_get_bits (mpeg, 34, 3); mpeg->pack.scr = (mpeg->pack.scr << 15) | mpegd_get_bits (mpeg, 38, 15); mpeg->pack.scr = (mpeg->pack.scr << 15) | mpegd_get_bits (mpeg, 54, 15); mpeg->pack.mux_rate = mpegd_get_bits (mpeg, 80, 22); mpeg->pack.stuff = mpegd_get_bits (mpeg, 109, 3); mpeg->pack.size = 14 + mpeg->pack.stuff; } else { mpeg->pack.type = 0; mpeg->pack.scr = 0; mpeg->pack.mux_rate = 0; mpeg->pack.size = 4; } ofs = mpeg->ofs + mpeg->pack.size; mpeg->pack_cnt += 1; if (mpeg->mpeg_pack != NULL) { if (mpeg->mpeg_pack (mpeg)) { return (1); } } mpegd_set_offset (mpeg, ofs); mpegd_seek_header (mpeg); if (mpegd_get_bits (mpeg, 0, 32) == MPEG_SYSTEM_HEADER) { if (mpegd_parse_system_header (mpeg)) { return (1); } mpegd_seek_header (mpeg); } while (mpegd_get_bits (mpeg, 0, 24) == MPEG_PACKET_START) { sid = mpegd_get_bits (mpeg, 24, 8); if ((sid == 0xba) || (sid == 0xb9) || (sid == 0xbb)) { break; } else { mpegd_parse_packet (mpeg); } mpegd_seek_header (mpeg); } return (0); } int mpegd_parse (mpeg_demux_t *mpeg) { unsigned long long ofs; while (1) { if (mpegd_seek_header (mpeg)) { return (0); } switch (mpegd_get_bits (mpeg, 0, 32)) { case MPEG_PACK_START: if (mpegd_parse_pack (mpeg)) { return (1); } break; case MPEG_END_CODE: mpeg->end_cnt += 1; ofs = mpeg->ofs + 4; if (mpeg->mpeg_end != NULL) { if (mpeg->mpeg_end (mpeg)) { return (1); } } if (mpegd_set_offset (mpeg, ofs)) { return (1); } break; default: ofs = mpeg->ofs + 1; if (mpeg->mpeg_skip != NULL) { if (mpeg->mpeg_skip (mpeg)) { return (1); } } if (mpegd_set_offset (mpeg, ofs)) { return (0); } break; } } return (0); } #endif//HAVE_LIBDVDNAV mediatomb-0.12.1/src/mpegdemux/mpeg_remux.c0000664000076400007640000000774211351644351015602 00000000000000/***************************************************************************** * mpegdemux * *****************************************************************************/ /***************************************************************************** * File name: mpeg_remux.c * * Created: 2003-02-02 by Hampa Hug * * Last modified: 2003-09-10 by Hampa Hug * * Copyright: (C) 2003 by Hampa Hug * *****************************************************************************/ /***************************************************************************** * This program is free software. You can redistribute it and / or modify it * * under the terms of the GNU General Public License version 2 as published * * by the Free Software Foundation. * * * * This program is distributed in the hope that it will be useful, but * * WITHOUT ANY WARRANTY, without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General * * Public License for more details. * *****************************************************************************/ /* $Id: mpeg_remux.c 67 2004-01-02 18:20:15Z hampa $ */ // The code has been modified to use file descriptors instead of FILE streams. // Only functionality needed in MediaTomb remains, all extra features are // stripped out. #ifdef HAVE_CONFIG_H #include "autoconfig.h" #endif #ifdef HAVE_LIBDVDNAV #include #include #include #include "buffer.h" #include "mpeg_parse.h" #include "mpeg_remux.h" #include "mpegdemux_internal.h" static mpeg_buffer_t shdr = { NULL, 0, 0 }; static mpeg_buffer_t pack = { NULL, 0, 0 }; static mpeg_buffer_t packet = { NULL, 0, 0 }; static int mpeg_remux_system_header (mpeg_demux_t *mpeg) { if (mpeg_buf_write_clear (&pack, mpeg->ext)) { return (1); } if (mpeg_buf_read (&shdr, mpeg, mpeg->shdr.size)) { return (1); } if (mpeg_buf_write_clear (&shdr, mpeg->ext)) { return (1); } return (0); } static int mpeg_remux_packet (mpeg_demux_t *mpeg) { int r; unsigned sid, ssid; sid = mpeg->packet.sid; ssid = mpeg->packet.ssid; if (mpeg_stream_excl (sid, ssid)) { return (0); } r = 0; if (mpeg_buf_read (&packet, mpeg, mpeg->packet.size)) { fprintf(stderr, "remux: incomplete packet (sid=%02x size=%u/%u)\n", sid, packet.cnt, mpeg->packet.size ); if (par_drop) { mpeg_buf_clear (&packet); return (1); } r = 1; } if (mpeg_buf_write_clear (&pack, mpeg->ext)) { return (1); } if (mpeg_buf_write_clear (&packet, mpeg->ext)) { return (1); } return (r); } static int mpeg_remux_pack (mpeg_demux_t *mpeg) { if (mpeg_buf_read (&pack, mpeg, mpeg->pack.size)) { return (1); } if (par_empty_pack) { if (mpeg_buf_write_clear (&pack, mpeg->ext)) { return (1); } } return (0); } static int mpeg_remux_end (mpeg_demux_t *mpeg) { if (mpeg_copy (mpeg, mpeg->ext, 4)) { return (1); } return (0); } int mpeg_remux (int inp, int out) { int r; mpeg_demux_t *mpeg; mpeg = mpegd_open_fd (NULL, inp, 0); if (mpeg == NULL) { return (1); } mpeg->ext = out; mpeg->mpeg_system_header = &mpeg_remux_system_header; mpeg->mpeg_pack = &mpeg_remux_pack; mpeg->mpeg_packet = &mpeg_remux_packet; mpeg->mpeg_packet_check = &mpeg_packet_check; mpeg->mpeg_end = &mpeg_remux_end; mpeg_buf_init (&shdr); mpeg_buf_init (&pack); mpeg_buf_init (&packet); r = mpegd_parse (mpeg); mpegd_close (mpeg); mpeg_buf_free (&shdr); mpeg_buf_free (&pack); mpeg_buf_free (&packet); return (r); } #endif//HAVE_LIBDVDNAV mediatomb-0.12.1/src/mpegdemux/mpegdemux.c0000664000076400007640000001037011352675002015412 00000000000000/***************************************************************************** * mpegdemux * *****************************************************************************/ /***************************************************************************** * File name: mpegdemux.c * * Created: 2003-02-01 by Hampa Hug * * Last modified: 2004-04-08 by Hampa Hug * * Copyright: (C) 2003-2004 Hampa Hug * *****************************************************************************/ /***************************************************************************** * This program is free software. You can redistribute it and / or modify it * * under the terms of the GNU General Public License version 2 as published * * by the Free Software Foundation. * * * * This program is distributed in the hope that it will be useful, but * * WITHOUT ANY WARRANTY, without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General * * Public License for more details. * *****************************************************************************/ /* $Id: mpegdemux.c 78 2004-04-08 18:57:31Z hampa $ */ // The code has been modified to use file descriptors instead of FILE streams. // Only functionality needed in MediaTomb remains, all extra features are // stripped out. #ifdef HAVE_CONFIG_H #include "autoconfig.h" #endif #ifdef HAVE_LIBDVDNAV #include #include #include #include #include #include #include #include "mpeg_parse.h" #include "mpeg_remux.h" #include "mpegdemux_internal.h" // thanks to mru for the following defines #define ISVIDEO(id) ((id & 0xf0) == 0xe0) #define ISMPEGAUDIO(id) ((id & 0xe0) == 0xc0) #define ISAC3(id) ((id & 0xf8) == 0x80) #define ISDTS(id) ((id & 0xf8) == 0x88) #define ISPCM(id) ((id & 0xf8) == 0xa0) #define ISSPU(id) ((id & 0xe0) == 0x20) #define STREAM_ID_PRIVATE 0xbd static int par_inp = -1; static int par_out = -1; unsigned char par_stream[256]; unsigned char par_substream[256]; unsigned char par_invalid[256]; int par_empty_pack = 0; int par_drop = 1; int par_dvdac3 = 0; int mpeg_stream_excl (unsigned char sid, unsigned char ssid) { if (par_stream[sid] & PAR_STREAM_EXCLUDE) { return (1); } if (sid == 0xbd) { if (par_substream[ssid] & PAR_STREAM_EXCLUDE) { return (1); } } return (0); } /* check if packet is valid. returns 0 if it is. */ int mpeg_packet_check (mpeg_demux_t *mpeg) { return ((par_invalid[mpeg->packet.sid] & PAR_STREAM_EXCLUDE) == 0); } int mpeg_copy (mpeg_demux_t *mpeg, int fd, unsigned n) { unsigned char buf[4096]; unsigned i, j; while (n > 0) { i = (n < 4096) ? n : 4096; j = mpegd_read (mpeg, buf, i); if (j > 0) { if (write (fd, buf, j) != j) { return (1); } } if (i != j) { return (1); } n -= i; } return (0); } int remux_mpeg(int fd_in, int fd_out, unsigned char keep_video_id, unsigned char keep_audio_id) { unsigned i; int r; if (!ISVIDEO(keep_video_id)) return 1; for (i = 0; i < 256; i++) { par_stream[i] = PAR_STREAM_EXCLUDE; par_substream[i] = PAR_STREAM_EXCLUDE; par_invalid[i] = PAR_STREAM_EXCLUDE; } par_stream[keep_video_id] &= ~PAR_STREAM_EXCLUDE; if (ISAC3(keep_audio_id) || ISDTS(keep_audio_id) || ISPCM(keep_audio_id)) { par_stream[STREAM_ID_PRIVATE] &= ~PAR_STREAM_EXCLUDE; par_substream[keep_audio_id] &= ~PAR_STREAM_EXCLUDE; par_dvdac3 = 1; } else { par_stream[keep_audio_id] &= ~PAR_STREAM_EXCLUDE; } par_inp = fd_in; par_out = fd_out; if ((par_inp == -1) || (par_out == -1)) { return 1; } r = mpeg_remux (par_inp, par_out); if (r) { return (1); } return (0); } #endif//HAVE_LIBDVDNAV mediatomb-0.12.1/src/mpegdemux/mpeg_parse.h0000664000076400007640000001032711351644351015552 00000000000000/***************************************************************************** * mpegdemux * *****************************************************************************/ /***************************************************************************** * File name: mpeg_parse.h * * Created: 2003-02-01 by Hampa Hug * * Last modified: 2003-09-10 by Hampa Hug * * Copyright: (C) 2003 by Hampa Hug * *****************************************************************************/ /***************************************************************************** * This program is free software. You can redistribute it and / or modify it * * under the terms of the GNU General Public License version 2 as published * * by the Free Software Foundation. * * * * This program is distributed in the hope that it will be useful, but * * WITHOUT ANY WARRANTY, without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General * * Public License for more details. * *****************************************************************************/ /* $Id: mpeg_parse.h 67 2004-01-02 18:20:15Z hampa $ */ // The code has been modified to use file descriptors instead of FILE streams. // Only functionality needed in MediaTomb remains, all extra features are // stripped out. #ifndef MPEG_PARSE_H #define MPEG_PARSE_H 1 #include #define MPEG_DEMUX_BUFFER 4096 #define MPEG_END_CODE 0x01b9 #define MPEG_PACK_START 0x01ba #define MPEG_SYSTEM_HEADER 0x01bb #define MPEG_PACKET_START 0x0001 typedef struct { unsigned long packet_cnt; unsigned long long size; } mpeg_stream_info_t; typedef struct { unsigned size; int fixed; int csps; } mpeg_shdr_t; typedef struct { unsigned type; unsigned sid; unsigned ssid; unsigned size; unsigned offset; char have_pts; unsigned long long pts; char have_dts; unsigned long long dts; } mpeg_packet_t; typedef struct { unsigned size; unsigned type; unsigned long long scr; unsigned long mux_rate; unsigned stuff; } mpeg_pack_t; typedef struct mpeg_demux_t { int close; int free; int fd; unsigned long long ofs; unsigned buf_i; unsigned buf_n; unsigned char buf[MPEG_DEMUX_BUFFER]; mpeg_shdr_t shdr; mpeg_packet_t packet; mpeg_pack_t pack; unsigned long shdr_cnt; unsigned long pack_cnt; unsigned long packet_cnt; unsigned long end_cnt; unsigned long skip_cnt; mpeg_stream_info_t streams[256]; mpeg_stream_info_t substreams[256]; // void *ext; int ext; int (*mpeg_skip) (struct mpeg_demux_t *mpeg); int (*mpeg_pack) (struct mpeg_demux_t *mpeg); int (*mpeg_system_header) (struct mpeg_demux_t *mpeg); int (*mpeg_packet) (struct mpeg_demux_t *mpeg); int (*mpeg_packet_check) (struct mpeg_demux_t *mpeg); int (*mpeg_end) (struct mpeg_demux_t *mpeg); } mpeg_demux_t; mpeg_demux_t *mpegd_open_fd (mpeg_demux_t *mpeg, int fd, int close_file); mpeg_demux_t *mpegd_open (mpeg_demux_t *mpeg, const char *fname); void mpegd_close (mpeg_demux_t *mpeg); void mpegd_reset_stats (mpeg_demux_t *mpeg); unsigned long mpegd_get_bits (mpeg_demux_t *mpeg, unsigned i, unsigned n); int mpegd_skip (mpeg_demux_t *mpeg, unsigned n); /*!*************************************************************************** * @short Read from the mpeg stream * @return The number of bytes read *****************************************************************************/ unsigned mpegd_read (mpeg_demux_t *mpeg, void *buf, unsigned n); int mpegd_set_offset (mpeg_demux_t *mpeg, unsigned long long ofs); int mpegd_parse (mpeg_demux_t *mpeg); #endif mediatomb-0.12.1/src/destroyer.h0000664000076400007640000000275111352675003013456 00000000000000/*MT* MediaTomb - http://www.mediatomb.cc/ destroyer.h - this file is part of MediaTomb. Copyright (C) 2005 Gena Batyan , Sergey 'Jin' Bostandzhyan Copyright (C) 2006-2010 Gena Batyan , Sergey 'Jin' Bostandzhyan , Leonhard Wimmer MediaTomb is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. MediaTomb is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with MediaTomb; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. $Id: destroyer.h 2081 2010-03-23 20:18:00Z lww $ */ /// \file destroyer.h #ifndef __DESTROYER_H__ #define __DESTROYER_H__ #include "common.h" class Destroyer : public zmm::Object { protected: void *data; void (* destroy_func)(void *); public: Destroyer(void (* destroy_func)(void *), void *data); virtual ~Destroyer(); void destroy(); }; #endif // __DESTROYER_H__ mediatomb-0.12.1/src/fd_io_handler.cc0000664000076400007640000000712411352675003014350 00000000000000/*MT* MediaTomb - http://www.mediatomb.cc/ fd_io_handler.cc - this file is part of MediaTomb. Copyright (C) 2005 Gena Batyan , Sergey 'Jin' Bostandzhyan Copyright (C) 2006-2010 Gena Batyan , Sergey 'Jin' Bostandzhyan , Leonhard Wimmer MediaTomb is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. MediaTomb is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with MediaTomb; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. $Id: fd_io_handler.cc 2081 2010-03-23 20:18:00Z lww $ */ /// \file fd_io_handler.cc #ifdef HAVE_CONFIG_H #include "autoconfig.h" #endif #include "server.h" #include #include #include #include #include #include #include "common.h" #include "fd_io_handler.h" using namespace zmm; using namespace mxml; FDIOHandler::FDIOHandler(String filename) : IOHandler() { this->filename = filename; this->fd = -1; this->other = nil; this->reference_list = Ref >(new Array(4)); this->closed = false; } FDIOHandler::FDIOHandler(int fd) : IOHandler() { this->filename = nil; this->fd = fd; this->other = nil; this->reference_list = Ref >(new Array(4)); this->closed = false; } void FDIOHandler::addReference(Ref reference) { reference_list->append(reference); } void FDIOHandler::closeOther(Ref other) { this->other = other; } void FDIOHandler::open(IN enum UpnpOpenFileMode mode) { if (fd != -1) { log_debug("Assuming valid fd %d\n", fd); return; } if (!string_ok(filename)) throw _Exception(_("Missing filename!")); if (mode == UPNP_READ) { fd = ::open(filename.c_str(), O_RDONLY); } else if (mode == UPNP_WRITE) { fd = ::open(filename.c_str(), O_WRONLY | O_CREAT, S_IWUSR | S_IRUSR); } else { throw _Exception(_("FDIOHandler::open: invdalid read/write mode")); } if (fd == -1) { throw _Exception(_("FDIOHandler::open: failed to open: ") + filename.c_str()); } } int FDIOHandler::read(OUT char *buf, IN size_t length) { int ret = 0; ret = ::read(fd, buf, length); return ret; } int FDIOHandler::write(IN char *buf, IN size_t length) { int ret = 0; ret = ::write(fd, buf, length); return ret; } void FDIOHandler::seek(IN off_t offset, IN int whence) { if (lseek(fd, offset, whence) != 0) { throw _Exception(_("fseek failed")); } } void FDIOHandler::close() { if (closed) return; log_debug("Closing...\n"); try { if (other != nil) other->close(); } catch (Exception ex) { log_debug("Error closing \"other\" handler: %s\n", ex.getMessage().c_str()); } // protect from multiple close calls if (::close(fd) != 0) { throw _Exception(_("fclose failed")); } fd = -1; closed = true; } mediatomb-0.12.1/src/string_converter.h0000664000076400007640000000563111352675003015033 00000000000000/*MT* MediaTomb - http://www.mediatomb.cc/ string_converter.h - this file is part of MediaTomb. Copyright (C) 2005 Gena Batyan , Sergey 'Jin' Bostandzhyan Copyright (C) 2006-2010 Gena Batyan , Sergey 'Jin' Bostandzhyan , Leonhard Wimmer MediaTomb is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. MediaTomb is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with MediaTomb; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. $Id: string_converter.h 2081 2010-03-23 20:18:00Z lww $ */ /// \file string_converter.h #ifndef __STRING_CONVERTER_H__ #define __STRING_CONVERTER_H__ #include "common.h" #include class StringConverter : public zmm::Object { public: StringConverter(zmm::String from, zmm::String to); virtual ~StringConverter(); /// \brief Converts uses the from and to values that were passed /// to the constructor to convert the string str to a specific character /// set. /// \param str String to be converted. /// \param validate if this parameter is true then an exception will be /// thrown if illegal input is encountered. If false, illegal characters /// will be padded with '?' and the function will return the string. zmm::String convert(zmm::String str, bool validate=false); bool validate(zmm::String str); /// \brief internal (UTF-8) to filesystem static zmm::Ref i2f(); /// \brief filesystem to internal static zmm::Ref f2i(); /// \brief metadata to internal static zmm::Ref m2i(); #ifdef HAVE_JS /// \brief scripting to internal static zmm::Ref j2i(); /// \brief playlist to internal static zmm::Ref p2i(); #endif #if defined(HAVE_JS) || defined(HAVE_TAGLIB) || defined(YOUTUBE) || defined(HAVE_LIBEXTRACTOR) || defined(HAVE_LIBMP4V2) /// \brief safeguard - internal to internal - needed to catch some /// scenarious where the user may have forgotten to add proper conversion /// in the script. static zmm::Ref i2i(); #endif protected: iconv_t cd; bool dirty; zmm::String _convert(zmm::String str, bool validate, size_t *stoppedAt = NULL); }; #endif // __STRING_CONVERTER_H__ mediatomb-0.12.1/src/filesystem.cc0000664000076400007640000001664011352675003013762 00000000000000/*MT* MediaTomb - http://www.mediatomb.cc/ filesystem.cc - this file is part of MediaTomb. Copyright (C) 2005 Gena Batyan , Sergey 'Jin' Bostandzhyan Copyright (C) 2006-2010 Gena Batyan , Sergey 'Jin' Bostandzhyan , Leonhard Wimmer MediaTomb is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. MediaTomb is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with MediaTomb; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. $Id: filesystem.cc 2081 2010-03-23 20:18:00Z lww $ */ /// \file filesystem.cc #ifdef HAVE_CONFIG_H #include "autoconfig.h" #endif #include #include #include #include "common.h" #include "config_manager.h" #include "content_manager.h" #include "filesystem.h" #include "mxml/mxml.h" #include "tools.h" using namespace zmm; using namespace mxml; int FsObjectComparator(void *arg1, void *arg2) { FsObject *o1 = (FsObject *)arg1; FsObject *o2 = (FsObject *)arg2; if (o1->isDirectory) { if (o2->isDirectory) return strcmp(o1->filename.c_str(), o2->filename.c_str()); else return -1; } else { if (o2->isDirectory) return 1; else return strcmp(o1->filename.c_str(), o2->filename.c_str()); } } Filesystem::Filesystem() : Object() { includeRules = Ref >(new Array()); Ref cm = ConfigManager::getInstance(); /* Ref rules = cm->getElement(_("filter")); if (rules == nil) return; for (int i = 0; i < rules->childCount(); i++) { Ref rule = rules->getChild(i); String pat = rule->getAttribute(_("pattern")); /// \todo make patterns from simple wildcards instead of /// taking the pattern attribute directly as regexp Ref pattern(new RExp()); try { pattern->compile(pat); includeRules->append(pattern); } catch (Exception e) { e.printStackTrace(); } } */ } Ref > Filesystem::readDirectory(String path, int mask, int childMask) { if (path.charAt(0) != '/') { throw _Exception(_("Filesystem: relative paths not allowed: ") + path); } if (! fileAllowed(path)) throw _Exception(_("Filesystem: file blocked: ") + path); struct stat statbuf; int ret; Ref > files(new Array()); DIR *dir; struct dirent *dent; dir = opendir(path.c_str()); if (! dir) { throw _Exception(_("could not list directory ") + path + " : " + strerror(errno)); } while ((dent = readdir(dir)) != NULL) { char *name = dent->d_name; if (name[0] == '.') { if (name[1] == 0) { continue; } else if (name[1] == '.' && name[2] == 0) { continue; } else if (!(mask & FS_MASK_HIDDEN)) continue; } String childPath; if (path == FS_ROOT_DIRECTORY) childPath = path + name; else childPath = path + "/" + name; if (fileAllowed(childPath)) { bool isDirectory = false; bool hasContent = false; ret = stat(childPath.c_str(), &statbuf); if (ret != 0) continue; if (S_ISREG(statbuf.st_mode)) { if (! (mask & FS_MASK_FILES)) continue; } else if (S_ISDIR(statbuf.st_mode)) { if (! (mask & FS_MASK_DIRECTORIES)) continue; isDirectory = true; if (childMask) { try { hasContent = have(childPath, childMask); } catch (Exception e) { //continue; } } } else continue; // special file Ref obj(new FsObject()); obj->filename = name; obj->isDirectory = isDirectory; obj->hasContent = hasContent; files->append(obj); } } closedir(dir); quicksort((COMPARABLE *)files->getObjectArray(), files->size(), FsObjectComparator); return files; } bool Filesystem::have(String path, int mask) { /* if (path.charAt(0) != '/') { throw _Exception(_("Filesystem relative paths not allowed: ") + path); } */ if (! fileAllowed(path)) return false; struct stat statbuf; int ret; Ref > files(new Array()); DIR *dir; struct dirent *dent; dir = opendir(path.c_str()); if (! dir) { throw _Exception(_("could not list directory ")+ path + " : " + strerror(errno)); } bool result = false; while ((dent = readdir(dir)) != NULL) { char *name = dent->d_name; if (name[0] == '.') { if (name[1] == 0) { continue; } else if (name[1] == '.' && name[2] == 0) { continue; } else if (!(mask & FS_MASK_HIDDEN)) continue; } String childPath; if (path == FS_ROOT_DIRECTORY) childPath = path + name; else childPath = path + "/" + name; if (fileAllowed(childPath)) { ret = stat(childPath.c_str(), &statbuf); if (ret != 0) continue; if (S_ISREG(statbuf.st_mode) && mask & FS_MASK_FILES) { result = true; break; } else if (S_ISDIR(statbuf.st_mode) && mask & FS_MASK_DIRECTORIES) { result = true; break; } else continue; // special file } } closedir(dir); return result; } bool Filesystem::haveFiles(String dir) { return have(dir, FS_MASK_FILES); } bool Filesystem::haveDirectories(String dir) { return have(dir, FS_MASK_DIRECTORIES); } bool Filesystem::fileAllowed(String path) { if (path == ConfigManager::getInstance()->getConfigFilename()) return false; return true; /* for (int i = 0; i < include_rules->size(); i++) { Ref rule = include_rules->get(i); if (rule->matches(path)) return true; } return false; */ } mediatomb-0.12.1/src/web_request_handler.h0000664000076400007640000001457711352675003015471 00000000000000/*MT* MediaTomb - http://www.mediatomb.cc/ web_request_handler.h - this file is part of MediaTomb. Copyright (C) 2005 Gena Batyan , Sergey 'Jin' Bostandzhyan Copyright (C) 2006-2010 Gena Batyan , Sergey 'Jin' Bostandzhyan , Leonhard Wimmer MediaTomb is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. MediaTomb is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with MediaTomb; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. $Id: web_request_handler.h 2081 2010-03-23 20:18:00Z lww $ */ /// \file web_request_handler.h /// \brief Definition of the WebRequestHandler class. #ifndef __WEB_REQUEST_HANDLER_H__ #define __WEB_REQUEST_HANDLER_H__ #include "common.h" #include "mxml/mxml.h" #include "request_handler.h" #include "dictionary.h" #include "session_manager.h" #include "config_manager.h" #include "content_manager.h" class SessionException : public zmm::Exception { public: SessionException(zmm::String message) : zmm::Exception(message) {} }; class LoginException : public zmm::Exception { public: LoginException(zmm::String message) : zmm::Exception(message) {} }; /// \brief This class is responsible for processing requests that come to the user interface. class WebRequestHandler : public RequestHandler { protected: bool checkRequestCalled; /// \brief Decoded URL parameters are stored as a dictionary. zmm::Ref params; /// \brief The original filename from url if anyone needs it. zmm::String filename; /// \brief We can also always see what mode was requested. enum UpnpOpenFileMode mode; /// \brief This is filled during request processing and holds the output. /// /// The XML or HTML that is the result of a request is put in this buffer, /// this is what is being served to the web browser. zmm::Ref out; /// \brief This is the root xml element to be populated by process() method. zmm::Ref root; /// \brief The current session, used for this request; will be filled by /// check_request() zmm::Ref session; /// \brief Little support function to access stuff from the dictionary in /// in an easier fashion. /// \param name of the parameter we are looking for. /// \return Value of the parameter with the given name or nil if not found. inline zmm::String param(zmm::String name) { return params->get(name); } int intParam(zmm::String name, int invalid = 0); bool boolParam(zmm::String name); /// \brief Checks if the incoming request is valid. /// /// Each request going to the ui must at least have a valid session id, /// and a driver parameter. Also, there can only by a primary or a /// a decondary driver. void check_request(bool checkLogin = true); /// \brief Helper function to create a generic XML document header. /// \param xsl_link If not nil, also adds header information that is required for the XSL processor. /// \return The header as a string... because our parser does not yet understand stuff :) zmm::String renderXMLHeader(); /// \brief Prepares the output buffer and calls the process function. /// \return IOHandler /// \todo Genych, chto tut proishodit, ya tolkom che to ne wrubaus?? zmm::Ref open(IN enum UpnpOpenFileMode mode); /// \brief add the ui update ids from the given session as xml tags to the given root element /// \param root the xml element to add the elements to /// \param session the session from which the ui update ids should be taken void addUpdateIDs(zmm::Ref root, zmm::Ref session); /// \brief check if ui update ids should be added to the response and add /// them in that case. /// must only be called after check_request void handleUpdateIDs(); /// \brief add the content manager task to the given xml element as xml elements /// \param el the xml element to add the elements to /// \param task the task to add to the given xml element void appendTask(zmm::Ref el, zmm::Ref task); /// \brief check if accounts are enabled in the config /// \return true if accounts are enabled, false if not bool accountsEnabled() { return (ConfigManager::getInstance()->getBoolOption(CFG_SERVER_UI_ACCOUNTS_ENABLED)); } zmm::String mapAutoscanType(int type); int remapAutoscanType(zmm::String type); public: /// \brief Constructor, currently empty. WebRequestHandler(); /// \brief Returns information about the requested content. /// \param filename Requested URL /// \param info File_Info structure, quite similar to statbuf. /// /// We need to override this, because for serving UI pages (mostly generated from /// dynamic XML) we do not know the size of the data. This is of course different /// for the FileRequestHandler, where we can check the file and return all /// information about it. virtual void get_info(IN const char *filename, OUT struct File_Info *info); /// \brief Decodes the parameters from the filename (URL) and calls the internal open() function. /// \param filename The requested URL /// \param mode either UPNP_READ or UPNP_WRITE /// \return the appropriate IOHandler for the request. virtual zmm::Ref open(IN const char *filename, OUT struct File_Info *info, IN enum UpnpOpenFileMode mode); /// \brief This method must be overriden by the subclasses that actually process the given request. virtual void process() = 0; /// \brief builds full path to a script for the given relative filename static zmm::String buildScriptPath(zmm::String filename); }; #endif // __WEB_REQUEST_HANDLER_H__ mediatomb-0.12.1/src/config_manager.cc0000664000076400007640000034762011352675003014542 00000000000000/*MT* MediaTomb - http://www.mediatomb.cc/ config_manager.cc - this file is part of MediaTomb. Copyright (C) 2005 Gena Batyan , Sergey 'Jin' Bostandzhyan Copyright (C) 2006-2010 Gena Batyan , Sergey 'Jin' Bostandzhyan , Leonhard Wimmer MediaTomb is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. MediaTomb is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with MediaTomb; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. $Id: config_manager.cc 2081 2010-03-23 20:18:00Z lww $ */ /// \file config_manager.cc #ifdef HAVE_CONFIG_H #include "autoconfig.h" #endif #include #include "uuid/uuid.h" #include "common.h" #include "config_manager.h" #include "storage.h" #include #include #include "tools.h" #include "string_converter.h" #include "metadata_handler.h" #ifdef HAVE_INOTIFY #include "mt_inotify.h" #endif #ifdef YOUTUBE #include "youtube_service.h" #endif #ifdef WEBORAMA #include "weborama_service.h" #endif #if defined(HAVE_LANGINFO_H) && defined(HAVE_LOCALE_H) #include #include #endif #ifdef HAVE_CURL #include #endif using namespace zmm; using namespace mxml; SINGLETON_MUTEX(ConfigManager, false); String ConfigManager::filename = nil; String ConfigManager::userhome = nil; String ConfigManager::config_dir = _(DEFAULT_CONFIG_HOME); String ConfigManager::prefix_dir = _(PACKAGE_DATADIR); String ConfigManager::magic = nil; bool ConfigManager::debug_logging = false; ConfigManager::~ConfigManager() { filename = nil; userhome = nil; config_dir = _(DEFAULT_CONFIG_HOME); prefix_dir = _(PACKAGE_DATADIR); magic = nil; } void ConfigManager::setStaticArgs(String _filename, String _userhome, String _config_dir, String _prefix_dir, String _magic, bool _debug_logging) { filename = _filename; userhome = _userhome; config_dir = _config_dir; prefix_dir = _prefix_dir; magic = _magic; debug_logging = _debug_logging; } ConfigManager::ConfigManager() : Singleton() { options = Ref > (new Array(CFG_MAX)); String home = userhome + DIR_SEPARATOR + config_dir; bool home_ok = true; if (filename == nil) { // we are looking for ~/.mediatomb if (home_ok && (!check_path(userhome + DIR_SEPARATOR + config_dir + DIR_SEPARATOR + DEFAULT_CONFIG_NAME))) { home_ok = false; } else { filename = home + DIR_SEPARATOR + DEFAULT_CONFIG_NAME; } if ((!home_ok) && (string_ok(userhome))) { userhome = normalizePath(userhome); filename = createDefaultConfig(userhome); } } if (filename == nil) { throw _Exception(_("\nThe server configuration file could not be found in ~/.mediatomb\n") + "MediaTomb could not determine your home directory - automatic setup failed.\n" + "Try specifying an alternative configuration file on the command line.\n" + "For a list of options run: mediatomb -h\n"); } log_info("Loading configuration from: %s\n", filename.c_str()); load(filename); prepare_udn(); validate(home); #ifdef TOMBDEBUG // dumpOptions(); #endif // now the XML is no longer needed we can destroy it root = nil; } String ConfigManager::construct_path(String path) { String home = getOption(CFG_SERVER_HOME); if (path.charAt(0) == '/') return path; #if defined(__CYGWIN__) if ((path.length() > 1) && (path.charAt(1) == ':')) return path; #endif if (home == "." && path.charAt(0) == '.') return path; if (home == "") return _(".") + DIR_SEPARATOR + path; else return home + DIR_SEPARATOR + path; } Ref ConfigManager::map_from_to(String from, String to) { Ref map(new Element(_("map"))); map->setAttribute(_("from"), from); map->setAttribute(_("to"), to); return map; } Ref ConfigManager::treat_as(String mimetype, String as) { Ref treat(new Element(_("treat"))); treat->setAttribute(_("mimetype"), mimetype); treat->setAttribute(_("as"), as); return treat; } #ifdef EXTERNAL_TRANSCODING Ref ConfigManager::renderTranscodingSection() { Ref transcoding(new Element(_("transcoding"))); transcoding->setAttribute(_("enabled"), _(DEFAULT_TRANSCODING_ENABLED)); Ref mt_prof_map(new Element(_("mimetype-profile-mappings"))); Ref prof_flv(new Element(_("transcode"))); prof_flv->setAttribute(_("mimetype"), _("video/x-flv")); prof_flv->setAttribute(_("using"), _("vlcmpeg")); mt_prof_map->appendElementChild(prof_flv); Ref prof_theora(new Element(_("transcode"))); prof_theora->setAttribute(_("mimetype"), _("application/ogg")); prof_theora->setAttribute(_("using"), _("vlcmpeg")); mt_prof_map->appendElementChild(prof_theora); Ref prof_ogg(new Element(_("transcode"))); prof_ogg->setAttribute(_("mimetype"), _("application/ogg")); prof_ogg->setAttribute(_("using"), _("oggflac2raw")); mt_prof_map->appendElementChild(prof_ogg); Ref prof_flac(new Element(_("transcode"))); prof_flac->setAttribute(_("mimetype"), _("audio/x-flac")); prof_flac->setAttribute(_("using"), _("oggflac2raw")); mt_prof_map->appendElementChild(prof_flac); transcoding->appendElementChild(mt_prof_map); Ref profiles(new Element(_("profiles"))); Ref oggflac(new Element(_("profile"))); oggflac->setAttribute(_("name"), _("oggflac2raw")); oggflac->setAttribute(_("enabled"), _(NO)); oggflac->setAttribute(_("type"), _("external")); oggflac->appendTextChild(_("mimetype"), _("audio/L16")); oggflac->appendTextChild(_("accept-url"), _(NO)); oggflac->appendTextChild(_("first-resource"), _(YES)); oggflac->appendTextChild(_("accept-ogg-theora"), _(NO)); Ref oggflac_agent(new Element(_("agent"))); oggflac_agent->setAttribute(_("command"), _("ogg123")); oggflac_agent->setAttribute(_("arguments"), _("-d raw -o byteorder:big -f %out %in")); oggflac->appendElementChild(oggflac_agent); Ref oggflac_buffer(new Element(_("buffer"))); oggflac_buffer->setAttribute(_("size"), String::from(DEFAULT_AUDIO_BUFFER_SIZE)); oggflac_buffer->setAttribute(_("chunk-size"), String::from(DEFAULT_AUDIO_CHUNK_SIZE)); oggflac_buffer->setAttribute(_("fill-size"), String::from(DEFAULT_AUDIO_FILL_SIZE)); oggflac->appendElementChild(oggflac_buffer); profiles->appendElementChild(oggflac); Ref vlcmpeg(new Element(_("profile"))); vlcmpeg->setAttribute(_("name"), _("vlcmpeg")); vlcmpeg->setAttribute(_("enabled"), _(NO)); vlcmpeg->setAttribute(_("type"), _("external")); vlcmpeg->appendTextChild(_("mimetype"), _("video/mpeg")); vlcmpeg->appendTextChild(_("accept-url"), _(YES)); vlcmpeg->appendTextChild(_("first-resource"), _(YES)); vlcmpeg->appendTextChild(_("accept-ogg-theora"), _(YES)); Ref vlcmpeg_agent(new Element(_("agent"))); vlcmpeg_agent->setAttribute(_("command"), _("vlc")); vlcmpeg_agent->setAttribute(_("arguments"), _("-I dummy %in --sout #transcode{venc=ffmpeg,vcodec=mp2v,vb=4096,fps=25,aenc=ffmpeg,acodec=mpga,ab=192,samplerate=44100,channels=2}:standard{access=file,mux=ps,dst=%out} vlc:quit")); vlcmpeg->appendElementChild(vlcmpeg_agent); Ref vlcmpeg_buffer(new Element(_("buffer"))); vlcmpeg_buffer->setAttribute(_("size"), String::from(DEFAULT_VIDEO_BUFFER_SIZE)); vlcmpeg_buffer->setAttribute(_("chunk-size"), String::from(DEFAULT_VIDEO_CHUNK_SIZE)); vlcmpeg_buffer->setAttribute(_("fill-size"), String::from(DEFAULT_VIDEO_FILL_SIZE)); vlcmpeg->appendElementChild(vlcmpeg_buffer); profiles->appendElementChild(vlcmpeg); transcoding->appendElementChild(profiles); return transcoding; } #endif Ref ConfigManager::renderExtendedRuntimeSection() { Ref extended(new Element(_("extended-runtime-options"))); #if defined(HAVE_FFMPEG) && defined(HAVE_FFMPEGTHUMBNAILER) Ref ffth(new Element(_("ffmpegthumbnailer"))); ffth->setAttribute(_("enabled"), _(DEFAULT_FFMPEGTHUMBNAILER_ENABLED)); ffth->appendTextChild(_("thumbnail-size"), String::from(DEFAULT_FFMPEGTHUMBNAILER_THUMBSIZE)); ffth->appendTextChild(_("seek-percentage"), String::from(DEFAULT_FFMPEGTHUMBNAILER_SEEK_PERCENTAGE)); ffth->appendTextChild(_("filmstrip-overlay"), _(DEFAULT_FFMPEGTHUMBNAILER_FILMSTRIP_OVERLAY)); ffth->appendTextChild(_("workaround-bugs"), _(DEFAULT_FFMPEGTHUMBNAILER_WORKAROUND_BUGS)); ffth->appendTextChild(_("image-quality"), String::from(DEFAULT_FFMPEGTHUMBNAILER_IMAGE_QUALITY)); extended->appendElementChild(ffth); #endif Ref mark(new Element(_("mark-played-items"))); mark->setAttribute(_("enabled"), _(DEFAULT_MARK_PLAYED_ITEMS_ENABLED)); mark->setAttribute(_("suppress-cds-updates"), _(DEFAULT_MARK_PLAYED_ITEMS_SUPPRESS_CDS_UPDATES)); Ref mark_string(new Element(_("string"))); mark_string->setAttribute(_("mode"), _(DEFAULT_MARK_PLAYED_ITEMS_STRING_MODE)); mark_string->setText(_(DEFAULT_MARK_PLAYED_ITEMS_STRING)); mark->appendElementChild(mark_string); Ref mark_content_section(new Element(_("mark"))); Ref content_video(new Element(_("content"))); content_video->setText(_(DEFAULT_MARK_PLAYED_CONTENT_VIDEO)); mark_content_section->appendElementChild(content_video); mark->appendElementChild(mark_content_section); extended->appendElementChild(mark); #ifdef HAVE_LASTFMLIB Ref lastfm(new Element(_("lastfm"))); lastfm->setAttribute(_("enabled"), _(DEFAULT_LASTFM_ENABLED)); lastfm->appendTextChild(_("username"), _(DEFAULT_LASTFM_USERNAME)); lastfm->appendTextChild(_("password"), _(DEFAULT_LASTFM_PASSWORD)); extended->appendElementChild(lastfm); #endif return extended; } #ifdef ONLINE_SERVICES Ref ConfigManager::renderOnlineSection() { Ref onlinecontent(new Element(_("online-content"))); #ifdef YOUTUBE // Ref ytinfo(new Comment(_(" Make sure to setup a transcoding profile for flv "), true)); // onlinecontent->appendChild(RefCast(ytinfo, Node)); Ref yt(new Element(_("YouTube"))); yt->setAttribute(_("enabled"), _(DEFAULT_YOUTUBE_ENABLED)); // 8 hours refresh cycle yt->setAttribute(_("refresh"), String::from(DEFAULT_YOUTUBE_REFRESH)); yt->setAttribute(_("update-at-start"), _(DEFAULT_YOUTUBE_UPDATE_AT_START)); // items that were not updated for 4 days will be purged yt->setAttribute(_("purge-after"), String::from(DEFAULT_YOUTUBE_PURGE_AFTER)); yt->setAttribute(_("racy-content"), _(DEFAULT_YOUTUBE_RACY_CONTENT)); yt->setAttribute(_("format"), _(DEFAULT_YOUTUBE_FORMAT)); yt->setAttribute(_("hd"), _(DEFAULT_YOUTUBE_HD)); Ref favs(new Element(_("favorites"))); favs->setAttribute(_("user"), _("mediatomb")); yt->appendElementChild(favs); Ref most_viewed(new Element(_("standardfeed"))); most_viewed->setAttribute(_("feed"), _("most_viewed")); most_viewed->setAttribute(_("time-range"), _("today")); yt->appendElementChild(most_viewed); Ref playlist(new Element(_("playlists"))); playlist->setAttribute(_("user"), _("mediatomb")); yt->appendElementChild(playlist); Ref ytuser(new Element(_("uploads"))); ytuser->setAttribute(_("user"), _("mediatomb")); yt->appendElementChild(ytuser); Ref ytfeatured(new Element(_("standardfeed"))); ytfeatured->setAttribute(_("feed"), _("recently_featured")); ytfeatured->setAttribute(_("time-range"), _("today")); yt->appendElementChild(ytfeatured); onlinecontent->appendElementChild(yt); #endif #ifdef WEBORAMA Ref wb(new Element(_("Weborama"))); wb->setAttribute(_("enabled"), _(DEFAULT_WEBORAMA_ENABLED)); wb->setAttribute(_("refresh"), String::from(DEFAULT_WEBORAMA_REFRESH)); wb->setAttribute(_("update-at-start"), _(DEFAULT_WEBORAMA_UPDATE_AT_START)); Ref play1(new Element(_("playlist"))); play1->setAttribute(_("name"), _("Active")); play1->setAttribute(_("type"), _("playlist")); play1->setAttribute(_("mood"), _("active")); wb->appendElementChild(play1); Ref play2(new Element(_("playlist"))); play2->setAttribute(_("name"), _("Metal")); play2->setAttribute(_("type"), _("playlist")); Ref filter(new Element(_("filter"))); Ref genres(new Element(_("genres"))); genres->setText(_("metal")); filter->appendElementChild(genres); play2->appendElementChild(filter); wb->appendElementChild(play2); onlinecontent->appendElementChild(wb); #endif #ifdef ATRAILERS Ref at(new Element(_("AppleTrailers"))); at->setAttribute(_("enabled"), _(DEFAULT_ATRAILERS_ENABLED)); at->setAttribute(_("refresh"), String::from(DEFAULT_ATRAILERS_REFRESH)); at->setAttribute(_("update-at-start"), _(DEFAULT_ATRAILERS_UPDATE_AT_START)); at->setAttribute(_("resolution"), String::from(DEFAULT_ATRAILERS_RESOLUTION)); onlinecontent->appendElementChild(at); #endif return onlinecontent; } #endif String ConfigManager::createDefaultConfig(String userhome) { bool mysql_flag = false; String homepath = userhome + DIR_SEPARATOR + config_dir; if (!check_path(homepath, true)) { if (mkdir(homepath.c_str(), 0777) < 0) { throw _Exception(_("Could not create directory ") + homepath + " : " + strerror(errno)); } } String config_filename = homepath + DIR_SEPARATOR + DEFAULT_CONFIG_NAME; Ref config(new Element(_("config"))); config->setAttribute(_("version"), String::from(CONFIG_XML_VERSION)); config->setAttribute(_("xmlns"), _(XML_XMLNS) + CONFIG_XML_VERSION); config->setAttribute(_("xmlns:xsi"), _(XML_XMLNS_XSI)); config->setAttribute(_("xsi:schemaLocation"), _(XML_XMLNS) + CONFIG_XML_VERSION + " " + XML_XMLNS + CONFIG_XML_VERSION + ".xsd"); Ref server(new Element(_("server"))); Ref ui(new Element(_("ui"))); ui->setAttribute(_("enabled"), _(DEFAULT_UI_EN_VALUE)); ui->setAttribute(_("show-tooltips"), _(DEFAULT_UI_SHOW_TOOLTIPS_VALUE)); Refaccounts(new Element(_("accounts"))); accounts->setAttribute(_("enabled"), _(DEFAULT_ACCOUNTS_EN_VALUE)); accounts->setAttribute(_("session-timeout"), String::from(DEFAULT_SESSION_TIMEOUT)); Ref account(new Element(_("account"))); account->setAttribute(_("user"), _(DEFAULT_ACCOUNT_USER)); account->setAttribute(_("password"), _(DEFAULT_ACCOUNT_PASSWORD)); accounts->appendElementChild(account); ui->appendElementChild(accounts); server->appendElementChild(ui); server->appendTextChild(_("name"), _(PACKAGE_NAME)); Ref udn(new Element(_("udn"))); server->appendElementChild(udn); server->appendTextChild(_("home"), homepath); server->appendTextChild(_("webroot"), prefix_dir + DIR_SEPARATOR + _(DEFAULT_WEB_DIR)); Ref storage(new Element(_("storage"))); #ifdef HAVE_SQLITE3 Ref sqlite3(new Element(_("sqlite3"))); sqlite3->setAttribute(_("enabled"), _(DEFAULT_SQLITE_ENABLED)); sqlite3->appendTextChild(_("database-file"), _(DEFAULT_SQLITE3_DB_FILENAME)); #ifdef SQLITE_BACKUP_ENABLED // Ref backup(new Element(_("backup"))); backup->setAttribute(_("enabled"), _(YES)); backup->setAttribute(_("interval"), String::from(DEFAULT_SQLITE_BACKUP_INTERVAL)); sqlite3->appendElementChild(backup); #endif storage->appendElementChild(sqlite3); #endif #ifdef HAVE_MYSQL Refmysql(new Element(_("mysql"))); #ifndef HAVE_SQLITE3 mysql->setAttribute(_("enabled"), _(DEFAULT_MYSQL_ENABLED)); mysql_flag = true; #else mysql->setAttribute(_("enabled"), _("no")); #endif mysql->appendTextChild(_("host"), _(DEFAULT_MYSQL_HOST)); mysql->appendTextChild(_("username"), _(DEFAULT_MYSQL_USER)); // storage->appendTextChild(_("password"), _(DEFAULT_MYSQL_PASSWORD)); mysql->appendTextChild(_("database"), _(DEFAULT_MYSQL_DB)); storage->appendElementChild(mysql); #endif server->appendElementChild(storage); Ref protocolinfo(new Element(_("protocolInfo"))); protocolinfo->setAttribute(_("extend"), _(DEFAULT_EXTEND_PROTOCOLINFO)); server->appendElementChild(protocolinfo); Ref ps3protinfo(new Comment(_(" For PS3 support change to \"yes\" "))); server->appendChild(RefCast(ps3protinfo, Node)); Ref redinfo(new Comment(_("\n\ Uncomment the lines below to get rid of jerky avi playback on the\n\ DSM320 or to enable subtitles support on the DSM units\n\ "), true)); Ref redsonic(new Comment(_("\n\ \n\ \n\ \n\ \n\ redsonic.com\n\ 105\n\ "), true)); Ref tg100info(new Comment(_(" Uncomment the line below if you have a Telegent TG100 "), true)); Ref tg100(new Comment(_("\n\ 101\n\ "), true)); server->appendChild(RefCast(redinfo, Node)); server->appendChild(RefCast(redsonic, Node)); server->appendChild(RefCast(tg100info, Node)); server->appendChild(RefCast(tg100, Node)); server->appendElementChild(renderExtendedRuntimeSection()); config->appendElementChild(server); Ref import(new Element(_("import"))); import->setAttribute(_("hidden-files"), _(DEFAULT_HIDDEN_FILES_VALUE)); #ifdef HAVE_MAGIC if (string_ok(magic)) { Ref magicfile(new Element(_("magic-file"))); magicfile->setText(magic); import->appendElementChild(magicfile); } #endif Ref scripting(new Element(_("scripting"))); scripting->setAttribute(_("script-charset"), _(DEFAULT_JS_CHARSET)); import->appendElementChild(scripting); Ref layout(new Element(_("virtual-layout"))); layout->setAttribute(_("type"), _(DEFAULT_LAYOUT_TYPE)); #ifdef HAVE_JS layout->appendTextChild(_("import-script"), prefix_dir + DIR_SEPARATOR + _(DEFAULT_JS_DIR) + DIR_SEPARATOR + _(DEFAULT_IMPORT_SCRIPT)); #ifdef HAVE_LIBDVDNAV layout->appendTextChild(_("dvd-script"), prefix_dir + DIR_SEPARATOR + _(DEFAULT_JS_DIR) + DIR_SEPARATOR + _(DEFAULT_DVD_SCRIPT)); #endif scripting->appendTextChild(_("common-script"), prefix_dir + DIR_SEPARATOR + _(DEFAULT_JS_DIR) + DIR_SEPARATOR + _(DEFAULT_COMMON_SCRIPT)); scripting->appendTextChild(_("playlist-script"), prefix_dir + DIR_SEPARATOR + _(DEFAULT_JS_DIR) + DIR_SEPARATOR + _(DEFAULT_PLAYLISTS_SCRIPT)); #endif scripting->appendElementChild(layout); String map_file = prefix_dir + DIR_SEPARATOR + CONFIG_MAPPINGS_TEMPLATE; Ref mappings(new Element(_("mappings"))); Ref ext2mt(new Element(_("extension-mimetype"))); ext2mt->setAttribute(_("ignore-unknown"), _(DEFAULT_IGNORE_UNKNOWN_EXTENSIONS)); ext2mt->appendElementChild(map_from_to(_("mp3"), _("audio/mpeg"))); ext2mt->appendElementChild(map_from_to(_("ogx"), _("application/ogg"))); ext2mt->appendElementChild(map_from_to(_("ogv"), _("video/ogg"))); ext2mt->appendElementChild(map_from_to(_("oga"), _("audio/ogg"))); ext2mt->appendElementChild(map_from_to(_("ogg"), _("audio/ogg"))); ext2mt->appendElementChild(map_from_to(_("ogm"), _("video/ogg"))); ext2mt->appendElementChild(map_from_to(_("asf"), _("video/x-ms-asf"))); ext2mt->appendElementChild(map_from_to(_("asx"), _("video/x-ms-asf"))); ext2mt->appendElementChild(map_from_to(_("wma"), _("audio/x-ms-wma"))); ext2mt->appendElementChild(map_from_to(_("wax"), _("audio/x-ms-wax"))); ext2mt->appendElementChild(map_from_to(_("wmv"), _("video/x-ms-wmv"))); ext2mt->appendElementChild(map_from_to(_("wvx"), _("video/x-ms-wvx"))); ext2mt->appendElementChild(map_from_to(_("wm"), _("video/x-ms-wm"))); ext2mt->appendElementChild(map_from_to(_("wmx"), _("video/x-ms-wmx"))); ext2mt->appendElementChild(map_from_to(_("m3u"), _("audio/x-mpegurl"))); ext2mt->appendElementChild(map_from_to(_("pls"), _("audio/x-scpls"))); ext2mt->appendElementChild(map_from_to(_("flv"), _("video/x-flv"))); ext2mt->appendElementChild(map_from_to(_("mkv"), _("video/x-matroska"))); ext2mt->appendElementChild(map_from_to(_("mka"), _("audio/x-matroska"))); Ref ps3info(new Comment(_(" Uncomment the line below for PS3 divx support "), true)); Ref ps3avi(new Comment(_(" "), true)); ext2mt->appendChild(RefCast(ps3info, Node)); ext2mt->appendChild(RefCast(ps3avi, Node)); Ref dsmzinfo(new Comment(_(" Uncomment the line below for D-Link DSM / ZyXEL DMA-1000 "), true)); Ref dsmzavi(new Comment(_(" "), true)); ext2mt->appendChild(RefCast(dsmzinfo, Node)); ext2mt->appendChild(RefCast(dsmzavi, Node)); mappings->appendElementChild(ext2mt); Ref mtupnp(new Element(_("mimetype-upnpclass"))); mtupnp->appendElementChild(map_from_to(_("audio/*"), _(UPNP_DEFAULT_CLASS_MUSIC_TRACK))); mtupnp->appendElementChild(map_from_to(_("video/*"), _(UPNP_DEFAULT_CLASS_VIDEO_ITEM))); mtupnp->appendElementChild(map_from_to(_("image/*"), _("object.item.imageItem"))); mappings->appendElementChild(mtupnp); Ref mtcontent(new Element(_("mimetype-contenttype"))); mtcontent->appendElementChild(treat_as(_("audio/mpeg"), _(CONTENT_TYPE_MP3))); mtcontent->appendElementChild(treat_as(_("application/ogg"), _(CONTENT_TYPE_OGG))); mtcontent->appendElementChild(treat_as(_("audio/x-flac"), _(CONTENT_TYPE_FLAC))); mtcontent->appendElementChild(treat_as(_("image/jpeg"), _(CONTENT_TYPE_JPG))); mtcontent->appendElementChild(treat_as(_("audio/x-mpegurl"), _(CONTENT_TYPE_PLAYLIST))); mtcontent->appendElementChild(treat_as(_("audio/x-scpls"), _(CONTENT_TYPE_PLAYLIST))); mtcontent->appendElementChild(treat_as(_("audio/x-wav"), _(CONTENT_TYPE_PCM))); mtcontent->appendElementChild(treat_as(_("audio/L16"), _(CONTENT_TYPE_PCM))); mtcontent->appendElementChild(treat_as(_("video/x-msvideo"), _(CONTENT_TYPE_AVI))); mtcontent->appendElementChild(treat_as(_("video/mp4"), _(CONTENT_TYPE_MP4))); mtcontent->appendElementChild(treat_as(_("audio/mp4"), _(CONTENT_TYPE_MP4))); mtcontent->appendElementChild(treat_as(_("application/x-iso9660"), _(CONTENT_TYPE_DVD))); mtcontent->appendElementChild(treat_as(_("application/x-iso9660-image"), _(CONTENT_TYPE_DVD))); mappings->appendElementChild(mtcontent); import->appendElementChild(mappings); #ifdef ONLINE_SERVICES import->appendElementChild(renderOnlineSection()); #endif config->appendElementChild(import); #ifdef EXTERNAL_TRANSCODING config->appendElementChild(renderTranscodingSection()); #endif config->indent(); save_text(config_filename, config->print()); log_info("MediaTomb configuration was created in: %s\n", config_filename.c_str()); if (mysql_flag) { throw _Exception(_("You are using MySQL! Please edit ") + config_filename + " and enter your MySQL host/username/password!"); } return config_filename; } void ConfigManager::migrate() { bool migrated_flag = false; String version = root->getAttribute(_("version")); // pre 0.10.* to 0.11.0 -> storage layout has changed if (!string_ok(version)) { log_info("Migrating server configuration to config version 1\n"); root->setAttribute(_("version"), String::from(CONFIG_XML_VERSION_0_11_0)); root->setAttribute(_("xmlns"), _(XML_XMLNS) + CONFIG_XML_VERSION_0_11_0); root->setAttribute(_("xmlns:xsi"), _(XML_XMLNS_XSI)); root->setAttribute(_("xsi:schemaLocation"), _(XML_XMLNS) + CONFIG_XML_VERSION_0_11_0 + " " + XML_XMLNS + CONFIG_XML_VERSION + ".xsd"); Ref server = root->getChildByName(_("server")); if (server == nil) throw _Exception(_("Migration failed! Could not find tag!")); checkOptionString(_("/server/storage/attribute::driver")); String dbDriver = getOption(_("/server/storage/attribute::driver")); Ref storage(new Element(_("storage"))); #ifdef HAVE_SQLITE3 if (dbDriver == "sqlite3") { String dbFile = getOption(_("/server/storage/database-file")); Ref sqlite3(new Element(_("sqlite3"))); sqlite3->setAttribute(_("enabled"), _(YES)); sqlite3->appendTextChild(_("database-file"), dbFile); storage->appendElementChild(sqlite3); } #endif // HAVE_SQLITE3 #ifdef HAVE_MYSQL if (dbDriver == "mysql") { String host = getOption(_("/server/storage/host")); String db = getOption(_("/server/storage/database")); String username = getOption(_("/server/storage/username")); int port = -1; if (server->getChildByName(_("storage"))->getChildByName(_("port")) != nil) port = getIntOption(_("/server/storage/port")); String socket = nil;; if (server->getChildByName(_("storage"))->getChildByName(_("socket")) != nil) socket = getOption(_("/server/storage/socket")); String password = nil; if (server->getChildByName(_("storage"))->getChildByName(_("password")) != nil) password = getOption(_("/server/storage/password")); Refmysql(new Element(_("mysql"))); mysql->setAttribute(_("enabled"), _(YES)); mysql->appendTextChild(_("host"), host); if (port != -1) mysql->appendTextChild(_("port"), String::from(port)); if (socket != nil) storage->appendTextChild(_("socket"), socket); mysql->appendTextChild(_("username"), username); if (password != nil) storage->appendTextChild(_("password"), password); mysql->appendTextChild(_("database"), db); storage->appendElementChild(mysql); } #endif server->removeElementChild(_("storage"), true); server->appendElementChild(storage); #ifdef EXTERNAL_TRANSCODING if (root->getChildByName(_("transcoding")) == nil) root->appendElementChild(renderTranscodingSection()); #endif Ref import = root->getChildByName(_("import")); if (import != nil) { #ifdef ONLINE_SERVICES if (import->getChildByName(_("online-content")) == nil) import->appendElementChild(renderOnlineSection()); #endif Ref map = import->getChildByName(_("mappings")); if (map != nil) { Ref mtct = map->getChildByName(_("mimetype-contenttype")); if ((mtct != nil) && (mtct->elementChildCount() > 0)) { bool add_avi = true; for (int mc = 0; mc < mtct->elementChildCount(); mc++) { Ref treat = mtct->getElementChild(mc); if (treat->getAttribute(_("as")) == "avi") add_avi = false; } if (add_avi) mtct->appendElementChild(treat_as(_("video/x-msvideo"), _("avi"))); } } } version = String::from(CONFIG_XML_VERSION_0_11_0); migrated_flag = true; } // from 0.11 to 0.12 if (string_ok(version) && version.toInt() == 1) { log_info("Migrating server configuration to config version 2\n"); root->setAttribute(_("version"), String::from(CONFIG_XML_VERSION)); root->setAttribute(_("xmlns"), _(XML_XMLNS) + CONFIG_XML_VERSION); root->setAttribute(_("xsi:schemaLocation"), _(XML_XMLNS) + CONFIG_XML_VERSION + " " + XML_XMLNS + CONFIG_XML_VERSION + ".xsd"); Ref server = root->getChildByName(_("server")); if (server == nil) throw _Exception(_("Migration failed! Could not find tag!")); String temp; try { temp = getOption(_("/server/ui/attribute::show-tooltips")); } catch (Exception e) { Ref ui = server->getChildByName(_("ui")); if (ui != nil) ui->setAttribute(_("show-tooltips"), _(DEFAULT_UI_SHOW_TOOLTIPS_VALUE)); } try { temp = getOption(_("/server/storage/attribute::caching")); } catch (Exception e) { Ref storage = server->getChildByName(_("storage")); if (storage != nil) storage->setAttribute(_("caching"), _(DEFAULT_STORAGE_CACHING_ENABLED)); } if (server->getChildByName(_("extended-runtime-options")) == nil) server->appendElementChild(renderExtendedRuntimeSection()); Ref import = root->getChildByName(_("import")); if (import != nil) { // add ext 2 mimetype stuff Ref mappings = import->getChildByName(_("mappings")); #ifdef ONLINE_SERVICES Ref online = import->getChildByName(_("online-content")); if (online == nil) import->appendElementChild(renderOnlineSection()); #endif } migrated_flag = true; } if (migrated_flag) { root->indent(); save(); log_info("Migration of configuration successfull\n"); } } #define NEW_OPTION(optval) opt = Ref