Add empty project for apco_p25_decode block.

git-svn-id: http://op25.osmocom.org/svn/trunk@62 65a5c917-d112-43f1-993d-58c26a4786be
This commit is contained in:
stevie 2008-05-16 10:14:58 +00:00
parent 0eaa4870c9
commit ceb3382ebc
52 changed files with 7283 additions and 0 deletions

1
decoder/AUTHORS Normal file
View File

@ -0,0 +1 @@
Steve Glass <stevie@sedition.org.au>

674
decoder/COPYING Normal file
View File

@ -0,0 +1,674 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. 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
them 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 prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. 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.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey 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;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If 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 convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU 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 that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
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.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
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.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
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
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
<program> Copyright (C) <year> <name of author>
This program 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, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<http://www.gnu.org/licenses/>.
The GNU 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. But first, please read
<http://www.gnu.org/philosophy/why-not-lgpl.html>.

23
decoder/ChangeLog Normal file
View File

@ -0,0 +1,23 @@
#
# Copyright 2008 Steve Glass
#
# This file is part of OP25
#
# OP25 is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your option)
# any later version.
#
# OP25 is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
# License for more details.
#
# You should have received a copy of the GNU General Public License
# along with OP25; see the file COPYING. If not, write to the Free
# Software Foundation, Inc., 51 Franklin Street, Boston, MA
# 02110-1301, USA.
For the complete project change log, please see
http://www.sedition.org.au/op25/timeline

234
decoder/INSTALL Normal file
View File

@ -0,0 +1,234 @@
Installation Instructions
*************************
Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005,
2006 Free Software Foundation, Inc.
This file is free documentation; the Free Software Foundation gives
unlimited permission to copy, distribute and modify it.
Basic Installation
==================
The commands `./bootstrap; ./configure; make; make install' should
configure, build, and install this package. The following
more-detailed instructions are generic; see the `README' file for
instructions specific to this package.
The `configure' shell script attempts to guess correct values for
various system-dependent variables used during compilation. It uses
those values to create a `Makefile' in each directory of the package.
It may also create one or more `.h' files containing system-dependent
definitions. Finally, it creates a shell script `config.status' that
you can run in the future to recreate the current configuration, and a
file `config.log' containing compiler output (useful mainly for
debugging `configure').
It can also use an optional file (typically called `config.cache'
and enabled with `--cache-file=config.cache' or simply `-C') that saves
the results of its tests to speed up reconfiguring. Caching is
disabled by default to prevent problems with accidental use of stale
cache files.
If you need to do unusual things to compile the package, please try
to figure out how `configure' could check whether to do them, and mail
diffs or instructions to the address given in the `README' so they can
be considered for the next release. If you are using the cache, and at
some point `config.cache' contains results you don't want to keep, you
may remove or edit it.
The file `configure.ac' (or `configure.in') is used to create
`configure' by a program called `autoconf'. You need `configure.ac' if
you want to change it or regenerate `configure' using a newer version
of `autoconf'.
The simplest way to compile this package is:
1. `cd' to the directory containing the package's source code and type
`./configure' to configure the package for your system.
Running `configure' might take a while. While running, it prints
some messages telling which features it is checking for.
2. Type `make' to compile the package.
3. Optionally, type `make check' to run any self-tests that come with
the package.
4. Type `make install' to install the programs and any data files and
documentation.
5. You can remove the program binaries and object files from the
source code directory by typing `make clean'. To also remove the
files that `configure' created (so you can compile the package for
a different kind of computer), type `make distclean'. There is
also a `make maintainer-clean' target, but that is intended mainly
for the package's developers. If you use it, you may have to get
all sorts of other programs in order to regenerate files that came
with the distribution.
Compilers and Options
=====================
Some systems require unusual options for compilation or linking that the
`configure' script does not know about. Run `./configure --help' for
details on some of the pertinent environment variables.
You can give `configure' initial values for configuration parameters
by setting variables in the command line or in the environment. Here
is an example:
./configure CC=c99 CFLAGS=-g LIBS=-lposix
*Note Defining Variables::, for more details.
Compiling For Multiple Architectures
====================================
You can compile the package for more than one kind of computer at the
same time, by placing the object files for each architecture in their
own directory. To do this, you can use GNU `make'. `cd' to the
directory where you want the object files and executables to go and run
the `configure' script. `configure' automatically checks for the
source code in the directory that `configure' is in and in `..'.
With a non-GNU `make', it is safer to compile the package for one
architecture at a time in the source code directory. After you have
installed the package for one architecture, use `make distclean' before
reconfiguring for another architecture.
Installation Names
==================
By default, `make install' installs the package's commands under
`/usr/local/bin', include files under `/usr/local/include', etc. You
can specify an installation prefix other than `/usr/local' by giving
`configure' the option `--prefix=PREFIX'.
You can specify separate installation prefixes for
architecture-specific files and architecture-independent files. If you
pass the option `--exec-prefix=PREFIX' to `configure', the package uses
PREFIX as the prefix for installing programs and libraries.
Documentation and other data files still use the regular prefix.
In addition, if you use an unusual directory layout you can give
options like `--bindir=DIR' to specify different values for particular
kinds of files. Run `configure --help' for a list of the directories
you can set and what kinds of files go in them.
If the package supports it, you can cause programs to be installed
with an extra prefix or suffix on their names by giving `configure' the
option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
Optional Features
=================
Some packages pay attention to `--enable-FEATURE' options to
`configure', where FEATURE indicates an optional part of the package.
They may also pay attention to `--with-PACKAGE' options, where PACKAGE
is something like `gnu-as' or `x' (for the X Window System). The
`README' should mention any `--enable-' and `--with-' options that the
package recognizes.
For packages that use the X Window System, `configure' can usually
find the X include and library files automatically, but if it doesn't,
you can use the `configure' options `--x-includes=DIR' and
`--x-libraries=DIR' to specify their locations.
Specifying the System Type
==========================
There may be some features `configure' cannot figure out automatically,
but needs to determine by the type of machine the package will run on.
Usually, assuming the package is built to be run on the _same_
architectures, `configure' can figure that out, but if it prints a
message saying it cannot guess the machine type, give it the
`--build=TYPE' option. TYPE can either be a short name for the system
type, such as `sun4', or a canonical name which has the form:
CPU-COMPANY-SYSTEM
where SYSTEM can have one of these forms:
OS KERNEL-OS
See the file `config.sub' for the possible values of each field. If
`config.sub' isn't included in this package, then this package doesn't
need to know the machine type.
If you are _building_ compiler tools for cross-compiling, you should
use the option `--target=TYPE' to select the type of system they will
produce code for.
If you want to _use_ a cross compiler, that generates code for a
platform different from the build platform, you should specify the
"host" platform (i.e., that on which the generated programs will
eventually be run) with `--host=TYPE'.
Sharing Defaults
================
If you want to set default values for `configure' scripts to share, you
can create a site shell script called `config.site' that gives default
values for variables like `CC', `cache_file', and `prefix'.
`configure' looks for `PREFIX/share/config.site' if it exists, then
`PREFIX/etc/config.site' if it exists. Or, you can set the
`CONFIG_SITE' environment variable to the location of the site script.
A warning: not all `configure' scripts look for a site script.
Defining Variables
==================
Variables not defined in a site shell script can be set in the
environment passed to `configure'. However, some packages may run
configure again during the build, and the customized values of these
variables may be lost. In order to avoid this problem, you should set
them in the `configure' command line, using `VAR=value'. For example:
./configure CC=/usr/local2/bin/gcc
causes the specified `gcc' to be used as the C compiler (unless it is
overridden in the site shell script).
Unfortunately, this technique does not work for `CONFIG_SHELL' due to
an Autoconf bug. Until the bug is fixed you can use this workaround:
CONFIG_SHELL=/bin/bash /bin/bash ./configure CONFIG_SHELL=/bin/bash
`configure' Invocation
======================
`configure' recognizes the following options to control how it operates.
`--help'
`-h'
Print a summary of the options to `configure', and exit.
`--version'
`-V'
Print the version of Autoconf used to generate the `configure'
script, and exit.
`--cache-file=FILE'
Enable the cache: use and save the results of the tests in FILE,
traditionally `config.cache'. FILE defaults to `/dev/null' to
disable caching.
`--config-cache'
`-C'
Alias for `--cache-file=config.cache'.
`--quiet'
`--silent'
`-q'
Do not print messages saying which checks are being made. To
suppress all normal output, redirect it to `/dev/null' (any error
messages will still be shown).
`--srcdir=DIR'
Look for the package's source code in directory DIR. Usually
`configure' can determine that directory automatically.
`configure' also accepts some other, not widely useful, options. Run
`configure --help' for more details.

29
decoder/Makefile.am Normal file
View File

@ -0,0 +1,29 @@
#
# Copyright 2004 Free Software Foundation, Inc.
#
# This file is part of OP25
#
# OP25 is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your option)
# any later version.
#
# OP25 is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with OP25; see the file COPYING. If not, write to
# the Free Software Foundation, Inc., 51 Franklin Street,
# Boston, MA 02110-1301, USA.
#
include $(top_srcdir)/Makefile.common
EXTRA_DIST = configure config.h.in
SUBDIRS = config src
DIST_SUBDIRS = config src
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA =

43
decoder/Makefile.common Normal file
View File

@ -0,0 +1,43 @@
# -*- Makefile -*-
#
# Copyright 2004,2006 Free Software Foundation, Inc.
#
# This file is part of OP25
#
# OP25 is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your option)
# any later version.
#
# OP25 is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
# License for more details.
#
# You should have received a copy of the GNU General Public License
# along with OP25; see the file COPYING. If not, write to the Free
# Software Foundation, Inc., 51 Franklin Street, Boston, MA
# 02110-1301, USA.
#
# includes
grincludedir = $(includedir)/gnuradio
# swig includes
swigincludedir = $(grincludedir)/swig
# Install this stuff in the appropriate subdirectory
# This usually ends up at:
# ${prefix}/lib/python${python_version}/site-packages/gnuradio
grpythondir = $(pythondir)/gnuradio
grpyexecdir = $(pyexecdir)/gnuradio
# swig flags
SWIGPYTHONFLAGS = -fvirtual -python -modern
SWIGGRFLAGS = -I$(GNURADIO_CORE_INCLUDEDIR)/swig -I$(GNURADIO_CORE_INCLUDEDIR)
# Don't assume that make predefines $(RM), because BSD make does
# not. We define it now in configure.ac using AM_PATH_PROG, but now
# here have to add a -f to be like GNU make.
RM=$(RM_PROG) -f

0
decoder/NEWS Normal file
View File

41
decoder/README Normal file
View File

@ -0,0 +1,41 @@
#
# Copyright 2008 Steve Glass
#
# This file is part of OP25.
#
# OP25 is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your option)
# any later version.
#
# OP25 is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
# License for more details.
#
# You should have received a copy of the GNU General Public License
# along with OP25; see the file COPYING. If not, write to the Free
# Software Foundation, Inc., 51 Franklin Street, Boston, MA
# 02110-1301, USA.
This contains the APCO P25 decoder block for GNU Radio and is derived
from the GNU Radio how-to-write-a-block example. This is only part of
the software - you should visit the project website is at
http://www.sedition.org.au/op25 for more information.
This package requires that gnuradio-core is already installed. It also
depends on some GNU Radio prerequisites, such as boost and a suitable
GNU Radio extension to demodulate C4FM. We suggest you use the 4FSK
demodulator from
http://radiorausch.googlepages.com/GnuradioFourLevelFSK.html.
To build the OP25 decoder you need to use the following commands.
$ ./bootstrap
$ ./configure
$ make
$ make check
Once you've done this you'll need to install
$ sudo make install

29
decoder/bootstrap Executable file
View File

@ -0,0 +1,29 @@
#!/bin/sh
# Copyright 2001,2005 Free Software Foundation, Inc.
#
# This file is part of OP25
#
# OP25 is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your option)
# any later version.
#
# OP25 is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
# License for more details.
#
# You should have received a copy of the GNU General Public License
# along with OP25; see the file COPYING. If not, write to the Free
# Software Foundation, Inc., 51 Franklin Street, Boston, MA
# 02110-1301, USA.
rm -fr config.cache autom4te*.cache
aclocal -I config
autoconf
autoheader
libtoolize --automake
automake --add-missing -c -f

1526
decoder/config.guess vendored Normal file

File diff suppressed because it is too large Load Diff

1658
decoder/config.sub vendored Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,65 @@
#
# Copyright 2001 Free Software Foundation, Inc.
#
# This file is part of OP25
#
# OP25 is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your option)
# any later version.
#
# OP25 is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
# License for more details.
#
# You should have received a copy of the GNU General Public License
# along with OP25; see the file COPYING. If not, write to the Free
# Software Foundation, Inc., 51 Franklin Street, Boston, MA
# 02110-1301, USA.
#
include $(top_srcdir)/Makefile.common
# Install m4 macros in this directory
m4datadir = $(datadir)/aclocal
# List your m4 macros here
m4macros = \
acx_pthread.m4 \
bnv_have_qt.m4 \
cppunit.m4 \
gr_boost.m4 \
gr_check_createfilemapping.m4 \
gr_check_usrp.m4 \
gr_check_mc4020.m4 \
gr_check_shm_open.m4 \
gr_doxygen.m4 \
gr_gprof.m4 \
gr_libgnuradio_core_extra_ldflags.m4 \
gr_no_undefined.m4 \
gr_omnithread.m4 \
gr_pwin32.m4 \
gr_python.m4 \
gr_require_mc4020.m4 \
gr_scripting.m4 \
gr_set_md_cpu.m4 \
gr_swig.m4 \
gr_sysv_shm.m4 \
gr_x86_64.m4 \
lf_cc.m4 \
lf_cxx.m4 \
lf_warnings.m4 \
lf_x11.m4 \
mkstemp.m4 \
onceonly.m4 \
pkg.m4 \
usrp_fusb_tech.m4 \
usrp_libusb.m4 \
usrp_sdcc.m4
# Don't install m4 macros anymore
# m4data_DATA = $(m4macros)
EXTRA_DIST = $(m4macros)

View File

@ -0,0 +1,190 @@
dnl Available from the GNU Autoconf Macro Archive at:
dnl http://www.gnu.org/software/ac-archive/htmldoc/acx_pthread.html
dnl
AC_DEFUN([ACX_PTHREAD], [
AC_REQUIRE([AC_CANONICAL_HOST])
AC_LANG_SAVE
AC_LANG_C
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"
AC_MSG_CHECKING([for pthread_join in LIBS=$PTHREAD_LIBS with CFLAGS=$PTHREAD_CFLAGS])
AC_TRY_LINK_FUNC(pthread_join, acx_pthread_ok=yes)
AC_MSG_RESULT($acx_pthread_ok)
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.
acx_pthread_flags="pthreads none -Kthread -kthread lthread -pthread -pthreads -mthreads pthread --thread-safe -mt"
# 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)
# pthread: Linux, etcetera
# --thread-safe: KAI C++
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 -pthread or
# -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="-pthread -pthreads pthread -mt $acx_pthread_flags"
;;
esac
if test x"$acx_pthread_ok" = xno; then
for flag in $acx_pthread_flags; do
case $flag in
none)
AC_MSG_CHECKING([whether pthreads work without any flags])
;;
-*)
AC_MSG_CHECKING([whether pthreads work with $flag])
PTHREAD_CFLAGS="$flag"
;;
*)
AC_MSG_CHECKING([for the pthreads library -l$flag])
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.
AC_TRY_LINK([#include <pthread.h>],
[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); ],
[acx_pthread_ok=yes])
LIBS="$save_LIBS"
CFLAGS="$save_CFLAGS"
AC_MSG_RESULT($acx_pthread_ok)
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: threads are created detached by default
# and the JOINABLE attribute has a nonstandard name (UNDETACHED).
AC_MSG_CHECKING([for joinable pthread attribute])
AC_TRY_LINK([#include <pthread.h>],
[int attr=PTHREAD_CREATE_JOINABLE;],
ok=PTHREAD_CREATE_JOINABLE, ok=unknown)
if test x"$ok" = xunknown; then
AC_TRY_LINK([#include <pthread.h>],
[int attr=PTHREAD_CREATE_UNDETACHED;],
ok=PTHREAD_CREATE_UNDETACHED, ok=unknown)
fi
if test x"$ok" != xPTHREAD_CREATE_JOINABLE; then
AC_DEFINE(PTHREAD_CREATE_JOINABLE, $ok,
[Define to the necessary symbol if this constant
uses a non-standard name on your system.])
fi
AC_MSG_RESULT(${ok})
if test x"$ok" = xunknown; then
AC_MSG_WARN([we do not know how to create joinable pthreads])
fi
AC_MSG_CHECKING([if more special flags are required for pthreads])
flag=no
case "${host_cpu}-${host_os}" in
*-aix* | *-freebsd*) flag="-D_THREAD_SAFE";;
*solaris* | *-osf* | *-hpux*) flag="-D_REENTRANT";;
esac
AC_MSG_RESULT(${flag})
if test "x$flag" != xno; then
PTHREAD_CFLAGS="$flag $PTHREAD_CFLAGS"
fi
LIBS="$save_LIBS"
CFLAGS="$save_CFLAGS"
# More AIX lossage: must compile with cc_r
AC_CHECK_PROG(PTHREAD_CC, cc_r, cc_r, ${CC})
else
PTHREAD_CC="$CC"
fi
AC_SUBST(PTHREAD_LIBS)
AC_SUBST(PTHREAD_CFLAGS)
AC_SUBST(PTHREAD_CC)
# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND:
if test x"$acx_pthread_ok" = xyes; then
ifelse([$1],,AC_DEFINE(HAVE_PTHREAD,1,[Define if you have POSIX threads libraries and header files.]),[$1])
:
else
acx_pthread_ok=no
$2
fi
AC_LANG_RESTORE
])dnl ACX_PTHREAD

View File

@ -0,0 +1,404 @@
dnl Available from the GNU Autoconf Macro Archive at:
dnl http://www.gnu.org/software/ac-archive/htmldoc/bnv_have_qt.html
dnl
AC_DEFUN([BNV_HAVE_QT],
[
dnl THANKS! This code includes bug fixes by:
dnl Tim McClarren.
AC_REQUIRE([AC_PROG_CXX])
AC_REQUIRE([AC_PATH_X])
AC_REQUIRE([AC_PATH_XTRA])
AC_MSG_CHECKING(for Qt)
AC_ARG_WITH([Qt-dir],
[ --with-Qt-dir=DIR DIR is equal to \$QTDIR if you have followed the
installation instructions of Trolltech. Header
files are in DIR/include, binary utilities are
in DIR/bin and the library is in DIR/lib])
AC_ARG_WITH([Qt-include-dir],
[ --with-Qt-include-dir=DIR
Qt header files are in DIR])
AC_ARG_WITH([Qt-bin-dir],
[ --with-Qt-bin-dir=DIR Qt utilities such as moc and uic are in DIR])
AC_ARG_WITH([Qt-lib-dir],
[ --with-Qt-lib-dir=DIR The Qt library is in DIR])
AC_ARG_WITH([Qt-lib],
[ --with-Qt-lib=LIB Use -lLIB to link with the Qt library])
if test x"$with_Qt_dir" = x"no" ||
test x"$with_Qt_include-dir" = x"no" ||
test x"$with_Qt_bin_dir" = x"no" ||
test x"$with_Qt_lib_dir" = x"no" ||
test x"$with_Qt_lib" = x"no"; then
# user disabled Qt. Leave cache alone.
have_qt="User disabled Qt."
else
# "yes" is a bogus option
if test x"$with_Qt_dir" = xyes; then
with_Qt_dir=
fi
if test x"$with_Qt_include_dir" = xyes; then
with_Qt_include_dir=
fi
if test x"$with_Qt_bin_dir" = xyes; then
with_Qt_bin_dir=
fi
if test x"$with_Qt_lib_dir" = xyes; then
with_Qt_lib_dir=
fi
if test x"$with_Qt_lib" = xyes; then
with_Qt_lib=
fi
# No Qt unless we discover otherwise
have_qt=no
# Check whether we are requested to link with a specific version
if test x"$with_Qt_lib" != x; then
bnv_qt_lib="$with_Qt_lib"
fi
# Check whether we were supplied with an answer already
if test x"$with_Qt_dir" != x; then
have_qt=yes
bnv_qt_dir="$with_Qt_dir"
bnv_qt_include_dir="$with_Qt_dir/include"
bnv_qt_bin_dir="$with_Qt_dir/bin"
bnv_qt_lib_dir="$with_Qt_dir/lib"
# Only search for the lib if the user did not define one already
if test x"$bnv_qt_lib" = x; then
bnv_qt_lib="`ls $bnv_qt_lib_dir/libqt* | sed -n 1p |
sed s@$bnv_qt_lib_dir/lib@@ | [sed s@[.].*@@]`"
fi
bnv_qt_LIBS="-L$bnv_qt_lib_dir -l$bnv_qt_lib $X_PRE_LIBS $X_LIBS -lX11 -lXext -lXmu -lXt -lXi $X_EXTRA_LIBS"
else
# Use cached value or do search, starting with suggestions from
# the command line
AC_CACHE_VAL(bnv_cv_have_qt,
[
# We are not given a solution and there is no cached value.
bnv_qt_dir=NO
bnv_qt_include_dir=NO
bnv_qt_lib_dir=NO
if test x"$bnv_qt_lib" = x; then
bnv_qt_lib=NO
fi
BNV_PATH_QT_DIRECT
if test "$bnv_qt_dir" = NO ||
test "$bnv_qt_include_dir" = NO ||
test "$bnv_qt_lib_dir" = NO ||
test "$bnv_qt_lib" = NO; then
# Problem with finding complete Qt. Cache the known absence of Qt.
bnv_cv_have_qt="have_qt=no"
else
# Record where we found Qt for the cache.
bnv_cv_have_qt="have_qt=yes \
bnv_qt_dir=$bnv_qt_dir \
bnv_qt_include_dir=$bnv_qt_include_dir \
bnv_qt_bin_dir=$bnv_qt_bin_dir \
bnv_qt_LIBS=\"$bnv_qt_LIBS\""
fi
])dnl
eval "$bnv_cv_have_qt"
fi # all $bnv_qt_* are set
fi # $have_qt reflects the system status
if test x"$have_qt" = xyes; then
QT_CXXFLAGS="-I$bnv_qt_include_dir"
QT_DIR="$bnv_qt_dir"
QT_LIBS="$bnv_qt_LIBS"
# If bnv_qt_dir is defined, utilities are expected to be in the
# bin subdirectory
if test x"$bnv_qt_dir" != x; then
if test -x "$bnv_qt_dir/bin/uic"; then
QT_UIC="$bnv_qt_dir/bin/uic"
else
# Old versions of Qt don't have uic
QT_UIC=
fi
QT_MOC="$bnv_qt_dir/bin/moc"
else
# Or maybe we are told where to look for the utilities
if test x"$bnv_qt_bin_dir" != x; then
if test -x "$bnv_qt_bin_dir/uic"; then
QT_UIC="$bnv_qt_bin_dir/uic"
else
# Old versions of Qt don't have uic
QT_UIC=
fi
QT_MOC="$bnv_qt_bin_dir/moc"
else
# Last possibility is that they are in $PATH
QT_UIC="`which uic`"
QT_MOC="`which moc`"
fi
fi
# All variables are defined, report the result
AC_MSG_RESULT([$have_qt:
QT_CXXFLAGS=$QT_CXXFLAGS
QT_DIR=$QT_DIR
QT_LIBS=$QT_LIBS
QT_UIC=$QT_UIC
QT_MOC=$QT_MOC])
else
# Qt was not found
QT_CXXFLAGS=
QT_DIR=
QT_LIBS=
QT_UIC=
QT_MOC=
AC_MSG_RESULT($have_qt)
fi
AC_SUBST(QT_CXXFLAGS)
AC_SUBST(QT_DIR)
AC_SUBST(QT_LIBS)
AC_SUBST(QT_UIC)
AC_SUBST(QT_MOC)
#### Being paranoid:
if test x"$have_qt" = xyes; then
AC_MSG_CHECKING(correct functioning of Qt installation)
AC_CACHE_VAL(bnv_cv_qt_test_result,
[
cat > bnv_qt_test.h << EOF
#include <qobject.h>
class Test : public QObject
{
Q_OBJECT
public:
Test() {}
~Test() {}
public slots:
void receive() {}
signals:
void send();
};
EOF
cat > bnv_qt_main.$ac_ext << EOF
#include "bnv_qt_test.h"
#include <qapplication.h>
int main( int argc, char **argv )
{
QApplication app( argc, argv );
Test t;
QObject::connect( &t, SIGNAL(send()), &t, SLOT(receive()) );
}
EOF
bnv_cv_qt_test_result="failure"
bnv_try_1="$QT_MOC bnv_qt_test.h -o moc_bnv_qt_test.$ac_ext >/dev/null 2>bnv_qt_test_1.out"
AC_TRY_EVAL(bnv_try_1)
bnv_err_1=`grep -v '^ *+' bnv_qt_test_1.out | grep -v "^bnv_qt_test.h\$"`
if test x"$bnv_err_1" != x; then
echo "$bnv_err_1" >&AC_FD_CC
echo "configure: could not run $QT_MOC on:" >&AC_FD_CC
cat bnv_qt_test.h >&AC_FD_CC
else
bnv_try_2="$CXX $QT_CXXFLAGS -c $CXXFLAGS -o moc_bnv_qt_test.o moc_bnv_qt_test.$ac_ext >/dev/null 2>bnv_qt_test_2.out"
AC_TRY_EVAL(bnv_try_2)
bnv_err_2=`grep -v '^ *+' bnv_qt_test_2.out | grep -v "^bnv_qt_test.{$ac_ext}\$"`
if test x"$bnv_err_2" != x; then
echo "$bnv_err_2" >&AC_FD_CC
echo "configure: could not compile:" >&AC_FD_CC
cat bnv_qt_test.$ac_ext >&AC_FD_CC
else
bnv_try_3="$CXX $QT_CXXFLAGS -c $CXXFLAGS -o bnv_qt_main.o bnv_qt_main.$ac_ext >/dev/null 2>bnv_qt_test_3.out"
AC_TRY_EVAL(bnv_try_3)
bnv_err_3=`grep -v '^ *+' bnv_qt_test_3.out | grep -v "^bnv_qt_main.{$ac_ext}\$"`
if test x"$bnv_err_3" != x; then
echo "$bnv_err_3" >&AC_FD_CC
echo "configure: could not compile:" >&AC_FD_CC
cat bnv_qt_main.$ac_ext >&AC_FD_CC
else
bnv_try_4="$CXX $QT_LIBS $LIBS -o bnv_qt_main bnv_qt_main.o moc_bnv_qt_test.o >/dev/null 2>bnv_qt_test_4.out"
AC_TRY_EVAL(bnv_try_4)
bnv_err_4=`grep -v '^ *+' bnv_qt_test_4.out`
if test x"$bnv_err_4" != x; then
echo "$bnv_err_4" >&AC_FD_CC
else
bnv_cv_qt_test_result="success"
fi
fi
fi
fi
])dnl AC_CACHE_VAL bnv_cv_qt_test_result
AC_MSG_RESULT([$bnv_cv_qt_test_result]);
if test x"$bnv_cv_qt_test_result" = "xfailure"; then
# working Qt was not found
QT_CXXFLAGS=
QT_DIR=
QT_LIBS=
QT_UIC=
QT_MOC=
have_qt=no
AC_MSG_WARN([Failed to find matching components of a complete
Qt installation. Try using more options,
see ./configure --help.])
fi
rm -f bnv_qt_test.h moc_bnv_qt_test.$ac_ext moc_bnv_qt_test.o \
bnv_qt_main.$ac_ext bnv_qt_main.o bnv_qt_main \
bnv_qt_test_1.out bnv_qt_test_2.out bnv_qt_test_3.out bnv_qt_test_4.out
fi
])
dnl Internal subroutine of BNV_HAVE_QT
dnl Set bnv_qt_dir bnv_qt_include_dir bnv_qt_bin_dir bnv_qt_lib_dir bnv_qt_lib
dnl Copyright 2001 Bastiaan N. Veelo <Bastiaan.N.Veelo@immtek.ntnu.no>
AC_DEFUN([BNV_PATH_QT_DIRECT],
[
## Binary utilities ##
if test x"$with_Qt_bin_dir" != x; then
bnv_qt_bin_dir=$with_Qt_bin_dir
fi
## Look for header files ##
if test x"$with_Qt_include_dir" != x; then
bnv_qt_include_dir="$with_Qt_include_dir"
else
# The following header file is expected to define QT_VERSION.
qt_direct_test_header=qglobal.h
# Look for the header file in a standard set of common directories.
bnv_include_path_list="
/usr/include
`ls -dr /usr/include/qt* 2>/dev/null`
`ls -dr /usr/lib/qt*/include 2>/dev/null`
`ls -dr /usr/local/qt*/include 2>/dev/null`
`ls -dr /opt/qt*/include 2>/dev/null`
"
for bnv_dir in $bnv_include_path_list; do
if test -r "$bnv_dir/$qt_direct_test_header"; then
bnv_dirs="$bnv_dirs $bnv_dir"
fi
done
# Now look for the newest in this list
bnv_prev_ver=0
for bnv_dir in $bnv_dirs; do
bnv_this_ver=`egrep -w '#define QT_VERSION' $bnv_dir/$qt_direct_test_header | sed s/'#define QT_VERSION'//`
if expr $bnv_this_ver '>' $bnv_prev_ver > /dev/null; then
bnv_qt_include_dir=$bnv_dir
bnv_prev_ver=$bnv_this_ver
fi
done
fi dnl Found header files.
# Are these headers located in a traditional Trolltech installation?
# That would be $bnv_qt_include_dir stripped from its last element:
bnv_possible_qt_dir=`dirname $bnv_qt_include_dir`
if test -x $bnv_possible_qt_dir/bin/moc &&
ls $bnv_possible_qt_dir/lib/libqt* > /dev/null; then
# Then the rest is a piece of cake
bnv_qt_dir=$bnv_possible_qt_dir
bnv_qt_bin_dir="$bnv_qt_dir/bin"
bnv_qt_lib_dir="$bnv_qt_dir/lib"
# Only look for lib if the user did not supply it already
if test x"$bnv_qt_lib" = xNO; then
bnv_qt_lib="`ls $bnv_qt_lib_dir/libqt* | sed -n 1p |
sed s@$bnv_qt_lib_dir/lib@@ | [sed s@[.].*@@]`"
fi
bnv_qt_LIBS="-L$bnv_qt_lib_dir -l$bnv_qt_lib $X_PRE_LIBS $X_LIBS -lX11 -lXext -lXmu -lXt -lXi $X_EXTRA_LIBS"
else
# There is no valid definition for $QTDIR as Trolltech likes to see it
bnv_qt_dir=
## Look for Qt library ##
if test x"$with_Qt_lib_dir" != x; then
bnv_qt_lib_dir="$with_Qt_lib_dir"
# Only look for lib if the user did not supply it already
if test x"$bnv_qt_lib" = xNO; then
bnv_qt_lib="`ls $bnv_qt_lib_dir/libqt* | sed -n 1p |
sed s@$bnv_qt_lib_dir/lib@@ | [sed s@[.].*@@]`"
fi
bnv_qt_LIBS="-L$bnv_qt_lib_dir -l$bnv_qt_lib $X_PRE_LIBS $X_LIBS -lX11 -lXext -lXmu -lXt -lXi $X_EXTRA_LIBS"
else
# Normally, when there is no traditional Trolltech installation,
# the library is installed in a place where the linker finds it
# automatically.
# If the user did not define the library name, try with qt
if test x"$bnv_qt_lib" = xNO; then
bnv_qt_lib=qt
fi
qt_direct_test_header=qapplication.h
qt_direct_test_main="
int argc;
char ** argv;
QApplication app(argc,argv);
"
# See if we find the library without any special options.
# Don't add top $LIBS permanently yet
bnv_save_LIBS="$LIBS"
LIBS="-l$bnv_qt_lib $X_PRE_LIBS $X_LIBS -lX11 -lXext -lXmu -lXt -lXi $X_EXTRA_LIBS"
bnv_qt_LIBS="$LIBS"
bnv_save_CXXFLAGS="$CXXFLAGS"
CXXFLAGS="-I$bnv_qt_include_dir"
AC_TRY_LINK([#include <$qt_direct_test_header>],
$qt_direct_test_main,
[
# Success.
# We can link with no special library directory.
bnv_qt_lib_dir=
], [
# That did not work. Try the multi-threaded version
echo "Non-critical error, please neglect the above." >&AC_FD_CC
bnv_qt_lib=qt-mt
LIBS="-l$bnv_qt_lib $X_PRE_LIBS $X_LIBS -lX11 -lXext -lXmu -lXt -lXi $X_EXTRA_LIBS"
AC_TRY_LINK([#include <$qt_direct_test_header>],
$qt_direct_test_main,
[
# Success.
# We can link with no special library directory.
bnv_qt_lib_dir=
], [
# That did not work. Try the OpenGL version
echo "Non-critical error, please neglect the above." >&AC_FD_CC
bnv_qt_lib=qt-gl
LIBS="-l$bnv_qt_lib $X_PRE_LIBS $X_LIBS -lX11 -lXext -lXmu -lXt -lXi $X_EXTRA_LIBS"
AC_TRY_LINK([#include <$qt_direct_test_header>],
$qt_direct_test_main,
[
# Succes.
# We can link with no special library directory.
bnv_qt_lib_dir=
], [
# That did not work. Maybe a library version I don't know about?
echo "Non-critical error, please neglect the above." >&AC_FD_CC
# Look for some Qt lib in a standard set of common directories.
bnv_dir_list="
`echo $bnv_qt_includes | sed ss/includess`
/lib
/usr/lib
/usr/local/lib
/opt/lib
`ls -dr /usr/lib/qt* 2>/dev/null`
`ls -dr /usr/local/qt* 2>/dev/null`
`ls -dr /opt/qt* 2>/dev/null`
"
for bnv_dir in $bnv_dir_list; do
if ls $bnv_dir/libqt*; then
# Gamble that it's the first one...
bnv_qt_lib="`ls $bnv_dir/libqt* | sed -n 1p |
sed s@$bnv_dir/lib@@ | sed s/[.].*//`"
bnv_qt_lib_dir="$bnv_dir"
break
fi
done
# Try with that one
LIBS="-l$bnv_qt_lib $X_PRE_LIBS $X_LIBS -lX11 -lXext -lXmu -lXt -lXi $X_EXTRA_LIBS"
AC_TRY_LINK([#include <$qt_direct_test_header>],
$qt_direct_test_main,
[
# Succes.
# We can link with no special library directory.
bnv_qt_lib_dir=
], [
# Leave bnv_qt_lib_dir defined
])
])
])
])
if test x"$bnv_qt_lib_dir" != x; then
bnv_qt_LIBS="-l$bnv_qt_lib_dir $LIBS"
else
bnv_qt_LIBS="$LIBS"
fi
LIBS="$bnv_save_LIBS"
CXXFLAGS="$bnv_save_CXXFLAGS"
fi dnl $with_Qt_lib_dir was not given
fi dnl Done setting up for non-traditional Trolltech installation
])

80
decoder/config/cppunit.m4 Normal file
View File

@ -0,0 +1,80 @@
dnl
dnl AM_PATH_CPPUNIT(MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
dnl
AC_DEFUN([AM_PATH_CPPUNIT],
[
AC_ARG_WITH(cppunit-prefix,[ --with-cppunit-prefix=PFX Prefix where CppUnit is installed (optional)],
cppunit_config_prefix="$withval", cppunit_config_prefix="")
AC_ARG_WITH(cppunit-exec-prefix,[ --with-cppunit-exec-prefix=PFX Exec prefix where CppUnit is installed (optional)],
cppunit_config_exec_prefix="$withval", cppunit_config_exec_prefix="")
if test x$cppunit_config_exec_prefix != x ; then
cppunit_config_args="$cppunit_config_args --exec-prefix=$cppunit_config_exec_prefix"
if test x${CPPUNIT_CONFIG+set} != xset ; then
CPPUNIT_CONFIG=$cppunit_config_exec_prefix/bin/cppunit-config
fi
fi
if test x$cppunit_config_prefix != x ; then
cppunit_config_args="$cppunit_config_args --prefix=$cppunit_config_prefix"
if test x${CPPUNIT_CONFIG+set} != xset ; then
CPPUNIT_CONFIG=$cppunit_config_prefix/bin/cppunit-config
fi
fi
AC_PATH_PROG(CPPUNIT_CONFIG, cppunit-config, no)
cppunit_version_min=$1
AC_MSG_CHECKING(for Cppunit - version >= $cppunit_version_min)
no_cppunit=""
if test "$CPPUNIT_CONFIG" = "no" ; then
no_cppunit=yes
else
CPPUNIT_CFLAGS=`$CPPUNIT_CONFIG --cflags`
CPPUNIT_LIBS=`$CPPUNIT_CONFIG --libs`
cppunit_version=`$CPPUNIT_CONFIG --version`
cppunit_major_version=`echo $cppunit_version | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
cppunit_minor_version=`echo $cppunit_version | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
cppunit_micro_version=`echo $cppunit_version | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
cppunit_major_min=`echo $cppunit_version_min | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
cppunit_minor_min=`echo $cppunit_version_min | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
cppunit_micro_min=`echo $cppunit_version_min | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
cppunit_version_proper=`expr \
$cppunit_major_version \> $cppunit_major_min \| \
$cppunit_major_version \= $cppunit_major_min \& \
$cppunit_minor_version \> $cppunit_minor_min \| \
$cppunit_major_version \= $cppunit_major_min \& \
$cppunit_minor_version \= $cppunit_minor_min \& \
$cppunit_micro_version \>= $cppunit_micro_min `
if test "$cppunit_version_proper" = "1" ; then
AC_MSG_RESULT([$cppunit_major_version.$cppunit_minor_version.$cppunit_micro_version])
else
AC_MSG_RESULT(no)
no_cppunit=yes
fi
fi
if test "x$no_cppunit" = x ; then
ifelse([$2], , :, [$2])
else
CPPUNIT_CFLAGS=""
CPPUNIT_LIBS=""
ifelse([$3], , :, [$3])
fi
AC_SUBST(CPPUNIT_CFLAGS)
AC_SUBST(CPPUNIT_LIBS)
])

111
decoder/config/gr_boost.m4 Normal file
View File

@ -0,0 +1,111 @@
dnl
dnl Copyright 2004,2005 Free Software Foundation, Inc.
dnl
dnl This file is part of OP25
dnl
dnl OP25 is free software; you can redistribute it and/or modify
dnl it under the terms of the GNU General Public License as published by
dnl the Free Software Foundation; either version 3, or (at your option)
dnl any later version.
dnl
dnl OP25 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
dnl GNU General Public License for more details.
dnl
dnl You should have received a copy of the GNU General Public License
dnl along with OP25; see the file COPYING. If not, write to
dnl the Free Software Foundation, Inc., 51 Franklin Street,
dnl Boston, MA 02110-1301, USA.
dnl
dnl This tries to do the "right thing" to locate the boost include files.
dnl If the user explicitly specified --with-boost-include-dir=<foo>
dnl we believe them and use it. Otherwise,
dnl
dnl We look for boost/shared_ptr.hpp in the "normal places". That is,
dnl wherever AC_CHECK_HEADER looks. If the boost includes are in /usr/local/include
dnl this step will find them.
dnl
dnl Otherwise, we check to see if the boost stuff was installed in a version-specific
dnl directory under /usr/local/include. These look like: /usr/local/include/boost-1_33_1
dnl If there's more than one version installed, we select the
dnl lexicographically greatest one.
dnl
dnl If none of these work, we bail.
AC_DEFUN([GR_REQUIRE_BOOST_INCLUDES],
[
AC_LANG_PUSH(C++)
gr_boost_include_dir=
AC_ARG_WITH([boost-include-dir],
AC_HELP_STRING([--with-boost-include-dir=<path>],
[path to boost c++ include files]),
[
# "yes" and "no" are bogus answers
if test x"$with_boost_include_dir" = xyes ||
test x"$with_boost_include_dir" = xno; then
gr_boost_include_dir=
else
gr_boost_include_dir=$with_boost_include_dir
fi
])
echo "gr_boost_include_dir = $gr_boost_include_dir"
if test x$gr_boost_include_dir != x; then
#
# If the user specified a directory, then we use it
#
OLD_CPPFLAGS=$CPPFLAGS
CPPFLAGS="$CPPFLAGS -I$gr_boost_include_dir"
AC_CHECK_HEADER([boost/shared_ptr.hpp],
[BOOST_CFLAGS="-I$gr_boost_include_dir"],
[AC_MSG_ERROR(
[Failed to locate boost/shared_ptr.hpp.
Try using --with-boost-include-dir=<path>,
E.g., --with-boost-include-dir=/usr/local/include/boost-1_33_1])])
CPPFLAGS=$OLD_CPPFLAGS
else
#
# Otherwise we check in the default places
#
AC_CHECK_HEADER([boost/shared_ptr.hpp],
[BOOST_CFLAGS=""],
[ # Nope, look for latest version if any in $prefix/include/boost-*
# Wipe out cached value. KLUDGE: AC should have API for this
unset AS_TR_SH([ac_cv_header_boost/shared_ptr.hpp])
boost_last_match(){
#echo "boost_last_match: [$]*"
pattern="[$]1"
shift
if test "[$]pattern" = "[$]1"
then
LM=''
else
shift `expr [$]# - 1`
LM=[$]1
fi
#echo "LM(1)='[$]LM'"
}
pattern="/usr/local/include/boost-*"
boost_last_match "$pattern" $pattern
#echo "LM(2)='$LM'"
OLD_CPPFLAGS=$CPP_FLAGS
CPPFLAGS="$CPPFLAGS -I$LM"
AC_CHECK_HEADER([boost/shared_ptr.hpp],
[BOOST_CFLAGS="-I$LM"],
[AC_MSG_ERROR(
[Failed to locate boost/shared_ptr.hpp.
Try using --with-boost-include-dir=<path>,
E.g., --with-boost-include-dir=/usr/local/include/boost-1_33_1])])
CPPFLAGS=$OLD_CPPFLAGS
])
fi
unset boost_last_match LM
AC_LANG_POP
AC_SUBST(BOOST_CFLAGS)
])

View File

@ -0,0 +1,52 @@
dnl
dnl Copyright 2005 Free Software Foundation, Inc.
dnl
dnl This file is part of OP25
dnl
dnl OP25 is free software; you can redistribute it and/or modify
dnl it under the terms of the GNU General Public License as published by
dnl the Free Software Foundation; either version 3, or (at your option)
dnl any later version.
dnl
dnl OP25 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
dnl GNU General Public License for more details.
dnl
dnl You should have received a copy of the GNU General Public License
dnl along with OP25; see the file COPYING. If not, write to
dnl the Free Software Foundation, Inc., 51 Franklin Street,
dnl Boston, MA 02110-1301, USA.
dnl AC_DEFUN([GR_CHECK_CREATEFILEMAPPING],
dnl [
dnl AC_CHECK_FUNCS([CreateFileMapping])
dnl ])
AC_DEFUN([GR_CHECK_CREATEFILEMAPPING],[
AC_MSG_CHECKING([for CreateFileMapping function])
AC_COMPILE_IFELSE([
#include <windows.h>
int main (int argc, char **argv)
{
HANDLE handle;
int size;
char seg_name[[1024]];
handle = CreateFileMapping(
INVALID_HANDLE_VALUE, // use paging file
NULL, // default security
PAGE_READWRITE, // read/write access
0, // max. object size
size, // buffer size
seg_name); // name of mapping object
return 0;
}
],[HAVE_CREATEFILEMAPPING=yes
AC_DEFINE(HAVE_CREATEFILEMAPPING,[1],[Define if you have the CreateFilemapping function(win32).])],
[HAVE_CREATEFILEMAPPING=no])
AC_MSG_RESULT($HAVE_CREATEFILEMAPPING)
AM_CONDITIONAL(HAVE_CREATEFILEMAPPING, test x$HAVE_CREATEFILEMAPPING = xyes)
])

View File

@ -0,0 +1,37 @@
dnl
dnl Copyright 2003 Free Software Foundation, Inc.
dnl
dnl This file is part of OP25
dnl
dnl OP25 is free software; you can redistribute it and/or modify
dnl it under the terms of the GNU General Public License as published by
dnl the Free Software Foundation; either version 3, or (at your option)
dnl any later version.
dnl
dnl OP25 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
dnl GNU General Public License for more details.
dnl
dnl You should have received a copy of the GNU General Public License
dnl along with OP25; see the file COPYING. If not, write to
dnl the Free Software Foundation, Inc., 51 Franklin Street,
dnl Boston, MA 02110-1301, USA.
dnl
AC_DEFUN([GR_CHECK_MC4020],[
AC_MSG_CHECKING([for mc4020 A/D driver include file])
AC_COMPILE_IFELSE([
#include <mc4020.h>
int main (int argc, char **argv)
{
return 0;
}
],[HAVE_MC4020=yes
AC_DEFINE(HAVE_MC4020,[1],[Define if you have a Measurement Computing PCI-DAS4020/12 A/D])],
[HAVE_MC4020=no])
AC_MSG_RESULT($HAVE_MC4020)
AM_CONDITIONAL(HAVE_MC4020, test x$HAVE_MC4020 = xyes)
])

View File

@ -0,0 +1,29 @@
dnl
dnl Copyright 2003 Free Software Foundation, Inc.
dnl
dnl This file is part of OP25
dnl
dnl OP25 is free software; you can redistribute it and/or modify
dnl it under the terms of the GNU General Public License as published by
dnl the Free Software Foundation; either version 3, or (at your option)
dnl any later version.
dnl
dnl OP25 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
dnl GNU General Public License for more details.
dnl
dnl You should have received a copy of the GNU General Public License
dnl along with OP25; see the file COPYING. If not, write to
dnl the Free Software Foundation, Inc., 51 Franklin Street,
dnl Boston, MA 02110-1301, USA.
AC_DEFUN([GR_CHECK_SHM_OPEN],
[
SHM_OPEN_LIBS=""
save_LIBS="$LIBS"
AC_SEARCH_LIBS([shm_open], [rt], [SHM_OPEN_LIBS="$LIBS"])
AC_CHECK_FUNCS([shm_open])
LIBS="$save_LIBS"
AC_SUBST(SHM_OPEN_LIBS)
])

View File

@ -0,0 +1,32 @@
dnl
dnl Copyright 2003 Free Software Foundation, Inc.
dnl
dnl This file is part of OP25
dnl
dnl OP25 is free software; you can redistribute it and/or modify
dnl it under the terms of the GNU General Public License as published by
dnl the Free Software Foundation; either version 3, or (at your option)
dnl any later version.
dnl
dnl OP25 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
dnl GNU General Public License for more details.
dnl
dnl You should have received a copy of the GNU General Public License
dnl along with OP25; see the file COPYING. If not, write to
dnl the Free Software Foundation, Inc., 51 Franklin Street,
dnl Boston, MA 02110-1301, USA.
dnl
dnl Check for Universal Software Radio Peripheral
AC_DEFUN([GR_CHECK_USRP],[
PKG_CHECK_MODULES(USRP, usrp >= 0.2,
[HAVE_USRP=yes
AC_DEFINE(HAVE_USRP,[1],[Define if you have a USRP])],
[HAVE_USRP=no])
AM_CONDITIONAL(HAVE_USRP, test x$HAVE_USRP = xyes)
])

View File

@ -0,0 +1,59 @@
dnl
dnl Copyright 2003,2005 Free Software Foundation, Inc.
dnl
dnl This file is part of OP25
dnl
dnl OP25 is free software; you can redistribute it and/or modify
dnl it under the terms of the GNU General Public License as published by
dnl the Free Software Foundation; either version 3, or (at your option)
dnl any later version.
dnl
dnl OP25 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
dnl GNU General Public License for more details.
dnl
dnl You should have received a copy of the GNU General Public License
dnl along with OP25; see the file COPYING. If not, write to
dnl the Free Software Foundation, Inc., 51 Franklin Street,
dnl Boston, MA 02110-1301, USA.
dnl
AC_DEFUN([GR_CHECK_DOXYGEN],[
AC_ARG_ENABLE(doxygen, [ --enable-doxygen enable documentation generation with doxygen (no)])
AC_ARG_ENABLE(dot, [ --enable-dot use 'dot' to generate graphs in doxygen (auto)])
AC_ARG_ENABLE(html-docs, [ --enable-html-docs enable HTML generation with doxygen (yes)], [], [ enable_html_docs=yes])
AC_ARG_ENABLE(latex-docs, [ --enable-latex-docs enable LaTeX doc generation with doxygen (no)], [], [ enable_latex_docs=no])
if test "x$enable_doxygen" = xyes; then
AC_PATH_PROG(DOXYGEN, doxygen, , $PATH)
if test x$DOXYGEN = x; then
if test "x$enable_doxygen" = xyes; then
AC_MSG_ERROR([could not find doxygen])
fi
enable_doc=no
generate_docs=
else
enable_doc=yes
generate_docs=docs
AC_PATH_PROG(DOT, dot, , $PATH)
fi
else
enable_doc=no
fi
AM_CONDITIONAL(DOC, test x$enable_doc = xyes)
if test x$DOT = x; then
if test "x$enable_dot" = xyes; then
AC_MSG_ERROR([could not find dot])
fi
enable_dot=no
else
enable_dot=yes
fi
AC_SUBST(enable_dot)
AC_SUBST(enable_html_docs)
AC_SUBST(enable_latex_docs)
AC_SUBST(generate_docs)
])

View File

@ -0,0 +1,72 @@
dnl
dnl Copyright 2002 Free Software Foundation, Inc.
dnl
dnl This file is part of OP25
dnl
dnl OP25 is free software; you can redistribute it and/or modify
dnl it under the terms of the GNU General Public License as published by
dnl the Free Software Foundation; either version 3, or (at your option)
dnl any later version.
dnl
dnl OP25 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
dnl GNU General Public License for more details.
dnl
dnl You should have received a copy of the GNU General Public License
dnl along with OP25; see the file COPYING. If not, write to
dnl the Free Software Foundation, Inc., 51 Franklin Street,
dnl Boston, MA 02110-1301, USA.
dnl
dnl FIXME probably need to add linker flag too...
AC_DEFUN([GR_SET_GPROF],[
dnl Check for --with-gprof
AC_MSG_CHECKING([whether user wants gprof])
AC_ARG_WITH(gprof,
[ --with-gprof Turn on gprof profiling],
[], [ with_gprof=no ])
AC_MSG_RESULT($with_gprof)
dnl gprof profiling flags for the two main compilers
cc_profiling_flags="-pg"
cxx_profiling_flags="-pg"
ld_profiling_flags="-pg"
if test $with_gprof = yes
then
if test -n "${CC}"
then
LF_CHECK_CC_FLAG($cc_profiling_flags)
fi
if test -n "${CXX}"
then
LF_CHECK_CXX_FLAG($cxx_profiling_flags)
fi
fi
])
AC_DEFUN([GR_SET_PROF],[
dnl Check for --with-prof
AC_MSG_CHECKING([whether user wants prof])
AC_ARG_WITH(prof,
[ --with-prof Turn on prof profiling],
[], [ with_prof=no ])
AC_MSG_RESULT($with_prof)
dnl prof profiling flags for the two main compilers
cc_profiling_flags="-p"
cxx_profiling_flags="-p"
ld_profiling_flags="-p"
if test $with_prof = yes
then
if test -n "${CC}"
then
LF_CHECK_CC_FLAG($cc_profiling_flags)
fi
if test -n "${CXX}"
then
LF_CHECK_CXX_FLAG($cxx_profiling_flags)
fi
fi
])

View File

@ -0,0 +1,40 @@
# Check for (MinGW)win32 extra ld options. -*- Autoconf -*-
# Copyright 2003,2004,2005 Free Software Foundation, Inc.
#
# This file is part of OP25
#
# OP25 is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your option)
# any later version.
#
# OP25 is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with OP25; see the file COPYING. If not, write to
# the Free Software Foundation, Inc., 51 Franklin Street,
# Boston, MA 02110-1301, USA.
dnl
AC_DEFUN([GR_LIBGNURADIO_CORE_EXTRA_LDFLAGS], [
AC_REQUIRE([AC_PROG_LD])
# on Mingw32 extra LDFLAGS are required to ease global variable linking
LIBGNURADIO_CORE_EXTRA_LDFLAGS=""
AC_MSG_CHECKING([whether $LD accepts --enable-runtime-pseudo-reloc])
if ${LD} --enable-runtime-pseudo-reloc --version >/dev/null 2>&1
then
# libtool requires the quotes
LIBGNURADIO_CORE_EXTRA_LDFLAGS="\"-Wl,--enable-runtime-pseudo-reloc\""
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
fi
AC_SUBST(LIBGNURADIO_CORE_EXTRA_LDFLAGS)
])

View File

@ -0,0 +1,44 @@
dnl
dnl Copyright 2005 Free Software Foundation, Inc.
dnl
dnl This file is part of OP25
dnl
dnl OP25 is free software; you can redistribute it and/or modify
dnl it under the terms of the GNU General Public License as published by
dnl the Free Software Foundation; either version 3, or (at your option)
dnl any later version.
dnl
dnl OP25 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
dnl GNU General Public License for more details.
dnl
dnl You should have received a copy of the GNU General Public License
dnl along with OP25; see the file COPYING. If not, write to
dnl the Free Software Foundation, Inc., 51 Franklin Street,
dnl Boston, MA 02110-1301, USA.
dnl
# GR_NO_UNDEFINED()
#
# Detemine whether we need to use the -no-undefined linker flag
# when building shared libraries.
# Sets NO_UNDEFINED to "" or "-no-undefined"
#
# As far as I can tell, we need -no-undefined only when building
# windows DLLs. This occurs when using MinGW and Cygwin.
#
# For now, we stub this out.
AC_DEFUN([GR_NO_UNDEFINED],[
AC_REQUIRE([AC_CANONICAL_HOST])
no_undefined=""
case "${host_os}" in
*mingw* | *cygwin*)
# on MinGW/Cygwin extra LDFLAGS are required
no_undefined="-no-undefined"
;;
esac
AC_SUBST(NO_UNDEFINED,[$no_undefined])
])

View File

@ -0,0 +1,51 @@
# Check for Omnithread (pthread/NT) thread support. -*- Autoconf -*-
# Copyright 2003 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 3, or (at your option)
# any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You 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, Boston, MA
# 02110-1301, USA.
AC_DEFUN([GR_OMNITHREAD],
[
# Check first for POSIX
ACX_PTHREAD(
[ ot_posix="yes"
AC_DEFINE(OMNITHREAD_POSIX,[1],[Define to 1 to enable pthread])
],[
# If no POSIX support found, then check for NT threads
AC_MSG_CHECKING([for NT threads])
AC_LINK_IFELSE([
#include <windows.h>
#include <winbase.h>
int main() { InitializeCriticalSection(NULL); return 0; }
],
[
ot_nt="yes"
AC_DEFINE(OMNITHREAD_NT,[1],[Define to 1 to enable NT thread])
],
[AC_MSG_FAILURE([OP25 requires POSIX threads. pthreads not found.])]
)
AC_MSG_RESULT(yes)
])
AM_CONDITIONAL(OMNITHREAD_POSIX, test "x$ot_posix" = xyes)
AM_CONDITIONAL(OMNITHREAD_NT, test "x$ot_nt" = xyes)
save_LIBS="$LIBS"
AC_SEARCH_LIBS([clock_gettime], [rt], [PTHREAD_LIBS="$PTHREAD_LIBS $LIBS"])
AC_CHECK_FUNCS([clock_gettime gettimeofday nanosleep])
LIBS="$save_LIBS"
])

146
decoder/config/gr_pwin32.m4 Normal file
View File

@ -0,0 +1,146 @@
# Check for (mingw)win32 POSIX replacements. -*- Autoconf -*-
# Copyright 2003,2004,2005 Free Software Foundation, Inc.
#
# This file is part of OP25
#
# OP25 is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your option)
# any later version.
#
# OP25 is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with OP25; see the file COPYING. If not, write to
# the Free Software Foundation, Inc., 51 Franklin Street,
# Boston, MA 02110-1301, USA.
AC_DEFUN([GR_PWIN32],
[
AC_REQUIRE([AC_HEADER_TIME])
AC_CHECK_HEADERS([sys/types.h fcntl.h io.h])
AC_CHECK_HEADERS([windows.h])
AC_CHECK_HEADERS([winioctl.h winbase.h], [], [], [
#if HAVE_WINDOWS_H
#include <windows.h>
#endif
])
AC_CHECK_FUNCS([getopt usleep gettimeofday nanosleep rand srand random srandom sleep sigaction])
AC_CHECK_TYPES([struct timezone, struct timespec, ssize_t],[],[],[
#if HAVE_SYS_TYPES_H
# include <sys/types.h>
#endif
#if TIME_WITH_SYS_TIME
# include <sys/time.h>
# include <time.h>
#else
# if HAVE_SYS_TIME_H
# include <sys/time.h>
# else
# include <time.h>
# endif
#endif
])
dnl Checks for replacements
AC_REPLACE_FUNCS([getopt usleep gettimeofday])
AC_MSG_CHECKING(for Sleep)
AC_TRY_LINK([ #include <windows.h>
#include <winbase.h>
], [ Sleep(0); ],
[AC_DEFINE(HAVE_SSLEEP,1,[Define to 1 if you have win32 Sleep])
AC_MSG_RESULT(yes)],
AC_MSG_RESULT(no)
)
dnl Under Win32, mkdir prototype in io.h has only one arg
AC_MSG_CHECKING(whether mkdir accepts only one arg)
AC_TRY_COMPILE([#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>], [
mkdir("")
], [ AC_MSG_RESULT(yes)
AC_DEFINE(MKDIR_TAKES_ONE_ARG,[],[Define if mkdir accepts only one arg]) ],
[ AC_MSG_RESULT(no)
])
AH_BOTTOM(
[
/* Define missing prototypes, implemented in replacement lib */
#ifdef __cplusplus
extern "C" {
#endif
#ifndef HAVE_GETOPT
int getopt (int argc, char * const argv[], const char * optstring);
extern char * optarg;
extern int optind, opterr, optopt;
#endif
#ifndef HAVE_USLEEP
int usleep(unsigned long usec); /* SUSv2 */
#endif
#ifndef HAVE_NANOSLEEP
#ifndef HAVE_STRUCT_TIMESPEC
#if HAVE_SYS_TYPES_H
# include <sys/types.h> /* need time_t */
#endif
struct timespec {
time_t tv_sec;
long tv_nsec;
};
#endif
static inline int nanosleep(const struct timespec *req, struct timespec *rem) { return usleep(req->tv_sec*1000000+req->tv_nsec/1000); }
#endif
#if defined(HAVE_SSLEEP) && !defined(HAVE_SLEEP)
#ifdef HAVE_WINBASE_H
#include <windows.h>
#include <winbase.h>
#endif
/* TODO: what about SleepEx? */
static inline unsigned int sleep (unsigned int nb_sec) { Sleep(nb_sec*1000); return 0; }
#endif
#ifndef HAVE_GETTIMEOFDAY
#ifdef HAVE_SYS_TIME_H
#include <sys/time.h>
#endif
#ifndef HAVE_STRUCT_TIMEZONE
struct timezone {
int tz_minuteswest;
int tz_dsttime;
};
#endif
int gettimeofday(struct timeval *tv, struct timezone *tz);
#endif
#if !defined(HAVE_RANDOM) && defined(HAVE_RAND)
#include <stdlib.h>
static inline long int random (void) { return rand(); }
#endif
#if !defined(HAVE_SRANDOM) && defined(HAVE_SRAND)
static inline void srandom (unsigned int seed) { srand(seed); }
#endif
#ifndef HAVE_SSIZE_T
typedef size_t ssize_t;
#endif
#ifdef __cplusplus
}
#endif
])
])

111
decoder/config/gr_python.m4 Normal file
View File

@ -0,0 +1,111 @@
dnl
dnl Copyright 2003,2004,2005 Free Software Foundation, Inc.
dnl
dnl This file is part of OP25
dnl
dnl OP25 is free software; you can redistribute it and/or modify
dnl it under the terms of the GNU General Public License as published by
dnl the Free Software Foundation; either version 3, or (at your option)
dnl any later version.
dnl
dnl OP25 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
dnl GNU General Public License for more details.
dnl
dnl You should have received a copy of the GNU General Public License
dnl along with OP25; see the file COPYING. If not, write to
dnl the Free Software Foundation, Inc., 51 Franklin Street,
dnl Boston, MA 02110-1301, USA.
dnl
# PYTHON_DEVEL()
#
# Checks for Python and tries to get the include path to 'Python.h'.
# It provides the $(PYTHON_CPPFLAGS) and $(PYTHON_LDFLAGS) output variables.
#
AC_DEFUN([PYTHON_DEVEL],[
AC_REQUIRE([AM_PATH_PYTHON])
AC_REQUIRE([AC_CANONICAL_HOST])
# For Fedora Core 5 and 6, see ticket:39 in Trac
if test -f '/etc/redhat-release'; then
if (echo $pyexecdir | grep -q lib64); then
pythondir="$pyexecdir"
fi
fi
# Check for Python include path
AC_MSG_CHECKING([for Python include path])
if test -z "$PYTHON" ; then
AC_MSG_ERROR([cannot find Python path])
fi
# ask distutils which include path we should use
python_cmd='
import distutils.sysconfig
import os
path = distutils.sysconfig.get_python_inc(plat_specific=False)
if os.sep == "\\":
path = path.replace("\\", "/")
print path
'
python_path=`$PYTHON -c "$python_cmd"`
AC_MSG_RESULT([$python_path])
if test -z "$python_path" ; then
AC_MSG_ERROR([cannot find Python include path])
fi
AC_SUBST(PYTHON_CPPFLAGS,[-I$python_path])
# Check for Python headers usability
python_save_CPPFLAGS=$CPPFLAGS
CPPFLAGS="$CPPFLAGS $PYTHON_CPPFLAGS"
AC_CHECK_HEADERS([Python.h], [],
[AC_MSG_ERROR([cannot find usable Python headers])])
CPPFLAGS="$python_save_CPPFLAGS"
# Only set this on mingw and cygwin hosts, (only implemented
# for mingw host, for crosscompiling you need to trick this)
PYTHON_LDFLAGS=""
case $host_os in
*mingw* | *cygwin* )
AC_MSG_CHECKING([for Python LDFLAGS])
python_cmd='
import distutils.sysconfig
import os
path = distutils.sysconfig.get_config_var("LIBPL")
if path == None:
path = distutils.sysconfig.PREFIX + "/libs"
if os.sep == "\\":
path = path.replace("\\", "/")
print path
'
python_stdlib_path=`$PYTHON -c "$python_cmd"`
python_version_nodot=`echo $PYTHON_VERSION | sed "s,\.,,"`
libpython_name="python$PYTHON_VERSION"
# Standard install of python for win32 has libpython24.a
# instead of libpython2.4.a so we check for the library
# without the dot in the version number.
python_stdlib_filename=`find $python_stdlib_path -type f -name libpython$python_version_nodot.* -print | sed "1q"`
if test -n "$python_stdlib_filename" ; then
libpython_name="python$python_version_nodot"
fi
PYTHON_LDFLAGS="-L$python_stdlib_path -l$libpython_name"
AC_MSG_RESULT($PYTHON_LDFLAGS)
# Replace all backslashes in PYTHON Paths with forward slashes
pythondir=`echo $pythondir |sed 's,\\\\,/,g'`
pkgpythondir=`echo $pkgpythondir |sed 's,\\\\,/,g'`
pyexecdir=`echo $pyexecdir |sed 's,\\\\,/,g'`
pkgpyexecdir=`echo $pkgpyexecdir |sed 's,\\\\,/,g'`
;;
esac
AC_SUBST([PYTHON_LDFLAGS])
])

View File

@ -0,0 +1,33 @@
dnl
dnl Copyright 2003,2004 Free Software Foundation, Inc.
dnl
dnl This file is part of OP25
dnl
dnl OP25 is free software; you can redistribute it and/or modify
dnl it under the terms of the GNU General Public License as published by
dnl the Free Software Foundation; either version 3, or (at your option)
dnl any later version.
dnl
dnl OP25 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
dnl GNU General Public License for more details.
dnl
dnl You should have received a copy of the GNU General Public License
dnl along with OP25; see the file COPYING. If not, write to
dnl the Free Software Foundation, Inc., 51 Franklin Street,
dnl Boston, MA 02110-1301, USA.
dnl
AC_DEFUN([GR_REQUIRE_MC4020],[
AC_MSG_CHECKING([for mc4020 A/D driver include file])
AC_COMPILE_IFELSE([
#include <mc4020.h>
int main (int argc, char **argv)
{
return 0;
}
],[AC_MSG_RESULT([yes])],
[AC_MSG_RESULT([no])
AC_MSG_ERROR([mc4020.h not found.])])
])

View File

@ -0,0 +1,30 @@
dnl
dnl Copyright 2003 Free Software Foundation, Inc.
dnl
dnl This file is part of OP25
dnl
dnl OP25 is free software; you can redistribute it and/or modify
dnl it under the terms of the GNU General Public License as published by
dnl the Free Software Foundation; either version 3, or (at your option)
dnl any later version.
dnl
dnl OP25 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
dnl GNU General Public License for more details.
dnl
dnl You should have received a copy of the GNU General Public License
dnl along with OP25; see the file COPYING. If not, write to
dnl the Free Software Foundation, Inc., 51 Franklin Street,
dnl Boston, MA 02110-1301, USA.
dnl
AC_DEFUN([GR_SCRIPTING],[
AC_REQUIRE([AC_PROG_LN_S])
AC_REQUIRE([AC_PROG_CXX])
AC_REQUIRE([AC_PROG_LIBTOOL])
SWIG_PROG(1.3.23)
SWIG_ENABLE_CXX
SWIG_PYTHON
])

View File

@ -0,0 +1,44 @@
dnl
dnl Copyright 2003 Free Software Foundation, Inc.
dnl
dnl This file is part of OP25
dnl
dnl OP25 is free software; you can redistribute it and/or modify
dnl it under the terms of the GNU General Public License as published by
dnl the Free Software Foundation; either version 3, or (at your option)
dnl any later version.
dnl
dnl OP25 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
dnl GNU General Public License for more details.
dnl
dnl You should have received a copy of the GNU General Public License
dnl along with OP25; see the file COPYING. If not, write to
dnl the Free Software Foundation, Inc., 51 Franklin Street,
dnl Boston, MA 02110-1301, USA.
dnl
AC_DEFUN([GR_SET_MD_CPU],[
AC_REQUIRE([AC_CANONICAL_HOST])
AC_ARG_WITH(md-cpu,
[ --with-md-cpu=ARCH set machine dependent speedups (auto)],
[cf_with_md_cpu="$withval"],
[cf_with_md_cpu="$host_cpu"])
AC_MSG_CHECKING([for machine dependent speedups])
case "$cf_with_md_cpu" in
x86 | i[[3-7]]86) MD_CPU=x86 MD_SUBCPU=x86 ;;
x86_64) MD_CPU=x86 MD_SUBCPU=x86_64 ;;
# sparc) MD_CPU=sparc ;;
*) MD_CPU=generic ;;
esac
AC_MSG_RESULT($MD_CPU)
AC_SUBST(MD_CPU)
AC_SUBST(MD_SUBCPU)
AM_CONDITIONAL(MD_CPU_x86, test $MD_CPU = x86)
AM_CONDITIONAL(MD_SUBCPU_x86_64, test $MD_SUBCPU = x86_64)
AM_CONDITIONAL(MD_CPU_generic, test $MD_CPU = generic)
])

85
decoder/config/gr_swig.m4 Normal file
View File

@ -0,0 +1,85 @@
dnl
dnl Copyright 2003 Free Software Foundation, Inc.
dnl
dnl This file is part of OP25
dnl
dnl OP25 is free software; you can redistribute it and/or modify
dnl it under the terms of the GNU General Public License as published by
dnl the Free Software Foundation; either version 3, or (at your option)
dnl any later version.
dnl
dnl OP25 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
dnl GNU General Public License for more details.
dnl
dnl You should have received a copy of the GNU General Public License
dnl along with OP25; see the file COPYING. If not, write to
dnl the Free Software Foundation, Inc., 51 Franklin Street,
dnl Boston, MA 02110-1301, USA.
dnl
# SWIG_PROG([required-version])
#
# Checks for the SWIG program. If found you can (and should) call SWIG via $(SWIG).
# You can use the optional first argument to check if the version of the available SWIG
# is greater or equal to the value of the argument. It should have the format:
# N[.N[.N]] (N is a number between 0 and 999. Only the first N is mandatory.)
AC_DEFUN([SWIG_PROG],[
AC_REQUIRE([AC_PROG_MAKE_SET])
AC_CHECK_PROG(SWIG,swig,[`which swig`])
if test -z "$SWIG" ; then
AC_MSG_ERROR([Cannot find 'swig' program. SWIG version >= $1 required])
SWIG=false
elif test -n "$1" ; then
AC_MSG_CHECKING([for SWIG version])
swig_version=`$SWIG -version 2>&1 | \
awk '/^SWIG Version [[0-9]+\.[0-9]+\.[0-9]]+.*$/ { split($[3],a,"[[^.0-9]]"); print a[[1]] }'`
AC_MSG_RESULT([$swig_version])
if test -n "$swig_version" ; then
swig_version=`echo $swig_version | \
awk '{ split($[1],a,"\."); print [a[1]*1000000+a[2]*1000+a[3]] }' 2>/dev/null`
swig_required_version=`echo $1 | \
awk '{ split($[1],a,"\."); print [a[1]*1000000+a[2]*1000+a[3]] }' 2>/dev/null`
if test $swig_required_version -gt $swig_version ; then
AC_MSG_ERROR([SWIG version >= $1 required])
fi
else
AC_MSG_ERROR([cannot determine SWIG version])
fi
fi
])
# SWIG_ENABLE_CXX()
#
# Enable swig C++ support. This effects all invocations of $(SWIG).
AC_DEFUN([SWIG_ENABLE_CXX],[
AC_REQUIRE([SWIG_PROG])
AC_REQUIRE([AC_PROG_CXX])
if test "$SWIG" != "false" ; then
SWIG="$SWIG -c++"
fi
])
# SWIG_PYTHON([use-shadow-classes])
#
# Checks for Python and provides the $(SWIG_PYTHON_CPPFLAGS),
# $(SWIG_PYTHON_LIB) and $(SWIG_PYTHON_OPT) output variables.
# $(SWIG_PYTHON_OPT) contains all necessary swig options to generate
# code for Python. If you need multi module support use
# $(SWIG_PYTHON_LIB) (provided by the SWIG_MULTI_MODULE_SUPPORT()
# macro) to link against the appropriate library. It contains the
# SWIG Python runtime library that is needed by the type check system
# for example.
AC_DEFUN([SWIG_PYTHON],[
AC_REQUIRE([SWIG_PROG])
AC_REQUIRE([PYTHON_DEVEL])
if test "$SWIG" != "false" ; then
AC_SUBST(SWIG_PYTHON_LIB,[-lswigpy])
dnl test ! "x$1" = "xno" && swig_shadow=" -shadow" || swig_shadow=""
dnl AC_SUBST(SWIG_PYTHON_OPT,[-python$swig_shadow])
AC_SUBST(SWIG_PYTHON_OPT,[-python])
fi
AC_SUBST(SWIG_PYTHON_CPPFLAGS,[$PYTHON_CPPFLAGS])
])

View File

@ -0,0 +1,36 @@
# Check for IPC System V shm support. -*- Autoconf -*-
# Copyright 2003 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 3, or (at your option)
# any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You 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, Boston, MA
# 02110-1301, USA.
AC_DEFUN([GR_SYSV_SHM],
[
AC_LANG_SAVE
AC_LANG_C
AC_CHECK_HEADERS([sys/ipc.h sys/shm.h])
save_LIBS="$LIBS"
AC_SEARCH_LIBS(shmat, [cygipc ipc],
[ IPC_LIBS="$LIBS" ],
[ AC_MSG_WARN([SystemV IPC support not found. ]) ]
)
LIBS="$save_LIBS"
AC_LANG_RESTORE
AC_SUBST(IPC_LIBS)
])

View File

@ -0,0 +1,39 @@
dnl
dnl Copyright 2005 Free Software Foundation, Inc.
dnl
dnl This file is part of OP25
dnl
dnl OP25 is free software; you can redistribute it and/or modify
dnl it under the terms of the GNU General Public License as published by
dnl the Free Software Foundation; either version 3, or (at your option)
dnl any later version.
dnl
dnl OP25 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
dnl GNU General Public License for more details.
dnl
dnl You should have received a copy of the GNU General Public License
dnl along with OP25; see the file COPYING. If not, write to
dnl the Free Software Foundation, Inc., 51 Franklin Street,
dnl Boston, MA 02110-1301, USA.
dnl
# GR_X86_64()
#
# Checks to see if we're on a x86_64 machine, and if so, ensure
# that libdir ends in "64"
#
AC_DEFUN([GR_X86_64],[
AC_REQUIRE([AC_CANONICAL_HOST])
if test "$host_cpu" = "x86_64"; then
AC_MSG_CHECKING([libdir for lib64 suffix])
t=${libdir##*/lib}
if test "$t" != 64 && test -d /lib64 && ! test -L /lib64; then
libdir=${libdir}64
AC_MSG_RESULT([no. Setting libdir to $libdir])
else
AC_MSG_RESULT([yes])
fi
fi
])

42
decoder/config/lf_cc.m4 Normal file
View File

@ -0,0 +1,42 @@
dnl Autoconf support for C++
dnl Copyright (C) 1988 Eleftherios Gkioulekas <lf@amath.washington.edu>
dnl
dnl This program is free software; you can redistribute it and/or modify
dnl it under the terms of the GNU General Public License as published by
dnl the Free Software Foundation; either version 3 of the License, or
dnl (at your option) any later version.
dnl
dnl This program 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
dnl GNU General Public License for more details.
dnl
dnl You should have received a copy of the GNU General Public License
dnl along with this program; if not, write to the Free Software
dnl Foundation, Inc., 51 Franklin Street, Boston, MA 02110-1301, USA.
dnl
dnl As a special exception to the GNU General Public License, if you
dnl distribute this file as part of a program that contains a configuration
dnl script generated by Autoconf, you may include it under the same
dnl distribution terms that you use for the rest of that program.
# -------------------------------------------------------------------------
# Use this macro to configure your C compiler
# When called the macro does the following things:
# 1. It finds an appropriate C compiler.
# If you passed the flag --with-cc=foo then it uses that
# particular compiler
# 2. Check whether the compiler works.
# 3. Checks whether the compiler accepts the -g
# -------------------------------------------------------------------------
AC_DEFUN([LF_CONFIGURE_CC],[
dnl Sing the song
AC_REQUIRE([AC_PROG_CC])dnl
AC_REQUIRE([AC_PROG_CPP])dnl
AC_REQUIRE([AC_AIX])dnl
AC_REQUIRE([AC_ISC_POSIX])dnl
AC_REQUIRE([AC_MINIX])dnl
AC_REQUIRE([AC_HEADER_STDC])dnl
])

121
decoder/config/lf_cxx.m4 Normal file
View File

@ -0,0 +1,121 @@
dnl Autoconf support for C++
dnl Copyright (C) 1988 Eleftherios Gkioulekas <lf@amath.washington.edu>
dnl
dnl This program is free software; you can redistribute it and/or modify
dnl it under the terms of the GNU General Public License as published by
dnl the Free Software Foundation; either version 3 of the License, or
dnl (at your option) any later version.
dnl
dnl This program 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
dnl GNU General Public License for more details.
dnl
dnl You should have received a copy of the GNU General Public License
dnl along with this program; if not, write to the Free Software
dnl Foundation, Inc., 51 Franklin Street, Boston, MA 02110-1301, USA.
dnl
dnl As a special exception to the GNU General Public License, if you
dnl distribute this file as part of a program that contains a configuration
dnl script generated by Autoconf, you may include it under the same
dnl distribution terms that you use for the rest of that program.
# -----------------------------------------------------------------
# This macro should be called to configure your C++ compiler.
# When called, the macro does the following things:
# 1. It finds an appropriate C++ compiler
# If you passed the flag --with-cxx=foo, then it uses that
# particular compiler
# 2. Checks whether the compiler accepts the -g
# ------------------------------------------------------------------
AC_DEFUN([LF_CONFIGURE_CXX],[
AC_REQUIRE([AC_PROG_CXX])dnl
AC_REQUIRE([AC_PROG_CXXCPP])dnl
LF_CXX_PORTABILITY
])
# -----------------------------------------------------------------------
# This macro tests the C++ compiler for various portability problem.
# 1. Defines CXX_HAS_NO_BOOL if the compiler does not support the bool
# data type
# 2. Defines CXX_HAS_BUGGY_FOR_LOOPS if the compiler has buggy
# scoping for the for-loop
# 3. Defines USE_ASSERT if the user wants to use assertions
# -----------------------------------------------------------------------
AC_DEFUN([LF_CXX_PORTABILITY],[
dnl
dnl Check for common C++ portability problems
dnl
dnl AC_LANG_PUSH
dnl AC_LANG_CPLUSPLUS
AC_LANG_SAVE
AC_LANG_CPLUSPLUS
dnl Check whether we have bool
AC_MSG_CHECKING(whether C++ has bool)
AC_TRY_RUN([main() { bool b1=true; bool b2=false; }],
[ AC_MSG_RESULT(yes) ],
[ AC_MSG_RESULT(no)
AC_DEFINE(CXX_HAS_NO_BOOL,[],[Define if C++ is missing bool type]) ],
[ AC_MSG_WARN(Don't cross-compile)]
)
dnl Test whether C++ has buggy for-loops
AC_MSG_CHECKING(whether C++ has buggy scoping in for-loops)
AC_TRY_COMPILE([#include <iostream.h>], [
for (int i=0;i<10;i++) { }
for (int i=0;i<10;i++) { }
], [ AC_MSG_RESULT(no) ],
[ AC_MSG_RESULT(yes)
AC_DEFINE(CXX_HAS_BUGGY_FOR_LOOPS,[],[Define if for loop scoping is broken]) ])
dnl Test whether the user wants to enable assertions
AC_MSG_CHECKING(whether user wants assertions)
AC_ARG_ENABLE(assert,
[ --disable-assert don't use cpp.h assert],
[ AC_DEFINE(NDEBUG,[],[Define to disable asserts (don't doit!)])
AC_MSG_RESULT(no) ],
[ AC_MSG_RESULT(yes) ],
)
dnl Test whether C++ has std::isnan
AC_MSG_CHECKING(whether C++ has std::isnan)
AC_TRY_COMPILE([#include <cmath>], [
std::isnan(0);
], [ AC_MSG_RESULT(yes)
AC_DEFINE(CXX_HAS_STD_ISNAN,[],[Define if has std::isnan]) ],
[ AC_MSG_RESULT(no) ])
dnl Done with the portability checks
dnl AC_LANG_POP([C++])
AC_LANG_RESTORE
])
AH_BOTTOM([// Workaround for compilers with buggy for-loop scoping
// That's quite a few compilers actually including recent versions of
// Dec Alpha cxx, HP-UX CC and SGI CC.
// The trivial "if" statement provides the correct scoping to the
// for loop
#ifdef CXX_HAS_BUGGY_FOR_LOOPS
#undef for
#define for if(1) for
#endif
])
AH_BOTTOM([// If the C++ compiler we use doesn't have bool, then
// the following is a near-perfect work-around.
// You must make sure your code does not depend on "int" and "bool"
// being two different types, in overloading for instance.
#ifdef CXX_HAS_NO_BOOL
#define bool int
#define true 1
#define false 0
#endif
])

View File

@ -0,0 +1,128 @@
dnl Copyright (C) 1988 Eleftherios Gkioulekas <lf@amath.washington.edu>
dnl
dnl This program is free software; you can redistribute it and/or modify
dnl it under the terms of the GNU General Public License as published by
dnl the Free Software Foundation; either version 3 of the License, or
dnl (at your option) any later version.
dnl
dnl This program 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
dnl GNU General Public License for more details.
dnl
dnl You should have received a copy of the GNU General Public License
dnl along with this program; if not, write to the Free Software
dnl Foundation, Inc., 51 Franklin Street, Boston, MA 02110-1301, USA.
dnl
dnl As a special exception to the GNU General Public License, if you
dnl distribute this file as part of a program that contains a configuration
dnl script generated by Autoconf, you may include it under the same
dnl distribution terms that you use for the rest of that program.
# --------------------------------------------------------------------------
# Check whether the C++ compiler accepts a certain flag
# If it does it adds the flag to CXXFLAGS
# If it does not then it returns an error to lf_ok
# Usage:
# LF_CHECK_CXX_FLAG(-flag1 -flag2 -flag3 ...)
# -------------------------------------------------------------------------
AC_DEFUN([LF_CHECK_CXX_FLAG],[
echo 'void f(){}' > conftest.cc
for i in $1
do
AC_MSG_CHECKING([whether $CXX accepts $i])
if test -z "`${CXX} $i -c conftest.cc 2>&1`"
then
CXXFLAGS="${CXXFLAGS} $i"
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
fi
done
rm -f conftest.cc conftest.o
])
# --------------------------------------------------------------------------
# Check whether the C compiler accepts a certain flag
# If it does it adds the flag to CFLAGS
# If it does not then it returns an error to lf_ok
# Usage:
# LF_CHECK_CC_FLAG(-flag1 -flag2 -flag3 ...)
# -------------------------------------------------------------------------
AC_DEFUN([LF_CHECK_CC_FLAG],[
echo 'void f(){}' > conftest.c
for i in $1
do
AC_MSG_CHECKING([whether $CC accepts $i])
if test -z "`${CC} $i -c conftest.c 2>&1`"
then
CFLAGS="${CFLAGS} $i"
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
fi
done
rm -f conftest.c conftest.o
])
# --------------------------------------------------------------------------
# Check whether the Fortran compiler accepts a certain flag
# If it does it adds the flag to FFLAGS
# If it does not then it returns an error to lf_ok
# Usage:
# LF_CHECK_F77_FLAG(-flag1 -flag2 -flag3 ...)
# -------------------------------------------------------------------------
AC_DEFUN([LF_CHECK_F77_FLAG],[
cat << EOF > conftest.f
c....:++++++++++++++++++++++++
PROGRAM MAIN
PRINT*,'Hello World!'
END
EOF
for i in $1
do
AC_MSG_CHECKING([whether $F77 accepts $i])
if test -z "`${F77} $i -c conftest.f 2>&1`"
then
FFLAGS="${FFLAGS} $i"
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
fi
done
rm -f conftest.f conftest.o
])
# ----------------------------------------------------------------------
# Provide the configure script with an --with-warnings option that
# turns on warnings. Call this command AFTER you have configured ALL your
# compilers.
# ----------------------------------------------------------------------
AC_DEFUN([LF_SET_WARNINGS],[
dnl Check for --with-warnings
AC_MSG_CHECKING([whether user wants warnings])
AC_ARG_WITH(warnings,
[ --with-warnings Turn on warnings],
[ lf_warnings=yes ], [ lf_warnings=no ])
lf_warnings=yes # hard code for now -eb
AC_MSG_RESULT($lf_warnings)
dnl Warnings for the two main compilers
cc_warning_flags="-Wall"
cxx_warning_flags="-Wall -Woverloaded-virtual"
if test $lf_warnings = yes
then
if test -n "${CC}"
then
LF_CHECK_CC_FLAG($cc_warning_flags)
fi
if test -n "${CXX}"
then
LF_CHECK_CXX_FLAG($cxx_warning_flags)
fi
fi
])

39
decoder/config/lf_x11.m4 Normal file
View File

@ -0,0 +1,39 @@
dnl Copyright (C) 1988 Eleftherios Gkioulekas <lf@amath.washington.edu>
dnl
dnl This program is free software; you can redistribute it and/or modify
dnl it under the terms of the GNU General Public License as published by
dnl the Free Software Foundation; either version 3 of the License, or
dnl (at your option) any later version.
dnl
dnl This program 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
dnl GNU General Public License for more details.
dnl
dnl You should have received a copy of the GNU General Public License
dnl along with this program; if not, write to the Free Software
dnl Foundation, Inc., 51 Franklin Street, Boston, MA 02110-1301, USA.
dnl
dnl As a special exception to the GNU General Public License, if you
dnl distribute this file as part of a program that contains a configuration
dnl script generated by Autoconf, you may include it under the same
dnl distribution terms that you use for the rest of that program.
#-----------------------------------------------------------------------
# This macro searches for Xlib and when it finds it it adds the
# appropriate flags to CXXFLAGS and export the link sequence to
# the variable XLIB.
# In your configure.in file add:
# LF_PATH_XLIB
# In your Makefile.am add
# program_LDADD = .... $(XLIB)
#------------------------------------------------------------------------
AC_DEFUN([LF_PATH_XLIB],[
AC_PATH_XTRA
CXXFLAGS="$CXXFLAGS $X_CFLAGS"
XLIB="$X_LIBS $X_PRE_LIBS -lX11 $X_EXTRA_LIBS"
AC_SUBST(XLIB)
])

89
decoder/config/mkstemp.m4 Normal file
View File

@ -0,0 +1,89 @@
#serial 4
# On some hosts (e.g., HP-UX 10.20, SunOS 4.1.4, Solaris 2.5.1), mkstemp has a
# silly limit that it can create no more than 26 files from a given template.
# Other systems lack mkstemp altogether.
# On OSF1/Tru64 V4.0F, the system-provided mkstemp function can create
# only 32 files per process.
# On systems like the above, arrange to use the replacement function.
AC_DEFUN([UTILS_FUNC_MKSTEMP],
[dnl
AC_REPLACE_FUNCS(mkstemp)
if test $ac_cv_func_mkstemp = no; then
utils_cv_func_mkstemp_limitations=yes
else
AC_CACHE_CHECK([for mkstemp limitations],
utils_cv_func_mkstemp_limitations,
[
AC_TRY_RUN([
# include <stdlib.h>
int main ()
{
int i;
for (i = 0; i < 70; i++)
{
char template[] = "conftestXXXXXX";
int fd = mkstemp (template);
if (fd == -1)
exit (1);
close (fd);
}
exit (0);
}
],
utils_cv_func_mkstemp_limitations=no,
utils_cv_func_mkstemp_limitations=yes,
utils_cv_func_mkstemp_limitations=yes
)
]
)
fi
if test $utils_cv_func_mkstemp_limitations = yes; then
AC_LIBOBJ(mkstemp)
AC_LIBOBJ(tempname)
AC_DEFINE(mkstemp, rpl_mkstemp,
[Define to rpl_mkstemp if the replacement function should be used.])
gl_PREREQ_MKSTEMP
jm_PREREQ_TEMPNAME
fi
])
# Prerequisites of lib/mkstemp.c.
AC_DEFUN([gl_PREREQ_MKSTEMP],
[
AH_BOTTOM(
[
#ifndef HAVE_MKSTEMP
#ifdef __cplusplus
extern "C" {
#endif
int rpl_mkstemp (char *templ);
#ifdef __cplusplus
}
#endif
#endif
])
])
# Prerequisites of lib/tempname.c.
AC_DEFUN([jm_PREREQ_TEMPNAME],
[
AC_REQUIRE([AC_HEADER_STAT])
AC_CHECK_HEADERS_ONCE(fcntl.h sys/time.h unistd.h)
AC_CHECK_HEADERS(stdint.h)
AC_CHECK_FUNCS(__secure_getenv gettimeofday lstat)
AC_CHECK_DECLS_ONCE(getenv)
# AC_REQUIRE([jm_AC_TYPE_UINTMAX_T])
dnl Under Win32, mkdir prototype in io.h has only one arg
AC_MSG_CHECKING(whether mkdir accepts only one arg)
AC_TRY_COMPILE([#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>], [
mkdir("")
], [ AC_MSG_RESULT(yes)
AC_DEFINE(MKDIR_TAKES_ONE_ARG,[],[Define if mkdir accepts only one arg]) ],
[ AC_MSG_RESULT(no)
])
])

View File

@ -0,0 +1,63 @@
# onceonly.m4 serial 3
dnl Copyright (C) 2002, 2003 Free Software Foundation, Inc.
dnl This file is free software, distributed under the terms of the GNU
dnl General Public License. As a special exception to the GNU General
dnl Public License, this file may be distributed as part of a program
dnl that contains a configuration script generated by Autoconf, under
dnl the same distribution terms as the rest of that program.
dnl This file defines some "once only" variants of standard autoconf macros.
dnl AC_CHECK_HEADERS_ONCE like AC_CHECK_HEADERS
dnl AC_CHECK_FUNCS_ONCE like AC_CHECK_FUNCS
dnl AC_CHECK_DECLS_ONCE like AC_CHECK_DECLS
dnl AC_REQUIRE([AC_HEADER_STDC]) like AC_HEADER_STDC
dnl The advantage is that the check for each of the headers/functions/decls
dnl will be put only once into the 'configure' file. It keeps the size of
dnl the 'configure' file down, and avoids redundant output when 'configure'
dnl is run.
dnl The drawback is that the checks cannot be conditionalized. If you write
dnl if some_condition; then gl_CHECK_HEADERS(stdlib.h); fi
dnl inside an AC_DEFUNed function, the gl_CHECK_HEADERS macro call expands to
dnl empty, and the check will be inserted before the body of the AC_DEFUNed
dnl function.
dnl Autoconf version 2.57 or newer is recommended.
AC_PREREQ(2.54)
# AC_CHECK_HEADERS_ONCE(HEADER1 HEADER2 ...) is a once-only variant of
# AC_CHECK_HEADERS(HEADER1 HEADER2 ...).
AC_DEFUN([AC_CHECK_HEADERS_ONCE], [
:
AC_FOREACH([gl_HEADER_NAME], [$1], [
AC_DEFUN([gl_CHECK_HEADER_]m4_quote(translit(defn([gl_HEADER_NAME]),
[-./], [___])), [
AC_CHECK_HEADERS(gl_HEADER_NAME)
])
AC_REQUIRE([gl_CHECK_HEADER_]m4_quote(translit(gl_HEADER_NAME,
[-./], [___])))
])
])
# AC_CHECK_FUNCS_ONCE(FUNC1 FUNC2 ...) is a once-only variant of
# AC_CHECK_FUNCS(FUNC1 FUNC2 ...).
AC_DEFUN([AC_CHECK_FUNCS_ONCE], [
:
AC_FOREACH([gl_FUNC_NAME], [$1], [
AC_DEFUN([gl_CHECK_FUNC_]defn([gl_FUNC_NAME]), [
AC_CHECK_FUNCS(defn([gl_FUNC_NAME]))
])
AC_REQUIRE([gl_CHECK_FUNC_]defn([gl_FUNC_NAME]))
])
])
# AC_CHECK_DECLS_ONCE(DECL1 DECL2 ...) is a once-only variant of
# AC_CHECK_DECLS(DECL1, DECL2, ...).
AC_DEFUN([AC_CHECK_DECLS_ONCE], [
:
AC_FOREACH([gl_DECL_NAME], [$1], [
AC_DEFUN([gl_CHECK_DECL_]defn([gl_DECL_NAME]), [
AC_CHECK_DECLS(defn([gl_DECL_NAME]))
])
AC_REQUIRE([gl_CHECK_DECL_]defn([gl_DECL_NAME]))
])
])

68
decoder/config/pkg.m4 Normal file
View File

@ -0,0 +1,68 @@
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
dnl If PKG_CONFIG_PATH is not already set, add /usr/local/lib/pkgconfig.
dnl If it's set, assume the user knows what they're doing.
dnl This should help avoid failures while looking for fftw3f
if test -z "$PKG_CONFIG_PATH"; then
export PKG_CONFIG_PATH="/usr/local/lib/pkgconfig"
fi
PKG_CONFIG_MIN_VERSION=0.9.0
if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
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)
AC_MSG_CHECKING($1_INCLUDEDIR)
$1_INCLUDEDIR=`$PKG_CONFIG --variable=includedir "$2"`
AC_MSG_RESULT($$1_INCLUDEDIR)
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)
AC_SUBST($1_INCLUDEDIR)
else
echo "*** Your version of pkg-config is too old. You need version $PKG_CONFIG_MIN_VERSION or newer."
echo "*** See http://www.freedesktop.org/software/pkgconfig"
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
])

View File

@ -0,0 +1,56 @@
dnl
dnl Copyright 2003 Free Software Foundation, Inc.
dnl
dnl This file is part of OP25
dnl
dnl OP25 is free software; you can redistribute it and/or modify
dnl it under the terms of the GNU General Public License as published by
dnl the Free Software Foundation; either version 3, or (at your option)
dnl any later version.
dnl
dnl OP25 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
dnl GNU General Public License for more details.
dnl
dnl You should have received a copy of the GNU General Public License
dnl along with OP25; see the file COPYING. If not, write to
dnl the Free Software Foundation, Inc., 51 Franklin Street,
dnl Boston, MA 02110-1301, USA.
dnl
AC_DEFUN([USRP_SET_FUSB_TECHNIQUE],[
AC_REQUIRE([AC_CANONICAL_HOST])
AC_ARG_WITH(fusb-tech,
[ --with-fusb-tech=OS set fast usb technique (auto)],
[cf_with_fusb_tech="$withval"],
[cf_with_fusb_tech="$host_os"])
AC_CHECK_HEADER([linux/usbdevice_fs.h],
[x_have_usbdevice_fs_h=yes],
[x_have_usbdevice_fs_h=no])
AC_MSG_CHECKING([for fast usb technique to use])
case "$cf_with_fusb_tech" in
linux*) if test x${x_have_usbdevice_fs_h} = xyes;
then
FUSB_TECH=linux
else
FUSB_TECH=generic
fi ;;
darwin*) FUSB_TECH=darwin ;;
cygwin*|win*|mingw*) FUSB_TECH=win32 ;;
*) FUSB_TECH=generic ;;
esac
AC_MSG_RESULT($FUSB_TECH)
AC_SUBST(FUSB_TECH)
AM_CONDITIONAL(FUSB_TECH_darwin, test $FUSB_TECH = darwin)
AM_CONDITIONAL(FUSB_TECH_win32, test $FUSB_TECH = win32)
AM_CONDITIONAL(FUSB_TECH_generic, test $FUSB_TECH = generic)
AM_CONDITIONAL(FUSB_TECH_linux, test $FUSB_TECH = linux)
])

View File

@ -0,0 +1,43 @@
# Check for libusb support. -*- Autoconf -*-
# Copyright 2003 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 3, or (at your option)
# any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You 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, Boston, MA
# 02110-1301, USA.
AC_DEFUN([USRP_LIBUSB],
[
AC_REQUIRE([AC_CANONICAL_HOST])
AC_LANG_PUSH(C)
AC_CHECK_HEADERS([usb.h],
[],
[ AC_MSG_ERROR([USRP requires libusb. usb.h not found, stop. See http://libusb.sf.net]) ]
)
save_LIBS="$LIBS"
case "$host_os" in
darwin*) LIBS="$LIBS -lIOKit" ;;
*) ;;
esac
AC_SEARCH_LIBS(usb_bulk_write, [usb],
[ USB_LIBS="$LIBS" ],
[ AC_MSG_ERROR([USRP requires libusb. usb_bulk_write not found, stop. See http://libusb.sf.net]) ]
)
LIBS="$save_LIBS"
AC_LANG_POP
AC_SUBST(USB_LIBS)
])

View File

@ -0,0 +1,67 @@
# Check for sdcc support. -*- Autoconf -*-
# Copyright 2004 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 3, or (at your option)
# any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You 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, Boston, MA
# 02110-1301, USA.
AC_DEFUN([USRP_SDCC],
[
AC_CHECK_PROG(XCC, sdcc, sdcc -mmcs51 --no-xinit-opt,no)
AC_CHECK_PROG(XAS, asx8051, asx8051 -plosgff,no)
if test "$XCC" = "no" -o "$XAS" = "no" ; then
AC_MSG_ERROR([USRP requires sdcc. sdcc not found, stop. See http://sdcc.sf.net])
fi
sdcc_version_min=$1
sdcc_version=`sdcc --version 2>&1 | \
sed 's/\(SDCC.* \)\([[0-9]]*\.[[0-9]]*\.[[0-9]]*\)\( .*$\)/\2/'`
AC_MSG_CHECKING([sdcc_version "$sdcc_version"])
sdcc_major_version=`echo $sdcc_version | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
sdcc_minor_version=`echo $sdcc_version | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
sdcc_micro_version=`echo $sdcc_version | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
sdcc_major_min=`echo $sdcc_version_min | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
sdcc_minor_min=`echo $sdcc_version_min | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
sdcc_micro_min=`echo $sdcc_version_min | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
sdcc_version_proper=`expr \
"$sdcc_major_version" \> "$sdcc_major_min" \| \
"$sdcc_major_version" \= "$sdcc_major_min" \& \
"$sdcc_minor_version" \> "$sdcc_minor_min" \| \
"$sdcc_major_version" \= "$sdcc_major_min" \& \
"$sdcc_minor_version" \= "$sdcc_minor_min" \& \
"$sdcc_micro_version" \>= "$sdcc_micro_min" `
if test "$sdcc_version_proper" = "1" ; then
AC_MSG_RESULT([$sdcc_major_version.$sdcc_minor_version.$sdcc_micro_version])
else
AC_MSG_ERROR([USRP requires sdcc >= $sdcc_version_min. sdcc not found, stop. See http://sdcc.sf.net])
fi
AC_SUBST(XCC)
AC_SUBST(XAS)
])

104
decoder/configure.ac Normal file
View File

@ -0,0 +1,104 @@
dnl
dnl Copyright 2004,2005 Free Software Foundation, Inc.
dnl
dnl This file is part of OP25
dnl
dnl OP25 is free software; you can redistribute it and/or modify
dnl it under the terms of the GNU General Public License as published by
dnl the Free Software Foundation; either version 3, or (at your option)
dnl any later version.
dnl
dnl OP25 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
dnl GNU General Public License for more details.
dnl
dnl You should have received a copy of the GNU General Public License
dnl along with OP25; see the file COPYING. If not, write to
dnl the Free Software Foundation, Inc., 51 Franklin Street,
dnl Boston, MA 02110-1301, USA.
dnl
AC_INIT
AC_PREREQ(2.57)
AC_CONFIG_SRCDIR([src/lib/op25.i])
AM_CONFIG_HEADER(config.h)
AC_CANONICAL_TARGET([])
AM_INIT_AUTOMAKE(op25,0.0.1)
GR_X86_64
dnl LF_CONFIGURE_CC
LF_CONFIGURE_CXX
LF_SET_WARNINGS
GR_SET_GPROF
GR_SET_PROF
AM_PROG_AS
AC_PROG_LN_S
AC_PROG_MAKE_SET
AC_PROG_INSTALL
AC_PATH_PROG([RM_PROG], [rm])
AC_LIBTOOL_WIN32_DLL
AC_ENABLE_SHARED dnl do build shared libraries
AC_DISABLE_STATIC dnl don't build static libraries
AC_PROG_LIBTOOL
dnl Locate python, SWIG, etc
GR_NO_UNDEFINED
GR_SCRIPTING
dnl Checks for libraries.
dnl check for threads (mandatory)
GR_OMNITHREAD
CFLAGS="${CFLAGS} $PTHREAD_CFLAGS"
CXXFLAGS="${CXXFLAGS} $PTHREAD_CFLAGS"
if test "x$CXX_FOR_BUILD" = x
then
CXX_FOR_BUILD=${CXX}
fi
AC_SUBST(CXX_FOR_BUILD)
dnl Checks for header files.
AC_HEADER_STDC
AC_HEADER_SYS_WAIT
AC_CHECK_HEADERS(fcntl.h limits.h strings.h sys/ioctl.h sys/time.h unistd.h)
AC_CHECK_HEADERS(sys/mman.h)
dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_C_INLINE
AC_TYPE_SIZE_T
AC_HEADER_TIME
dnl Checks for library functions.
AC_CHECK_FUNCS([])
dnl Check for Mingw support
GR_PWIN32
PKG_CHECK_MODULES(GNURADIO_CORE, gnuradio-core >= 2)
LIBS="$LIBS $GNURADIO_CORE_LIBS"
dnl Define where to find boost includes
dnl defines BOOST_CFLAGS
GR_REQUIRE_BOOST_INCLUDES
STD_DEFINES_AND_INCLUDES="$GNURADIO_CORE_CFLAGS $BOOST_CFLAGS"
AC_SUBST(STD_DEFINES_AND_INCLUDES)
AC_CONFIG_FILES([\
Makefile \
config/Makefile \
src/Makefile \
src/lib/Makefile \
src/python/Makefile \
src/python/run_tests \
])
dnl run_tests is created from run_tests.in. Make it executable.
AC_CONFIG_COMMANDS([run_tests], [chmod +x src/python/run_tests])
AC_OUTPUT

22
decoder/src/Makefile.am Normal file
View File

@ -0,0 +1,22 @@
#
# Copyright 2004 Free Software Foundation, Inc.
#
# This file is part of OP25
#
# OP25 is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your option)
# any later version.
#
# OP25 is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
# License for more details.
#
# You should have received a copy of the GNU General Public License
# along with OP25; see the file COPYING. If not, write to the Free
# Software Foundation, Inc., 51 Franklin Street, Boston, MA
# 02110-1301, USA.
#
SUBDIRS = lib python

View File

@ -0,0 +1,93 @@
#
# Copyright 2004,2005,2006,2008 Free Software Foundation, Inc.
#
# This file is part of OP25
#
# OP25 is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your option)
# any later version.
#
# OP25 is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
# License for more details.
#
# You should have received a copy of the GNU General Public License
# along with OP25; see the file COPYING. If not, write to the Free
# Software Foundation, Inc., 51 Franklin Street, Boston, MA
# 02110-1301, USA.
#
include $(top_srcdir)/Makefile.common
# Install this stuff so that it ends up as the gr.apco_p25_decoder
# module. This usually ends up at:
# ${prefix}/lib/python${python_version}/site-packages/gnuradio
ourpythondir = $(grpythondir)
ourlibdir = $(grpyexecdir)
AM_CPPFLAGS = $(STD_DEFINES_AND_INCLUDES) $(PYTHON_CPPFLAGS) $(WITH_INCLUDES)
SWIGPYTHONARGS = $(SWIGPYTHONFLAGS) $(SWIGGRFLAGS) $(WITH_SWIG_INCLUDES) \
$(WITH_INCLUDES)
ALL_IFILES = \
$(LOCAL_IFILES) \
$(NON_LOCAL_IFILES)
NON_LOCAL_IFILES = \
$(GNURADIO_CORE_INCLUDEDIR)/swig/gnuradio.i
LOCAL_IFILES = \
$(top_srcdir)/src/lib/op25.i
# These files are built by SWIG. The first is the C++ glue.
# The second is the python wrapper that loads the _op25 shared library
# and knows how to call our extensions.
BUILT_SOURCES = \
op25.cc \
op25.py
# This gets op25.py installed in the right place
ourpython_PYTHON = \
op25.py
ourlib_LTLIBRARIES = _op25.la
# These are the source files that go into the shared library
_op25_la_SOURCES = \
op25.cc \
gr_apco_p25_decoder_f.cc
# magic flags
_op25_la_LDFLAGS = $(NO_UNDEFINED) -module -avoid-version
# link the library against some comon swig runtime code and the
# c++ standard library
_op25_la_LIBADD = \
$(PYTHON_LDFLAGS) \
-lstdc++
op25.cc op25.py: $(LOCAL_IFILES) $(ALL_IFILES)
$(SWIG) $(SWIGPYTHONARGS) -module gr -o op25.cc $(LOCAL_IFILES)
# These headers get installed in ${prefix}/include/gnuradio
grinclude_HEADERS = \
gr_apco_p25_decoder_f.h
# These swig headers get installed in ${prefix}/include/gnuradio/swig
swiginclude_HEADERS = \
$(LOCAL_IFILES)
MOSTLYCLEANFILES = $(BUILT_SOURCES) *.pyc
# Don't distribute output of swig
dist-hook:
@for file in $(BUILT_SOURCES); do echo $(RM) $(distdir)/$$file; done
@for file in $(BUILT_SOURCES); do $(RM) $(distdir)/$$file; done

View File

@ -0,0 +1,85 @@
/* -*- C++ -*- */
/*
* Copyright 2008 Steve Glass
*
* This file is part of OP25.
*
* OP25 is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3, or (at your option)
* any later version.
*
* OP25 is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
* License for more details.
*
* You should have received a copy of the GNU General Public License
* along with OP25; see the file COPYING. If not, write to the Free
* Software Foundation, Inc., 51 Franklin Street, Boston, MA
* 02110-1301, USA.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <gr_apco_p25_decoder_f.h>
#include <gr_io_signature.h>
/*
* The private constructor.
*/
gr_apco_p25_decoder_f::gr_apco_p25_decoder_f() :
gr_block("apco_p25_decoder_f",
gr_make_io_signature(1, 1, sizeof(float)),
gr_make_io_signature(0, 0, sizeof(float)))
{
}
/*
* Destruct an instance of this class.
*/
gr_apco_p25_decoder_f::~gr_apco_p25_decoder_f()
{
}
/*
* Given output request for noutput_items return number of input items
* required. This block doesn't produce an output stream so this just
* returns its input.
*/
void
gr_apco_p25_decoder_f::forecast(int nof_output_items, gr_vector_int& nof_inputs_required)
{
int items = nof_output_items;
for(size_t i = 0; i < nof_inputs_required.size(); ++i)
nof_inputs_required[i] = items;
}
/*
* Take an incoming float value, convert to a symbol and process.
*/
int
gr_apco_p25_decoder_f::general_work(int nof_output_items,
gr_vector_int& nof_input_items,
gr_vector_const_void_star& input_items,
gr_vector_void_star& output_items)
{
// const float *in = reinterpret_cast<const float*>(&input_items[0]);
// ToDo: decode input
consume_each(nof_output_items); // tell runtime how many items we consumed
return 0; // tell runtime system how many items we produced.
}
/*
* Create a new instance of gr_apco_p25_decoder_f and wrap it in a
* shared_ptr. This is effectively the public constructor.
*/
gr_apco_p25_decoder_f_sptr
gr_make_apco_p25_decoder_f()
{
return gr_apco_p25_decoder_f_sptr(new gr_apco_p25_decoder_f);
}

View File

@ -0,0 +1,56 @@
/* -*- C++ -*- */
/*
* Copyright 2008 Steve Glass
*
* This file is part of OP25.
*
* OP25 is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3, or (at your option)
* any later version.
*
* OP25 is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
* License for more details.
*
* You should have received a copy of the GNU General Public License
* along with OP25; see the file COPYING. If not, write to the Free
* Software Foundation, Inc., 51 Franklin Street, Boston, MA
* 02110-1301, USA.
*/
#ifndef INCLUDED_GR_APCO_P25_DECODER_F_H
#define INCLUDED_GR_APCO_P25_DECODER_F_H
#include <gr_block.h>
#include <gr_msg_queue.h>
typedef unsigned char dibit;
typedef boost::shared_ptr<class gr_apco_p25_decoder_f> gr_apco_p25_decoder_f_sptr;
/*
* gr_apco_p25_decoder_f is a GNU Radio block for decoding APCO P25
* signals. This file expects its input to be a stream of symbols
* from an appropriate demodulator and is a signal sink that produces
* no outputs.
*/
class gr_apco_p25_decoder_f : public gr_block
{
public:
virtual ~gr_apco_p25_decoder_f();
virtual void forecast(int nof_output_items, gr_vector_int &nof_inputs_required);
virtual int general_work(int nof_output_items,
gr_vector_int& nof_input_items,
gr_vector_const_void_star& input_items,
gr_vector_void_star& output_items);
private:
friend gr_apco_p25_decoder_f_sptr gr_make_apco_p25_decoder_f(); // expose class to public ctor
gr_apco_p25_decoder_f();
private:
};
gr_apco_p25_decoder_f_sptr gr_make_apco_p25_decoder_f();
#endif /* INCLUDED_GR_APCO_P25_DECODER_F_H */

35
decoder/src/lib/op25.i Normal file
View File

@ -0,0 +1,35 @@
/* -*- C++ -*- */
%feature("autodoc", "1");
%include "exception.i"
%import "gnuradio.i"
%{
#include "gnuradio_swig_bug_workaround.h"
#include "gr_apco_p25_decoder_f.h"
#include <stdexcept>
%}
/*
* First arg is the package prefix.
* Second arg is the name of the class minus the prefix.
*
* This does some behind-the-scenes magic so we can access
* apco_p25_decoder_f from python as gr.apco_p25_decoder_f
*/
GR_SWIG_BLOCK_MAGIC(gr, apco_p25_decoder_f);
/*
* Publically accesible constuctor function for apco_p25_decoder_f.
*/
gr_apco_p25_decoder_f_sptr gr_make_apco_p25_decoder_f();
/*
* The actual gr_apco_p25_decoder block.
*/
class gr_apco_p25_decoder_f : public gr_sync_block
{
private:
gr_apco_p25_decoder_f();
};

View File

@ -0,0 +1,32 @@
#
# Copyright 2004 Free Software Foundation, Inc.
#
# This file is part of OP25
#
# OP25 is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your option)
# any later version.
#
# OP25 is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
# License for more details.
#
# You should have received a copy of the GNU General Public License
# along with OP25; see the file COPYING. If not, write to the Free
# Software Foundation, Inc., 51 Franklin Street, Boston, MA
# 02110-1301, USA.
#
include $(top_srcdir)/Makefile.common
EXTRA_DIST = run_tests.in
TESTS = \
run_tests
noinst_PYTHON = \
qa_apco_p25_decoder.py

View File

@ -0,0 +1,42 @@
#!/usr/bin/env python
#
# Copyright 2008 Stevie Glass
#
# This file is part of OP25
#
# OP25 is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your option)
# any later version.
#
# OP25 is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
# License for more details.
#
# You should have received a copy of the GNU General Public License
# along with OP25; see the file COPYING. If not, write to the Free
# Software Foundation, Inc., 51 Franklin Street, Boston, MA
# 02110-1301, USA.
#
from gnuradio import gr, gr_unittest
class qa_apco_p25_decoder (gr_unittest.TestCase):
def setUp(self):
self.fg = gr.flow_graph ()
def tearDown(self):
self.fg = None
def test_constuct_apco_p25_decoder_f(self):
framing_sequence = ()
src = gr.vector_source_f(framing_sequence)
p25 = gr.apco_25_decoder_f()
self.fg.connect(src, p25)
self.fg.run()
# no meaningful external test at present
if __name__ == '__main__':
gr_unittest.main ()

View File

@ -0,0 +1,50 @@
#!/bin/sh
# All this strange PYTHONPATH manipulation is required to run our
# tests using our just built shared library and swig-generated python
# code prior to installation.
# build tree == src tree unless you're doing a VPATH build.
# If you don't know what a VPATH build is, you're not doing one. Relax...
prefix=@prefix@
exec_prefix=@exec_prefix@
# Where to look in the build tree for our shared library
libbld=@abs_top_builddir@/src/lib
# Where to look in the src tree for swig generated python code
libsrc=@abs_top_srcdir@/src/lib
# Where to look in the src tree for hand written python code
py=@abs_top_srcdir@/src/python
# Where to look for installed GNU Radio python modules
# FIXME this is wrong on a distcheck. We really need to ask gnuradio-core
# where it put its python files.
installed_pythondir=@pythondir@
installed_pyexecdir=@pyexecdir@
PYTHONPATH="$libbld:$libbld/.libs:$libsrc:$py:$installed_pythondir:$installed_pyexecdir:$PYTHONPATH"
#PYTHONPATH="$libbld:$libbld/.libs:$libsrc:$py:$installed_pythondir:$installed_pyexecdir"
export PYTHONPATH
#
# This is the simple part...
# Run everything that matches qa_*.py and return the final result.
#
ok=yes
for file in @srcdir@/qa_*.py
do
if ! $file
then
ok=no
fi
done
if [ $ok = yes ]
then
exit 0
else
exit 1
fi