diff --git a/common b/common index d81417a103..47d51c3f04 160000 --- a/common +++ b/common @@ -1 +1 @@ -Subproject commit d81417a103945ab1c393e74557983b1163e9e353 +Subproject commit 47d51c3f04e416caa4c43c72a5458df99cf09c3a diff --git a/gst/cothreads/AUTHORS b/gst/cothreads/AUTHORS deleted file mode 100644 index 9182f1c328..0000000000 --- a/gst/cothreads/AUTHORS +++ /dev/null @@ -1,25 +0,0 @@ - ____ _ _ - | _ \| |_| |__ - | |_) | __| '_ \ ``Some people have entirely too - | __/| |_| | | | much free time on their hands.'' - |_| \__|_| |_| -- Gene Spafford - - GNU Pth - The GNU Portable Threads - - AUTHORS - ======= - - This is a list of authors who have written - or edited major parts of the GNU Pth sources. - - o GNU Pth (as a whole): - Written by: Ralf S. Engelschall - Edited by: Ralf S. Engelschall - - o pthread.pod: - Written by: Ralf S. Engelschall - Parts from: The Open Group - Edited by: Ralf S. Engelschall - -Modified for inclusion in GStreamer by Andy Wingo -All bugs to gstreamer-devel@lists.sourceforge.net diff --git a/gst/cothreads/COPYING b/gst/cothreads/COPYING deleted file mode 100644 index eb685a5ec9..0000000000 --- a/gst/cothreads/COPYING +++ /dev/null @@ -1,481 +0,0 @@ - GNU LIBRARY GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1991 Free Software Foundation, Inc. - 675 Mass Ave, Cambridge, MA 02139, USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - -[This is the first released version of the library GPL. It is - numbered 2 because it goes with version 2 of the ordinary GPL.] - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -Licenses are intended to guarantee your freedom to share and change -free software--to make sure the software is free for all its users. - - This license, the Library General Public License, applies to some -specially designated Free Software Foundation software, and to any -other libraries whose authors decide to use it. You can use it for -your libraries, 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 library, or if you modify it. - - For example, if you distribute copies of the library, whether gratis -or for a fee, you must give the recipients all the rights that we gave -you. You must make sure that they, too, receive or can get the source -code. If you link a program with the library, you must provide -complete object files to the recipients so that they can relink them -with the library, after making changes to the library and recompiling -it. And you must show them these terms so they know their rights. - - Our method of protecting your rights has two steps: (1) copyright -the library, and (2) offer you this license which gives you legal -permission to copy, distribute and/or modify the library. - - Also, for each distributor's protection, we want to make certain -that everyone understands that there is no warranty for this free -library. If the library is modified by someone else and passed on, we -want its recipients to know that what they have is not the original -version, 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 companies distributing free -software will individually obtain patent licenses, thus in effect -transforming the program into proprietary software. To prevent this, -we have made it clear that any patent must be licensed for everyone's -free use or not licensed at all. - - Most GNU software, including some libraries, is covered by the ordinary -GNU General Public License, which was designed for utility programs. This -license, the GNU Library General Public License, applies to certain -designated libraries. This license is quite different from the ordinary -one; be sure to read it in full, and don't assume that anything in it is -the same as in the ordinary license. - - The reason we have a separate public license for some libraries is that -they blur the distinction we usually make between modifying or adding to a -program and simply using it. Linking a program with a library, without -changing the library, is in some sense simply using the library, and is -analogous to running a utility program or application program. However, in -a textual and legal sense, the linked executable is a combined work, a -derivative of the original library, and the ordinary General Public License -treats it as such. - - Because of this blurred distinction, using the ordinary General -Public License for libraries did not effectively promote software -sharing, because most developers did not use the libraries. We -concluded that weaker conditions might promote sharing better. - - However, unrestricted linking of non-free programs would deprive the -users of those programs of all benefit from the free status of the -libraries themselves. This Library General Public License is intended to -permit developers of non-free programs to use free libraries, while -preserving your freedom as a user of such programs to change the free -libraries that are incorporated in them. (We have not seen how to achieve -this as regards changes in header files, but we have achieved it as regards -changes in the actual functions of the Library.) The hope is that this -will lead to faster development of free libraries. - - The precise terms and conditions for copying, distribution and -modification follow. Pay close attention to the difference between a -"work based on the library" and a "work that uses the library". The -former contains code derived from the library, while the latter only -works together with the library. - - Note that it is possible for a library to be covered by the ordinary -General Public License rather than by this special one. - - GNU LIBRARY GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License Agreement applies to any software library which -contains a notice placed by the copyright holder or other authorized -party saying it may be distributed under the terms of this Library -General Public License (also called "this License"). Each licensee is -addressed as "you". - - A "library" means a collection of software functions and/or data -prepared so as to be conveniently linked with application programs -(which use some of those functions and data) to form executables. - - The "Library", below, refers to any such software library or work -which has been distributed under these terms. A "work based on the -Library" means either the Library or any derivative work under -copyright law: that is to say, a work containing the Library or a -portion of it, either verbatim or with modifications and/or translated -straightforwardly into another language. (Hereinafter, translation is -included without limitation in the term "modification".) - - "Source code" for a work means the preferred form of the work for -making modifications to it. For a library, complete source code means -all the source code for all modules it contains, plus any associated -interface definition files, plus the scripts used to control compilation -and installation of the library. - - Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running a program using the Library is not restricted, and output from -such a program is covered only if its contents constitute a work based -on the Library (independent of the use of the Library in a tool for -writing it). Whether that is true depends on what the Library does -and what the program that uses the Library does. - - 1. You may copy and distribute verbatim copies of the Library's -complete source code as you receive it, in any medium, provided that -you conspicuously and appropriately publish on each copy an -appropriate copyright notice and disclaimer of warranty; keep intact -all the notices that refer to this License and to the absence of any -warranty; and distribute a copy of this License along with the -Library. - - You may charge a fee for the physical act of transferring a copy, -and you may at your option offer warranty protection in exchange for a -fee. - - 2. You may modify your copy or copies of the Library or any portion -of it, thus forming a work based on the Library, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) The modified work must itself be a software library. - - b) You must cause the files modified to carry prominent notices - stating that you changed the files and the date of any change. - - c) You must cause the whole of the work to be licensed at no - charge to all third parties under the terms of this License. - - d) If a facility in the modified Library refers to a function or a - table of data to be supplied by an application program that uses - the facility, other than as an argument passed when the facility - is invoked, then you must make a good faith effort to ensure that, - in the event an application does not supply such function or - table, the facility still operates, and performs whatever part of - its purpose remains meaningful. - - (For example, a function in a library to compute square roots has - a purpose that is entirely well-defined independent of the - application. Therefore, Subsection 2d requires that any - application-supplied function or table used by this function must - be optional: if the application does not supply it, the square - root function must still compute square roots.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Library, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Library, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote -it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Library. - -In addition, mere aggregation of another work not based on the Library -with the Library (or with a work based on the Library) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may opt to apply the terms of the ordinary GNU General Public -License instead of this License to a given copy of the Library. To do -this, you must alter all the notices that refer to this License, so -that they refer to the ordinary GNU General Public License, version 2, -instead of to this License. (If a newer version than version 2 of the -ordinary GNU General Public License has appeared, then you can specify -that version instead if you wish.) Do not make any other change in -these notices. - - Once this change is made in a given copy, it is irreversible for -that copy, so the ordinary GNU General Public License applies to all -subsequent copies and derivative works made from that copy. - - This option is useful when you wish to copy part of the code of -the Library into a program that is not a library. - - 4. You may copy and distribute the Library (or a portion or -derivative of it, under Section 2) in object code or executable form -under the terms of Sections 1 and 2 above provided that you accompany -it with the complete corresponding machine-readable source code, which -must be distributed under the terms of Sections 1 and 2 above on a -medium customarily used for software interchange. - - If distribution of object code is made by offering access to copy -from a designated place, then offering equivalent access to copy the -source code from the same place satisfies the requirement to -distribute the source code, even though third parties are not -compelled to copy the source along with the object code. - - 5. A program that contains no derivative of any portion of the -Library, but is designed to work with the Library by being compiled or -linked with it, is called a "work that uses the Library". Such a -work, in isolation, is not a derivative work of the Library, and -therefore falls outside the scope of this License. - - However, linking a "work that uses the Library" with the Library -creates an executable that is a derivative of the Library (because it -contains portions of the Library), rather than a "work that uses the -library". The executable is therefore covered by this License. -Section 6 states terms for distribution of such executables. - - When a "work that uses the Library" uses material from a header file -that is part of the Library, the object code for the work may be a -derivative work of the Library even though the source code is not. -Whether this is true is especially significant if the work can be -linked without the Library, or if the work is itself a library. The -threshold for this to be true is not precisely defined by law. - - If such an object file uses only numerical parameters, data -structure layouts and accessors, and small macros and small inline -functions (ten lines or less in length), then the use of the object -file is unrestricted, regardless of whether it is legally a derivative -work. (Executables containing this object code plus portions of the -Library will still fall under Section 6.) - - Otherwise, if the work is a derivative of the Library, you may -distribute the object code for the work under the terms of Section 6. -Any executables containing that work also fall under Section 6, -whether or not they are linked directly with the Library itself. - - 6. As an exception to the Sections above, you may also compile or -link a "work that uses the Library" with the Library to produce a -work containing portions of the Library, and distribute that work -under terms of your choice, provided that the terms permit -modification of the work for the customer's own use and reverse -engineering for debugging such modifications. - - You must give prominent notice with each copy of the work that the -Library is used in it and that the Library and its use are covered by -this License. You must supply a copy of this License. If the work -during execution displays copyright notices, you must include the -copyright notice for the Library among them, as well as a reference -directing the user to the copy of this License. Also, you must do one -of these things: - - a) Accompany the work with the complete corresponding - machine-readable source code for the Library including whatever - changes were used in the work (which must be distributed under - Sections 1 and 2 above); and, if the work is an executable linked - with the Library, with the complete machine-readable "work that - uses the Library", as object code and/or source code, so that the - user can modify the Library and then relink to produce a modified - executable containing the modified Library. (It is understood - that the user who changes the contents of definitions files in the - Library will not necessarily be able to recompile the application - to use the modified definitions.) - - b) Accompany the work with a written offer, valid for at - least three years, to give the same user the materials - specified in Subsection 6a, above, for a charge no more - than the cost of performing this distribution. - - c) If distribution of the work is made by offering access to copy - from a designated place, offer equivalent access to copy the above - specified materials from the same place. - - d) Verify that the user has already received a copy of these - materials or that you have already sent this user a copy. - - For an executable, the required form of the "work that uses the -Library" must include any data and utility programs needed for -reproducing the executable from it. However, as a special exception, -the 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. - - It may happen that this requirement contradicts the license -restrictions of other proprietary libraries that do not normally -accompany the operating system. Such a contradiction means you cannot -use both them and the Library together in an executable that you -distribute. - - 7. You may place library facilities that are a work based on the -Library side-by-side in a single library together with other library -facilities not covered by this License, and distribute such a combined -library, provided that the separate distribution of the work based on -the Library and of the other library facilities is otherwise -permitted, and provided that you do these two things: - - a) Accompany the combined library with a copy of the same work - based on the Library, uncombined with any other library - facilities. This must be distributed under the terms of the - Sections above. - - b) Give prominent notice with the combined library of the fact - that part of it is a work based on the Library, and explaining - where to find the accompanying uncombined form of the same work. - - 8. You may not copy, modify, sublicense, link with, or distribute -the Library except as expressly provided under this License. Any -attempt otherwise to copy, modify, sublicense, link with, or -distribute the Library is void, and will automatically terminate your -rights under this License. However, parties who have received copies, -or rights, from you under this License will not have their licenses -terminated so long as such parties remain in full compliance. - - 9. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Library or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Library (or any work based on the -Library), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Library or works based on it. - - 10. Each time you redistribute the Library (or any work based on the -Library), the recipient automatically receives a license from the -original licensor to copy, distribute, link with or modify the Library -subject to these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 11. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Library at all. For example, if a patent -license would not permit royalty-free redistribution of the Library by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Library. - -If any portion of this section is held invalid or unenforceable under any -particular circumstance, the balance of the section is intended to apply, -and the section as a whole is intended to apply in other circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 12. If the distribution and/or use of the Library is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Library under this License may add -an explicit geographical distribution limitation excluding those countries, -so that distribution is permitted only in or among countries not thus -excluded. In such case, this License incorporates the limitation as if -written in the body of this License. - - 13. The Free Software Foundation may publish revised and/or new -versions of the Library General Public License from time to time. -Such new versions will be similar in spirit to the present version, -but may differ in detail to address new problems or concerns. - -Each version is given a distinguishing version number. If the Library -specifies a version number of this License which applies to it and -"any later version", you have the option of following the terms and -conditions either of that version or of any later version published by -the Free Software Foundation. If the Library does not specify a -license version number, you may choose any version ever published by -the Free Software Foundation. - - 14. If you wish to incorporate parts of the Library into other free -programs whose distribution conditions are incompatible with these, -write to the author to ask for permission. For software which is -copyrighted by the Free Software Foundation, write to the Free -Software Foundation; we sometimes make exceptions for this. Our -decision will be guided by the two goals of preserving the free status -of all derivatives of our free software and of promoting the sharing -and reuse of software generally. - - NO WARRANTY - - 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO -WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. -EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR -OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY -KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE -LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME -THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN -WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY -AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU -FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR -CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE -LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING -RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A -FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF -SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGES. - - END OF TERMS AND CONDITIONS - - Appendix: How to Apply These Terms to Your New Libraries - - If you develop a new library, and you want it to be of the greatest -possible use to the public, we recommend making it free software that -everyone can redistribute and change. You can do so by permitting -redistribution under these terms (or, alternatively, under the terms of the -ordinary General Public License). - - To apply these terms, attach the following notices to the library. It is -safest to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least the -"copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with this library; if not, write to the Free - Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - -Also add information on how to contact you by electronic and paper mail. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the library, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the - library `Frob' (a library for tweaking knobs) written by James Random Hacker. - - , 1 April 1990 - Ty Coon, President of Vice - -That's all there is to it! diff --git a/gst/cothreads/ChangeLog b/gst/cothreads/ChangeLog deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/gst/cothreads/INSTALL b/gst/cothreads/INSTALL deleted file mode 100644 index afa01a6981..0000000000 --- a/gst/cothreads/INSTALL +++ /dev/null @@ -1,2 +0,0 @@ -This package has been modified for use with GStreamer. Go to the root gstreamer -directory to install. diff --git a/gst/cothreads/Makefile.am b/gst/cothreads/Makefile.am deleted file mode 100644 index 00273987d0..0000000000 --- a/gst/cothreads/Makefile.am +++ /dev/null @@ -1,36 +0,0 @@ -## Makefile.am: NGPT Makefile.in hacked into an automake file by wingo -## -## - # ``UNIX -- where you can do anything - # in two keystrokes, or less...'' - -noinst_LTLIBRARIES = libpth-mctx.la libgstcothreads.la - -libpth_mctx_la_SOURCES = pth_mctx.c pth_p.h pth_vers.c pth.h pth_acdef.h pth_acmac.h - -libgstcothreads_la_SOURCES = cothreads.c cothread-stack.c cothreads.h -libgstcothreads_la_LIBADD = libpth-mctx.la $(GLIB_LIBS) -libgstcothreads_la_CFLAGS = $(GLIB_CFLAGS) - -noinst_PROGRAMS = test-pth test-pth-pthreads test-pthreads test-pth-pthreads2 test-cothreads -noinst_HEADERS = linuxthreads.h cothreads-private.h cothreads.h - -test_pth_LDADD = libpth-mctx.la -test_pth_pthreads_LDADD = libpth-mctx.la -lpthread -test_pthreads_LDADD = -lpthread -test_pth_pthreads2_LDADD = -lpthread libpth-mctx.la -test_cothreads_CFLAGS = $(GLIB_CFLAGS) -test_cothreads_LDADD = libgstcothreads.la - -BUILT_SOURCES = pth_p.h - -EXTRA_DIST = ltmain.sh mkinstalldirs config.guess config.sub install-sh missing - -HSRCS = $(srcdir)/pth_debug.c $(srcdir)/pth_errno.c $(srcdir)/pth_mctx.c - -pth_p.h: $(srcdir)/pth_p.h.in $(HSRCS) - $(srcdir)/shtool scpp -o pth_p.h -t $(srcdir)/pth_p.h.in -Dcpp -Cintern -M '==#==' $(HSRCS) - -#pth_mctx_a_DEPENDENCIES = shtool -#shtool: -# shtoolize -o shtool scpp diff --git a/gst/cothreads/NEWS b/gst/cothreads/NEWS deleted file mode 100644 index 22a52dc2fe..0000000000 --- a/gst/cothreads/NEWS +++ /dev/null @@ -1 +0,0 @@ -no gnus here diff --git a/gst/cothreads/README b/gst/cothreads/README deleted file mode 100644 index fe82e0e364..0000000000 --- a/gst/cothreads/README +++ /dev/null @@ -1,5 +0,0 @@ -I ripped the core out of GNU pth to provide cothreading for GStreamer. That's -what this package is. It was written by Ralf Engelschall. Plaudits to him, bug -reports to gstreamer-devel@lists.sourceforge.net. - -wingo , 20 Jan 2002 diff --git a/gst/cothreads/acconfig.h b/gst/cothreads/acconfig.h deleted file mode 100644 index 61cad0760a..0000000000 --- a/gst/cothreads/acconfig.h +++ /dev/null @@ -1,61 +0,0 @@ -/* -** GNU Pth - The GNU Portable Threads -** Copyright (c) 1999-2001 Ralf S. Engelschall -** -** This file is part of GNU Pth, a non-preemptive thread scheduling -** library which can be found at http://www.gnu.org/software/pth/. -** -** This library is free software; you can redistribute it and/or -** modify it under the terms of the GNU Lesser General Public -** License as published by the Free Software Foundation; either -** version 2.1 of the License, or (at your option) any later version. -** -** This library is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -** Lesser General Public License for more details. -** -** You should have received a copy of the GNU Lesser General Public -** License along with this library; if not, write to the Free Software -** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 -** USA, or contact Ralf S. Engelschall . -** -** pth_acdef.h Autoconf defines -*/ - -#ifndef _PTH_ACDEF_H_ -#define _PTH_ACDEF_H_ - -@TOP@ - -/* the custom Autoconf defines */ -#undef HAVE_SIG_ATOMIC_T -#undef HAVE_PID_T -#undef HAVE_STACK_T -#undef HAVE_SIZE_T -#undef HAVE_SSIZE_T -#undef HAVE_SOCKLEN_T -#undef HAVE_NFDS_T -#undef HAVE_OFF_T -#undef HAVE_GETTIMEOFDAY_ARGS1 -#undef HAVE_STRUCT_TIMESPEC -#undef HAVE_SYS_READ -#undef HAVE_POLLIN -#undef HAVE_SS_SP -#undef HAVE_SS_BASE -#undef HAVE_LONGLONG -#undef HAVE_LONGDOUBLE -#undef PTH_DEBUG -#undef PTH_NSIG -#undef PTH_MCTX_MTH_use -#undef PTH_MCTX_DSP_use -#undef PTH_MCTX_STK_use -#undef PTH_STACKGROWTH -#undef PTH_DMALLOC -#undef PTH_NEED_SEPARATE_REGISTER_STACK - -#undef HAVE_LINUXTHREADS - -@BOTTOM@ - -#endif /* _PTH_ACDEF_H_ */ diff --git a/gst/cothreads/autogen.sh b/gst/cothreads/autogen.sh deleted file mode 100755 index 0c541bf195..0000000000 --- a/gst/cothreads/autogen.sh +++ /dev/null @@ -1,204 +0,0 @@ -#!/bin/bash -# Run this to generate all the initial makefiles, etc. - -DIE=0 -package=gstpth -srcfile=pth_mctx.c -#DEBUG=defined - -for i in $@; do - if test "$i" = "--autogen-noconfigure"; then - NOCONFIGURE=defined - echo "+ configure run disabled" - elif test "$i" = "--autogen-nocheck"; then - NOCHECK=defined - echo "+ autotools version check disabled" - elif test "$i" = "--autogen-debug"; then - DEBUG=defined - echo "+ debug output enabled" - elif test "$i" = "--help"; then - echo "autogen.sh help options: " - echo " --autogen-noconfigure don't run the configure script" - echo " --autogen-nocheck don't do version checks" - echo " --autogen-debug debug the autogen process" - echo "continuing with the autogen in order to get configure help messages..." - fi -done - -debug () -# print out a debug message if DEBUG is a defined variable -{ - if test ! -z "$DEBUG" - then - echo "DEBUG: $1" - fi -} - -version_check () -# check the version of a package -# first argument : package name (executable) -# second argument : source download url -# rest of arguments : major, minor, micro version -{ - PACKAGE=$1 - URL=$2 - MAJOR=$3 - MINOR=$4 - MICRO=$5 - - WRONG= - - debug "major $MAJOR minor $MINOR micro $MICRO" - VERSION=$MAJOR - if test ! -z "$MINOR"; then VERSION=$VERSION.$MINOR; else MINOR=0; fi - if test ! -z "$MICRO"; then VERSION=$VERSION.$MICRO; else MICRO=0; fi - - debug "major $MAJOR minor $MINOR micro $MICRO" - - test -z "$NOCHECK" && { - echo -n "+ checking for $1 >= $VERSION ... " - } || { - echo "+ NOT checking for $1 >= $VERSION, as requested ..." - return 0 - } - - ($PACKAGE --version) < /dev/null > /dev/null 2>&1 || - { - echo - echo "You must have $PACKAGE installed to compile $package." - echo "Download the appropriate package for your distribution," - echo "or get the source tarball at $URL" - return 1 - } - # the following line is carefully crafted sed magic - pkg_version=`$PACKAGE --version|head -n 1|sed 's/^[a-zA-z\.\ ()]*//;s/ .*$//'` - debug "pkg_version $pkg_version" - pkg_major=`echo $pkg_version | cut -d. -f1` - pkg_minor=`echo $pkg_version | cut -d. -f2` - pkg_micro=`echo $pkg_version | cut -d. -f3` - test -z "$pkg_minor" && pkg_minor=0 - test -z "$pkg_micro" && pkg_micro=0 - - debug "found major $pkg_major minor $pkg_minor micro $pkg_micro" - - #start checking the version - debug "version check" - - if [ ! "$pkg_major" \> "$MAJOR" ]; then - debug "$pkg_major <= $MAJOR" - if [ "$pkg_major" \< "$MAJOR" ]; then - WRONG=1 - elif [ ! "$pkg_minor" \> "$MINOR" ]; then - if [ "$pkg_minor" \< "$MINOR" ]; then - WRONG=1 - elif [ "$pkg_micro" \< "$MICRO" ]; then - WRONG=1 - fi - fi - fi - - if test ! -z "$WRONG"; then - echo "found $pkg_version, not ok !" - echo - echo "You must have $PACKAGE $VERSION or greater to compile $package." - echo "Get the latest version from $URL" - return 1 - else - echo "found $pkg_version, ok." - fi -} - -# autoconf 2.52d has a weird issue involving a yes:no error -# so don't allow it's use -ac_version=`autoconf --version|head -n 1|sed 's/^[a-zA-z\.\ ()]*//;s/ .*$//'` -if test "$ac_version" = "2.52d"; then - echo "autoconf 2.52d has an issue with our current build." - echo "We don't know who's to blame however. So until we do, get a" - echo "regular version. RPM's of a working version are on the gstreamer site." - exit 1 -fi - - -version_check "autoconf" "ftp://ftp.gnu.org/pub/gnu/autoconf/" 2 52 || DIE=1 -version_check "automake" "ftp://ftp.gnu.org/pub/gnu/automake/" 1 5 || DIE=1 -version_check "libtool" "ftp://ftp.gnu.org/pub/gnu/libtool/" 1 4 0 || DIE=1 - -if test "$DIE" -eq 1; then - exit 1 -fi - -test -f $srcfile || { - echo "You must run this script in the top-level $package directory" - exit 1 -} - -if test -z "$*"; then - echo "I am going to run ./configure with no arguments - if you wish " - echo "to pass any to it, please specify them on the $0 command line." -fi - -echo "+ creating acinclude.m4" -cat m4/*.m4 > acinclude.m4 - -echo "+ running aclocal ..." -aclocal $ACLOCAL_FLAGS || { - echo - echo "aclocal failed - check that all needed development files are present on system" - exit 1 -} - -# FIXME : why does libtoolize keep complaining about aclocal ? -#echo "+ running libtoolize ..." -#libtoolize --copy --force || { -# echo -# echo "libtoolize failed" -# exit 1 -#} - -echo "+ running autoheader ... " -autoheader || { - echo - echo "autoheader failed" - exit 1 -} -# touch the stamp-h.in build stamp so we don't re-run autoheader in maintainer mode -- wingo -echo timestamp > stamp-h.in 2> /dev/null -echo "+ running autoconf ... " -autoconf || { - echo - echo "autoconf failed" - exit 1 -} -echo "+ running automake ... " -automake -a -c || { - echo - echo "automake failed" - exit 1 -} - -CONFIGURE_OPT='--enable-maintainer-mode' - -# work around some wierd sort of autotools buglet -for i in install-sh mkinstalldirs config.sub config.guess missing ltmain.sh; do - ln -sf ../../$i $i -done - -test -n "$NOCONFIGURE" && { - echo "skipping configure stage for package $package, as requested." - echo "autogen.sh done." - exit 0 -} - -echo "+ running configure ... " -echo "./configure default flags: $CONFIGURE_OPT" -echo "using: $CONFIGURE_OPT $@" -echo - -./configure $CONFIGURE_OPT "$@" || { - echo - echo "configure failed" - exit 1 -} - -echo -echo "Now type 'make' to compile $package." diff --git a/gst/cothreads/configure.ac b/gst/cothreads/configure.ac deleted file mode 100644 index c104672fea..0000000000 --- a/gst/cothreads/configure.ac +++ /dev/null @@ -1,306 +0,0 @@ -dnl ## -dnl ## NGPT - Next Generation POSIX Threading -dnl ## Copyright (c) 2001 IBM Corporation -dnl ## Portions Copyright (c) 1999-2000 Ralf S. Engelschall -dnl ## -dnl ## This file is part of BlueThreads, a non-preemptive thread scheduling -dnl ## library which can be found at http://www.ibm.com/developer -dnl ## -dnl ## This library is free software; you can redistribute it and/or -dnl ## modify it under the terms of the GNU Lesser General Public -dnl ## License as published by the Free Software Foundation; either -dnl ## version 2.1 of the License, or (at your option) any later version. -dnl ## -dnl ## This library is distributed in the hope that it will be useful, -dnl ## but WITHOUT ANY WARRANTY; without even the implied warranty of -dnl ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -dnl ## Lesser General Public License for more details. -dnl ## -dnl ## You should have received a copy of the GNU Lesser General Public -dnl ## License along with this library; if not, write to the Free Software -dnl ## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 -dnl ## USA. -dnl ## -dnl ## configure.in: ngpt Autoconf specification -dnl ## - -dnl # hacked on for inclusion into the gstreamer project 20 Jan 2002 by Andy -dnl # Wingo - -dnl # ``Programming in Bourne-Shell -dnl # is a higher form of masochism.'' -dnl # -- Unknown - -AC_INIT -AM_CONFIG_HEADER(pth_acdef.h) -AM_INIT_AUTOMAKE(pth, 1400) - -AC_MSG_PART(Build Tools) - -AC_PROG_CC -AC_PROG_CPP -AC_SET_MAKE -AM_PROG_LIBTOOL - -dnl ## Support for some special platform/compiler options -case "$PLATFORM:$CC" in - *-sun-solaris2*:cc ) - # shut-up harmless warnings caused by do-while macros on Solaris - test ".$ac_cv_prog_gcc" = ".no" && PTH_CFLAGS="$PTH_CFLAGS -w" - ;; - *-*-sysv*uw[27]*:cc ) - # shut-up harmless warnings caused by do-while macros on UnixWare - PTH_CFLAGS="$PTH_CFLAGS -w" - ;; - *-hp-hpux*:cc ) - # HPUX needs a few special options to find its ANSI C brain - PTH_CFLAGS="$PTH_CFLAGS -Ae -O" - ;; - *-hp-hpux*:CC ) - # HPUX outputs useless warnings - PTH_CFLAGS="$PTH_CFLAGS -w" - ;; - *-sgi-irix6.2:cc ) - # shut-up warnings caused by IRIX brain-dead 32/64 bit stuff - PTH_LDFLAGS="$PTH_LDFLAGS -woff 85 -Wl,-woff,84 -Wl,-woff,85" - ;; - *-sgi-irix6.5.[2-9]:cc ) - # since IRIX 6.5.2 the C compiler is smart enough, - # but the linker is still complaining, of course - PTH_LDFLAGS="$PTH_LDFLAGS -woff 84,85,134" - ;; - *-sgi-irix6.5:cc ) - # shut-up warnings caused by IRIX brain-dead 32/64 bit stuff - PTH_CFLAGS="$PTH_CFLAGS -woff 1110,1048" - PTH_LDFLAGS="$PTH_LDFLAGS -woff 84,85,134" - ;; - *-dec-osf4*:cc ) - # make sure the standard compliant functions are used on Tru64/OSF1 4.x - PTH_CFLAGS="$PTH_CFLAGS -std" - ;; - *-dec-osf5*:cc ) - # make sure the standard compliant functions are used on Tru64/OSF1 5.x - PTH_CFLAGS="$PTH_CFLAGS -std -D_XOPEN_SOURCE_EXTENDED" - ;; - *-*-isc*:* ) - # ISC is brain-dead and needs a bunch of options to find its brain - PTH_CPPFLAGS="$PTH_CPPFLAGS -D_POSIX_SOURCE"; - PTH_LIBS="$PTH_LIBS -lcposix -linet"; - ;; -esac - -AC_MSG_PART(Mandatory Platform Environment) - -dnl # check for standard headers -AC_HEADER_STDC -# FIXME -AC_HAVE_HEADERS(dnl - stdio.h stdlib.h stdarg.h string.h signal.h unistd.h setjmp.h fcntl.h dnl - errno.h sys/types.h) -AC_CHECK_FUNCTIONS(dnl - sigaction sigprocmask sigpending sigsuspend) -AC_BEGIN_DECISION([mandatory system headers and functions]) -AC_IFALLYES(dnl - header:stdio.h header:stdlib.h header:stdarg.h header:string.h dnl - header:signal.h header:unistd.h header:setjmp.h header:fcntl.h header:errno.h dnl - header:sys/types.h dnl - func:sigaction func:sigprocmask dnl - func:sigpending func:sigsuspend, - AC_DECIDE(fine, [all fine])) -AC_END_DECISION - -AC_MSG_PART(Optional Platform Environment) - -dnl # check whether ss_base instead of ss_sp attribute exists -AC_CHECK_STRUCTATTR(ss_base, sigaltstack, sys/signal.h) -AC_CHECK_STRUCTATTR(ss_sp, sigaltstack, sys/signal.h) - -dnl ## -dnl ## MACHINE CONTEXT IMPLEMENTATION -dnl ## - -AC_MSG_PART(Machine Context Implementation) - -dnl # -dnl # 1. determine possibilities -dnl # - -dnl # check for MCSC method -AC_CHECK_HEADERS(ucontext.h) -AC_CHECK_FUNCTIONS(makecontext swapcontext getcontext setcontext) -AC_CHECK_MCSC(mcsc=yes, mcsc=no) - -dnl # check for SJLJ method -AC_CHECK_HEADERS(signal.h) -AC_CHECK_FUNCTIONS(sigsetjmp siglongjmp setjmp longjmp _setjmp _longjmp) -AC_CHECK_FUNCTIONS(sigaltstack sigstack) -AC_CHECK_SJLJ(sjlj=yes, sjlj=no, sjlj_type) - -dnl # -dnl # 2. make a general decision -dnl # - -if test ".$mcsc" = .yes; then - mctx_mth=mcsc - mctx_dsp=sc - mctx_stk=mc -elif test ".$sjlj" = .yes; then - mctx_mth=sjlj - mctx_dsp=$sjlj_type - mctx_stk=none - AC_IFALLYES(func:sigstack, mctx_stk=ss) - AC_IFALLYES(func:sigaltstack, mctx_stk=sas) - case $mctx_dsp in - sjljlx|sjljisc|sjljw32 ) mctx_stk=none - esac -else - AC_ERROR([no appropriate mctx method found]) -fi - -dnl # -dnl # 3. allow decision to be overridden by user -dnl # - -AC_ARG_WITH(mctx-mth,dnl -[ --with-mctx-mth=ID force mctx method (mcsc,sjlj)],[ -case $withval in - mcsc|sjlj ) mctx_mth=$withval ;; - * ) AC_ERROR([invalid mctx method -- allowed: mcsc,sjlj]) ;; -esac -])dnl -AC_ARG_WITH(mctx-dsp,dnl -[ --with-mctx-dsp=ID force mctx dispatching (sc,ssjlj,sjlj,usjlj,sjlje,...)],[ -case $withval in - sc|ssjlj|sjlj|usjlj|sjlje|sjljlx|sjljisc|sjljw32 ) mctx_dsp=$withval ;; - * ) AC_ERROR([invalid mctx dispatching -- allowed: sc,ssjlj,sjlj,usjlj,sjlje,sjljlx,sjljisc,sjljw32]) ;; -esac -])dnl -AC_ARG_WITH(mctx-stk,dnl -[ --with-mctx-stk=ID force mctx stack setup (mc,ss,sas,...)],[ -case $withval in - mc|ss|sas|none ) mctx_stk=$withval ;; - * ) AC_ERROR([invalid mctx stack setup -- allowed: mc,ss,sas,none]) ;; -esac -])dnl - -dnl # -dnl # 4. determine a few additional details -dnl # - -dnl # whether sigaltstack has to use stack_t instead of struct sigaltstack -AC_CHECK_TYPEDEF(stack_t, signal.h) - -dnl # ibm - test whether we need a separate register stack (IA64). -AC_CHECK_NEED_FOR_SEPARATE_STACK(PTH_NEED_SEPARATE_REGISTER_STACK) -dnl # ibm - end - -dnl # direction of stack grow -AC_CHECK_STACKGROWTH(PTH_STACKGROWTH) -if test ".$ac_cv_check_stackgrowth" = ".down"; then - PTH_STACK_GROWTH="down" -else - PTH_STACK_GROWTH="up" -fi -AC_SUBST(PTH_STACK_GROWTH) - -dnl # how to specify stacks for the various functions -AC_CHECK_STACKSETUP(makecontext, pth_skaddr_makecontext, pth_sksize_makecontext) -AC_CHECK_STACKSETUP(sigaltstack, pth_skaddr_sigaltstack, pth_sksize_sigaltstack) -AC_CHECK_STACKSETUP(sigstack, pth_skaddr_sigstack, pth_sksize_sigstack) - -dnl # how to implement POSIX compliant sig{set,long}jmp() -case $mctx_dsp in [ - ssjlj ) - pth_sigjmpbuf='sigjmp_buf' - pth_sigsetjmp='sigsetjmp(buf,1)' - pth_siglongjmp='siglongjmp(buf,val)' - ;; - sjlj ) - pth_sigjmpbuf='jmp_buf' - pth_sigsetjmp='setjmp(buf)' - pth_siglongjmp='longjmp(buf,val)' - ;; - usjlj ) - pth_sigjmpbuf='jmp_buf' - pth_sigsetjmp='_setjmp(buf)' - pth_siglongjmp='_longjmp(buf,val)' - ;; - sjlje ) - pth_sigjmpbuf='jmp_buf' - pth_sigsetjmp='setjmp(buf)' - pth_siglongjmp='longjmp(buf,val)' - ;; - sjljlx|sjljisc|sjljw32 ) - pth_sigjmpbuf='sigjmp_buf' - pth_sigsetjmp='sigsetjmp(buf,1)' - pth_siglongjmp='siglongjmp(buf,val)' - ;; -] esac -pth_sigjmpbuf="#define pth_sigjmpbuf $pth_sigjmpbuf" -pth_sigsetjmp="#define pth_sigsetjmp(buf) $pth_sigsetjmp" -pth_siglongjmp="#define pth_siglongjmp(buf,val) $pth_siglongjmp" -AC_SUBST(pth_sigjmpbuf) -AC_SUBST(pth_sigsetjmp) -AC_SUBST(pth_siglongjmp) - -dnl # -dnl # 5. export the results -dnl # - -AC_DEFINE_UNQUOTED(PTH_MCTX_MTH_use, [PTH_MCTX_MTH_$mctx_mth]) -AC_DEFINE_UNQUOTED(PTH_MCTX_DSP_use, [PTH_MCTX_DSP_$mctx_dsp]) -AC_DEFINE_UNQUOTED(PTH_MCTX_STK_use, [PTH_MCTX_STK_$mctx_stk]) - -PTH_MCTX_ID="$mctx_mth/$mctx_dsp/$mctx_stk" -AC_MSG_RESULT([decision on mctx implementation... ${TB}${PTH_MCTX_ID}${TN}]) -AC_SUBST(PTH_MCTX_ID) - -AC_MSG_VERBOSE([decided mctx method: $mctx_mth]) -AC_MSG_VERBOSE([decided mctx dispatching: $mctx_dsp]) -AC_MSG_VERBOSE([decided mctx stack setup: $mctx_stk]) - -AC_MSG_PART(Checking for GLib) - -dnl Check for glib2 -translit(dnm, m, l) AM_CONDITIONAL(USE_GLIB2, true) -GST_CHECK_FEATURE(GLIB2, [use of glib-2.0 and GObject], , [ - PKG_CHECK_MODULES(GLIB2, glib-2.0 gthread-2.0, - HAVE_GLIB2=yes,HAVE_GLIB2=no) - GLIB_LIBS=$GLIB2_LIBS - GLIB_CFLAGS=$GLIB2_CFLAGS - AC_SUBST(GLIB_LIBS) - AC_SUBST(GLIB_CFLAGS) - # glib2 is now the default. so if we don't have it here, then use glib1 - if test "x$HAVE_GLIB2" = "xno"; then - AC_MSG_WARN([no glib2 found, falling back to glib1]) - fi -], enabled, [ -dnl AC_DEFINE(USE_GLIB2) -]) -dnl AC_SUBST(USE_GLIB2) - -if test x$USE_GLIB2 = xno; then - dnl Check for glib and gtk - AM_PATH_GLIB(1.2.0,, - AC_MSG_ERROR(Cannot find glib: Is glib-config in path?), - glib gmodule gthread) -fi - - -dnl ## Additional support for some special platform/compiler options -case "$PLATFORM:$CC" in -*-ibm-mvs*:cc | *-ibm-mvs*:c++ ) - mvs_extras='-W "c,float(ieee)" -W "c,langlvl(extended)" -W "c,expo,dll"' - PTH_CFLAGS="$PTH_CFLAGS $mvs_extras" - mvs_extras='-W "l,p,map" -W "l,map,list"' - PTH_LDFLAGS="$PTH_LDFLAGS $mvs_extras" - ;; -esac - -AC_MSG_PART(Output Substitution) - -AC_OUTPUT( -Makefile -pth.h -pth_acmac.h -) diff --git a/gst/cothreads/cothread-stack.c b/gst/cothreads/cothread-stack.c deleted file mode 100644 index cf3f13d3a2..0000000000 --- a/gst/cothreads/cothread-stack.c +++ /dev/null @@ -1,236 +0,0 @@ -/* Pthread-friendly coroutines with pth - * Copyright (C) 2001 Andy Wingo - * - * cothread-stack.c: various methods of allocating cothread stacks - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -#include "cothreads-private.h" -#include "linuxthreads.h" -#include -#include - -typedef enum _cothread_block_state cothread_block_state; -typedef struct _cothread_chunk cothread_chunk; - -enum _cothread_block_state -{ - COTHREAD_BLOCK_STATE_UNUSED=0, - COTHREAD_BLOCK_STATE_IN_USE -}; - -struct _cothread_chunk { - cothread_chunk *next; - cothread_block_state *block_states; - char *chunk; - int size; - int reserved_bottom; - gboolean needs_free; - int nblocks; -}; - - -static cothread_chunk* cothread_chunk_new (unsigned long size, gboolean allocate); -static void cothread_chunk_free (cothread_chunk *chunk); -static gboolean cothread_stack_alloc_chunked (cothread_chunk *chunk, char **low, char **high, - cothread_chunk *(*chunk_new)(cothread_chunk*)); -static cothread_chunk* cothread_chunk_new_linuxthreads (cothread_chunk* old); -static cothread_chunk* cothread_chunk_new_on_stack (cothread_chunk* old); - - -gboolean -cothread_stack_alloc_on_heap (char **low, char **high) -{ - if (posix_memalign (low, _cothreads_config_global->chunk_size / _cothreads_config_global->blocks_per_chunk, - _cothreads_config_global->chunk_size / _cothreads_config_global->blocks_per_chunk)) { - g_error ("could not memalign stack"); - return FALSE; - } - - *high = *low + sizeof (*low) - 1; - return TRUE; -} - -gboolean -cothread_stack_alloc_on_gthread_stack (char **low, char **high) -{ - cothread_chunk *chunk = NULL; - static GStaticPrivate chunk_key = G_STATIC_PRIVATE_INIT; - - if (!(chunk = g_static_private_get(&chunk_key))) { - chunk = cothread_chunk_new (_cothreads_config_global->chunk_size, FALSE); - g_static_private_set (&chunk_key, chunk, (GDestroyNotify) cothread_chunk_free); - } - - return cothread_stack_alloc_chunked (chunk, low, high, cothread_chunk_new_on_stack); -} - -gboolean -cothread_stack_alloc_linuxthreads (char **low, char **high) -{ - cothread_chunk *chunk = NULL; - static GStaticPrivate chunk_key = G_STATIC_PRIVATE_INIT; - - if (!(chunk = g_static_private_get(&chunk_key))) { - chunk = cothread_chunk_new (_cothreads_config_global->chunk_size, FALSE); - g_message ("created new chunk, %p, size=0x%x", chunk->chunk, chunk->size); - g_static_private_set (&chunk_key, chunk, (GDestroyNotify) cothread_chunk_free); - } - - return cothread_stack_alloc_chunked (chunk, low, high, cothread_chunk_new_linuxthreads); -} - - -/* size must be a power of two. */ -static cothread_chunk* -cothread_chunk_new (unsigned long size, gboolean allocate) -{ - cothread_chunk *ret; - char *sp = CURRENT_STACK_FRAME; - - ret = g_new0 (cothread_chunk, 1); - ret->nblocks = _cothreads_config_global->blocks_per_chunk; - ret->block_states = g_new0 (cothread_block_state, ret->nblocks); - - if (allocate) { - if (posix_memalign(&ret->chunk, size, size)) - g_error ("memalign operation failed"); - } else { - /* if we don't allocate the chunk, we must already be in it. */ - - ret->chunk = (char*) ((unsigned long) sp &~ (size - 1)); -#if PTH_STACK_GROWTH > 0 - ret->reserved_bottom = sp - ret->chunk; -#else - ret->reserved_bottom = ret->chunk + size - sp; -#endif - } - - ret->size = size; - ret->needs_free = allocate; - - return ret; -} - -/** - * cothread_stack_alloc_chunked: - * @chunk: the chunk for the - * Make a new cothread stack out of a chunk. Chunks are assumed to be aligned on - * boundaries of _cothreads_config_global->chunk_size. - * - * Returns: the new cothread context - */ - /* we assume that the stack is aligned on _cothreads_config_global->chunk_size boundaries */ -static gboolean -cothread_stack_alloc_chunked (cothread_chunk *chunk, char **low, char **high, - cothread_chunk *(*chunk_new)(cothread_chunk*)) -{ - int block; - cothread_chunk *walk, *last; - - for (walk=chunk; walk; last=walk, walk=walk->next) { - if (walk->block_states[0] == COTHREAD_BLOCK_STATE_UNUSED) { - walk->block_states[0] = COTHREAD_BLOCK_STATE_IN_USE; -#if PTH_STACK_GROWTH > 0 - *low = walk->chunk + walk->reserved_bottom; - *high = walk->chunk + walk->size / walk->nblocks; -#else - *low = walk->chunk + walk->size * (walk->nblocks - 1) / walk->nblocks; - *high = walk->chunk + walk->size - walk->reserved_bottom; -#endif - return TRUE; - } - - for (block = 1; block < walk->nblocks; block++) { - if (walk->block_states[block] == COTHREAD_BLOCK_STATE_UNUSED) { - walk->block_states[block] = COTHREAD_BLOCK_STATE_IN_USE; -#if PTH_STACK_GROWTH > 0 - *low = walk->chunk + walk->size * block / walk->nblocks; -#else - *low = walk->chunk + walk->size * (walk->nblocks - block - 1) / walk->nblocks; -#endif - *high = *low + walk->size / walk->nblocks; - return TRUE; - } - } - } - - if (!chunk_new) - return FALSE; - else - return cothread_stack_alloc_chunked (chunk_new (last), low, high, NULL); -} - -static void -cothread_chunk_free (cothread_chunk *chunk) -{ - /* FIXME: implement me please */ -} - -static cothread_chunk* -cothread_chunk_new_linuxthreads (cothread_chunk* old) -{ - cothread_chunk *new; - void *pthread_descr; - - new = cothread_chunk_new (_cothreads_config_global->chunk_size, TRUE); - pthread_descr = __linuxthreads_self(); -#if PTH_STACK_GROWTH > 0 - /* we don't really know pthread_descr's size in this case, but we can be - * conservative. it's normally 1K in the down-growing case, so we allocate 2K. - */ - new->reserved_bottom = 2048; - memcpy(new->chunk, pthread_descr, 2048); -#else - new->reserved_bottom = ((unsigned long) pthread_descr | (new->size - 1)) - (unsigned long) pthread_descr; - memcpy(new->chunk + new->size - new->reserved_bottom - 1, pthread_descr, new->reserved_bottom); -#endif - - old->next = new; - return new; -} - -static cothread_chunk* -cothread_chunk_new_on_stack (cothread_chunk* old) -{ - cothread_chunk *new; - void *pthread_descr; - struct rlimit limit; - - getrlimit (RLIMIT_STACK, &limit); - g_print ("stack limit: %d\nstack max: %d\n", limit.rlim_cur, limit.rlim_max); - limit.rlim_cur += old->size; - if (setrlimit (RLIMIT_STACK, &limit)) { - perror ("Could not increase the stack size, aborting..."); - return NULL; - } - - new = cothread_chunk_new (old->size, FALSE); - new->reserved_bottom = 0; - -#if PTH_STACK_GROWTH > 0 - /* we don't really know pthread_descr's size in this case, but we can be - * conservative. it's normally 1K in the down-growing case, so we allocate 2K. - */ - new->chunk += new->size; -#else - new->chunk -= new->size; -#endif - - old->next = new; - return new; -} diff --git a/gst/cothreads/cothreads-private.h b/gst/cothreads/cothreads-private.h deleted file mode 100644 index 2cd620270a..0000000000 --- a/gst/cothreads/cothreads-private.h +++ /dev/null @@ -1,43 +0,0 @@ -/* Pthread-friendly coroutines with pth - * Copyright (C) 2002 Andy Wingo - * - * cothread-private.h: private prototypes - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -#ifndef __COTHREAD_PRIVATE_H__ -#define __COTHREAD_PRIVATE_H__ - -#include - -typedef struct _cothread_private cothread_private; - -struct _cothread_private { - int argc; - void **argv; - void (*func) (int argc, void **argv); -}; - -extern cothreads_config *_cothreads_config_global; - - -gboolean cothread_stack_alloc_on_gthread_stack (char **low, char **high); -gboolean cothread_stack_alloc_linuxthreads (char **low, char **high); -gboolean cothread_stack_alloc_on_heap (char **low, char **high); - - -#endif /* __COTHREAD_PRIVATE_H__ */ diff --git a/gst/cothreads/cothreads.c b/gst/cothreads/cothreads.c deleted file mode 100644 index e9744fb049..0000000000 --- a/gst/cothreads/cothreads.c +++ /dev/null @@ -1,203 +0,0 @@ -/* Pthread-friendly coroutines with pth - * Copyright (C) 2002 Andy Wingo - * - * cothreads.c: public API implementation - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -#include "cothreads-private.h" - -#define HAVE_LINUXTHREADS - -#ifdef HAVE_LINUXTHREADS -static cothreads_config cothreads_config_default = COTHREADS_CONFIG_LINUXTHREADS_INITIALIZER; -#else -static cothreads_config cothreads_config_default = COTHREADS_CONFIG_GTHREAD_INITIALIZER; -#endif - -cothreads_config *_cothreads_config_global = NULL; - -static gboolean (*stack_alloc_func) (char**, char**); - -static void cothread_private_set (char *sp, void *priv, size_t size); -static void cothread_private_get (char *sp, void *priv, size_t size); -static void cothread_stub (void); - - -/** - * cothreads_initialized: - * - * Query the state of the cothreads system. - * - * Returns: TRUE if cothreads_init() has already been called, FALSE otherwise - */ -gboolean -cothreads_initialized (void) -{ - return (_cothreads_config_global != NULL); -} - -/** - * cothreads_init: - * @config: attributes for creation of cothread stacks - * - * Initialize the cothreads system. If @config is NULL, use the default parameters - * detected at compile-time. - */ -void -cothreads_init (cothreads_config *config) -{ - static cothreads_config _config; - - if (cothreads_initialized()) { - g_warning ("cothread system has already been initialized"); - return; - } - - /* we don't hold on to *config, we copy it (if it's supplied) */ - if (!config) - _config = cothreads_config_default; - else - _config = *config; - - _cothreads_config_global = &_config; - - switch (_cothreads_config_global->method) { - case COTHREADS_ALLOC_METHOD_MALLOC: - stack_alloc_func = cothread_stack_alloc_on_heap; - break; - case COTHREADS_ALLOC_METHOD_GTHREAD_STACK: - stack_alloc_func = cothread_stack_alloc_on_gthread_stack; - break; - case COTHREADS_ALLOC_METHOD_LINUXTHREADS: - stack_alloc_func = cothread_stack_alloc_linuxthreads; - break; - default: - g_error ("unexpected value for config method %d", _cothreads_config_global->method); - } -} - -/** - * cothread_create: - * @func: function to start with this cothread - * @argc: argument count - * @argv: argument vector - * - * Create a new cothread running a given function. You must explictly switch - * into this cothread to give it control. If @func is NULL, a cothread is - * created on the current stack with the current stack pointer. - * - * Returns: A pointer to the new cothread - */ -cothread* -cothread_create (void (*func)(int, void **), int argc, void **argv) -{ - char *low, *high; - cothread_private priv; - cothread *ret = g_new0 (cothread, 1); - - if (!func) { - /* we are being asked to save the current thread into a new cothread. this - * only happens for the first cothread. */ - if (_cothreads_config_global->alloc_cothread_0) - if (!stack_alloc_func (&low, &high)) - g_error ("couldn't create cothread 0"); - else - g_message ("created cothread 0 with low=%p, high=%p", low, high); - else - g_message ("created cothread 0"); - - pth_mctx_save (ret); - return ret; - } - - if (!stack_alloc_func (&low, &high)) - g_error ("could not allocate a new cothread stack"); - - g_message ("created a cothread with low=%p, high=%p", low, high); - - pth_mctx_set (ret, cothread_stub, low, high); - - priv.argc = argc; - priv.argv = argv; - priv.func = func; - cothread_private_set (low, &priv, sizeof(priv)); - - return ret; -} - -/** - * cothread_destroy: - * @thread: cothread to destroy - * - * Deallocate any memory used by the cothread data structures. - */ -void -cothread_destroy (cothread *thread) -{ - /* FIXME: have method-specific destroy functions. */ - - g_free (thread); -} - -/* the whole 'page size' thing is to allow for the last page of a stack or chunk - * to be mmap'd as a boundary page */ - -static void -cothread_private_set (char *sp, void *priv, size_t size) -{ - char *dest; - -#if PTH_STACK_GROWTH > 0 - dest = (char*) ((gulong)sp | (_cothreads_config_global->chunk_size / _cothreads_config_global->blocks_per_chunk - 1)) - - size + 1 - getpagesize(); -#else - dest = (char*) ((gulong)sp &~ (_cothreads_config_global->chunk_size / _cothreads_config_global->blocks_per_chunk - 1)) - + getpagesize(); -#endif - - memcpy (dest, priv, size); -} - -static void -cothread_private_get (char *sp, void *priv, size_t size) -{ - char *src; - -#if PTH_STACK_GROWTH > 0 - src = (char*) ((gulong)sp | (_cothreads_config_global->chunk_size / _cothreads_config_global->blocks_per_chunk - 1)) - - size + 1 - getpagesize(); -#else - src = (char*) ((gulong)sp &~ (_cothreads_config_global->chunk_size / _cothreads_config_global->blocks_per_chunk - 1)) - + getpagesize(); -#endif - - memcpy (priv, src, size); -} - -static void -cothread_stub (void) -{ - cothread_private priv; - - cothread_private_get (CURRENT_STACK_FRAME, &priv, sizeof (priv)); - - priv.func (priv.argc, priv.argv); - - g_warning ("we really shouldn't get here"); -} - diff --git a/gst/cothreads/cothreads.h b/gst/cothreads/cothreads.h deleted file mode 100644 index 2b5063205a..0000000000 --- a/gst/cothreads/cothreads.h +++ /dev/null @@ -1,84 +0,0 @@ -/* Pthread-friendly coroutines with pth - * Copyright (C) 2002 Andy Wingo - * - * cothread.h: public API - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -#ifndef __COTHREAD_H__ -#define __COTHREAD_H__ - -#include -#include - - -#ifndef CURRENT_STACK_FRAME -#define CURRENT_STACK_FRAME ({ char __csf; &__csf; }) -#endif /* CURRENT_STACK_FRAME */ - - -typedef pth_mctx_t cothread; -typedef enum _cothreads_alloc_method cothreads_alloc_method; -typedef struct _cothreads_config cothreads_config; - - -enum _cothreads_alloc_method -{ - COTHREADS_ALLOC_METHOD_MALLOC, /* cothread stacks on the heap, one block per chunk */ - COTHREADS_ALLOC_METHOD_GTHREAD_STACK, /* cothread stacks within the current gthread's stack */ - COTHREADS_ALLOC_METHOD_LINUXTHREADS, /* a hack that allows for linuxthreads compatibility */ -}; - -struct _cothreads_config { - cothreads_alloc_method method; /* the method of allocating new cothread stacks */ - int chunk_size; /* size of contiguous chunk of memory for cothread stacks */ - int blocks_per_chunk; /* cothreads per chunk */ - gboolean alloc_cothread_0; /* if the first cothread needs to be allocated */ -}; - -#define COTHREADS_CONFIG_HEAP_INITIALIZER { \ - COTHREADS_ALLOC_METHOD_MALLOC, /* each cothread on the heap */ \ - 0x20000, /* stack size of 128 kB */ \ - 1, /* we aren't chunked */ \ - FALSE /* nothing special for cothread 0 */ \ -} - -#define COTHREADS_CONFIG_GTHREAD_INITIALIZER { \ - COTHREADS_ALLOC_METHOD_GTHREAD_STACK, /* this is what the old cothreads code does */ \ - 0x100000, /* only 1 MB due the the FreeBSD defaults */ \ - 8, /* for a stack size of 128 KB */ \ - TRUE /* set up the first chunk */ \ -} - -#define COTHREADS_CONFIG_LINUXTHREADS_INITIALIZER { \ - COTHREADS_ALLOC_METHOD_LINUXTHREADS, /* use the linuxthreads hack */ \ - 0x200000, /* 2 MB */ \ - 8, /* for a stack size of 256 KB */ \ - TRUE /* set up the first chunk */ \ -} - -gboolean cothreads_initialized (void); -void cothreads_init (cothreads_config *config); - -cothread* cothread_create (void (*func)(int, void**), int argc, void **argv); -void cothread_destroy (cothread *thread); - -/* 'old' and 'new' are of type (cothread*) */ -#define cothread_switch(old,new) pth_mctx_switch(old,new) -#define cothread_yield(new) pth_mctx_restore(new); - -#endif /* __COTHREAD_H__ */ diff --git a/gst/cothreads/linuxthreads.h b/gst/cothreads/linuxthreads.h deleted file mode 100644 index dcdd9e8807..0000000000 --- a/gst/cothreads/linuxthreads.h +++ /dev/null @@ -1,33 +0,0 @@ -#ifndef _GNU_SOURCE /* pull in the nonposix static mutex initializers */ -#define _GNU_SOURCE -#define __USE_GNU /* just to be sure */ -#endif - -#include - -#ifndef CURRENT_STACK_FRAME -#define CURRENT_STACK_FRAME ({ char __csf; &__csf; }) -#endif /* CURRENT_STACK_FRAME */ - -#define STACK_SIZE 0x200000 - -/* this function is only really necessary to get the main thread's - * pthread_descr, as the other threads store the pthread_descr (actually the - * first member of struct _pthread_descr_struct, which points to itself for the - * default non-indirected case) at the top of the stack. */ -static inline _pthread_descr __linuxthreads_self() -{ - pthread_mutex_t mutex = PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP; - _pthread_descr self; - - pthread_mutex_lock (&mutex); - self = mutex.__m_owner; - pthread_mutex_unlock (&mutex); - - printf ("pthread_self: %d\n", pthread_self()); - printf ("descr: %p\n", self); - printf ("*descr: %p\n", *(int*)self); - - return self; -} - diff --git a/gst/cothreads/m4/glib.m4 b/gst/cothreads/m4/glib.m4 deleted file mode 100644 index b8094bbfe0..0000000000 --- a/gst/cothreads/m4/glib.m4 +++ /dev/null @@ -1,196 +0,0 @@ -# Configure paths for GLIB -# Owen Taylor 97-11-3 - -dnl AM_PATH_GLIB([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]]) -dnl Test for GLIB, and define GLIB_CFLAGS and GLIB_LIBS, if "gmodule" or -dnl gthread is specified in MODULES, pass to glib-config -dnl -AC_DEFUN(AM_PATH_GLIB, -[dnl -dnl Get the cflags and libraries from the glib-config script -dnl -AC_ARG_WITH(glib-prefix,[ --with-glib-prefix=PFX Prefix where GLIB is installed (optional)], - glib_config_prefix="$withval", glib_config_prefix="") -AC_ARG_WITH(glib-exec-prefix,[ --with-glib-exec-prefix=PFX Exec prefix where GLIB is installed (optional)], - glib_config_exec_prefix="$withval", glib_config_exec_prefix="") -AC_ARG_ENABLE(glibtest, [ --disable-glibtest Do not try to compile and run a test GLIB program], - , enable_glibtest=yes) - - if test x$glib_config_exec_prefix != x ; then - glib_config_args="$glib_config_args --exec-prefix=$glib_config_exec_prefix" - if test x${GLIB_CONFIG+set} != xset ; then - GLIB_CONFIG=$glib_config_exec_prefix/bin/glib-config - fi - fi - if test x$glib_config_prefix != x ; then - glib_config_args="$glib_config_args --prefix=$glib_config_prefix" - if test x${GLIB_CONFIG+set} != xset ; then - GLIB_CONFIG=$glib_config_prefix/bin/glib-config - fi - fi - - for module in . $4 - do - case "$module" in - gmodule) - glib_config_args="$glib_config_args gmodule" - ;; - gthread) - glib_config_args="$glib_config_args gthread" - ;; - esac - done - - AC_PATH_PROG(GLIB_CONFIG, glib-config, no) - min_glib_version=ifelse([$1], ,0.99.7,$1) - AC_MSG_CHECKING(for GLIB - version >= $min_glib_version) - no_glib="" - if test "$GLIB_CONFIG" = "no" ; then - no_glib=yes - else - GLIB_CFLAGS=`$GLIB_CONFIG $glib_config_args --cflags` - GLIB_LIBS=`$GLIB_CONFIG $glib_config_args --libs` - glib_config_major_version=`$GLIB_CONFIG $glib_config_args --version | \ - sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` - glib_config_minor_version=`$GLIB_CONFIG $glib_config_args --version | \ - sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` - glib_config_micro_version=`$GLIB_CONFIG $glib_config_args --version | \ - sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` - if test "x$enable_glibtest" = "xyes" ; then - ac_save_CFLAGS="$CFLAGS" - ac_save_LIBS="$LIBS" - CFLAGS="$CFLAGS $GLIB_CFLAGS" - LIBS="$GLIB_LIBS $LIBS" -dnl -dnl Now check if the installed GLIB is sufficiently new. (Also sanity -dnl checks the results of glib-config to some extent -dnl - rm -f conf.glibtest - AC_TRY_RUN([ -#include -#include -#include - -int -main () -{ - int major, minor, micro; - char *tmp_version; - - system ("touch conf.glibtest"); - - /* HP/UX 9 (%@#!) writes to sscanf strings */ - tmp_version = g_strdup("$min_glib_version"); - if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) { - printf("%s, bad version string\n", "$min_glib_version"); - exit(1); - } - - if ((glib_major_version != $glib_config_major_version) || - (glib_minor_version != $glib_config_minor_version) || - (glib_micro_version != $glib_config_micro_version)) - { - printf("\n*** 'glib-config --version' returned %d.%d.%d, but GLIB (%d.%d.%d)\n", - $glib_config_major_version, $glib_config_minor_version, $glib_config_micro_version, - glib_major_version, glib_minor_version, glib_micro_version); - printf ("*** was found! If glib-config was correct, then it is best\n"); - printf ("*** to remove the old version of GLIB. You may also be able to fix the error\n"); - printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n"); - printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n"); - printf("*** required on your system.\n"); - printf("*** If glib-config was wrong, set the environment variable GLIB_CONFIG\n"); - printf("*** to point to the correct copy of glib-config, and remove the file config.cache\n"); - printf("*** before re-running configure\n"); - } - else if ((glib_major_version != GLIB_MAJOR_VERSION) || - (glib_minor_version != GLIB_MINOR_VERSION) || - (glib_micro_version != GLIB_MICRO_VERSION)) - { - printf("*** GLIB header files (version %d.%d.%d) do not match\n", - GLIB_MAJOR_VERSION, GLIB_MINOR_VERSION, GLIB_MICRO_VERSION); - printf("*** library (version %d.%d.%d)\n", - glib_major_version, glib_minor_version, glib_micro_version); - } - else - { - if ((glib_major_version > major) || - ((glib_major_version == major) && (glib_minor_version > minor)) || - ((glib_major_version == major) && (glib_minor_version == minor) && (glib_micro_version >= micro))) - { - return 0; - } - else - { - printf("\n*** An old version of GLIB (%d.%d.%d) was found.\n", - glib_major_version, glib_minor_version, glib_micro_version); - printf("*** You need a version of GLIB newer than %d.%d.%d. The latest version of\n", - major, minor, micro); - printf("*** GLIB is always available from ftp://ftp.gtk.org.\n"); - printf("***\n"); - printf("*** If you have already installed a sufficiently new version, this error\n"); - printf("*** probably means that the wrong copy of the glib-config shell script is\n"); - printf("*** being found. The easiest way to fix this is to remove the old version\n"); - printf("*** of GLIB, but you can also set the GLIB_CONFIG environment to point to the\n"); - printf("*** correct copy of glib-config. (In this case, you will have to\n"); - printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n"); - printf("*** so that the correct libraries are found at run-time))\n"); - } - } - return 1; -} -],, no_glib=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"]) - CFLAGS="$ac_save_CFLAGS" - LIBS="$ac_save_LIBS" - fi - fi - if test "x$no_glib" = x ; then - AC_MSG_RESULT(yes) - ifelse([$2], , :, [$2]) - else - AC_MSG_RESULT(no) - if test "$GLIB_CONFIG" = "no" ; then - echo "*** The glib-config script installed by GLIB could not be found" - echo "*** If GLIB was installed in PREFIX, make sure PREFIX/bin is in" - echo "*** your path, or set the GLIB_CONFIG environment variable to the" - echo "*** full path to glib-config." - else - if test -f conf.glibtest ; then - : - else - echo "*** Could not run GLIB test program, checking why..." - CFLAGS="$CFLAGS $GLIB_CFLAGS" - LIBS="$LIBS $GLIB_LIBS" - AC_TRY_LINK([ -#include -#include -], [ return ((glib_major_version) || (glib_minor_version) || (glib_micro_version)); ], - [ echo "*** The test program compiled, but did not run. This usually means" - echo "*** that the run-time linker is not finding GLIB or finding the wrong" - echo "*** version of GLIB. If it is not finding GLIB, you'll need to set your" - echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" - echo "*** to the installed location Also, make sure you have run ldconfig if that" - echo "*** is required on your system" - echo "***" - echo "*** If you have an old version installed, it is best to remove it, although" - echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" - echo "***" - echo "*** If you have a RedHat 5.0 system, you should remove the GTK package that" - echo "*** came with the system with the command" - echo "***" - echo "*** rpm --erase --nodeps gtk gtk-devel" ], - [ echo "*** The test program failed to compile or link. See the file config.log for the" - echo "*** exact error that occured. This usually means GLIB was incorrectly installed" - echo "*** or that you have moved GLIB since it was installed. In the latter case, you" - echo "*** may want to edit the glib-config script: $GLIB_CONFIG" ]) - CFLAGS="$ac_save_CFLAGS" - LIBS="$ac_save_LIBS" - fi - fi - GLIB_CFLAGS="" - GLIB_LIBS="" - ifelse([$3], , :, [$3]) - fi - AC_SUBST(GLIB_CFLAGS) - AC_SUBST(GLIB_LIBS) - rm -f conf.glibtest -]) diff --git a/gst/cothreads/m4/gst-feature.m4 b/gst/cothreads/m4/gst-feature.m4 deleted file mode 100644 index a0dc39c84c..0000000000 --- a/gst/cothreads/m4/gst-feature.m4 +++ /dev/null @@ -1,182 +0,0 @@ -dnl Perform a check for a feature for GStreamer -dnl Richard Boulton -dnl Thomas Vander Stichele added useful stuff -dnl Last modification: 25/06/2001 -dnl GST_CHECK_FEATURE(FEATURE-NAME, FEATURE-DESCRIPTION, -dnl DEPENDENT-PLUGINS, TEST-FOR-FEATURE, -dnl DISABLE-BY-DEFAULT, ACTION-IF-USE, ACTION-IF-NOTUSE) -dnl -dnl This macro adds a command line argument to enable the user to enable -dnl or disable a feature, and if the feature is enabled, performs a supplied -dnl test to check if the feature is available. -dnl -dnl The test should define HAVE_ to "yes" or "no" depending -dnl on whether the feature is available. -dnl -dnl The macro will set USE_ to "yes" or "no" depending on -dnl whether the feature is to be used. -dnl Thomas changed this, so that when USE_ was already set -dnl to no, then it stays that way. -dnl -dnl The macro will call AM_CONDITIONAL(USE_<, ...) to allow -dnl the feature to control what is built in Makefile.ams. If you want -dnl additional actions resulting from the test, you can add them with the -dnl ACTION-IF-USE and ACTION-IF-NOTUSE parameters. -dnl -dnl FEATURE-NAME is the name of the feature, and should be in -dnl purely upper case characters. -dnl FEATURE-DESCRIPTION is used to describe the feature in help text for -dnl the command line argument. -dnl DEPENDENT-PLUGINS lists any plugins which depend on this feature. -dnl TEST-FOR-FEATURE is a test which sets HAVE_ to "yes" -dnl or "no" depending on whether the feature is -dnl available. -dnl DISABLE-BY-DEFAULT if "disabled", the feature is disabled by default, -dnl if any other value, the feature is enabled by default. -dnl ACTION-IF-USE any extra actions to perform if the feature is to be -dnl used. -dnl ACTION-IF-NOTUSE any extra actions to perform if the feature is not to -dnl be used. -dnl -dnl -dnl thomas : -dnl we also added a history. -dnl GST_PLUGINS_YES will contain all plugins to be built -dnl that were checked through GST_CHECK_FEATURE -dnl GST_PLUGINS_NO will contain those that won't be built - -AC_DEFUN(GST_CHECK_FEATURE, -[dnl -builtin(define, [gst_endisable], ifelse($5, [disabled], [enable], [disable]))dnl -dnl if it is set to NO, then don't even consider it for building -NOUSE= -if test "x$USE_[$1]" = "xno"; then - NOUSE="yes" -fi -AC_ARG_ENABLE(translit([$1], A-Z, a-z), - [ ]builtin(format, --%-26s gst_endisable %s, gst_endisable-translit([$1], A-Z, a-z), [$2]ifelse([$3],,,: [$3])), - [ case "${enableval}" in - yes) USE_[$1]=yes;; - no) USE_[$1]=no;; - *) AC_MSG_ERROR(bad value ${enableval} for --enable-translit([$1], A-Z, a-z)) ;; - esac], - [ USE_$1=]ifelse($5, [disabled], [no], [yes])) dnl DEFAULT - -dnl *** set it back to no if it was preset to no -if test "x$NOUSE" = "xyes"; then - USE_[$1]="no" - AC_MSG_WARN(*** $3 pre-configured not to be built) -fi -NOUSE= - -dnl *** If it's enabled - -if test x$USE_[$1] = xyes; then - gst_check_save_LIBS=$LIBS - gst_check_save_LDFLAGS=$LDFLAGS - gst_check_save_CFLAGS=$CFLAGS - gst_check_save_CPPFLAGS=$CPPFLAGS - gst_check_save_CXXFLAGS=$CXXFLAGS - HAVE_[$1]=no - $4 - LIBS=$gst_check_save_LIBS - LDFLAGS=$gst_check_save_LDFLAGS - CFLAGS=$gst_check_save_CFLAGS - CPPFLAGS=$gst_check_save_CPPFLAGS - CXXFLAGS=$gst_check_save_CXXFLAGS - - dnl If it isn't found, unset USE_[$1] - if test x$HAVE_[$1] = xno; then - USE_[$1]=no - fi -fi -dnl *** Warn if it's disabled or not found -if test x$USE_[$1] = xyes; then - ifelse([$6], , :, [$6]) - GST_PLUGINS_YES="$GST_PLUGINS_YES \n\t[$3]" -else - ifelse([$3], , :, [AC_MSG_NOTICE( -These plugins will not be built: [$3] -)]) - GST_PLUGINS_NO="$GST_PLUGINS_NO \n\t[$3]" - ifelse([$7], , :, [$7]) -fi -dnl *** Define the conditional as appropriate -AM_CONDITIONAL(USE_[$1], test x$USE_[$1] = xyes) -]) - -dnl Use a -config program which accepts --cflags and --libs parameters -dnl to set *_CFLAGS and *_LIBS and check existence of a feature. -dnl Richard Boulton -dnl Last modification: 26/06/2001 -dnl GST_CHECK_CONFIGPROG(FEATURE-NAME, CONFIG-PROG-FILENAME, MODULES) -dnl -dnl This check was written for GStreamer: it should be renamed and checked -dnl for portability if you decide to use it elsewhere. -dnl -AC_DEFUN(GST_CHECK_CONFIGPROG, -[ - AC_PATH_PROG([$1]_CONFIG, [$2], no) - if test x$[$1]_CONFIG = xno; then - [$1]_LIBS= - [$1]_CFLAGS= - HAVE_[$1]=no - else - [$1]_LIBS=`[$2] --libs [$3]` - [$1]_CFLAGS=`[$2] --cflags [$3]` - HAVE_[$1]=yes - fi - AC_SUBST([$1]_LIBS) - AC_SUBST([$1]_CFLAGS) -]) - -dnl Use AC_CHECK_LIB and AC_CHECK_HEADER to do both tests at once -dnl sets HAVE_module if we have it -dnl Richard Boulton -dnl Last modification: 26/06/2001 -dnl GST_CHECK_LIBHEADER(FEATURE-NAME, LIB NAME, LIB FUNCTION, EXTRA LD FLAGS, -dnl HEADER NAME, ACTION-IF-FOUND, ACTION-IF-NOT-FOUND) -dnl -dnl This check was written for GStreamer: it should be renamed and checked -dnl for portability if you decide to use it elsewhere. -dnl -AC_DEFUN(GST_CHECK_LIBHEADER, -[ - AC_CHECK_LIB([$2], [$3], HAVE_[$1]=yes, HAVE_[$1]=no,[$4]) - if test "x$HAVE_[$1]" = "xyes"; then - AC_CHECK_HEADER([$5], :, HAVE_[$1]=no) - if test "x$HAVE_[$1]" = "xyes"; then - dnl execute what needs to be - ifelse([$6], , :, [$6]) - else - ifelse([$7], , :, [$7]) - fi - else - AC_MSG_WARN([$1] not found) - fi - AC_SUBST(HAVE_[$1]) -] -) - -dnl -dnl Add a subsystem --disable flag and all the necessary symbols and substitions -dnl -dnl GST_SUBSYSTEM_DISABLE(SYSNAME, [subsystem name]) -dnl -AC_DEFUN(GST_SUBSYSTEM_DISABLE, -[AC_ARG_ENABLE(translit([$1], A-Z, a-z), -[ ]builtin(format, --disable-%-17s disable %s, translit([$1], A-Z, a-z), $2), -[ case "${enableval}" in - yes) GST_DISABLE_[$1]=no ;; - no) GST_DISABLE_[$1]=yes ;; - *) AC_MSG_ERROR(bad value ${enableval} for --enable-translit([$1], A-Z, a-z)) ;; - esac], -[GST_DISABLE_[$1]=no]) dnl Default value -if test x$GST_DISABLE_[$1] = xyes; then - AC_DEFINE(GST_DISABLE_[$1], 1, [Disable $2]) - GST_DISABLE_[$1]_DEFINE=-DGST_DISABLE_[$1] -fi -AM_CONDITIONAL(GST_DISABLE_[$1], test x$GST_DISABLE_[$1] = xyes) -AC_SUBST(GST_DISABLE_[$1]_DEFINE) -GST_SUBSYSTEM_DISABLE_DEFINES="$GST_SUBSYTEM_DISABLE_DEFINES $GST_DISABLE_[$1]_DEFINE" -]) diff --git a/gst/cothreads/m4/linuxthreads.m4 b/gst/cothreads/m4/linuxthreads.m4 deleted file mode 100644 index 7f65fac244..0000000000 --- a/gst/cothreads/m4/linuxthreads.m4 +++ /dev/null @@ -1,15 +0,0 @@ -dnl Check for LinuxThreads -dnl COTHREADS_CHECK_LINUXTHREADS -dnl no arguments -AC_DEFUN([COTHREADS_CHECK_LINUXTHREADS], [ - AC_CACHE_CHECK([for LinuxThreads], - [cothreads_cv_linuxthreads], - [AC_EGREP_CPP(pthread_kill_other_threads_np, - [#include ], - [cothreads_cv_linuxthreads=yes], - [cothreads_cv_linuxthreads=no]) - ]) - if test $cothreads_cv_linuxthreads = yes; then - AC_DEFINE(HAVE_LINUXTHREADS,1,[if you have LinuxThreads]) - fi -]) diff --git a/gst/cothreads/m4/pkg.m4 b/gst/cothreads/m4/pkg.m4 deleted file mode 100644 index 874a120cfb..0000000000 --- a/gst/cothreads/m4/pkg.m4 +++ /dev/null @@ -1,56 +0,0 @@ - -dnl PKG_CHECK_MODULES(GSTUFF, gtk+-2.0 >= 1.3 glib = 1.3.4, action-if, action-not) -dnl defines GSTUFF_LIBS, GSTUFF_CFLAGS, see pkg-config man page -dnl also defines GSTUFF_PKG_ERRORS on error -AC_DEFUN(PKG_CHECK_MODULES, [ - succeeded=no - - if test -z "$PKG_CONFIG"; then - AC_PATH_PROG(PKG_CONFIG, pkg-config, no) - fi - - if test "$PKG_CONFIG" = "no" ; then - echo "*** The pkg-config script could not be found. Make sure it is" - echo "*** in your path, or set the PKG_CONFIG environment variable" - echo "*** to the full path to pkg-config." - echo "*** Or see http://www.freedesktop.org/software/pkgconfig to get pkg-config." - else - if ! $PKG_CONFIG --atleast-pkgconfig-version 0.7.0; then - echo "*** Your version of pkg-config is too old. You need version 0.7.0 or newer." - echo "*** See http://www.freedesktop.org/software/pkgconfig" - else - AC_MSG_CHECKING(for $2) - - if $PKG_CONFIG --exists "$2" ; then - AC_MSG_RESULT(yes) - succeeded=yes - - AC_MSG_CHECKING($1_CFLAGS) - $1_CFLAGS=`$PKG_CONFIG --cflags "$2"` - AC_MSG_RESULT($$1_CFLAGS) - - AC_MSG_CHECKING($1_LIBS) - $1_LIBS=`$PKG_CONFIG --libs "$2"` - AC_MSG_RESULT($$1_LIBS) - else - $1_CFLAGS="" - $1_LIBS="" - ## If we have a custom action on failure, don't print errors, but - ## do set a variable so people can do so. - $1_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"` - ifelse([$4], ,echo $$1_PKG_ERRORS,) - fi - - AC_SUBST($1_CFLAGS) - AC_SUBST($1_LIBS) - fi - fi - - if test $succeeded = yes; then - ifelse([$3], , :, [$3]) - else - ifelse([$4], , AC_MSG_ERROR([Library requirements ($2) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them.]), [$4]) - fi -]) - - diff --git a/gst/cothreads/m4/pth-acinclude.m4 b/gst/cothreads/m4/pth-acinclude.m4 deleted file mode 100644 index ad0f6ed4a7..0000000000 --- a/gst/cothreads/m4/pth-acinclude.m4 +++ /dev/null @@ -1,1765 +0,0 @@ -dnl ## -dnl ## NGPT - Next Generation POSIX Threading -dnl ## Copyright (c) 2001 IBM Corporation -dnl ## Copyright (c) 1999-2000 Ralf S. Engelschall -dnl ## -dnl ## This file is part of NGPT, a non-preemptive thread scheduling -dnl ## library which can be found at http://www.ibm.com/developer -dnl ## -dnl ## This library is free software; you can redistribute it and/or -dnl ## modify it under the terms of the GNU Lesser General Public -dnl ## License as published by the Free Software Foundation; either -dnl ## version 2.1 of the License, or (at your option) any later version. -dnl ## -dnl ## This library is distributed in the hope that it will be useful, -dnl ## but WITHOUT ANY WARRANTY; without even the implied warranty of -dnl ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -dnl ## Lesser General Public License for more details. -dnl ## -dnl ## You should have received a copy of the GNU Lesser General Public -dnl ## License along with this library; if not, write to the Free Software -dnl ## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 -dnl ## USA, or contact Bill Abt -dnl ## -dnl ## aclocal.m4: Pth Autoconf macros -dnl ## - dnl # ``"Reuse an expert's code" is the right - dnl # advice for most people. But it's a useless - dnl # advice for the experts writing the code - dnl # in the first place.' - dnl # -- Dan J. Bernstein - -dnl ## -dnl ## Display Configuration Headers -dnl ## -dnl ## configure.in: -dnl ## AC_MSG_PART() -dnl ## - -define(AC_MSG_PART,[dnl -if test ".$enable_subdir" != .yes; then - AC_MSG_RESULT() - AC_MSG_RESULT(${TB}$1:${TN}) -fi -])dnl - -dnl ## -dnl ## Display a message under --verbose -dnl ## -dnl ## configure.in: -dnl ## AC_MSG_VERBOSE() -dnl ## - -define(AC_MSG_VERBOSE,[dnl -if test ".$verbose" = .yes; then - AC_MSG_RESULT([ $1]) -fi -]) - -dnl ## -dnl ## Do not display message for a command -dnl ## -dnl ## configure.in: -dnl ## AC_MSG_SILENT(...) -dnl ## - -define(AC_FD_TMP, 9) -define(AC_MSG_SILENT,[dnl -exec AC_FD_TMP>&AC_FD_MSG AC_FD_MSG>/dev/null -$1 -exec AC_FD_MSG>&AC_FD_TMP AC_FD_TMP>&- -]) - -dnl ## -dnl ## Perform something only once -dnl ## -dnl ## configure.in: -dnl ## AC_ONCE() -dnl ## - -define(AC_ONCE,[ -ifelse(ac_once_$1, already_done, ,[ - define(ac_once_$1, already_done) - $2 -])dnl -]) - -dnl ## -dnl ## Support for $(S) -dnl ## -dnl ## configure.in: -dnl ## AC_SRCDIR_PREFIX() -dnl ## - -AC_DEFUN(AC_SRCDIR_PREFIX,[ -ac_prog=[$]0 -changequote(, )dnl -ac_srcdir=`echo $ac_prog | sed -e 's%/[^/][^/]*$%%' -e 's%\([^/]\)/*$%\1%'` -changequote([, ])dnl -if test ".$ac_srcdir" = ".$ac_prog"; then - ac_srcdir="" -elif test "x$ac_srcdir" = "x."; then - ac_srcdir="" -else - if test ".$CFLAGS" = .; then - CFLAGS="-I$ac_srcdir" - else - CFLAGS="$CFLAGS -I$ac_srcdir" - fi - ac_srcdir="$ac_srcdir/" -fi -$1="$ac_srcdir" -AC_SUBST($1) -])dnl - -dnl ## -dnl ## Support for --enable-subdir (for use with pth.m4) -dnl ## -dnl ## configure.in: -dnl ## AC_ENABLESUBDIR -dnl ## - -AC_DEFUN(AC_ENABLESUBDIR,[ -AC_ARG_ENABLE(subdir,dnl -[ --enable-subdir enable local building as subdirectory (default=no)],[dnl -],[dnl -enable_subdir=no -])dnl -if test ".$enable_subdir" = .yes; then - enable_batch=yes - enable_shared=no -fi -])dnl - -dnl ## -dnl ## Support for Configuration Headers -dnl ## -dnl ## configure.in: -dnl ## AC_HEADLINE(, , -dnl ## , , -dnl ## ) -dnl ## - -AC_DEFUN(AC_HEADLINE,[dnl -AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)dnl -# configuration header -if test ".`echo dummy [$]@ | grep enable-subdir`" != .; then - enable_subdir=yes -fi -if test ".`echo dummy [$]@ | grep help`" = .; then - # bootstrapping shtool - ac_prog=[$]0 -changequote(, )dnl - ac_srcdir=`echo $ac_prog | sed -e 's%/[^/][^/]*$%%' -e 's%\([^/]\)/*$%\1%'` -changequote([, ])dnl - test ".$ac_srcdir" = ".$ac_prog" && ac_srcdir=. - ac_shtool="${CONFIG_SHELL-/bin/sh} $ac_srcdir/shtool" - - # find out terminal sequences - if test ".$enable_subdir" != .yes; then - TB=`$ac_shtool echo -n -e %B 2>/dev/null` - TN=`$ac_shtool echo -n -e %b 2>/dev/null` - else - TB='' - TN='' - fi - - # find out package version - $3_STR="`$ac_shtool version -lc -dlong $ac_srcdir/$4`" - AC_SUBST($3_STR) - - # friendly header ;) - if test ".$enable_subdir" != .yes; then - echo "Configuring ${TB}$1${TN} ($2), Version ${TB}${$3_STR}${TN}" - echo "$5" - fi - - # additionally find out hex version - $3_HEX="`$ac_shtool version -lc -dhex $ac_srcdir/$4`" - AC_SUBST($3_HEX) -fi -AC_DIVERT_POP() -])dnl - -dnl ## -dnl ## Support for Platform IDs -dnl ## -dnl ## configure.in: -dnl ## AC_PLATFORM() -dnl ## - -AC_DEFUN(AC_PLATFORM,[ -if test ".$host" != .NONE; then - $1="$host" -elif test ".$nonopt" != .NONE; then - $1="$nonopt" -else - $1=`${CONFIG_SHELL-/bin/sh} $srcdir/config.guess` -fi -$1=`${CONFIG_SHELL-/bin/sh} $srcdir/config.sub $$1` || exit 1 -AC_SUBST($1) -if test ".$enable_subdir" != .yes; then - echo "Platform: ${TB}${$1}${TN}" -fi -])dnl - -dnl ## -dnl ## Support for config.param files -dnl ## -dnl ## configure.in: -dnl ## AC_CONFIG_PARAM() -dnl ## - -AC_DEFUN(AC_CONFIG_PARAM,[ -AC_DIVERT_PUSH(-1) -AC_ARG_WITH(param,[ --with-param=ID[,ID,..] load parameters from $1]) -AC_DIVERT_POP() -AC_DIVERT_PUSH(AC_DIVERSION_NOTICE) -ac_prev="" -ac_param="" -if test -f $1; then - ac_param="$1:common" -fi -for ac_option -do - if test ".$ac_prev" != .; then - eval "$ac_prev=\$ac_option" - ac_prev="" - continue - fi - case "$ac_option" in - -*=*) ac_optarg=`echo "$ac_option" | sed 's/[[-_a-zA-Z0-9]]*=//'` ;; - *) ac_optarg="" ;; - esac - case "$ac_option" in - --with-param=* ) - case $ac_optarg in - *:* ) - ac_from=`echo $ac_optarg | sed -e 's/:.*//'` - ac_what=`echo $ac_optarg | sed -e 's/.*://'` - ;; - * ) - ac_from="$1" - ac_what="$ac_optarg" - ;; - esac - if test ".$ac_param" = .; then - ac_param="$ac_from:$ac_what" - else - ac_param="$ac_param,$ac_from:$ac_what" - fi - ;; - esac -done -if test ".$ac_param" != .; then - # echo "loading parameters" - OIFS="$IFS" - IFS="," - pconf="/tmp/autoconf.$$" - echo "ac_options=''" >$pconf - ac_from="$1" - for ac_section in $ac_param; do - changequote(, ) - case $ac_section in - *:* ) - ac_from=`echo "$ac_section" | sed -e 's/:.*//'` - ac_section=`echo "$ac_section" | sed -e 's/.*://'` - ;; - esac - (echo ''; cat $ac_from; echo '') |\ - sed -e "1,/[ ]*[ ]*${ac_section}[ ]*{[ ]*/d" \ - -e '/[ ]*}[ ]*/,$d' \ - -e ':join' -e '/\\[ ]*$/N' -e 's/\\[ ]*\n[ ]*//' -e 'tjoin' \ - -e 's/^[ ]*//g' \ - -e 's/^\([^-].*=.*\) IF \(.*\)$/if \2; then \1; fi/' \ - -e 's/^\(--.*=.*\) IF \(.*\)$/if \2; then ac_options="$ac_options \1"; fi/' \ - -e 's/^\(--.*\) IF \(.*\)$/if \2; then ac_options="$ac_options \1"; fi/' \ - -e 's/^\(--.*=.*\)$/ac_options="$ac_options \1"/' \ - -e 's/^\(--.*\)$/ac_options="$ac_options \1"/' \ - >>$pconf - changequote([, ]) - done - IFS="$OIFS" - . $pconf - rm -f $pconf >/dev/null 2>&1 - if test ".[$]*" = .; then - set -- $ac_options - else - set -- "[$]@" $ac_options - fi -fi -AC_DIVERT_POP() -])dnl - -dnl ## -dnl ## Check whether compiler option works -dnl ## -dnl ## configure.in: -dnl ## AC_COMPILER_OPTION(, ,