aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--AUTHORS18
-rw-r--r--COPYING674
-rw-r--r--ChangeLog36
-rw-r--r--INSTALL31
-rw-r--r--Makefile.am21
-rw-r--r--Makefile.in720
-rw-r--r--NEWS0
-rw-r--r--README44
-rw-r--r--TODO0
-rw-r--r--aclocal.m4986
-rwxr-xr-xbuild-aux/compile143
-rwxr-xr-xbuild-aux/config.guess1511
-rwxr-xr-xbuild-aux/config.sub1705
-rwxr-xr-xbuild-aux/depcomp630
-rwxr-xr-xbuild-aux/install-sh520
-rwxr-xr-xbuild-aux/missing376
-rw-r--r--config.h.in269
-rwxr-xr-xconfigure7416
-rw-r--r--configure.ac272
-rw-r--r--doc/CVS/Entries2
-rw-r--r--doc/CVS/Repository1
-rw-r--r--doc/CVS/Root1
-rw-r--r--doc/DabMux.1584
-rw-r--r--lib/Makefile.am19
-rw-r--r--lib/Makefile.in558
-rw-r--r--lib/farsync/Makefile.am1
-rw-r--r--lib/farsync/Makefile.in338
-rw-r--r--lib/farsync/linux/CVS/Entries2
-rw-r--r--lib/farsync/linux/CVS/Repository1
-rw-r--r--lib/farsync/linux/CVS/Root1
-rw-r--r--lib/farsync/linux/farsync.h507
-rw-r--r--lib/farsync/windows/CVS/Entries4
-rw-r--r--lib/farsync/windows/CVS/Repository1
-rw-r--r--lib/farsync/windows/CVS/Root1
-rw-r--r--lib/farsync/windows/fscfg.h574
-rw-r--r--lib/farsync/windows/sdci.h700
-rw-r--r--lib/farsync/windows/smcuser.h451
-rw-r--r--src/DabMux.cpp3549
-rw-r--r--src/Dmb.cpp280
-rw-r--r--src/Dmb.h81
-rw-r--r--src/Eti.cpp70
-rw-r--r--src/Eti.h96
-rw-r--r--src/InetAddress.cpp259
-rw-r--r--src/InetAddress.h91
-rw-r--r--src/Interleaver.cpp143
-rw-r--r--src/Interleaver.h56
-rw-r--r--src/Makefile.am66
-rw-r--r--src/Makefile.in1146
-rw-r--r--src/PcDebug.h76
-rw-r--r--src/ReedSolomon.cpp105
-rw-r--r--src/ReedSolomon.h52
-rw-r--r--src/TcpLog.cpp330
-rw-r--r--src/TcpLog.h69
-rw-r--r--src/TcpServer.cpp243
-rw-r--r--src/TcpServer.h84
-rw-r--r--src/TcpSocket.cpp366
-rw-r--r--src/TcpSocket.h97
-rw-r--r--src/UdpSocket.cpp455
-rw-r--r--src/UdpSocket.h126
-rw-r--r--src/bridge.c515
-rw-r--r--src/bridge.h112
-rw-r--r--src/crc.c266
-rw-r--r--src/crc.h59
-rw-r--r--src/dabInput.cpp51
-rw-r--r--src/dabInput.h52
-rw-r--r--src/dabInputBridgeUdp.cpp124
-rw-r--r--src/dabInputBridgeUdp.h49
-rw-r--r--src/dabInputDabplusFifo.cpp186
-rw-r--r--src/dabInputDabplusFifo.h54
-rw-r--r--src/dabInputDabplusFile.cpp176
-rw-r--r--src/dabInputDabplusFile.h62
-rw-r--r--src/dabInputDmbFile.cpp161
-rw-r--r--src/dabInputDmbFile.h49
-rw-r--r--src/dabInputDmbUdp.cpp191
-rw-r--r--src/dabInputDmbUdp.h49
-rw-r--r--src/dabInputEnhancedFifo.cpp64
-rw-r--r--src/dabInputEnhancedFifo.h46
-rw-r--r--src/dabInputEnhancedPacketFile.cpp53
-rw-r--r--src/dabInputEnhancedPacketFile.h47
-rw-r--r--src/dabInputFifo.cpp513
-rw-r--r--src/dabInputFifo.h101
-rw-r--r--src/dabInputFile.cpp104
-rw-r--r--src/dabInputFile.h49
-rw-r--r--src/dabInputMpegFifo.cpp47
-rw-r--r--src/dabInputMpegFifo.h37
-rw-r--r--src/dabInputMpegFile.cpp201
-rw-r--r--src/dabInputMpegFile.h42
-rw-r--r--src/dabInputPacketFile.cpp263
-rw-r--r--src/dabInputPacketFile.h46
-rw-r--r--src/dabInputPrbs.cpp146
-rw-r--r--src/dabInputPrbs.h56
-rw-r--r--src/dabInputRawFifo.cpp193
-rw-r--r--src/dabInputRawFifo.h63
-rw-r--r--src/dabInputRawFile.cpp59
-rw-r--r--src/dabInputRawFile.h45
-rw-r--r--src/dabInputSlip.cpp408
-rw-r--r--src/dabInputSlip.h52
-rw-r--r--src/dabInputTest.cpp105
-rw-r--r--src/dabInputTest.h50
-rw-r--r--src/dabInputUdp.cpp189
-rw-r--r--src/dabInputUdp.h59
-rw-r--r--src/dabOutput.cpp1112
-rw-r--r--src/dabOutput.h72
-rw-r--r--src/dabUtils.cpp52
-rw-r--r--src/dabUtils.h35
-rw-r--r--src/mpeg.c221
-rw-r--r--src/mpeg.h82
-rw-r--r--src/prbs.c140
-rw-r--r--src/prbs.h61
109 files changed, 33927 insertions, 0 deletions
diff --git a/AUTHORS b/AUTHORS
new file mode 100644
index 0000000..b4fba38
--- /dev/null
+++ b/AUTHORS
@@ -0,0 +1,18 @@
+Jean-Daniel Langlois <> for
+the Communications Research Centre, Ottawa, Canada, 2002:
+ Fisrt version of DabMux.cpp (a.k.a. createETI.cpp)
+
+Pascal Charest <pascal [dot] charest [at] crc [dot] ca> for
+the Communications Research Centre, Ottawa, Canada, 2002-2009:
+ All files.
+
+Jean-Michel Bouffard <jean-michel [dot] bouffard [at] crc [dot] ca> for
+the Communications Research Centre, Ottawa, Canada, 2004:
+ Minor changes for crc.c, DabMux.cpp
+
+Martin-Pierre Lussier <martin-pierre [dot] lussier [at] crc [dot] ca> for
+the Communications Research Centre, Ottawa, Canada, 2004, 2006:
+ Minor changes for PcDebug.h, bridge.c, bridge.h, dabOutput.cpp
+
+FarSite Communications Ltd.
+ All files included in lib/farsite/
diff --git a/COPYING b/COPYING
new file mode 100644
index 0000000..94a9ed0
--- /dev/null
+++ b/COPYING
@@ -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>.
diff --git a/ChangeLog b/ChangeLog
new file mode 100644
index 0000000..10758a3
--- /dev/null
+++ b/ChangeLog
@@ -0,0 +1,36 @@
+2011-05-24 Pascal Charest <pascal.charest@crc.ca>
+
+ * src/DabMux.cpp: Changed for more precise messages.
+ * src/DabMux.cpp: Added ECC support.
+ * src/dabInputFile.cpp: Removed unused macros, which solved unitialised bug.
+ * src/dabInputPacketFile.cpp: Removed unused macros, which solved unitialised bug.
+
+2010-08-23 Pascal Charest <pascal.charest@crc.ca>
+
+ * src/DabMux.cpp: Added UDP input for data subchannel (bug).
+
+2010-06-24 Pascal Charest <pascal.charest@crc.ca>
+
+ * src/DabMux.cpp: Added support for timestamp.
+
+2010-06-17 Pascal Charest <pascal.charest@crc.ca>
+
+ * src/DabMux.cpp: Solved FIC date bug.
+
+Copyright (C) 2010,2011 Her Majesty the Queen in Right of Canada
+(Communications Research Center Canada)
+
+This file is part of CRC-DabMux.
+
+CRC-DabMux is free software: you can 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.
+
+CRC-DabMux is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with CRC-DabMux. If not, see <http://www.gnu.org/licenses/>.
diff --git a/INSTALL b/INSTALL
new file mode 100644
index 0000000..b71c676
--- /dev/null
+++ b/INSTALL
@@ -0,0 +1,31 @@
+Required dependencies:
+======================
+
+ * libfec from Phil Karn: http://www.ka9q.net/code/fec/
+
+Simple install procedure:
+=========================
+
+ % wget http://www.ka9q.net/code/fec/fec-3.0.1.tar.bz2
+ # Download libfec
+ % tar xjf fec-3.0.1.tar.bz2 # Unpack the library source
+ % cd fec-3.0.1 # Change to the library directory
+ % ./configure # Run the configure script
+ % make # Build the library
+ [as root]
+ % make install # Install the library
+
+ % tar xjf crc-dabmux-0.3.0.4.tar.bz2 # Unpack the source
+ % cd crc-dabmux-0.3.0.4 # Change to the source directory
+ % ./configure # Run the configure script
+ % make # Build CRC-DabMux
+ [ as root ]
+ % make install # Install CRC-DabMux
+
+
+Advanced install procedure:
+===========================
+
+The configure script can be launch with a variety of options, launch the
+following command for a complete list:
+ % ./configure --help
diff --git a/Makefile.am b/Makefile.am
new file mode 100644
index 0000000..ea808a3
--- /dev/null
+++ b/Makefile.am
@@ -0,0 +1,21 @@
+# Copyright (C) 2008, 2009 Her Majesty the Queen in Right of Canada
+# (Communications Research Center Canada)
+
+# This file is part of CRC-DabMux.
+#
+# CRC-DabMux is free software: you can 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.
+#
+# CRC-DabMux is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with CRC-DabMux. If not, see <http://www.gnu.org/licenses/>.
+
+SUBDIRS =src lib
+
+EXTRA_DIST =COPYING NEWS README AUTHORS ChangeLog TODO doc
diff --git a/Makefile.in b/Makefile.in
new file mode 100644
index 0000000..c139743
--- /dev/null
+++ b/Makefile.in
@@ -0,0 +1,720 @@
+# Makefile.in generated by automake 1.11.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
+# Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+# Copyright (C) 2008, 2009 Her Majesty the Queen in Right of Canada
+# (Communications Research Center Canada)
+
+# This file is part of CRC-DabMux.
+#
+# CRC-DabMux is free software: you can 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.
+#
+# CRC-DabMux is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with CRC-DabMux. If not, see <http://www.gnu.org/licenses/>.
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = .
+DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \
+ $(srcdir)/Makefile.in $(srcdir)/config.h.in \
+ $(top_srcdir)/configure AUTHORS COPYING ChangeLog INSTALL NEWS \
+ TODO build-aux/compile build-aux/config.guess \
+ build-aux/config.sub build-aux/depcomp build-aux/install-sh \
+ build-aux/missing
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
+ configure.lineno config.status.lineno
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+SOURCES =
+DIST_SOURCES =
+RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
+ html-recursive info-recursive install-data-recursive \
+ install-dvi-recursive install-exec-recursive \
+ install-html-recursive install-info-recursive \
+ install-pdf-recursive install-ps-recursive install-recursive \
+ installcheck-recursive installdirs-recursive pdf-recursive \
+ ps-recursive uninstall-recursive
+RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
+ distclean-recursive maintainer-clean-recursive
+AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \
+ $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \
+ distdir dist dist-all distcheck
+ETAGS = etags
+CTAGS = ctags
+DIST_SUBDIRS = $(SUBDIRS)
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+distdir = $(PACKAGE)-$(VERSION)
+top_distdir = $(distdir)
+am__remove_distdir = \
+ { test ! -d "$(distdir)" \
+ || { find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \
+ && rm -fr "$(distdir)"; }; }
+am__relativize = \
+ dir0=`pwd`; \
+ sed_first='s,^\([^/]*\)/.*$$,\1,'; \
+ sed_rest='s,^[^/]*/*,,'; \
+ sed_last='s,^.*/\([^/]*\)$$,\1,'; \
+ sed_butlast='s,/*[^/]*$$,,'; \
+ while test -n "$$dir1"; do \
+ first=`echo "$$dir1" | sed -e "$$sed_first"`; \
+ if test "$$first" != "."; then \
+ if test "$$first" = ".."; then \
+ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
+ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
+ else \
+ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
+ if test "$$first2" = "$$first"; then \
+ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
+ else \
+ dir2="../$$dir2"; \
+ fi; \
+ dir0="$$dir0"/"$$first"; \
+ fi; \
+ fi; \
+ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
+ done; \
+ reldir="$$dir2"
+DIST_ARCHIVES = $(distdir).tar.gz
+GZIP_ENV = --best
+distuninstallcheck_listfiles = find . -type f -print
+distcleancheck_listfiles = find . -type f -print
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BUILD_HOST = @BUILD_HOST@
+BUILD_TARGET = @BUILD_TARGET@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FARSYNC_DIR = @FARSYNC_DIR@
+GETOPT = @GETOPT@
+GREP = @GREP@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MKDIR_P = @MKDIR_P@
+OBJEXT = @OBJEXT@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+VERSION = @VERSION@
+WSOCK32 = @WSOCK32@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+SUBDIRS = src lib
+EXTRA_DIST = COPYING NEWS README AUTHORS ChangeLog TODO doc
+all: config.h
+ $(MAKE) $(AM_MAKEFLAGS) all-recursive
+
+.SUFFIXES:
+am--refresh:
+ @:
+$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ echo ' cd $(srcdir) && $(AUTOMAKE) --gnu'; \
+ $(am__cd) $(srcdir) && $(AUTOMAKE) --gnu \
+ && exit 0; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \
+ $(am__cd) $(top_srcdir) && \
+ $(AUTOMAKE) --gnu Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ echo ' $(SHELL) ./config.status'; \
+ $(SHELL) ./config.status;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ $(SHELL) ./config.status --recheck
+
+$(top_srcdir)/configure: $(am__configure_deps)
+ $(am__cd) $(srcdir) && $(AUTOCONF)
+$(ACLOCAL_M4): $(am__aclocal_m4_deps)
+ $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
+$(am__aclocal_m4_deps):
+
+config.h: stamp-h1
+ @if test ! -f $@; then \
+ rm -f stamp-h1; \
+ $(MAKE) $(AM_MAKEFLAGS) stamp-h1; \
+ else :; fi
+
+stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status
+ @rm -f stamp-h1
+ cd $(top_builddir) && $(SHELL) ./config.status config.h
+$(srcdir)/config.h.in: $(am__configure_deps)
+ ($(am__cd) $(top_srcdir) && $(AUTOHEADER))
+ rm -f stamp-h1
+ touch $@
+
+distclean-hdr:
+ -rm -f config.h stamp-h1
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run `make' without going through this Makefile.
+# To change the values of `make' variables: instead of editing Makefiles,
+# (1) if the variable is set in `config.status', edit `config.status'
+# (which will cause the Makefiles to be regenerated when you run `make');
+# (2) otherwise, pass the desired values on the `make' command line.
+$(RECURSIVE_TARGETS):
+ @fail= failcom='exit 1'; \
+ for f in x $$MAKEFLAGS; do \
+ case $$f in \
+ *=* | --[!k]*);; \
+ *k*) failcom='fail=yes';; \
+ esac; \
+ done; \
+ dot_seen=no; \
+ target=`echo $@ | sed s/-recursive//`; \
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ echo "Making $$target in $$subdir"; \
+ if test "$$subdir" = "."; then \
+ dot_seen=yes; \
+ local_target="$$target-am"; \
+ else \
+ local_target="$$target"; \
+ fi; \
+ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+ || eval $$failcom; \
+ done; \
+ if test "$$dot_seen" = "no"; then \
+ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+ fi; test -z "$$fail"
+
+$(RECURSIVE_CLEAN_TARGETS):
+ @fail= failcom='exit 1'; \
+ for f in x $$MAKEFLAGS; do \
+ case $$f in \
+ *=* | --[!k]*);; \
+ *k*) failcom='fail=yes';; \
+ esac; \
+ done; \
+ dot_seen=no; \
+ case "$@" in \
+ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+ *) list='$(SUBDIRS)' ;; \
+ esac; \
+ rev=''; for subdir in $$list; do \
+ if test "$$subdir" = "."; then :; else \
+ rev="$$subdir $$rev"; \
+ fi; \
+ done; \
+ rev="$$rev ."; \
+ target=`echo $@ | sed s/-recursive//`; \
+ for subdir in $$rev; do \
+ echo "Making $$target in $$subdir"; \
+ if test "$$subdir" = "."; then \
+ local_target="$$target-am"; \
+ else \
+ local_target="$$target"; \
+ fi; \
+ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+ || eval $$failcom; \
+ done && test -z "$$fail"
+tags-recursive:
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
+ done
+ctags-recursive:
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
+ done
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ mkid -fID $$unique
+tags: TAGS
+
+TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ set x; \
+ here=`pwd`; \
+ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
+ include_option=--etags-include; \
+ empty_fix=.; \
+ else \
+ include_option=--include; \
+ empty_fix=; \
+ fi; \
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ if test "$$subdir" = .; then :; else \
+ test ! -f $$subdir/TAGS || \
+ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
+ fi; \
+ done; \
+ list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ shift; \
+ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ if test $$# -gt 0; then \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ "$$@" $$unique; \
+ else \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$unique; \
+ fi; \
+ fi
+ctags: CTAGS
+CTAGS: ctags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ test -z "$(CTAGS_ARGS)$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && $(am__cd) $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) "$$here"
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+ $(am__remove_distdir)
+ test -d "$(distdir)" || mkdir "$(distdir)"
+ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ list='$(DISTFILES)'; \
+ dist_files=`for file in $$list; do echo $$file; done | \
+ sed -e "s|^$$srcdirstrip/||;t" \
+ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+ case $$dist_files in \
+ */*) $(MKDIR_P) `echo "$$dist_files" | \
+ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+ sort -u` ;; \
+ esac; \
+ for file in $$dist_files; do \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ if test -d $$d/$$file; then \
+ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test -d "$(distdir)/$$file"; then \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+ else \
+ test -f "$(distdir)/$$file" \
+ || cp -p $$d/$$file "$(distdir)/$$file" \
+ || exit 1; \
+ fi; \
+ done
+ @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+ if test "$$subdir" = .; then :; else \
+ test -d "$(distdir)/$$subdir" \
+ || $(MKDIR_P) "$(distdir)/$$subdir" \
+ || exit 1; \
+ fi; \
+ done
+ @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+ if test "$$subdir" = .; then :; else \
+ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
+ $(am__relativize); \
+ new_distdir=$$reldir; \
+ dir1=$$subdir; dir2="$(top_distdir)"; \
+ $(am__relativize); \
+ new_top_distdir=$$reldir; \
+ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
+ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
+ ($(am__cd) $$subdir && \
+ $(MAKE) $(AM_MAKEFLAGS) \
+ top_distdir="$$new_top_distdir" \
+ distdir="$$new_distdir" \
+ am__remove_distdir=: \
+ am__skip_length_check=: \
+ am__skip_mode_fix=: \
+ distdir) \
+ || exit 1; \
+ fi; \
+ done
+ -test -n "$(am__skip_mode_fix)" \
+ || find "$(distdir)" -type d ! -perm -755 \
+ -exec chmod u+rwx,go+rx {} \; -o \
+ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
+ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \
+ ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \
+ || chmod -R a+r "$(distdir)"
+dist-gzip: distdir
+ tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
+ $(am__remove_distdir)
+
+dist-bzip2: distdir
+ tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2
+ $(am__remove_distdir)
+
+dist-lzma: distdir
+ tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma
+ $(am__remove_distdir)
+
+dist-xz: distdir
+ tardir=$(distdir) && $(am__tar) | xz -c >$(distdir).tar.xz
+ $(am__remove_distdir)
+
+dist-tarZ: distdir
+ tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
+ $(am__remove_distdir)
+
+dist-shar: distdir
+ shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
+ $(am__remove_distdir)
+
+dist-zip: distdir
+ -rm -f $(distdir).zip
+ zip -rq $(distdir).zip $(distdir)
+ $(am__remove_distdir)
+
+dist dist-all: distdir
+ tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
+ $(am__remove_distdir)
+
+# This target untars the dist file and tries a VPATH configuration. Then
+# it guarantees that the distribution is self-contained by making another
+# tarfile.
+distcheck: dist
+ case '$(DIST_ARCHIVES)' in \
+ *.tar.gz*) \
+ GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\
+ *.tar.bz2*) \
+ bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\
+ *.tar.lzma*) \
+ lzma -dc $(distdir).tar.lzma | $(am__untar) ;;\
+ *.tar.xz*) \
+ xz -dc $(distdir).tar.xz | $(am__untar) ;;\
+ *.tar.Z*) \
+ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
+ *.shar.gz*) \
+ GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\
+ *.zip*) \
+ unzip $(distdir).zip ;;\
+ esac
+ chmod -R a-w $(distdir); chmod a+w $(distdir)
+ mkdir $(distdir)/_build
+ mkdir $(distdir)/_inst
+ chmod a-w $(distdir)
+ test -d $(distdir)/_build || exit 0; \
+ dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
+ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
+ && am__cwd=`pwd` \
+ && $(am__cd) $(distdir)/_build \
+ && ../configure --srcdir=.. --prefix="$$dc_install_base" \
+ $(DISTCHECK_CONFIGURE_FLAGS) \
+ && $(MAKE) $(AM_MAKEFLAGS) \
+ && $(MAKE) $(AM_MAKEFLAGS) dvi \
+ && $(MAKE) $(AM_MAKEFLAGS) check \
+ && $(MAKE) $(AM_MAKEFLAGS) install \
+ && $(MAKE) $(AM_MAKEFLAGS) installcheck \
+ && $(MAKE) $(AM_MAKEFLAGS) uninstall \
+ && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \
+ distuninstallcheck \
+ && chmod -R a-w "$$dc_install_base" \
+ && ({ \
+ (cd ../.. && umask 077 && mkdir "$$dc_destdir") \
+ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \
+ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \
+ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \
+ distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \
+ } || { rm -rf "$$dc_destdir"; exit 1; }) \
+ && rm -rf "$$dc_destdir" \
+ && $(MAKE) $(AM_MAKEFLAGS) dist \
+ && rm -rf $(DIST_ARCHIVES) \
+ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \
+ && cd "$$am__cwd" \
+ || exit 1
+ $(am__remove_distdir)
+ @(echo "$(distdir) archives ready for distribution: "; \
+ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \
+ sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x'
+distuninstallcheck:
+ @$(am__cd) '$(distuninstallcheck_dir)' \
+ && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \
+ || { echo "ERROR: files left after uninstall:" ; \
+ if test -n "$(DESTDIR)"; then \
+ echo " (check DESTDIR support)"; \
+ fi ; \
+ $(distuninstallcheck_listfiles) ; \
+ exit 1; } >&2
+distcleancheck: distclean
+ @if test '$(srcdir)' = . ; then \
+ echo "ERROR: distcleancheck can only run from a VPATH build" ; \
+ exit 1 ; \
+ fi
+ @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \
+ || { echo "ERROR: files left in build directory after distclean:" ; \
+ $(distcleancheck_listfiles) ; \
+ exit 1; } >&2
+check-am: all-am
+check: check-recursive
+all-am: Makefile config.h
+installdirs: installdirs-recursive
+installdirs-am:
+install: install-recursive
+install-exec: install-exec-recursive
+install-data: install-data-recursive
+uninstall: uninstall-recursive
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-recursive
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+ -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-recursive
+
+clean-am: clean-generic mostlyclean-am
+
+distclean: distclean-recursive
+ -rm -f $(am__CONFIG_DISTCLEAN_FILES)
+ -rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-hdr distclean-tags
+
+dvi: dvi-recursive
+
+dvi-am:
+
+html: html-recursive
+
+html-am:
+
+info: info-recursive
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-recursive
+
+install-dvi-am:
+
+install-exec-am:
+
+install-html: install-html-recursive
+
+install-html-am:
+
+install-info: install-info-recursive
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-recursive
+
+install-pdf-am:
+
+install-ps: install-ps-recursive
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-recursive
+ -rm -f $(am__CONFIG_DISTCLEAN_FILES)
+ -rm -rf $(top_srcdir)/autom4te.cache
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-recursive
+
+mostlyclean-am: mostlyclean-generic
+
+pdf: pdf-recursive
+
+pdf-am:
+
+ps: ps-recursive
+
+ps-am:
+
+uninstall-am:
+
+.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) all \
+ ctags-recursive install-am install-strip tags-recursive
+
+.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
+ all all-am am--refresh check check-am clean clean-generic \
+ ctags ctags-recursive dist dist-all dist-bzip2 dist-gzip \
+ dist-lzma dist-shar dist-tarZ dist-xz dist-zip distcheck \
+ distclean distclean-generic distclean-hdr distclean-tags \
+ distcleancheck distdir distuninstallcheck dvi dvi-am html \
+ html-am info info-am install install-am install-data \
+ install-data-am install-dvi install-dvi-am install-exec \
+ install-exec-am install-html install-html-am install-info \
+ install-info-am install-man install-pdf install-pdf-am \
+ install-ps install-ps-am install-strip installcheck \
+ installcheck-am installdirs installdirs-am maintainer-clean \
+ maintainer-clean-generic mostlyclean mostlyclean-generic pdf \
+ pdf-am ps ps-am tags tags-recursive uninstall uninstall-am
+
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/NEWS b/NEWS
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/NEWS
diff --git a/README b/README
new file mode 100644
index 0000000..e26b220
--- /dev/null
+++ b/README
@@ -0,0 +1,44 @@
+LICENSING
+=========
+Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Her Majesty
+the Queen in Right of Canada (Communications Research Center Canada)
+
+This file is part of CRC-DabMux.
+
+CRC-DabMux is free software: you can 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.
+
+CRC-DabMux is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with CRC-DabMux. If not, see <http://www.gnu.org/licenses/>.
+
+OVERVIEW
+========
+This is CRC-DabMux 0.3.0
+
+CRC-DabMux is a DAB (Digital Audio Broadcasting) multiplexer compliant to
+ETSI EN 300 401.
+
+The src/ directory contains the source code of CRC-DabMux.
+
+The doc/ directory contains the CRC-DabMux documentation.
+
+The lib/ directory contains source code of libraries need to build CRC-DabMux.
+
+INSTALL
+=======
+See the INSTALL file for installation instructions.
+
+CONTACT
+=======
+Pascal Charest <pascal [dot] charest [at] crc [dot] ca>
+
+http://mmbtools.crc.ca/
+http://www.crc.ca/mmb
+http://openmokast.org/
diff --git a/TODO b/TODO
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/TODO
diff --git a/aclocal.m4 b/aclocal.m4
new file mode 100644
index 0000000..1f41bc9
--- /dev/null
+++ b/aclocal.m4
@@ -0,0 +1,986 @@
+# generated automatically by aclocal 1.11.1 -*- Autoconf -*-
+
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
+# 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+m4_ifndef([AC_AUTOCONF_VERSION],
+ [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
+m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.65],,
+[m4_warning([this file was generated for autoconf 2.65.
+You have another version of autoconf. It may work, but is not guaranteed to.
+If you have problems, you may need to regenerate the build system entirely.
+To do so, use the procedure documented by the package, typically `autoreconf'.])])
+
+# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_AUTOMAKE_VERSION(VERSION)
+# ----------------------------
+# Automake X.Y traces this macro to ensure aclocal.m4 has been
+# generated from the m4 files accompanying Automake X.Y.
+# (This private macro should not be called outside this file.)
+AC_DEFUN([AM_AUTOMAKE_VERSION],
+[am__api_version='1.11'
+dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
+dnl require some minimum version. Point them to the right macro.
+m4_if([$1], [1.11.1], [],
+ [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
+])
+
+# _AM_AUTOCONF_VERSION(VERSION)
+# -----------------------------
+# aclocal traces this macro to find the Autoconf version.
+# This is a private macro too. Using m4_define simplifies
+# the logic in aclocal, which can simply ignore this definition.
+m4_define([_AM_AUTOCONF_VERSION], [])
+
+# AM_SET_CURRENT_AUTOMAKE_VERSION
+# -------------------------------
+# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
+# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
+AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
+[AM_AUTOMAKE_VERSION([1.11.1])dnl
+m4_ifndef([AC_AUTOCONF_VERSION],
+ [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
+_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
+
+# AM_AUX_DIR_EXPAND -*- Autoconf -*-
+
+# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
+# $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to
+# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
+#
+# Of course, Automake must honor this variable whenever it calls a
+# tool from the auxiliary directory. The problem is that $srcdir (and
+# therefore $ac_aux_dir as well) can be either absolute or relative,
+# depending on how configure is run. This is pretty annoying, since
+# it makes $ac_aux_dir quite unusable in subdirectories: in the top
+# source directory, any form will work fine, but in subdirectories a
+# relative path needs to be adjusted first.
+#
+# $ac_aux_dir/missing
+# fails when called from a subdirectory if $ac_aux_dir is relative
+# $top_srcdir/$ac_aux_dir/missing
+# fails if $ac_aux_dir is absolute,
+# fails when called from a subdirectory in a VPATH build with
+# a relative $ac_aux_dir
+#
+# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
+# are both prefixed by $srcdir. In an in-source build this is usually
+# harmless because $srcdir is `.', but things will broke when you
+# start a VPATH build or use an absolute $srcdir.
+#
+# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
+# iff we strip the leading $srcdir from $ac_aux_dir. That would be:
+# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
+# and then we would define $MISSING as
+# MISSING="\${SHELL} $am_aux_dir/missing"
+# This will work as long as MISSING is not called from configure, because
+# unfortunately $(top_srcdir) has no meaning in configure.
+# However there are other variables, like CC, which are often used in
+# configure, and could therefore not use this "fixed" $ac_aux_dir.
+#
+# Another solution, used here, is to always expand $ac_aux_dir to an
+# absolute PATH. The drawback is that using absolute paths prevent a
+# configured tree to be moved without reconfiguration.
+
+AC_DEFUN([AM_AUX_DIR_EXPAND],
+[dnl Rely on autoconf to set up CDPATH properly.
+AC_PREREQ([2.50])dnl
+# expand $ac_aux_dir to an absolute path
+am_aux_dir=`cd $ac_aux_dir && pwd`
+])
+
+# AM_CONDITIONAL -*- Autoconf -*-
+
+# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 9
+
+# AM_CONDITIONAL(NAME, SHELL-CONDITION)
+# -------------------------------------
+# Define a conditional.
+AC_DEFUN([AM_CONDITIONAL],
+[AC_PREREQ(2.52)dnl
+ ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])],
+ [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
+AC_SUBST([$1_TRUE])dnl
+AC_SUBST([$1_FALSE])dnl
+_AM_SUBST_NOTMAKE([$1_TRUE])dnl
+_AM_SUBST_NOTMAKE([$1_FALSE])dnl
+m4_define([_AM_COND_VALUE_$1], [$2])dnl
+if $2; then
+ $1_TRUE=
+ $1_FALSE='#'
+else
+ $1_TRUE='#'
+ $1_FALSE=
+fi
+AC_CONFIG_COMMANDS_PRE(
+[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
+ AC_MSG_ERROR([[conditional "$1" was never defined.
+Usually this means the macro was only invoked conditionally.]])
+fi])])
+
+# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 10
+
+# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
+# written in clear, in which case automake, when reading aclocal.m4,
+# will think it sees a *use*, and therefore will trigger all it's
+# C support machinery. Also note that it means that autoscan, seeing
+# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
+
+
+# _AM_DEPENDENCIES(NAME)
+# ----------------------
+# See how the compiler implements dependency checking.
+# NAME is "CC", "CXX", "GCJ", or "OBJC".
+# We try a few techniques and use that to set a single cache variable.
+#
+# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
+# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
+# dependency, and given that the user is not expected to run this macro,
+# just rely on AC_PROG_CC.
+AC_DEFUN([_AM_DEPENDENCIES],
+[AC_REQUIRE([AM_SET_DEPDIR])dnl
+AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
+AC_REQUIRE([AM_MAKE_INCLUDE])dnl
+AC_REQUIRE([AM_DEP_TRACK])dnl
+
+ifelse([$1], CC, [depcc="$CC" am_compiler_list=],
+ [$1], CXX, [depcc="$CXX" am_compiler_list=],
+ [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
+ [$1], UPC, [depcc="$UPC" am_compiler_list=],
+ [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'],
+ [depcc="$$1" am_compiler_list=])
+
+AC_CACHE_CHECK([dependency style of $depcc],
+ [am_cv_$1_dependencies_compiler_type],
+[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
+ # We make a subdir and do the tests there. Otherwise we can end up
+ # making bogus files that we don't know about and never remove. For
+ # instance it was reported that on HP-UX the gcc test will end up
+ # making a dummy file named `D' -- because `-MD' means `put the output
+ # in D'.
+ mkdir conftest.dir
+ # Copy depcomp to subdir because otherwise we won't find it if we're
+ # using a relative directory.
+ cp "$am_depcomp" conftest.dir
+ cd conftest.dir
+ # We will build objects and dependencies in a subdirectory because
+ # it helps to detect inapplicable dependency modes. For instance
+ # both Tru64's cc and ICC support -MD to output dependencies as a
+ # side effect of compilation, but ICC will put the dependencies in
+ # the current directory while Tru64 will put them in the object
+ # directory.
+ mkdir sub
+
+ am_cv_$1_dependencies_compiler_type=none
+ if test "$am_compiler_list" = ""; then
+ am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
+ fi
+ am__universal=false
+ m4_case([$1], [CC],
+ [case " $depcc " in #(
+ *\ -arch\ *\ -arch\ *) am__universal=true ;;
+ esac],
+ [CXX],
+ [case " $depcc " in #(
+ *\ -arch\ *\ -arch\ *) am__universal=true ;;
+ esac])
+
+ for depmode in $am_compiler_list; do
+ # Setup a source with many dependencies, because some compilers
+ # like to wrap large dependency lists on column 80 (with \), and
+ # we should not choose a depcomp mode which is confused by this.
+ #
+ # We need to recreate these files for each test, as the compiler may
+ # overwrite some of them when testing with obscure command lines.
+ # This happens at least with the AIX C compiler.
+ : > sub/conftest.c
+ for i in 1 2 3 4 5 6; do
+ echo '#include "conftst'$i'.h"' >> sub/conftest.c
+ # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
+ # Solaris 8's {/usr,}/bin/sh.
+ touch sub/conftst$i.h
+ done
+ echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
+
+ # We check with `-c' and `-o' for the sake of the "dashmstdout"
+ # mode. It turns out that the SunPro C++ compiler does not properly
+ # handle `-M -o', and we need to detect this. Also, some Intel
+ # versions had trouble with output in subdirs
+ am__obj=sub/conftest.${OBJEXT-o}
+ am__minus_obj="-o $am__obj"
+ case $depmode in
+ gcc)
+ # This depmode causes a compiler race in universal mode.
+ test "$am__universal" = false || continue
+ ;;
+ nosideeffect)
+ # after this tag, mechanisms are not by side-effect, so they'll
+ # only be used when explicitly requested
+ if test "x$enable_dependency_tracking" = xyes; then
+ continue
+ else
+ break
+ fi
+ ;;
+ msvisualcpp | msvcmsys)
+ # This compiler won't grok `-c -o', but also, the minuso test has
+ # not run yet. These depmodes are late enough in the game, and
+ # so weak that their functioning should not be impacted.
+ am__obj=conftest.${OBJEXT-o}
+ am__minus_obj=
+ ;;
+ none) break ;;
+ esac
+ if depmode=$depmode \
+ source=sub/conftest.c object=$am__obj \
+ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
+ >/dev/null 2>conftest.err &&
+ grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
+ grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+ grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
+ ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
+ # icc doesn't choke on unknown options, it will just issue warnings
+ # or remarks (even with -Werror). So we grep stderr for any message
+ # that says an option was ignored or not supported.
+ # When given -MP, icc 7.0 and 7.1 complain thusly:
+ # icc: Command line warning: ignoring option '-M'; no argument required
+ # The diagnosis changed in icc 8.0:
+ # icc: Command line remark: option '-MP' not supported
+ if (grep 'ignoring option' conftest.err ||
+ grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
+ am_cv_$1_dependencies_compiler_type=$depmode
+ break
+ fi
+ fi
+ done
+
+ cd ..
+ rm -rf conftest.dir
+else
+ am_cv_$1_dependencies_compiler_type=none
+fi
+])
+AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
+AM_CONDITIONAL([am__fastdep$1], [
+ test "x$enable_dependency_tracking" != xno \
+ && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
+])
+
+
+# AM_SET_DEPDIR
+# -------------
+# Choose a directory name for dependency files.
+# This macro is AC_REQUIREd in _AM_DEPENDENCIES
+AC_DEFUN([AM_SET_DEPDIR],
+[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
+AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
+])
+
+
+# AM_DEP_TRACK
+# ------------
+AC_DEFUN([AM_DEP_TRACK],
+[AC_ARG_ENABLE(dependency-tracking,
+[ --disable-dependency-tracking speeds up one-time build
+ --enable-dependency-tracking do not reject slow dependency extractors])
+if test "x$enable_dependency_tracking" != xno; then
+ am_depcomp="$ac_aux_dir/depcomp"
+ AMDEPBACKSLASH='\'
+fi
+AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
+AC_SUBST([AMDEPBACKSLASH])dnl
+_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
+])
+
+# Generate code to set up dependency tracking. -*- Autoconf -*-
+
+# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+#serial 5
+
+# _AM_OUTPUT_DEPENDENCY_COMMANDS
+# ------------------------------
+AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
+[{
+ # Autoconf 2.62 quotes --file arguments for eval, but not when files
+ # are listed without --file. Let's play safe and only enable the eval
+ # if we detect the quoting.
+ case $CONFIG_FILES in
+ *\'*) eval set x "$CONFIG_FILES" ;;
+ *) set x $CONFIG_FILES ;;
+ esac
+ shift
+ for mf
+ do
+ # Strip MF so we end up with the name of the file.
+ mf=`echo "$mf" | sed -e 's/:.*$//'`
+ # Check whether this is an Automake generated Makefile or not.
+ # We used to match only the files named `Makefile.in', but
+ # some people rename them; so instead we look at the file content.
+ # Grep'ing the first line is not enough: some people post-process
+ # each Makefile.in and add a new line on top of each file to say so.
+ # Grep'ing the whole file is not good either: AIX grep has a line
+ # limit of 2048, but all sed's we know have understand at least 4000.
+ if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
+ dirpart=`AS_DIRNAME("$mf")`
+ else
+ continue
+ fi
+ # Extract the definition of DEPDIR, am__include, and am__quote
+ # from the Makefile without running `make'.
+ DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
+ test -z "$DEPDIR" && continue
+ am__include=`sed -n 's/^am__include = //p' < "$mf"`
+ test -z "am__include" && continue
+ am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
+ # When using ansi2knr, U may be empty or an underscore; expand it
+ U=`sed -n 's/^U = //p' < "$mf"`
+ # Find all dependency output files, they are included files with
+ # $(DEPDIR) in their names. We invoke sed twice because it is the
+ # simplest approach to changing $(DEPDIR) to its actual value in the
+ # expansion.
+ for file in `sed -n "
+ s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
+ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
+ # Make sure the directory exists.
+ test -f "$dirpart/$file" && continue
+ fdir=`AS_DIRNAME(["$file"])`
+ AS_MKDIR_P([$dirpart/$fdir])
+ # echo "creating $dirpart/$file"
+ echo '# dummy' > "$dirpart/$file"
+ done
+ done
+}
+])# _AM_OUTPUT_DEPENDENCY_COMMANDS
+
+
+# AM_OUTPUT_DEPENDENCY_COMMANDS
+# -----------------------------
+# This macro should only be invoked once -- use via AC_REQUIRE.
+#
+# This code is only required when automatic dependency tracking
+# is enabled. FIXME. This creates each `.P' file that we will
+# need in order to bootstrap the dependency handling code.
+AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
+[AC_CONFIG_COMMANDS([depfiles],
+ [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
+ [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
+])
+
+# Do all the work for Automake. -*- Autoconf -*-
+
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
+# 2005, 2006, 2008, 2009 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 16
+
+# This macro actually does too much. Some checks are only needed if
+# your package does certain things. But this isn't really a big deal.
+
+# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
+# AM_INIT_AUTOMAKE([OPTIONS])
+# -----------------------------------------------
+# The call with PACKAGE and VERSION arguments is the old style
+# call (pre autoconf-2.50), which is being phased out. PACKAGE
+# and VERSION should now be passed to AC_INIT and removed from
+# the call to AM_INIT_AUTOMAKE.
+# We support both call styles for the transition. After
+# the next Automake release, Autoconf can make the AC_INIT
+# arguments mandatory, and then we can depend on a new Autoconf
+# release and drop the old call support.
+AC_DEFUN([AM_INIT_AUTOMAKE],
+[AC_PREREQ([2.62])dnl
+dnl Autoconf wants to disallow AM_ names. We explicitly allow
+dnl the ones we care about.
+m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
+AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
+AC_REQUIRE([AC_PROG_INSTALL])dnl
+if test "`cd $srcdir && pwd`" != "`pwd`"; then
+ # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
+ # is not polluted with repeated "-I."
+ AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
+ # test to see if srcdir already configured
+ if test -f $srcdir/config.status; then
+ AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
+ fi
+fi
+
+# test whether we have cygpath
+if test -z "$CYGPATH_W"; then
+ if (cygpath --version) >/dev/null 2>/dev/null; then
+ CYGPATH_W='cygpath -w'
+ else
+ CYGPATH_W=echo
+ fi
+fi
+AC_SUBST([CYGPATH_W])
+
+# Define the identity of the package.
+dnl Distinguish between old-style and new-style calls.
+m4_ifval([$2],
+[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
+ AC_SUBST([PACKAGE], [$1])dnl
+ AC_SUBST([VERSION], [$2])],
+[_AM_SET_OPTIONS([$1])dnl
+dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
+m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
+ [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
+ AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
+ AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
+
+_AM_IF_OPTION([no-define],,
+[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
+ AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
+
+# Some tools Automake needs.
+AC_REQUIRE([AM_SANITY_CHECK])dnl
+AC_REQUIRE([AC_ARG_PROGRAM])dnl
+AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
+AM_MISSING_PROG(AUTOCONF, autoconf)
+AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
+AM_MISSING_PROG(AUTOHEADER, autoheader)
+AM_MISSING_PROG(MAKEINFO, makeinfo)
+AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
+AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
+AC_REQUIRE([AM_PROG_MKDIR_P])dnl
+# We need awk for the "check" target. The system "awk" is bad on
+# some platforms.
+AC_REQUIRE([AC_PROG_AWK])dnl
+AC_REQUIRE([AC_PROG_MAKE_SET])dnl
+AC_REQUIRE([AM_SET_LEADING_DOT])dnl
+_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
+ [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
+ [_AM_PROG_TAR([v7])])])
+_AM_IF_OPTION([no-dependencies],,
+[AC_PROVIDE_IFELSE([AC_PROG_CC],
+ [_AM_DEPENDENCIES(CC)],
+ [define([AC_PROG_CC],
+ defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
+AC_PROVIDE_IFELSE([AC_PROG_CXX],
+ [_AM_DEPENDENCIES(CXX)],
+ [define([AC_PROG_CXX],
+ defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
+AC_PROVIDE_IFELSE([AC_PROG_OBJC],
+ [_AM_DEPENDENCIES(OBJC)],
+ [define([AC_PROG_OBJC],
+ defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
+])
+_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl
+dnl The `parallel-tests' driver may need to know about EXEEXT, so add the
+dnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This macro
+dnl is hooked onto _AC_COMPILER_EXEEXT early, see below.
+AC_CONFIG_COMMANDS_PRE(dnl
+[m4_provide_if([_AM_COMPILER_EXEEXT],
+ [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
+])
+
+dnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion. Do not
+dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
+dnl mangled by Autoconf and run in a shell conditional statement.
+m4_define([_AC_COMPILER_EXEEXT],
+m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
+
+
+# When config.status generates a header, we must update the stamp-h file.
+# This file resides in the same directory as the config header
+# that is generated. The stamp files are numbered to have different names.
+
+# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
+# loop where config.status creates the headers, so we can generate
+# our stamp files there.
+AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
+[# Compute $1's index in $config_headers.
+_am_arg=$1
+_am_stamp_count=1
+for _am_header in $config_headers :; do
+ case $_am_header in
+ $_am_arg | $_am_arg:* )
+ break ;;
+ * )
+ _am_stamp_count=`expr $_am_stamp_count + 1` ;;
+ esac
+done
+echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
+
+# Copyright (C) 2001, 2003, 2005, 2008 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_PROG_INSTALL_SH
+# ------------------
+# Define $install_sh.
+AC_DEFUN([AM_PROG_INSTALL_SH],
+[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+if test x"${install_sh}" != xset; then
+ case $am_aux_dir in
+ *\ * | *\ *)
+ install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
+ *)
+ install_sh="\${SHELL} $am_aux_dir/install-sh"
+ esac
+fi
+AC_SUBST(install_sh)])
+
+# Copyright (C) 2003, 2005 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 2
+
+# Check whether the underlying file-system supports filenames
+# with a leading dot. For instance MS-DOS doesn't.
+AC_DEFUN([AM_SET_LEADING_DOT],
+[rm -rf .tst 2>/dev/null
+mkdir .tst 2>/dev/null
+if test -d .tst; then
+ am__leading_dot=.
+else
+ am__leading_dot=_
+fi
+rmdir .tst 2>/dev/null
+AC_SUBST([am__leading_dot])])
+
+# Check to see how 'make' treats includes. -*- Autoconf -*-
+
+# Copyright (C) 2001, 2002, 2003, 2005, 2009 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 4
+
+# AM_MAKE_INCLUDE()
+# -----------------
+# Check to see how make treats includes.
+AC_DEFUN([AM_MAKE_INCLUDE],
+[am_make=${MAKE-make}
+cat > confinc << 'END'
+am__doit:
+ @echo this is the am__doit target
+.PHONY: am__doit
+END
+# If we don't find an include directive, just comment out the code.
+AC_MSG_CHECKING([for style of include used by $am_make])
+am__include="#"
+am__quote=
+_am_result=none
+# First try GNU make style include.
+echo "include confinc" > confmf
+# Ignore all kinds of additional output from `make'.
+case `$am_make -s -f confmf 2> /dev/null` in #(
+*the\ am__doit\ target*)
+ am__include=include
+ am__quote=
+ _am_result=GNU
+ ;;
+esac
+# Now try BSD make style include.
+if test "$am__include" = "#"; then
+ echo '.include "confinc"' > confmf
+ case `$am_make -s -f confmf 2> /dev/null` in #(
+ *the\ am__doit\ target*)
+ am__include=.include
+ am__quote="\""
+ _am_result=BSD
+ ;;
+ esac
+fi
+AC_SUBST([am__include])
+AC_SUBST([am__quote])
+AC_MSG_RESULT([$_am_result])
+rm -f confinc confmf
+])
+
+# Copyright (C) 1999, 2000, 2001, 2003, 2004, 2005, 2008
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 6
+
+# AM_PROG_CC_C_O
+# --------------
+# Like AC_PROG_CC_C_O, but changed for automake.
+AC_DEFUN([AM_PROG_CC_C_O],
+[AC_REQUIRE([AC_PROG_CC_C_O])dnl
+AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+AC_REQUIRE_AUX_FILE([compile])dnl
+# FIXME: we rely on the cache variable name because
+# there is no other way.
+set dummy $CC
+am_cc=`echo $[2] | sed ['s/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/']`
+eval am_t=\$ac_cv_prog_cc_${am_cc}_c_o
+if test "$am_t" != yes; then
+ # Losing compiler, so override with the script.
+ # FIXME: It is wrong to rewrite CC.
+ # But if we don't then we get into trouble of one sort or another.
+ # A longer-term fix would be to have automake use am__CC in this case,
+ # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
+ CC="$am_aux_dir/compile $CC"
+fi
+dnl Make sure AC_PROG_CC is never called again, or it will override our
+dnl setting of CC.
+m4_define([AC_PROG_CC],
+ [m4_fatal([AC_PROG_CC cannot be called after AM_PROG_CC_C_O])])
+])
+
+# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*-
+
+# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 6
+
+# AM_MISSING_PROG(NAME, PROGRAM)
+# ------------------------------
+AC_DEFUN([AM_MISSING_PROG],
+[AC_REQUIRE([AM_MISSING_HAS_RUN])
+$1=${$1-"${am_missing_run}$2"}
+AC_SUBST($1)])
+
+
+# AM_MISSING_HAS_RUN
+# ------------------
+# Define MISSING if not defined so far and test if it supports --run.
+# If it does, set am_missing_run to use it, otherwise, to nothing.
+AC_DEFUN([AM_MISSING_HAS_RUN],
+[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+AC_REQUIRE_AUX_FILE([missing])dnl
+if test x"${MISSING+set}" != xset; then
+ case $am_aux_dir in
+ *\ * | *\ *)
+ MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
+ *)
+ MISSING="\${SHELL} $am_aux_dir/missing" ;;
+ esac
+fi
+# Use eval to expand $SHELL
+if eval "$MISSING --run true"; then
+ am_missing_run="$MISSING --run "
+else
+ am_missing_run=
+ AC_MSG_WARN([`missing' script is too old or missing])
+fi
+])
+
+# Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_PROG_MKDIR_P
+# ---------------
+# Check for `mkdir -p'.
+AC_DEFUN([AM_PROG_MKDIR_P],
+[AC_PREREQ([2.60])dnl
+AC_REQUIRE([AC_PROG_MKDIR_P])dnl
+dnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P,
+dnl while keeping a definition of mkdir_p for backward compatibility.
+dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
+dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
+dnl Makefile.ins that do not define MKDIR_P, so we do our own
+dnl adjustment using top_builddir (which is defined more often than
+dnl MKDIR_P).
+AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
+case $mkdir_p in
+ [[\\/$]]* | ?:[[\\/]]*) ;;
+ */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
+esac
+])
+
+# Helper functions for option handling. -*- Autoconf -*-
+
+# Copyright (C) 2001, 2002, 2003, 2005, 2008 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 4
+
+# _AM_MANGLE_OPTION(NAME)
+# -----------------------
+AC_DEFUN([_AM_MANGLE_OPTION],
+[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
+
+# _AM_SET_OPTION(NAME)
+# ------------------------------
+# Set option NAME. Presently that only means defining a flag for this option.
+AC_DEFUN([_AM_SET_OPTION],
+[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
+
+# _AM_SET_OPTIONS(OPTIONS)
+# ----------------------------------
+# OPTIONS is a space-separated list of Automake options.
+AC_DEFUN([_AM_SET_OPTIONS],
+[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
+
+# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
+# -------------------------------------------
+# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
+AC_DEFUN([_AM_IF_OPTION],
+[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
+
+# Check to make sure that the build environment is sane. -*- Autoconf -*-
+
+# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 5
+
+# AM_SANITY_CHECK
+# ---------------
+AC_DEFUN([AM_SANITY_CHECK],
+[AC_MSG_CHECKING([whether build environment is sane])
+# Just in case
+sleep 1
+echo timestamp > conftest.file
+# Reject unsafe characters in $srcdir or the absolute working directory
+# name. Accept space and tab only in the latter.
+am_lf='
+'
+case `pwd` in
+ *[[\\\"\#\$\&\'\`$am_lf]]*)
+ AC_MSG_ERROR([unsafe absolute working directory name]);;
+esac
+case $srcdir in
+ *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*)
+ AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);;
+esac
+
+# Do `set' in a subshell so we don't clobber the current shell's
+# arguments. Must try -L first in case configure is actually a
+# symlink; some systems play weird games with the mod time of symlinks
+# (eg FreeBSD returns the mod time of the symlink's containing
+# directory).
+if (
+ set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
+ if test "$[*]" = "X"; then
+ # -L didn't work.
+ set X `ls -t "$srcdir/configure" conftest.file`
+ fi
+ rm -f conftest.file
+ if test "$[*]" != "X $srcdir/configure conftest.file" \
+ && test "$[*]" != "X conftest.file $srcdir/configure"; then
+
+ # If neither matched, then we have a broken ls. This can happen
+ # if, for instance, CONFIG_SHELL is bash and it inherits a
+ # broken ls alias from the environment. This has actually
+ # happened. Such a system could not be considered "sane".
+ AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
+alias in your environment])
+ fi
+
+ test "$[2]" = conftest.file
+ )
+then
+ # Ok.
+ :
+else
+ AC_MSG_ERROR([newly created file is older than distributed files!
+Check your system clock])
+fi
+AC_MSG_RESULT(yes)])
+
+# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_PROG_INSTALL_STRIP
+# ---------------------
+# One issue with vendor `install' (even GNU) is that you can't
+# specify the program used to strip binaries. This is especially
+# annoying in cross-compiling environments, where the build's strip
+# is unlikely to handle the host's binaries.
+# Fortunately install-sh will honor a STRIPPROG variable, so we
+# always use install-sh in `make install-strip', and initialize
+# STRIPPROG with the value of the STRIP variable (set by the user).
+AC_DEFUN([AM_PROG_INSTALL_STRIP],
+[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
+# Installed binaries are usually stripped using `strip' when the user
+# run `make install-strip'. However `strip' might not be the right
+# tool to use in cross-compilation environments, therefore Automake
+# will honor the `STRIP' environment variable to overrule this program.
+dnl Don't test for $cross_compiling = yes, because it might be `maybe'.
+if test "$cross_compiling" != no; then
+ AC_CHECK_TOOL([STRIP], [strip], :)
+fi
+INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
+AC_SUBST([INSTALL_STRIP_PROGRAM])])
+
+# Copyright (C) 2006, 2008 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 2
+
+# _AM_SUBST_NOTMAKE(VARIABLE)
+# ---------------------------
+# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
+# This macro is traced by Automake.
+AC_DEFUN([_AM_SUBST_NOTMAKE])
+
+# AM_SUBST_NOTMAKE(VARIABLE)
+# ---------------------------
+# Public sister of _AM_SUBST_NOTMAKE.
+AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
+
+# Check how to create a tarball. -*- Autoconf -*-
+
+# Copyright (C) 2004, 2005 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 2
+
+# _AM_PROG_TAR(FORMAT)
+# --------------------
+# Check how to create a tarball in format FORMAT.
+# FORMAT should be one of `v7', `ustar', or `pax'.
+#
+# Substitute a variable $(am__tar) that is a command
+# writing to stdout a FORMAT-tarball containing the directory
+# $tardir.
+# tardir=directory && $(am__tar) > result.tar
+#
+# Substitute a variable $(am__untar) that extract such
+# a tarball read from stdin.
+# $(am__untar) < result.tar
+AC_DEFUN([_AM_PROG_TAR],
+[# Always define AMTAR for backward compatibility.
+AM_MISSING_PROG([AMTAR], [tar])
+m4_if([$1], [v7],
+ [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
+ [m4_case([$1], [ustar],, [pax],,
+ [m4_fatal([Unknown tar format])])
+AC_MSG_CHECKING([how to create a $1 tar archive])
+# Loop over all known methods to create a tar archive until one works.
+_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
+_am_tools=${am_cv_prog_tar_$1-$_am_tools}
+# Do not fold the above two line into one, because Tru64 sh and
+# Solaris sh will not grok spaces in the rhs of `-'.
+for _am_tool in $_am_tools
+do
+ case $_am_tool in
+ gnutar)
+ for _am_tar in tar gnutar gtar;
+ do
+ AM_RUN_LOG([$_am_tar --version]) && break
+ done
+ am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
+ am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
+ am__untar="$_am_tar -xf -"
+ ;;
+ plaintar)
+ # Must skip GNU tar: if it does not support --format= it doesn't create
+ # ustar tarball either.
+ (tar --version) >/dev/null 2>&1 && continue
+ am__tar='tar chf - "$$tardir"'
+ am__tar_='tar chf - "$tardir"'
+ am__untar='tar xf -'
+ ;;
+ pax)
+ am__tar='pax -L -x $1 -w "$$tardir"'
+ am__tar_='pax -L -x $1 -w "$tardir"'
+ am__untar='pax -r'
+ ;;
+ cpio)
+ am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
+ am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
+ am__untar='cpio -i -H $1 -d'
+ ;;
+ none)
+ am__tar=false
+ am__tar_=false
+ am__untar=false
+ ;;
+ esac
+
+ # If the value was cached, stop now. We just wanted to have am__tar
+ # and am__untar set.
+ test -n "${am_cv_prog_tar_$1}" && break
+
+ # tar/untar a dummy directory, and stop if the command works
+ rm -rf conftest.dir
+ mkdir conftest.dir
+ echo GrepMe > conftest.dir/file
+ AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
+ rm -rf conftest.dir
+ if test -s conftest.tar; then
+ AM_RUN_LOG([$am__untar <conftest.tar])
+ grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
+ fi
+done
+rm -rf conftest.dir
+
+AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
+AC_MSG_RESULT([$am_cv_prog_tar_$1])])
+AC_SUBST([am__tar])
+AC_SUBST([am__untar])
+]) # _AM_PROG_TAR
+
diff --git a/build-aux/compile b/build-aux/compile
new file mode 100755
index 0000000..c0096a7
--- /dev/null
+++ b/build-aux/compile
@@ -0,0 +1,143 @@
+#! /bin/sh
+# Wrapper for compilers which do not understand `-c -o'.
+
+scriptversion=2009-10-06.20; # UTC
+
+# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2009 Free Software
+# Foundation, Inc.
+# Written by Tom Tromey <tromey@cygnus.com>.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU 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/>.
+
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# This file is maintained in Automake, please report
+# bugs to <bug-automake@gnu.org> or send patches to
+# <automake-patches@gnu.org>.
+
+case $1 in
+ '')
+ echo "$0: No command. Try \`$0 --help' for more information." 1>&2
+ exit 1;
+ ;;
+ -h | --h*)
+ cat <<\EOF
+Usage: compile [--help] [--version] PROGRAM [ARGS]
+
+Wrapper for compilers which do not understand `-c -o'.
+Remove `-o dest.o' from ARGS, run PROGRAM with the remaining
+arguments, and rename the output as expected.
+
+If you are trying to build a whole package this is not the
+right script to run: please start by reading the file `INSTALL'.
+
+Report bugs to <bug-automake@gnu.org>.
+EOF
+ exit $?
+ ;;
+ -v | --v*)
+ echo "compile $scriptversion"
+ exit $?
+ ;;
+esac
+
+ofile=
+cfile=
+eat=
+
+for arg
+do
+ if test -n "$eat"; then
+ eat=
+ else
+ case $1 in
+ -o)
+ # configure might choose to run compile as `compile cc -o foo foo.c'.
+ # So we strip `-o arg' only if arg is an object.
+ eat=1
+ case $2 in
+ *.o | *.obj)
+ ofile=$2
+ ;;
+ *)
+ set x "$@" -o "$2"
+ shift
+ ;;
+ esac
+ ;;
+ *.c)
+ cfile=$1
+ set x "$@" "$1"
+ shift
+ ;;
+ *)
+ set x "$@" "$1"
+ shift
+ ;;
+ esac
+ fi
+ shift
+done
+
+if test -z "$ofile" || test -z "$cfile"; then
+ # If no `-o' option was seen then we might have been invoked from a
+ # pattern rule where we don't need one. That is ok -- this is a
+ # normal compilation that the losing compiler can handle. If no
+ # `.c' file was seen then we are probably linking. That is also
+ # ok.
+ exec "$@"
+fi
+
+# Name of file we expect compiler to create.
+cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'`
+
+# Create the lock directory.
+# Note: use `[/\\:.-]' here to ensure that we don't use the same name
+# that we are using for the .o file. Also, base the name on the expected
+# object file name, since that is what matters with a parallel build.
+lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d
+while true; do
+ if mkdir "$lockdir" >/dev/null 2>&1; then
+ break
+ fi
+ sleep 1
+done
+# FIXME: race condition here if user kills between mkdir and trap.
+trap "rmdir '$lockdir'; exit 1" 1 2 15
+
+# Run the compile.
+"$@"
+ret=$?
+
+if test -f "$cofile"; then
+ test "$cofile" = "$ofile" || mv "$cofile" "$ofile"
+elif test -f "${cofile}bj"; then
+ test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile"
+fi
+
+rmdir "$lockdir"
+exit $ret
+
+# Local Variables:
+# mode: shell-script
+# sh-indentation: 2
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-time-zone: "UTC"
+# time-stamp-end: "; # UTC"
+# End:
diff --git a/build-aux/config.guess b/build-aux/config.guess
new file mode 100755
index 0000000..666c5ad
--- /dev/null
+++ b/build-aux/config.guess
@@ -0,0 +1,1511 @@
+#! /bin/sh
+# Attempt to guess a canonical system name.
+# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
+# Free Software Foundation, Inc.
+
+timestamp='2009-11-20'
+
+# This file is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
+# 02110-1301, USA.
+#
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+
+# Originally written by Per Bothner. Please send patches (context
+# diff format) to <config-patches@gnu.org> and include a ChangeLog
+# entry.
+#
+# This script attempts to guess a canonical system name similar to
+# config.sub. If it succeeds, it prints the system name on stdout, and
+# exits with 0. Otherwise, it exits with 1.
+#
+# You can get the latest version of this script from:
+# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
+
+me=`echo "$0" | sed -e 's,.*/,,'`
+
+usage="\
+Usage: $0 [OPTION]
+
+Output the configuration name of the system \`$me' is run on.
+
+Operation modes:
+ -h, --help print this help, then exit
+ -t, --time-stamp print date of last modification, then exit
+ -v, --version print version number, then exit
+
+Report bugs and patches to <config-patches@gnu.org>."
+
+version="\
+GNU config.guess ($timestamp)
+
+Originally written by Per Bothner.
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
+2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+
+This is free software; see the source for copying conditions. There is NO
+warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
+
+help="
+Try \`$me --help' for more information."
+
+# Parse command line
+while test $# -gt 0 ; do
+ case $1 in
+ --time-stamp | --time* | -t )
+ echo "$timestamp" ; exit ;;
+ --version | -v )
+ echo "$version" ; exit ;;
+ --help | --h* | -h )
+ echo "$usage"; exit ;;
+ -- ) # Stop option processing
+ shift; break ;;
+ - ) # Use stdin as input.
+ break ;;
+ -* )
+ echo "$me: invalid option $1$help" >&2
+ exit 1 ;;
+ * )
+ break ;;
+ esac
+done
+
+if test $# != 0; then
+ echo "$me: too many arguments$help" >&2
+ exit 1
+fi
+
+trap 'exit 1' 1 2 15
+
+# CC_FOR_BUILD -- compiler used by this script. Note that the use of a
+# compiler to aid in system detection is discouraged as it requires
+# temporary files to be created and, as you can see below, it is a
+# headache to deal with in a portable fashion.
+
+# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
+# use `HOST_CC' if defined, but it is deprecated.
+
+# Portable tmp directory creation inspired by the Autoconf team.
+
+set_cc_for_build='
+trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
+trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
+: ${TMPDIR=/tmp} ;
+ { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
+ { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
+ { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
+ { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
+dummy=$tmp/dummy ;
+tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
+case $CC_FOR_BUILD,$HOST_CC,$CC in
+ ,,) echo "int x;" > $dummy.c ;
+ for c in cc gcc c89 c99 ; do
+ if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then
+ CC_FOR_BUILD="$c"; break ;
+ fi ;
+ done ;
+ if test x"$CC_FOR_BUILD" = x ; then
+ CC_FOR_BUILD=no_compiler_found ;
+ fi
+ ;;
+ ,,*) CC_FOR_BUILD=$CC ;;
+ ,*,*) CC_FOR_BUILD=$HOST_CC ;;
+esac ; set_cc_for_build= ;'
+
+# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
+# (ghazi@noc.rutgers.edu 1994-08-24)
+if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
+ PATH=$PATH:/.attbin ; export PATH
+fi
+
+UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
+UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
+UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
+UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
+
+case "${UNAME_MACHINE}" in
+ i?86)
+ test -z "$VENDOR" && VENDOR=pc
+ ;;
+ *)
+ test -z "$VENDOR" && VENDOR=unknown
+ ;;
+esac
+test -f /etc/SuSE-release -o -f /.buildenv && VENDOR=suse
+
+# Note: order is significant - the case branches are not exclusive.
+
+case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
+ *:NetBSD:*:*)
+ # NetBSD (nbsd) targets should (where applicable) match one or
+ # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*,
+ # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently
+ # switched to ELF, *-*-netbsd* would select the old
+ # object file format. This provides both forward
+ # compatibility and a consistent mechanism for selecting the
+ # object file format.
+ #
+ # Note: NetBSD doesn't particularly care about the vendor
+ # portion of the name. We always set it to "unknown".
+ sysctl="sysctl -n hw.machine_arch"
+ UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \
+ /usr/sbin/$sysctl 2>/dev/null || echo unknown)`
+ case "${UNAME_MACHINE_ARCH}" in
+ armeb) machine=armeb-unknown ;;
+ arm*) machine=arm-unknown ;;
+ sh3el) machine=shl-unknown ;;
+ sh3eb) machine=sh-unknown ;;
+ sh5el) machine=sh5le-unknown ;;
+ *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
+ esac
+ # The Operating System including object format, if it has switched
+ # to ELF recently, or will in the future.
+ case "${UNAME_MACHINE_ARCH}" in
+ arm*|i386|m68k|ns32k|sh3*|sparc|vax)
+ eval $set_cc_for_build
+ if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
+ | grep -q __ELF__
+ then
+ # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
+ # Return netbsd for either. FIX?
+ os=netbsd
+ else
+ os=netbsdelf
+ fi
+ ;;
+ *)
+ os=netbsd
+ ;;
+ esac
+ # The OS release
+ # Debian GNU/NetBSD machines have a different userland, and
+ # thus, need a distinct triplet. However, they do not need
+ # kernel version information, so it can be replaced with a
+ # suitable tag, in the style of linux-gnu.
+ case "${UNAME_VERSION}" in
+ Debian*)
+ release='-gnu'
+ ;;
+ *)
+ release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
+ ;;
+ esac
+ # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
+ # contains redundant information, the shorter form:
+ # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
+ echo "${machine}-${os}${release}"
+ exit ;;
+ *:OpenBSD:*:*)
+ UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
+ echo ${UNAME_MACHINE_ARCH}-${VENDOR}-openbsd${UNAME_RELEASE}
+ exit ;;
+ *:ekkoBSD:*:*)
+ echo ${UNAME_MACHINE}-${VENDOR}-ekkobsd${UNAME_RELEASE}
+ exit ;;
+ *:SolidBSD:*:*)
+ echo ${UNAME_MACHINE}-${VENDOR}-solidbsd${UNAME_RELEASE}
+ exit ;;
+ macppc:MirBSD:*:*)
+ echo powerpc-${VENDOR}-mirbsd${UNAME_RELEASE}
+ exit ;;
+ *:MirBSD:*:*)
+ echo ${UNAME_MACHINE}-${VENDOR}-mirbsd${UNAME_RELEASE}
+ exit ;;
+ alpha:OSF1:*:*)
+ case $UNAME_RELEASE in
+ *4.0)
+ UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
+ ;;
+ *5.*)
+ UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
+ ;;
+ esac
+ # According to Compaq, /usr/sbin/psrinfo has been available on
+ # OSF/1 and Tru64 systems produced since 1995. I hope that
+ # covers most systems running today. This code pipes the CPU
+ # types through head -n 1, so we only detect the type of CPU 0.
+ ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1`
+ case "$ALPHA_CPU_TYPE" in
+ "EV4 (21064)")
+ UNAME_MACHINE="alpha" ;;
+ "EV4.5 (21064)")
+ UNAME_MACHINE="alpha" ;;
+ "LCA4 (21066/21068)")
+ UNAME_MACHINE="alpha" ;;
+ "EV5 (21164)")
+ UNAME_MACHINE="alphaev5" ;;
+ "EV5.6 (21164A)")
+ UNAME_MACHINE="alphaev56" ;;
+ "EV5.6 (21164PC)")
+ UNAME_MACHINE="alphapca56" ;;
+ "EV5.7 (21164PC)")
+ UNAME_MACHINE="alphapca57" ;;
+ "EV6 (21264)")
+ UNAME_MACHINE="alphaev6" ;;
+ "EV6.7 (21264A)")
+ UNAME_MACHINE="alphaev67" ;;
+ "EV6.8CB (21264C)")
+ UNAME_MACHINE="alphaev68" ;;
+ "EV6.8AL (21264B)")
+ UNAME_MACHINE="alphaev68" ;;
+ "EV6.8CX (21264D)")
+ UNAME_MACHINE="alphaev68" ;;
+ "EV6.9A (21264/EV69A)")
+ UNAME_MACHINE="alphaev69" ;;
+ "EV7 (21364)")
+ UNAME_MACHINE="alphaev7" ;;
+ "EV7.9 (21364A)")
+ UNAME_MACHINE="alphaev79" ;;
+ esac
+ # A Pn.n version is a patched version.
+ # A Vn.n version is a released version.
+ # A Tn.n version is a released field test version.
+ # A Xn.n version is an unreleased experimental baselevel.
+ # 1.2 uses "1.2" for uname -r.
+ echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
+ exit ;;
+ Alpha\ *:Windows_NT*:*)
+ # How do we know it's Interix rather than the generic POSIX subsystem?
+ # Should we change UNAME_MACHINE based on the output of uname instead
+ # of the specific Alpha model?
+ echo alpha-pc-interix
+ exit ;;
+ 21064:Windows_NT:50:3)
+ echo alpha-dec-winnt3.5
+ exit ;;
+ Amiga*:UNIX_System_V:4.0:*)
+ echo m68k-${VENDOR}-sysv4
+ exit ;;
+ *:[Aa]miga[Oo][Ss]:*:*)
+ echo ${UNAME_MACHINE}-${VENDOR}-amigaos
+ exit ;;
+ *:[Mm]orph[Oo][Ss]:*:*)
+ echo ${UNAME_MACHINE}-${VENDOR}-morphos
+ exit ;;
+ *:OS/390:*:*)
+ echo i370-ibm-openedition
+ exit ;;
+ *:z/VM:*:*)
+ echo s390-ibm-zvmoe
+ exit ;;
+ *:OS400:*:*)
+ echo powerpc-ibm-os400
+ exit ;;
+ arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
+ echo arm-acorn-riscix${UNAME_RELEASE}
+ exit ;;
+ arm:riscos:*:*|arm:RISCOS:*:*)
+ echo arm-${VENDOR}-riscos
+ exit ;;
+ SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
+ echo hppa1.1-hitachi-hiuxmpp
+ exit ;;
+ Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
+ # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
+ if test "`(/bin/universe) 2>/dev/null`" = att ; then
+ echo pyramid-pyramid-sysv3
+ else
+ echo pyramid-pyramid-bsd
+ fi
+ exit ;;
+ NILE*:*:*:dcosx)
+ echo pyramid-pyramid-svr4
+ exit ;;
+ DRS?6000:unix:4.0:6*)
+ echo sparc-icl-nx6
+ exit ;;
+ DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*)
+ case `/usr/bin/uname -p` in
+ sparc) echo sparc-icl-nx7; exit ;;
+ esac ;;
+ s390x:SunOS:*:*)
+ echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ exit ;;
+ sun4H:SunOS:5.*:*)
+ echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ exit ;;
+ sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
+ echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ exit ;;
+ i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*)
+ echo i386-pc-auroraux${UNAME_RELEASE}
+ exit ;;
+ i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
+ eval $set_cc_for_build
+ SUN_ARCH="i386"
+ # If there is a compiler, see if it is configured for 64-bit objects.
+ # Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
+ # This test works for both compilers.
+ if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
+ if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
+ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
+ grep IS_64BIT_ARCH >/dev/null
+ then
+ SUN_ARCH="x86_64"
+ fi
+ fi
+ echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ exit ;;
+ sun4*:SunOS:6*:*)
+ # According to config.sub, this is the proper way to canonicalize
+ # SunOS6. Hard to guess exactly what SunOS6 will be like, but
+ # it's likely to be more like Solaris than SunOS4.
+ echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ exit ;;
+ sun4*:SunOS:*:*)
+ case "`/usr/bin/arch -k`" in
+ Series*|S4*)
+ UNAME_RELEASE=`uname -v`
+ ;;
+ esac
+ # Japanese Language versions have a version number like `4.1.3-JL'.
+ echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
+ exit ;;
+ sun3*:SunOS:*:*)
+ echo m68k-sun-sunos${UNAME_RELEASE}
+ exit ;;
+ sun*:*:4.2BSD:*)
+ UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
+ test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
+ case "`/bin/arch`" in
+ sun3)
+ echo m68k-sun-sunos${UNAME_RELEASE}
+ ;;
+ sun4)
+ echo sparc-sun-sunos${UNAME_RELEASE}
+ ;;
+ esac
+ exit ;;
+ aushp:SunOS:*:*)
+ echo sparc-auspex-sunos${UNAME_RELEASE}
+ exit ;;
+ # The situation for MiNT is a little confusing. The machine name
+ # can be virtually everything (everything which is not
+ # "atarist" or "atariste" at least should have a processor
+ # > m68000). The system name ranges from "MiNT" over "FreeMiNT"
+ # to the lowercase version "mint" (or "freemint"). Finally
+ # the system name "TOS" denotes a system which is actually not
+ # MiNT. But MiNT is downward compatible to TOS, so this should
+ # be no problem.
+ atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
+ echo m68k-atari-mint${UNAME_RELEASE}
+ exit ;;
+ atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
+ echo m68k-atari-mint${UNAME_RELEASE}
+ exit ;;
+ *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
+ echo m68k-atari-mint${UNAME_RELEASE}
+ exit ;;
+ milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
+ echo m68k-milan-mint${UNAME_RELEASE}
+ exit ;;
+ hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
+ echo m68k-hades-mint${UNAME_RELEASE}
+ exit ;;
+ *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
+ echo m68k-${VENDOR}-mint${UNAME_RELEASE}
+ exit ;;
+ m68k:machten:*:*)
+ echo m68k-apple-machten${UNAME_RELEASE}
+ exit ;;
+ powerpc:machten:*:*)
+ echo powerpc-apple-machten${UNAME_RELEASE}
+ exit ;;
+ RISC*:Mach:*:*)
+ echo mips-dec-mach_bsd4.3
+ exit ;;
+ RISC*:ULTRIX:*:*)
+ echo mips-dec-ultrix${UNAME_RELEASE}
+ exit ;;
+ VAX*:ULTRIX*:*:*)
+ echo vax-dec-ultrix${UNAME_RELEASE}
+ exit ;;
+ 2020:CLIX:*:* | 2430:CLIX:*:*)
+ echo clipper-intergraph-clix${UNAME_RELEASE}
+ exit ;;
+ mips:*:*:UMIPS | mips:*:*:RISCos)
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+#ifdef __cplusplus
+#include <stdio.h> /* for printf() prototype */
+ int main (int argc, char *argv[]) {
+#else
+ int main (argc, argv) int argc; char *argv[]; {
+#endif
+ #if defined (host_mips) && defined (MIPSEB)
+ #if defined (SYSTYPE_SYSV)
+ printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
+ #endif
+ #if defined (SYSTYPE_SVR4)
+ printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0);
+ #endif
+ #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
+ printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0);
+ #endif
+ #endif
+ exit (-1);
+ }
+EOF
+ $CC_FOR_BUILD -o $dummy $dummy.c &&
+ dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` &&
+ SYSTEM_NAME=`$dummy $dummyarg` &&
+ { echo "$SYSTEM_NAME"; exit; }
+ echo mips-mips-riscos${UNAME_RELEASE}
+ exit ;;
+ Motorola:PowerMAX_OS:*:*)
+ echo powerpc-motorola-powermax
+ exit ;;
+ Motorola:*:4.3:PL8-*)
+ echo powerpc-harris-powermax
+ exit ;;
+ Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
+ echo powerpc-harris-powermax
+ exit ;;
+ Night_Hawk:Power_UNIX:*:*)
+ echo powerpc-harris-powerunix
+ exit ;;
+ m88k:CX/UX:7*:*)
+ echo m88k-harris-cxux7
+ exit ;;
+ m88k:*:4*:R4*)
+ echo m88k-motorola-sysv4
+ exit ;;
+ m88k:*:3*:R3*)
+ echo m88k-motorola-sysv3
+ exit ;;
+ AViiON:dgux:*:*)
+ # DG/UX returns AViiON for all architectures
+ UNAME_PROCESSOR=`/usr/bin/uname -p`
+ if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
+ then
+ if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
+ [ ${TARGET_BINARY_INTERFACE}x = x ]
+ then
+ echo m88k-dg-dgux${UNAME_RELEASE}
+ else
+ echo m88k-dg-dguxbcs${UNAME_RELEASE}
+ fi
+ else
+ echo i586-dg-dgux${UNAME_RELEASE}
+ fi
+ exit ;;
+ M88*:DolphinOS:*:*) # DolphinOS (SVR3)
+ echo m88k-dolphin-sysv3
+ exit ;;
+ M88*:*:R3*:*)
+ # Delta 88k system running SVR3
+ echo m88k-motorola-sysv3
+ exit ;;
+ XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
+ echo m88k-tektronix-sysv3
+ exit ;;
+ Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
+ echo m68k-tektronix-bsd
+ exit ;;
+ *:IRIX*:*:*)
+ echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
+ exit ;;
+ ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
+ echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id
+ exit ;; # Note that: echo "'`uname -s`'" gives 'AIX '
+ i*86:AIX:*:*)
+ echo i386-ibm-aix
+ exit ;;
+ ia64:AIX:*:*)
+ if [ -x /usr/bin/oslevel ] ; then
+ IBM_REV=`/usr/bin/oslevel`
+ else
+ IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
+ fi
+ echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
+ exit ;;
+ *:AIX:2:3)
+ if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+ #include <sys/systemcfg.h>
+
+ main()
+ {
+ if (!__power_pc())
+ exit(1);
+ puts("powerpc-ibm-aix3.2.5");
+ exit(0);
+ }
+EOF
+ if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy`
+ then
+ echo "$SYSTEM_NAME"
+ else
+ echo rs6000-ibm-aix3.2.5
+ fi
+ elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
+ echo rs6000-ibm-aix3.2.4
+ else
+ echo rs6000-ibm-aix3.2
+ fi
+ exit ;;
+ *:AIX:*:[456])
+ IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
+ if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
+ IBM_ARCH=rs6000
+ else
+ IBM_ARCH=powerpc
+ fi
+ if [ -x /usr/bin/oslevel ] ; then
+ IBM_REV=`/usr/bin/oslevel`
+ else
+ IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
+ fi
+ echo ${IBM_ARCH}-ibm-aix${IBM_REV}
+ exit ;;
+ *:AIX:*:*)
+ echo rs6000-ibm-aix
+ exit ;;
+ ibmrt:4.4BSD:*|romp-ibm:BSD:*)
+ echo romp-ibm-bsd4.4
+ exit ;;
+ ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and
+ echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to
+ exit ;; # report: romp-ibm BSD 4.3
+ *:BOSX:*:*)
+ echo rs6000-bull-bosx
+ exit ;;
+ DPX/2?00:B.O.S.:*:*)
+ echo m68k-bull-sysv3
+ exit ;;
+ 9000/[34]??:4.3bsd:1.*:*)
+ echo m68k-hp-bsd
+ exit ;;
+ hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
+ echo m68k-hp-bsd4.4
+ exit ;;
+ 9000/[34678]??:HP-UX:*:*)
+ HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
+ case "${UNAME_MACHINE}" in
+ 9000/31? ) HP_ARCH=m68000 ;;
+ 9000/[34]?? ) HP_ARCH=m68k ;;
+ 9000/[678][0-9][0-9])
+ if [ -x /usr/bin/getconf ]; then
+ sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
+ sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
+ case "${sc_cpu_version}" in
+ 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
+ 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
+ 532) # CPU_PA_RISC2_0
+ case "${sc_kernel_bits}" in
+ 32) HP_ARCH="hppa2.0n" ;;
+ 64) HP_ARCH="hppa2.0w" ;;
+ '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20
+ esac ;;
+ esac
+ fi
+ if [ "${HP_ARCH}" = "" ]; then
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+
+ #define _HPUX_SOURCE
+ #include <stdlib.h>
+ #include <unistd.h>
+
+ int main ()
+ {
+ #if defined(_SC_KERNEL_BITS)
+ long bits = sysconf(_SC_KERNEL_BITS);
+ #endif
+ long cpu = sysconf (_SC_CPU_VERSION);
+
+ switch (cpu)
+ {
+ case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
+ case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
+ case CPU_PA_RISC2_0:
+ #if defined(_SC_KERNEL_BITS)
+ switch (bits)
+ {
+ case 64: puts ("hppa2.0w"); break;
+ case 32: puts ("hppa2.0n"); break;
+ default: puts ("hppa2.0"); break;
+ } break;
+ #else /* !defined(_SC_KERNEL_BITS) */
+ puts ("hppa2.0"); break;
+ #endif
+ default: puts ("hppa1.0"); break;
+ }
+ exit (0);
+ }
+EOF
+ (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
+ test -z "$HP_ARCH" && HP_ARCH=hppa
+ fi ;;
+ esac
+ if [ ${HP_ARCH} = "hppa2.0w" ]
+ then
+ eval $set_cc_for_build
+
+ # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
+ # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler
+ # generating 64-bit code. GNU and HP use different nomenclature:
+ #
+ # $ CC_FOR_BUILD=cc ./config.guess
+ # => hppa2.0w-hp-hpux11.23
+ # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess
+ # => hppa64-hp-hpux11.23
+
+ if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) |
+ grep -q __LP64__
+ then
+ HP_ARCH="hppa2.0w"
+ else
+ HP_ARCH="hppa64"
+ fi
+ fi
+ echo ${HP_ARCH}-hp-hpux${HPUX_REV}
+ exit ;;
+ ia64:HP-UX:*:*)
+ HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
+ echo ia64-hp-hpux${HPUX_REV}
+ exit ;;
+ 3050*:HI-UX:*:*)
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+ #include <unistd.h>
+ int
+ main ()
+ {
+ long cpu = sysconf (_SC_CPU_VERSION);
+ /* The order matters, because CPU_IS_HP_MC68K erroneously returns
+ true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct
+ results, however. */
+ if (CPU_IS_PA_RISC (cpu))
+ {
+ switch (cpu)
+ {
+ case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
+ case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
+ case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
+ default: puts ("hppa-hitachi-hiuxwe2"); break;
+ }
+ }
+ else if (CPU_IS_HP_MC68K (cpu))
+ puts ("m68k-hitachi-hiuxwe2");
+ else puts ("unknown-hitachi-hiuxwe2");
+ exit (0);
+ }
+EOF
+ $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` &&
+ { echo "$SYSTEM_NAME"; exit; }
+ echo unknown-hitachi-hiuxwe2
+ exit ;;
+ 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
+ echo hppa1.1-hp-bsd
+ exit ;;
+ 9000/8??:4.3bsd:*:*)
+ echo hppa1.0-hp-bsd
+ exit ;;
+ *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
+ echo hppa1.0-hp-mpeix
+ exit ;;
+ hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
+ echo hppa1.1-hp-osf
+ exit ;;
+ hp8??:OSF1:*:*)
+ echo hppa1.0-hp-osf
+ exit ;;
+ i*86:OSF1:*:*)
+ if [ -x /usr/sbin/sysversion ] ; then
+ echo ${UNAME_MACHINE}-${VENDOR}-osf1mk
+ else
+ echo ${UNAME_MACHINE}-${VENDOR}-osf1
+ fi
+ exit ;;
+ parisc*:Lites*:*:*)
+ echo hppa1.1-hp-lites
+ exit ;;
+ C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
+ echo c1-convex-bsd
+ exit ;;
+ C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
+ if getsysinfo -f scalar_acc
+ then echo c32-convex-bsd
+ else echo c2-convex-bsd
+ fi
+ exit ;;
+ C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
+ echo c34-convex-bsd
+ exit ;;
+ C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
+ echo c38-convex-bsd
+ exit ;;
+ C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
+ echo c4-convex-bsd
+ exit ;;
+ CRAY*Y-MP:*:*:*)
+ echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+ exit ;;
+ CRAY*[A-Z]90:*:*:*)
+ echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
+ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
+ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
+ -e 's/\.[^.]*$/.X/'
+ exit ;;
+ CRAY*TS:*:*:*)
+ echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+ exit ;;
+ CRAY*T3E:*:*:*)
+ echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+ exit ;;
+ CRAY*SV1:*:*:*)
+ echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+ exit ;;
+ *:UNICOS/mp:*:*)
+ echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+ exit ;;
+ F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
+ FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
+ FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
+ FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
+ echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
+ exit ;;
+ 5000:UNIX_System_V:4.*:*)
+ FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
+ FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
+ echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
+ exit ;;
+ i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
+ echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
+ exit ;;
+ sparc*:BSD/OS:*:*)
+ echo sparc-${VENDOR}-bsdi${UNAME_RELEASE}
+ exit ;;
+ *:BSD/OS:*:*)
+ echo ${UNAME_MACHINE}-${VENDOR}-bsdi${UNAME_RELEASE}
+ exit ;;
+ *:FreeBSD:*:*)
+ case ${UNAME_MACHINE} in
+ pc98)
+ echo i386-${VENDOR}-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+ amd64)
+ echo x86_64-${VENDOR}-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+ *)
+ echo ${UNAME_MACHINE}-${VENDOR}-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+ esac
+ exit ;;
+ i*:CYGWIN*:*)
+ echo ${UNAME_MACHINE}-pc-cygwin
+ exit ;;
+ *:MINGW*:*)
+ echo ${UNAME_MACHINE}-pc-mingw32
+ exit ;;
+ i*:windows32*:*)
+ # uname -m includes "-pc" on this system.
+ echo ${UNAME_MACHINE}-mingw32
+ exit ;;
+ i*:PW*:*)
+ echo ${UNAME_MACHINE}-pc-pw32
+ exit ;;
+ *:Interix*:*)
+ case ${UNAME_MACHINE} in
+ x86)
+ echo i586-pc-interix${UNAME_RELEASE}
+ exit ;;
+ authenticamd | genuineintel | EM64T)
+ echo x86_64-${VENDOR}-interix${UNAME_RELEASE}
+ exit ;;
+ IA64)
+ echo ia64-${VENDOR}-interix${UNAME_RELEASE}
+ exit ;;
+ esac ;;
+ [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
+ echo i${UNAME_MACHINE}-pc-mks
+ exit ;;
+ 8664:Windows_NT:*)
+ echo x86_64-pc-mks
+ exit ;;
+ i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
+ # How do we know it's Interix rather than the generic POSIX subsystem?
+ # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
+ # UNAME_MACHINE based on the output of uname instead of i386?
+ echo i586-pc-interix
+ exit ;;
+ i*:UWIN*:*)
+ echo ${UNAME_MACHINE}-pc-uwin
+ exit ;;
+ amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
+ echo x86_64-${VENDOR}-cygwin
+ exit ;;
+ p*:CYGWIN*:*)
+ echo powerpcle-${VENDOR}-cygwin
+ exit ;;
+ prep*:SunOS:5.*:*)
+ echo powerpcle-${VENDOR}-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ exit ;;
+ *:GNU:*:*)
+ # the GNU system
+ echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-${VENDOR}-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
+ exit ;;
+ *:GNU/*:*:*)
+ # other systems with GNU libc and userland
+ echo ${UNAME_MACHINE}-${VENDOR}-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu
+ exit ;;
+ i*86:Minix:*:*)
+ echo ${UNAME_MACHINE}-pc-minix
+ exit ;;
+ alpha:Linux:*:*)
+ case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
+ EV5) UNAME_MACHINE=alphaev5 ;;
+ EV56) UNAME_MACHINE=alphaev56 ;;
+ PCA56) UNAME_MACHINE=alphapca56 ;;
+ PCA57) UNAME_MACHINE=alphapca56 ;;
+ EV6) UNAME_MACHINE=alphaev6 ;;
+ EV67) UNAME_MACHINE=alphaev67 ;;
+ EV68*) UNAME_MACHINE=alphaev68 ;;
+ esac
+ objdump --private-headers /bin/sh | grep -q ld.so.1
+ if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
+ echo ${UNAME_MACHINE}-${VENDOR}-linux-gnu${LIBC}
+ exit ;;
+ arm*:Linux:*:*)
+ eval $set_cc_for_build
+ if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
+ | grep -q __ARM_EABI__
+ then
+ echo ${UNAME_MACHINE}-${VENDOR}-linux-gnu
+ else
+ echo ${UNAME_MACHINE}-${VENDOR}-linux-gnueabi
+ fi
+ exit ;;
+ avr32*:Linux:*:*)
+ echo ${UNAME_MACHINE}-${VENDOR}-linux-gnu
+ exit ;;
+ cris:Linux:*:*)
+ echo cris-axis-linux-gnu
+ exit ;;
+ crisv32:Linux:*:*)
+ echo crisv32-axis-linux-gnu
+ exit ;;
+ frv:Linux:*:*)
+ echo frv-${VENDOR}-linux-gnu
+ exit ;;
+ i*86:Linux:*:*)
+ LIBC=gnu
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+ #ifdef __dietlibc__
+ LIBC=dietlibc
+ #endif
+EOF
+ eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'`
+ echo "${UNAME_MACHINE}-${VENDOR}-linux-${LIBC}"
+ exit ;;
+ ia64:Linux:*:*)
+ echo ${UNAME_MACHINE}-${VENDOR}-linux-gnu
+ exit ;;
+ m32r*:Linux:*:*)
+ echo ${UNAME_MACHINE}-${VENDOR}-linux-gnu
+ exit ;;
+ m68*:Linux:*:*)
+ echo ${UNAME_MACHINE}-${VENDOR}-linux-gnu
+ exit ;;
+ mips:Linux:*:* | mips64:Linux:*:*)
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+ #undef CPU
+ #undef ${UNAME_MACHINE}
+ #undef ${UNAME_MACHINE}el
+ #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
+ CPU=${UNAME_MACHINE}el
+ #else
+ #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
+ CPU=${UNAME_MACHINE}
+ #else
+ CPU=
+ #endif
+ #endif
+EOF
+ eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
+ test x"${CPU}" != x && { echo "${CPU}-${VENDOR}-linux-gnu"; exit; }
+ ;;
+ or32:Linux:*:*)
+ echo or32-${VENDOR}-linux-gnu
+ exit ;;
+ padre:Linux:*:*)
+ echo sparc-${VENDOR}-linux-gnu
+ exit ;;
+ parisc64:Linux:*:* | hppa64:Linux:*:*)
+ echo hppa64-${VENDOR}-linux-gnu
+ exit ;;
+ parisc:Linux:*:* | hppa:Linux:*:*)
+ # Look for CPU level
+ case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
+ PA7*) echo hppa1.1-${VENDOR}-linux-gnu ;;
+ PA8*) echo hppa2.0-${VENDOR}-linux-gnu ;;
+ *) echo hppa-${VENDOR}-linux-gnu ;;
+ esac
+ exit ;;
+ ppc64:Linux:*:*)
+ echo powerpc64-${VENDOR}-linux-gnu
+ exit ;;
+ ppc:Linux:*:*)
+ echo powerpc-${VENDOR}-linux-gnu
+ exit ;;
+ s390:Linux:*:* | s390x:Linux:*:*)
+ echo ${UNAME_MACHINE}-ibm-linux
+ exit ;;
+ sh64*:Linux:*:*)
+ echo ${UNAME_MACHINE}-${VENDOR}-linux-gnu
+ exit ;;
+ sh*:Linux:*:*)
+ echo ${UNAME_MACHINE}-${VENDOR}-linux-gnu
+ exit ;;
+ sparc:Linux:*:* | sparc64:Linux:*:*)
+ echo ${UNAME_MACHINE}-${VENDOR}-linux-gnu
+ exit ;;
+ vax:Linux:*:*)
+ echo ${UNAME_MACHINE}-dec-linux-gnu
+ exit ;;
+ x86_64:Linux:*:*)
+ echo x86_64-${VENDOR}-linux-gnu
+ exit ;;
+ xtensa*:Linux:*:*)
+ echo ${UNAME_MACHINE}-${VENDOR}-linux-gnu
+ exit ;;
+ i*86:DYNIX/ptx:4*:*)
+ # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
+ # earlier versions are messed up and put the nodename in both
+ # sysname and nodename.
+ echo i386-sequent-sysv4
+ exit ;;
+ i*86:UNIX_SV:4.2MP:2.*)
+ # Unixware is an offshoot of SVR4, but it has its own version
+ # number series starting with 2...
+ # I am not positive that other SVR4 systems won't match this,
+ # I just have to hope. -- rms.
+ # Use sysv4.2uw... so that sysv4* matches it.
+ echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
+ exit ;;
+ i*86:OS/2:*:*)
+ # If we were able to find `uname', then EMX Unix compatibility
+ # is probably installed.
+ echo ${UNAME_MACHINE}-pc-os2-emx
+ exit ;;
+ i*86:XTS-300:*:STOP)
+ echo ${UNAME_MACHINE}-${VENDOR}-stop
+ exit ;;
+ i*86:atheos:*:*)
+ echo ${UNAME_MACHINE}-${VENDOR}-atheos
+ exit ;;
+ i*86:syllable:*:*)
+ echo ${UNAME_MACHINE}-pc-syllable
+ exit ;;
+ i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*)
+ echo i386-${VENDOR}-lynxos${UNAME_RELEASE}
+ exit ;;
+ i*86:*DOS:*:*)
+ echo ${UNAME_MACHINE}-pc-msdosdjgpp
+ exit ;;
+ i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
+ UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
+ if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
+ echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}
+ else
+ echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
+ fi
+ exit ;;
+ i*86:*:5:[678]*)
+ # UnixWare 7.x, OpenUNIX and OpenServer 6.
+ case `/bin/uname -X | grep "^Machine"` in
+ *486*) UNAME_MACHINE=i486 ;;
+ *Pentium) UNAME_MACHINE=i586 ;;
+ *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
+ esac
+ echo ${UNAME_MACHINE}-${VENDOR}-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
+ exit ;;
+ i*86:*:3.2:*)
+ if test -f /usr/options/cb.name; then
+ UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
+ echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
+ elif /bin/uname -X 2>/dev/null >/dev/null ; then
+ UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
+ (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
+ (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \
+ && UNAME_MACHINE=i586
+ (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \
+ && UNAME_MACHINE=i686
+ (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
+ && UNAME_MACHINE=i686
+ echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
+ else
+ echo ${UNAME_MACHINE}-pc-sysv32
+ fi
+ exit ;;
+ pc:*:*:*)
+ # Left here for compatibility:
+ # uname -m prints for DJGPP always 'pc', but it prints nothing about
+ # the processor, so we play safe by assuming i586.
+ # Note: whatever this is, it MUST be the same as what config.sub
+ # prints for the "djgpp" host, or else GDB configury will decide that
+ # this is a cross-build.
+ echo i586-pc-msdosdjgpp
+ exit ;;
+ Intel:Mach:3*:*)
+ echo i386-pc-mach3
+ exit ;;
+ paragon:*:*:*)
+ echo i860-intel-osf1
+ exit ;;
+ i860:*:4.*:*) # i860-SVR4
+ if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
+ echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
+ else # Add other i860-SVR4 vendors below as they are discovered.
+ echo i860-${VENDOR}-sysv${UNAME_RELEASE} # Unknown i860-SVR4
+ fi
+ exit ;;
+ mini*:CTIX:SYS*5:*)
+ # "miniframe"
+ echo m68010-convergent-sysv
+ exit ;;
+ mc68k:UNIX:SYSTEM5:3.51m)
+ echo m68k-convergent-sysv
+ exit ;;
+ M680?0:D-NIX:5.3:*)
+ echo m68k-diab-dnix
+ exit ;;
+ M68*:*:R3V[5678]*:*)
+ test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;;
+ 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0)
+ OS_REL=''
+ test -r /etc/.relid \
+ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
+ /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
+ && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
+ /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
+ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
+ 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
+ /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
+ && { echo i486-ncr-sysv4; exit; } ;;
+ NCR*:*:4.2:* | MPRAS*:*:4.2:*)
+ OS_REL='.3'
+ test -r /etc/.relid \
+ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
+ /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
+ && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
+ /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
+ && { echo i586-ncr-sysv4.3${OS_REL}; exit; }
+ /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \
+ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
+ m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
+ echo m68k-${VENDOR}-lynxos${UNAME_RELEASE}
+ exit ;;
+ mc68030:UNIX_System_V:4.*:*)
+ echo m68k-atari-sysv4
+ exit ;;
+ TSUNAMI:LynxOS:2.*:*)
+ echo sparc-${VENDOR}-lynxos${UNAME_RELEASE}
+ exit ;;
+ rs6000:LynxOS:2.*:*)
+ echo rs6000-${VENDOR}-lynxos${UNAME_RELEASE}
+ exit ;;
+ PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*)
+ echo powerpc-${VENDOR}-lynxos${UNAME_RELEASE}
+ exit ;;
+ SM[BE]S:UNIX_SV:*:*)
+ echo mips-dde-sysv${UNAME_RELEASE}
+ exit ;;
+ RM*:ReliantUNIX-*:*:*)
+ echo mips-sni-sysv4
+ exit ;;
+ RM*:SINIX-*:*:*)
+ echo mips-sni-sysv4
+ exit ;;
+ *:SINIX-*:*:*)
+ if uname -p 2>/dev/null >/dev/null ; then
+ UNAME_MACHINE=`(uname -p) 2>/dev/null`
+ echo ${UNAME_MACHINE}-sni-sysv4
+ else
+ echo ns32k-sni-sysv
+ fi
+ exit ;;
+ PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
+ # says <Richard.M.Bartel@ccMail.Census.GOV>
+ echo i586-unisys-sysv4
+ exit ;;
+ *:UNIX_System_V:4*:FTX*)
+ # From Gerald Hewes <hewes@openmarket.com>.
+ # How about differentiating between stratus architectures? -djm
+ echo hppa1.1-stratus-sysv4
+ exit ;;
+ *:*:*:FTX*)
+ # From seanf@swdc.stratus.com.
+ echo i860-stratus-sysv4
+ exit ;;
+ i*86:VOS:*:*)
+ # From Paul.Green@stratus.com.
+ echo ${UNAME_MACHINE}-stratus-vos
+ exit ;;
+ *:VOS:*:*)
+ # From Paul.Green@stratus.com.
+ echo hppa1.1-stratus-vos
+ exit ;;
+ mc68*:A/UX:*:*)
+ echo m68k-apple-aux${UNAME_RELEASE}
+ exit ;;
+ news*:NEWS-OS:6*:*)
+ echo mips-sony-newsos6
+ exit ;;
+ R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
+ if [ -d /usr/nec ]; then
+ echo mips-nec-sysv${UNAME_RELEASE}
+ else
+ echo mips-${VENDOR}-sysv${UNAME_RELEASE}
+ fi
+ exit ;;
+ BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only.
+ echo powerpc-be-beos
+ exit ;;
+ BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only.
+ echo powerpc-apple-beos
+ exit ;;
+ BePC:BeOS:*:*) # BeOS running on Intel PC compatible.
+ echo i586-pc-beos
+ exit ;;
+ BePC:Haiku:*:*) # Haiku running on Intel PC compatible.
+ echo i586-pc-haiku
+ exit ;;
+ SX-4:SUPER-UX:*:*)
+ echo sx4-nec-superux${UNAME_RELEASE}
+ exit ;;
+ SX-5:SUPER-UX:*:*)
+ echo sx5-nec-superux${UNAME_RELEASE}
+ exit ;;
+ SX-6:SUPER-UX:*:*)
+ echo sx6-nec-superux${UNAME_RELEASE}
+ exit ;;
+ SX-7:SUPER-UX:*:*)
+ echo sx7-nec-superux${UNAME_RELEASE}
+ exit ;;
+ SX-8:SUPER-UX:*:*)
+ echo sx8-nec-superux${UNAME_RELEASE}
+ exit ;;
+ SX-8R:SUPER-UX:*:*)
+ echo sx8r-nec-superux${UNAME_RELEASE}
+ exit ;;
+ Power*:Rhapsody:*:*)
+ echo powerpc-apple-rhapsody${UNAME_RELEASE}
+ exit ;;
+ *:Rhapsody:*:*)
+ echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
+ exit ;;
+ *:Darwin:*:*)
+ UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
+ case $UNAME_PROCESSOR in
+ i386)
+ eval $set_cc_for_build
+ if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
+ if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
+ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
+ grep IS_64BIT_ARCH >/dev/null
+ then
+ UNAME_PROCESSOR="x86_64"
+ fi
+ fi ;;
+ unknown) UNAME_PROCESSOR=powerpc ;;
+ esac
+ echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
+ exit ;;
+ *:procnto*:*:* | *:QNX:[0123456789]*:*)
+ UNAME_PROCESSOR=`uname -p`
+ if test "$UNAME_PROCESSOR" = "x86"; then
+ UNAME_PROCESSOR=i386
+ UNAME_MACHINE=pc
+ fi
+ echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
+ exit ;;
+ *:QNX:*:4*)
+ echo i386-pc-qnx
+ exit ;;
+ NSE-?:NONSTOP_KERNEL:*:*)
+ echo nse-tandem-nsk${UNAME_RELEASE}
+ exit ;;
+ NSR-?:NONSTOP_KERNEL:*:*)
+ echo nsr-tandem-nsk${UNAME_RELEASE}
+ exit ;;
+ *:NonStop-UX:*:*)
+ echo mips-compaq-nonstopux
+ exit ;;
+ BS2000:POSIX*:*:*)
+ echo bs2000-siemens-sysv
+ exit ;;
+ DS/*:UNIX_System_V:*:*)
+ echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
+ exit ;;
+ *:Plan9:*:*)
+ # "uname -m" is not consistent, so use $cputype instead. 386
+ # is converted to i386 for consistency with other x86
+ # operating systems.
+ if test "$cputype" = "386"; then
+ UNAME_MACHINE=i386
+ else
+ UNAME_MACHINE="$cputype"
+ fi
+ echo ${UNAME_MACHINE}-${VENDOR}-plan9
+ exit ;;
+ *:TOPS-10:*:*)
+ echo pdp10-${VENDOR}-tops10
+ exit ;;
+ *:TENEX:*:*)
+ echo pdp10-${VENDOR}-tenex
+ exit ;;
+ KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
+ echo pdp10-dec-tops20
+ exit ;;
+ XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
+ echo pdp10-xkl-tops20
+ exit ;;
+ *:TOPS-20:*:*)
+ echo pdp10-${VENDOR}-tops20
+ exit ;;
+ *:ITS:*:*)
+ echo pdp10-${VENDOR}-its
+ exit ;;
+ SEI:*:*:SEIUX)
+ echo mips-sei-seiux${UNAME_RELEASE}
+ exit ;;
+ *:DragonFly:*:*)
+ echo ${UNAME_MACHINE}-${VENDOR}-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
+ exit ;;
+ *:*VMS:*:*)
+ UNAME_MACHINE=`(uname -p) 2>/dev/null`
+ case "${UNAME_MACHINE}" in
+ A*) echo alpha-dec-vms ; exit ;;
+ I*) echo ia64-dec-vms ; exit ;;
+ V*) echo vax-dec-vms ; exit ;;
+ esac ;;
+ *:XENIX:*:SysV)
+ echo i386-pc-xenix
+ exit ;;
+ i*86:skyos:*:*)
+ echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//'
+ exit ;;
+ i*86:rdos:*:*)
+ echo ${UNAME_MACHINE}-pc-rdos
+ exit ;;
+ i*86:AROS:*:*)
+ echo ${UNAME_MACHINE}-pc-aros
+ exit ;;
+esac
+
+#echo '(No uname command or uname output not recognized.)' 1>&2
+#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
+
+eval $set_cc_for_build
+cat >$dummy.c <<EOF
+#ifdef _SEQUENT_
+# include <sys/types.h>
+# include <sys/utsname.h>
+#endif
+main ()
+{
+#if defined (sony)
+#if defined (MIPSEB)
+ /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed,
+ I don't know.... */
+ printf ("mips-sony-bsd\n"); exit (0);
+#else
+#include <sys/param.h>
+ printf ("m68k-sony-newsos%s\n",
+#ifdef NEWSOS4
+ "4"
+#else
+ ""
+#endif
+ ); exit (0);
+#endif
+#endif
+
+#if defined (__arm) && defined (__acorn) && defined (__unix)
+ printf ("arm-acorn-riscix\n"); exit (0);
+#endif
+
+#if defined (hp300) && !defined (hpux)
+ printf ("m68k-hp-bsd\n"); exit (0);
+#endif
+
+#if defined (NeXT)
+#if !defined (__ARCHITECTURE__)
+#define __ARCHITECTURE__ "m68k"
+#endif
+ int version;
+ version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
+ if (version < 4)
+ printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
+ else
+ printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
+ exit (0);
+#endif
+
+#if defined (MULTIMAX) || defined (n16)
+#if defined (UMAXV)
+ printf ("ns32k-encore-sysv\n"); exit (0);
+#else
+#if defined (CMU)
+ printf ("ns32k-encore-mach\n"); exit (0);
+#else
+ printf ("ns32k-encore-bsd\n"); exit (0);
+#endif
+#endif
+#endif
+
+#if defined (__386BSD__)
+ printf ("i386-pc-bsd\n"); exit (0);
+#endif
+
+#if defined (sequent)
+#if defined (i386)
+ printf ("i386-sequent-dynix\n"); exit (0);
+#endif
+#if defined (ns32000)
+ printf ("ns32k-sequent-dynix\n"); exit (0);
+#endif
+#endif
+
+#if defined (_SEQUENT_)
+ struct utsname un;
+
+ uname(&un);
+
+ if (strncmp(un.version, "V2", 2) == 0) {
+ printf ("i386-sequent-ptx2\n"); exit (0);
+ }
+ if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
+ printf ("i386-sequent-ptx1\n"); exit (0);
+ }
+ printf ("i386-sequent-ptx\n"); exit (0);
+
+#endif
+
+#if defined (vax)
+# if !defined (ultrix)
+# include <sys/param.h>
+# if defined (BSD)
+# if BSD == 43
+ printf ("vax-dec-bsd4.3\n"); exit (0);
+# else
+# if BSD == 199006
+ printf ("vax-dec-bsd4.3reno\n"); exit (0);
+# else
+ printf ("vax-dec-bsd\n"); exit (0);
+# endif
+# endif
+# else
+ printf ("vax-dec-bsd\n"); exit (0);
+# endif
+# else
+ printf ("vax-dec-ultrix\n"); exit (0);
+# endif
+#endif
+
+#if defined (alliant) && defined (i860)
+ printf ("i860-alliant-bsd\n"); exit (0);
+#endif
+
+ exit (1);
+}
+EOF
+
+$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` &&
+ { echo "$SYSTEM_NAME"; exit; }
+
+# Apollos put the system type in the environment.
+
+test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; }
+
+# Convex versions that predate uname can use getsysinfo(1)
+
+if [ -x /usr/convex/getsysinfo ]
+then
+ case `getsysinfo -f cpu_type` in
+ c1*)
+ echo c1-convex-bsd
+ exit ;;
+ c2*)
+ if getsysinfo -f scalar_acc
+ then echo c32-convex-bsd
+ else echo c2-convex-bsd
+ fi
+ exit ;;
+ c34*)
+ echo c34-convex-bsd
+ exit ;;
+ c38*)
+ echo c38-convex-bsd
+ exit ;;
+ c4*)
+ echo c4-convex-bsd
+ exit ;;
+ esac
+fi
+
+cat >&2 <<EOF
+$0: unable to guess system type
+
+This script, last modified $timestamp, has failed to recognize
+the operating system you are using. It is advised that you
+download the most up to date version of the config scripts from
+
+ http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
+and
+ http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
+
+If the version you run ($0) is already up to date, please
+send the following data and any information you think might be
+pertinent to <config-patches@gnu.org> in order to provide the needed
+information to handle your system.
+
+config.guess timestamp = $timestamp
+
+uname -m = `(uname -m) 2>/dev/null || echo unknown`
+uname -r = `(uname -r) 2>/dev/null || echo unknown`
+uname -s = `(uname -s) 2>/dev/null || echo unknown`
+uname -v = `(uname -v) 2>/dev/null || echo unknown`
+
+/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null`
+/bin/uname -X = `(/bin/uname -X) 2>/dev/null`
+
+hostinfo = `(hostinfo) 2>/dev/null`
+/bin/universe = `(/bin/universe) 2>/dev/null`
+/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null`
+/bin/arch = `(/bin/arch) 2>/dev/null`
+/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null`
+/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
+
+UNAME_MACHINE = ${UNAME_MACHINE}
+UNAME_RELEASE = ${UNAME_RELEASE}
+UNAME_SYSTEM = ${UNAME_SYSTEM}
+UNAME_VERSION = ${UNAME_VERSION}
+EOF
+
+exit 1
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "timestamp='"
+# time-stamp-format: "%:y-%02m-%02d"
+# time-stamp-end: "'"
+# End:
diff --git a/build-aux/config.sub b/build-aux/config.sub
new file mode 100755
index 0000000..2a55a50
--- /dev/null
+++ b/build-aux/config.sub
@@ -0,0 +1,1705 @@
+#! /bin/sh
+# Configuration validation subroutine script.
+# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
+# Free Software Foundation, Inc.
+
+timestamp='2009-11-20'
+
+# This file is (in principle) common to ALL GNU software.
+# The presence of a machine in this file suggests that SOME GNU software
+# can handle that machine. It does not imply ALL GNU software can.
+#
+# This file is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
+# 02110-1301, USA.
+#
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+
+# Please send patches to <config-patches@gnu.org>. Submit a context
+# diff and a properly formatted GNU ChangeLog entry.
+#
+# Configuration subroutine to validate and canonicalize a configuration type.
+# Supply the specified configuration type as an argument.
+# If it is invalid, we print an error message on stderr and exit with code 1.
+# Otherwise, we print the canonical config type on stdout and succeed.
+
+# You can get the latest version of this script from:
+# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
+
+# This file is supposed to be the same for all GNU packages
+# and recognize all the CPU types, system types and aliases
+# that are meaningful with *any* GNU software.
+# Each package is responsible for reporting which valid configurations
+# it does not support. The user should be able to distinguish
+# a failure to support a valid configuration from a meaningless
+# configuration.
+
+# The goal of this file is to map all the various variations of a given
+# machine specification into a single specification in the form:
+# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
+# or in some cases, the newer four-part form:
+# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
+# It is wrong to echo any other type of specification.
+
+me=`echo "$0" | sed -e 's,.*/,,'`
+
+usage="\
+Usage: $0 [OPTION] CPU-MFR-OPSYS
+ $0 [OPTION] ALIAS
+
+Canonicalize a configuration name.
+
+Operation modes:
+ -h, --help print this help, then exit
+ -t, --time-stamp print date of last modification, then exit
+ -v, --version print version number, then exit
+
+Report bugs and patches to <config-patches@gnu.org>."
+
+version="\
+GNU config.sub ($timestamp)
+
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
+2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+
+This is free software; see the source for copying conditions. There is NO
+warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
+
+help="
+Try \`$me --help' for more information."
+
+# Parse command line
+while test $# -gt 0 ; do
+ case $1 in
+ --time-stamp | --time* | -t )
+ echo "$timestamp" ; exit ;;
+ --version | -v )
+ echo "$version" ; exit ;;
+ --help | --h* | -h )
+ echo "$usage"; exit ;;
+ -- ) # Stop option processing
+ shift; break ;;
+ - ) # Use stdin as input.
+ break ;;
+ -* )
+ echo "$me: invalid option $1$help"
+ exit 1 ;;
+
+ *local*)
+ # First pass through any local machine types.
+ echo $1
+ exit ;;
+
+ * )
+ break ;;
+ esac
+done
+
+case $# in
+ 0) echo "$me: missing argument$help" >&2
+ exit 1;;
+ 1) ;;
+ *) echo "$me: too many arguments$help" >&2
+ exit 1;;
+esac
+
+# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
+# Here we must recognize all the valid KERNEL-OS combinations.
+maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
+case $maybe_os in
+ nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \
+ uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \
+ kopensolaris*-gnu* | \
+ storm-chaos* | os2-emx* | rtmk-nova*)
+ os=-$maybe_os
+ basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
+ ;;
+ *)
+ basic_machine=`echo $1 | sed 's/-[^-]*$//'`
+ if [ $basic_machine != $1 ]
+ then os=`echo $1 | sed 's/.*-/-/'`
+ else os=; fi
+ ;;
+esac
+
+### Let's recognize common machines as not being operating systems so
+### that things like config.sub decstation-3100 work. We also
+### recognize some manufacturers as not being operating systems, so we
+### can provide default operating systems below.
+case $os in
+ -sun*os*)
+ # Prevent following clause from handling this invalid input.
+ ;;
+ -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
+ -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
+ -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
+ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
+ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
+ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
+ -apple | -axis | -knuth | -cray | -microblaze)
+ os=
+ basic_machine=$1
+ ;;
+ -bluegene*)
+ os=-cnk
+ ;;
+ -sim | -cisco | -oki | -wec | -winbond)
+ os=
+ basic_machine=$1
+ ;;
+ -scout)
+ ;;
+ -wrs)
+ os=-vxworks
+ basic_machine=$1
+ ;;
+ -chorusos*)
+ os=-chorusos
+ basic_machine=$1
+ ;;
+ -chorusrdb)
+ os=-chorusrdb
+ basic_machine=$1
+ ;;
+ -hiux*)
+ os=-hiuxwe2
+ ;;
+ -sco6)
+ os=-sco5v6
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -sco5)
+ os=-sco3.2v5
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -sco4)
+ os=-sco3.2v4
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -sco3.2.[4-9]*)
+ os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -sco3.2v[4-9]*)
+ # Don't forget version if it is 3.2v4 or newer.
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -sco5v6*)
+ # Don't forget version if it is 3.2v4 or newer.
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -sco*)
+ os=-sco3.2v2
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -udk*)
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -isc)
+ os=-isc2.2
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -clix*)
+ basic_machine=clipper-intergraph
+ ;;
+ -isc*)
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -lynx*)
+ os=-lynxos
+ ;;
+ -ptx*)
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`
+ ;;
+ -windowsnt*)
+ os=`echo $os | sed -e 's/windowsnt/winnt/'`
+ ;;
+ -psos*)
+ os=-psos
+ ;;
+ -mint | -mint[0-9]*)
+ basic_machine=m68k-atari
+ os=-mint
+ ;;
+esac
+
+# Decode aliases for certain CPU-COMPANY combinations.
+case $basic_machine in
+ # Recognize the basic CPU types without company name.
+ # Some are omitted here because they have special meanings below.
+ 1750a | 580 \
+ | a29k \
+ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
+ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
+ | am33_2.0 \
+ | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \
+ | bfin \
+ | c4x | clipper \
+ | d10v | d30v | dlx | dsp16xx \
+ | fido | fr30 | frv \
+ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
+ | i370 | i860 | i960 | ia64 \
+ | ip2k | iq2000 \
+ | lm32 \
+ | m32c | m32r | m32rle | m68000 | m68k | m88k \
+ | maxq | mb | microblaze | mcore | mep | metag \
+ | mips | mipsbe | mipseb | mipsel | mipsle \
+ | mips16 \
+ | mips64 | mips64el \
+ | mips64octeon | mips64octeonel \
+ | mips64orion | mips64orionel \
+ | mips64r5900 | mips64r5900el \
+ | mips64vr | mips64vrel \
+ | mips64vr4100 | mips64vr4100el \
+ | mips64vr4300 | mips64vr4300el \
+ | mips64vr5000 | mips64vr5000el \
+ | mips64vr5900 | mips64vr5900el \
+ | mipsisa32 | mipsisa32el \
+ | mipsisa32r2 | mipsisa32r2el \
+ | mipsisa64 | mipsisa64el \
+ | mipsisa64r2 | mipsisa64r2el \
+ | mipsisa64sb1 | mipsisa64sb1el \
+ | mipsisa64sr71k | mipsisa64sr71kel \
+ | mipstx39 | mipstx39el \
+ | mn10200 | mn10300 \
+ | moxie \
+ | mt \
+ | msp430 \
+ | nios | nios2 \
+ | ns16k | ns32k \
+ | or32 \
+ | pdp10 | pdp11 | pj | pjl \
+ | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
+ | pyramid \
+ | rx \
+ | score \
+ | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
+ | sh64 | sh64le \
+ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
+ | sparcv8 | sparcv9 | sparcv9b | sparcv9v \
+ | spu | strongarm \
+ | tahoe | thumb | tic4x | tic80 | tron \
+ | ubicom32 \
+ | v850 | v850e \
+ | we32k \
+ | x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \
+ | z8k | z80)
+ basic_machine=$basic_machine-unknown
+ ;;
+ m6811 | m68hc11 | m6812 | m68hc12 | picochip)
+ # Motorola 68HC11/12.
+ basic_machine=$basic_machine-unknown
+ os=-none
+ ;;
+ m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
+ ;;
+ ms1)
+ basic_machine=mt-unknown
+ ;;
+
+ # We use `pc' rather than `unknown'
+ # because (1) that's what they normally are, and
+ # (2) the word "unknown" tends to confuse beginning users.
+ i*86 | x86_64)
+ basic_machine=$basic_machine-pc
+ ;;
+ # Object if more than one company name word.
+ *-*-*)
+ echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
+ exit 1
+ ;;
+ # Recognize the basic CPU types with company name.
+ 580-* \
+ | a29k-* \
+ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
+ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
+ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
+ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \
+ | avr-* | avr32-* \
+ | bfin-* | bs2000-* \
+ | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \
+ | clipper-* | craynv-* | cydra-* \
+ | d10v-* | d30v-* | dlx-* \
+ | elxsi-* \
+ | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
+ | h8300-* | h8500-* \
+ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
+ | i*86-* | i860-* | i960-* | ia64-* \
+ | ip2k-* | iq2000-* \
+ | lm32-* \
+ | m32c-* | m32r-* | m32rle-* \
+ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
+ | m88110-* | m88k-* | maxq-* | mcore-* | metag-* | microblaze-* \
+ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
+ | mips16-* \
+ | mips64-* | mips64el-* \
+ | mips64octeon-* | mips64octeonel-* \
+ | mips64orion-* | mips64orionel-* \
+ | mips64r5900-* | mips64r5900el-* \
+ | mips64vr-* | mips64vrel-* \
+ | mips64vr4100-* | mips64vr4100el-* \
+ | mips64vr4300-* | mips64vr4300el-* \
+ | mips64vr5000-* | mips64vr5000el-* \
+ | mips64vr5900-* | mips64vr5900el-* \
+ | mipsisa32-* | mipsisa32el-* \
+ | mipsisa32r2-* | mipsisa32r2el-* \
+ | mipsisa64-* | mipsisa64el-* \
+ | mipsisa64r2-* | mipsisa64r2el-* \
+ | mipsisa64sb1-* | mipsisa64sb1el-* \
+ | mipsisa64sr71k-* | mipsisa64sr71kel-* \
+ | mipstx39-* | mipstx39el-* \
+ | mmix-* \
+ | mt-* \
+ | msp430-* \
+ | nios-* | nios2-* \
+ | none-* | np1-* | ns16k-* | ns32k-* \
+ | orion-* \
+ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
+ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
+ | pyramid-* \
+ | romp-* | rs6000-* | rx-* \
+ | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
+ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
+ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
+ | sparclite-* \
+ | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \
+ | tahoe-* | thumb-* \
+ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* | tile-* \
+ | tron-* \
+ | ubicom32-* \
+ | v850-* | v850e-* | vax-* \
+ | we32k-* \
+ | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \
+ | xstormy16-* | xtensa*-* \
+ | ymp-* \
+ | z8k-* | z80-*)
+ ;;
+ # Recognize the basic CPU types without company name, with glob match.
+ xtensa*)
+ basic_machine=$basic_machine-unknown
+ ;;
+ # Recognize the various machine names and aliases which stand
+ # for a CPU type and a company and sometimes even an OS.
+ 386bsd)
+ basic_machine=i386-unknown
+ os=-bsd
+ ;;
+ 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
+ basic_machine=m68000-att
+ ;;
+ 3b*)
+ basic_machine=we32k-att
+ ;;
+ a29khif)
+ basic_machine=a29k-amd
+ os=-udi
+ ;;
+ abacus)
+ basic_machine=abacus-unknown
+ ;;
+ adobe68k)
+ basic_machine=m68010-adobe
+ os=-scout
+ ;;
+ alliant | fx80)
+ basic_machine=fx80-alliant
+ ;;
+ altos | altos3068)
+ basic_machine=m68k-altos
+ ;;
+ am29k)
+ basic_machine=a29k-none
+ os=-bsd
+ ;;
+ amd64)
+ basic_machine=x86_64-pc
+ ;;
+ amd64-*)
+ basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ amdahl)
+ basic_machine=580-amdahl
+ os=-sysv
+ ;;
+ amiga | amiga-*)
+ basic_machine=m68k-unknown
+ ;;
+ amigaos | amigados)
+ basic_machine=m68k-unknown
+ os=-amigaos
+ ;;
+ amigaunix | amix)
+ basic_machine=m68k-unknown
+ os=-sysv4
+ ;;
+ apollo68)
+ basic_machine=m68k-apollo
+ os=-sysv
+ ;;
+ apollo68bsd)
+ basic_machine=m68k-apollo
+ os=-bsd
+ ;;
+ aros)
+ basic_machine=i386-pc
+ os=-aros
+ ;;
+ aux)
+ basic_machine=m68k-apple
+ os=-aux
+ ;;
+ balance)
+ basic_machine=ns32k-sequent
+ os=-dynix
+ ;;
+ blackfin)
+ basic_machine=bfin-unknown
+ os=-linux
+ ;;
+ blackfin-*)
+ basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'`
+ os=-linux
+ ;;
+ bluegene*)
+ basic_machine=powerpc-ibm
+ os=-cnk
+ ;;
+ c90)
+ basic_machine=c90-cray
+ os=-unicos
+ ;;
+ cegcc)
+ basic_machine=arm-unknown
+ os=-cegcc
+ ;;
+ convex-c1)
+ basic_machine=c1-convex
+ os=-bsd
+ ;;
+ convex-c2)
+ basic_machine=c2-convex
+ os=-bsd
+ ;;
+ convex-c32)
+ basic_machine=c32-convex
+ os=-bsd
+ ;;
+ convex-c34)
+ basic_machine=c34-convex
+ os=-bsd
+ ;;
+ convex-c38)
+ basic_machine=c38-convex
+ os=-bsd
+ ;;
+ cray | j90)
+ basic_machine=j90-cray
+ os=-unicos
+ ;;
+ craynv)
+ basic_machine=craynv-cray
+ os=-unicosmp
+ ;;
+ cr16)
+ basic_machine=cr16-unknown
+ os=-elf
+ ;;
+ crds | unos)
+ basic_machine=m68k-crds
+ ;;
+ crisv32 | crisv32-* | etraxfs*)
+ basic_machine=crisv32-axis
+ ;;
+ cris | cris-* | etrax*)
+ basic_machine=cris-axis
+ ;;
+ crx)
+ basic_machine=crx-unknown
+ os=-elf
+ ;;
+ da30 | da30-*)
+ basic_machine=m68k-da30
+ ;;
+ decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
+ basic_machine=mips-dec
+ ;;
+ decsystem10* | dec10*)
+ basic_machine=pdp10-dec
+ os=-tops10
+ ;;
+ decsystem20* | dec20*)
+ basic_machine=pdp10-dec
+ os=-tops20
+ ;;
+ delta | 3300 | motorola-3300 | motorola-delta \
+ | 3300-motorola | delta-motorola)
+ basic_machine=m68k-motorola
+ ;;
+ delta88)
+ basic_machine=m88k-motorola
+ os=-sysv3
+ ;;
+ dicos)
+ basic_machine=i686-pc
+ os=-dicos
+ ;;
+ djgpp)
+ basic_machine=i586-pc
+ os=-msdosdjgpp
+ ;;
+ dpx20 | dpx20-*)
+ basic_machine=rs6000-bull
+ os=-bosx
+ ;;
+ dpx2* | dpx2*-bull)
+ basic_machine=m68k-bull
+ os=-sysv3
+ ;;
+ ebmon29k)
+ basic_machine=a29k-amd
+ os=-ebmon
+ ;;
+ elxsi)
+ basic_machine=elxsi-elxsi
+ os=-bsd
+ ;;
+ encore | umax | mmax)
+ basic_machine=ns32k-encore
+ ;;
+ es1800 | OSE68k | ose68k | ose | OSE)
+ basic_machine=m68k-ericsson
+ os=-ose
+ ;;
+ fx2800)
+ basic_machine=i860-alliant
+ ;;
+ genix)
+ basic_machine=ns32k-ns
+ ;;
+ gmicro)
+ basic_machine=tron-gmicro
+ os=-sysv
+ ;;
+ go32)
+ basic_machine=i386-pc
+ os=-go32
+ ;;
+ h3050r* | hiux*)
+ basic_machine=hppa1.1-hitachi
+ os=-hiuxwe2
+ ;;
+ h8300hms)
+ basic_machine=h8300-hitachi
+ os=-hms
+ ;;
+ h8300xray)
+ basic_machine=h8300-hitachi
+ os=-xray
+ ;;
+ h8500hms)
+ basic_machine=h8500-hitachi
+ os=-hms
+ ;;
+ harris)
+ basic_machine=m88k-harris
+ os=-sysv3
+ ;;
+ hp300-*)
+ basic_machine=m68k-hp
+ ;;
+ hp300bsd)
+ basic_machine=m68k-hp
+ os=-bsd
+ ;;
+ hp300hpux)
+ basic_machine=m68k-hp
+ os=-hpux
+ ;;
+ hp3k9[0-9][0-9] | hp9[0-9][0-9])
+ basic_machine=hppa1.0-hp
+ ;;
+ hp9k2[0-9][0-9] | hp9k31[0-9])
+ basic_machine=m68000-hp
+ ;;
+ hp9k3[2-9][0-9])
+ basic_machine=m68k-hp
+ ;;
+ hp9k6[0-9][0-9] | hp6[0-9][0-9])
+ basic_machine=hppa1.0-hp
+ ;;
+ hp9k7[0-79][0-9] | hp7[0-79][0-9])
+ basic_machine=hppa1.1-hp
+ ;;
+ hp9k78[0-9] | hp78[0-9])
+ # FIXME: really hppa2.0-hp
+ basic_machine=hppa1.1-hp
+ ;;
+ hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
+ # FIXME: really hppa2.0-hp
+ basic_machine=hppa1.1-hp
+ ;;
+ hp9k8[0-9][13679] | hp8[0-9][13679])
+ basic_machine=hppa1.1-hp
+ ;;
+ hp9k8[0-9][0-9] | hp8[0-9][0-9])
+ basic_machine=hppa1.0-hp
+ ;;
+ hppa-next)
+ os=-nextstep3
+ ;;
+ hppaosf)
+ basic_machine=hppa1.1-hp
+ os=-osf
+ ;;
+ hppro)
+ basic_machine=hppa1.1-hp
+ os=-proelf
+ ;;
+ i370-ibm* | ibm*)
+ basic_machine=i370-ibm
+ ;;
+# I'm not sure what "Sysv32" means. Should this be sysv3.2?
+ i*86v32)
+ basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+ os=-sysv32
+ ;;
+ i*86v4*)
+ basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+ os=-sysv4
+ ;;
+ i*86v)
+ basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+ os=-sysv
+ ;;
+ i*86sol2)
+ basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+ os=-solaris2
+ ;;
+ i386mach)
+ basic_machine=i386-mach
+ os=-mach
+ ;;
+ i386-vsta | vsta)
+ basic_machine=i386-unknown
+ os=-vsta
+ ;;
+ iris | iris4d)
+ basic_machine=mips-sgi
+ case $os in
+ -irix*)
+ ;;
+ *)
+ os=-irix4
+ ;;
+ esac
+ ;;
+ isi68 | isi)
+ basic_machine=m68k-isi
+ os=-sysv
+ ;;
+ m68knommu)
+ basic_machine=m68k-unknown
+ os=-linux
+ ;;
+ m68knommu-*)
+ basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'`
+ os=-linux
+ ;;
+ m88k-omron*)
+ basic_machine=m88k-omron
+ ;;
+ magnum | m3230)
+ basic_machine=mips-mips
+ os=-sysv
+ ;;
+ merlin)
+ basic_machine=ns32k-utek
+ os=-sysv
+ ;;
+ microblaze)
+ basic_machine=microblaze-xilinx
+ ;;
+ mingw32)
+ basic_machine=i386-pc
+ os=-mingw32
+ ;;
+ mingw32ce)
+ basic_machine=arm-unknown
+ os=-mingw32ce
+ ;;
+ miniframe)
+ basic_machine=m68000-convergent
+ ;;
+ *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*)
+ basic_machine=m68k-atari
+ os=-mint
+ ;;
+ mips3*-*)
+ basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
+ ;;
+ mips3*)
+ basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
+ ;;
+ monitor)
+ basic_machine=m68k-rom68k
+ os=-coff
+ ;;
+ morphos)
+ basic_machine=powerpc-unknown
+ os=-morphos
+ ;;
+ msdos)
+ basic_machine=i386-pc
+ os=-msdos
+ ;;
+ ms1-*)
+ basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
+ ;;
+ mvs)
+ basic_machine=i370-ibm
+ os=-mvs
+ ;;
+ ncr3000)
+ basic_machine=i486-ncr
+ os=-sysv4
+ ;;
+ netbsd386)
+ basic_machine=i386-unknown
+ os=-netbsd
+ ;;
+ netwinder)
+ basic_machine=armv4l-rebel
+ os=-linux
+ ;;
+ news | news700 | news800 | news900)
+ basic_machine=m68k-sony
+ os=-newsos
+ ;;
+ news1000)
+ basic_machine=m68030-sony
+ os=-newsos
+ ;;
+ news-3600 | risc-news)
+ basic_machine=mips-sony
+ os=-newsos
+ ;;
+ necv70)
+ basic_machine=v70-nec
+ os=-sysv
+ ;;
+ next | m*-next )
+ basic_machine=m68k-next
+ case $os in
+ -nextstep* )
+ ;;
+ -ns2*)
+ os=-nextstep2
+ ;;
+ *)
+ os=-nextstep3
+ ;;
+ esac
+ ;;
+ nh3000)
+ basic_machine=m68k-harris
+ os=-cxux
+ ;;
+ nh[45]000)
+ basic_machine=m88k-harris
+ os=-cxux
+ ;;
+ nindy960)
+ basic_machine=i960-intel
+ os=-nindy
+ ;;
+ mon960)
+ basic_machine=i960-intel
+ os=-mon960
+ ;;
+ nonstopux)
+ basic_machine=mips-compaq
+ os=-nonstopux
+ ;;
+ np1)
+ basic_machine=np1-gould
+ ;;
+ nsr-tandem)
+ basic_machine=nsr-tandem
+ ;;
+ op50n-* | op60c-*)
+ basic_machine=hppa1.1-oki
+ os=-proelf
+ ;;
+ openrisc | openrisc-*)
+ basic_machine=or32-unknown
+ ;;
+ os400)
+ basic_machine=powerpc-ibm
+ os=-os400
+ ;;
+ OSE68000 | ose68000)
+ basic_machine=m68000-ericsson
+ os=-ose
+ ;;
+ os68k)
+ basic_machine=m68k-none
+ os=-os68k
+ ;;
+ pa-hitachi)
+ basic_machine=hppa1.1-hitachi
+ os=-hiuxwe2
+ ;;
+ paragon)
+ basic_machine=i860-intel
+ os=-osf
+ ;;
+ parisc)
+ basic_machine=hppa-unknown
+ os=-linux
+ ;;
+ parisc-*)
+ basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'`
+ os=-linux
+ ;;
+ pbd)
+ basic_machine=sparc-tti
+ ;;
+ pbb)
+ basic_machine=m68k-tti
+ ;;
+ pc532 | pc532-*)
+ basic_machine=ns32k-pc532
+ ;;
+ pc98)
+ basic_machine=i386-pc
+ ;;
+ pc98-*)
+ basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ pentium | p5 | k5 | k6 | nexgen | viac3)
+ basic_machine=i586-pc
+ ;;
+ pentiumpro | p6 | 6x86 | athlon | athlon_*)
+ basic_machine=i686-pc
+ ;;
+ pentiumii | pentium2 | pentiumiii | pentium3)
+ basic_machine=i686-pc
+ ;;
+ pentium4)
+ basic_machine=i786-pc
+ ;;
+ pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
+ basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ pentiumpro-* | p6-* | 6x86-* | athlon-*)
+ basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
+ basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ pentium4-*)
+ basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ pn)
+ basic_machine=pn-gould
+ ;;
+ power) basic_machine=power-ibm
+ ;;
+ ppc) basic_machine=powerpc-unknown
+ ;;
+ ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ ppcle | powerpclittle | ppc-le | powerpc-little)
+ basic_machine=powerpcle-unknown
+ ;;
+ ppcle-* | powerpclittle-*)
+ basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ ppc64) basic_machine=powerpc64-unknown
+ ;;
+ ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ ppc64le | powerpc64little | ppc64-le | powerpc64-little)
+ basic_machine=powerpc64le-unknown
+ ;;
+ ppc64le-* | powerpc64little-*)
+ basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ ps2)
+ basic_machine=i386-ibm
+ ;;
+ pw32)
+ basic_machine=i586-unknown
+ os=-pw32
+ ;;
+ rdos)
+ basic_machine=i386-pc
+ os=-rdos
+ ;;
+ rom68k)
+ basic_machine=m68k-rom68k
+ os=-coff
+ ;;
+ rm[46]00)
+ basic_machine=mips-siemens
+ ;;
+ rtpc | rtpc-*)
+ basic_machine=romp-ibm
+ ;;
+ s390 | s390-*)
+ basic_machine=s390-ibm
+ ;;
+ s390x | s390x-*)
+ basic_machine=s390x-ibm
+ ;;
+ sa29200)
+ basic_machine=a29k-amd
+ os=-udi
+ ;;
+ sb1)
+ basic_machine=mipsisa64sb1-unknown
+ ;;
+ sb1el)
+ basic_machine=mipsisa64sb1el-unknown
+ ;;
+ sde)
+ basic_machine=mipsisa32-sde
+ os=-elf
+ ;;
+ sei)
+ basic_machine=mips-sei
+ os=-seiux
+ ;;
+ sequent)
+ basic_machine=i386-sequent
+ ;;
+ sh)
+ basic_machine=sh-hitachi
+ os=-hms
+ ;;
+ sh5el)
+ basic_machine=sh5le-unknown
+ ;;
+ sh64)
+ basic_machine=sh64-unknown
+ ;;
+ sparclite-wrs | simso-wrs)
+ basic_machine=sparclite-wrs
+ os=-vxworks
+ ;;
+ sps7)
+ basic_machine=m68k-bull
+ os=-sysv2
+ ;;
+ spur)
+ basic_machine=spur-unknown
+ ;;
+ st2000)
+ basic_machine=m68k-tandem
+ ;;
+ stratus)
+ basic_machine=i860-stratus
+ os=-sysv4
+ ;;
+ sun2)
+ basic_machine=m68000-sun
+ ;;
+ sun2os3)
+ basic_machine=m68000-sun
+ os=-sunos3
+ ;;
+ sun2os4)
+ basic_machine=m68000-sun
+ os=-sunos4
+ ;;
+ sun3os3)
+ basic_machine=m68k-sun
+ os=-sunos3
+ ;;
+ sun3os4)
+ basic_machine=m68k-sun
+ os=-sunos4
+ ;;
+ sun4os3)
+ basic_machine=sparc-sun
+ os=-sunos3
+ ;;
+ sun4os4)
+ basic_machine=sparc-sun
+ os=-sunos4
+ ;;
+ sun4sol2)
+ basic_machine=sparc-sun
+ os=-solaris2
+ ;;
+ sun3 | sun3-*)
+ basic_machine=m68k-sun
+ ;;
+ sun4)
+ basic_machine=sparc-sun
+ ;;
+ sun386 | sun386i | roadrunner)
+ basic_machine=i386-sun
+ ;;
+ sv1)
+ basic_machine=sv1-cray
+ os=-unicos
+ ;;
+ symmetry)
+ basic_machine=i386-sequent
+ os=-dynix
+ ;;
+ t3e)
+ basic_machine=alphaev5-cray
+ os=-unicos
+ ;;
+ t90)
+ basic_machine=t90-cray
+ os=-unicos
+ ;;
+ tic54x | c54x*)
+ basic_machine=tic54x-unknown
+ os=-coff
+ ;;
+ tic55x | c55x*)
+ basic_machine=tic55x-unknown
+ os=-coff
+ ;;
+ tic6x | c6x*)
+ basic_machine=tic6x-unknown
+ os=-coff
+ ;;
+ tile*)
+ basic_machine=tile-unknown
+ os=-linux-gnu
+ ;;
+ tx39)
+ basic_machine=mipstx39-unknown
+ ;;
+ tx39el)
+ basic_machine=mipstx39el-unknown
+ ;;
+ toad1)
+ basic_machine=pdp10-xkl
+ os=-tops20
+ ;;
+ tower | tower-32)
+ basic_machine=m68k-ncr
+ ;;
+ tpf)
+ basic_machine=s390x-ibm
+ os=-tpf
+ ;;
+ udi29k)
+ basic_machine=a29k-amd
+ os=-udi
+ ;;
+ ultra3)
+ basic_machine=a29k-nyu
+ os=-sym1
+ ;;
+ v810 | necv810)
+ basic_machine=v810-nec
+ os=-none
+ ;;
+ vaxv)
+ basic_machine=vax-dec
+ os=-sysv
+ ;;
+ vms)
+ basic_machine=vax-dec
+ os=-vms
+ ;;
+ vpp*|vx|vx-*)
+ basic_machine=f301-fujitsu
+ ;;
+ vxworks960)
+ basic_machine=i960-wrs
+ os=-vxworks
+ ;;
+ vxworks68)
+ basic_machine=m68k-wrs
+ os=-vxworks
+ ;;
+ vxworks29k)
+ basic_machine=a29k-wrs
+ os=-vxworks
+ ;;
+ w65*)
+ basic_machine=w65-wdc
+ os=-none
+ ;;
+ w89k-*)
+ basic_machine=hppa1.1-winbond
+ os=-proelf
+ ;;
+ xbox)
+ basic_machine=i686-pc
+ os=-mingw32
+ ;;
+ xps | xps100)
+ basic_machine=xps100-honeywell
+ ;;
+ ymp)
+ basic_machine=ymp-cray
+ os=-unicos
+ ;;
+ z8k-*-coff)
+ basic_machine=z8k-unknown
+ os=-sim
+ ;;
+ z80-*-coff)
+ basic_machine=z80-unknown
+ os=-sim
+ ;;
+ none)
+ basic_machine=none-none
+ os=-none
+ ;;
+
+# Here we handle the default manufacturer of certain CPU types. It is in
+# some cases the only manufacturer, in others, it is the most popular.
+ w89k)
+ basic_machine=hppa1.1-winbond
+ ;;
+ op50n)
+ basic_machine=hppa1.1-oki
+ ;;
+ op60c)
+ basic_machine=hppa1.1-oki
+ ;;
+ romp)
+ basic_machine=romp-ibm
+ ;;
+ mmix)
+ basic_machine=mmix-knuth
+ ;;
+ rs6000)
+ basic_machine=rs6000-ibm
+ ;;
+ vax)
+ basic_machine=vax-dec
+ ;;
+ pdp10)
+ # there are many clones, so DEC is not a safe bet
+ basic_machine=pdp10-unknown
+ ;;
+ pdp11)
+ basic_machine=pdp11-dec
+ ;;
+ we32k)
+ basic_machine=we32k-att
+ ;;
+ sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele)
+ basic_machine=sh-unknown
+ ;;
+ sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)
+ basic_machine=sparc-sun
+ ;;
+ cydra)
+ basic_machine=cydra-cydrome
+ ;;
+ orion)
+ basic_machine=orion-highlevel
+ ;;
+ orion105)
+ basic_machine=clipper-highlevel
+ ;;
+ mac | mpw | mac-mpw)
+ basic_machine=m68k-apple
+ ;;
+ pmac | pmac-mpw)
+ basic_machine=powerpc-apple
+ ;;
+ *-unknown)
+ # Make sure to match an already-canonicalized machine name.
+ ;;
+ *)
+ echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
+ exit 1
+ ;;
+esac
+
+# Here we canonicalize certain aliases for manufacturers.
+case $basic_machine in
+ *-digital*)
+ basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`
+ ;;
+ *-commodore*)
+ basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`
+ ;;
+ *)
+ ;;
+esac
+
+# Decode manufacturer-specific aliases for certain operating systems.
+
+if [ x"$os" != x"" ]
+then
+case $os in
+ # First match some system type aliases
+ # that might get confused with valid system types.
+ # -solaris* is a basic system type, with this one exception.
+ -auroraux)
+ os=-auroraux
+ ;;
+ -solaris1 | -solaris1.*)
+ os=`echo $os | sed -e 's|solaris1|sunos4|'`
+ ;;
+ -solaris)
+ os=-solaris2
+ ;;
+ -svr4*)
+ os=-sysv4
+ ;;
+ -unixware*)
+ os=-sysv4.2uw
+ ;;
+ -gnu/linux*)
+ os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
+ ;;
+ # First accept the basic system types.
+ # The portable systems comes first.
+ # Each alternative MUST END IN A *, to match a version number.
+ # -sysv* is not here because it comes later, after sysvr4.
+ -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
+ | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\
+ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
+ | -sym* | -kopensolaris* \
+ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
+ | -aos* | -aros* \
+ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
+ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
+ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
+ | -openbsd* | -solidbsd* \
+ | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
+ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
+ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
+ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
+ | -chorusos* | -chorusrdb* | -cegcc* \
+ | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
+ | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \
+ | -uxpv* | -beos* | -mpeix* | -udk* \
+ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
+ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
+ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
+ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
+ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
+ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
+ | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*)
+ # Remember, each alternative MUST END IN *, to match a version number.
+ ;;
+ -qnx*)
+ case $basic_machine in
+ x86-* | i*86-*)
+ ;;
+ *)
+ os=-nto$os
+ ;;
+ esac
+ ;;
+ -nto-qnx*)
+ ;;
+ -nto*)
+ os=`echo $os | sed -e 's|nto|nto-qnx|'`
+ ;;
+ -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
+ | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \
+ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
+ ;;
+ -mac*)
+ os=`echo $os | sed -e 's|mac|macos|'`
+ ;;
+ -linux-dietlibc)
+ os=-linux-dietlibc
+ ;;
+ -linux*)
+ os=`echo $os | sed -e 's|linux|linux-gnu|'`
+ ;;
+ -sunos5*)
+ os=`echo $os | sed -e 's|sunos5|solaris2|'`
+ ;;
+ -sunos6*)
+ os=`echo $os | sed -e 's|sunos6|solaris3|'`
+ ;;
+ -opened*)
+ os=-openedition
+ ;;
+ -os400*)
+ os=-os400
+ ;;
+ -wince*)
+ os=-wince
+ ;;
+ -osfrose*)
+ os=-osfrose
+ ;;
+ -osf*)
+ os=-osf
+ ;;
+ -utek*)
+ os=-bsd
+ ;;
+ -dynix*)
+ os=-bsd
+ ;;
+ -acis*)
+ os=-aos
+ ;;
+ -atheos*)
+ os=-atheos
+ ;;
+ -syllable*)
+ os=-syllable
+ ;;
+ -386bsd)
+ os=-bsd
+ ;;
+ -ctix* | -uts*)
+ os=-sysv
+ ;;
+ -nova*)
+ os=-rtmk-nova
+ ;;
+ -ns2 )
+ os=-nextstep2
+ ;;
+ -nsk*)
+ os=-nsk
+ ;;
+ # Preserve the version number of sinix5.
+ -sinix5.*)
+ os=`echo $os | sed -e 's|sinix|sysv|'`
+ ;;
+ -sinix*)
+ os=-sysv4
+ ;;
+ -tpf*)
+ os=-tpf
+ ;;
+ -triton*)
+ os=-sysv3
+ ;;
+ -oss*)
+ os=-sysv3
+ ;;
+ -svr4)
+ os=-sysv4
+ ;;
+ -svr3)
+ os=-sysv3
+ ;;
+ -sysvr4)
+ os=-sysv4
+ ;;
+ # This must come after -sysvr4.
+ -sysv*)
+ ;;
+ -ose*)
+ os=-ose
+ ;;
+ -es1800*)
+ os=-ose
+ ;;
+ -xenix)
+ os=-xenix
+ ;;
+ -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
+ os=-mint
+ ;;
+ -aros*)
+ os=-aros
+ ;;
+ -kaos*)
+ os=-kaos
+ ;;
+ -zvmoe)
+ os=-zvmoe
+ ;;
+ -dicos*)
+ os=-dicos
+ ;;
+ -none)
+ ;;
+ *)
+ # Get rid of the `-' at the beginning of $os.
+ os=`echo $os | sed 's/[^-]*-//'`
+ echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
+ exit 1
+ ;;
+esac
+else
+
+# Here we handle the default operating systems that come with various machines.
+# The value should be what the vendor currently ships out the door with their
+# machine or put another way, the most popular os provided with the machine.
+
+# Note that if you're going to try to match "-MANUFACTURER" here (say,
+# "-sun"), then you have to tell the case statement up towards the top
+# that MANUFACTURER isn't an operating system. Otherwise, code above
+# will signal an error saying that MANUFACTURER isn't an operating
+# system, and we'll never get to this point.
+
+case $basic_machine in
+ score-*)
+ os=-elf
+ ;;
+ spu-*)
+ os=-elf
+ ;;
+ *-acorn)
+ os=-riscix1.2
+ ;;
+ arm*-rebel)
+ os=-linux
+ ;;
+ arm*-semi)
+ os=-aout
+ ;;
+ c4x-* | tic4x-*)
+ os=-coff
+ ;;
+ # This must come before the *-dec entry.
+ pdp10-*)
+ os=-tops20
+ ;;
+ pdp11-*)
+ os=-none
+ ;;
+ *-dec | vax-*)
+ os=-ultrix4.2
+ ;;
+ m68*-apollo)
+ os=-domain
+ ;;
+ i386-sun)
+ os=-sunos4.0.2
+ ;;
+ m68000-sun)
+ os=-sunos3
+ # This also exists in the configure program, but was not the
+ # default.
+ # os=-sunos4
+ ;;
+ m68*-cisco)
+ os=-aout
+ ;;
+ mep-*)
+ os=-elf
+ ;;
+ mips*-cisco)
+ os=-elf
+ ;;
+ mips*-*)
+ os=-elf
+ ;;
+ or32-*)
+ os=-coff
+ ;;
+ *-tti) # must be before sparc entry or we get the wrong os.
+ os=-sysv3
+ ;;
+ sparc-* | *-sun)
+ os=-sunos4.1.1
+ ;;
+ *-be)
+ os=-beos
+ ;;
+ *-haiku)
+ os=-haiku
+ ;;
+ *-ibm)
+ os=-aix
+ ;;
+ *-knuth)
+ os=-mmixware
+ ;;
+ *-wec)
+ os=-proelf
+ ;;
+ *-winbond)
+ os=-proelf
+ ;;
+ *-oki)
+ os=-proelf
+ ;;
+ *-hp)
+ os=-hpux
+ ;;
+ *-hitachi)
+ os=-hiux
+ ;;
+ i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
+ os=-sysv
+ ;;
+ *-cbm)
+ os=-amigaos
+ ;;
+ *-dg)
+ os=-dgux
+ ;;
+ *-dolphin)
+ os=-sysv3
+ ;;
+ m68k-ccur)
+ os=-rtu
+ ;;
+ m88k-omron*)
+ os=-luna
+ ;;
+ *-next )
+ os=-nextstep
+ ;;
+ *-sequent)
+ os=-ptx
+ ;;
+ *-crds)
+ os=-unos
+ ;;
+ *-ns)
+ os=-genix
+ ;;
+ i370-*)
+ os=-mvs
+ ;;
+ *-next)
+ os=-nextstep3
+ ;;
+ *-gould)
+ os=-sysv
+ ;;
+ *-highlevel)
+ os=-bsd
+ ;;
+ *-encore)
+ os=-bsd
+ ;;
+ *-sgi)
+ os=-irix
+ ;;
+ *-siemens)
+ os=-sysv4
+ ;;
+ *-masscomp)
+ os=-rtu
+ ;;
+ f30[01]-fujitsu | f700-fujitsu)
+ os=-uxpv
+ ;;
+ *-rom68k)
+ os=-coff
+ ;;
+ *-*bug)
+ os=-coff
+ ;;
+ *-apple)
+ os=-macos
+ ;;
+ *-atari*)
+ os=-mint
+ ;;
+ *)
+ os=-none
+ ;;
+esac
+fi
+
+# Here we handle the case where we know the os, and the CPU type, but not the
+# manufacturer. We pick the logical manufacturer.
+vendor=unknown
+case $basic_machine in
+ *-unknown)
+ case $os in
+ -riscix*)
+ vendor=acorn
+ ;;
+ -sunos*)
+ vendor=sun
+ ;;
+ -cnk*|-aix*)
+ vendor=ibm
+ ;;
+ -beos*)
+ vendor=be
+ ;;
+ -hpux*)
+ vendor=hp
+ ;;
+ -mpeix*)
+ vendor=hp
+ ;;
+ -hiux*)
+ vendor=hitachi
+ ;;
+ -unos*)
+ vendor=crds
+ ;;
+ -dgux*)
+ vendor=dg
+ ;;
+ -luna*)
+ vendor=omron
+ ;;
+ -genix*)
+ vendor=ns
+ ;;
+ -mvs* | -opened*)
+ vendor=ibm
+ ;;
+ -os400*)
+ vendor=ibm
+ ;;
+ -ptx*)
+ vendor=sequent
+ ;;
+ -tpf*)
+ vendor=ibm
+ ;;
+ -vxsim* | -vxworks* | -windiss*)
+ vendor=wrs
+ ;;
+ -aux*)
+ vendor=apple
+ ;;
+ -hms*)
+ vendor=hitachi
+ ;;
+ -mpw* | -macos*)
+ vendor=apple
+ ;;
+ -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
+ vendor=atari
+ ;;
+ -vos*)
+ vendor=stratus
+ ;;
+ esac
+ basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
+ ;;
+esac
+
+echo $basic_machine$os
+exit
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "timestamp='"
+# time-stamp-format: "%:y-%02m-%02d"
+# time-stamp-end: "'"
+# End:
diff --git a/build-aux/depcomp b/build-aux/depcomp
new file mode 100755
index 0000000..df8eea7
--- /dev/null
+++ b/build-aux/depcomp
@@ -0,0 +1,630 @@
+#! /bin/sh
+# depcomp - compile a program generating dependencies as side-effects
+
+scriptversion=2009-04-28.21; # UTC
+
+# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2009 Free
+# Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# Originally written by Alexandre Oliva <oliva@dcc.unicamp.br>.
+
+case $1 in
+ '')
+ echo "$0: No command. Try \`$0 --help' for more information." 1>&2
+ exit 1;
+ ;;
+ -h | --h*)
+ cat <<\EOF
+Usage: depcomp [--help] [--version] PROGRAM [ARGS]
+
+Run PROGRAMS ARGS to compile a file, generating dependencies
+as side-effects.
+
+Environment variables:
+ depmode Dependency tracking mode.
+ source Source file read by `PROGRAMS ARGS'.
+ object Object file output by `PROGRAMS ARGS'.
+ DEPDIR directory where to store dependencies.
+ depfile Dependency file to output.
+ tmpdepfile Temporary file to use when outputing dependencies.
+ libtool Whether libtool is used (yes/no).
+
+Report bugs to <bug-automake@gnu.org>.
+EOF
+ exit $?
+ ;;
+ -v | --v*)
+ echo "depcomp $scriptversion"
+ exit $?
+ ;;
+esac
+
+if test -z "$depmode" || test -z "$source" || test -z "$object"; then
+ echo "depcomp: Variables source, object and depmode must be set" 1>&2
+ exit 1
+fi
+
+# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po.
+depfile=${depfile-`echo "$object" |
+ sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`}
+tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
+
+rm -f "$tmpdepfile"
+
+# Some modes work just like other modes, but use different flags. We
+# parameterize here, but still list the modes in the big case below,
+# to make depend.m4 easier to write. Note that we *cannot* use a case
+# here, because this file can only contain one case statement.
+if test "$depmode" = hp; then
+ # HP compiler uses -M and no extra arg.
+ gccflag=-M
+ depmode=gcc
+fi
+
+if test "$depmode" = dashXmstdout; then
+ # This is just like dashmstdout with a different argument.
+ dashmflag=-xM
+ depmode=dashmstdout
+fi
+
+cygpath_u="cygpath -u -f -"
+if test "$depmode" = msvcmsys; then
+ # This is just like msvisualcpp but w/o cygpath translation.
+ # Just convert the backslash-escaped backslashes to single forward
+ # slashes to satisfy depend.m4
+ cygpath_u="sed s,\\\\\\\\,/,g"
+ depmode=msvisualcpp
+fi
+
+case "$depmode" in
+gcc3)
+## gcc 3 implements dependency tracking that does exactly what
+## we want. Yay! Note: for some reason libtool 1.4 doesn't like
+## it if -MD -MP comes after the -MF stuff. Hmm.
+## Unfortunately, FreeBSD c89 acceptance of flags depends upon
+## the command line argument order; so add the flags where they
+## appear in depend2.am. Note that the slowdown incurred here
+## affects only configure: in makefiles, %FASTDEP% shortcuts this.
+ for arg
+ do
+ case $arg in
+ -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;;
+ *) set fnord "$@" "$arg" ;;
+ esac
+ shift # fnord
+ shift # $arg
+ done
+ "$@"
+ stat=$?
+ if test $stat -eq 0; then :
+ else
+ rm -f "$tmpdepfile"
+ exit $stat
+ fi
+ mv "$tmpdepfile" "$depfile"
+ ;;
+
+gcc)
+## There are various ways to get dependency output from gcc. Here's
+## why we pick this rather obscure method:
+## - Don't want to use -MD because we'd like the dependencies to end
+## up in a subdir. Having to rename by hand is ugly.
+## (We might end up doing this anyway to support other compilers.)
+## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like
+## -MM, not -M (despite what the docs say).
+## - Using -M directly means running the compiler twice (even worse
+## than renaming).
+ if test -z "$gccflag"; then
+ gccflag=-MD,
+ fi
+ "$@" -Wp,"$gccflag$tmpdepfile"
+ stat=$?
+ if test $stat -eq 0; then :
+ else
+ rm -f "$tmpdepfile"
+ exit $stat
+ fi
+ rm -f "$depfile"
+ echo "$object : \\" > "$depfile"
+ alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
+## The second -e expression handles DOS-style file names with drive letters.
+ sed -e 's/^[^:]*: / /' \
+ -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile"
+## This next piece of magic avoids the `deleted header file' problem.
+## The problem is that when a header file which appears in a .P file
+## is deleted, the dependency causes make to die (because there is
+## typically no way to rebuild the header). We avoid this by adding
+## dummy dependencies for each header file. Too bad gcc doesn't do
+## this for us directly.
+ tr ' ' '
+' < "$tmpdepfile" |
+## Some versions of gcc put a space before the `:'. On the theory
+## that the space means something, we add a space to the output as
+## well.
+## Some versions of the HPUX 10.20 sed can't process this invocation
+## correctly. Breaking it into two sed invocations is a workaround.
+ sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
+ rm -f "$tmpdepfile"
+ ;;
+
+hp)
+ # This case exists only to let depend.m4 do its work. It works by
+ # looking at the text of this script. This case will never be run,
+ # since it is checked for above.
+ exit 1
+ ;;
+
+sgi)
+ if test "$libtool" = yes; then
+ "$@" "-Wp,-MDupdate,$tmpdepfile"
+ else
+ "$@" -MDupdate "$tmpdepfile"
+ fi
+ stat=$?
+ if test $stat -eq 0; then :
+ else
+ rm -f "$tmpdepfile"
+ exit $stat
+ fi
+ rm -f "$depfile"
+
+ if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files
+ echo "$object : \\" > "$depfile"
+
+ # Clip off the initial element (the dependent). Don't try to be
+ # clever and replace this with sed code, as IRIX sed won't handle
+ # lines with more than a fixed number of characters (4096 in
+ # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines;
+ # the IRIX cc adds comments like `#:fec' to the end of the
+ # dependency line.
+ tr ' ' '
+' < "$tmpdepfile" \
+ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \
+ tr '
+' ' ' >> "$depfile"
+ echo >> "$depfile"
+
+ # The second pass generates a dummy entry for each header file.
+ tr ' ' '
+' < "$tmpdepfile" \
+ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
+ >> "$depfile"
+ else
+ # The sourcefile does not contain any dependencies, so just
+ # store a dummy comment line, to avoid errors with the Makefile
+ # "include basename.Plo" scheme.
+ echo "#dummy" > "$depfile"
+ fi
+ rm -f "$tmpdepfile"
+ ;;
+
+aix)
+ # The C for AIX Compiler uses -M and outputs the dependencies
+ # in a .u file. In older versions, this file always lives in the
+ # current directory. Also, the AIX compiler puts `$object:' at the
+ # start of each line; $object doesn't have directory information.
+ # Version 6 uses the directory in both cases.
+ dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
+ test "x$dir" = "x$object" && dir=
+ base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
+ if test "$libtool" = yes; then
+ tmpdepfile1=$dir$base.u
+ tmpdepfile2=$base.u
+ tmpdepfile3=$dir.libs/$base.u
+ "$@" -Wc,-M
+ else
+ tmpdepfile1=$dir$base.u
+ tmpdepfile2=$dir$base.u
+ tmpdepfile3=$dir$base.u
+ "$@" -M
+ fi
+ stat=$?
+
+ if test $stat -eq 0; then :
+ else
+ rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
+ exit $stat
+ fi
+
+ for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
+ do
+ test -f "$tmpdepfile" && break
+ done
+ if test -f "$tmpdepfile"; then
+ # Each line is of the form `foo.o: dependent.h'.
+ # Do two passes, one to just change these to
+ # `$object: dependent.h' and one to simply `dependent.h:'.
+ sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
+ # That's a tab and a space in the [].
+ sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
+ else
+ # The sourcefile does not contain any dependencies, so just
+ # store a dummy comment line, to avoid errors with the Makefile
+ # "include basename.Plo" scheme.
+ echo "#dummy" > "$depfile"
+ fi
+ rm -f "$tmpdepfile"
+ ;;
+
+icc)
+ # Intel's C compiler understands `-MD -MF file'. However on
+ # icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c
+ # ICC 7.0 will fill foo.d with something like
+ # foo.o: sub/foo.c
+ # foo.o: sub/foo.h
+ # which is wrong. We want:
+ # sub/foo.o: sub/foo.c
+ # sub/foo.o: sub/foo.h
+ # sub/foo.c:
+ # sub/foo.h:
+ # ICC 7.1 will output
+ # foo.o: sub/foo.c sub/foo.h
+ # and will wrap long lines using \ :
+ # foo.o: sub/foo.c ... \
+ # sub/foo.h ... \
+ # ...
+
+ "$@" -MD -MF "$tmpdepfile"
+ stat=$?
+ if test $stat -eq 0; then :
+ else
+ rm -f "$tmpdepfile"
+ exit $stat
+ fi
+ rm -f "$depfile"
+ # Each line is of the form `foo.o: dependent.h',
+ # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'.
+ # Do two passes, one to just change these to
+ # `$object: dependent.h' and one to simply `dependent.h:'.
+ sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile"
+ # Some versions of the HPUX 10.20 sed can't process this invocation
+ # correctly. Breaking it into two sed invocations is a workaround.
+ sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" |
+ sed -e 's/$/ :/' >> "$depfile"
+ rm -f "$tmpdepfile"
+ ;;
+
+hp2)
+ # The "hp" stanza above does not work with aCC (C++) and HP's ia64
+ # compilers, which have integrated preprocessors. The correct option
+ # to use with these is +Maked; it writes dependencies to a file named
+ # 'foo.d', which lands next to the object file, wherever that
+ # happens to be.
+ # Much of this is similar to the tru64 case; see comments there.
+ dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
+ test "x$dir" = "x$object" && dir=
+ base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
+ if test "$libtool" = yes; then
+ tmpdepfile1=$dir$base.d
+ tmpdepfile2=$dir.libs/$base.d
+ "$@" -Wc,+Maked
+ else
+ tmpdepfile1=$dir$base.d
+ tmpdepfile2=$dir$base.d
+ "$@" +Maked
+ fi
+ stat=$?
+ if test $stat -eq 0; then :
+ else
+ rm -f "$tmpdepfile1" "$tmpdepfile2"
+ exit $stat
+ fi
+
+ for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2"
+ do
+ test -f "$tmpdepfile" && break
+ done
+ if test -f "$tmpdepfile"; then
+ sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile"
+ # Add `dependent.h:' lines.
+ sed -ne '2,${
+ s/^ *//
+ s/ \\*$//
+ s/$/:/
+ p
+ }' "$tmpdepfile" >> "$depfile"
+ else
+ echo "#dummy" > "$depfile"
+ fi
+ rm -f "$tmpdepfile" "$tmpdepfile2"
+ ;;
+
+tru64)
+ # The Tru64 compiler uses -MD to generate dependencies as a side
+ # effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'.
+ # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
+ # dependencies in `foo.d' instead, so we check for that too.
+ # Subdirectories are respected.
+ dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
+ test "x$dir" = "x$object" && dir=
+ base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
+
+ if test "$libtool" = yes; then
+ # With Tru64 cc, shared objects can also be used to make a
+ # static library. This mechanism is used in libtool 1.4 series to
+ # handle both shared and static libraries in a single compilation.
+ # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d.
+ #
+ # With libtool 1.5 this exception was removed, and libtool now
+ # generates 2 separate objects for the 2 libraries. These two
+ # compilations output dependencies in $dir.libs/$base.o.d and
+ # in $dir$base.o.d. We have to check for both files, because
+ # one of the two compilations can be disabled. We should prefer
+ # $dir$base.o.d over $dir.libs/$base.o.d because the latter is
+ # automatically cleaned when .libs/ is deleted, while ignoring
+ # the former would cause a distcleancheck panic.
+ tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4
+ tmpdepfile2=$dir$base.o.d # libtool 1.5
+ tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5
+ tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504
+ "$@" -Wc,-MD
+ else
+ tmpdepfile1=$dir$base.o.d
+ tmpdepfile2=$dir$base.d
+ tmpdepfile3=$dir$base.d
+ tmpdepfile4=$dir$base.d
+ "$@" -MD
+ fi
+
+ stat=$?
+ if test $stat -eq 0; then :
+ else
+ rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
+ exit $stat
+ fi
+
+ for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
+ do
+ test -f "$tmpdepfile" && break
+ done
+ if test -f "$tmpdepfile"; then
+ sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
+ # That's a tab and a space in the [].
+ sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
+ else
+ echo "#dummy" > "$depfile"
+ fi
+ rm -f "$tmpdepfile"
+ ;;
+
+#nosideeffect)
+ # This comment above is used by automake to tell side-effect
+ # dependency tracking mechanisms from slower ones.
+
+dashmstdout)
+ # Important note: in order to support this mode, a compiler *must*
+ # always write the preprocessed file to stdout, regardless of -o.
+ "$@" || exit $?
+
+ # Remove the call to Libtool.
+ if test "$libtool" = yes; then
+ while test "X$1" != 'X--mode=compile'; do
+ shift
+ done
+ shift
+ fi
+
+ # Remove `-o $object'.
+ IFS=" "
+ for arg
+ do
+ case $arg in
+ -o)
+ shift
+ ;;
+ $object)
+ shift
+ ;;
+ *)
+ set fnord "$@" "$arg"
+ shift # fnord
+ shift # $arg
+ ;;
+ esac
+ done
+
+ test -z "$dashmflag" && dashmflag=-M
+ # Require at least two characters before searching for `:'
+ # in the target name. This is to cope with DOS-style filenames:
+ # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise.
+ "$@" $dashmflag |
+ sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile"
+ rm -f "$depfile"
+ cat < "$tmpdepfile" > "$depfile"
+ tr ' ' '
+' < "$tmpdepfile" | \
+## Some versions of the HPUX 10.20 sed can't process this invocation
+## correctly. Breaking it into two sed invocations is a workaround.
+ sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
+ rm -f "$tmpdepfile"
+ ;;
+
+dashXmstdout)
+ # This case only exists to satisfy depend.m4. It is never actually
+ # run, as this mode is specially recognized in the preamble.
+ exit 1
+ ;;
+
+makedepend)
+ "$@" || exit $?
+ # Remove any Libtool call
+ if test "$libtool" = yes; then
+ while test "X$1" != 'X--mode=compile'; do
+ shift
+ done
+ shift
+ fi
+ # X makedepend
+ shift
+ cleared=no eat=no
+ for arg
+ do
+ case $cleared in
+ no)
+ set ""; shift
+ cleared=yes ;;
+ esac
+ if test $eat = yes; then
+ eat=no
+ continue
+ fi
+ case "$arg" in
+ -D*|-I*)
+ set fnord "$@" "$arg"; shift ;;
+ # Strip any option that makedepend may not understand. Remove
+ # the object too, otherwise makedepend will parse it as a source file.
+ -arch)
+ eat=yes ;;
+ -*|$object)
+ ;;
+ *)
+ set fnord "$@" "$arg"; shift ;;
+ esac
+ done
+ obj_suffix=`echo "$object" | sed 's/^.*\././'`
+ touch "$tmpdepfile"
+ ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@"
+ rm -f "$depfile"
+ cat < "$tmpdepfile" > "$depfile"
+ sed '1,2d' "$tmpdepfile" | tr ' ' '
+' | \
+## Some versions of the HPUX 10.20 sed can't process this invocation
+## correctly. Breaking it into two sed invocations is a workaround.
+ sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
+ rm -f "$tmpdepfile" "$tmpdepfile".bak
+ ;;
+
+cpp)
+ # Important note: in order to support this mode, a compiler *must*
+ # always write the preprocessed file to stdout.
+ "$@" || exit $?
+
+ # Remove the call to Libtool.
+ if test "$libtool" = yes; then
+ while test "X$1" != 'X--mode=compile'; do
+ shift
+ done
+ shift
+ fi
+
+ # Remove `-o $object'.
+ IFS=" "
+ for arg
+ do
+ case $arg in
+ -o)
+ shift
+ ;;
+ $object)
+ shift
+ ;;
+ *)
+ set fnord "$@" "$arg"
+ shift # fnord
+ shift # $arg
+ ;;
+ esac
+ done
+
+ "$@" -E |
+ sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
+ -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' |
+ sed '$ s: \\$::' > "$tmpdepfile"
+ rm -f "$depfile"
+ echo "$object : \\" > "$depfile"
+ cat < "$tmpdepfile" >> "$depfile"
+ sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile"
+ rm -f "$tmpdepfile"
+ ;;
+
+msvisualcpp)
+ # Important note: in order to support this mode, a compiler *must*
+ # always write the preprocessed file to stdout.
+ "$@" || exit $?
+
+ # Remove the call to Libtool.
+ if test "$libtool" = yes; then
+ while test "X$1" != 'X--mode=compile'; do
+ shift
+ done
+ shift
+ fi
+
+ IFS=" "
+ for arg
+ do
+ case "$arg" in
+ -o)
+ shift
+ ;;
+ $object)
+ shift
+ ;;
+ "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
+ set fnord "$@"
+ shift
+ shift
+ ;;
+ *)
+ set fnord "$@" "$arg"
+ shift
+ shift
+ ;;
+ esac
+ done
+ "$@" -E 2>/dev/null |
+ sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile"
+ rm -f "$depfile"
+ echo "$object : \\" > "$depfile"
+ sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile"
+ echo " " >> "$depfile"
+ sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile"
+ rm -f "$tmpdepfile"
+ ;;
+
+msvcmsys)
+ # This case exists only to let depend.m4 do its work. It works by
+ # looking at the text of this script. This case will never be run,
+ # since it is checked for above.
+ exit 1
+ ;;
+
+none)
+ exec "$@"
+ ;;
+
+*)
+ echo "Unknown depmode $depmode" 1>&2
+ exit 1
+ ;;
+esac
+
+exit 0
+
+# Local Variables:
+# mode: shell-script
+# sh-indentation: 2
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-time-zone: "UTC"
+# time-stamp-end: "; # UTC"
+# End:
diff --git a/build-aux/install-sh b/build-aux/install-sh
new file mode 100755
index 0000000..6781b98
--- /dev/null
+++ b/build-aux/install-sh
@@ -0,0 +1,520 @@
+#!/bin/sh
+# install - install a program, script, or datafile
+
+scriptversion=2009-04-28.21; # UTC
+
+# This originates from X11R5 (mit/util/scripts/install.sh), which was
+# later released in X11R6 (xc/config/util/install.sh) with the
+# following copyright and license.
+#
+# Copyright (C) 1994 X Consortium
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to
+# deal in the Software without restriction, including without limitation the
+# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+# sell copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
+# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+#
+# Except as contained in this notice, the name of the X Consortium shall not
+# be used in advertising or otherwise to promote the sale, use or other deal-
+# ings in this Software without prior written authorization from the X Consor-
+# tium.
+#
+#
+# FSF changes to this file are in the public domain.
+#
+# Calling this script install-sh is preferred over install.sh, to prevent
+# `make' implicit rules from creating a file called install from it
+# when there is no Makefile.
+#
+# This script is compatible with the BSD install script, but was written
+# from scratch.
+
+nl='
+'
+IFS=" "" $nl"
+
+# set DOITPROG to echo to test this script
+
+# Don't use :- since 4.3BSD and earlier shells don't like it.
+doit=${DOITPROG-}
+if test -z "$doit"; then
+ doit_exec=exec
+else
+ doit_exec=$doit
+fi
+
+# Put in absolute file names if you don't have them in your path;
+# or use environment vars.
+
+chgrpprog=${CHGRPPROG-chgrp}
+chmodprog=${CHMODPROG-chmod}
+chownprog=${CHOWNPROG-chown}
+cmpprog=${CMPPROG-cmp}
+cpprog=${CPPROG-cp}
+mkdirprog=${MKDIRPROG-mkdir}
+mvprog=${MVPROG-mv}
+rmprog=${RMPROG-rm}
+stripprog=${STRIPPROG-strip}
+
+posix_glob='?'
+initialize_posix_glob='
+ test "$posix_glob" != "?" || {
+ if (set -f) 2>/dev/null; then
+ posix_glob=
+ else
+ posix_glob=:
+ fi
+ }
+'
+
+posix_mkdir=
+
+# Desired mode of installed file.
+mode=0755
+
+chgrpcmd=
+chmodcmd=$chmodprog
+chowncmd=
+mvcmd=$mvprog
+rmcmd="$rmprog -f"
+stripcmd=
+
+src=
+dst=
+dir_arg=
+dst_arg=
+
+copy_on_change=false
+no_target_directory=
+
+usage="\
+Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
+ or: $0 [OPTION]... SRCFILES... DIRECTORY
+ or: $0 [OPTION]... -t DIRECTORY SRCFILES...
+ or: $0 [OPTION]... -d DIRECTORIES...
+
+In the 1st form, copy SRCFILE to DSTFILE.
+In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
+In the 4th, create DIRECTORIES.
+
+Options:
+ --help display this help and exit.
+ --version display version info and exit.
+
+ -c (ignored)
+ -C install only if different (preserve the last data modification time)
+ -d create directories instead of installing files.
+ -g GROUP $chgrpprog installed files to GROUP.
+ -m MODE $chmodprog installed files to MODE.
+ -o USER $chownprog installed files to USER.
+ -s $stripprog installed files.
+ -t DIRECTORY install into DIRECTORY.
+ -T report an error if DSTFILE is a directory.
+
+Environment variables override the default commands:
+ CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG
+ RMPROG STRIPPROG
+"
+
+while test $# -ne 0; do
+ case $1 in
+ -c) ;;
+
+ -C) copy_on_change=true;;
+
+ -d) dir_arg=true;;
+
+ -g) chgrpcmd="$chgrpprog $2"
+ shift;;
+
+ --help) echo "$usage"; exit $?;;
+
+ -m) mode=$2
+ case $mode in
+ *' '* | *' '* | *'
+'* | *'*'* | *'?'* | *'['*)
+ echo "$0: invalid mode: $mode" >&2
+ exit 1;;
+ esac
+ shift;;
+
+ -o) chowncmd="$chownprog $2"
+ shift;;
+
+ -s) stripcmd=$stripprog;;
+
+ -t) dst_arg=$2
+ shift;;
+
+ -T) no_target_directory=true;;
+
+ --version) echo "$0 $scriptversion"; exit $?;;
+
+ --) shift
+ break;;
+
+ -*) echo "$0: invalid option: $1" >&2
+ exit 1;;
+
+ *) break;;
+ esac
+ shift
+done
+
+if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
+ # When -d is used, all remaining arguments are directories to create.
+ # When -t is used, the destination is already specified.
+ # Otherwise, the last argument is the destination. Remove it from $@.
+ for arg
+ do
+ if test -n "$dst_arg"; then
+ # $@ is not empty: it contains at least $arg.
+ set fnord "$@" "$dst_arg"
+ shift # fnord
+ fi
+ shift # arg
+ dst_arg=$arg
+ done
+fi
+
+if test $# -eq 0; then
+ if test -z "$dir_arg"; then
+ echo "$0: no input file specified." >&2
+ exit 1
+ fi
+ # It's OK to call `install-sh -d' without argument.
+ # This can happen when creating conditional directories.
+ exit 0
+fi
+
+if test -z "$dir_arg"; then
+ trap '(exit $?); exit' 1 2 13 15
+
+ # Set umask so as not to create temps with too-generous modes.
+ # However, 'strip' requires both read and write access to temps.
+ case $mode in
+ # Optimize common cases.
+ *644) cp_umask=133;;
+ *755) cp_umask=22;;
+
+ *[0-7])
+ if test -z "$stripcmd"; then
+ u_plus_rw=
+ else
+ u_plus_rw='% 200'
+ fi
+ cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
+ *)
+ if test -z "$stripcmd"; then
+ u_plus_rw=
+ else
+ u_plus_rw=,u+rw
+ fi
+ cp_umask=$mode$u_plus_rw;;
+ esac
+fi
+
+for src
+do
+ # Protect names starting with `-'.
+ case $src in
+ -*) src=./$src;;
+ esac
+
+ if test -n "$dir_arg"; then
+ dst=$src
+ dstdir=$dst
+ test -d "$dstdir"
+ dstdir_status=$?
+ else
+
+ # Waiting for this to be detected by the "$cpprog $src $dsttmp" command
+ # might cause directories to be created, which would be especially bad
+ # if $src (and thus $dsttmp) contains '*'.
+ if test ! -f "$src" && test ! -d "$src"; then
+ echo "$0: $src does not exist." >&2
+ exit 1
+ fi
+
+ if test -z "$dst_arg"; then
+ echo "$0: no destination specified." >&2
+ exit 1
+ fi
+
+ dst=$dst_arg
+ # Protect names starting with `-'.
+ case $dst in
+ -*) dst=./$dst;;
+ esac
+
+ # If destination is a directory, append the input filename; won't work
+ # if double slashes aren't ignored.
+ if test -d "$dst"; then
+ if test -n "$no_target_directory"; then
+ echo "$0: $dst_arg: Is a directory" >&2
+ exit 1
+ fi
+ dstdir=$dst
+ dst=$dstdir/`basename "$src"`
+ dstdir_status=0
+ else
+ # Prefer dirname, but fall back on a substitute if dirname fails.
+ dstdir=`
+ (dirname "$dst") 2>/dev/null ||
+ expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$dst" : 'X\(//\)[^/]' \| \
+ X"$dst" : 'X\(//\)$' \| \
+ X"$dst" : 'X\(/\)' \| . 2>/dev/null ||
+ echo X"$dst" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'
+ `
+
+ test -d "$dstdir"
+ dstdir_status=$?
+ fi
+ fi
+
+ obsolete_mkdir_used=false
+
+ if test $dstdir_status != 0; then
+ case $posix_mkdir in
+ '')
+ # Create intermediate dirs using mode 755 as modified by the umask.
+ # This is like FreeBSD 'install' as of 1997-10-28.
+ umask=`umask`
+ case $stripcmd.$umask in
+ # Optimize common cases.
+ *[2367][2367]) mkdir_umask=$umask;;
+ .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
+
+ *[0-7])
+ mkdir_umask=`expr $umask + 22 \
+ - $umask % 100 % 40 + $umask % 20 \
+ - $umask % 10 % 4 + $umask % 2
+ `;;
+ *) mkdir_umask=$umask,go-w;;
+ esac
+
+ # With -d, create the new directory with the user-specified mode.
+ # Otherwise, rely on $mkdir_umask.
+ if test -n "$dir_arg"; then
+ mkdir_mode=-m$mode
+ else
+ mkdir_mode=
+ fi
+
+ posix_mkdir=false
+ case $umask in
+ *[123567][0-7][0-7])
+ # POSIX mkdir -p sets u+wx bits regardless of umask, which
+ # is incompatible with FreeBSD 'install' when (umask & 300) != 0.
+ ;;
+ *)
+ tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
+ trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
+
+ if (umask $mkdir_umask &&
+ exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
+ then
+ if test -z "$dir_arg" || {
+ # Check for POSIX incompatibilities with -m.
+ # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
+ # other-writeable bit of parent directory when it shouldn't.
+ # FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
+ ls_ld_tmpdir=`ls -ld "$tmpdir"`
+ case $ls_ld_tmpdir in
+ d????-?r-*) different_mode=700;;
+ d????-?--*) different_mode=755;;
+ *) false;;
+ esac &&
+ $mkdirprog -m$different_mode -p -- "$tmpdir" && {
+ ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
+ test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
+ }
+ }
+ then posix_mkdir=:
+ fi
+ rmdir "$tmpdir/d" "$tmpdir"
+ else
+ # Remove any dirs left behind by ancient mkdir implementations.
+ rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
+ fi
+ trap '' 0;;
+ esac;;
+ esac
+
+ if
+ $posix_mkdir && (
+ umask $mkdir_umask &&
+ $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
+ )
+ then :
+ else
+
+ # The umask is ridiculous, or mkdir does not conform to POSIX,
+ # or it failed possibly due to a race condition. Create the
+ # directory the slow way, step by step, checking for races as we go.
+
+ case $dstdir in
+ /*) prefix='/';;
+ -*) prefix='./';;
+ *) prefix='';;
+ esac
+
+ eval "$initialize_posix_glob"
+
+ oIFS=$IFS
+ IFS=/
+ $posix_glob set -f
+ set fnord $dstdir
+ shift
+ $posix_glob set +f
+ IFS=$oIFS
+
+ prefixes=
+
+ for d
+ do
+ test -z "$d" && continue
+
+ prefix=$prefix$d
+ if test -d "$prefix"; then
+ prefixes=
+ else
+ if $posix_mkdir; then
+ (umask=$mkdir_umask &&
+ $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
+ # Don't fail if two instances are running concurrently.
+ test -d "$prefix" || exit 1
+ else
+ case $prefix in
+ *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
+ *) qprefix=$prefix;;
+ esac
+ prefixes="$prefixes '$qprefix'"
+ fi
+ fi
+ prefix=$prefix/
+ done
+
+ if test -n "$prefixes"; then
+ # Don't fail if two instances are running concurrently.
+ (umask $mkdir_umask &&
+ eval "\$doit_exec \$mkdirprog $prefixes") ||
+ test -d "$dstdir" || exit 1
+ obsolete_mkdir_used=true
+ fi
+ fi
+ fi
+
+ if test -n "$dir_arg"; then
+ { test -z "$chowncmd" || $doit $chowncmd "$dst"; } &&
+ { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } &&
+ { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false ||
+ test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1
+ else
+
+ # Make a couple of temp file names in the proper directory.
+ dsttmp=$dstdir/_inst.$$_
+ rmtmp=$dstdir/_rm.$$_
+
+ # Trap to clean up those temp files at exit.
+ trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
+
+ # Copy the file name to the temp name.
+ (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") &&
+
+ # and set any options; do chmod last to preserve setuid bits.
+ #
+ # If any of these fail, we abort the whole thing. If we want to
+ # ignore errors from any of these, just make sure not to ignore
+ # errors from the above "$doit $cpprog $src $dsttmp" command.
+ #
+ { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } &&
+ { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } &&
+ { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } &&
+ { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } &&
+
+ # If -C, don't bother to copy if it wouldn't change the file.
+ if $copy_on_change &&
+ old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` &&
+ new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` &&
+
+ eval "$initialize_posix_glob" &&
+ $posix_glob set -f &&
+ set X $old && old=:$2:$4:$5:$6 &&
+ set X $new && new=:$2:$4:$5:$6 &&
+ $posix_glob set +f &&
+
+ test "$old" = "$new" &&
+ $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1
+ then
+ rm -f "$dsttmp"
+ else
+ # Rename the file to the real destination.
+ $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null ||
+
+ # The rename failed, perhaps because mv can't rename something else
+ # to itself, or perhaps because mv is so ancient that it does not
+ # support -f.
+ {
+ # Now remove or move aside any old file at destination location.
+ # We try this two ways since rm can't unlink itself on some
+ # systems and the destination file might be busy for other
+ # reasons. In this case, the final cleanup might fail but the new
+ # file should still install successfully.
+ {
+ test ! -f "$dst" ||
+ $doit $rmcmd -f "$dst" 2>/dev/null ||
+ { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
+ { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
+ } ||
+ { echo "$0: cannot unlink or rename $dst" >&2
+ (exit 1); exit 1
+ }
+ } &&
+
+ # Now rename the file to the real destination.
+ $doit $mvcmd "$dsttmp" "$dst"
+ }
+ fi || exit 1
+
+ trap '' 0
+ fi
+done
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-time-zone: "UTC"
+# time-stamp-end: "; # UTC"
+# End:
diff --git a/build-aux/missing b/build-aux/missing
new file mode 100755
index 0000000..28055d2
--- /dev/null
+++ b/build-aux/missing
@@ -0,0 +1,376 @@
+#! /bin/sh
+# Common stub for a few missing GNU programs while installing.
+
+scriptversion=2009-04-28.21; # UTC
+
+# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006,
+# 2008, 2009 Free Software Foundation, Inc.
+# Originally by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+if test $# -eq 0; then
+ echo 1>&2 "Try \`$0 --help' for more information"
+ exit 1
+fi
+
+run=:
+sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p'
+sed_minuso='s/.* -o \([^ ]*\).*/\1/p'
+
+# In the cases where this matters, `missing' is being run in the
+# srcdir already.
+if test -f configure.ac; then
+ configure_ac=configure.ac
+else
+ configure_ac=configure.in
+fi
+
+msg="missing on your system"
+
+case $1 in
+--run)
+ # Try to run requested program, and just exit if it succeeds.
+ run=
+ shift
+ "$@" && exit 0
+ # Exit code 63 means version mismatch. This often happens
+ # when the user try to use an ancient version of a tool on
+ # a file that requires a minimum version. In this case we
+ # we should proceed has if the program had been absent, or
+ # if --run hadn't been passed.
+ if test $? = 63; then
+ run=:
+ msg="probably too old"
+ fi
+ ;;
+
+ -h|--h|--he|--hel|--help)
+ echo "\
+$0 [OPTION]... PROGRAM [ARGUMENT]...
+
+Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an
+error status if there is no known handling for PROGRAM.
+
+Options:
+ -h, --help display this help and exit
+ -v, --version output version information and exit
+ --run try to run the given command, and emulate it if it fails
+
+Supported PROGRAM values:
+ aclocal touch file \`aclocal.m4'
+ autoconf touch file \`configure'
+ autoheader touch file \`config.h.in'
+ autom4te touch the output file, or create a stub one
+ automake touch all \`Makefile.in' files
+ bison create \`y.tab.[ch]', if possible, from existing .[ch]
+ flex create \`lex.yy.c', if possible, from existing .c
+ help2man touch the output file
+ lex create \`lex.yy.c', if possible, from existing .c
+ makeinfo touch the output file
+ tar try tar, gnutar, gtar, then tar without non-portable flags
+ yacc create \`y.tab.[ch]', if possible, from existing .[ch]
+
+Version suffixes to PROGRAM as well as the prefixes \`gnu-', \`gnu', and
+\`g' are ignored when checking the name.
+
+Send bug reports to <bug-automake@gnu.org>."
+ exit $?
+ ;;
+
+ -v|--v|--ve|--ver|--vers|--versi|--versio|--version)
+ echo "missing $scriptversion (GNU Automake)"
+ exit $?
+ ;;
+
+ -*)
+ echo 1>&2 "$0: Unknown \`$1' option"
+ echo 1>&2 "Try \`$0 --help' for more information"
+ exit 1
+ ;;
+
+esac
+
+# normalize program name to check for.
+program=`echo "$1" | sed '
+ s/^gnu-//; t
+ s/^gnu//; t
+ s/^g//; t'`
+
+# Now exit if we have it, but it failed. Also exit now if we
+# don't have it and --version was passed (most likely to detect
+# the program). This is about non-GNU programs, so use $1 not
+# $program.
+case $1 in
+ lex*|yacc*)
+ # Not GNU programs, they don't have --version.
+ ;;
+
+ tar*)
+ if test -n "$run"; then
+ echo 1>&2 "ERROR: \`tar' requires --run"
+ exit 1
+ elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
+ exit 1
+ fi
+ ;;
+
+ *)
+ if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
+ # We have it, but it failed.
+ exit 1
+ elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
+ # Could not run --version or --help. This is probably someone
+ # running `$TOOL --version' or `$TOOL --help' to check whether
+ # $TOOL exists and not knowing $TOOL uses missing.
+ exit 1
+ fi
+ ;;
+esac
+
+# If it does not exist, or fails to run (possibly an outdated version),
+# try to emulate it.
+case $program in
+ aclocal*)
+ echo 1>&2 "\
+WARNING: \`$1' is $msg. You should only need it if
+ you modified \`acinclude.m4' or \`${configure_ac}'. You might want
+ to install the \`Automake' and \`Perl' packages. Grab them from
+ any GNU archive site."
+ touch aclocal.m4
+ ;;
+
+ autoconf*)
+ echo 1>&2 "\
+WARNING: \`$1' is $msg. You should only need it if
+ you modified \`${configure_ac}'. You might want to install the
+ \`Autoconf' and \`GNU m4' packages. Grab them from any GNU
+ archive site."
+ touch configure
+ ;;
+
+ autoheader*)
+ echo 1>&2 "\
+WARNING: \`$1' is $msg. You should only need it if
+ you modified \`acconfig.h' or \`${configure_ac}'. You might want
+ to install the \`Autoconf' and \`GNU m4' packages. Grab them
+ from any GNU archive site."
+ files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}`
+ test -z "$files" && files="config.h"
+ touch_files=
+ for f in $files; do
+ case $f in
+ *:*) touch_files="$touch_files "`echo "$f" |
+ sed -e 's/^[^:]*://' -e 's/:.*//'`;;
+ *) touch_files="$touch_files $f.in";;
+ esac
+ done
+ touch $touch_files
+ ;;
+
+ automake*)
+ echo 1>&2 "\
+WARNING: \`$1' is $msg. You should only need it if
+ you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'.
+ You might want to install the \`Automake' and \`Perl' packages.
+ Grab them from any GNU archive site."
+ find . -type f -name Makefile.am -print |
+ sed 's/\.am$/.in/' |
+ while read f; do touch "$f"; done
+ ;;
+
+ autom4te*)
+ echo 1>&2 "\
+WARNING: \`$1' is needed, but is $msg.
+ You might have modified some files without having the
+ proper tools for further handling them.
+ You can get \`$1' as part of \`Autoconf' from any GNU
+ archive site."
+
+ file=`echo "$*" | sed -n "$sed_output"`
+ test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
+ if test -f "$file"; then
+ touch $file
+ else
+ test -z "$file" || exec >$file
+ echo "#! /bin/sh"
+ echo "# Created by GNU Automake missing as a replacement of"
+ echo "# $ $@"
+ echo "exit 0"
+ chmod +x $file
+ exit 1
+ fi
+ ;;
+
+ bison*|yacc*)
+ echo 1>&2 "\
+WARNING: \`$1' $msg. You should only need it if
+ you modified a \`.y' file. You may need the \`Bison' package
+ in order for those modifications to take effect. You can get
+ \`Bison' from any GNU archive site."
+ rm -f y.tab.c y.tab.h
+ if test $# -ne 1; then
+ eval LASTARG="\${$#}"
+ case $LASTARG in
+ *.y)
+ SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
+ if test -f "$SRCFILE"; then
+ cp "$SRCFILE" y.tab.c
+ fi
+ SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
+ if test -f "$SRCFILE"; then
+ cp "$SRCFILE" y.tab.h
+ fi
+ ;;
+ esac
+ fi
+ if test ! -f y.tab.h; then
+ echo >y.tab.h
+ fi
+ if test ! -f y.tab.c; then
+ echo 'main() { return 0; }' >y.tab.c
+ fi
+ ;;
+
+ lex*|flex*)
+ echo 1>&2 "\
+WARNING: \`$1' is $msg. You should only need it if
+ you modified a \`.l' file. You may need the \`Flex' package
+ in order for those modifications to take effect. You can get
+ \`Flex' from any GNU archive site."
+ rm -f lex.yy.c
+ if test $# -ne 1; then
+ eval LASTARG="\${$#}"
+ case $LASTARG in
+ *.l)
+ SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
+ if test -f "$SRCFILE"; then
+ cp "$SRCFILE" lex.yy.c
+ fi
+ ;;
+ esac
+ fi
+ if test ! -f lex.yy.c; then
+ echo 'main() { return 0; }' >lex.yy.c
+ fi
+ ;;
+
+ help2man*)
+ echo 1>&2 "\
+WARNING: \`$1' is $msg. You should only need it if
+ you modified a dependency of a manual page. You may need the
+ \`Help2man' package in order for those modifications to take
+ effect. You can get \`Help2man' from any GNU archive site."
+
+ file=`echo "$*" | sed -n "$sed_output"`
+ test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
+ if test -f "$file"; then
+ touch $file
+ else
+ test -z "$file" || exec >$file
+ echo ".ab help2man is required to generate this page"
+ exit $?
+ fi
+ ;;
+
+ makeinfo*)
+ echo 1>&2 "\
+WARNING: \`$1' is $msg. You should only need it if
+ you modified a \`.texi' or \`.texinfo' file, or any other file
+ indirectly affecting the aspect of the manual. The spurious
+ call might also be the consequence of using a buggy \`make' (AIX,
+ DU, IRIX). You might want to install the \`Texinfo' package or
+ the \`GNU make' package. Grab either from any GNU archive site."
+ # The file to touch is that specified with -o ...
+ file=`echo "$*" | sed -n "$sed_output"`
+ test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
+ if test -z "$file"; then
+ # ... or it is the one specified with @setfilename ...
+ infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
+ file=`sed -n '
+ /^@setfilename/{
+ s/.* \([^ ]*\) *$/\1/
+ p
+ q
+ }' $infile`
+ # ... or it is derived from the source name (dir/f.texi becomes f.info)
+ test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info
+ fi
+ # If the file does not exist, the user really needs makeinfo;
+ # let's fail without touching anything.
+ test -f $file || exit 1
+ touch $file
+ ;;
+
+ tar*)
+ shift
+
+ # We have already tried tar in the generic part.
+ # Look for gnutar/gtar before invocation to avoid ugly error
+ # messages.
+ if (gnutar --version > /dev/null 2>&1); then
+ gnutar "$@" && exit 0
+ fi
+ if (gtar --version > /dev/null 2>&1); then
+ gtar "$@" && exit 0
+ fi
+ firstarg="$1"
+ if shift; then
+ case $firstarg in
+ *o*)
+ firstarg=`echo "$firstarg" | sed s/o//`
+ tar "$firstarg" "$@" && exit 0
+ ;;
+ esac
+ case $firstarg in
+ *h*)
+ firstarg=`echo "$firstarg" | sed s/h//`
+ tar "$firstarg" "$@" && exit 0
+ ;;
+ esac
+ fi
+
+ echo 1>&2 "\
+WARNING: I can't seem to be able to run \`tar' with the given arguments.
+ You may want to install GNU tar or Free paxutils, or check the
+ command line arguments."
+ exit 1
+ ;;
+
+ *)
+ echo 1>&2 "\
+WARNING: \`$1' is needed, and is $msg.
+ You might have modified some files without having the
+ proper tools for further handling them. Check the \`README' file,
+ it often tells you about the needed prerequisites for installing
+ this package. You may also peek at any GNU archive site, in case
+ some other package would contain this missing \`$1' program."
+ exit 1
+ ;;
+esac
+
+exit 0
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-time-zone: "UTC"
+# time-stamp-end: "; # UTC"
+# End:
diff --git a/config.h.in b/config.h.in
new file mode 100644
index 0000000..a8b9cb5
--- /dev/null
+++ b/config.h.in
@@ -0,0 +1,269 @@
+/* config.h.in. Generated from configure.ac by autoheader. */
+
+/* Define to 1 if you have the <arpa/inet.h> header file. */
+#undef HAVE_ARPA_INET_H
+
+/* Define to 1 if you have the `bzero' function. */
+#undef HAVE_BZERO
+
+/* Define to 1 if you don't have `vprintf' but do have `_doprnt.' */
+#undef HAVE_DOPRNT
+
+/* Define to 1 if you have the <fcntl.h> header file. */
+#undef HAVE_FCNTL_H
+
+/* Define if BRIDGE format is enabled */
+#undef HAVE_FORMAT_BRIDGE
+
+/* Define if DABPLUS format is enabled */
+#undef HAVE_FORMAT_DABPLUS
+
+/* Define if DMB format is enabled */
+#undef HAVE_FORMAT_DMB
+
+/* Define if EPM format is enabled */
+#undef HAVE_FORMAT_EPM
+
+/* Define if MPEG format is enabled */
+#undef HAVE_FORMAT_MPEG
+
+/* Define if PACKET format is enabled */
+#undef HAVE_FORMAT_PACKET
+
+/* Define if RAW format is enabled */
+#undef HAVE_FORMAT_RAW
+
+/* Define to 1 if you have the `gethostbyname' function. */
+#undef HAVE_GETHOSTBYNAME
+
+/* Define to 1 if you have the `gettimeofday' function. */
+#undef HAVE_GETTIMEOFDAY
+
+/* Define to 1 if you have the `inet_ntoa' function. */
+#undef HAVE_INET_NTOA
+
+/* Define if FIFO input is enabled */
+#undef HAVE_INPUT_FIFO
+
+/* Define if FILE input is enabled */
+#undef HAVE_INPUT_FILE
+
+/* Define if PRBS input is enabled */
+#undef HAVE_INPUT_PRBS
+
+/* Define if SLIP input is enabled */
+#undef HAVE_INPUT_SLIP
+
+/* Define if TEST input is enabled */
+#undef HAVE_INPUT_TEST
+
+/* Define if UDP input is enabled */
+#undef HAVE_INPUT_UDP
+
+/* Define to 1 if you have the <inttypes.h> header file. */
+#undef HAVE_INTTYPES_H
+
+/* Define to 1 if you have the `pthread' library (-lpthread). */
+#undef HAVE_LIBPTHREAD
+
+/* Define to 1 if you have the <limits.h> header file. */
+#undef HAVE_LIMITS_H
+
+/* Define to 1 if your system has a GNU libc compatible `malloc' function, and
+ to 0 otherwise. */
+#undef HAVE_MALLOC
+
+/* Define to 1 if you have the `memchr' function. */
+#undef HAVE_MEMCHR
+
+/* Define to 1 if you have the `memmove' function. */
+#undef HAVE_MEMMOVE
+
+/* Define to 1 if you have the <memory.h> header file. */
+#undef HAVE_MEMORY_H
+
+/* Define to 1 if you have the `memset' function. */
+#undef HAVE_MEMSET
+
+/* Define to 1 if you have the <netdb.h> header file. */
+#undef HAVE_NETDB_H
+
+/* Define to 1 if you have the <netinet/in.h> header file. */
+#undef HAVE_NETINET_IN_H
+
+/* Define if FIFO output is enabled */
+#undef HAVE_OUTPUT_FIFO
+
+/* Define if FILE output is enabled */
+#undef HAVE_OUTPUT_FILE
+
+/* Define if RAW output is enabled */
+#undef HAVE_OUTPUT_RAW
+
+/* Define if SIMUL output is enabled */
+#undef HAVE_OUTPUT_SIMUL
+
+/* Define if TCP output is enabled */
+#undef HAVE_OUTPUT_TCP
+
+/* Define if UDP output is enabled */
+#undef HAVE_OUTPUT_UDP
+
+/* Define to 1 if your system has a GNU libc compatible `realloc' function,
+ and to 0 otherwise. */
+#undef HAVE_REALLOC
+
+/* Define to 1 if you have the `socket' function. */
+#undef HAVE_SOCKET
+
+/* Define to 1 if stdbool.h conforms to C99. */
+#undef HAVE_STDBOOL_H
+
+/* Define to 1 if you have the <stddef.h> header file. */
+#undef HAVE_STDDEF_H
+
+/* Define to 1 if you have the <stdint.h> header file. */
+#undef HAVE_STDINT_H
+
+/* Define to 1 if you have the <stdlib.h> header file. */
+#undef HAVE_STDLIB_H
+
+/* Define to 1 if you have the `strchr' function. */
+#undef HAVE_STRCHR
+
+/* Define to 1 if you have the `strdup' function. */
+#undef HAVE_STRDUP
+
+/* Define to 1 if you have the `strerror' function. */
+#undef HAVE_STRERROR
+
+/* Define to 1 if you have the <strings.h> header file. */
+#undef HAVE_STRINGS_H
+
+/* Define to 1 if you have the <string.h> header file. */
+#undef HAVE_STRING_H
+
+/* Define to 1 if you have the `strrchr' function. */
+#undef HAVE_STRRCHR
+
+/* Define to 1 if you have the `strstr' function. */
+#undef HAVE_STRSTR
+
+/* Define to 1 if you have the `strtol' function. */
+#undef HAVE_STRTOL
+
+/* Define to 1 if you have the `strtoul' function. */
+#undef HAVE_STRTOUL
+
+/* Define to 1 if you have the <sys/ioctl.h> header file. */
+#undef HAVE_SYS_IOCTL_H
+
+/* Define to 1 if you have the <sys/socket.h> header file. */
+#undef HAVE_SYS_SOCKET_H
+
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#undef HAVE_SYS_STAT_H
+
+/* Define to 1 if you have the <sys/time.h> header file. */
+#undef HAVE_SYS_TIME_H
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+#undef HAVE_SYS_TYPES_H
+
+/* Define to 1 if you have <sys/wait.h> that is POSIX.1 compatible. */
+#undef HAVE_SYS_WAIT_H
+
+/* Define to 1 if you have the <unistd.h> header file. */
+#undef HAVE_UNISTD_H
+
+/* Define to 1 if you have the `vprintf' function. */
+#undef HAVE_VPRINTF
+
+/* Define to 1 if the system has the type `_Bool'. */
+#undef HAVE__BOOL
+
+/* Define to 1 if your C compiler doesn't accept -c and -o together. */
+#undef NO_MINUS_C_MINUS_O
+
+/* Name of package */
+#undef PACKAGE
+
+/* Define to the address where bug reports for this package should be sent. */
+#undef PACKAGE_BUGREPORT
+
+/* Define to the full name of this package. */
+#undef PACKAGE_NAME
+
+/* Define to the full name and version of this package. */
+#undef PACKAGE_STRING
+
+/* Define to the one symbol short name of this package. */
+#undef PACKAGE_TARNAME
+
+/* Define to the home page for this package. */
+#undef PACKAGE_URL
+
+/* Define to the version of this package. */
+#undef PACKAGE_VERSION
+
+/* Define as the return type of signal handlers (`int' or `void'). */
+#undef RETSIGTYPE
+
+/* Define to 1 if you have the ANSI C header files. */
+#undef STDC_HEADERS
+
+/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
+#undef TIME_WITH_SYS_TIME
+
+/* Define to 1 if your <sys/time.h> declares `struct tm'. */
+#undef TM_IN_SYS_TIME
+
+/* Version number of package */
+#undef VERSION
+
+/* Define for Solaris 2.5.1 so the uint32_t typedef from <sys/synch.h>,
+ <pthread.h>, or <semaphore.h> is not used. If the typedef were allowed, the
+ #define below would cause a syntax error. */
+#undef _UINT32_T
+
+/* Define for Solaris 2.5.1 so the uint8_t typedef from <sys/synch.h>,
+ <pthread.h>, or <semaphore.h> is not used. If the typedef were allowed, the
+ #define below would cause a syntax error. */
+#undef _UINT8_T
+
+/* __16BIT__, __64BIT__ */
+#undef __32BIT__
+
+/* __16BIT__, __32BIT__ */
+#undef __64BIT__
+
+/* Define to empty if `const' does not conform to ANSI C. */
+#undef const
+
+/* Define to rpl_malloc if the replacement function should be used. */
+#undef malloc
+
+/* Define to rpl_realloc if the replacement function should be used. */
+#undef realloc
+
+/* Define to `unsigned int' if <sys/types.h> does not define. */
+#undef size_t
+
+/* Define to `int' if <sys/types.h> does not define. */
+#undef ssize_t
+
+/* Define to the type of an unsigned integer type of width exactly 16 bits if
+ such a type exists and the standard includes do not define it. */
+#undef uint16_t
+
+/* Define to the type of an unsigned integer type of width exactly 32 bits if
+ such a type exists and the standard includes do not define it. */
+#undef uint32_t
+
+/* Define to the type of an unsigned integer type of width exactly 8 bits if
+ such a type exists and the standard includes do not define it. */
+#undef uint8_t
+
+/* Define to empty if the keyword `volatile' does not work. Warning: valid
+ code using `volatile' can become incorrect without. Disable with care. */
+#undef volatile
diff --git a/configure b/configure
new file mode 100755
index 0000000..47b59b2
--- /dev/null
+++ b/configure
@@ -0,0 +1,7416 @@
+#! /bin/sh
+# Guess values for system-dependent variables and create Makefiles.
+# Generated by GNU Autoconf 2.65 for CRC-DabMux 0.3.0.4.
+#
+# Report bugs to <pascal.charest@crc.ca>.
+#
+#
+# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
+# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
+# Inc.
+#
+#
+# This configure script is free software; the Free Software Foundation
+# gives unlimited permission to copy, distribute and modify it.
+## -------------------- ##
+## M4sh Initialization. ##
+## -------------------- ##
+
+# Be more Bourne compatible
+DUALCASE=1; export DUALCASE # for MKS sh
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
+ emulate sh
+ NULLCMD=:
+ # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
+ # is contrary to our usage. Disable this feature.
+ alias -g '${1+"$@"}'='"$@"'
+ setopt NO_GLOB_SUBST
+else
+ case `(set -o) 2>/dev/null` in #(
+ *posix*) :
+ set -o posix ;; #(
+ *) :
+ ;;
+esac
+fi
+
+
+as_nl='
+'
+export as_nl
+# Printing a long string crashes Solaris 7 /usr/bin/printf.
+as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
+# Prefer a ksh shell builtin over an external printf program on Solaris,
+# but without wasting forks for bash or zsh.
+if test -z "$BASH_VERSION$ZSH_VERSION" \
+ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
+ as_echo='print -r --'
+ as_echo_n='print -rn --'
+elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
+ as_echo='printf %s\n'
+ as_echo_n='printf %s'
+else
+ if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
+ as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
+ as_echo_n='/usr/ucb/echo -n'
+ else
+ as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
+ as_echo_n_body='eval
+ arg=$1;
+ case $arg in #(
+ *"$as_nl"*)
+ expr "X$arg" : "X\\(.*\\)$as_nl";
+ arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
+ esac;
+ expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
+ '
+ export as_echo_n_body
+ as_echo_n='sh -c $as_echo_n_body as_echo'
+ fi
+ export as_echo_body
+ as_echo='sh -c $as_echo_body as_echo'
+fi
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+ PATH_SEPARATOR=:
+ (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
+ (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
+ PATH_SEPARATOR=';'
+ }
+fi
+
+
+# IFS
+# We need space, tab and new line, in precisely that order. Quoting is
+# there to prevent editors from complaining about space-tab.
+# (If _AS_PATH_WALK were called with IFS unset, it would disable word
+# splitting by setting IFS to empty value.)
+IFS=" "" $as_nl"
+
+# Find who we are. Look in the path if we contain no directory separator.
+case $0 in #((
+ *[\\/]* ) as_myself=$0 ;;
+ *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+ done
+IFS=$as_save_IFS
+
+ ;;
+esac
+# We did not find ourselves, most probably we were run as `sh COMMAND'
+# in which case we are not to be found in the path.
+if test "x$as_myself" = x; then
+ as_myself=$0
+fi
+if test ! -f "$as_myself"; then
+ $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+ exit 1
+fi
+
+# Unset variables that we do not need and which cause bugs (e.g. in
+# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1"
+# suppresses any "Segmentation fault" message there. '((' could
+# trigger a bug in pdksh 5.2.14.
+for as_var in BASH_ENV ENV MAIL MAILPATH
+do eval test x\${$as_var+set} = xset \
+ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
+done
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+LC_ALL=C
+export LC_ALL
+LANGUAGE=C
+export LANGUAGE
+
+# CDPATH.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+if test "x$CONFIG_SHELL" = x; then
+ as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then :
+ emulate sh
+ NULLCMD=:
+ # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which
+ # is contrary to our usage. Disable this feature.
+ alias -g '\${1+\"\$@\"}'='\"\$@\"'
+ setopt NO_GLOB_SUBST
+else
+ case \`(set -o) 2>/dev/null\` in #(
+ *posix*) :
+ set -o posix ;; #(
+ *) :
+ ;;
+esac
+fi
+"
+ as_required="as_fn_return () { (exit \$1); }
+as_fn_success () { as_fn_return 0; }
+as_fn_failure () { as_fn_return 1; }
+as_fn_ret_success () { return 0; }
+as_fn_ret_failure () { return 1; }
+
+exitcode=0
+as_fn_success || { exitcode=1; echo as_fn_success failed.; }
+as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; }
+as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; }
+as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; }
+if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then :
+
+else
+ exitcode=1; echo positional parameters were not saved.
+fi
+test x\$exitcode = x0 || exit 1"
+ as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO
+ as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO
+ eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" &&
+ test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1
+test \$(( 1 + 1 )) = 2 || exit 1"
+ if (eval "$as_required") 2>/dev/null; then :
+ as_have_required=yes
+else
+ as_have_required=no
+fi
+ if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then :
+
+else
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+as_found=false
+for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ as_found=:
+ case $as_dir in #(
+ /*)
+ for as_base in sh bash ksh sh5; do
+ # Try only shells that exist, to save several forks.
+ as_shell=$as_dir/$as_base
+ if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&
+ { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then :
+ CONFIG_SHELL=$as_shell as_have_required=yes
+ if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then :
+ break 2
+fi
+fi
+ done;;
+ esac
+ as_found=false
+done
+$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } &&
+ { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then :
+ CONFIG_SHELL=$SHELL as_have_required=yes
+fi; }
+IFS=$as_save_IFS
+
+
+ if test "x$CONFIG_SHELL" != x; then :
+ # We cannot yet assume a decent shell, so we have to provide a
+ # neutralization value for shells without unset; and this also
+ # works around shells that cannot unset nonexistent variables.
+ BASH_ENV=/dev/null
+ ENV=/dev/null
+ (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
+ export CONFIG_SHELL
+ exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"}
+fi
+
+ if test x$as_have_required = xno; then :
+ $as_echo "$0: This script requires a shell more modern than all"
+ $as_echo "$0: the shells that I found on your system."
+ if test x${ZSH_VERSION+set} = xset ; then
+ $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should"
+ $as_echo "$0: be upgraded to zsh 4.3.4 or later."
+ else
+ $as_echo "$0: Please tell bug-autoconf@gnu.org and
+$0: pascal.charest@crc.ca about your system, including any
+$0: error possibly output before this message. Then install
+$0: a modern shell, or manually run the script under such a
+$0: shell if you do have one."
+ fi
+ exit 1
+fi
+fi
+fi
+SHELL=${CONFIG_SHELL-/bin/sh}
+export SHELL
+# Unset more variables known to interfere with behavior of common tools.
+CLICOLOR_FORCE= GREP_OPTIONS=
+unset CLICOLOR_FORCE GREP_OPTIONS
+
+## --------------------- ##
+## M4sh Shell Functions. ##
+## --------------------- ##
+# as_fn_unset VAR
+# ---------------
+# Portably unset VAR.
+as_fn_unset ()
+{
+ { eval $1=; unset $1;}
+}
+as_unset=as_fn_unset
+
+# as_fn_set_status STATUS
+# -----------------------
+# Set $? to STATUS, without forking.
+as_fn_set_status ()
+{
+ return $1
+} # as_fn_set_status
+
+# as_fn_exit STATUS
+# -----------------
+# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
+as_fn_exit ()
+{
+ set +e
+ as_fn_set_status $1
+ exit $1
+} # as_fn_exit
+
+# as_fn_mkdir_p
+# -------------
+# Create "$as_dir" as a directory, including parents if necessary.
+as_fn_mkdir_p ()
+{
+
+ case $as_dir in #(
+ -*) as_dir=./$as_dir;;
+ esac
+ test -d "$as_dir" || eval $as_mkdir_p || {
+ as_dirs=
+ while :; do
+ case $as_dir in #(
+ *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
+ *) as_qdir=$as_dir;;
+ esac
+ as_dirs="'$as_qdir' $as_dirs"
+ as_dir=`$as_dirname -- "$as_dir" ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$as_dir" : 'X\(//\)[^/]' \| \
+ X"$as_dir" : 'X\(//\)$' \| \
+ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_dir" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ test -d "$as_dir" && break
+ done
+ test -z "$as_dirs" || eval "mkdir $as_dirs"
+ } || test -d "$as_dir" || as_fn_error "cannot create directory $as_dir"
+
+
+} # as_fn_mkdir_p
+# as_fn_append VAR VALUE
+# ----------------------
+# Append the text in VALUE to the end of the definition contained in VAR. Take
+# advantage of any shell optimizations that allow amortized linear growth over
+# repeated appends, instead of the typical quadratic growth present in naive
+# implementations.
+if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
+ eval 'as_fn_append ()
+ {
+ eval $1+=\$2
+ }'
+else
+ as_fn_append ()
+ {
+ eval $1=\$$1\$2
+ }
+fi # as_fn_append
+
+# as_fn_arith ARG...
+# ------------------
+# Perform arithmetic evaluation on the ARGs, and store the result in the
+# global $as_val. Take advantage of shells that can avoid forks. The arguments
+# must be portable across $(()) and expr.
+if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
+ eval 'as_fn_arith ()
+ {
+ as_val=$(( $* ))
+ }'
+else
+ as_fn_arith ()
+ {
+ as_val=`expr "$@" || test $? -eq 1`
+ }
+fi # as_fn_arith
+
+
+# as_fn_error ERROR [LINENO LOG_FD]
+# ---------------------------------
+# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
+# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
+# script with status $?, using 1 if that was 0.
+as_fn_error ()
+{
+ as_status=$?; test $as_status -eq 0 && as_status=1
+ if test "$3"; then
+ as_lineno=${as_lineno-"$2"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ $as_echo "$as_me:${as_lineno-$LINENO}: error: $1" >&$3
+ fi
+ $as_echo "$as_me: error: $1" >&2
+ as_fn_exit $as_status
+} # as_fn_error
+
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+ test "X`expr 00001 : '.*\(...\)'`" = X001; then
+ as_expr=expr
+else
+ as_expr=false
+fi
+
+if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
+ as_basename=basename
+else
+ as_basename=false
+fi
+
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+ as_dirname=dirname
+else
+ as_dirname=false
+fi
+
+as_me=`$as_basename -- "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+ X"$0" : 'X\(//\)$' \| \
+ X"$0" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X/"$0" |
+ sed '/^.*\/\([^/][^/]*\)\/*$/{
+ s//\1/
+ q
+ }
+ /^X\/\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\/\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+
+ as_lineno_1=$LINENO as_lineno_1a=$LINENO
+ as_lineno_2=$LINENO as_lineno_2a=$LINENO
+ eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" &&
+ test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || {
+ # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-)
+ sed -n '
+ p
+ /[$]LINENO/=
+ ' <$as_myself |
+ sed '
+ s/[$]LINENO.*/&-/
+ t lineno
+ b
+ :lineno
+ N
+ :loop
+ s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
+ t loop
+ s/-\n.*//
+ ' >$as_me.lineno &&
+ chmod +x "$as_me.lineno" ||
+ { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; }
+
+ # Don't try to exec as it changes $[0], causing all sort of problems
+ # (the dirname of $[0] is not the place where we might find the
+ # original and so on. Autoconf is especially sensitive to this).
+ . "./$as_me.lineno"
+ # Exit status is that of the last command.
+ exit
+}
+
+ECHO_C= ECHO_N= ECHO_T=
+case `echo -n x` in #(((((
+-n*)
+ case `echo 'xy\c'` in
+ *c*) ECHO_T=' ';; # ECHO_T is single tab character.
+ xy) ECHO_C='\c';;
+ *) echo `echo ksh88 bug on AIX 6.1` > /dev/null
+ ECHO_T=' ';;
+ esac;;
+*)
+ ECHO_N='-n';;
+esac
+
+rm -f conf$$ conf$$.exe conf$$.file
+if test -d conf$$.dir; then
+ rm -f conf$$.dir/conf$$.file
+else
+ rm -f conf$$.dir
+ mkdir conf$$.dir 2>/dev/null
+fi
+if (echo >conf$$.file) 2>/dev/null; then
+ if ln -s conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s='ln -s'
+ # ... but there are two gotchas:
+ # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+ # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+ # In both cases, we have to default to `cp -p'.
+ ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+ as_ln_s='cp -p'
+ elif ln conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s=ln
+ else
+ as_ln_s='cp -p'
+ fi
+else
+ as_ln_s='cp -p'
+fi
+rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
+rmdir conf$$.dir 2>/dev/null
+
+if mkdir -p . 2>/dev/null; then
+ as_mkdir_p='mkdir -p "$as_dir"'
+else
+ test -d ./-p && rmdir ./-p
+ as_mkdir_p=false
+fi
+
+if test -x / >/dev/null 2>&1; then
+ as_test_x='test -x'
+else
+ if ls -dL / >/dev/null 2>&1; then
+ as_ls_L_option=L
+ else
+ as_ls_L_option=
+ fi
+ as_test_x='
+ eval sh -c '\''
+ if test -d "$1"; then
+ test -d "$1/.";
+ else
+ case $1 in #(
+ -*)set "./$1";;
+ esac;
+ case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #((
+ ???[sx]*):;;*)false;;esac;fi
+ '\'' sh
+ '
+fi
+as_executable_p=$as_test_x
+
+# Sed expression to map a string onto a valid CPP name.
+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
+
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
+
+
+test -n "$DJDIR" || exec 7<&0 </dev/null
+exec 6>&1
+
+# Name of the host.
+# hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
+# so uname gets run too.
+ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
+
+#
+# Initializations.
+#
+ac_default_prefix=/usr/local
+ac_clean_files=
+ac_config_libobj_dir=.
+LIBOBJS=
+cross_compiling=no
+subdirs=
+MFLAGS=
+MAKEFLAGS=
+
+# Identity of this package.
+PACKAGE_NAME='CRC-DabMux'
+PACKAGE_TARNAME='crc-dabmux'
+PACKAGE_VERSION='0.3.0.4'
+PACKAGE_STRING='CRC-DabMux 0.3.0.4'
+PACKAGE_BUGREPORT='pascal.charest@crc.ca'
+PACKAGE_URL=''
+
+ac_unique_file="src/DabMux.cpp"
+# Factoring default headers for most tests.
+ac_includes_default="\
+#include <stdio.h>
+#ifdef HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
+#ifdef HAVE_SYS_STAT_H
+# include <sys/stat.h>
+#endif
+#ifdef STDC_HEADERS
+# include <stdlib.h>
+# include <stddef.h>
+#else
+# ifdef HAVE_STDLIB_H
+# include <stdlib.h>
+# endif
+#endif
+#ifdef HAVE_STRING_H
+# if !defined STDC_HEADERS && defined HAVE_MEMORY_H
+# include <memory.h>
+# endif
+# include <string.h>
+#endif
+#ifdef HAVE_STRINGS_H
+# include <strings.h>
+#endif
+#ifdef HAVE_INTTYPES_H
+# include <inttypes.h>
+#endif
+#ifdef HAVE_STDINT_H
+# include <stdint.h>
+#endif
+#ifdef HAVE_UNISTD_H
+# include <unistd.h>
+#endif"
+
+ac_subst_vars='am__EXEEXT_FALSE
+am__EXEEXT_TRUE
+LTLIBOBJS
+LIBOBJS
+EGREP
+GREP
+FARSYNC_DIR
+WINDOWS_FALSE
+WINDOWS_TRUE
+CPP
+am__fastdepCC_FALSE
+am__fastdepCC_TRUE
+CCDEPMODE
+ac_ct_CC
+CFLAGS
+CC
+am__fastdepCXX_FALSE
+am__fastdepCXX_TRUE
+CXXDEPMODE
+AMDEPBACKSLASH
+AMDEP_FALSE
+AMDEP_TRUE
+am__quote
+am__include
+DEPDIR
+OBJEXT
+EXEEXT
+ac_ct_CXX
+CPPFLAGS
+LDFLAGS
+CXXFLAGS
+CXX
+BUILD_HOST
+WSOCK32
+GETOPT
+BUILD_TARGET
+am__untar
+am__tar
+AMTAR
+am__leading_dot
+SET_MAKE
+AWK
+mkdir_p
+MKDIR_P
+INSTALL_STRIP_PROGRAM
+STRIP
+install_sh
+MAKEINFO
+AUTOHEADER
+AUTOMAKE
+AUTOCONF
+ACLOCAL
+VERSION
+PACKAGE
+CYGPATH_W
+am__isrc
+INSTALL_DATA
+INSTALL_SCRIPT
+INSTALL_PROGRAM
+target_os
+target_vendor
+target_cpu
+target
+host_os
+host_vendor
+host_cpu
+host
+build_os
+build_vendor
+build_cpu
+build
+target_alias
+host_alias
+build_alias
+LIBS
+ECHO_T
+ECHO_N
+ECHO_C
+DEFS
+mandir
+localedir
+libdir
+psdir
+pdfdir
+dvidir
+htmldir
+infodir
+docdir
+oldincludedir
+includedir
+localstatedir
+sharedstatedir
+sysconfdir
+datadir
+datarootdir
+libexecdir
+sbindir
+bindir
+program_transform_name
+prefix
+exec_prefix
+PACKAGE_URL
+PACKAGE_BUGREPORT
+PACKAGE_STRING
+PACKAGE_VERSION
+PACKAGE_TARNAME
+PACKAGE_NAME
+PATH_SEPARATOR
+SHELL'
+ac_subst_files=''
+ac_user_opts='
+enable_option_checking
+enable_dependency_tracking
+enable_input_prbs
+enable_input_test
+enable_input_slip
+enable_input_udp
+enable_input_fifo
+enable_input_file
+enable_output_file
+enable_output_fifo
+enable_output_udp
+enable_output_tcp
+enable_output_raw
+enable_output_simul
+enable_format_raw
+enable_format_bridge
+enable_format_mpeg
+enable_format_packet
+enable_format_dabplus
+enable_format_dmb
+enable_format_epm
+'
+ ac_precious_vars='build_alias
+host_alias
+target_alias
+CXX
+CXXFLAGS
+LDFLAGS
+LIBS
+CPPFLAGS
+CCC
+CC
+CFLAGS
+CPP'
+
+
+# Initialize some variables set by options.
+ac_init_help=
+ac_init_version=false
+ac_unrecognized_opts=
+ac_unrecognized_sep=
+# The variables have the same names as the options, with
+# dashes changed to underlines.
+cache_file=/dev/null
+exec_prefix=NONE
+no_create=
+no_recursion=
+prefix=NONE
+program_prefix=NONE
+program_suffix=NONE
+program_transform_name=s,x,x,
+silent=
+site=
+srcdir=
+verbose=
+x_includes=NONE
+x_libraries=NONE
+
+# Installation directory options.
+# These are left unexpanded so users can "make install exec_prefix=/foo"
+# and all the variables that are supposed to be based on exec_prefix
+# by default will actually change.
+# Use braces instead of parens because sh, perl, etc. also accept them.
+# (The list follows the same order as the GNU Coding Standards.)
+bindir='${exec_prefix}/bin'
+sbindir='${exec_prefix}/sbin'
+libexecdir='${exec_prefix}/libexec'
+datarootdir='${prefix}/share'
+datadir='${datarootdir}'
+sysconfdir='${prefix}/etc'
+sharedstatedir='${prefix}/com'
+localstatedir='${prefix}/var'
+includedir='${prefix}/include'
+oldincludedir='/usr/include'
+docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
+infodir='${datarootdir}/info'
+htmldir='${docdir}'
+dvidir='${docdir}'
+pdfdir='${docdir}'
+psdir='${docdir}'
+libdir='${exec_prefix}/lib'
+localedir='${datarootdir}/locale'
+mandir='${datarootdir}/man'
+
+ac_prev=
+ac_dashdash=
+for ac_option
+do
+ # If the previous option needs an argument, assign it.
+ if test -n "$ac_prev"; then
+ eval $ac_prev=\$ac_option
+ ac_prev=
+ continue
+ fi
+
+ case $ac_option in
+ *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;
+ *) ac_optarg=yes ;;
+ esac
+
+ # Accept the important Cygnus configure options, so we can diagnose typos.
+
+ case $ac_dashdash$ac_option in
+ --)
+ ac_dashdash=yes ;;
+
+ -bindir | --bindir | --bindi | --bind | --bin | --bi)
+ ac_prev=bindir ;;
+ -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
+ bindir=$ac_optarg ;;
+
+ -build | --build | --buil | --bui | --bu)
+ ac_prev=build_alias ;;
+ -build=* | --build=* | --buil=* | --bui=* | --bu=*)
+ build_alias=$ac_optarg ;;
+
+ -cache-file | --cache-file | --cache-fil | --cache-fi \
+ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
+ ac_prev=cache_file ;;
+ -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
+ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
+ cache_file=$ac_optarg ;;
+
+ --config-cache | -C)
+ cache_file=config.cache ;;
+
+ -datadir | --datadir | --datadi | --datad)
+ ac_prev=datadir ;;
+ -datadir=* | --datadir=* | --datadi=* | --datad=*)
+ datadir=$ac_optarg ;;
+
+ -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
+ | --dataroo | --dataro | --datar)
+ ac_prev=datarootdir ;;
+ -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
+ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
+ datarootdir=$ac_optarg ;;
+
+ -disable-* | --disable-*)
+ ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+ as_fn_error "invalid feature name: $ac_useropt"
+ ac_useropt_orig=$ac_useropt
+ ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+ case $ac_user_opts in
+ *"
+"enable_$ac_useropt"
+"*) ;;
+ *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig"
+ ac_unrecognized_sep=', ';;
+ esac
+ eval enable_$ac_useropt=no ;;
+
+ -docdir | --docdir | --docdi | --doc | --do)
+ ac_prev=docdir ;;
+ -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*)
+ docdir=$ac_optarg ;;
+
+ -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv)
+ ac_prev=dvidir ;;
+ -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*)
+ dvidir=$ac_optarg ;;
+
+ -enable-* | --enable-*)
+ ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+ as_fn_error "invalid feature name: $ac_useropt"
+ ac_useropt_orig=$ac_useropt
+ ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+ case $ac_user_opts in
+ *"
+"enable_$ac_useropt"
+"*) ;;
+ *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig"
+ ac_unrecognized_sep=', ';;
+ esac
+ eval enable_$ac_useropt=\$ac_optarg ;;
+
+ -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
+ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
+ | --exec | --exe | --ex)
+ ac_prev=exec_prefix ;;
+ -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
+ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
+ | --exec=* | --exe=* | --ex=*)
+ exec_prefix=$ac_optarg ;;
+
+ -gas | --gas | --ga | --g)
+ # Obsolete; use --with-gas.
+ with_gas=yes ;;
+
+ -help | --help | --hel | --he | -h)
+ ac_init_help=long ;;
+ -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
+ ac_init_help=recursive ;;
+ -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
+ ac_init_help=short ;;
+
+ -host | --host | --hos | --ho)
+ ac_prev=host_alias ;;
+ -host=* | --host=* | --hos=* | --ho=*)
+ host_alias=$ac_optarg ;;
+
+ -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht)
+ ac_prev=htmldir ;;
+ -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \
+ | --ht=*)
+ htmldir=$ac_optarg ;;
+
+ -includedir | --includedir | --includedi | --included | --include \
+ | --includ | --inclu | --incl | --inc)
+ ac_prev=includedir ;;
+ -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
+ | --includ=* | --inclu=* | --incl=* | --inc=*)
+ includedir=$ac_optarg ;;
+
+ -infodir | --infodir | --infodi | --infod | --info | --inf)
+ ac_prev=infodir ;;
+ -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
+ infodir=$ac_optarg ;;
+
+ -libdir | --libdir | --libdi | --libd)
+ ac_prev=libdir ;;
+ -libdir=* | --libdir=* | --libdi=* | --libd=*)
+ libdir=$ac_optarg ;;
+
+ -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
+ | --libexe | --libex | --libe)
+ ac_prev=libexecdir ;;
+ -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
+ | --libexe=* | --libex=* | --libe=*)
+ libexecdir=$ac_optarg ;;
+
+ -localedir | --localedir | --localedi | --localed | --locale)
+ ac_prev=localedir ;;
+ -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*)
+ localedir=$ac_optarg ;;
+
+ -localstatedir | --localstatedir | --localstatedi | --localstated \
+ | --localstate | --localstat | --localsta | --localst | --locals)
+ ac_prev=localstatedir ;;
+ -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
+ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*)
+ localstatedir=$ac_optarg ;;
+
+ -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
+ ac_prev=mandir ;;
+ -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
+ mandir=$ac_optarg ;;
+
+ -nfp | --nfp | --nf)
+ # Obsolete; use --without-fp.
+ with_fp=no ;;
+
+ -no-create | --no-create | --no-creat | --no-crea | --no-cre \
+ | --no-cr | --no-c | -n)
+ no_create=yes ;;
+
+ -no-recursion | --no-recursion | --no-recursio | --no-recursi \
+ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
+ no_recursion=yes ;;
+
+ -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
+ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
+ | --oldin | --oldi | --old | --ol | --o)
+ ac_prev=oldincludedir ;;
+ -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
+ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
+ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
+ oldincludedir=$ac_optarg ;;
+
+ -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
+ ac_prev=prefix ;;
+ -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
+ prefix=$ac_optarg ;;
+
+ -program-prefix | --program-prefix | --program-prefi | --program-pref \
+ | --program-pre | --program-pr | --program-p)
+ ac_prev=program_prefix ;;
+ -program-prefix=* | --program-prefix=* | --program-prefi=* \
+ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
+ program_prefix=$ac_optarg ;;
+
+ -program-suffix | --program-suffix | --program-suffi | --program-suff \
+ | --program-suf | --program-su | --program-s)
+ ac_prev=program_suffix ;;
+ -program-suffix=* | --program-suffix=* | --program-suffi=* \
+ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
+ program_suffix=$ac_optarg ;;
+
+ -program-transform-name | --program-transform-name \
+ | --program-transform-nam | --program-transform-na \
+ | --program-transform-n | --program-transform- \
+ | --program-transform | --program-transfor \
+ | --program-transfo | --program-transf \
+ | --program-trans | --program-tran \
+ | --progr-tra | --program-tr | --program-t)
+ ac_prev=program_transform_name ;;
+ -program-transform-name=* | --program-transform-name=* \
+ | --program-transform-nam=* | --program-transform-na=* \
+ | --program-transform-n=* | --program-transform-=* \
+ | --program-transform=* | --program-transfor=* \
+ | --program-transfo=* | --program-transf=* \
+ | --program-trans=* | --program-tran=* \
+ | --progr-tra=* | --program-tr=* | --program-t=*)
+ program_transform_name=$ac_optarg ;;
+
+ -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd)
+ ac_prev=pdfdir ;;
+ -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*)
+ pdfdir=$ac_optarg ;;
+
+ -psdir | --psdir | --psdi | --psd | --ps)
+ ac_prev=psdir ;;
+ -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*)
+ psdir=$ac_optarg ;;
+
+ -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+ | -silent | --silent | --silen | --sile | --sil)
+ silent=yes ;;
+
+ -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
+ ac_prev=sbindir ;;
+ -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
+ | --sbi=* | --sb=*)
+ sbindir=$ac_optarg ;;
+
+ -sharedstatedir | --sharedstatedir | --sharedstatedi \
+ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
+ | --sharedst | --shareds | --shared | --share | --shar \
+ | --sha | --sh)
+ ac_prev=sharedstatedir ;;
+ -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
+ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
+ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
+ | --sha=* | --sh=*)
+ sharedstatedir=$ac_optarg ;;
+
+ -site | --site | --sit)
+ ac_prev=site ;;
+ -site=* | --site=* | --sit=*)
+ site=$ac_optarg ;;
+
+ -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
+ ac_prev=srcdir ;;
+ -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
+ srcdir=$ac_optarg ;;
+
+ -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
+ | --syscon | --sysco | --sysc | --sys | --sy)
+ ac_prev=sysconfdir ;;
+ -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
+ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
+ sysconfdir=$ac_optarg ;;
+
+ -target | --target | --targe | --targ | --tar | --ta | --t)
+ ac_prev=target_alias ;;
+ -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
+ target_alias=$ac_optarg ;;
+
+ -v | -verbose | --verbose | --verbos | --verbo | --verb)
+ verbose=yes ;;
+
+ -version | --version | --versio | --versi | --vers | -V)
+ ac_init_version=: ;;
+
+ -with-* | --with-*)
+ ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+ as_fn_error "invalid package name: $ac_useropt"
+ ac_useropt_orig=$ac_useropt
+ ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+ case $ac_user_opts in
+ *"
+"with_$ac_useropt"
+"*) ;;
+ *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig"
+ ac_unrecognized_sep=', ';;
+ esac
+ eval with_$ac_useropt=\$ac_optarg ;;
+
+ -without-* | --without-*)
+ ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+ as_fn_error "invalid package name: $ac_useropt"
+ ac_useropt_orig=$ac_useropt
+ ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+ case $ac_user_opts in
+ *"
+"with_$ac_useropt"
+"*) ;;
+ *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig"
+ ac_unrecognized_sep=', ';;
+ esac
+ eval with_$ac_useropt=no ;;
+
+ --x)
+ # Obsolete; use --with-x.
+ with_x=yes ;;
+
+ -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
+ | --x-incl | --x-inc | --x-in | --x-i)
+ ac_prev=x_includes ;;
+ -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
+ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
+ x_includes=$ac_optarg ;;
+
+ -x-libraries | --x-libraries | --x-librarie | --x-librari \
+ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
+ ac_prev=x_libraries ;;
+ -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
+ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
+ x_libraries=$ac_optarg ;;
+
+ -*) as_fn_error "unrecognized option: \`$ac_option'
+Try \`$0 --help' for more information."
+ ;;
+
+ *=*)
+ ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
+ # Reject names that are not valid shell variable names.
+ case $ac_envvar in #(
+ '' | [0-9]* | *[!_$as_cr_alnum]* )
+ as_fn_error "invalid variable name: \`$ac_envvar'" ;;
+ esac
+ eval $ac_envvar=\$ac_optarg
+ export $ac_envvar ;;
+
+ *)
+ # FIXME: should be removed in autoconf 3.0.
+ $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2
+ expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
+ $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2
+ : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}
+ ;;
+
+ esac
+done
+
+if test -n "$ac_prev"; then
+ ac_option=--`echo $ac_prev | sed 's/_/-/g'`
+ as_fn_error "missing argument to $ac_option"
+fi
+
+if test -n "$ac_unrecognized_opts"; then
+ case $enable_option_checking in
+ no) ;;
+ fatal) as_fn_error "unrecognized options: $ac_unrecognized_opts" ;;
+ *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;;
+ esac
+fi
+
+# Check all directory arguments for consistency.
+for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
+ datadir sysconfdir sharedstatedir localstatedir includedir \
+ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
+ libdir localedir mandir
+do
+ eval ac_val=\$$ac_var
+ # Remove trailing slashes.
+ case $ac_val in
+ */ )
+ ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'`
+ eval $ac_var=\$ac_val;;
+ esac
+ # Be sure to have absolute directory names.
+ case $ac_val in
+ [\\/$]* | ?:[\\/]* ) continue;;
+ NONE | '' ) case $ac_var in *prefix ) continue;; esac;;
+ esac
+ as_fn_error "expected an absolute directory name for --$ac_var: $ac_val"
+done
+
+# There might be people who depend on the old broken behavior: `$host'
+# used to hold the argument of --host etc.
+# FIXME: To remove some day.
+build=$build_alias
+host=$host_alias
+target=$target_alias
+
+# FIXME: To remove some day.
+if test "x$host_alias" != x; then
+ if test "x$build_alias" = x; then
+ cross_compiling=maybe
+ $as_echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.
+ If a cross compiler is detected then cross compile mode will be used." >&2
+ elif test "x$build_alias" != "x$host_alias"; then
+ cross_compiling=yes
+ fi
+fi
+
+ac_tool_prefix=
+test -n "$host_alias" && ac_tool_prefix=$host_alias-
+
+test "$silent" = yes && exec 6>/dev/null
+
+
+ac_pwd=`pwd` && test -n "$ac_pwd" &&
+ac_ls_di=`ls -di .` &&
+ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||
+ as_fn_error "working directory cannot be determined"
+test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
+ as_fn_error "pwd does not report name of working directory"
+
+
+# Find the source files, if location was not specified.
+if test -z "$srcdir"; then
+ ac_srcdir_defaulted=yes
+ # Try the directory containing this script, then the parent directory.
+ ac_confdir=`$as_dirname -- "$as_myself" ||
+$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$as_myself" : 'X\(//\)[^/]' \| \
+ X"$as_myself" : 'X\(//\)$' \| \
+ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_myself" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ srcdir=$ac_confdir
+ if test ! -r "$srcdir/$ac_unique_file"; then
+ srcdir=..
+ fi
+else
+ ac_srcdir_defaulted=no
+fi
+if test ! -r "$srcdir/$ac_unique_file"; then
+ test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."
+ as_fn_error "cannot find sources ($ac_unique_file) in $srcdir"
+fi
+ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
+ac_abs_confdir=`(
+ cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error "$ac_msg"
+ pwd)`
+# When building in place, set srcdir=.
+if test "$ac_abs_confdir" = "$ac_pwd"; then
+ srcdir=.
+fi
+# Remove unnecessary trailing slashes from srcdir.
+# Double slashes in file names in object file debugging info
+# mess up M-x gdb in Emacs.
+case $srcdir in
+*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;;
+esac
+for ac_var in $ac_precious_vars; do
+ eval ac_env_${ac_var}_set=\${${ac_var}+set}
+ eval ac_env_${ac_var}_value=\$${ac_var}
+ eval ac_cv_env_${ac_var}_set=\${${ac_var}+set}
+ eval ac_cv_env_${ac_var}_value=\$${ac_var}
+done
+
+#
+# Report the --help message.
+#
+if test "$ac_init_help" = "long"; then
+ # Omit some internal or obsolete options to make the list less imposing.
+ # This message is too long to be a string in the A/UX 3.1 sh.
+ cat <<_ACEOF
+\`configure' configures CRC-DabMux 0.3.0.4 to adapt to many kinds of systems.
+
+Usage: $0 [OPTION]... [VAR=VALUE]...
+
+To assign environment variables (e.g., CC, CFLAGS...), specify them as
+VAR=VALUE. See below for descriptions of some of the useful variables.
+
+Defaults for the options are specified in brackets.
+
+Configuration:
+ -h, --help display this help and exit
+ --help=short display options specific to this package
+ --help=recursive display the short help of all the included packages
+ -V, --version display version information and exit
+ -q, --quiet, --silent do not print \`checking...' messages
+ --cache-file=FILE cache test results in FILE [disabled]
+ -C, --config-cache alias for \`--cache-file=config.cache'
+ -n, --no-create do not create output files
+ --srcdir=DIR find the sources in DIR [configure dir or \`..']
+
+Installation directories:
+ --prefix=PREFIX install architecture-independent files in PREFIX
+ [$ac_default_prefix]
+ --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
+ [PREFIX]
+
+By default, \`make install' will install all the files in
+\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify
+an installation prefix other than \`$ac_default_prefix' using \`--prefix',
+for instance \`--prefix=\$HOME'.
+
+For better control, use the options below.
+
+Fine tuning of the installation directories:
+ --bindir=DIR user executables [EPREFIX/bin]
+ --sbindir=DIR system admin executables [EPREFIX/sbin]
+ --libexecdir=DIR program executables [EPREFIX/libexec]
+ --sysconfdir=DIR read-only single-machine data [PREFIX/etc]
+ --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
+ --localstatedir=DIR modifiable single-machine data [PREFIX/var]
+ --libdir=DIR object code libraries [EPREFIX/lib]
+ --includedir=DIR C header files [PREFIX/include]
+ --oldincludedir=DIR C header files for non-gcc [/usr/include]
+ --datarootdir=DIR read-only arch.-independent data root [PREFIX/share]
+ --datadir=DIR read-only architecture-independent data [DATAROOTDIR]
+ --infodir=DIR info documentation [DATAROOTDIR/info]
+ --localedir=DIR locale-dependent data [DATAROOTDIR/locale]
+ --mandir=DIR man documentation [DATAROOTDIR/man]
+ --docdir=DIR documentation root [DATAROOTDIR/doc/crc-dabmux]
+ --htmldir=DIR html documentation [DOCDIR]
+ --dvidir=DIR dvi documentation [DOCDIR]
+ --pdfdir=DIR pdf documentation [DOCDIR]
+ --psdir=DIR ps documentation [DOCDIR]
+_ACEOF
+
+ cat <<\_ACEOF
+
+Program names:
+ --program-prefix=PREFIX prepend PREFIX to installed program names
+ --program-suffix=SUFFIX append SUFFIX to installed program names
+ --program-transform-name=PROGRAM run sed PROGRAM on installed program names
+
+System types:
+ --build=BUILD configure for building on BUILD [guessed]
+ --host=HOST cross-compile to build programs to run on HOST [BUILD]
+ --target=TARGET configure for building compilers for TARGET [HOST]
+_ACEOF
+fi
+
+if test -n "$ac_init_help"; then
+ case $ac_init_help in
+ short | recursive ) echo "Configuration of CRC-DabMux 0.3.0.4:";;
+ esac
+ cat <<\_ACEOF
+
+Optional Features:
+ --disable-option-checking ignore unrecognized --enable/--with options
+ --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
+ --enable-FEATURE[=ARG] include FEATURE [ARG=yes]
+ --disable-dependency-tracking speeds up one-time build
+ --enable-dependency-tracking do not reject slow dependency extractors
+ --disable-input-prbs Disable PRBS input
+ --disable-input-test Disable TEST input
+ --disable-input-slip Disable SLIP input
+ --disable-input-udp Disable UDP input
+ --disable-input-fifo Disable FIFO input
+ --disable-input-file Disable FILE input
+ --disable-output-file Disable FILE output
+ --disable-output-fifo Disable FIFO output
+ --disable-output-udp Disable UDP output
+ --disable-output-tcp Disable TCP output
+ --disable-output-raw Disable RAW output
+ --disable-output-simul Disable SIMUL output
+ --disable-format-raw Disable RAW format
+ --disable-format-bridge Disable BRIDGE format
+ --disable-format-mpeg Disable MPEG format
+ --disable-format-packet Disable PACKET format
+ --disable-format-dabplus
+ Disable DABPLUS format
+ --disable-format-dmb Disable DMB format
+ --disable-format-epm Disable EPM format
+
+Some influential environment variables:
+ CXX C++ compiler command
+ CXXFLAGS C++ compiler flags
+ LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a
+ nonstandard directory <lib dir>
+ LIBS libraries to pass to the linker, e.g. -l<library>
+ CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if
+ you have headers in a nonstandard directory <include dir>
+ CC C compiler command
+ CFLAGS C compiler flags
+ CPP C preprocessor
+
+Use these variables to override the choices made by `configure' or to help
+it to find libraries and programs with nonstandard names/locations.
+
+Report bugs to <pascal.charest@crc.ca>.
+_ACEOF
+ac_status=$?
+fi
+
+if test "$ac_init_help" = "recursive"; then
+ # If there are subdirs, report their specific --help.
+ for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
+ test -d "$ac_dir" ||
+ { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } ||
+ continue
+ ac_builddir=.
+
+case "$ac_dir" in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
+ ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
+ # A ".." for each directory in $ac_dir_suffix.
+ ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
+ case $ac_top_builddir_sub in
+ "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
+ *) ac_top_build_prefix=$ac_top_builddir_sub/ ;;
+ esac ;;
+esac
+ac_abs_top_builddir=$ac_pwd
+ac_abs_builddir=$ac_pwd$ac_dir_suffix
+# for backward compatibility:
+ac_top_builddir=$ac_top_build_prefix
+
+case $srcdir in
+ .) # We are building in place.
+ ac_srcdir=.
+ ac_top_srcdir=$ac_top_builddir_sub
+ ac_abs_top_srcdir=$ac_pwd ;;
+ [\\/]* | ?:[\\/]* ) # Absolute name.
+ ac_srcdir=$srcdir$ac_dir_suffix;
+ ac_top_srcdir=$srcdir
+ ac_abs_top_srcdir=$srcdir ;;
+ *) # Relative name.
+ ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
+ ac_top_srcdir=$ac_top_build_prefix$srcdir
+ ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
+esac
+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
+
+ cd "$ac_dir" || { ac_status=$?; continue; }
+ # Check for guested configure.
+ if test -f "$ac_srcdir/configure.gnu"; then
+ echo &&
+ $SHELL "$ac_srcdir/configure.gnu" --help=recursive
+ elif test -f "$ac_srcdir/configure"; then
+ echo &&
+ $SHELL "$ac_srcdir/configure" --help=recursive
+ else
+ $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
+ fi || ac_status=$?
+ cd "$ac_pwd" || { ac_status=$?; break; }
+ done
+fi
+
+test -n "$ac_init_help" && exit $ac_status
+if $ac_init_version; then
+ cat <<\_ACEOF
+CRC-DabMux configure 0.3.0.4
+generated by GNU Autoconf 2.65
+
+Copyright (C) 2009 Free Software Foundation, Inc.
+This configure script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it.
+_ACEOF
+ exit
+fi
+
+## ------------------------ ##
+## Autoconf initialization. ##
+## ------------------------ ##
+
+# ac_fn_cxx_try_compile LINENO
+# ----------------------------
+# Try to compile conftest.$ac_ext, and return whether this succeeded.
+ac_fn_cxx_try_compile ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ rm -f conftest.$ac_objext
+ if { { ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_compile") 2>conftest.err
+ ac_status=$?
+ if test -s conftest.err; then
+ grep -v '^ *+' conftest.err >conftest.er1
+ cat conftest.er1 >&5
+ mv -f conftest.er1 conftest.err
+ fi
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } && {
+ test -z "$ac_cxx_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then :
+ ac_retval=0
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_retval=1
+fi
+ eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+ as_fn_set_status $ac_retval
+
+} # ac_fn_cxx_try_compile
+
+# ac_fn_c_try_compile LINENO
+# --------------------------
+# Try to compile conftest.$ac_ext, and return whether this succeeded.
+ac_fn_c_try_compile ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ rm -f conftest.$ac_objext
+ if { { ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_compile") 2>conftest.err
+ ac_status=$?
+ if test -s conftest.err; then
+ grep -v '^ *+' conftest.err >conftest.er1
+ cat conftest.er1 >&5
+ mv -f conftest.er1 conftest.err
+ fi
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then :
+ ac_retval=0
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_retval=1
+fi
+ eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+ as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_compile
+
+# ac_fn_c_try_link LINENO
+# -----------------------
+# Try to link conftest.$ac_ext, and return whether this succeeded.
+ac_fn_c_try_link ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ rm -f conftest.$ac_objext conftest$ac_exeext
+ if { { ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_link") 2>conftest.err
+ ac_status=$?
+ if test -s conftest.err; then
+ grep -v '^ *+' conftest.err >conftest.er1
+ cat conftest.er1 >&5
+ mv -f conftest.er1 conftest.err
+ fi
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext && {
+ test "$cross_compiling" = yes ||
+ $as_test_x conftest$ac_exeext
+ }; then :
+ ac_retval=0
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_retval=1
+fi
+ # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information
+ # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would
+ # interfere with the next link command; also delete a directory that is
+ # left behind by Apple's compiler. We do this before executing the actions.
+ rm -rf conftest.dSYM conftest_ipa8_conftest.oo
+ eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+ as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_link
+
+# ac_fn_c_try_cpp LINENO
+# ----------------------
+# Try to preprocess conftest.$ac_ext, and return whether this succeeded.
+ac_fn_c_try_cpp ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ if { { ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err
+ ac_status=$?
+ if test -s conftest.err; then
+ grep -v '^ *+' conftest.err >conftest.er1
+ cat conftest.er1 >&5
+ mv -f conftest.er1 conftest.err
+ fi
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } >/dev/null && {
+ test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ }; then :
+ ac_retval=0
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_retval=1
+fi
+ eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+ as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_cpp
+
+# ac_fn_c_try_run LINENO
+# ----------------------
+# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes
+# that executables *can* be run.
+ac_fn_c_try_run ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ if { { ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_link") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } && { ac_try='./conftest$ac_exeext'
+ { { case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_try") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; }; then :
+ ac_retval=0
+else
+ $as_echo "$as_me: program exited with status $ac_status" >&5
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_retval=$ac_status
+fi
+ rm -rf conftest.dSYM conftest_ipa8_conftest.oo
+ eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+ as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_run
+
+# ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES
+# -------------------------------------------------------
+# Tests whether HEADER exists, giving a warning if it cannot be compiled using
+# the include files in INCLUDES and setting the cache variable VAR
+# accordingly.
+ac_fn_c_check_header_mongrel ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then :
+ $as_echo_n "(cached) " >&6
+fi
+eval ac_res=\$$3
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+else
+ # Is the header compilable?
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5
+$as_echo_n "checking $2 usability... " >&6; }
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$4
+#include <$2>
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_header_compiler=yes
+else
+ ac_header_compiler=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5
+$as_echo "$ac_header_compiler" >&6; }
+
+# Is the header present?
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5
+$as_echo_n "checking $2 presence... " >&6; }
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <$2>
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+ ac_header_preproc=yes
+else
+ ac_header_preproc=no
+fi
+rm -f conftest.err conftest.$ac_ext
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5
+$as_echo "$ac_header_preproc" >&6; }
+
+# So? What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #((
+ yes:no: )
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5
+$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
+$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
+ ;;
+ no:yes:* )
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5
+$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5
+$as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5
+$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5
+$as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
+$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
+( cat <<\_ASBOX
+## ------------------------------------ ##
+## Report this to pascal.charest@crc.ca ##
+## ------------------------------------ ##
+_ASBOX
+ ) | sed "s/^/$as_me: WARNING: /" >&2
+ ;;
+esac
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then :
+ $as_echo_n "(cached) " >&6
+else
+ eval "$3=\$ac_header_compiler"
+fi
+eval ac_res=\$$3
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+fi
+ eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+
+} # ac_fn_c_check_header_mongrel
+
+# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES
+# -------------------------------------------------------
+# Tests whether HEADER exists and can be compiled using the include files in
+# INCLUDES, setting the cache variable VAR accordingly.
+ac_fn_c_check_header_compile ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$4
+#include <$2>
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ eval "$3=yes"
+else
+ eval "$3=no"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+eval ac_res=\$$3
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+ eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+
+} # ac_fn_c_check_header_compile
+
+# ac_fn_c_check_type LINENO TYPE VAR INCLUDES
+# -------------------------------------------
+# Tests whether TYPE exists after having included INCLUDES, setting cache
+# variable VAR accordingly.
+ac_fn_c_check_type ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then :
+ $as_echo_n "(cached) " >&6
+else
+ eval "$3=no"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$4
+int
+main ()
+{
+if (sizeof ($2))
+ return 0;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$4
+int
+main ()
+{
+if (sizeof (($2)))
+ return 0;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+else
+ eval "$3=yes"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+eval ac_res=\$$3
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+ eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+
+} # ac_fn_c_check_type
+
+# ac_fn_c_find_uintX_t LINENO BITS VAR
+# ------------------------------------
+# Finds an unsigned integer type with width BITS, setting cache variable VAR
+# accordingly.
+ac_fn_c_find_uintX_t ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for uint$2_t" >&5
+$as_echo_n "checking for uint$2_t... " >&6; }
+if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then :
+ $as_echo_n "(cached) " >&6
+else
+ eval "$3=no"
+ # Order is important - never check a type that is potentially smaller
+ # than half of the expected target width.
+ for ac_type in uint$2_t 'unsigned int' 'unsigned long int' \
+ 'unsigned long long int' 'unsigned short int' 'unsigned char'; do
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+static int test_array [1 - 2 * !((($ac_type) -1 >> ($2 / 2 - 1)) >> ($2 / 2 - 1) == 3)];
+test_array [0] = 0
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ case $ac_type in #(
+ uint$2_t) :
+ eval "$3=yes" ;; #(
+ *) :
+ eval "$3=\$ac_type" ;;
+esac
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ eval as_val=\$$3
+ if test "x$as_val" = x""no; then :
+
+else
+ break
+fi
+ done
+fi
+eval ac_res=\$$3
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+ eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+
+} # ac_fn_c_find_uintX_t
+
+# ac_fn_c_check_func LINENO FUNC VAR
+# ----------------------------------
+# Tests whether FUNC exists, setting the cache variable VAR accordingly
+ac_fn_c_check_func ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+/* Define $2 to an innocuous variant, in case <limits.h> declares $2.
+ For example, HP-UX 11i <limits.h> declares gettimeofday. */
+#define $2 innocuous_$2
+
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char $2 (); below.
+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ <limits.h> exists even on freestanding compilers. */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef $2
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char $2 ();
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined __stub_$2 || defined __stub___$2
+choke me
+#endif
+
+int
+main ()
+{
+return $2 ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ eval "$3=yes"
+else
+ eval "$3=no"
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+eval ac_res=\$$3
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+ eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+
+} # ac_fn_c_check_func
+cat >config.log <<_ACEOF
+This file contains any messages produced by compilers while
+running configure, to aid debugging if configure makes a mistake.
+
+It was created by CRC-DabMux $as_me 0.3.0.4, which was
+generated by GNU Autoconf 2.65. Invocation command line was
+
+ $ $0 $@
+
+_ACEOF
+exec 5>>config.log
+{
+cat <<_ASUNAME
+## --------- ##
+## Platform. ##
+## --------- ##
+
+hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
+uname -m = `(uname -m) 2>/dev/null || echo unknown`
+uname -r = `(uname -r) 2>/dev/null || echo unknown`
+uname -s = `(uname -s) 2>/dev/null || echo unknown`
+uname -v = `(uname -v) 2>/dev/null || echo unknown`
+
+/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
+/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown`
+
+/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown`
+/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown`
+/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
+/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown`
+/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown`
+/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown`
+/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown`
+
+_ASUNAME
+
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ $as_echo "PATH: $as_dir"
+ done
+IFS=$as_save_IFS
+
+} >&5
+
+cat >&5 <<_ACEOF
+
+
+## ----------- ##
+## Core tests. ##
+## ----------- ##
+
+_ACEOF
+
+
+# Keep a trace of the command line.
+# Strip out --no-create and --no-recursion so they do not pile up.
+# Strip out --silent because we don't want to record it for future runs.
+# Also quote any args containing shell meta-characters.
+# Make two passes to allow for proper duplicate-argument suppression.
+ac_configure_args=
+ac_configure_args0=
+ac_configure_args1=
+ac_must_keep_next=false
+for ac_pass in 1 2
+do
+ for ac_arg
+ do
+ case $ac_arg in
+ -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;;
+ -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+ | -silent | --silent | --silen | --sile | --sil)
+ continue ;;
+ *\'*)
+ ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
+ esac
+ case $ac_pass in
+ 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;;
+ 2)
+ as_fn_append ac_configure_args1 " '$ac_arg'"
+ if test $ac_must_keep_next = true; then
+ ac_must_keep_next=false # Got value, back to normal.
+ else
+ case $ac_arg in
+ *=* | --config-cache | -C | -disable-* | --disable-* \
+ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
+ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
+ | -with-* | --with-* | -without-* | --without-* | --x)
+ case "$ac_configure_args0 " in
+ "$ac_configure_args1"*" '$ac_arg' "* ) continue ;;
+ esac
+ ;;
+ -* ) ac_must_keep_next=true ;;
+ esac
+ fi
+ as_fn_append ac_configure_args " '$ac_arg'"
+ ;;
+ esac
+ done
+done
+{ ac_configure_args0=; unset ac_configure_args0;}
+{ ac_configure_args1=; unset ac_configure_args1;}
+
+# When interrupted or exit'd, cleanup temporary files, and complete
+# config.log. We remove comments because anyway the quotes in there
+# would cause problems or look ugly.
+# WARNING: Use '\'' to represent an apostrophe within the trap.
+# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug.
+trap 'exit_status=$?
+ # Save into config.log some information that might help in debugging.
+ {
+ echo
+
+ cat <<\_ASBOX
+## ---------------- ##
+## Cache variables. ##
+## ---------------- ##
+_ASBOX
+ echo
+ # The following way of writing the cache mishandles newlines in values,
+(
+ for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do
+ eval ac_val=\$$ac_var
+ case $ac_val in #(
+ *${as_nl}*)
+ case $ac_var in #(
+ *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
+$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
+ esac
+ case $ac_var in #(
+ _ | IFS | as_nl) ;; #(
+ BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
+ *) { eval $ac_var=; unset $ac_var;} ;;
+ esac ;;
+ esac
+ done
+ (set) 2>&1 |
+ case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #(
+ *${as_nl}ac_space=\ *)
+ sed -n \
+ "s/'\''/'\''\\\\'\'''\''/g;
+ s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p"
+ ;; #(
+ *)
+ sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
+ ;;
+ esac |
+ sort
+)
+ echo
+
+ cat <<\_ASBOX
+## ----------------- ##
+## Output variables. ##
+## ----------------- ##
+_ASBOX
+ echo
+ for ac_var in $ac_subst_vars
+ do
+ eval ac_val=\$$ac_var
+ case $ac_val in
+ *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+ esac
+ $as_echo "$ac_var='\''$ac_val'\''"
+ done | sort
+ echo
+
+ if test -n "$ac_subst_files"; then
+ cat <<\_ASBOX
+## ------------------- ##
+## File substitutions. ##
+## ------------------- ##
+_ASBOX
+ echo
+ for ac_var in $ac_subst_files
+ do
+ eval ac_val=\$$ac_var
+ case $ac_val in
+ *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+ esac
+ $as_echo "$ac_var='\''$ac_val'\''"
+ done | sort
+ echo
+ fi
+
+ if test -s confdefs.h; then
+ cat <<\_ASBOX
+## ----------- ##
+## confdefs.h. ##
+## ----------- ##
+_ASBOX
+ echo
+ cat confdefs.h
+ echo
+ fi
+ test "$ac_signal" != 0 &&
+ $as_echo "$as_me: caught signal $ac_signal"
+ $as_echo "$as_me: exit $exit_status"
+ } >&5
+ rm -f core *.core core.conftest.* &&
+ rm -f -r conftest* confdefs* conf$$* $ac_clean_files &&
+ exit $exit_status
+' 0
+for ac_signal in 1 2 13 15; do
+ trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal
+done
+ac_signal=0
+
+# confdefs.h avoids OS command line length limits that DEFS can exceed.
+rm -f -r conftest* confdefs.h
+
+$as_echo "/* confdefs.h */" > confdefs.h
+
+# Predefined preprocessor variables.
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_NAME "$PACKAGE_NAME"
+_ACEOF
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_TARNAME "$PACKAGE_TARNAME"
+_ACEOF
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_VERSION "$PACKAGE_VERSION"
+_ACEOF
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_STRING "$PACKAGE_STRING"
+_ACEOF
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT"
+_ACEOF
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_URL "$PACKAGE_URL"
+_ACEOF
+
+
+# Let the site file select an alternate cache file if it wants to.
+# Prefer an explicitly selected file to automatically selected ones.
+ac_site_file1=NONE
+ac_site_file2=NONE
+if test -n "$CONFIG_SITE"; then
+ ac_site_file1=$CONFIG_SITE
+elif test "x$prefix" != xNONE; then
+ ac_site_file1=$prefix/share/config.site
+ ac_site_file2=$prefix/etc/config.site
+else
+ ac_site_file1=$ac_default_prefix/share/config.site
+ ac_site_file2=$ac_default_prefix/etc/config.site
+fi
+for ac_site_file in "$ac_site_file1" "$ac_site_file2"
+do
+ test "x$ac_site_file" = xNONE && continue
+ if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5
+$as_echo "$as_me: loading site script $ac_site_file" >&6;}
+ sed 's/^/| /' "$ac_site_file" >&5
+ . "$ac_site_file"
+ fi
+done
+
+if test -r "$cache_file"; then
+ # Some versions of bash will fail to source /dev/null (special files
+ # actually), so we avoid doing that. DJGPP emulates it as a regular file.
+ if test /dev/null != "$cache_file" && test -f "$cache_file"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5
+$as_echo "$as_me: loading cache $cache_file" >&6;}
+ case $cache_file in
+ [\\/]* | ?:[\\/]* ) . "$cache_file";;
+ *) . "./$cache_file";;
+ esac
+ fi
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5
+$as_echo "$as_me: creating cache $cache_file" >&6;}
+ >$cache_file
+fi
+
+# Check that the precious variables saved in the cache have kept the same
+# value.
+ac_cache_corrupted=false
+for ac_var in $ac_precious_vars; do
+ eval ac_old_set=\$ac_cv_env_${ac_var}_set
+ eval ac_new_set=\$ac_env_${ac_var}_set
+ eval ac_old_val=\$ac_cv_env_${ac_var}_value
+ eval ac_new_val=\$ac_env_${ac_var}_value
+ case $ac_old_set,$ac_new_set in
+ set,)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
+$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
+ ac_cache_corrupted=: ;;
+ ,set)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5
+$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
+ ac_cache_corrupted=: ;;
+ ,);;
+ *)
+ if test "x$ac_old_val" != "x$ac_new_val"; then
+ # differences in whitespace do not lead to failure.
+ ac_old_val_w=`echo x $ac_old_val`
+ ac_new_val_w=`echo x $ac_new_val`
+ if test "$ac_old_val_w" != "$ac_new_val_w"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5
+$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
+ ac_cache_corrupted=:
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5
+$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;}
+ eval $ac_var=\$ac_old_val
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5
+$as_echo "$as_me: former value: \`$ac_old_val'" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5
+$as_echo "$as_me: current value: \`$ac_new_val'" >&2;}
+ fi;;
+ esac
+ # Pass precious variables to config.status.
+ if test "$ac_new_set" = set; then
+ case $ac_new_val in
+ *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
+ *) ac_arg=$ac_var=$ac_new_val ;;
+ esac
+ case " $ac_configure_args " in
+ *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy.
+ *) as_fn_append ac_configure_args " '$ac_arg'" ;;
+ esac
+ fi
+done
+if $ac_cache_corrupted; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5
+$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;}
+ as_fn_error "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5
+fi
+## -------------------- ##
+## Main body of script. ##
+## -------------------- ##
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+ac_aux_dir=
+for ac_dir in build-aux "$srcdir"/build-aux; do
+ for ac_t in install-sh install.sh shtool; do
+ if test -f "$ac_dir/$ac_t"; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/$ac_t -c"
+ break 2
+ fi
+ done
+done
+if test -z "$ac_aux_dir"; then
+ as_fn_error "cannot find install-sh, install.sh, or shtool in build-aux \"$srcdir\"/build-aux" "$LINENO" 5
+fi
+
+# These three variables are undocumented and unsupported,
+# and are intended to be withdrawn in a future Autoconf release.
+# They can cause serious problems if a builder's source tree is in a directory
+# whose full name contains unusual characters.
+ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var.
+ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var.
+ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var.
+
+
+# Make sure we can run config.sub.
+$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
+ as_fn_error "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5
+$as_echo_n "checking build system type... " >&6; }
+if test "${ac_cv_build+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_build_alias=$build_alias
+test "x$ac_build_alias" = x &&
+ ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"`
+test "x$ac_build_alias" = x &&
+ as_fn_error "cannot guess build type; you must specify one" "$LINENO" 5
+ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` ||
+ as_fn_error "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5
+$as_echo "$ac_cv_build" >&6; }
+case $ac_cv_build in
+*-*-*) ;;
+*) as_fn_error "invalid value of canonical build" "$LINENO" 5;;
+esac
+build=$ac_cv_build
+ac_save_IFS=$IFS; IFS='-'
+set x $ac_cv_build
+shift
+build_cpu=$1
+build_vendor=$2
+shift; shift
+# Remember, the first character of IFS is used to create $*,
+# except with old shells:
+build_os=$*
+IFS=$ac_save_IFS
+case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5
+$as_echo_n "checking host system type... " >&6; }
+if test "${ac_cv_host+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test "x$host_alias" = x; then
+ ac_cv_host=$ac_cv_build
+else
+ ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` ||
+ as_fn_error "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5
+$as_echo "$ac_cv_host" >&6; }
+case $ac_cv_host in
+*-*-*) ;;
+*) as_fn_error "invalid value of canonical host" "$LINENO" 5;;
+esac
+host=$ac_cv_host
+ac_save_IFS=$IFS; IFS='-'
+set x $ac_cv_host
+shift
+host_cpu=$1
+host_vendor=$2
+shift; shift
+# Remember, the first character of IFS is used to create $*,
+# except with old shells:
+host_os=$*
+IFS=$ac_save_IFS
+case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking target system type" >&5
+$as_echo_n "checking target system type... " >&6; }
+if test "${ac_cv_target+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test "x$target_alias" = x; then
+ ac_cv_target=$ac_cv_host
+else
+ ac_cv_target=`$SHELL "$ac_aux_dir/config.sub" $target_alias` ||
+ as_fn_error "$SHELL $ac_aux_dir/config.sub $target_alias failed" "$LINENO" 5
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_target" >&5
+$as_echo "$ac_cv_target" >&6; }
+case $ac_cv_target in
+*-*-*) ;;
+*) as_fn_error "invalid value of canonical target" "$LINENO" 5;;
+esac
+target=$ac_cv_target
+ac_save_IFS=$IFS; IFS='-'
+set x $ac_cv_target
+shift
+target_cpu=$1
+target_vendor=$2
+shift; shift
+# Remember, the first character of IFS is used to create $*,
+# except with old shells:
+target_os=$*
+IFS=$ac_save_IFS
+case $target_os in *\ *) target_os=`echo "$target_os" | sed 's/ /-/g'`;; esac
+
+
+# The aliases save the names the user supplied, while $host etc.
+# will get canonicalized.
+test -n "$target_alias" &&
+ test "$program_prefix$program_suffix$program_transform_name" = \
+ NONENONEs,x,x, &&
+ program_prefix=${target_alias}-
+
+am__api_version='1.11'
+
+# Find a good install program. We prefer a C program (faster),
+# so one script is as good as another. But avoid the broken or
+# incompatible versions:
+# SysV /etc/install, /usr/sbin/install
+# SunOS /usr/etc/install
+# IRIX /sbin/install
+# AIX /bin/install
+# AmigaOS /C/install, which installs bootblocks on floppy discs
+# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
+# AFS /usr/afsws/bin/install, which mishandles nonexistent args
+# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
+# OS/2's system install, which has a completely different semantic
+# ./install, which can be erroneously created by make from ./install.sh.
+# Reject install programs that cannot install multiple files.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5
+$as_echo_n "checking for a BSD-compatible install... " >&6; }
+if test -z "$INSTALL"; then
+if test "${ac_cv_path_install+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ # Account for people who put trailing slashes in PATH elements.
+case $as_dir/ in #((
+ ./ | .// | /[cC]/* | \
+ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
+ ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \
+ /usr/ucb/* ) ;;
+ *)
+ # OSF1 and SCO ODT 3.0 have their own names for install.
+ # Don't use installbsd from OSF since it installs stuff as root
+ # by default.
+ for ac_prog in ginstall scoinst install; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then
+ if test $ac_prog = install &&
+ grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+ # AIX install. It has an incompatible calling convention.
+ :
+ elif test $ac_prog = install &&
+ grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+ # program-specific install script used by HP pwplus--don't use.
+ :
+ else
+ rm -rf conftest.one conftest.two conftest.dir
+ echo one > conftest.one
+ echo two > conftest.two
+ mkdir conftest.dir
+ if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" &&
+ test -s conftest.one && test -s conftest.two &&
+ test -s conftest.dir/conftest.one &&
+ test -s conftest.dir/conftest.two
+ then
+ ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
+ break 3
+ fi
+ fi
+ fi
+ done
+ done
+ ;;
+esac
+
+ done
+IFS=$as_save_IFS
+
+rm -rf conftest.one conftest.two conftest.dir
+
+fi
+ if test "${ac_cv_path_install+set}" = set; then
+ INSTALL=$ac_cv_path_install
+ else
+ # As a last resort, use the slow shell script. Don't cache a
+ # value for INSTALL within a source directory, because that will
+ # break other packages using the cache if that directory is
+ # removed, or if the value is a relative name.
+ INSTALL=$ac_install_sh
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5
+$as_echo "$INSTALL" >&6; }
+
+# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
+# It thinks the first close brace ends the variable substitution.
+test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
+
+test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
+
+test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5
+$as_echo_n "checking whether build environment is sane... " >&6; }
+# Just in case
+sleep 1
+echo timestamp > conftest.file
+# Reject unsafe characters in $srcdir or the absolute working directory
+# name. Accept space and tab only in the latter.
+am_lf='
+'
+case `pwd` in
+ *[\\\"\#\$\&\'\`$am_lf]*)
+ as_fn_error "unsafe absolute working directory name" "$LINENO" 5;;
+esac
+case $srcdir in
+ *[\\\"\#\$\&\'\`$am_lf\ \ ]*)
+ as_fn_error "unsafe srcdir value: \`$srcdir'" "$LINENO" 5;;
+esac
+
+# Do `set' in a subshell so we don't clobber the current shell's
+# arguments. Must try -L first in case configure is actually a
+# symlink; some systems play weird games with the mod time of symlinks
+# (eg FreeBSD returns the mod time of the symlink's containing
+# directory).
+if (
+ set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
+ if test "$*" = "X"; then
+ # -L didn't work.
+ set X `ls -t "$srcdir/configure" conftest.file`
+ fi
+ rm -f conftest.file
+ if test "$*" != "X $srcdir/configure conftest.file" \
+ && test "$*" != "X conftest.file $srcdir/configure"; then
+
+ # If neither matched, then we have a broken ls. This can happen
+ # if, for instance, CONFIG_SHELL is bash and it inherits a
+ # broken ls alias from the environment. This has actually
+ # happened. Such a system could not be considered "sane".
+ as_fn_error "ls -t appears to fail. Make sure there is not a broken
+alias in your environment" "$LINENO" 5
+ fi
+
+ test "$2" = conftest.file
+ )
+then
+ # Ok.
+ :
+else
+ as_fn_error "newly created file is older than distributed files!
+Check your system clock" "$LINENO" 5
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+test "$program_prefix" != NONE &&
+ program_transform_name="s&^&$program_prefix&;$program_transform_name"
+# Use a double $ so make ignores it.
+test "$program_suffix" != NONE &&
+ program_transform_name="s&\$&$program_suffix&;$program_transform_name"
+# Double any \ or $.
+# By default was `s,x,x', remove it if useless.
+ac_script='s/[\\$]/&&/g;s/;s,x,x,$//'
+program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"`
+
+# expand $ac_aux_dir to an absolute path
+am_aux_dir=`cd $ac_aux_dir && pwd`
+
+if test x"${MISSING+set}" != xset; then
+ case $am_aux_dir in
+ *\ * | *\ *)
+ MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
+ *)
+ MISSING="\${SHELL} $am_aux_dir/missing" ;;
+ esac
+fi
+# Use eval to expand $SHELL
+if eval "$MISSING --run true"; then
+ am_missing_run="$MISSING --run "
+else
+ am_missing_run=
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`missing' script is too old or missing" >&5
+$as_echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;}
+fi
+
+if test x"${install_sh}" != xset; then
+ case $am_aux_dir in
+ *\ * | *\ *)
+ install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
+ *)
+ install_sh="\${SHELL} $am_aux_dir/install-sh"
+ esac
+fi
+
+# Installed binaries are usually stripped using `strip' when the user
+# run `make install-strip'. However `strip' might not be the right
+# tool to use in cross-compilation environments, therefore Automake
+# will honor the `STRIP' environment variable to overrule this program.
+if test "$cross_compiling" != no; then
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
+set dummy ${ac_tool_prefix}strip; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_STRIP+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$STRIP"; then
+ ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_STRIP="${ac_tool_prefix}strip"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+STRIP=$ac_cv_prog_STRIP
+if test -n "$STRIP"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5
+$as_echo "$STRIP" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_STRIP"; then
+ ac_ct_STRIP=$STRIP
+ # Extract the first word of "strip", so it can be a program name with args.
+set dummy strip; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_STRIP"; then
+ ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_ac_ct_STRIP="strip"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
+if test -n "$ac_ct_STRIP"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5
+$as_echo "$ac_ct_STRIP" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_STRIP" = x; then
+ STRIP=":"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ STRIP=$ac_ct_STRIP
+ fi
+else
+ STRIP="$ac_cv_prog_STRIP"
+fi
+
+fi
+INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5
+$as_echo_n "checking for a thread-safe mkdir -p... " >&6; }
+if test -z "$MKDIR_P"; then
+ if test "${ac_cv_path_mkdir+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_prog in mkdir gmkdir; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue
+ case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #(
+ 'mkdir (GNU coreutils) '* | \
+ 'mkdir (coreutils) '* | \
+ 'mkdir (fileutils) '4.1*)
+ ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext
+ break 3;;
+ esac
+ done
+ done
+ done
+IFS=$as_save_IFS
+
+fi
+
+ test -d ./--version && rmdir ./--version
+ if test "${ac_cv_path_mkdir+set}" = set; then
+ MKDIR_P="$ac_cv_path_mkdir -p"
+ else
+ # As a last resort, use the slow shell script. Don't cache a
+ # value for MKDIR_P within a source directory, because that will
+ # break other packages using the cache if that directory is
+ # removed, or if the value is a relative name.
+ MKDIR_P="$ac_install_sh -d"
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5
+$as_echo "$MKDIR_P" >&6; }
+
+mkdir_p="$MKDIR_P"
+case $mkdir_p in
+ [\\/$]* | ?:[\\/]*) ;;
+ */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
+esac
+
+for ac_prog in gawk mawk nawk awk
+do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_AWK+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$AWK"; then
+ ac_cv_prog_AWK="$AWK" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_AWK="$ac_prog"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+AWK=$ac_cv_prog_AWK
+if test -n "$AWK"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5
+$as_echo "$AWK" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$AWK" && break
+done
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5
+$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; }
+set x ${MAKE-make}
+ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
+if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat >conftest.make <<\_ACEOF
+SHELL = /bin/sh
+all:
+ @echo '@@@%%%=$(MAKE)=@@@%%%'
+_ACEOF
+# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
+case `${MAKE-make} -f conftest.make 2>/dev/null` in
+ *@@@%%%=?*=@@@%%%*)
+ eval ac_cv_prog_make_${ac_make}_set=yes;;
+ *)
+ eval ac_cv_prog_make_${ac_make}_set=no;;
+esac
+rm -f conftest.make
+fi
+if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+ SET_MAKE=
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+ SET_MAKE="MAKE=${MAKE-make}"
+fi
+
+rm -rf .tst 2>/dev/null
+mkdir .tst 2>/dev/null
+if test -d .tst; then
+ am__leading_dot=.
+else
+ am__leading_dot=_
+fi
+rmdir .tst 2>/dev/null
+
+if test "`cd $srcdir && pwd`" != "`pwd`"; then
+ # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
+ # is not polluted with repeated "-I."
+ am__isrc=' -I$(srcdir)'
+ # test to see if srcdir already configured
+ if test -f $srcdir/config.status; then
+ as_fn_error "source directory already configured; run \"make distclean\" there first" "$LINENO" 5
+ fi
+fi
+
+# test whether we have cygpath
+if test -z "$CYGPATH_W"; then
+ if (cygpath --version) >/dev/null 2>/dev/null; then
+ CYGPATH_W='cygpath -w'
+ else
+ CYGPATH_W=echo
+ fi
+fi
+
+
+# Define the identity of the package.
+ PACKAGE='crc-dabmux'
+ VERSION='0.3.0.4'
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE "$PACKAGE"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define VERSION "$VERSION"
+_ACEOF
+
+# Some tools Automake needs.
+
+ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"}
+
+
+AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"}
+
+
+AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"}
+
+
+AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"}
+
+
+MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
+
+# We need awk for the "check" target. The system "awk" is bad on
+# some platforms.
+# Always define AMTAR for backward compatibility.
+
+AMTAR=${AMTAR-"${am_missing_run}tar"}
+
+am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'
+
+
+
+
+
+
+ac_config_headers="$ac_config_headers config.h"
+
+
+case $host in
+*linux*)
+ case $target_cpu in
+ x86_64)
+
+$as_echo "#define __64BIT__ /**/" >>confdefs.h
+
+ ;;
+ *)
+
+$as_echo "#define __32BIT__ /**/" >>confdefs.h
+
+ BUILD_TARGET="CC='gcc -m32' CXX='g++ -m32' --target=i686"
+
+ flags="-m32"
+ esac
+ ;;
+*)
+
+$as_echo "#define __32BIT__ /**/" >>confdefs.h
+
+ GETOPT="xgetopt.cpp xgetopt.h"
+
+ WSOCK32="-lwsock32"
+
+ BUILD_HOST="--host i386-mingw32msvc"
+
+esac
+
+# Checks for programs.
+ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+if test -z "$CXX"; then
+ if test -n "$CCC"; then
+ CXX=$CCC
+ else
+ if test -n "$ac_tool_prefix"; then
+ for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC
+ do
+ # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_CXX+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$CXX"; then
+ ac_cv_prog_CXX="$CXX" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_CXX="$ac_tool_prefix$ac_prog"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+CXX=$ac_cv_prog_CXX
+if test -n "$CXX"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5
+$as_echo "$CXX" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$CXX" && break
+ done
+fi
+if test -z "$CXX"; then
+ ac_ct_CXX=$CXX
+ for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC
+do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_CXX+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_CXX"; then
+ ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_ac_ct_CXX="$ac_prog"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CXX=$ac_cv_prog_ac_ct_CXX
+if test -n "$ac_ct_CXX"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5
+$as_echo "$ac_ct_CXX" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$ac_ct_CXX" && break
+done
+
+ if test "x$ac_ct_CXX" = x; then
+ CXX="g++"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ CXX=$ac_ct_CXX
+ fi
+fi
+
+ fi
+fi
+# Provide some information about the compiler.
+$as_echo "$as_me:${as_lineno-$LINENO}: checking for C++ compiler version" >&5
+set X $ac_compile
+ac_compiler=$2
+for ac_option in --version -v -V -qversion; do
+ { { ac_try="$ac_compiler $ac_option >&5"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_compiler $ac_option >&5") 2>conftest.err
+ ac_status=$?
+ if test -s conftest.err; then
+ sed '10a\
+... rest of stderr output deleted ...
+ 10q' conftest.err >conftest.er1
+ cat conftest.er1 >&5
+ fi
+ rm -f conftest.er1 conftest.err
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }
+done
+
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out"
+# Try to create an executable without -o first, disregard a.out.
+# It will help us diagnose broken compilers, and finding out an intuition
+# of exeext.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C++ compiler works" >&5
+$as_echo_n "checking whether the C++ compiler works... " >&6; }
+ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
+
+# The possible output files:
+ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*"
+
+ac_rmfiles=
+for ac_file in $ac_files
+do
+ case $ac_file in
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
+ * ) ac_rmfiles="$ac_rmfiles $ac_file";;
+ esac
+done
+rm -f $ac_rmfiles
+
+if { { ac_try="$ac_link_default"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_link_default") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then :
+ # Autoconf-2.13 could set the ac_cv_exeext variable to `no'.
+# So ignore a value of `no', otherwise this would lead to `EXEEXT = no'
+# in a Makefile. We should not override ac_cv_exeext if it was cached,
+# so that the user can short-circuit this test for compilers unknown to
+# Autoconf.
+for ac_file in $ac_files ''
+do
+ test -f "$ac_file" || continue
+ case $ac_file in
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj )
+ ;;
+ [ab].out )
+ # We found the default executable, but exeext='' is most
+ # certainly right.
+ break;;
+ *.* )
+ if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no;
+ then :; else
+ ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+ fi
+ # We set ac_cv_exeext here because the later test for it is not
+ # safe: cross compilers may not add the suffix if given an `-o'
+ # argument, so we may need to know it at that point already.
+ # Even if this section looks crufty: it has the advantage of
+ # actually working.
+ break;;
+ * )
+ break;;
+ esac
+done
+test "$ac_cv_exeext" = no && ac_cv_exeext=
+
+else
+ ac_file=''
+fi
+if test -z "$ac_file"; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+$as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ as_fn_set_status 77
+as_fn_error "C++ compiler cannot create executables
+See \`config.log' for more details." "$LINENO" 5; }; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C++ compiler default output file name" >&5
+$as_echo_n "checking for C++ compiler default output file name... " >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5
+$as_echo "$ac_file" >&6; }
+ac_exeext=$ac_cv_exeext
+
+rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out
+ac_clean_files=$ac_clean_files_save
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5
+$as_echo_n "checking for suffix of executables... " >&6; }
+if { { ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_link") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then :
+ # If both `conftest.exe' and `conftest' are `present' (well, observable)
+# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will
+# work properly (i.e., refer to `conftest.exe'), while it won't with
+# `rm'.
+for ac_file in conftest.exe conftest conftest.*; do
+ test -f "$ac_file" || continue
+ case $ac_file in
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
+ *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+ break;;
+ * ) break;;
+ esac
+done
+else
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error "cannot compute suffix of executables: cannot compile and link
+See \`config.log' for more details." "$LINENO" 5; }
+fi
+rm -f conftest conftest$ac_cv_exeext
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5
+$as_echo "$ac_cv_exeext" >&6; }
+
+rm -f conftest.$ac_ext
+EXEEXT=$ac_cv_exeext
+ac_exeext=$EXEEXT
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stdio.h>
+int
+main ()
+{
+FILE *f = fopen ("conftest.out", "w");
+ return ferror (f) || fclose (f) != 0;
+
+ ;
+ return 0;
+}
+_ACEOF
+ac_clean_files="$ac_clean_files conftest.out"
+# Check that the compiler produces executables we can run. If not, either
+# the compiler is broken, or we cross compile.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5
+$as_echo_n "checking whether we are cross compiling... " >&6; }
+if test "$cross_compiling" != yes; then
+ { { ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_link") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }
+ if { ac_try='./conftest$ac_cv_exeext'
+ { { case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_try") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; }; then
+ cross_compiling=no
+ else
+ if test "$cross_compiling" = maybe; then
+ cross_compiling=yes
+ else
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error "cannot run C++ compiled programs.
+If you meant to cross compile, use \`--host'.
+See \`config.log' for more details." "$LINENO" 5; }
+ fi
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5
+$as_echo "$cross_compiling" >&6; }
+
+rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out
+ac_clean_files=$ac_clean_files_save
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5
+$as_echo_n "checking for suffix of object files... " >&6; }
+if test "${ac_cv_objext+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.o conftest.obj
+if { { ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_compile") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then :
+ for ac_file in conftest.o conftest.obj conftest.*; do
+ test -f "$ac_file" || continue;
+ case $ac_file in
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;;
+ *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
+ break;;
+ esac
+done
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error "cannot compute suffix of object files: cannot compile
+See \`config.log' for more details." "$LINENO" 5; }
+fi
+rm -f conftest.$ac_cv_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5
+$as_echo "$ac_cv_objext" >&6; }
+OBJEXT=$ac_cv_objext
+ac_objext=$OBJEXT
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C++ compiler" >&5
+$as_echo_n "checking whether we are using the GNU C++ compiler... " >&6; }
+if test "${ac_cv_cxx_compiler_gnu+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+#ifndef __GNUC__
+ choke me
+#endif
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_compile "$LINENO"; then :
+ ac_compiler_gnu=yes
+else
+ ac_compiler_gnu=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_cv_cxx_compiler_gnu=$ac_compiler_gnu
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5
+$as_echo "$ac_cv_cxx_compiler_gnu" >&6; }
+if test $ac_compiler_gnu = yes; then
+ GXX=yes
+else
+ GXX=
+fi
+ac_test_CXXFLAGS=${CXXFLAGS+set}
+ac_save_CXXFLAGS=$CXXFLAGS
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5
+$as_echo_n "checking whether $CXX accepts -g... " >&6; }
+if test "${ac_cv_prog_cxx_g+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_save_cxx_werror_flag=$ac_cxx_werror_flag
+ ac_cxx_werror_flag=yes
+ ac_cv_prog_cxx_g=no
+ CXXFLAGS="-g"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_compile "$LINENO"; then :
+ ac_cv_prog_cxx_g=yes
+else
+ CXXFLAGS=""
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_compile "$LINENO"; then :
+
+else
+ ac_cxx_werror_flag=$ac_save_cxx_werror_flag
+ CXXFLAGS="-g"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_compile "$LINENO"; then :
+ ac_cv_prog_cxx_g=yes
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ ac_cxx_werror_flag=$ac_save_cxx_werror_flag
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5
+$as_echo "$ac_cv_prog_cxx_g" >&6; }
+if test "$ac_test_CXXFLAGS" = set; then
+ CXXFLAGS=$ac_save_CXXFLAGS
+elif test $ac_cv_prog_cxx_g = yes; then
+ if test "$GXX" = yes; then
+ CXXFLAGS="-g -O2"
+ else
+ CXXFLAGS="-g"
+ fi
+else
+ if test "$GXX" = yes; then
+ CXXFLAGS="-O2"
+ else
+ CXXFLAGS=
+ fi
+fi
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+DEPDIR="${am__leading_dot}deps"
+
+ac_config_commands="$ac_config_commands depfiles"
+
+
+am_make=${MAKE-make}
+cat > confinc << 'END'
+am__doit:
+ @echo this is the am__doit target
+.PHONY: am__doit
+END
+# If we don't find an include directive, just comment out the code.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5
+$as_echo_n "checking for style of include used by $am_make... " >&6; }
+am__include="#"
+am__quote=
+_am_result=none
+# First try GNU make style include.
+echo "include confinc" > confmf
+# Ignore all kinds of additional output from `make'.
+case `$am_make -s -f confmf 2> /dev/null` in #(
+*the\ am__doit\ target*)
+ am__include=include
+ am__quote=
+ _am_result=GNU
+ ;;
+esac
+# Now try BSD make style include.
+if test "$am__include" = "#"; then
+ echo '.include "confinc"' > confmf
+ case `$am_make -s -f confmf 2> /dev/null` in #(
+ *the\ am__doit\ target*)
+ am__include=.include
+ am__quote="\""
+ _am_result=BSD
+ ;;
+ esac
+fi
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5
+$as_echo "$_am_result" >&6; }
+rm -f confinc confmf
+
+# Check whether --enable-dependency-tracking was given.
+if test "${enable_dependency_tracking+set}" = set; then :
+ enableval=$enable_dependency_tracking;
+fi
+
+if test "x$enable_dependency_tracking" != xno; then
+ am_depcomp="$ac_aux_dir/depcomp"
+ AMDEPBACKSLASH='\'
+fi
+ if test "x$enable_dependency_tracking" != xno; then
+ AMDEP_TRUE=
+ AMDEP_FALSE='#'
+else
+ AMDEP_TRUE='#'
+ AMDEP_FALSE=
+fi
+
+
+
+depcc="$CXX" am_compiler_list=
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5
+$as_echo_n "checking dependency style of $depcc... " >&6; }
+if test "${am_cv_CXX_dependencies_compiler_type+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
+ # We make a subdir and do the tests there. Otherwise we can end up
+ # making bogus files that we don't know about and never remove. For
+ # instance it was reported that on HP-UX the gcc test will end up
+ # making a dummy file named `D' -- because `-MD' means `put the output
+ # in D'.
+ mkdir conftest.dir
+ # Copy depcomp to subdir because otherwise we won't find it if we're
+ # using a relative directory.
+ cp "$am_depcomp" conftest.dir
+ cd conftest.dir
+ # We will build objects and dependencies in a subdirectory because
+ # it helps to detect inapplicable dependency modes. For instance
+ # both Tru64's cc and ICC support -MD to output dependencies as a
+ # side effect of compilation, but ICC will put the dependencies in
+ # the current directory while Tru64 will put them in the object
+ # directory.
+ mkdir sub
+
+ am_cv_CXX_dependencies_compiler_type=none
+ if test "$am_compiler_list" = ""; then
+ am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
+ fi
+ am__universal=false
+ case " $depcc " in #(
+ *\ -arch\ *\ -arch\ *) am__universal=true ;;
+ esac
+
+ for depmode in $am_compiler_list; do
+ # Setup a source with many dependencies, because some compilers
+ # like to wrap large dependency lists on column 80 (with \), and
+ # we should not choose a depcomp mode which is confused by this.
+ #
+ # We need to recreate these files for each test, as the compiler may
+ # overwrite some of them when testing with obscure command lines.
+ # This happens at least with the AIX C compiler.
+ : > sub/conftest.c
+ for i in 1 2 3 4 5 6; do
+ echo '#include "conftst'$i'.h"' >> sub/conftest.c
+ # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
+ # Solaris 8's {/usr,}/bin/sh.
+ touch sub/conftst$i.h
+ done
+ echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
+
+ # We check with `-c' and `-o' for the sake of the "dashmstdout"
+ # mode. It turns out that the SunPro C++ compiler does not properly
+ # handle `-M -o', and we need to detect this. Also, some Intel
+ # versions had trouble with output in subdirs
+ am__obj=sub/conftest.${OBJEXT-o}
+ am__minus_obj="-o $am__obj"
+ case $depmode in
+ gcc)
+ # This depmode causes a compiler race in universal mode.
+ test "$am__universal" = false || continue
+ ;;
+ nosideeffect)
+ # after this tag, mechanisms are not by side-effect, so they'll
+ # only be used when explicitly requested
+ if test "x$enable_dependency_tracking" = xyes; then
+ continue
+ else
+ break
+ fi
+ ;;
+ msvisualcpp | msvcmsys)
+ # This compiler won't grok `-c -o', but also, the minuso test has
+ # not run yet. These depmodes are late enough in the game, and
+ # so weak that their functioning should not be impacted.
+ am__obj=conftest.${OBJEXT-o}
+ am__minus_obj=
+ ;;
+ none) break ;;
+ esac
+ if depmode=$depmode \
+ source=sub/conftest.c object=$am__obj \
+ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
+ >/dev/null 2>conftest.err &&
+ grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
+ grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+ grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
+ ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
+ # icc doesn't choke on unknown options, it will just issue warnings
+ # or remarks (even with -Werror). So we grep stderr for any message
+ # that says an option was ignored or not supported.
+ # When given -MP, icc 7.0 and 7.1 complain thusly:
+ # icc: Command line warning: ignoring option '-M'; no argument required
+ # The diagnosis changed in icc 8.0:
+ # icc: Command line remark: option '-MP' not supported
+ if (grep 'ignoring option' conftest.err ||
+ grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
+ am_cv_CXX_dependencies_compiler_type=$depmode
+ break
+ fi
+ fi
+ done
+
+ cd ..
+ rm -rf conftest.dir
+else
+ am_cv_CXX_dependencies_compiler_type=none
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CXX_dependencies_compiler_type" >&5
+$as_echo "$am_cv_CXX_dependencies_compiler_type" >&6; }
+CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type
+
+ if
+ test "x$enable_dependency_tracking" != xno \
+ && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then
+ am__fastdepCXX_TRUE=
+ am__fastdepCXX_FALSE='#'
+else
+ am__fastdepCXX_TRUE='#'
+ am__fastdepCXX_FALSE=
+fi
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}gcc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_CC+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_CC="${ac_tool_prefix}gcc"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_CC"; then
+ ac_ct_CC=$CC
+ # Extract the first word of "gcc", so it can be a program name with args.
+set dummy gcc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_CC"; then
+ ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_ac_ct_CC="gcc"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_CC" = x; then
+ CC=""
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ CC=$ac_ct_CC
+ fi
+else
+ CC="$ac_cv_prog_CC"
+fi
+
+if test -z "$CC"; then
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}cc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_CC+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_CC="${ac_tool_prefix}cc"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ fi
+fi
+if test -z "$CC"; then
+ # Extract the first word of "cc", so it can be a program name with args.
+set dummy cc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_CC+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+ ac_prog_rejected=no
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
+ ac_prog_rejected=yes
+ continue
+ fi
+ ac_cv_prog_CC="cc"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+if test $ac_prog_rejected = yes; then
+ # We found a bogon in the path, so make sure we never use it.
+ set dummy $ac_cv_prog_CC
+ shift
+ if test $# != 0; then
+ # We chose a different compiler from the bogus one.
+ # However, it has the same basename, so the bogon will be chosen
+ # first if we set CC to just the basename; use the full file name.
+ shift
+ ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"
+ fi
+fi
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$CC"; then
+ if test -n "$ac_tool_prefix"; then
+ for ac_prog in cl.exe
+ do
+ # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_CC+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$CC" && break
+ done
+fi
+if test -z "$CC"; then
+ ac_ct_CC=$CC
+ for ac_prog in cl.exe
+do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_CC"; then
+ ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_ac_ct_CC="$ac_prog"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$ac_ct_CC" && break
+done
+
+ if test "x$ac_ct_CC" = x; then
+ CC=""
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ CC=$ac_ct_CC
+ fi
+fi
+
+fi
+
+
+test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error "no acceptable C compiler found in \$PATH
+See \`config.log' for more details." "$LINENO" 5; }
+
+# Provide some information about the compiler.
+$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5
+set X $ac_compile
+ac_compiler=$2
+for ac_option in --version -v -V -qversion; do
+ { { ac_try="$ac_compiler $ac_option >&5"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_compiler $ac_option >&5") 2>conftest.err
+ ac_status=$?
+ if test -s conftest.err; then
+ sed '10a\
+... rest of stderr output deleted ...
+ 10q' conftest.err >conftest.er1
+ cat conftest.er1 >&5
+ fi
+ rm -f conftest.er1 conftest.err
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }
+done
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5
+$as_echo_n "checking whether we are using the GNU C compiler... " >&6; }
+if test "${ac_cv_c_compiler_gnu+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+#ifndef __GNUC__
+ choke me
+#endif
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_compiler_gnu=yes
+else
+ ac_compiler_gnu=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_cv_c_compiler_gnu=$ac_compiler_gnu
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5
+$as_echo "$ac_cv_c_compiler_gnu" >&6; }
+if test $ac_compiler_gnu = yes; then
+ GCC=yes
+else
+ GCC=
+fi
+ac_test_CFLAGS=${CFLAGS+set}
+ac_save_CFLAGS=$CFLAGS
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5
+$as_echo_n "checking whether $CC accepts -g... " >&6; }
+if test "${ac_cv_prog_cc_g+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_save_c_werror_flag=$ac_c_werror_flag
+ ac_c_werror_flag=yes
+ ac_cv_prog_cc_g=no
+ CFLAGS="-g"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_prog_cc_g=yes
+else
+ CFLAGS=""
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+else
+ ac_c_werror_flag=$ac_save_c_werror_flag
+ CFLAGS="-g"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_prog_cc_g=yes
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ ac_c_werror_flag=$ac_save_c_werror_flag
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5
+$as_echo "$ac_cv_prog_cc_g" >&6; }
+if test "$ac_test_CFLAGS" = set; then
+ CFLAGS=$ac_save_CFLAGS
+elif test $ac_cv_prog_cc_g = yes; then
+ if test "$GCC" = yes; then
+ CFLAGS="-g -O2"
+ else
+ CFLAGS="-g"
+ fi
+else
+ if test "$GCC" = yes; then
+ CFLAGS="-O2"
+ else
+ CFLAGS=
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5
+$as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
+if test "${ac_cv_prog_cc_c89+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_cv_prog_cc_c89=no
+ac_save_CC=$CC
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stdarg.h>
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
+struct buf { int x; };
+FILE * (*rcsopen) (struct buf *, struct stat *, int);
+static char *e (p, i)
+ char **p;
+ int i;
+{
+ return p[i];
+}
+static char *f (char * (*g) (char **, int), char **p, ...)
+{
+ char *s;
+ va_list v;
+ va_start (v,p);
+ s = g (p, va_arg (v,int));
+ va_end (v);
+ return s;
+}
+
+/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has
+ function prototypes and stuff, but not '\xHH' hex character constants.
+ These don't provoke an error unfortunately, instead are silently treated
+ as 'x'. The following induces an error, until -std is added to get
+ proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an
+ array size at least. It's necessary to write '\x00'==0 to get something
+ that's true only with -std. */
+int osf4_cc_array ['\x00' == 0 ? 1 : -1];
+
+/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
+ inside strings and character constants. */
+#define FOO(x) 'x'
+int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];
+
+int test (int i, double x);
+struct s1 {int (*f) (int a);};
+struct s2 {int (*f) (double a);};
+int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
+int argc;
+char **argv;
+int
+main ()
+{
+return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
+ ;
+ return 0;
+}
+_ACEOF
+for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
+ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
+do
+ CC="$ac_save_CC $ac_arg"
+ if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_prog_cc_c89=$ac_arg
+fi
+rm -f core conftest.err conftest.$ac_objext
+ test "x$ac_cv_prog_cc_c89" != "xno" && break
+done
+rm -f conftest.$ac_ext
+CC=$ac_save_CC
+
+fi
+# AC_CACHE_VAL
+case "x$ac_cv_prog_cc_c89" in
+ x)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
+$as_echo "none needed" >&6; } ;;
+ xno)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
+$as_echo "unsupported" >&6; } ;;
+ *)
+ CC="$CC $ac_cv_prog_cc_c89"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5
+$as_echo "$ac_cv_prog_cc_c89" >&6; } ;;
+esac
+if test "x$ac_cv_prog_cc_c89" != xno; then :
+
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+depcc="$CC" am_compiler_list=
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5
+$as_echo_n "checking dependency style of $depcc... " >&6; }
+if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
+ # We make a subdir and do the tests there. Otherwise we can end up
+ # making bogus files that we don't know about and never remove. For
+ # instance it was reported that on HP-UX the gcc test will end up
+ # making a dummy file named `D' -- because `-MD' means `put the output
+ # in D'.
+ mkdir conftest.dir
+ # Copy depcomp to subdir because otherwise we won't find it if we're
+ # using a relative directory.
+ cp "$am_depcomp" conftest.dir
+ cd conftest.dir
+ # We will build objects and dependencies in a subdirectory because
+ # it helps to detect inapplicable dependency modes. For instance
+ # both Tru64's cc and ICC support -MD to output dependencies as a
+ # side effect of compilation, but ICC will put the dependencies in
+ # the current directory while Tru64 will put them in the object
+ # directory.
+ mkdir sub
+
+ am_cv_CC_dependencies_compiler_type=none
+ if test "$am_compiler_list" = ""; then
+ am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
+ fi
+ am__universal=false
+ case " $depcc " in #(
+ *\ -arch\ *\ -arch\ *) am__universal=true ;;
+ esac
+
+ for depmode in $am_compiler_list; do
+ # Setup a source with many dependencies, because some compilers
+ # like to wrap large dependency lists on column 80 (with \), and
+ # we should not choose a depcomp mode which is confused by this.
+ #
+ # We need to recreate these files for each test, as the compiler may
+ # overwrite some of them when testing with obscure command lines.
+ # This happens at least with the AIX C compiler.
+ : > sub/conftest.c
+ for i in 1 2 3 4 5 6; do
+ echo '#include "conftst'$i'.h"' >> sub/conftest.c
+ # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
+ # Solaris 8's {/usr,}/bin/sh.
+ touch sub/conftst$i.h
+ done
+ echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
+
+ # We check with `-c' and `-o' for the sake of the "dashmstdout"
+ # mode. It turns out that the SunPro C++ compiler does not properly
+ # handle `-M -o', and we need to detect this. Also, some Intel
+ # versions had trouble with output in subdirs
+ am__obj=sub/conftest.${OBJEXT-o}
+ am__minus_obj="-o $am__obj"
+ case $depmode in
+ gcc)
+ # This depmode causes a compiler race in universal mode.
+ test "$am__universal" = false || continue
+ ;;
+ nosideeffect)
+ # after this tag, mechanisms are not by side-effect, so they'll
+ # only be used when explicitly requested
+ if test "x$enable_dependency_tracking" = xyes; then
+ continue
+ else
+ break
+ fi
+ ;;
+ msvisualcpp | msvcmsys)
+ # This compiler won't grok `-c -o', but also, the minuso test has
+ # not run yet. These depmodes are late enough in the game, and
+ # so weak that their functioning should not be impacted.
+ am__obj=conftest.${OBJEXT-o}
+ am__minus_obj=
+ ;;
+ none) break ;;
+ esac
+ if depmode=$depmode \
+ source=sub/conftest.c object=$am__obj \
+ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
+ >/dev/null 2>conftest.err &&
+ grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
+ grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+ grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
+ ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
+ # icc doesn't choke on unknown options, it will just issue warnings
+ # or remarks (even with -Werror). So we grep stderr for any message
+ # that says an option was ignored or not supported.
+ # When given -MP, icc 7.0 and 7.1 complain thusly:
+ # icc: Command line warning: ignoring option '-M'; no argument required
+ # The diagnosis changed in icc 8.0:
+ # icc: Command line remark: option '-MP' not supported
+ if (grep 'ignoring option' conftest.err ||
+ grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
+ am_cv_CC_dependencies_compiler_type=$depmode
+ break
+ fi
+ fi
+ done
+
+ cd ..
+ rm -rf conftest.dir
+else
+ am_cv_CC_dependencies_compiler_type=none
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5
+$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; }
+CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type
+
+ if
+ test "x$enable_dependency_tracking" != xno \
+ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then
+ am__fastdepCC_TRUE=
+ am__fastdepCC_FALSE='#'
+else
+ am__fastdepCC_TRUE='#'
+ am__fastdepCC_FALSE=
+fi
+
+
+if test "x$CC" != xcc; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC and cc understand -c and -o together" >&5
+$as_echo_n "checking whether $CC and cc understand -c and -o together... " >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether cc understands -c and -o together" >&5
+$as_echo_n "checking whether cc understands -c and -o together... " >&6; }
+fi
+set dummy $CC; ac_cc=`$as_echo "$2" |
+ sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'`
+if { as_var=ac_cv_prog_cc_${ac_cc}_c_o; eval "test \"\${$as_var+set}\" = set"; }; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+# Make sure it works both with $CC and with simple cc.
+# We do the test twice because some compilers refuse to overwrite an
+# existing .o file with -o, though they will create one.
+ac_try='$CC -c conftest.$ac_ext -o conftest2.$ac_objext >&5'
+rm -f conftest2.*
+if { { case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_try") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } &&
+ test -f conftest2.$ac_objext && { { case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_try") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; };
+then
+ eval ac_cv_prog_cc_${ac_cc}_c_o=yes
+ if test "x$CC" != xcc; then
+ # Test first that cc exists at all.
+ if { ac_try='cc -c conftest.$ac_ext >&5'
+ { { case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_try") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; }; then
+ ac_try='cc -c conftest.$ac_ext -o conftest2.$ac_objext >&5'
+ rm -f conftest2.*
+ if { { case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_try") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } &&
+ test -f conftest2.$ac_objext && { { case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_try") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; };
+ then
+ # cc works too.
+ :
+ else
+ # cc exists but doesn't like -o.
+ eval ac_cv_prog_cc_${ac_cc}_c_o=no
+ fi
+ fi
+ fi
+else
+ eval ac_cv_prog_cc_${ac_cc}_c_o=no
+fi
+rm -f core conftest*
+
+fi
+if eval test \$ac_cv_prog_cc_${ac_cc}_c_o = yes; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+$as_echo "#define NO_MINUS_C_MINUS_O 1" >>confdefs.h
+
+fi
+
+# FIXME: we rely on the cache variable name because
+# there is no other way.
+set dummy $CC
+am_cc=`echo $2 | sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'`
+eval am_t=\$ac_cv_prog_cc_${am_cc}_c_o
+if test "$am_t" != yes; then
+ # Losing compiler, so override with the script.
+ # FIXME: It is wrong to rewrite CC.
+ # But if we don't then we get into trouble of one sort or another.
+ # A longer-term fix would be to have automake use am__CC in this case,
+ # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
+ CC="$am_aux_dir/compile $CC"
+fi
+
+
+
+
+# Checks for libraries.
+# FIXME: Replace `main' with a function in `-lfec':
+#AC_CHECK_LIB([fec], [init_rs_char], [], AC_MSG_ERROR([libfec is required]))
+# FIXME: Replace `main' with a function in `-lpthread':
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_create in -lpthread" >&5
+$as_echo_n "checking for pthread_create in -lpthread... " >&6; }
+if test "${ac_cv_lib_pthread_pthread_create+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lpthread $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char pthread_create ();
+int
+main ()
+{
+return pthread_create ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_pthread_pthread_create=yes
+else
+ ac_cv_lib_pthread_pthread_create=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_create" >&5
+$as_echo "$ac_cv_lib_pthread_pthread_create" >&6; }
+if test "x$ac_cv_lib_pthread_pthread_create" = x""yes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBPTHREAD 1
+_ACEOF
+
+ LIBS="-lpthread $LIBS"
+
+else
+ as_fn_error "libpthread is required" "$LINENO" 5
+fi
+
+
+# Checks for header files.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for OS type" >&5
+$as_echo_n "checking for OS type... " >&6; }
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5
+$as_echo_n "checking how to run the C preprocessor... " >&6; }
+# On Suns, sometimes $CPP names a directory.
+if test -n "$CPP" && test -d "$CPP"; then
+ CPP=
+fi
+if test -z "$CPP"; then
+ if test "${ac_cv_prog_CPP+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ # Double quotes because CPP needs to be expanded
+ for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
+ do
+ ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+ # Use a header file that comes with gcc, so configuring glibc
+ # with a fresh cross-compiler works.
+ # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ # <limits.h> exists even on freestanding compilers.
+ # On the NeXT, cc -E runs the code through the compiler's parser,
+ # not just through cpp. "Syntax error" is here to catch this case.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+ Syntax error
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+
+else
+ # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.$ac_ext
+
+ # OK, works on sane cases. Now check whether nonexistent headers
+ # can be detected and how.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <ac_nonexistent.h>
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+ # Broken: success on invalid input.
+continue
+else
+ # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -f conftest.err conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then :
+ break
+fi
+
+ done
+ ac_cv_prog_CPP=$CPP
+
+fi
+ CPP=$ac_cv_prog_CPP
+else
+ ac_cv_prog_CPP=$CPP
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5
+$as_echo "$CPP" >&6; }
+ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+ # Use a header file that comes with gcc, so configuring glibc
+ # with a fresh cross-compiler works.
+ # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ # <limits.h> exists even on freestanding compilers.
+ # On the NeXT, cc -E runs the code through the compiler's parser,
+ # not just through cpp. "Syntax error" is here to catch this case.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+ Syntax error
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+
+else
+ # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.$ac_ext
+
+ # OK, works on sane cases. Now check whether nonexistent headers
+ # can be detected and how.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <ac_nonexistent.h>
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+ # Broken: success on invalid input.
+continue
+else
+ # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -f conftest.err conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then :
+
+else
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error "C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details." "$LINENO" 5; }
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#ifndef _WIN32
+#error windows
+#endif
+
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+ OS=windows
+else
+ OS=linux
+
+fi
+rm -f conftest.err conftest.$ac_ext
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $OS" >&5
+$as_echo "$OS" >&6; }
+ if test "x$OS" == "xwindows"; then
+ WINDOWS_TRUE=
+ WINDOWS_FALSE='#'
+else
+ WINDOWS_TRUE='#'
+ WINDOWS_FALSE=
+fi
+
+FARSYNC_DIR='$(top_srcdir)/lib/farsync/'$OS
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5
+$as_echo_n "checking for grep that handles long lines and -e... " >&6; }
+if test "${ac_cv_path_GREP+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -z "$GREP"; then
+ ac_path_GREP_found=false
+ # Loop through the user's path and test for each of PROGNAME-LIST
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_prog in grep ggrep; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
+ { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue
+# Check for GNU ac_path_GREP and select it if it is found.
+ # Check for GNU $ac_path_GREP
+case `"$ac_path_GREP" --version 2>&1` in
+*GNU*)
+ ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;
+*)
+ ac_count=0
+ $as_echo_n 0123456789 >"conftest.in"
+ while :
+ do
+ cat "conftest.in" "conftest.in" >"conftest.tmp"
+ mv "conftest.tmp" "conftest.in"
+ cp "conftest.in" "conftest.nl"
+ $as_echo 'GREP' >> "conftest.nl"
+ "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break
+ diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+ as_fn_arith $ac_count + 1 && ac_count=$as_val
+ if test $ac_count -gt ${ac_path_GREP_max-0}; then
+ # Best one so far, save it but keep looking for a better one
+ ac_cv_path_GREP="$ac_path_GREP"
+ ac_path_GREP_max=$ac_count
+ fi
+ # 10*(2^10) chars as input seems more than enough
+ test $ac_count -gt 10 && break
+ done
+ rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+ $ac_path_GREP_found && break 3
+ done
+ done
+ done
+IFS=$as_save_IFS
+ if test -z "$ac_cv_path_GREP"; then
+ as_fn_error "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
+ fi
+else
+ ac_cv_path_GREP=$GREP
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5
+$as_echo "$ac_cv_path_GREP" >&6; }
+ GREP="$ac_cv_path_GREP"
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5
+$as_echo_n "checking for egrep... " >&6; }
+if test "${ac_cv_path_EGREP+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
+ then ac_cv_path_EGREP="$GREP -E"
+ else
+ if test -z "$EGREP"; then
+ ac_path_EGREP_found=false
+ # Loop through the user's path and test for each of PROGNAME-LIST
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_prog in egrep; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
+ { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue
+# Check for GNU ac_path_EGREP and select it if it is found.
+ # Check for GNU $ac_path_EGREP
+case `"$ac_path_EGREP" --version 2>&1` in
+*GNU*)
+ ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;;
+*)
+ ac_count=0
+ $as_echo_n 0123456789 >"conftest.in"
+ while :
+ do
+ cat "conftest.in" "conftest.in" >"conftest.tmp"
+ mv "conftest.tmp" "conftest.in"
+ cp "conftest.in" "conftest.nl"
+ $as_echo 'EGREP' >> "conftest.nl"
+ "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break
+ diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+ as_fn_arith $ac_count + 1 && ac_count=$as_val
+ if test $ac_count -gt ${ac_path_EGREP_max-0}; then
+ # Best one so far, save it but keep looking for a better one
+ ac_cv_path_EGREP="$ac_path_EGREP"
+ ac_path_EGREP_max=$ac_count
+ fi
+ # 10*(2^10) chars as input seems more than enough
+ test $ac_count -gt 10 && break
+ done
+ rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+ $ac_path_EGREP_found && break 3
+ done
+ done
+ done
+IFS=$as_save_IFS
+ if test -z "$ac_cv_path_EGREP"; then
+ as_fn_error "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
+ fi
+else
+ ac_cv_path_EGREP=$EGREP
+fi
+
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5
+$as_echo "$ac_cv_path_EGREP" >&6; }
+ EGREP="$ac_cv_path_EGREP"
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5
+$as_echo_n "checking for ANSI C header files... " >&6; }
+if test "${ac_cv_header_stdc+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+#include <float.h>
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_header_stdc=yes
+else
+ ac_cv_header_stdc=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+if test $ac_cv_header_stdc = yes; then
+ # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <string.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "memchr" >/dev/null 2>&1; then :
+
+else
+ ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+ # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stdlib.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "free" >/dev/null 2>&1; then :
+
+else
+ ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+ # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
+ if test "$cross_compiling" = yes; then :
+ :
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <ctype.h>
+#include <stdlib.h>
+#if ((' ' & 0x0FF) == 0x020)
+# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
+# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
+#else
+# define ISLOWER(c) \
+ (('a' <= (c) && (c) <= 'i') \
+ || ('j' <= (c) && (c) <= 'r') \
+ || ('s' <= (c) && (c) <= 'z'))
+# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
+#endif
+
+#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
+int
+main ()
+{
+ int i;
+ for (i = 0; i < 256; i++)
+ if (XOR (islower (i), ISLOWER (i))
+ || toupper (i) != TOUPPER (i))
+ return 2;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+
+else
+ ac_cv_header_stdc=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5
+$as_echo "$ac_cv_header_stdc" >&6; }
+if test $ac_cv_header_stdc = yes; then
+
+$as_echo "#define STDC_HEADERS 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sys/wait.h that is POSIX.1 compatible" >&5
+$as_echo_n "checking for sys/wait.h that is POSIX.1 compatible... " >&6; }
+if test "${ac_cv_header_sys_wait_h+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/types.h>
+#include <sys/wait.h>
+#ifndef WEXITSTATUS
+# define WEXITSTATUS(stat_val) ((unsigned int) (stat_val) >> 8)
+#endif
+#ifndef WIFEXITED
+# define WIFEXITED(stat_val) (((stat_val) & 255) == 0)
+#endif
+
+int
+main ()
+{
+ int s;
+ wait (&s);
+ s = WIFEXITED (s) ? WEXITSTATUS (s) : 1;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_header_sys_wait_h=yes
+else
+ ac_cv_header_sys_wait_h=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_sys_wait_h" >&5
+$as_echo "$ac_cv_header_sys_wait_h" >&6; }
+if test $ac_cv_header_sys_wait_h = yes; then
+
+$as_echo "#define HAVE_SYS_WAIT_H 1" >>confdefs.h
+
+fi
+
+# On IRIX 5.3, sys/types and inttypes.h are conflicting.
+for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
+ inttypes.h stdint.h unistd.h
+do :
+ as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default
+"
+eval as_val=\$$as_ac_Header
+ if test "x$as_val" = x""yes; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+for ac_header in arpa/inet.h fcntl.h limits.h netdb.h netinet/in.h stddef.h stdint.h stdlib.h string.h sys/ioctl.h sys/socket.h sys/time.h unistd.h
+do :
+ as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
+eval as_val=\$$as_ac_Header
+ if test "x$as_val" = x""yes; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+# Checks for typedefs, structures, and compiler characteristics.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for stdbool.h that conforms to C99" >&5
+$as_echo_n "checking for stdbool.h that conforms to C99... " >&6; }
+if test "${ac_cv_header_stdbool_h+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <stdbool.h>
+#ifndef bool
+ "error: bool is not defined"
+#endif
+#ifndef false
+ "error: false is not defined"
+#endif
+#if false
+ "error: false is not 0"
+#endif
+#ifndef true
+ "error: true is not defined"
+#endif
+#if true != 1
+ "error: true is not 1"
+#endif
+#ifndef __bool_true_false_are_defined
+ "error: __bool_true_false_are_defined is not defined"
+#endif
+
+ struct s { _Bool s: 1; _Bool t; } s;
+
+ char a[true == 1 ? 1 : -1];
+ char b[false == 0 ? 1 : -1];
+ char c[__bool_true_false_are_defined == 1 ? 1 : -1];
+ char d[(bool) 0.5 == true ? 1 : -1];
+ bool e = &s;
+ char f[(_Bool) 0.0 == false ? 1 : -1];
+ char g[true];
+ char h[sizeof (_Bool)];
+ char i[sizeof s.t];
+ enum { j = false, k = true, l = false * true, m = true * 256 };
+ /* The following fails for
+ HP aC++/ANSI C B3910B A.05.55 [Dec 04 2003]. */
+ _Bool n[m];
+ char o[sizeof n == m * sizeof n[0] ? 1 : -1];
+ char p[-1 - (_Bool) 0 < 0 && -1 - (bool) 0 < 0 ? 1 : -1];
+# if defined __xlc__ || defined __GNUC__
+ /* Catch a bug in IBM AIX xlc compiler version 6.0.0.0
+ reported by James Lemley on 2005-10-05; see
+ http://lists.gnu.org/archive/html/bug-coreutils/2005-10/msg00086.html
+ This test is not quite right, since xlc is allowed to
+ reject this program, as the initializer for xlcbug is
+ not one of the forms that C requires support for.
+ However, doing the test right would require a runtime
+ test, and that would make cross-compilation harder.
+ Let us hope that IBM fixes the xlc bug, and also adds
+ support for this kind of constant expression. In the
+ meantime, this test will reject xlc, which is OK, since
+ our stdbool.h substitute should suffice. We also test
+ this with GCC, where it should work, to detect more
+ quickly whether someone messes up the test in the
+ future. */
+ char digs[] = "0123456789";
+ int xlcbug = 1 / (&(digs + 5)[-2 + (bool) 1] == &digs[4] ? 1 : -1);
+# endif
+ /* Catch a bug in an HP-UX C compiler. See
+ http://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html
+ http://lists.gnu.org/archive/html/bug-coreutils/2005-11/msg00161.html
+ */
+ _Bool q = true;
+ _Bool *pq = &q;
+
+int
+main ()
+{
+
+ *pq |= q;
+ *pq |= ! q;
+ /* Refer to every declared value, to avoid compiler optimizations. */
+ return (!a + !b + !c + !d + !e + !f + !g + !h + !i + !!j + !k + !!l
+ + !m + !n + !o + !p + !q + !pq);
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_header_stdbool_h=yes
+else
+ ac_cv_header_stdbool_h=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdbool_h" >&5
+$as_echo "$ac_cv_header_stdbool_h" >&6; }
+ac_fn_c_check_type "$LINENO" "_Bool" "ac_cv_type__Bool" "$ac_includes_default"
+if test "x$ac_cv_type__Bool" = x""yes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE__BOOL 1
+_ACEOF
+
+
+fi
+
+if test $ac_cv_header_stdbool_h = yes; then
+
+$as_echo "#define HAVE_STDBOOL_H 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5
+$as_echo_n "checking for an ANSI C-conforming const... " >&6; }
+if test "${ac_cv_c_const+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+/* FIXME: Include the comments suggested by Paul. */
+#ifndef __cplusplus
+ /* Ultrix mips cc rejects this. */
+ typedef int charset[2];
+ const charset cs;
+ /* SunOS 4.1.1 cc rejects this. */
+ char const *const *pcpcc;
+ char **ppc;
+ /* NEC SVR4.0.2 mips cc rejects this. */
+ struct point {int x, y;};
+ static struct point const zero = {0,0};
+ /* AIX XL C 1.02.0.0 rejects this.
+ It does not let you subtract one const X* pointer from another in
+ an arm of an if-expression whose if-part is not a constant
+ expression */
+ const char *g = "string";
+ pcpcc = &g + (g ? g-g : 0);
+ /* HPUX 7.0 cc rejects these. */
+ ++pcpcc;
+ ppc = (char**) pcpcc;
+ pcpcc = (char const *const *) ppc;
+ { /* SCO 3.2v4 cc rejects this. */
+ char *t;
+ char const *s = 0 ? (char *) 0 : (char const *) 0;
+
+ *t++ = 0;
+ if (s) return 0;
+ }
+ { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */
+ int x[] = {25, 17};
+ const int *foo = &x[0];
+ ++foo;
+ }
+ { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
+ typedef const int *iptr;
+ iptr p = 0;
+ ++p;
+ }
+ { /* AIX XL C 1.02.0.0 rejects this saying
+ "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
+ struct s { int j; const int *ap[3]; };
+ struct s *b; b->j = 5;
+ }
+ { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
+ const int foo = 10;
+ if (!foo) return 0;
+ }
+ return !cs[0] && !zero.x;
+#endif
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_c_const=yes
+else
+ ac_cv_c_const=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_const" >&5
+$as_echo "$ac_cv_c_const" >&6; }
+if test $ac_cv_c_const = no; then
+
+$as_echo "#define const /**/" >>confdefs.h
+
+fi
+
+ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default"
+if test "x$ac_cv_type_size_t" = x""yes; then :
+
+else
+
+cat >>confdefs.h <<_ACEOF
+#define size_t unsigned int
+_ACEOF
+
+fi
+
+ac_fn_c_check_type "$LINENO" "ssize_t" "ac_cv_type_ssize_t" "$ac_includes_default"
+if test "x$ac_cv_type_ssize_t" = x""yes; then :
+
+else
+
+cat >>confdefs.h <<_ACEOF
+#define ssize_t int
+_ACEOF
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether time.h and sys/time.h may both be included" >&5
+$as_echo_n "checking whether time.h and sys/time.h may both be included... " >&6; }
+if test "${ac_cv_header_time+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/types.h>
+#include <sys/time.h>
+#include <time.h>
+
+int
+main ()
+{
+if ((struct tm *) 0)
+return 0;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_header_time=yes
+else
+ ac_cv_header_time=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_time" >&5
+$as_echo "$ac_cv_header_time" >&6; }
+if test $ac_cv_header_time = yes; then
+
+$as_echo "#define TIME_WITH_SYS_TIME 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether struct tm is in sys/time.h or time.h" >&5
+$as_echo_n "checking whether struct tm is in sys/time.h or time.h... " >&6; }
+if test "${ac_cv_struct_tm+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/types.h>
+#include <time.h>
+
+int
+main ()
+{
+struct tm tm;
+ int *p = &tm.tm_sec;
+ return !p;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_struct_tm=time.h
+else
+ ac_cv_struct_tm=sys/time.h
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_struct_tm" >&5
+$as_echo "$ac_cv_struct_tm" >&6; }
+if test $ac_cv_struct_tm = sys/time.h; then
+
+$as_echo "#define TM_IN_SYS_TIME 1" >>confdefs.h
+
+fi
+
+ac_fn_c_find_uintX_t "$LINENO" "16" "ac_cv_c_uint16_t"
+case $ac_cv_c_uint16_t in #(
+ no|yes) ;; #(
+ *)
+
+
+cat >>confdefs.h <<_ACEOF
+#define uint16_t $ac_cv_c_uint16_t
+_ACEOF
+;;
+ esac
+
+ac_fn_c_find_uintX_t "$LINENO" "32" "ac_cv_c_uint32_t"
+case $ac_cv_c_uint32_t in #(
+ no|yes) ;; #(
+ *)
+
+$as_echo "#define _UINT32_T 1" >>confdefs.h
+
+
+cat >>confdefs.h <<_ACEOF
+#define uint32_t $ac_cv_c_uint32_t
+_ACEOF
+;;
+ esac
+
+ac_fn_c_find_uintX_t "$LINENO" "8" "ac_cv_c_uint8_t"
+case $ac_cv_c_uint8_t in #(
+ no|yes) ;; #(
+ *)
+
+$as_echo "#define _UINT8_T 1" >>confdefs.h
+
+
+cat >>confdefs.h <<_ACEOF
+#define uint8_t $ac_cv_c_uint8_t
+_ACEOF
+;;
+ esac
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for working volatile" >&5
+$as_echo_n "checking for working volatile... " >&6; }
+if test "${ac_cv_c_volatile+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+volatile int x;
+int * volatile y = (int *) 0;
+return !x && !y;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_c_volatile=yes
+else
+ ac_cv_c_volatile=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_volatile" >&5
+$as_echo "$ac_cv_c_volatile" >&6; }
+if test $ac_cv_c_volatile = no; then
+
+$as_echo "#define volatile /**/" >>confdefs.h
+
+fi
+
+
+# Checks for library functions.
+if test $ac_cv_c_compiler_gnu = yes; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC needs -traditional" >&5
+$as_echo_n "checking whether $CC needs -traditional... " >&6; }
+if test "${ac_cv_prog_gcc_traditional+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_pattern="Autoconf.*'x'"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sgtty.h>
+Autoconf TIOCGETP
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "$ac_pattern" >/dev/null 2>&1; then :
+ ac_cv_prog_gcc_traditional=yes
+else
+ ac_cv_prog_gcc_traditional=no
+fi
+rm -f conftest*
+
+
+ if test $ac_cv_prog_gcc_traditional = no; then
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <termio.h>
+Autoconf TCGETA
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "$ac_pattern" >/dev/null 2>&1; then :
+ ac_cv_prog_gcc_traditional=yes
+fi
+rm -f conftest*
+
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_gcc_traditional" >&5
+$as_echo "$ac_cv_prog_gcc_traditional" >&6; }
+ if test $ac_cv_prog_gcc_traditional = yes; then
+ CC="$CC -traditional"
+ fi
+fi
+
+for ac_header in stdlib.h
+do :
+ ac_fn_c_check_header_mongrel "$LINENO" "stdlib.h" "ac_cv_header_stdlib_h" "$ac_includes_default"
+if test "x$ac_cv_header_stdlib_h" = x""yes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_STDLIB_H 1
+_ACEOF
+
+fi
+
+done
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU libc compatible malloc" >&5
+$as_echo_n "checking for GNU libc compatible malloc... " >&6; }
+if test "${ac_cv_func_malloc_0_nonnull+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test "$cross_compiling" = yes; then :
+ ac_cv_func_malloc_0_nonnull=no
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#if defined STDC_HEADERS || defined HAVE_STDLIB_H
+# include <stdlib.h>
+#else
+char *malloc ();
+#endif
+
+int
+main ()
+{
+return ! malloc (0);
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ ac_cv_func_malloc_0_nonnull=yes
+else
+ ac_cv_func_malloc_0_nonnull=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_malloc_0_nonnull" >&5
+$as_echo "$ac_cv_func_malloc_0_nonnull" >&6; }
+if test $ac_cv_func_malloc_0_nonnull = yes; then :
+
+$as_echo "#define HAVE_MALLOC 1" >>confdefs.h
+
+else
+ $as_echo "#define HAVE_MALLOC 0" >>confdefs.h
+
+ case " $LIBOBJS " in
+ *" malloc.$ac_objext "* ) ;;
+ *) LIBOBJS="$LIBOBJS malloc.$ac_objext"
+ ;;
+esac
+
+
+$as_echo "#define malloc rpl_malloc" >>confdefs.h
+
+fi
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for working memcmp" >&5
+$as_echo_n "checking for working memcmp... " >&6; }
+if test "${ac_cv_func_memcmp_working+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test "$cross_compiling" = yes; then :
+ ac_cv_func_memcmp_working=no
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+
+ /* Some versions of memcmp are not 8-bit clean. */
+ char c0 = '\100', c1 = '\200', c2 = '\201';
+ if (memcmp(&c0, &c2, 1) >= 0 || memcmp(&c1, &c2, 1) >= 0)
+ return 1;
+
+ /* The Next x86 OpenStep bug shows up only when comparing 16 bytes
+ or more and with at least one buffer not starting on a 4-byte boundary.
+ William Lewis provided this test program. */
+ {
+ char foo[21];
+ char bar[21];
+ int i;
+ for (i = 0; i < 4; i++)
+ {
+ char *a = foo + i;
+ char *b = bar + i;
+ strcpy (a, "--------01111111");
+ strcpy (b, "--------10000000");
+ if (memcmp (a, b, 16) >= 0)
+ return 1;
+ }
+ return 0;
+ }
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ ac_cv_func_memcmp_working=yes
+else
+ ac_cv_func_memcmp_working=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_memcmp_working" >&5
+$as_echo "$ac_cv_func_memcmp_working" >&6; }
+test $ac_cv_func_memcmp_working = no && case " $LIBOBJS " in
+ *" memcmp.$ac_objext "* ) ;;
+ *) LIBOBJS="$LIBOBJS memcmp.$ac_objext"
+ ;;
+esac
+
+
+for ac_header in stdlib.h
+do :
+ ac_fn_c_check_header_mongrel "$LINENO" "stdlib.h" "ac_cv_header_stdlib_h" "$ac_includes_default"
+if test "x$ac_cv_header_stdlib_h" = x""yes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_STDLIB_H 1
+_ACEOF
+
+fi
+
+done
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU libc compatible realloc" >&5
+$as_echo_n "checking for GNU libc compatible realloc... " >&6; }
+if test "${ac_cv_func_realloc_0_nonnull+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test "$cross_compiling" = yes; then :
+ ac_cv_func_realloc_0_nonnull=no
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#if defined STDC_HEADERS || defined HAVE_STDLIB_H
+# include <stdlib.h>
+#else
+char *realloc ();
+#endif
+
+int
+main ()
+{
+return ! realloc (0, 0);
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ ac_cv_func_realloc_0_nonnull=yes
+else
+ ac_cv_func_realloc_0_nonnull=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_realloc_0_nonnull" >&5
+$as_echo "$ac_cv_func_realloc_0_nonnull" >&6; }
+if test $ac_cv_func_realloc_0_nonnull = yes; then :
+
+$as_echo "#define HAVE_REALLOC 1" >>confdefs.h
+
+else
+ $as_echo "#define HAVE_REALLOC 0" >>confdefs.h
+
+ case " $LIBOBJS " in
+ *" realloc.$ac_objext "* ) ;;
+ *) LIBOBJS="$LIBOBJS realloc.$ac_objext"
+ ;;
+esac
+
+
+$as_echo "#define realloc rpl_realloc" >>confdefs.h
+
+fi
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking return type of signal handlers" >&5
+$as_echo_n "checking return type of signal handlers... " >&6; }
+if test "${ac_cv_type_signal+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/types.h>
+#include <signal.h>
+
+int
+main ()
+{
+return *(signal (0, 0)) (0) == 1;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_type_signal=int
+else
+ ac_cv_type_signal=void
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_signal" >&5
+$as_echo "$ac_cv_type_signal" >&6; }
+
+cat >>confdefs.h <<_ACEOF
+#define RETSIGTYPE $ac_cv_type_signal
+_ACEOF
+
+
+for ac_func in vprintf
+do :
+ ac_fn_c_check_func "$LINENO" "vprintf" "ac_cv_func_vprintf"
+if test "x$ac_cv_func_vprintf" = x""yes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_VPRINTF 1
+_ACEOF
+
+ac_fn_c_check_func "$LINENO" "_doprnt" "ac_cv_func__doprnt"
+if test "x$ac_cv_func__doprnt" = x""yes; then :
+
+$as_echo "#define HAVE_DOPRNT 1" >>confdefs.h
+
+fi
+
+fi
+done
+
+
+for ac_func in bzero gethostbyname gettimeofday inet_ntoa memchr memmove memset socket strchr strdup strerror strrchr strstr strtol strtoul
+do :
+ as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
+eval as_val=\$$as_ac_var
+ if test "x$as_val" = x""yes; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+
+# Options
+# Inputs
+# PRBS
+# Check whether --enable-input_prbs was given.
+if test "${enable_input_prbs+set}" = set; then :
+ enableval=$enable_input_prbs;
+else
+ enable_input_prbs=yes
+fi
+
+if test "x$enable_input_prbs" = "xyes"; then :
+
+$as_echo "#define HAVE_INPUT_PRBS 1" >>confdefs.h
+
+fi
+# TEST
+# Check whether --enable-input_test was given.
+if test "${enable_input_test+set}" = set; then :
+ enableval=$enable_input_test;
+else
+ enable_input_test=yes
+fi
+
+if test "x$enable_input_test" = "xyes"; then :
+
+$as_echo "#define HAVE_INPUT_TEST 1" >>confdefs.h
+
+fi
+# SLIP
+# Check whether --enable-input_slip was given.
+if test "${enable_input_slip+set}" = set; then :
+ enableval=$enable_input_slip;
+else
+ enable_input_slip=yes
+fi
+
+if test "x$enable_input_slip" = "xyes"; then :
+
+$as_echo "#define HAVE_INPUT_SLIP 1" >>confdefs.h
+
+fi
+# UDP
+# Check whether --enable-input_udp was given.
+if test "${enable_input_udp+set}" = set; then :
+ enableval=$enable_input_udp;
+else
+ enable_input_udp=yes
+fi
+
+if test "x$enable_input_udp" = "xyes"; then :
+
+$as_echo "#define HAVE_INPUT_UDP 1" >>confdefs.h
+
+fi
+# FIFO
+# Check whether --enable-input_fifo was given.
+if test "${enable_input_fifo+set}" = set; then :
+ enableval=$enable_input_fifo;
+else
+ enable_input_fifo=yes
+fi
+
+if test "x$enable_input_fifo" = "xyes"; then :
+
+$as_echo "#define HAVE_INPUT_FIFO 1" >>confdefs.h
+
+fi
+# FILE
+# Check whether --enable-input_file was given.
+if test "${enable_input_file+set}" = set; then :
+ enableval=$enable_input_file;
+else
+ enable_input_file=yes
+fi
+
+if test "x$enable_input_file" = "xyes"; then :
+
+$as_echo "#define HAVE_INPUT_FILE 1" >>confdefs.h
+
+fi
+
+# Outputs
+# FILE
+# Check whether --enable-output_file was given.
+if test "${enable_output_file+set}" = set; then :
+ enableval=$enable_output_file;
+else
+ enable_output_file=yes
+fi
+
+if test "x$enable_output_file" = "xyes"; then :
+
+$as_echo "#define HAVE_OUTPUT_FILE 1" >>confdefs.h
+
+fi
+# FIFO
+# Check whether --enable-output_fifo was given.
+if test "${enable_output_fifo+set}" = set; then :
+ enableval=$enable_output_fifo;
+else
+ enable_output_fifo=yes
+fi
+
+if test "x$enable_output_fifo" = "xyes"; then :
+
+$as_echo "#define HAVE_OUTPUT_FIFO 1" >>confdefs.h
+
+fi
+# UDP
+# Check whether --enable-output_udp was given.
+if test "${enable_output_udp+set}" = set; then :
+ enableval=$enable_output_udp;
+else
+ enable_output_udp=yes
+fi
+
+if test "x$enable_output_udp" = "xyes"; then :
+
+$as_echo "#define HAVE_OUTPUT_UDP 1" >>confdefs.h
+
+fi
+# TCP
+# Check whether --enable-output_tcp was given.
+if test "${enable_output_tcp+set}" = set; then :
+ enableval=$enable_output_tcp;
+else
+ enable_output_tcp=yes
+fi
+
+if test "x$enable_output_tcp" = "xyes"; then :
+
+$as_echo "#define HAVE_OUTPUT_TCP 1" >>confdefs.h
+
+fi
+# RAW
+# Check whether --enable-output_raw was given.
+if test "${enable_output_raw+set}" = set; then :
+ enableval=$enable_output_raw;
+else
+ enable_output_raw=yes
+fi
+
+if test "x$enable_output_raw" = "xyes"; then :
+
+$as_echo "#define HAVE_OUTPUT_RAW 1" >>confdefs.h
+
+fi
+# SIMUL
+# Check whether --enable-output_simul was given.
+if test "${enable_output_simul+set}" = set; then :
+ enableval=$enable_output_simul;
+else
+ enable_output_simul=yes
+fi
+
+if test "x$enable_output_simul" = "xyes"; then :
+
+$as_echo "#define HAVE_OUTPUT_SIMUL 1" >>confdefs.h
+
+fi
+
+# Formats
+# RAW
+# Check whether --enable-format_raw was given.
+if test "${enable_format_raw+set}" = set; then :
+ enableval=$enable_format_raw;
+else
+ enable_format_raw=yes
+fi
+
+if test "x$enable_format_raw" = "xyes"; then :
+
+$as_echo "#define HAVE_FORMAT_RAW 1" >>confdefs.h
+
+fi
+# BRIDGE
+# Check whether --enable-format_bridge was given.
+if test "${enable_format_bridge+set}" = set; then :
+ enableval=$enable_format_bridge;
+else
+ enable_format_bridge=yes
+fi
+
+if test "x$enable_format_bridge" = "xyes"; then :
+
+$as_echo "#define HAVE_FORMAT_BRIDGE 1" >>confdefs.h
+
+fi
+# MPEG
+# Check whether --enable-format_mpeg was given.
+if test "${enable_format_mpeg+set}" = set; then :
+ enableval=$enable_format_mpeg;
+else
+ enable_format_mpeg=yes
+fi
+
+if test "x$enable_format_mpeg" = "xyes"; then :
+
+$as_echo "#define HAVE_FORMAT_MPEG 1" >>confdefs.h
+
+fi
+# PACKET
+# Check whether --enable-format_packet was given.
+if test "${enable_format_packet+set}" = set; then :
+ enableval=$enable_format_packet;
+else
+ enable_format_packet=yes
+fi
+
+if test "x$enable_format_packet" = "xyes"; then :
+
+$as_echo "#define HAVE_FORMAT_PACKET 1" >>confdefs.h
+
+fi
+# DABPLUS
+# Check whether --enable-format_dabplus was given.
+if test "${enable_format_dabplus+set}" = set; then :
+ enableval=$enable_format_dabplus;
+else
+ enable_format_dabplus=yes
+fi
+
+if test "x$enable_format_dabplus" = "xyes"; then :
+
+$as_echo "#define HAVE_FORMAT_DABPLUS 1" >>confdefs.h
+
+fi
+# DMB
+# Check whether --enable-format_dmb was given.
+if test "${enable_format_dmb+set}" = set; then :
+ enableval=$enable_format_dmb;
+else
+ enable_format_dmb=yes
+fi
+
+if test "x$enable_format_dmb" = "xyes"; then :
+
+$as_echo "#define HAVE_FORMAT_DMB 1" >>confdefs.h
+
+fi
+# EPM
+# Check whether --enable-format_epm was given.
+if test "${enable_format_epm+set}" = set; then :
+ enableval=$enable_format_epm;
+else
+ enable_format_epm=yes
+fi
+
+if test "x$enable_format_epm" = "xyes"; then :
+
+$as_echo "#define HAVE_FORMAT_EPM 1" >>confdefs.h
+
+fi
+
+ac_config_files="$ac_config_files Makefile src/Makefile lib/Makefile lib/farsync/Makefile"
+
+cat >confcache <<\_ACEOF
+# This file is a shell script that caches the results of configure
+# tests run on this system so they can be shared between configure
+# scripts and configure runs, see configure's option --config-cache.
+# It is not useful on other systems. If it contains results you don't
+# want to keep, you may remove or edit it.
+#
+# config.status only pays attention to the cache file if you give it
+# the --recheck option to rerun configure.
+#
+# `ac_cv_env_foo' variables (set or unset) will be overridden when
+# loading this file, other *unset* `ac_cv_foo' will be assigned the
+# following values.
+
+_ACEOF
+
+# The following way of writing the cache mishandles newlines in values,
+# but we know of no workaround that is simple, portable, and efficient.
+# So, we kill variables containing newlines.
+# Ultrix sh set writes to stderr and can't be redirected directly,
+# and sets the high bit in the cache file unless we assign to the vars.
+(
+ for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do
+ eval ac_val=\$$ac_var
+ case $ac_val in #(
+ *${as_nl}*)
+ case $ac_var in #(
+ *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
+$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
+ esac
+ case $ac_var in #(
+ _ | IFS | as_nl) ;; #(
+ BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
+ *) { eval $ac_var=; unset $ac_var;} ;;
+ esac ;;
+ esac
+ done
+
+ (set) 2>&1 |
+ case $as_nl`(ac_space=' '; set) 2>&1` in #(
+ *${as_nl}ac_space=\ *)
+ # `set' does not quote correctly, so add quotes: double-quote
+ # substitution turns \\\\ into \\, and sed turns \\ into \.
+ sed -n \
+ "s/'/'\\\\''/g;
+ s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
+ ;; #(
+ *)
+ # `set' quotes correctly as required by POSIX, so do not add quotes.
+ sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
+ ;;
+ esac |
+ sort
+) |
+ sed '
+ /^ac_cv_env_/b end
+ t clear
+ :clear
+ s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
+ t end
+ s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
+ :end' >>confcache
+if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
+ if test -w "$cache_file"; then
+ test "x$cache_file" != "x/dev/null" &&
+ { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5
+$as_echo "$as_me: updating cache $cache_file" >&6;}
+ cat confcache >$cache_file
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5
+$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;}
+ fi
+fi
+rm -f confcache
+
+test "x$prefix" = xNONE && prefix=$ac_default_prefix
+# Let make expand exec_prefix.
+test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
+
+DEFS=-DHAVE_CONFIG_H
+
+ac_libobjs=
+ac_ltlibobjs=
+for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
+ # 1. Remove the extension, and $U if already installed.
+ ac_script='s/\$U\././;s/\.o$//;s/\.obj$//'
+ ac_i=`$as_echo "$ac_i" | sed "$ac_script"`
+ # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR
+ # will be set to the directory where LIBOBJS objects are built.
+ as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext"
+ as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo'
+done
+LIBOBJS=$ac_libobjs
+
+LTLIBOBJS=$ac_ltlibobjs
+
+
+ if test -n "$EXEEXT"; then
+ am__EXEEXT_TRUE=
+ am__EXEEXT_FALSE='#'
+else
+ am__EXEEXT_TRUE='#'
+ am__EXEEXT_FALSE=
+fi
+
+if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then
+ as_fn_error "conditional \"AMDEP\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then
+ as_fn_error "conditional \"am__fastdepCXX\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then
+ as_fn_error "conditional \"am__fastdepCC\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${WINDOWS_TRUE}" && test -z "${WINDOWS_FALSE}"; then
+ as_fn_error "conditional \"WINDOWS\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+
+: ${CONFIG_STATUS=./config.status}
+ac_write_fail=0
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files $CONFIG_STATUS"
+{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5
+$as_echo "$as_me: creating $CONFIG_STATUS" >&6;}
+as_write_fail=0
+cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1
+#! $SHELL
+# Generated by $as_me.
+# Run this file to recreate the current configuration.
+# Compiler output produced by configure, useful for debugging
+# configure, is in config.log if it exists.
+
+debug=false
+ac_cs_recheck=false
+ac_cs_silent=false
+
+SHELL=\${CONFIG_SHELL-$SHELL}
+export SHELL
+_ASEOF
+cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1
+## -------------------- ##
+## M4sh Initialization. ##
+## -------------------- ##
+
+# Be more Bourne compatible
+DUALCASE=1; export DUALCASE # for MKS sh
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
+ emulate sh
+ NULLCMD=:
+ # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
+ # is contrary to our usage. Disable this feature.
+ alias -g '${1+"$@"}'='"$@"'
+ setopt NO_GLOB_SUBST
+else
+ case `(set -o) 2>/dev/null` in #(
+ *posix*) :
+ set -o posix ;; #(
+ *) :
+ ;;
+esac
+fi
+
+
+as_nl='
+'
+export as_nl
+# Printing a long string crashes Solaris 7 /usr/bin/printf.
+as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
+# Prefer a ksh shell builtin over an external printf program on Solaris,
+# but without wasting forks for bash or zsh.
+if test -z "$BASH_VERSION$ZSH_VERSION" \
+ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
+ as_echo='print -r --'
+ as_echo_n='print -rn --'
+elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
+ as_echo='printf %s\n'
+ as_echo_n='printf %s'
+else
+ if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
+ as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
+ as_echo_n='/usr/ucb/echo -n'
+ else
+ as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
+ as_echo_n_body='eval
+ arg=$1;
+ case $arg in #(
+ *"$as_nl"*)
+ expr "X$arg" : "X\\(.*\\)$as_nl";
+ arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
+ esac;
+ expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
+ '
+ export as_echo_n_body
+ as_echo_n='sh -c $as_echo_n_body as_echo'
+ fi
+ export as_echo_body
+ as_echo='sh -c $as_echo_body as_echo'
+fi
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+ PATH_SEPARATOR=:
+ (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
+ (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
+ PATH_SEPARATOR=';'
+ }
+fi
+
+
+# IFS
+# We need space, tab and new line, in precisely that order. Quoting is
+# there to prevent editors from complaining about space-tab.
+# (If _AS_PATH_WALK were called with IFS unset, it would disable word
+# splitting by setting IFS to empty value.)
+IFS=" "" $as_nl"
+
+# Find who we are. Look in the path if we contain no directory separator.
+case $0 in #((
+ *[\\/]* ) as_myself=$0 ;;
+ *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+ done
+IFS=$as_save_IFS
+
+ ;;
+esac
+# We did not find ourselves, most probably we were run as `sh COMMAND'
+# in which case we are not to be found in the path.
+if test "x$as_myself" = x; then
+ as_myself=$0
+fi
+if test ! -f "$as_myself"; then
+ $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+ exit 1
+fi
+
+# Unset variables that we do not need and which cause bugs (e.g. in
+# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1"
+# suppresses any "Segmentation fault" message there. '((' could
+# trigger a bug in pdksh 5.2.14.
+for as_var in BASH_ENV ENV MAIL MAILPATH
+do eval test x\${$as_var+set} = xset \
+ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
+done
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+LC_ALL=C
+export LC_ALL
+LANGUAGE=C
+export LANGUAGE
+
+# CDPATH.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+
+# as_fn_error ERROR [LINENO LOG_FD]
+# ---------------------------------
+# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
+# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
+# script with status $?, using 1 if that was 0.
+as_fn_error ()
+{
+ as_status=$?; test $as_status -eq 0 && as_status=1
+ if test "$3"; then
+ as_lineno=${as_lineno-"$2"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ $as_echo "$as_me:${as_lineno-$LINENO}: error: $1" >&$3
+ fi
+ $as_echo "$as_me: error: $1" >&2
+ as_fn_exit $as_status
+} # as_fn_error
+
+
+# as_fn_set_status STATUS
+# -----------------------
+# Set $? to STATUS, without forking.
+as_fn_set_status ()
+{
+ return $1
+} # as_fn_set_status
+
+# as_fn_exit STATUS
+# -----------------
+# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
+as_fn_exit ()
+{
+ set +e
+ as_fn_set_status $1
+ exit $1
+} # as_fn_exit
+
+# as_fn_unset VAR
+# ---------------
+# Portably unset VAR.
+as_fn_unset ()
+{
+ { eval $1=; unset $1;}
+}
+as_unset=as_fn_unset
+# as_fn_append VAR VALUE
+# ----------------------
+# Append the text in VALUE to the end of the definition contained in VAR. Take
+# advantage of any shell optimizations that allow amortized linear growth over
+# repeated appends, instead of the typical quadratic growth present in naive
+# implementations.
+if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
+ eval 'as_fn_append ()
+ {
+ eval $1+=\$2
+ }'
+else
+ as_fn_append ()
+ {
+ eval $1=\$$1\$2
+ }
+fi # as_fn_append
+
+# as_fn_arith ARG...
+# ------------------
+# Perform arithmetic evaluation on the ARGs, and store the result in the
+# global $as_val. Take advantage of shells that can avoid forks. The arguments
+# must be portable across $(()) and expr.
+if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
+ eval 'as_fn_arith ()
+ {
+ as_val=$(( $* ))
+ }'
+else
+ as_fn_arith ()
+ {
+ as_val=`expr "$@" || test $? -eq 1`
+ }
+fi # as_fn_arith
+
+
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+ test "X`expr 00001 : '.*\(...\)'`" = X001; then
+ as_expr=expr
+else
+ as_expr=false
+fi
+
+if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
+ as_basename=basename
+else
+ as_basename=false
+fi
+
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+ as_dirname=dirname
+else
+ as_dirname=false
+fi
+
+as_me=`$as_basename -- "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+ X"$0" : 'X\(//\)$' \| \
+ X"$0" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X/"$0" |
+ sed '/^.*\/\([^/][^/]*\)\/*$/{
+ s//\1/
+ q
+ }
+ /^X\/\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\/\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+ECHO_C= ECHO_N= ECHO_T=
+case `echo -n x` in #(((((
+-n*)
+ case `echo 'xy\c'` in
+ *c*) ECHO_T=' ';; # ECHO_T is single tab character.
+ xy) ECHO_C='\c';;
+ *) echo `echo ksh88 bug on AIX 6.1` > /dev/null
+ ECHO_T=' ';;
+ esac;;
+*)
+ ECHO_N='-n';;
+esac
+
+rm -f conf$$ conf$$.exe conf$$.file
+if test -d conf$$.dir; then
+ rm -f conf$$.dir/conf$$.file
+else
+ rm -f conf$$.dir
+ mkdir conf$$.dir 2>/dev/null
+fi
+if (echo >conf$$.file) 2>/dev/null; then
+ if ln -s conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s='ln -s'
+ # ... but there are two gotchas:
+ # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+ # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+ # In both cases, we have to default to `cp -p'.
+ ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+ as_ln_s='cp -p'
+ elif ln conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s=ln
+ else
+ as_ln_s='cp -p'
+ fi
+else
+ as_ln_s='cp -p'
+fi
+rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
+rmdir conf$$.dir 2>/dev/null
+
+
+# as_fn_mkdir_p
+# -------------
+# Create "$as_dir" as a directory, including parents if necessary.
+as_fn_mkdir_p ()
+{
+
+ case $as_dir in #(
+ -*) as_dir=./$as_dir;;
+ esac
+ test -d "$as_dir" || eval $as_mkdir_p || {
+ as_dirs=
+ while :; do
+ case $as_dir in #(
+ *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
+ *) as_qdir=$as_dir;;
+ esac
+ as_dirs="'$as_qdir' $as_dirs"
+ as_dir=`$as_dirname -- "$as_dir" ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$as_dir" : 'X\(//\)[^/]' \| \
+ X"$as_dir" : 'X\(//\)$' \| \
+ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_dir" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ test -d "$as_dir" && break
+ done
+ test -z "$as_dirs" || eval "mkdir $as_dirs"
+ } || test -d "$as_dir" || as_fn_error "cannot create directory $as_dir"
+
+
+} # as_fn_mkdir_p
+if mkdir -p . 2>/dev/null; then
+ as_mkdir_p='mkdir -p "$as_dir"'
+else
+ test -d ./-p && rmdir ./-p
+ as_mkdir_p=false
+fi
+
+if test -x / >/dev/null 2>&1; then
+ as_test_x='test -x'
+else
+ if ls -dL / >/dev/null 2>&1; then
+ as_ls_L_option=L
+ else
+ as_ls_L_option=
+ fi
+ as_test_x='
+ eval sh -c '\''
+ if test -d "$1"; then
+ test -d "$1/.";
+ else
+ case $1 in #(
+ -*)set "./$1";;
+ esac;
+ case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #((
+ ???[sx]*):;;*)false;;esac;fi
+ '\'' sh
+ '
+fi
+as_executable_p=$as_test_x
+
+# Sed expression to map a string onto a valid CPP name.
+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
+
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
+
+
+exec 6>&1
+## ----------------------------------- ##
+## Main body of $CONFIG_STATUS script. ##
+## ----------------------------------- ##
+_ASEOF
+test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# Save the log message, to keep $0 and so on meaningful, and to
+# report actual input values of CONFIG_FILES etc. instead of their
+# values after options handling.
+ac_log="
+This file was extended by CRC-DabMux $as_me 0.3.0.4, which was
+generated by GNU Autoconf 2.65. Invocation command line was
+
+ CONFIG_FILES = $CONFIG_FILES
+ CONFIG_HEADERS = $CONFIG_HEADERS
+ CONFIG_LINKS = $CONFIG_LINKS
+ CONFIG_COMMANDS = $CONFIG_COMMANDS
+ $ $0 $@
+
+on `(hostname || uname -n) 2>/dev/null | sed 1q`
+"
+
+_ACEOF
+
+case $ac_config_files in *"
+"*) set x $ac_config_files; shift; ac_config_files=$*;;
+esac
+
+case $ac_config_headers in *"
+"*) set x $ac_config_headers; shift; ac_config_headers=$*;;
+esac
+
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+# Files that config.status was made for.
+config_files="$ac_config_files"
+config_headers="$ac_config_headers"
+config_commands="$ac_config_commands"
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+ac_cs_usage="\
+\`$as_me' instantiates files and other configuration actions
+from templates according to the current configuration. Unless the files
+and actions are specified as TAGs, all are instantiated by default.
+
+Usage: $0 [OPTION]... [TAG]...
+
+ -h, --help print this help, then exit
+ -V, --version print version number and configuration settings, then exit
+ --config print configuration, then exit
+ -q, --quiet, --silent
+ do not print progress messages
+ -d, --debug don't remove temporary files
+ --recheck update $as_me by reconfiguring in the same conditions
+ --file=FILE[:TEMPLATE]
+ instantiate the configuration file FILE
+ --header=FILE[:TEMPLATE]
+ instantiate the configuration header FILE
+
+Configuration files:
+$config_files
+
+Configuration headers:
+$config_headers
+
+Configuration commands:
+$config_commands
+
+Report bugs to <pascal.charest@crc.ca>."
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
+ac_cs_version="\\
+CRC-DabMux config.status 0.3.0.4
+configured by $0, generated by GNU Autoconf 2.65,
+ with options \\"\$ac_cs_config\\"
+
+Copyright (C) 2009 Free Software Foundation, Inc.
+This config.status script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it."
+
+ac_pwd='$ac_pwd'
+srcdir='$srcdir'
+INSTALL='$INSTALL'
+MKDIR_P='$MKDIR_P'
+AWK='$AWK'
+test -n "\$AWK" || AWK=awk
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# The default lists apply if the user does not specify any file.
+ac_need_defaults=:
+while test $# != 0
+do
+ case $1 in
+ --*=*)
+ ac_option=`expr "X$1" : 'X\([^=]*\)='`
+ ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'`
+ ac_shift=:
+ ;;
+ *)
+ ac_option=$1
+ ac_optarg=$2
+ ac_shift=shift
+ ;;
+ esac
+
+ case $ac_option in
+ # Handling of the options.
+ -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
+ ac_cs_recheck=: ;;
+ --version | --versio | --versi | --vers | --ver | --ve | --v | -V )
+ $as_echo "$ac_cs_version"; exit ;;
+ --config | --confi | --conf | --con | --co | --c )
+ $as_echo "$ac_cs_config"; exit ;;
+ --debug | --debu | --deb | --de | --d | -d )
+ debug=: ;;
+ --file | --fil | --fi | --f )
+ $ac_shift
+ case $ac_optarg in
+ *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
+ esac
+ as_fn_append CONFIG_FILES " '$ac_optarg'"
+ ac_need_defaults=false;;
+ --header | --heade | --head | --hea )
+ $ac_shift
+ case $ac_optarg in
+ *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
+ esac
+ as_fn_append CONFIG_HEADERS " '$ac_optarg'"
+ ac_need_defaults=false;;
+ --he | --h)
+ # Conflict between --help and --header
+ as_fn_error "ambiguous option: \`$1'
+Try \`$0 --help' for more information.";;
+ --help | --hel | -h )
+ $as_echo "$ac_cs_usage"; exit ;;
+ -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+ | -silent | --silent | --silen | --sile | --sil | --si | --s)
+ ac_cs_silent=: ;;
+
+ # This is an error.
+ -*) as_fn_error "unrecognized option: \`$1'
+Try \`$0 --help' for more information." ;;
+
+ *) as_fn_append ac_config_targets " $1"
+ ac_need_defaults=false ;;
+
+ esac
+ shift
+done
+
+ac_configure_extra_args=
+
+if $ac_cs_silent; then
+ exec 6>/dev/null
+ ac_configure_extra_args="$ac_configure_extra_args --silent"
+fi
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+if \$ac_cs_recheck; then
+ set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
+ shift
+ \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6
+ CONFIG_SHELL='$SHELL'
+ export CONFIG_SHELL
+ exec "\$@"
+fi
+
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+exec 5>>config.log
+{
+ echo
+ sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
+## Running $as_me. ##
+_ASBOX
+ $as_echo "$ac_log"
+} >&5
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+#
+# INIT-COMMANDS
+#
+AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+
+# Handling of arguments.
+for ac_config_target in $ac_config_targets
+do
+ case $ac_config_target in
+ "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;;
+ "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
+ "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
+ "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;;
+ "lib/Makefile") CONFIG_FILES="$CONFIG_FILES lib/Makefile" ;;
+ "lib/farsync/Makefile") CONFIG_FILES="$CONFIG_FILES lib/farsync/Makefile" ;;
+
+ *) as_fn_error "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
+ esac
+done
+
+
+# If the user did not use the arguments to specify the items to instantiate,
+# then the envvar interface is used. Set only those that are not.
+# We use the long form for the default assignment because of an extremely
+# bizarre bug on SunOS 4.1.3.
+if $ac_need_defaults; then
+ test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
+ test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
+ test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
+fi
+
+# Have a temporary directory for convenience. Make it in the build tree
+# simply because there is no reason against having it here, and in addition,
+# creating and moving files from /tmp can sometimes cause problems.
+# Hook for its removal unless debugging.
+# Note that there is a small window in which the directory will not be cleaned:
+# after its creation but before its name has been assigned to `$tmp'.
+$debug ||
+{
+ tmp=
+ trap 'exit_status=$?
+ { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status
+' 0
+ trap 'as_fn_exit 1' 1 2 13 15
+}
+# Create a (secure) tmp directory for tmp files.
+
+{
+ tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` &&
+ test -n "$tmp" && test -d "$tmp"
+} ||
+{
+ tmp=./conf$$-$RANDOM
+ (umask 077 && mkdir "$tmp")
+} || as_fn_error "cannot create a temporary directory in ." "$LINENO" 5
+
+# Set up the scripts for CONFIG_FILES section.
+# No need to generate them if there are no CONFIG_FILES.
+# This happens for instance with `./config.status config.h'.
+if test -n "$CONFIG_FILES"; then
+
+
+ac_cr=`echo X | tr X '\015'`
+# On cygwin, bash can eat \r inside `` if the user requested igncr.
+# But we know of no other shell where ac_cr would be empty at this
+# point, so we can use a bashism as a fallback.
+if test "x$ac_cr" = x; then
+ eval ac_cr=\$\'\\r\'
+fi
+ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null`
+if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then
+ ac_cs_awk_cr='\r'
+else
+ ac_cs_awk_cr=$ac_cr
+fi
+
+echo 'BEGIN {' >"$tmp/subs1.awk" &&
+_ACEOF
+
+
+{
+ echo "cat >conf$$subs.awk <<_ACEOF" &&
+ echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' &&
+ echo "_ACEOF"
+} >conf$$subs.sh ||
+ as_fn_error "could not make $CONFIG_STATUS" "$LINENO" 5
+ac_delim_num=`echo "$ac_subst_vars" | grep -c '$'`
+ac_delim='%!_!# '
+for ac_last_try in false false false false false :; do
+ . ./conf$$subs.sh ||
+ as_fn_error "could not make $CONFIG_STATUS" "$LINENO" 5
+
+ ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X`
+ if test $ac_delim_n = $ac_delim_num; then
+ break
+ elif $ac_last_try; then
+ as_fn_error "could not make $CONFIG_STATUS" "$LINENO" 5
+ else
+ ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
+ fi
+done
+rm -f conf$$subs.sh
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+cat >>"\$tmp/subs1.awk" <<\\_ACAWK &&
+_ACEOF
+sed -n '
+h
+s/^/S["/; s/!.*/"]=/
+p
+g
+s/^[^!]*!//
+:repl
+t repl
+s/'"$ac_delim"'$//
+t delim
+:nl
+h
+s/\(.\{148\}\)..*/\1/
+t more1
+s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/
+p
+n
+b repl
+:more1
+s/["\\]/\\&/g; s/^/"/; s/$/"\\/
+p
+g
+s/.\{148\}//
+t nl
+:delim
+h
+s/\(.\{148\}\)..*/\1/
+t more2
+s/["\\]/\\&/g; s/^/"/; s/$/"/
+p
+b
+:more2
+s/["\\]/\\&/g; s/^/"/; s/$/"\\/
+p
+g
+s/.\{148\}//
+t delim
+' <conf$$subs.awk | sed '
+/^[^""]/{
+ N
+ s/\n//
+}
+' >>$CONFIG_STATUS || ac_write_fail=1
+rm -f conf$$subs.awk
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+_ACAWK
+cat >>"\$tmp/subs1.awk" <<_ACAWK &&
+ for (key in S) S_is_set[key] = 1
+ FS = ""
+
+}
+{
+ line = $ 0
+ nfields = split(line, field, "@")
+ substed = 0
+ len = length(field[1])
+ for (i = 2; i < nfields; i++) {
+ key = field[i]
+ keylen = length(key)
+ if (S_is_set[key]) {
+ value = S[key]
+ line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3)
+ len += length(value) + length(field[++i])
+ substed = 1
+ } else
+ len += 1 + keylen
+ }
+
+ print line
+}
+
+_ACAWK
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then
+ sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g"
+else
+ cat
+fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \
+ || as_fn_error "could not setup config files machinery" "$LINENO" 5
+_ACEOF
+
+# VPATH may cause trouble with some makes, so we remove $(srcdir),
+# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
+# trailing colons and then remove the whole line if VPATH becomes empty
+# (actually we leave an empty line to preserve line numbers).
+if test "x$srcdir" = x.; then
+ ac_vpsub='/^[ ]*VPATH[ ]*=/{
+s/:*\$(srcdir):*/:/
+s/:*\${srcdir}:*/:/
+s/:*@srcdir@:*/:/
+s/^\([^=]*=[ ]*\):*/\1/
+s/:*$//
+s/^[^=]*=[ ]*$//
+}'
+fi
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+fi # test -n "$CONFIG_FILES"
+
+# Set up the scripts for CONFIG_HEADERS section.
+# No need to generate them if there are no CONFIG_HEADERS.
+# This happens for instance with `./config.status Makefile'.
+if test -n "$CONFIG_HEADERS"; then
+cat >"$tmp/defines.awk" <<\_ACAWK ||
+BEGIN {
+_ACEOF
+
+# Transform confdefs.h into an awk script `defines.awk', embedded as
+# here-document in config.status, that substitutes the proper values into
+# config.h.in to produce config.h.
+
+# Create a delimiter string that does not exist in confdefs.h, to ease
+# handling of long lines.
+ac_delim='%!_!# '
+for ac_last_try in false false :; do
+ ac_t=`sed -n "/$ac_delim/p" confdefs.h`
+ if test -z "$ac_t"; then
+ break
+ elif $ac_last_try; then
+ as_fn_error "could not make $CONFIG_HEADERS" "$LINENO" 5
+ else
+ ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
+ fi
+done
+
+# For the awk script, D is an array of macro values keyed by name,
+# likewise P contains macro parameters if any. Preserve backslash
+# newline sequences.
+
+ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]*
+sed -n '
+s/.\{148\}/&'"$ac_delim"'/g
+t rset
+:rset
+s/^[ ]*#[ ]*define[ ][ ]*/ /
+t def
+d
+:def
+s/\\$//
+t bsnl
+s/["\\]/\\&/g
+s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\
+D["\1"]=" \3"/p
+s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p
+d
+:bsnl
+s/["\\]/\\&/g
+s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\
+D["\1"]=" \3\\\\\\n"\\/p
+t cont
+s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p
+t cont
+d
+:cont
+n
+s/.\{148\}/&'"$ac_delim"'/g
+t clear
+:clear
+s/\\$//
+t bsnlc
+s/["\\]/\\&/g; s/^/"/; s/$/"/p
+d
+:bsnlc
+s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p
+b cont
+' <confdefs.h | sed '
+s/'"$ac_delim"'/"\\\
+"/g' >>$CONFIG_STATUS || ac_write_fail=1
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ for (key in D) D_is_set[key] = 1
+ FS = ""
+}
+/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ {
+ line = \$ 0
+ split(line, arg, " ")
+ if (arg[1] == "#") {
+ defundef = arg[2]
+ mac1 = arg[3]
+ } else {
+ defundef = substr(arg[1], 2)
+ mac1 = arg[2]
+ }
+ split(mac1, mac2, "(") #)
+ macro = mac2[1]
+ prefix = substr(line, 1, index(line, defundef) - 1)
+ if (D_is_set[macro]) {
+ # Preserve the white space surrounding the "#".
+ print prefix "define", macro P[macro] D[macro]
+ next
+ } else {
+ # Replace #undef with comments. This is necessary, for example,
+ # in the case of _POSIX_SOURCE, which is predefined and required
+ # on some systems where configure will not decide to define it.
+ if (defundef == "undef") {
+ print "/*", prefix defundef, macro, "*/"
+ next
+ }
+ }
+}
+{ print }
+_ACAWK
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+ as_fn_error "could not setup config headers machinery" "$LINENO" 5
+fi # test -n "$CONFIG_HEADERS"
+
+
+eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS"
+shift
+for ac_tag
+do
+ case $ac_tag in
+ :[FHLC]) ac_mode=$ac_tag; continue;;
+ esac
+ case $ac_mode$ac_tag in
+ :[FHL]*:*);;
+ :L* | :C*:*) as_fn_error "invalid tag \`$ac_tag'" "$LINENO" 5;;
+ :[FH]-) ac_tag=-:-;;
+ :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
+ esac
+ ac_save_IFS=$IFS
+ IFS=:
+ set x $ac_tag
+ IFS=$ac_save_IFS
+ shift
+ ac_file=$1
+ shift
+
+ case $ac_mode in
+ :L) ac_source=$1;;
+ :[FH])
+ ac_file_inputs=
+ for ac_f
+ do
+ case $ac_f in
+ -) ac_f="$tmp/stdin";;
+ *) # Look for the file first in the build tree, then in the source tree
+ # (if the path is not absolute). The absolute path cannot be DOS-style,
+ # because $ac_f cannot contain `:'.
+ test -f "$ac_f" ||
+ case $ac_f in
+ [\\/$]*) false;;
+ *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
+ esac ||
+ as_fn_error "cannot find input file: \`$ac_f'" "$LINENO" 5;;
+ esac
+ case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac
+ as_fn_append ac_file_inputs " '$ac_f'"
+ done
+
+ # Let's still pretend it is `configure' which instantiates (i.e., don't
+ # use $as_me), people would be surprised to read:
+ # /* config.h. Generated by config.status. */
+ configure_input='Generated from '`
+ $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g'
+ `' by configure.'
+ if test x"$ac_file" != x-; then
+ configure_input="$ac_file. $configure_input"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5
+$as_echo "$as_me: creating $ac_file" >&6;}
+ fi
+ # Neutralize special characters interpreted by sed in replacement strings.
+ case $configure_input in #(
+ *\&* | *\|* | *\\* )
+ ac_sed_conf_input=`$as_echo "$configure_input" |
+ sed 's/[\\\\&|]/\\\\&/g'`;; #(
+ *) ac_sed_conf_input=$configure_input;;
+ esac
+
+ case $ac_tag in
+ *:-:* | *:-) cat >"$tmp/stdin" \
+ || as_fn_error "could not create $ac_file" "$LINENO" 5 ;;
+ esac
+ ;;
+ esac
+
+ ac_dir=`$as_dirname -- "$ac_file" ||
+$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$ac_file" : 'X\(//\)[^/]' \| \
+ X"$ac_file" : 'X\(//\)$' \| \
+ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$ac_file" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ as_dir="$ac_dir"; as_fn_mkdir_p
+ ac_builddir=.
+
+case "$ac_dir" in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
+ ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
+ # A ".." for each directory in $ac_dir_suffix.
+ ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
+ case $ac_top_builddir_sub in
+ "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
+ *) ac_top_build_prefix=$ac_top_builddir_sub/ ;;
+ esac ;;
+esac
+ac_abs_top_builddir=$ac_pwd
+ac_abs_builddir=$ac_pwd$ac_dir_suffix
+# for backward compatibility:
+ac_top_builddir=$ac_top_build_prefix
+
+case $srcdir in
+ .) # We are building in place.
+ ac_srcdir=.
+ ac_top_srcdir=$ac_top_builddir_sub
+ ac_abs_top_srcdir=$ac_pwd ;;
+ [\\/]* | ?:[\\/]* ) # Absolute name.
+ ac_srcdir=$srcdir$ac_dir_suffix;
+ ac_top_srcdir=$srcdir
+ ac_abs_top_srcdir=$srcdir ;;
+ *) # Relative name.
+ ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
+ ac_top_srcdir=$ac_top_build_prefix$srcdir
+ ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
+esac
+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
+
+
+ case $ac_mode in
+ :F)
+ #
+ # CONFIG_FILE
+ #
+
+ case $INSTALL in
+ [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
+ *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;;
+ esac
+ ac_MKDIR_P=$MKDIR_P
+ case $MKDIR_P in
+ [\\/$]* | ?:[\\/]* ) ;;
+ */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;;
+ esac
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# If the template does not know about datarootdir, expand it.
+# FIXME: This hack should be removed a few years after 2.60.
+ac_datarootdir_hack=; ac_datarootdir_seen=
+ac_sed_dataroot='
+/datarootdir/ {
+ p
+ q
+}
+/@datadir@/p
+/@docdir@/p
+/@infodir@/p
+/@localedir@/p
+/@mandir@/p'
+case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in
+*datarootdir*) ac_datarootdir_seen=yes;;
+*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
+$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ ac_datarootdir_hack='
+ s&@datadir@&$datadir&g
+ s&@docdir@&$docdir&g
+ s&@infodir@&$infodir&g
+ s&@localedir@&$localedir&g
+ s&@mandir@&$mandir&g
+ s&\\\${datarootdir}&$datarootdir&g' ;;
+esac
+_ACEOF
+
+# Neutralize VPATH when `$srcdir' = `.'.
+# Shell code in configure.ac might set extrasub.
+# FIXME: do we really want to maintain this feature?
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ac_sed_extra="$ac_vpsub
+$extrasub
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+:t
+/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
+s|@configure_input@|$ac_sed_conf_input|;t t
+s&@top_builddir@&$ac_top_builddir_sub&;t t
+s&@top_build_prefix@&$ac_top_build_prefix&;t t
+s&@srcdir@&$ac_srcdir&;t t
+s&@abs_srcdir@&$ac_abs_srcdir&;t t
+s&@top_srcdir@&$ac_top_srcdir&;t t
+s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t
+s&@builddir@&$ac_builddir&;t t
+s&@abs_builddir@&$ac_abs_builddir&;t t
+s&@abs_top_builddir@&$ac_abs_top_builddir&;t t
+s&@INSTALL@&$ac_INSTALL&;t t
+s&@MKDIR_P@&$ac_MKDIR_P&;t t
+$ac_datarootdir_hack
+"
+eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$tmp/subs.awk" >$tmp/out \
+ || as_fn_error "could not create $ac_file" "$LINENO" 5
+
+test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
+ { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } &&
+ { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } &&
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined. Please make sure it is defined." >&5
+$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined. Please make sure it is defined." >&2;}
+
+ rm -f "$tmp/stdin"
+ case $ac_file in
+ -) cat "$tmp/out" && rm -f "$tmp/out";;
+ *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";;
+ esac \
+ || as_fn_error "could not create $ac_file" "$LINENO" 5
+ ;;
+ :H)
+ #
+ # CONFIG_HEADER
+ #
+ if test x"$ac_file" != x-; then
+ {
+ $as_echo "/* $configure_input */" \
+ && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs"
+ } >"$tmp/config.h" \
+ || as_fn_error "could not create $ac_file" "$LINENO" 5
+ if diff "$ac_file" "$tmp/config.h" >/dev/null 2>&1; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5
+$as_echo "$as_me: $ac_file is unchanged" >&6;}
+ else
+ rm -f "$ac_file"
+ mv "$tmp/config.h" "$ac_file" \
+ || as_fn_error "could not create $ac_file" "$LINENO" 5
+ fi
+ else
+ $as_echo "/* $configure_input */" \
+ && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" \
+ || as_fn_error "could not create -" "$LINENO" 5
+ fi
+# Compute "$ac_file"'s index in $config_headers.
+_am_arg="$ac_file"
+_am_stamp_count=1
+for _am_header in $config_headers :; do
+ case $_am_header in
+ $_am_arg | $_am_arg:* )
+ break ;;
+ * )
+ _am_stamp_count=`expr $_am_stamp_count + 1` ;;
+ esac
+done
+echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" ||
+$as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$_am_arg" : 'X\(//\)[^/]' \| \
+ X"$_am_arg" : 'X\(//\)$' \| \
+ X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$_am_arg" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`/stamp-h$_am_stamp_count
+ ;;
+
+ :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5
+$as_echo "$as_me: executing $ac_file commands" >&6;}
+ ;;
+ esac
+
+
+ case $ac_file$ac_mode in
+ "depfiles":C) test x"$AMDEP_TRUE" != x"" || {
+ # Autoconf 2.62 quotes --file arguments for eval, but not when files
+ # are listed without --file. Let's play safe and only enable the eval
+ # if we detect the quoting.
+ case $CONFIG_FILES in
+ *\'*) eval set x "$CONFIG_FILES" ;;
+ *) set x $CONFIG_FILES ;;
+ esac
+ shift
+ for mf
+ do
+ # Strip MF so we end up with the name of the file.
+ mf=`echo "$mf" | sed -e 's/:.*$//'`
+ # Check whether this is an Automake generated Makefile or not.
+ # We used to match only the files named `Makefile.in', but
+ # some people rename them; so instead we look at the file content.
+ # Grep'ing the first line is not enough: some people post-process
+ # each Makefile.in and add a new line on top of each file to say so.
+ # Grep'ing the whole file is not good either: AIX grep has a line
+ # limit of 2048, but all sed's we know have understand at least 4000.
+ if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
+ dirpart=`$as_dirname -- "$mf" ||
+$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$mf" : 'X\(//\)[^/]' \| \
+ X"$mf" : 'X\(//\)$' \| \
+ X"$mf" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$mf" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ else
+ continue
+ fi
+ # Extract the definition of DEPDIR, am__include, and am__quote
+ # from the Makefile without running `make'.
+ DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
+ test -z "$DEPDIR" && continue
+ am__include=`sed -n 's/^am__include = //p' < "$mf"`
+ test -z "am__include" && continue
+ am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
+ # When using ansi2knr, U may be empty or an underscore; expand it
+ U=`sed -n 's/^U = //p' < "$mf"`
+ # Find all dependency output files, they are included files with
+ # $(DEPDIR) in their names. We invoke sed twice because it is the
+ # simplest approach to changing $(DEPDIR) to its actual value in the
+ # expansion.
+ for file in `sed -n "
+ s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
+ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
+ # Make sure the directory exists.
+ test -f "$dirpart/$file" && continue
+ fdir=`$as_dirname -- "$file" ||
+$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$file" : 'X\(//\)[^/]' \| \
+ X"$file" : 'X\(//\)$' \| \
+ X"$file" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$file" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ as_dir=$dirpart/$fdir; as_fn_mkdir_p
+ # echo "creating $dirpart/$file"
+ echo '# dummy' > "$dirpart/$file"
+ done
+ done
+}
+ ;;
+
+ esac
+done # for ac_tag
+
+
+as_fn_exit 0
+_ACEOF
+ac_clean_files=$ac_clean_files_save
+
+test $ac_write_fail = 0 ||
+ as_fn_error "write failure creating $CONFIG_STATUS" "$LINENO" 5
+
+
+# configure is writing to config.log, and then calls config.status.
+# config.status does its own redirection, appending to config.log.
+# Unfortunately, on DOS this fails, as config.log is still kept open
+# by configure, so config.status won't be able to write to it; its
+# output is simply discarded. So we exec the FD to /dev/null,
+# effectively closing config.log, so it can be properly (re)opened and
+# appended to by config.status. When coming back to configure, we
+# need to make the FD available again.
+if test "$no_create" != yes; then
+ ac_cs_success=:
+ ac_config_status_args=
+ test "$silent" = yes &&
+ ac_config_status_args="$ac_config_status_args --quiet"
+ exec 5>/dev/null
+ $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false
+ exec 5>>config.log
+ # Use ||, not &&, to avoid exiting from the if with $? = 1, which
+ # would make configure fail if this is the last instruction.
+ $ac_cs_success || as_fn_exit $?
+fi
+if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5
+$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
+fi
+
+
+echo
+echo "***********************************************"
+echo
+echo "Inputs:"
+enabled=""
+disabled=""
+for output in prbs test slip udp fifo file
+do
+ eval var=\$enable_input_$output
+ if test "x$var" = "xyes"; then :
+ enabled="$enabled $output"
+else
+ disabled="$disabled $output"
+fi
+done
+echo " Enabled: $enabled"
+echo " Disabled: $disabled"
+
+echo
+echo "Formats:"
+enabled=""
+disabled=""
+for format in raw bridge mpeg packet dabplus dmb epm
+do
+ eval var=\$enable_format_$format
+ if test "x$var" = "xyes"; then :
+ enabled="$enabled $format"
+else
+ disabled="$disabled $format"
+fi
+done
+echo " Enabled: $enabled"
+echo " Disabled: $disabled"
+
+echo
+echo "Outputs:"
+enabled=""
+disabled=""
+for output in file fifo udp tcp raw simul
+do
+ eval var=\$enable_output_$output
+ if test "x$var" = "xyes"; then :
+ enabled="$enabled $output"
+else
+ disabled="$disabled $output"
+fi
+done
+echo " Enabled: $enabled"
+echo " Disabled: $disabled"
+
+echo
+echo "***********************************************"
+echo
diff --git a/configure.ac b/configure.ac
new file mode 100644
index 0000000..48d0c3b
--- /dev/null
+++ b/configure.ac
@@ -0,0 +1,272 @@
+# Copyright (C) 2008, 2009 Her Majesty the Queen in Right of Canada
+# (Communications Research Center Canada)
+
+# This file is part of CRC-DabMux.
+#
+# CRC-DabMux is free software: you can 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.
+#
+# CRC-DabMux is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with CRC-DabMux. If not, see <http://www.gnu.org/licenses/>.
+
+AC_PREREQ(2.61)
+AC_INIT([CRC-DabMux], [0.3.0.4], [pascal.charest@crc.ca])
+AC_CONFIG_AUX_DIR([build-aux])
+AC_CANONICAL_SYSTEM
+AM_INIT_AUTOMAKE([-Wall])
+AC_CONFIG_SRCDIR([src/DabMux.cpp])
+AC_CONFIG_HEADER([config.h])
+
+case $host in
+*linux*)
+ case $target_cpu in
+ x86_64)
+ AC_DEFINE([__64BIT__], [], [__16BIT__, __32BIT__])
+ ;;
+ *)
+ AC_DEFINE([__32BIT__], [], [__16BIT__, __64BIT__])
+ AC_SUBST([BUILD_TARGET], ["CC='gcc -m32' CXX='g++ -m32' --target=i686"])
+ flags="-m32"
+ esac
+ ;;
+*)
+ AC_DEFINE([__32BIT__], [], [__16BIT__, __64BIT__])
+ AC_SUBST([GETOPT], ["xgetopt.cpp xgetopt.h"])
+ AC_SUBST([WSOCK32], ["-lwsock32"])
+ AC_SUBST([BUILD_HOST], ["--host i386-mingw32msvc"])
+esac
+
+# Checks for programs.
+AC_PROG_CXX
+AC_PROG_CC
+AM_PROG_CC_C_O
+AC_PROG_INSTALL
+
+# Checks for libraries.
+# FIXME: Replace `main' with a function in `-lfec':
+#AC_CHECK_LIB([fec], [init_rs_char], [], AC_MSG_ERROR([libfec is required]))
+# FIXME: Replace `main' with a function in `-lpthread':
+AC_CHECK_LIB([pthread], [pthread_create], [], AC_MSG_ERROR([libpthread is required]))
+
+# Checks for header files.
+AC_MSG_CHECKING([for OS type])
+AC_PREPROC_IFELSE(
+ [AC_LANG_SOURCE([
+#ifndef _WIN32
+#error windows
+#endif
+ ])],
+ [OS=windows],
+ [OS=linux]
+ )
+AC_MSG_RESULT([$OS])
+AM_CONDITIONAL([WINDOWS], [test "x$OS" == "xwindows"])
+AC_SUBST([FARSYNC_DIR], ['$(top_srcdir)/lib/farsync/'$OS])
+
+AC_HEADER_STDC
+AC_HEADER_SYS_WAIT
+AC_CHECK_HEADERS([arpa/inet.h fcntl.h limits.h netdb.h netinet/in.h stddef.h stdint.h stdlib.h string.h sys/ioctl.h sys/socket.h sys/time.h unistd.h])
+
+# Checks for typedefs, structures, and compiler characteristics.
+AC_HEADER_STDBOOL
+AC_C_CONST
+AC_TYPE_SIZE_T
+AC_TYPE_SSIZE_T
+AC_HEADER_TIME
+AC_STRUCT_TM
+AC_TYPE_UINT16_T
+AC_TYPE_UINT32_T
+AC_TYPE_UINT8_T
+AC_C_VOLATILE
+
+# Checks for library functions.
+AC_PROG_GCC_TRADITIONAL
+AC_FUNC_MALLOC
+AC_FUNC_MEMCMP
+AC_FUNC_REALLOC
+AC_TYPE_SIGNAL
+AC_FUNC_VPRINTF
+AC_CHECK_FUNCS([bzero gethostbyname gettimeofday inet_ntoa memchr memmove memset socket strchr strdup strerror strrchr strstr strtol strtoul])
+
+# Options
+# Inputs
+# PRBS
+AC_ARG_ENABLE([input_prbs],
+ [AS_HELP_STRING([--disable-input-prbs], [Disable PRBS input])],
+ [], [enable_input_prbs=yes])
+AS_IF([test "x$enable_input_prbs" = "xyes"],
+ [AC_DEFINE(HAVE_INPUT_PRBS, [1], [Define if PRBS input is enabled])])
+# TEST
+AC_ARG_ENABLE([input_test],
+ [AS_HELP_STRING([--disable-input-test], [Disable TEST input])],
+ [], [enable_input_test=yes])
+AS_IF([test "x$enable_input_test" = "xyes"],
+ [AC_DEFINE(HAVE_INPUT_TEST, [1], [Define if TEST input is enabled])])
+# SLIP
+AC_ARG_ENABLE([input_slip],
+ [AS_HELP_STRING([--disable-input-slip], [Disable SLIP input])],
+ [], [enable_input_slip=yes])
+AS_IF([test "x$enable_input_slip" = "xyes"],
+ [AC_DEFINE(HAVE_INPUT_SLIP, [1], [Define if SLIP input is enabled])])
+# UDP
+AC_ARG_ENABLE([input_udp],
+ [AS_HELP_STRING([--disable-input-udp], [Disable UDP input])],
+ [], [enable_input_udp=yes])
+AS_IF([test "x$enable_input_udp" = "xyes"],
+ [AC_DEFINE(HAVE_INPUT_UDP, [1], [Define if UDP input is enabled])])
+# FIFO
+AC_ARG_ENABLE([input_fifo],
+ [AS_HELP_STRING([--disable-input-fifo], [Disable FIFO input])],
+ [], [enable_input_fifo=yes])
+AS_IF([test "x$enable_input_fifo" = "xyes"],
+ [AC_DEFINE(HAVE_INPUT_FIFO, [1], [Define if FIFO input is enabled])])
+# FILE
+AC_ARG_ENABLE([input_file],
+ [AS_HELP_STRING([--disable-input-file], [Disable FILE input])],
+ [], [enable_input_file=yes])
+AS_IF([test "x$enable_input_file" = "xyes"],
+ [AC_DEFINE(HAVE_INPUT_FILE, [1], [Define if FILE input is enabled])])
+
+# Outputs
+# FILE
+AC_ARG_ENABLE([output_file],
+ [AS_HELP_STRING([--disable-output-file], [Disable FILE output])],
+ [], [enable_output_file=yes])
+AS_IF([test "x$enable_output_file" = "xyes"],
+ [AC_DEFINE(HAVE_OUTPUT_FILE, [1], [Define if FILE output is enabled])])
+# FIFO
+AC_ARG_ENABLE([output_fifo],
+ [AS_HELP_STRING([--disable-output-fifo], [Disable FIFO output])],
+ [], [enable_output_fifo=yes])
+AS_IF([test "x$enable_output_fifo" = "xyes"],
+ [AC_DEFINE(HAVE_OUTPUT_FIFO, [1], [Define if FIFO output is enabled])])
+# UDP
+AC_ARG_ENABLE([output_udp],
+ [AS_HELP_STRING([--disable-output-udp], [Disable UDP output])],
+ [], [enable_output_udp=yes])
+AS_IF([test "x$enable_output_udp" = "xyes"],
+ [AC_DEFINE(HAVE_OUTPUT_UDP, [1], [Define if UDP output is enabled])])
+# TCP
+AC_ARG_ENABLE([output_tcp],
+ [AS_HELP_STRING([--disable-output-tcp], [Disable TCP output])],
+ [], [enable_output_tcp=yes])
+AS_IF([test "x$enable_output_tcp" = "xyes"],
+ [AC_DEFINE(HAVE_OUTPUT_TCP, [1], [Define if TCP output is enabled])])
+# RAW
+AC_ARG_ENABLE([output_raw],
+ [AS_HELP_STRING([--disable-output-raw], [Disable RAW output])],
+ [], [enable_output_raw=yes])
+AS_IF([test "x$enable_output_raw" = "xyes"],
+ [AC_DEFINE(HAVE_OUTPUT_RAW, [1], [Define if RAW output is enabled])])
+# SIMUL
+AC_ARG_ENABLE([output_simul],
+ [AS_HELP_STRING([--disable-output-simul], [Disable SIMUL output])],
+ [], [enable_output_simul=yes])
+AS_IF([test "x$enable_output_simul" = "xyes"],
+ [AC_DEFINE(HAVE_OUTPUT_SIMUL, [1], [Define if SIMUL output is enabled])])
+
+# Formats
+# RAW
+AC_ARG_ENABLE([format_raw],
+ [AS_HELP_STRING([--disable-format-raw], [Disable RAW format])],
+ [], [enable_format_raw=yes])
+AS_IF([test "x$enable_format_raw" = "xyes"],
+ [AC_DEFINE(HAVE_FORMAT_RAW, [1], [Define if RAW format is enabled])])
+# BRIDGE
+AC_ARG_ENABLE([format_bridge],
+ [AS_HELP_STRING([--disable-format-bridge], [Disable BRIDGE format])],
+ [], [enable_format_bridge=yes])
+AS_IF([test "x$enable_format_bridge" = "xyes"],
+ [AC_DEFINE(HAVE_FORMAT_BRIDGE, [1], [Define if BRIDGE format is enabled])])
+# MPEG
+AC_ARG_ENABLE([format_mpeg],
+ [AS_HELP_STRING([--disable-format-mpeg], [Disable MPEG format])],
+ [], [enable_format_mpeg=yes])
+AS_IF([test "x$enable_format_mpeg" = "xyes"],
+ [AC_DEFINE(HAVE_FORMAT_MPEG, [1], [Define if MPEG format is enabled])])
+# PACKET
+AC_ARG_ENABLE([format_packet],
+ [AS_HELP_STRING([--disable-format-packet], [Disable PACKET format])],
+ [], [enable_format_packet=yes])
+AS_IF([test "x$enable_format_packet" = "xyes"],
+ [AC_DEFINE(HAVE_FORMAT_PACKET, [1], [Define if PACKET format is enabled])])
+# DABPLUS
+AC_ARG_ENABLE([format_dabplus],
+ [AS_HELP_STRING([--disable-format-dabplus], [Disable DABPLUS format])],
+ [], [enable_format_dabplus=yes])
+AS_IF([test "x$enable_format_dabplus" = "xyes"],
+ [AC_DEFINE(HAVE_FORMAT_DABPLUS, [1], [Define if DABPLUS format is enabled])])
+# DMB
+AC_ARG_ENABLE([format_dmb],
+ [AS_HELP_STRING([--disable-format-dmb], [Disable DMB format])],
+ [], [enable_format_dmb=yes])
+AS_IF([test "x$enable_format_dmb" = "xyes"],
+ [AC_DEFINE(HAVE_FORMAT_DMB, [1], [Define if DMB format is enabled])])
+# EPM
+AC_ARG_ENABLE([format_epm],
+ [AS_HELP_STRING([--disable-format-epm], [Disable EPM format])],
+ [], [enable_format_epm=yes])
+AS_IF([test "x$enable_format_epm" = "xyes"],
+ [AC_DEFINE(HAVE_FORMAT_EPM, [1], [Define if EPM format is enabled])])
+
+AC_CONFIG_FILES([Makefile
+ src/Makefile
+ lib/Makefile
+ lib/farsync/Makefile
+ ])
+AC_OUTPUT
+
+echo
+echo "***********************************************"
+echo
+echo "Inputs:"
+enabled=""
+disabled=""
+for output in prbs test slip udp fifo file
+do
+ eval var=\$enable_input_$output
+ AS_IF([test "x$var" = "xyes"],
+ [enabled="$enabled $output"],
+ [disabled="$disabled $output"])
+done
+echo " Enabled: $enabled"
+echo " Disabled: $disabled"
+
+echo
+echo "Formats:"
+enabled=""
+disabled=""
+for format in raw bridge mpeg packet dabplus dmb epm
+do
+ eval var=\$enable_format_$format
+ AS_IF([test "x$var" = "xyes"],
+ [enabled="$enabled $format"],
+ [disabled="$disabled $format"])
+done
+echo " Enabled: $enabled"
+echo " Disabled: $disabled"
+
+echo
+echo "Outputs:"
+enabled=""
+disabled=""
+for output in file fifo udp tcp raw simul
+do
+ eval var=\$enable_output_$output
+ AS_IF([test "x$var" = "xyes"],
+ [enabled="$enabled $output"],
+ [disabled="$disabled $output"])
+done
+echo " Enabled: $enabled"
+echo " Disabled: $disabled"
+
+echo
+echo "***********************************************"
+echo
diff --git a/doc/CVS/Entries b/doc/CVS/Entries
new file mode 100644
index 0000000..c5e13a7
--- /dev/null
+++ b/doc/CVS/Entries
@@ -0,0 +1,2 @@
+/DabMux.1/1.3/Thu Jul 22 14:50:01 2010//
+D
diff --git a/doc/CVS/Repository b/doc/CVS/Repository
new file mode 100644
index 0000000..3ae78ec
--- /dev/null
+++ b/doc/CVS/Repository
@@ -0,0 +1 @@
+crc-dabmux/doc
diff --git a/doc/CVS/Root b/doc/CVS/Root
new file mode 100644
index 0000000..9e5f945
--- /dev/null
+++ b/doc/CVS/Root
@@ -0,0 +1 @@
+:pserver:pascal@mmlab.dgbt.crc.ca:/home/cvsroot
diff --git a/doc/DabMux.1 b/doc/DabMux.1
new file mode 100644
index 0000000..a20e845
--- /dev/null
+++ b/doc/DabMux.1
@@ -0,0 +1,584 @@
+.\" Process this file with
+.\" groff -t -man -Tascii DabMux.1
+.\" groff -t -man DabMux.1 > DabMux.ps
+.\"
+.TH CRC-DABMUX 1 "2006-2010" "\(co Communications Research Centre Canada" "User Manual"
+.SH NAME
+crc-dabmux \- A software DAB multiplexer
+
+.SH SYNOPSIS
+.B crc-dabmux
+.BI [ ensemble ]
+.BI [ "subchannel1 subchannel2 ..." ]
+.BI [ "service1 component1 " [ "component2 ..." ] " service2 ..."]
+.BI [ output1 ... ]
+.B [-h]
+.BI [-m " mode"]
+.BI [-n " nbFrames"]
+.B [-V]
+.B [-z]
+
+.SS ensemble
+.BI [-i " ensembleId"]
+.BI [-L " label"]
+.BI [-l " sLabel"]
+
+.SS subchannel
+.B -(A | B | D | E | F | M | P | T)
+.I inputName
+.BI [-b " bitrate"]
+.BI [-i " subchannelId"]
+.BB [-k]
+.BI [-p " protection"]
+
+.SS service
+.B -S
+.BI [-g " language"]
+.BI [-i " serviceId"]
+.BI [-L " label"]
+.BI [-l " sLabel"]
+.BI [-y " PTy"]
+
+.SS component
+.B -C
+.BI [-a " address"]
+.B [-d]
+.BI [-f " figType"]
+.BI [-i " subchannelId"]
+.BI [-L " label"]
+.BI [-l " sLabel"]
+.BI [-t " packetType"]
+
+.SS output
+.BI -O " outputName"
+
+.SH DESCRIPTION
+CRC-DABMUX is a software multiplexer that generates an ETI stream from audio and data streams. Because of its software based architecture, many typical DAB services can be generated and multiplexed on a single PC platform with live or pre-recorded sources.
+
+A DAB multiplex configuration is composed of one ensemble. An ensemble is the entity that receivers tune to and process. An ensemble contains several services. A service is the listener-selectable output. Each service contains one mandatory service component which is called primary component. An audio primary component define a program service while a data primary component define a data service. Service can contain additional components which are called secondary components. Maximum total number of components is 12 for program services and 11 for data services. A service component is a link to one subchannel (or Fast Information Data Channel). A subchannel is the physical space used within the common interleaved frame.
+
+.bp
+.KS
+.cs R 20
+.ps -1
+.nf
+ __________________________________________________
+ | CRC-Ensemble | ENSEMBLE
+ |__________________________________________________|
+ | | |
+ | | |
+ _______V______ _______V______ _______V______
+ | CRC-Service1 | | CRC-Service2 | | CRC-Service3 | SERVICES
+ |______________| |______________| |______________|
+ | | | | |______ |
+ | | | | | |
+ __V__ __V__ __V__ __V__ __V__ __V__
+ | SC1 | | SC2 | | SC3 | | SC4 | | SC5 | | SC6 | SERVICE
+ |_____| |_____| |_____| |_____| |_____| |_____| COMPONENTS
+ | | _____| | | ____|
+ | | | | | |
+ _________________ __V________V__V______________V________V___V_______ COMMON
+| MCI | SI | FIDC | | SubCh1 | SubCh9 | ... | SubCh3 | SubCh60 | ... | INTERLEAVED
+|_____|____|______| |________|________|_______|________|_________|_____| FRAME
+Fast Information Ch. Main Service Channel
+.fi
+.ps
+.cs R
+
+.I Figure 1: An example of a DAB multiplex
+.KE
+
+.SH OPTIONS
+.
+.SS GENERAL
+.TP
+.B -h
+get this help
+.
+.TP
+.BI -m " mode"
+DAB mode (default: 2)
+.
+.TP
+.BI -n " nbFrames"
+number of frames to produce (default: infinite)
+.
+.TP
+.B -o
+turn on log facility on TCP port 12222
+.
+.TP
+.B -V
+print version information, included input/output/format and exit
+.
+.TP
+.B -z
+write SCCA field for old Factum ETI analyzer
+
+.SS INPUT
+One of the following option must be used:
+.TP
+.BI -A " inputName"
+set audio input with MPEG-1/2 layer II file
+.I inputName
+input file
+.
+.TP
+.BI -B " inputName"
+set CRC-Bridge stream data input with UDP input address
+.I inputName.
+Format is
+.BI [ address ]: port
+.
+.TP
+.BI -D " inputName"
+set raw stream data input with UDP input address
+.I inputName.
+Format is
+.BI [ address ]: port
+.
+.TP
+.BI -E " inputName"
+set enhanced packet input
+.
+.TP
+.BI -F " inputName"
+set audio input with DAB+ file (AAC + RS + interleaver)
+.I inputName
+input file
+.
+.TP
+.BI -M " inputName"
+set DMB input
+.
+.TP
+.BI -P " inputName"
+set packet input
+.
+.TP
+.B -T
+set test input
+
+.SS ENSEMBLE, SUBCHANNEL, SERVICE AND SERVICE COMPONENTS OPTIONS
+.TP
+.BI -a " address"
+packet address (default: 0x200 + <n> (512))
+.
+.TP
+.BI -b " bitrate"
+bitrate (in kbits/s) of the subchannel (default: audio 1st frame, data 384, packet 32)
+.
+.TP
+.B -d
+turn on datagroups in packet mode
+.
+.TP
+.BI -f " figType"
+user application type in FIG 0/13 for packet mode
+.
+.TP
+.BI -g " language"
+Primary service component language: english=9, french=15
+.
+.TP
+.BI -i " id"
+.IR service | subchannel | serviceComponent
+id of ensemble, service <n>, subchannel <n> or service component <n> (default: <n>)
+.
+.TP
+.B -k
+set non-blocking file input (audio and packet only)
+.
+.TP
+.BI -L " label"
+label of service <n> (default: CRC-Audio<n>)
+.
+.TP
+.BI -l " sLabel"
+short label flag of service <n>. Format is either numerical or a character string. (default: 0xf040)
+.
+.TP
+.BI -p " protection"
+protection level (default: 3)
+.
+.TP
+.BI -t " type"
+.br
+audio/data service component type (default: 0)
+.br
+audio: foreground=0, background=1, multi-channel=2
+.br
+data: unspecified=0, TMC=1, EWS=2, ITTS=3, paging=4, TDC=5, IP=59, MOT=60, proprietary=61
+.
+.TP
+.BI -y " PTy"
+Primary service component program type international code
+
+.SS OUTPUT
+.TP
+.BI -O " outputName"
+name of the output in URL format, i.e.
+.IR scheme ://[ address ][: port ][ path ][? query ]
+where
+.I scheme
+is
+.RI ( raw | udp | tcp | file | fifo | simul )
+
+.SH USAGE
+A multiplex configuration is composed of subchannels, services, service components, outputs and general options. Subchannels must be defined before being referenced by a service component. Services component must be defined within the service they are associated with.
+
+To easily build a multiplex configuration, ensemble options must be defined first. Then subchannels should be defined, followed with services. For each service, its associated service components must be defined when it is defined. Then, outputs should be defined and finally, general options can be appended.
+
+For any numerical option, the value format can be in decimal (e.g. 26), hexadecimal (starting with 0x, e.g. 0x1a) or octal (starting with zero, e.g. 032).
+
+Labels and short labels containing space characters should be double-quoted (e.g. "CRC Ensemble")
+
+A short label is a 16 bits flag field that indicates which of the characters of the label are to be displayed in an abbreviated form. MSB bit is associated with first label character. A binary value of 0 means that the associated character should not be displayed and a value of 1 activate the display. A maximum of 8 bits shall be set. Short label value could also be entered by text. In this case, a flag field will be extrated by comparing label with short label. (e.g. label="CRC Service", short label="Service" or short label=0x0f70)
+
+.SS ENSEMBLE
+Ensemble options must be defined prior to any subchannel, service and service component.
+.RB "Label (" -L "), short label (" -l " and ensemble identifier (" -i " are available options. Ensemble identifier is a 16 bits number divided in two part. First 4 most significant bits are country identifier and last 12 bits are ensemble reference. Country identifier should not be set to 0.
+
+.SS SUBCHANNEL (INPUT)
+Subchannels are defined through software input. Common options are
+.I bitrate
+.RB ( -b ),
+.I subchannel identifier
+.RB ( -i ") and "
+.I protection
+.RB ( -p ).
+Bitrate must be 8 kbits/s multiple. For audio input, look at table 7 in subclause 6.2 of ETSI - EN 300 401 for allowed bitrates. Subchannel identifier shall range from 0 to 63. Protection is between 1 and 5 for audio input and between 1 and 4 for data input. Only UEP is supported for MPEG-1/2 layer II audio subchannels and EEP-A for all other subchannels. Input format is chosen between
+.RB "audio (" -A "), data (" -D "), enhanced packet mode (" -E "), dmb (" -M "), packet mode (" -P ") and test (" -T ).
+
+.I NOTE: all input type might not be supported. Option -V lists supported inputs.
+
+.TP
+.BI "-A " inputName
+MPEG audio input. File format must conforms to subclause 7 of ETSI - EN 300 401 (i.e with ScF-CRC, FPAD or XPAD and no padding bytes). MPEG-1 layer II at 48kHz sampling rate and MPEG-2 layer II at 24kHz are supported. The
+.I inputName
+format is directly the file name.
+.RS
+Example:
+.IP \(bu
+.I -A audio.mpg
+.RE
+
+.TP
+.BI "-D " inputName
+Data DAB stream mode input. Uses CRC-Dr.Bridge for subchannel framing.
+.I InputName
+is a URL with supported scheme are
+.IR UDP " and " SLIP.
+This input can also be used with
+.I PRBS
+scheme, without any framing.
+.RS
+Examples:
+.IP \(bu
+.I -D udp://224.8.9.9:1234
+.IP \(bu
+.I -D slip://:1234
+.IP \(bu
+.I -D prbs://:0x110
+.RE
+
+.TP
+.BI "-E " inputName
+DAB enhanced packet mode input. Input stream must follow same rules as with DAB packet mode input. 192 Reed-Solomon error correction RS(204,188) codes are added after every 2256 input data bytes. 24 bytes null packets is added when needed.
+.I inputName
+is directly the file name.
+
+.TP
+.BI "-M " inputName
+DAB MPEG-2 TS input, also known as DMB.
+.I InputName
+is a URL with UDP as default and unique input scheme.
+.RS
+Examples:
+.IP \(bu
+.I -M udp://:1234
+.IP \(bu
+.I -M 224.8.8.8:1234
+.RE
+
+.TP
+.BI "-P " inputName
+DAB packet mode input. Input stream must conforms to subclause 5.3.2 of ETSI - EN 300 401. The
+.I inputName
+is directly the file name. Flag
+.B -k
+should be set for pipe input. If packets contain DAB datagroups, then
+.B -d
+flag should be set. Component type is set with
+.BI "-t " type
+option while FIG 0/13 is set with
+.BI "-f " figType
+options. If input packet is bigger than available space at the end of the current frame, it will start next frame and current frame is padded with 24 bytes null packets. If there is not enough input packet available to complete current frame, it is fill with 24 bytes null packets.
+.RS
+Examples:
+.IP \(bu
+.I -P input.bws -t 60 -d
+.IP \(bu
+.I -P ipstream -k -t 59 -d
+.RE
+
+.TP
+.BI -T
+Data DAB stream mode CRC test internal input. Generates a well-know byte stream for debugging purpose. Each DAB logical frame is composed of a sequence of 8 bits number from 0 to 255. First 4 bytes are replaced with a 32 bits frame counter in big endian mode.
+.RS
+Example:
+.IP \(bu
+.I -T
+.RE
+
+.SS SERVICE
+A new service is added every time option
+.I -S
+is used. Options are
+.I language
+.RB ( -g ),
+.I service identifier
+.RB ( -i ),
+.I label
+.RB ( -L ),
+.I short label
+.RB ( -l ") and "
+.I program type
+.RB ( -y ).
+Service identifier is 16 bits encoded for audio services and 32 bits encoded for data services. Program type (PTy) specified the international code found in table of RBDS PTY codes in table 13 of ETSI - TS 101 756.
+
+.SS SERVICE COMPONENT
+Service components are added with option (
+.B -C
+). As they are part of one service, they must be defined within a service definition, i.e. after option (
+.B -S
+) and its sub options. The
+.I subchannel identifier
+.RB ( -i )
+is a common option of all types of components. For audio components,
+.I type
+.RB ( -t )
+can be used to set foreground, background or multi-channel stream. By default, it is foreground. For packet component, options
+.I packet address
+.RB ( -a ),
+datagroups
+.RB ( -d ),
+.I fig type,
+.RB ( -f ),
+.I subchannel identifier
+.RB ( -i "), and "
+.I packet type
+.RB ( -t )
+are available.
+
+.SS OUTPUT
+Output are defined with option
+.B -O
+followed with the
+.I output name.
+The maximum number of allowed output is not defined. If there is no output defined, a simulation output is automatically created.
+.I Output name
+follows the
+.I URL
+schemes
+.IR raw , " udp" , " tcp" , " file" " or " simul ". " Raw
+scheme is used with a E1 communication card for creating a G.703 stream. For UDP scheme, one ETI frame per UDP datagram is inserted, without the padding. With TCP scheme, each frame is preceded with a 16 bits integer telling the frame size in bytes. This number is in little-endian byte order. Same format is used with file output, except that a 32 bits integer is inserted at the beginning of the file. This number indicates number of frame in the file. This number is in little-endian byte order.
+
+.SS GENERAL
+The software can be called with
+.I help
+.RB ( -h )
+option to get a brief online help or with
+.I version
+.RB ( -V )
+option to get information. DAB
+.I mode
+.RB ( -m )
+can be set between 1 and 4. Default mode is 2. A limited
+.I number of frames
+.RB ( -n )
+to produce can be choose, otherwise the software will produces an unlimited number of ETI frames. A special option
+.RB ( -z )
+is available to remove false SCCA field error reports with an old version of Factum ETI analyser. Option
+.RB ( -o )
+is used to turn on LOG facility.
+
+.SS URL
+Most input and output resources are defined through URLs. Uniform Resource Locator (URL) is a standard way to reference resource location. URL format is:
+.RI [ scheme ://][ address ][: port ][ path ][? query ].
+Scheme indicates the protocol to access the resource.
+
+.I NOTE: all URL types might not be supported. Option -V lists supported URLs.
+
+.TP
+.B raw://address
+Write interface for network card low level access. Interface name is specified with
+.I path.
+.RS
+Example:
+.IP \(bu
+.I raw://hdlc0
+.RE
+
+.TP
+.B file://path
+Read/write to/from a local file with file name
+.I path.
+In *NIX, add an additional / for accessing root while on Windows, use path starting with C:\e.
+.RS
+Examples:
+.IP \(bu
+.I file://audiofile.mp2
+.IP \(bu
+.I file:///root
+.IP \(bu
+.I file://c:\ewinroot
+.RE
+
+.TP
+.B udp://[address][:port]
+Receive/send UDP packets from/to a client at a specified IP
+.IR address " and " port .
+Can be any unicast or multicast address. When resource is an input, if address is multicast, it is used to join group, otherwise address is used to choose a specific network card when there is more than one. No input address means wait packets from any network interface. When resource is an output, address is always a destination. When it is not specified, destination is local address.
+.RS
+Examples:
+.IP \(bu
+.I udp://224.8.9.10:1234
+.IP \(bu
+.I udp://:1234
+.RE
+
+.TP
+.B slip://[address]:port]
+SLIP is a packet framing protocol over TCP. It is conform to RFC1055. It follows same rules as TCP for naming convention.
+.RS
+Example:
+.IP \(bu
+.I slip://:1234
+.RE
+
+.TP
+.B prbs://:port
+PRBS is used for testing purpose. It is an internal input that generates a pseudo-random binary sequence. Stream is generated form the output of a feedback shift register which polynomial is specified by the user. Register is reseted at the beginning of each DAB logical frame.
+.RS
+Example:
+.IP \(bu
+.I prbs://:0x110
+.RE
+
+.TP
+.B simul://
+This scheme is an simulation output. Drop the stream and add a 24 ms delay between each write operation.
+
+.SS LOGS
+Output logs can be accessed through TCP socket on port 12222. Use option
+.RB ( -o )
+to turn on LOGS. Every line start with
+.RI < prio >
+, where
+.I prio
+is the message priority. Priority codes can be found in the following table.
+.TS
+tab(&), box;
+| c | c | c |
+| l | c | l |.
+Mnemonic & Value & Description
+_
+_
+EMERG & 0 & system is unusable
+_
+ALERT & 1 & action must be taken immediately
+_
+CRIT & 2 & critical conditions
+_
+ERR & 3 & error conditions
+_
+WARNING & 4 & warning conditions
+_
+NOTICE & 5 & normal but significant condition
+_
+INFO & 6 & informational
+_
+DBG & 7 & debug-level messages
+.TE
+
+.I Figure 2: Message logs priority chart
+
+.SH EXAMPLES
+.TP
+Encode one (1) audio file with default options
+.ul 1
+crc-dabmux -A filename -S -C -O file://output
+
+.TP
+Encode one (1) audio file with user defined labels
+crc-dabmux -A filename -S -L "Service Label" -C -L "Component Label" -O file://output
+
+.TP
+Encode one (1) audio file with user defined subchannel options, i.e. 192 kbits/s @ protection 4
+crc-dabmux -A filename -b 192 -p 4 -S -C -O file://output
+
+.TP
+Encode one (1) audio file and one (1) data stream
+crc-dabmux -A filename -S -C -D 224.8.8.8:1234 -S -C -O file://output
+
+.TP
+Encode one (1) broadcast website (BWS) file
+crc-dabmux -P filename.bws -b 64 -t 60 -S -C -O file://output
+
+.TP
+Encode a complex multiplex
+crc-dabmux \\
+.RS
+.RS
+-A audio.mp2 -b 192 -i 0 -p 4 \\
+.br
+-P pipe1 -k -b 312 -i 1 -p 4 \\
+.br
+-P data1.bws -b 64 -i 2 -p 3 \\
+.br
+-E data2.ss -b 96 -i 3 -p 4 \\
+.br
+.M udp://224.8.8.8:1234 -b 256 -i 4 -p 4 \\
+.br
+-S -L CRC-Karaoke -l 4064 -i 80 \\
+.RS
+-C -i 0 \\
+.br
+-C -i 2 \\
+.RE
+-S -L "CRC-IP Tunneling" -l 4080 -i 81 \\
+.RS
+-C -i 1 \\
+.RE
+-S -L CRC-WebSite -l 0x0fe0 -i 82 \\
+.RS
+-C -i 2 \\
+.RE
+-S -L "CRC-Slide Show" -l SlideShow -i 83 \\
+.RS
+-C -i 3 \\
+.RE
+-S -L CRC-DMB -l 07000 -i 84 \\
+.RS
+-C -i 4 \\
+.RE
+-O raw://hdlc0 -m 2
+.RE
+
+.SH CONFORMING TO
+ETSI: EN 300 401 V1.3.3 (May 2001).
+.I Radio Broadcasting Systems;
+.I Digital Audio Broadcasting (DAB) to mobile, portable and fixed receivers.
+.PP
+ETSI: ETS 300 799 1st edition (September 1997).
+.I Digital Audio Broadcasting (DAB);
+.I Distribution interfaces;
+.I Ensemble Transport Interface (ETI).
+.PP
+ETSI: TS 102 427 V1.1.1 (July 2005).
+.I Digital Audio Broadcasting (DAB);
+.I Data Broadcasting - MPEG-2 TS streaming
+
+.SH AUTHOR
+Pascal Charest <pascal (dot) charest (at) crc (dot) ca>
diff --git a/lib/Makefile.am b/lib/Makefile.am
new file mode 100644
index 0000000..d2bb342
--- /dev/null
+++ b/lib/Makefile.am
@@ -0,0 +1,19 @@
+# Copyright (C) 2009 Her Majesty the Queen in Right of Canada (Communications
+# Research Center Canada)
+
+# This file is part of CRC-DabMux.
+#
+# CRC-DabMux is free software: you can 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.
+#
+# CRC-DabMux is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with CRC-DabMux. If not, see <http://www.gnu.org/licenses/>.
+
+SUBDIRS =farsync
diff --git a/lib/Makefile.in b/lib/Makefile.in
new file mode 100644
index 0000000..7491c8b
--- /dev/null
+++ b/lib/Makefile.in
@@ -0,0 +1,558 @@
+# Makefile.in generated by automake 1.11.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
+# Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+# Copyright (C) 2009 Her Majesty the Queen in Right of Canada (Communications
+# Research Center Canada)
+
+# This file is part of CRC-DabMux.
+#
+# CRC-DabMux is free software: you can 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.
+#
+# CRC-DabMux is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with CRC-DabMux. If not, see <http://www.gnu.org/licenses/>.
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = lib
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+SOURCES =
+DIST_SOURCES =
+RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
+ html-recursive info-recursive install-data-recursive \
+ install-dvi-recursive install-exec-recursive \
+ install-html-recursive install-info-recursive \
+ install-pdf-recursive install-ps-recursive install-recursive \
+ installcheck-recursive installdirs-recursive pdf-recursive \
+ ps-recursive uninstall-recursive
+RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
+ distclean-recursive maintainer-clean-recursive
+AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \
+ $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \
+ distdir
+ETAGS = etags
+CTAGS = ctags
+DIST_SUBDIRS = $(SUBDIRS)
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+am__relativize = \
+ dir0=`pwd`; \
+ sed_first='s,^\([^/]*\)/.*$$,\1,'; \
+ sed_rest='s,^[^/]*/*,,'; \
+ sed_last='s,^.*/\([^/]*\)$$,\1,'; \
+ sed_butlast='s,/*[^/]*$$,,'; \
+ while test -n "$$dir1"; do \
+ first=`echo "$$dir1" | sed -e "$$sed_first"`; \
+ if test "$$first" != "."; then \
+ if test "$$first" = ".."; then \
+ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
+ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
+ else \
+ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
+ if test "$$first2" = "$$first"; then \
+ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
+ else \
+ dir2="../$$dir2"; \
+ fi; \
+ dir0="$$dir0"/"$$first"; \
+ fi; \
+ fi; \
+ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
+ done; \
+ reldir="$$dir2"
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BUILD_HOST = @BUILD_HOST@
+BUILD_TARGET = @BUILD_TARGET@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FARSYNC_DIR = @FARSYNC_DIR@
+GETOPT = @GETOPT@
+GREP = @GREP@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MKDIR_P = @MKDIR_P@
+OBJEXT = @OBJEXT@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+VERSION = @VERSION@
+WSOCK32 = @WSOCK32@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+SUBDIRS = farsync
+all: all-recursive
+
+.SUFFIXES:
+$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+ && { if test -f $@; then exit 0; else break; fi; }; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu lib/Makefile'; \
+ $(am__cd) $(top_srcdir) && \
+ $(AUTOMAKE) --gnu lib/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run `make' without going through this Makefile.
+# To change the values of `make' variables: instead of editing Makefiles,
+# (1) if the variable is set in `config.status', edit `config.status'
+# (which will cause the Makefiles to be regenerated when you run `make');
+# (2) otherwise, pass the desired values on the `make' command line.
+$(RECURSIVE_TARGETS):
+ @fail= failcom='exit 1'; \
+ for f in x $$MAKEFLAGS; do \
+ case $$f in \
+ *=* | --[!k]*);; \
+ *k*) failcom='fail=yes';; \
+ esac; \
+ done; \
+ dot_seen=no; \
+ target=`echo $@ | sed s/-recursive//`; \
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ echo "Making $$target in $$subdir"; \
+ if test "$$subdir" = "."; then \
+ dot_seen=yes; \
+ local_target="$$target-am"; \
+ else \
+ local_target="$$target"; \
+ fi; \
+ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+ || eval $$failcom; \
+ done; \
+ if test "$$dot_seen" = "no"; then \
+ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+ fi; test -z "$$fail"
+
+$(RECURSIVE_CLEAN_TARGETS):
+ @fail= failcom='exit 1'; \
+ for f in x $$MAKEFLAGS; do \
+ case $$f in \
+ *=* | --[!k]*);; \
+ *k*) failcom='fail=yes';; \
+ esac; \
+ done; \
+ dot_seen=no; \
+ case "$@" in \
+ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+ *) list='$(SUBDIRS)' ;; \
+ esac; \
+ rev=''; for subdir in $$list; do \
+ if test "$$subdir" = "."; then :; else \
+ rev="$$subdir $$rev"; \
+ fi; \
+ done; \
+ rev="$$rev ."; \
+ target=`echo $@ | sed s/-recursive//`; \
+ for subdir in $$rev; do \
+ echo "Making $$target in $$subdir"; \
+ if test "$$subdir" = "."; then \
+ local_target="$$target-am"; \
+ else \
+ local_target="$$target"; \
+ fi; \
+ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+ || eval $$failcom; \
+ done && test -z "$$fail"
+tags-recursive:
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
+ done
+ctags-recursive:
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
+ done
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ mkid -fID $$unique
+tags: TAGS
+
+TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ set x; \
+ here=`pwd`; \
+ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
+ include_option=--etags-include; \
+ empty_fix=.; \
+ else \
+ include_option=--include; \
+ empty_fix=; \
+ fi; \
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ if test "$$subdir" = .; then :; else \
+ test ! -f $$subdir/TAGS || \
+ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
+ fi; \
+ done; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ shift; \
+ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ if test $$# -gt 0; then \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ "$$@" $$unique; \
+ else \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$unique; \
+ fi; \
+ fi
+ctags: CTAGS
+CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ test -z "$(CTAGS_ARGS)$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && $(am__cd) $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) "$$here"
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ list='$(DISTFILES)'; \
+ dist_files=`for file in $$list; do echo $$file; done | \
+ sed -e "s|^$$srcdirstrip/||;t" \
+ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+ case $$dist_files in \
+ */*) $(MKDIR_P) `echo "$$dist_files" | \
+ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+ sort -u` ;; \
+ esac; \
+ for file in $$dist_files; do \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ if test -d $$d/$$file; then \
+ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test -d "$(distdir)/$$file"; then \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+ else \
+ test -f "$(distdir)/$$file" \
+ || cp -p $$d/$$file "$(distdir)/$$file" \
+ || exit 1; \
+ fi; \
+ done
+ @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+ if test "$$subdir" = .; then :; else \
+ test -d "$(distdir)/$$subdir" \
+ || $(MKDIR_P) "$(distdir)/$$subdir" \
+ || exit 1; \
+ fi; \
+ done
+ @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+ if test "$$subdir" = .; then :; else \
+ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
+ $(am__relativize); \
+ new_distdir=$$reldir; \
+ dir1=$$subdir; dir2="$(top_distdir)"; \
+ $(am__relativize); \
+ new_top_distdir=$$reldir; \
+ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
+ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
+ ($(am__cd) $$subdir && \
+ $(MAKE) $(AM_MAKEFLAGS) \
+ top_distdir="$$new_top_distdir" \
+ distdir="$$new_distdir" \
+ am__remove_distdir=: \
+ am__skip_length_check=: \
+ am__skip_mode_fix=: \
+ distdir) \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+check: check-recursive
+all-am: Makefile
+installdirs: installdirs-recursive
+installdirs-am:
+install: install-recursive
+install-exec: install-exec-recursive
+install-data: install-data-recursive
+uninstall: uninstall-recursive
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-recursive
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+ -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-recursive
+
+clean-am: clean-generic mostlyclean-am
+
+distclean: distclean-recursive
+ -rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-tags
+
+dvi: dvi-recursive
+
+dvi-am:
+
+html: html-recursive
+
+html-am:
+
+info: info-recursive
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-recursive
+
+install-dvi-am:
+
+install-exec-am:
+
+install-html: install-html-recursive
+
+install-html-am:
+
+install-info: install-info-recursive
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-recursive
+
+install-pdf-am:
+
+install-ps: install-ps-recursive
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-recursive
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-recursive
+
+mostlyclean-am: mostlyclean-generic
+
+pdf: pdf-recursive
+
+pdf-am:
+
+ps: ps-recursive
+
+ps-am:
+
+uninstall-am:
+
+.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \
+ install-am install-strip tags-recursive
+
+.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
+ all all-am check check-am clean clean-generic ctags \
+ ctags-recursive distclean distclean-generic distclean-tags \
+ distdir dvi dvi-am html html-am info info-am install \
+ install-am install-data install-data-am install-dvi \
+ install-dvi-am install-exec install-exec-am install-html \
+ install-html-am install-info install-info-am install-man \
+ install-pdf install-pdf-am install-ps install-ps-am \
+ install-strip installcheck installcheck-am installdirs \
+ installdirs-am maintainer-clean maintainer-clean-generic \
+ mostlyclean mostlyclean-generic pdf pdf-am ps ps-am tags \
+ tags-recursive uninstall uninstall-am
+
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/lib/farsync/Makefile.am b/lib/farsync/Makefile.am
new file mode 100644
index 0000000..858c150
--- /dev/null
+++ b/lib/farsync/Makefile.am
@@ -0,0 +1 @@
+EXTRA_DIST =linux windows
diff --git a/lib/farsync/Makefile.in b/lib/farsync/Makefile.in
new file mode 100644
index 0000000..435618f
--- /dev/null
+++ b/lib/farsync/Makefile.in
@@ -0,0 +1,338 @@
+# Makefile.in generated by automake 1.11.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
+# Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = lib/farsync
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+SOURCES =
+DIST_SOURCES =
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BUILD_HOST = @BUILD_HOST@
+BUILD_TARGET = @BUILD_TARGET@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FARSYNC_DIR = @FARSYNC_DIR@
+GETOPT = @GETOPT@
+GREP = @GREP@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MKDIR_P = @MKDIR_P@
+OBJEXT = @OBJEXT@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+VERSION = @VERSION@
+WSOCK32 = @WSOCK32@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+EXTRA_DIST = linux windows
+all: all-am
+
+.SUFFIXES:
+$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+ && { if test -f $@; then exit 0; else break; fi; }; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu lib/farsync/Makefile'; \
+ $(am__cd) $(top_srcdir) && \
+ $(AUTOMAKE) --gnu lib/farsync/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+tags: TAGS
+TAGS:
+
+ctags: CTAGS
+CTAGS:
+
+
+distdir: $(DISTFILES)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ list='$(DISTFILES)'; \
+ dist_files=`for file in $$list; do echo $$file; done | \
+ sed -e "s|^$$srcdirstrip/||;t" \
+ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+ case $$dist_files in \
+ */*) $(MKDIR_P) `echo "$$dist_files" | \
+ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+ sort -u` ;; \
+ esac; \
+ for file in $$dist_files; do \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ if test -d $$d/$$file; then \
+ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test -d "$(distdir)/$$file"; then \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+ else \
+ test -f "$(distdir)/$$file" \
+ || cp -p $$d/$$file "$(distdir)/$$file" \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+check: check-am
+all-am: Makefile
+installdirs:
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+ -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic mostlyclean-am
+
+distclean: distclean-am
+ -rm -f Makefile
+distclean-am: clean-am distclean-generic
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am:
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-generic
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am:
+
+.MAKE: install-am install-strip
+
+.PHONY: all all-am check check-am clean clean-generic distclean \
+ distclean-generic distdir dvi dvi-am html html-am info info-am \
+ install install-am install-data install-data-am install-dvi \
+ install-dvi-am install-exec install-exec-am install-html \
+ install-html-am install-info install-info-am install-man \
+ install-pdf install-pdf-am install-ps install-ps-am \
+ install-strip installcheck installcheck-am installdirs \
+ maintainer-clean maintainer-clean-generic mostlyclean \
+ mostlyclean-generic pdf pdf-am ps ps-am uninstall uninstall-am
+
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/lib/farsync/linux/CVS/Entries b/lib/farsync/linux/CVS/Entries
new file mode 100644
index 0000000..1c2d89c
--- /dev/null
+++ b/lib/farsync/linux/CVS/Entries
@@ -0,0 +1,2 @@
+/farsync.h/1.1.1.1/Wed Sep 9 22:14:15 2009//
+D
diff --git a/lib/farsync/linux/CVS/Repository b/lib/farsync/linux/CVS/Repository
new file mode 100644
index 0000000..981d916
--- /dev/null
+++ b/lib/farsync/linux/CVS/Repository
@@ -0,0 +1 @@
+crc-dabmux/lib/farsync/linux
diff --git a/lib/farsync/linux/CVS/Root b/lib/farsync/linux/CVS/Root
new file mode 100644
index 0000000..9e5f945
--- /dev/null
+++ b/lib/farsync/linux/CVS/Root
@@ -0,0 +1 @@
+:pserver:pascal@mmlab.dgbt.crc.ca:/home/cvsroot
diff --git a/lib/farsync/linux/farsync.h b/lib/farsync/linux/farsync.h
new file mode 100644
index 0000000..adc4e3a
--- /dev/null
+++ b/lib/farsync/linux/farsync.h
@@ -0,0 +1,507 @@
+/*
+ * FarSync X21 driver for Linux
+ *
+ * Actually sync driver for X.21, V.35 and V.24 on FarSync T-series cards
+ *
+ * Copyright (C) 2001-2004 FarSite Communications Ltd.
+ * www.farsite.co.uk
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version
+ * 2 of the License, or (at your option) any later version.
+ *
+ * Author: R.J.Dunlop <bob.dunlop@farsite.co.uk>
+ *
+ * For the most part this file only contains structures and information
+ * that is visible to applications outside the driver. Shared memory
+ * layout etc is internal to the driver and described within farsync.c.
+ * Overlap exists in that the values used for some fields within the
+ * ioctl interface extend into the cards firmware interface so values in
+ * this file may not be changed arbitrarily.
+ */
+
+#define FST_NAME "fst" /* In debug/info etc */
+#define FST_NDEV_NAME "sync" /* For net interface */
+#define FST_DEV_NAME "farsync" /* For misc interfaces */
+
+/* User version number
+ *
+ * This version number is incremented with each official release of the
+ * package and is a simplified number for normal user reference.
+ * Individual files are tracked by the version control system and may
+ * have individual versions (or IDs) that move much faster than the
+ * the release version as individual updates are tracked.
+ */
+#define FST_USER_VERSION "1.06"
+#define FST_PATCH_LEVEL "02"
+#define FST_PLATFORM "ia32"
+#define FST_ADDITIONAL "-T1"
+
+#define FST_INCLUDES_CHAR
+
+/* Ioctl call command values
+ *
+ * The first three private ioctls are used by the sync-PPP module,
+ * allowing a little room for expansion we start our numbering at 10.
+ */
+#define FSTWRITE (SIOCDEVPRIVATE+4)
+#define FSTCPURESET (SIOCDEVPRIVATE+5)
+#define FSTCPURELEASE (SIOCDEVPRIVATE+6)
+#define FSTGETCONF (SIOCDEVPRIVATE+7)
+#define FSTSETCONF (SIOCDEVPRIVATE+8)
+#define FSTSNOTIFY (SIOCDEVPRIVATE+9)
+#define FSTGSTATE (SIOCDEVPRIVATE+10)
+#define FSTSYSREQ (SIOCDEVPRIVATE+11)
+#define FSTGETSHELL (SIOCDEVPRIVATE+12)
+#define FSTSETMON (SIOCDEVPRIVATE+13)
+#define FSTSETPORT (SIOCDEVPRIVATE+14)
+
+
+/* FSTWRITE
+ *
+ * Used to write a block of data (firmware etc) before the card is running
+ */
+struct fstioc_write {
+ unsigned int size;
+ unsigned int offset;
+ unsigned char data[0];
+};
+
+
+/* FSTCPURESET and FSTCPURELEASE
+ *
+ * These take no additional data.
+ * FSTCPURESET forces the cards CPU into a reset state and holds it there.
+ * FSTCPURELEASE releases the CPU from this reset state allowing it to run,
+ * the reset vector should be setup before this ioctl is run.
+ */
+
+/* FSTGETCONF and FSTSETCONF
+ *
+ * Get and set a card/ports configuration.
+ * In order to allow selective setting of items and for the kernel to
+ * indicate a partial status response the first field "valid" is a bitmask
+ * indicating which other fields in the structure are valid.
+ * Many of the field names in this structure match those used in the
+ * firmware shared memory configuration interface and come originally from
+ * the NT header file Smc.h
+ *
+ * When used with FSTGETCONF this structure should be zeroed before use.
+ * This is to allow for possible future expansion when some of the fields
+ * might be used to indicate a different (expanded) structure.
+ */
+struct fstioc_info {
+ unsigned int valid; /* Bits of structure that are valid */
+ unsigned int nports; /* Number of serial ports */
+ unsigned int type; /* Type index of card */
+ unsigned int state; /* State of card */
+ unsigned int index; /* Index of port ioctl was issued on */
+ unsigned int smcFirmwareVersion;
+ unsigned long kernelVersion; /* What Kernel version we are working with */
+ unsigned short lineInterface; /* Physical interface type */
+ unsigned char proto; /* Line protocol */
+ unsigned char internalClock; /* 1 => internal clock, 0 => external */
+ unsigned int lineSpeed; /* Speed in bps */
+ unsigned int estLineSpeed; /* Estimated speed in bps */
+ unsigned int v24IpSts; /* V.24 control input status */
+ unsigned int v24OpSts; /* V.24 control output status */
+ unsigned short clockStatus; /* lsb: 0=> present, 1=> absent */
+ unsigned short cableStatus; /* lsb: 0=> present, 1=> absent */
+ unsigned short cardMode; /* lsb: LED id mode */
+ unsigned short debug; /* Debug flags */
+ unsigned char transparentMode; /* Not used always 0 */
+ unsigned char invertClock; /* Invert clock feature for syncing */
+ unsigned char asyncAbility ; /* The ability to do async */
+ unsigned char synthAbility; /* The ability to syth a clock */
+ unsigned char startingSlot; /* Time slot to use for start of tx */
+ unsigned char clockSource; /* External or internal */
+ unsigned char framing; /* E1, T1 or J1 */
+ unsigned char structure; /* unframed, double, crc4, f4, f12, */
+ /* f24 f72 */
+ unsigned char interface; /* rj48c or bnc */
+ unsigned char coding; /* hdb3 b8zs */
+ unsigned char lineBuildOut; /* 0, -7.5, -15, -22 */
+ unsigned char equalizer; /* short or lon haul settings */
+ unsigned char loopMode; /* various loopbacks */
+ unsigned char range; /* cable lengths */
+ unsigned char txBufferMode; /* tx elastic buffer depth */
+ unsigned char rxBufferMode; /* rx elastic buffer depth */
+ unsigned char losThreshold; /* Attenuation on LOS signal */
+ unsigned char idleCode; /* Value to send as idle timeslot */
+ unsigned int receiveBufferDelay; /* delay thro rx buffer timeslots */
+ unsigned int framingErrorCount; /* framing errors */
+ unsigned int codeViolationCount; /* code violations */
+ unsigned int crcErrorCount; /* CRC errors */
+ int lineAttenuation; /* in dB*/
+ unsigned short lossOfSignal;
+ unsigned short receiveRemoteAlarm;
+ unsigned short alarmIndicationSignal;
+ unsigned short _reserved[64];
+ unsigned char ignoreCarrier; /* If set transmit regardless of carrier state */
+ unsigned char numTxBuffers; /* No of tx buffers in card window */
+ unsigned char numRxBuffers; /* No of rx buffers in card window */
+ unsigned int txBufferSize; /* Size of tx buffers in card window */
+ unsigned int rxBufferSize; /* Size of rx buffers in card window */
+ unsigned char terminalType; /* Additional hdsl */
+ unsigned char annexType;
+ unsigned char encap;
+ unsigned char testMode;
+ unsigned char backoff;
+ unsigned char bLineProbingEnable;
+ unsigned char snrth;
+ unsigned char lpath;
+ unsigned short vpi;
+ unsigned short vci;
+ unsigned char activationStatus;
+ unsigned char noCommonModeStatus;
+ unsigned char transceiverStatus1;
+ unsigned char transceiverStatus2;
+ unsigned char lineLoss;
+ char signalQuality;
+ unsigned char nearEndBlockErrorCount;
+ char signalToNoiseRatio;
+ unsigned char erroredSecondCount;
+ unsigned char severelyErroredSecondCount;
+ unsigned char lossOfSyncWordSecondCount;
+ unsigned char unavailableSecondCount;
+ char frequencyDeviation;
+ char negotiatedPowerBackOff;
+ unsigned char negotiatedPSD;
+ unsigned char negotiatedBChannels;
+ unsigned char negotiatedZBits;
+ unsigned short negotiatedSyncWord;
+ unsigned char negotiatedStuffBits;
+ unsigned char chipVersion;
+ unsigned char firmwareVersion;
+ unsigned char romVersion;
+ unsigned short atmTxCellCount;
+ unsigned short atmRxCellCount;
+ unsigned short atmHecErrorCount;
+ unsigned int atmCellsDropped;
+ unsigned char transmitMSBFirst;
+ unsigned char receiveMSBFirst;
+};
+
+/* FSTGSTATE
+ *
+ * Used to query why a state change message has been issued by the driver
+ * It could be because there was a change in line states or that the txq
+ * has reached an empty state
+ */
+struct fstioc_status {
+ int carrier_state;
+ int txq_length;
+};
+
+/* FSTSYSREQ
+ *
+ * Used to provide a simple transparent command/repsonse interface between
+ * an application and the firmware running on the card
+ */
+struct fstioc_req {
+ unsigned short msg_type;
+ unsigned short msg_len;
+ unsigned short ret_code;
+ unsigned short i_reg_idx;
+ unsigned short value;
+ unsigned char u_msg[16];
+ unsigned char u_msg_reserved[16];
+ unsigned char u_reserved[4];
+};
+
+
+#define MSG_FIFO_EEPROM_RD 0x769b
+#define MSG_FIFO_EEPROM_WR 0xcd4a
+#define RSP_FIFO_SUCCESS 0x0000
+#define RSP_FIFO_FAILURE 0x0001
+
+
+/* FSTSETMON
+ *
+ * Used to provide a simple monitoring data
+ */
+#define FSTIOC_MON_VERSION 0
+#define FST_MON_RX 0
+#define FST_MON_TX 1
+
+struct fstioc_mon {
+ unsigned char version;
+ unsigned char tx_rx_ind;
+ unsigned int sequence;
+ unsigned long timestamp;
+ unsigned int length;
+};
+
+/* FSTSETPORT
+ *
+ * Used to provide a DSL port control
+ */
+#define FST_DSL_PORT_NORMAL 0
+#define FST_DSL_PORT_ACTIVE 1
+
+/* "valid" bitmask */
+#define FSTVAL_NONE 0x00000000 /* Nothing valid (firmware not running).
+ * Slight misnomer. In fact nports,
+ * type, state and index will be set
+ * based on hardware detected.
+ */
+#define FSTVAL_OMODEM 0x0000001F /* First 5 bits correspond to the
+ * output status bits defined for
+ * v24OpSts
+ */
+#define FSTVAL_SPEED 0x00000020 /* internalClock, lineSpeed, clockStatus
+ */
+#define FSTVAL_CABLE 0x00000040 /* lineInterface, cableStatus */
+#define FSTVAL_IMODEM 0x00000080 /* v24IpSts */
+#define FSTVAL_CARD 0x00000100 /* nports, type, state, index,
+ * smcFirmwareVersion
+ */
+#define FSTVAL_PROTO 0x00000200 /* proto */
+#define FSTVAL_MODE 0x00000400 /* cardMode */
+#define FSTVAL_PHASE 0x00000800 /* Clock phase */
+#define FSTVAL_TE1 0x00001000 /* T1E1 Configuration */
+#define FSTVAL_BUFFERS 0x00002000 /* Tx and Rx buffer settings */
+#define FSTVAL_DSL_S1 0x00004000 /* DSL-S1 Configuration */
+#define FSTVAL_T4E 0x00008000 /* T4E Mk II Configuration */
+#define FSTVAL_DEBUG 0x80000000 /* debug */
+#define FSTVAL_ALL 0x0000FFFF /* Note: does not include DEBUG flag */
+
+/* "type" */
+#define FST_TYPE_NONE 0 /* Probably should never happen */
+#define FST_TYPE_T2P 1 /* T2P X21 2 port card */
+#define FST_TYPE_T4P 2 /* T4P X21 4 port card */
+#define FST_TYPE_T1U 3 /* T1U X21 1 port card */
+#define FST_TYPE_T2U 4 /* T2U X21 2 port card */
+#define FST_TYPE_T4U 5 /* T4U X21 4 port card */
+#define FST_TYPE_TE1 6 /* T1E1 X21 1 port card */
+#define FST_TYPE_DSL_S1 7 /* DSL-S1 card */
+#define FST_TYPE_T4E 8 /* T4E Mk II */
+
+/* "family" */
+#define FST_FAMILY_TXP 0 /* T2P or T4P */
+#define FST_FAMILY_TXU 1 /* T1U or T2U or T4U */
+
+/* "state" */
+#define FST_UNINIT 0 /* Raw uninitialised state following
+ * system startup */
+#define FST_RESET 1 /* Processor held in reset state */
+#define FST_DOWNLOAD 2 /* Card being downloaded */
+#define FST_STARTING 3 /* Released following download */
+#define FST_RUNNING 4 /* Processor running */
+#define FST_BADVERSION 5 /* Bad shared memory version detected */
+#define FST_HALTED 6 /* Processor flagged a halt */
+#define FST_IFAILED 7 /* Firmware issued initialisation failed
+ * interrupt
+ */
+/* "lineInterface" */
+#define V24 1
+#define X21 2
+#define V35 3
+#define X21D 4
+#define NOCABLE 5
+#define RS530_449 6
+#define T1 7
+#define E1 8
+#define J1 9
+#define SHDSL 10
+
+/* "proto" */
+#define FST_HDLC 1 /* Cisco compatible HDLC */
+#define FST_PPP 2 /* Sync PPP */
+#define FST_MONITOR 3 /* Monitor only (raw packet reception) */
+#define FST_RAW 4 /* Two way raw packets */
+#define FST_GEN_HDLC 5 /* Using "Generic HDLC" module */
+
+/* "internalClock" */
+#define INTCLK 1
+#define EXTCLK 0
+
+/* "v24IpSts" bitmask */
+#define IPSTS_CTS 0x00000001 /* Clear To Send (Indicate for X.21) */
+#define IPSTS_INDICATE IPSTS_CTS
+#define IPSTS_DSR 0x00000002 /* Data Set Ready (T2P Port A) */
+#define IPSTS_DCD 0x00000004 /* Data Carrier Detect */
+#define IPSTS_RI 0x00000008 /* Ring Indicator (T2P Port A) */
+#define IPSTS_TMI 0x00000010 /* Test Mode Indicator (Not Supported)*/
+
+/* "v24OpSts" bitmask */
+#define OPSTS_RTS 0x00000001 /* Request To Send (Control for X.21) */
+#define OPSTS_CONTROL OPSTS_RTS
+#define OPSTS_DTR 0x00000002 /* Data Terminal Ready */
+#define OPSTS_DSRS 0x00000004 /* Data Signalling Rate Select (Not
+ * Supported) */
+#define OPSTS_SS 0x00000008 /* Select Standby (Not Supported) */
+#define OPSTS_LL 0x00000010 /* Maintenance Test (Not Supported) */
+
+/* "cardMode" bitmask */
+#define CARD_MODE_IDENTIFY 0x0001
+
+/*
+ * TxRx Start Parameters
+ */
+#define START_TX 1
+#define START_RX 2
+#define START_TX_AND_RX (START_TX | START_RX)
+#define START_DEFAULT START_TX_AND_RX
+
+/*
+ * Constants for T1/E1 configuration
+ */
+
+/*
+ * Clock source
+ */
+#define CLOCKING_SLAVE 0
+#define CLOCKING_MASTER 1
+
+/*
+ * Framing
+ */
+#define FRAMING_E1 0
+#define FRAMING_J1 1
+#define FRAMING_T1 2
+
+/*
+ * Structure
+ */
+#define STRUCTURE_UNFRAMED 0
+#define STRUCTURE_E1_DOUBLE 1
+#define STRUCTURE_E1_CRC4 2
+#define STRUCTURE_E1_CRC4M 3
+#define STRUCTURE_T1_4 4
+#define STRUCTURE_T1_12 5
+#define STRUCTURE_T1_24 6
+#define STRUCTURE_T1_72 7
+
+/*
+ * Interface
+ */
+#define INTERFACE_RJ48C 0
+#define INTERFACE_BNC 1
+
+/*
+ * Coding
+ */
+
+#define CODING_HDB3 0
+#define CODING_NRZ 1
+#define CODING_CMI 2
+#define CODING_CMI_HDB3 3
+#define CODING_CMI_B8ZS 4
+#define CODING_AMI 5
+#define CODING_AMI_ZCS 6
+#define CODING_B8ZS 7
+
+/*
+ * Line Build Out
+ */
+#define LBO_0dB 0
+#define LBO_7dB5 1
+#define LBO_15dB 2
+#define LBO_22dB5 3
+
+/*
+ * Range for long haul t1 > 655ft
+ */
+#define RANGE_0_133_FT 0
+#define RANGE_0_40_M RANGE_0_133_FT
+#define RANGE_133_266_FT 1
+#define RANGE_40_81_M RANGE_133_266_FT
+#define RANGE_266_399_FT 2
+#define RANGE_81_122_M RANGE_266_399_FT
+#define RANGE_399_533_FT 3
+#define RANGE_122_162_M RANGE_399_533_FT
+#define RANGE_533_655_FT 4
+#define RANGE_162_200_M RANGE_533_655_FT
+/*
+ * Receive Equaliser
+ */
+#define EQUALIZER_SHORT 0
+#define EQUALIZER_LONG 1
+
+/*
+ * Loop modes
+ */
+#define LOOP_NONE 0
+#define LOOP_LOCAL 1
+#define LOOP_PAYLOAD_EXC_TS0 2
+#define LOOP_PAYLOAD_INC_TS0 3
+#define LOOP_REMOTE 4
+
+/*
+ * Buffer modes
+ */
+#define BUFFER_2_FRAME 0
+#define BUFFER_1_FRAME 1
+#define BUFFER_96_BIT 2
+#define BUFFER_NONE 3
+
+/*
+ * DSL Equipment types
+ */
+#define EQUIP_TYPE_REMOTE 0
+#define EQUIP_TYPE_CENTRAL 1
+
+/*
+ * DSL Operating modes
+ */
+#define ANNEX_A 1 /* US */
+#define ANNEX_B 0 /* EU */
+
+/*
+ * DSL ATM Encapsulation methods
+ */
+#define ENCAP_PPP 0
+#define ENCAP_MPOA 1
+#define MPOA_HEADER_LEN 8
+
+/*
+ * DSL Test Modes
+ */
+#define TEST_MODE_NONE 0
+#define TEST_MODE_DEFAULT TEST_MODE_NONE
+
+#define TEST_MODE_ALTERNATING_SINGLE_PULSE 1
+#define TEST_MODE_ANALOG_TRANSPARENT_LOOP 4
+#define TEST_MODE_ANALOG_NON_TRANSPARENT_LOOP 8
+#define TEST_MODE_TRANSMIT_SC_SR 9
+#define TEST_MODE_TRANSMIT_TC_PAM_SCRONE 10
+#define TEST_MODE_LINE_DRIVER_NO_SIGNAL 11
+#define TEST_MODE_AGC_TO_LINE_DRIVER_LOOP 12
+
+#define TEST_MODE_LOOP_TDM_TO_LINE 16
+#define TEST_MODE_LOOP_PAYLOAD_TO_LINE 17
+
+/* Debug support
+ *
+ * These should only be enabled for development kernels, production code
+ * should define FST_DEBUG=0 in order to exclude the code.
+ * Setting FST_DEBUG=1 will include all the debug code but in a disabled
+ * state, use the FSTSETCONF ioctl to enable specific debug actions, or
+ * FST_DEBUG can be set to prime the debug selection.
+ */
+#define FST_DEBUG 0x0000
+#if FST_DEBUG
+
+extern int fst_debug_mask; /* Bit mask of actions to debug, bits
+ * listed below. Note: Bit 0 is used
+ * to trigger the inclusion of this
+ * code, without enabling any actions.
+ */
+#define DBG_INIT 0x0002 /* Card detection and initialisation */
+#define DBG_OPEN 0x0004 /* Open and close sequences */
+#define DBG_PCI 0x0008 /* PCI config operations */
+#define DBG_IOCTL 0x0010 /* Ioctls and other config */
+#define DBG_INTR 0x0020 /* Interrupt routines (be careful) */
+#define DBG_TX 0x0040 /* Packet transmission */
+#define DBG_RX 0x0080 /* Packet reception */
+#define DBG_CMD 0x0100 /* Port command issuing */
+#define DBG_ATM 0x0200 /* ATM processing */
+#define DBG_TTY 0x0400 /* PPPd processing */
+#define DBG_ASS 0x0001 /* Assert like statements. Code that
+ * should never be reached, if you see
+ * one of these then I've been an ass
+ */
+#endif /* FST_DEBUG */
+
diff --git a/lib/farsync/windows/CVS/Entries b/lib/farsync/windows/CVS/Entries
new file mode 100644
index 0000000..eb6576c
--- /dev/null
+++ b/lib/farsync/windows/CVS/Entries
@@ -0,0 +1,4 @@
+/fscfg.h/1.1.1.1/Wed Sep 9 22:14:15 2009//
+/sdci.h/1.1.1.1/Wed Sep 9 22:14:15 2009//
+/smcuser.h/1.1.1.1/Wed Sep 9 22:14:15 2009//
+D
diff --git a/lib/farsync/windows/CVS/Repository b/lib/farsync/windows/CVS/Repository
new file mode 100644
index 0000000..c77b5cb
--- /dev/null
+++ b/lib/farsync/windows/CVS/Repository
@@ -0,0 +1 @@
+crc-dabmux/lib/farsync/windows
diff --git a/lib/farsync/windows/CVS/Root b/lib/farsync/windows/CVS/Root
new file mode 100644
index 0000000..9e5f945
--- /dev/null
+++ b/lib/farsync/windows/CVS/Root
@@ -0,0 +1 @@
+:pserver:pascal@mmlab.dgbt.crc.ca:/home/cvsroot
diff --git a/lib/farsync/windows/fscfg.h b/lib/farsync/windows/fscfg.h
new file mode 100644
index 0000000..7a13884
--- /dev/null
+++ b/lib/farsync/windows/fscfg.h
@@ -0,0 +1,574 @@
+/*******************************************************************************
+*
+* Program : FarSync (generic)
+*
+* File : fscfg.h
+*
+* Description : Common FarSync Configuration Definitions used through the
+* FarSync PC-based modules
+*
+* Modifications
+*
+* Version 2.1.0 01Mar01 WEB Add device and port configuration values
+* 09Mar01 WEB Add Fswan hwid
+* Version 2.2.0 18Jul01 WEB Certification candidate
+* 22Oct01 MJD Added Transparent Mode support - define
+* names and values for Transparent Mode and
+* Buffer Length parameters.
+* Version 2.2.6 26Oct01 WEB Add name for devices use only for SDCI applications.
+* Version 2.3.0 28Nov01 WEB Add minnow ids + DeviceIDToCardID map
+* Version 2.3.1 08Apr02 WEB Change min buffer length from 62 to 2
+* Version 2.3.2 27Aug02 WEB Rationalised
+* Version 3.0.2 05Nov02 WEB Add 'U' to DeviceIDToCardID map
+* Version 3.2.0 09Dec02 WEB Add Invert Rx Clock, Dual Clocking & DMA definitions
+* Version 3.4.0 26Oct04 WEB Add fstap definitions
+* Version 3.5.0 11Nov04 WEB Add te1 definitions
+* Version 4.0.0 18Feb05 WEB Add configurable number and size of buffers, start
+* tx/rx
+* Version 4.0.1 03Mar05 WEB Add extended clocking definitions
+* Version 4.0.2 17Mar05 WEB Correct FS_LINE_INTERFACE_MAX - should be V35
+* Version 4.1.0 24Jun05 WEB Add new T4E defs
+* Version 4.2.0 12Sep05 WEB Add FS_NDEVICE_CLASS i.e. support for T4E MkII
+* Reduce FS_LINE_RATE_MIN to 300
+*
+*******************************************************************************/
+
+#ifndef __FSCFG_H_
+#define __FSCFG_H_
+
+#define SMCUSER_PACKING 1
+#include "smcuser.h" // Values also used in the adapter window interface */
+
+// PCI IDs
+#define FS_VENDOR_ID 0x1619
+#define FS_DEVICE_CLASS 0x0400 // ie. 0400 .. 04FF
+#define FS_TDEVICE_CLASS FS_DEVICE_CLASS
+
+// FarSync card classes/Device ID ranges
+#define FS_MDEVICE_CLASS 0x0500 // ie. 0500 .. 05FF
+#define FS_VDEVICE_CLASS 0x0000 // ie. 0000 .. 00FF
+#define FS_UDEVICE_CLASS 0x0600 // ie. 0600 .. 06FF
+#define FS_EDEVICE_CLASS 0x1600 // ie. 1600 .. 16FF
+#define FS_NDEVICE_CLASS 0x3600 // ie. 3600 .. 36FF
+#define FS_DDEVICE_CLASS 0x1700 // ie. 1700 .. 17FF
+
+#define FS_CARDID_MASK 0xFF00
+
+// Class maps
+struct _DEVICEIDTOCARDID// e.g. 0400 -> T, 0500 -> M, 0600 -> T
+{
+ ULONG uDeviceID;
+ char cCardID;
+};
+#define DEVICEIDTOCARDID struct _DEVICEIDTOCARDID
+#ifdef FS_DECLARE_CFG_ARRAYS
+DEVICEIDTOCARDID DeviceIDToCardID[] = { {FS_TDEVICE_CLASS, 'T'},
+ {FS_MDEVICE_CLASS, 'M'},
+ {FS_VDEVICE_CLASS, 'V'},
+ {FS_UDEVICE_CLASS, 'T'},
+ {FS_EDEVICE_CLASS, 'T'},
+ {FS_DDEVICE_CLASS, 'D'},
+ {FS_NDEVICE_CLASS, 'T'}
+ };
+typedef struct _DEVICEIDTOCARDID2
+{
+ ULONG uDeviceID;
+ char cCardID;
+} DEVICEIDTOCARDID2; // e.g. 0400 -> P, 0500 -> P, 0600 -> U
+#endif
+
+#ifdef FS_DECLARE_CFG_ARRAYS
+DEVICEIDTOCARDID DeviceIDToCardID2[] = { {FS_TDEVICE_CLASS, 'P'},
+ {FS_MDEVICE_CLASS, 'P'},
+ {FS_VDEVICE_CLASS, 'P'},
+ {FS_UDEVICE_CLASS, 'U'},
+ {FS_EDEVICE_CLASS, 'E'},
+ {FS_DDEVICE_CLASS, 'S'},
+ {FS_NDEVICE_CLASS, 'E'}
+ };
+#else
+DEVICEIDTOCARDID DeviceIDToCardID2[];
+#endif
+
+#define FS_FSWAN_HWID "fsvbus\\FS_TXP-00" // must match value in .inf
+#define FS_VBUS_PREFIX_U L"fsv"
+
+// Limits required for adapter/port enumeration
+#define FS_MAX_ADAPTERS 100
+#define FS_MAX_SYNC_ADAPTERS 10
+#define FS_MAX_PORTS MAX_PORTS
+
+#define FS_MAX_DEVICE_NAME 32 // number of WCHARs required to accomodate the longest device name
+ // e.g. \Device\SYNCH, \DosDevices\SYNC1 or \DosDevices\FSPPP0006
+#define FS_DEVICE_PREFIX "SYNC"
+#define FS_DEVICE_PREFIX_U L"SYNC"
+
+#define FS_PPP_DEVICE_NAME "FSPPP%s" // name of farsynct device when in ppp mode
+
+#define FS_SDCI_DEVICE_NAME "SDCI%s" // name of farsynct device when in sdci mode
+
+#define FS_PORT_DEVICE_NAME "PortDeviceName" // stores name of farsynct port to use
+#define LFS_PORT_DEVICE_NAME L"PortDeviceName" // required for use in ndiswan driver
+
+#define FS_MAX_PARAM_NAME 128 // max number of chars in FS_LINE_NAME_PARAM_NAME etc.
+
+/* Line name values */
+#define FS_LINE_NAME_PARAM_NAME "Port%u_%u_Name"
+#define FS_LINE_NAME_MAX_CHARS 16
+#define FS_LINE_NAME_DEF "FSWAN_%u"
+#define FS_PORT_NAME_DEF "Port %c"
+#define FS_PORT_NAME_PARAM_NAME "Port%u_Name"
+
+/* Line interface values */
+#define FS_LINE_INTERFACE_PARAM_NAME "Port%u_%u_Interface"
+#define FS_LINE_INTERFACE_MIN V24
+#define FS_LINE_INTERFACE_V24 V24
+#define FS_LINE_INTERFACE_X21 X21
+#define FS_LINE_INTERFACE_X21D X21D
+#define FS_LINE_INTERFACE_V35 V35
+#define FS_LINE_INTERFACE_RS530_449 RS530_449
+// Note: Specifying MAX as X21D intentionally makes RS530_449 not accessible to the current client GUIs
+#define FS_LINE_INTERFACE_MAX RS530_449
+#define FS_LINE_INTERFACE_DEF X21
+#define FS_LINE_INTERFACE_MAX_CHARS 7
+#define FS_PORT_INTERFACE_PARAM_NAME "Port%u_Interface"
+#define FS_PORT_INTERFACE_PARAM_NAME_U L"Port%u_Interface"
+
+#ifdef FS_DECLARE_CFG_ARRAYS
+char* szFsT4EInterfaceTypesTable[] = {"Auto", "V.24", "X.21", "V.35", "X.21 (Dual-Clocking)", "RS530/449", 0};
+char* szFsT4EInterfaceTypesTable2[] = {"Auto", "V.24", "X.21", "V.35", "X.21D", "RS530", 0};
+ULONG uFsT4EInterfaceTypesTableVals[] = {AUTO, V24, X21, V35, X21D, RS530_449, 0};
+char* szFsInterfaceTypesTable[] = {"Auto", "V.24", "X.21", "V.35", "X.21 (Dual-Clocking)", 0};
+char* szFsM1PInterfaceTypesTable[] = {"Auto", "V.24", "X.21", "V.35", 0};
+#else
+char* szFsT4EInterfaceTypesTable[];
+char* szFsT4EInterfaceTypesTable2[];
+ULONG uFsT4EInterfaceTypesTableVals[];
+char* szFsInterfaceTypesTable[];
+char* szFsM1PInterfaceTypesTable[];
+#endif
+
+/* Line rate values */
+#define FS_LINE_RATE_PARAM_NAME "Port%u_%u_Rate"
+#define FS_LINE_RATE_MIN 300
+#define FS_LINE_RATE_MAX 8192000
+#define FS_LINE_RATE_DEF 64000
+#define FS_LINE_RATE_MAX_CHARS 7
+#define FS_PORT_RATE_PARAM_NAME "Port%u_Rate"
+#define FS_PORT_RATE_PARAM_NAME_U L"Port%u_Rate"
+
+#ifdef FS_DECLARE_CFG_ARRAYS
+ULONG uFsRateTable[] = {1200, 2400, 4800, 9600,
+ 19200, 38400, 64000, 76800,
+ 128000, 153600, 256000, 307200,
+ 512000, 614400, 1024000, 2048000,
+ 4096000, 8192000, 0 };
+#else
+ULONG uFsRateTable[];
+#endif
+
+/* Line clocking values */
+#define FS_LINE_CLOCKING_PARAM_NAME "Port%u_%u_InternalClocking"
+#define FS_LINE_CLOCKING_MIN EXTCLK
+#define FS_LINE_CLOCKING_EXTERNAL EXTCLK
+#define FS_LINE_CLOCKING_INTERNAL INTCLK
+#define FS_LINE_CLOCKING_MAX INTCLK
+#define FS_LINE_CLOCKING_DEF EXTCLK
+#define FS_LINE_CLOCKING_MAX_CHARS 8
+#define FS_PORT_CLOCKING_PARAM_NAME "Port%u_InternalClocking"
+#define FS_PORT_CLOCKING_PARAM_NAME_U L"Port%u_InternalClocking"
+
+#ifdef FS_DECLARE_CFG_ARRAYS
+char* szFsClockingTypesTable[] = {"External", "Internal", 0}; // maps onto FALSE, TRUE
+#else
+char* szFsClockingTypesTable[];
+#endif
+
+/* Transparent mode values */
+#define FS_LINE_TRANSPARENT_MIN FALSE
+#define FS_LINE_TRANSPARENT_MAX TRUE
+#define FS_LINE_TRANSPARENT_DEF FALSE
+#define FS_PORT_TRANSPARENT_PARAM_NAME "Port%u_TransparentMode"
+#define FS_PORT_TRANSPARENT_PARAM_NAME_U L"Port%u_TransparentMode"
+
+/* HDLC/Transparent mode values */
+#define FS_LINE_MODE_HDLC 0
+#define FS_LINE_MODE_TRANSPARENT 1
+#define FS_LINE_MODE_MIN FS_LINE_MODE_HDLC
+#define FS_LINE_MODE_MAX FS_LINE_MODE_TRANSPARENT
+#define FS_LINE_MODE_DEF FS_LINE_MODE_HDLC
+#define FS_LINE_MODE_MAX_CHARS 12
+
+#ifdef FS_DECLARE_CFG_ARRAYS
+char* szFsModeTypesTable[] = {"HDLC", "Transparent", 0};
+#else
+char* szFsModeTypesTable[];
+#endif
+
+/* Buffer length values */
+#define FS_LINE_BUFFER_MIN 2
+#define FS_LINE_BUFFER_MAX 64*1024
+#define FS_LINE_BUFFER_DEF 8*1024
+#define FS_PORT_BUFFER_PARAM_NAME "Port%u_BufferLength"
+#define FS_PORT_BUFFER_PARAM_NAME_U L"Port%u_BufferLength"
+#define FS_PORT_TX_BUFFER_PARAM_NAME "Port%u_TxBufferLength"
+#define FS_PORT_TX_BUFFER_PARAM_NAME_U L"Port%u_TxBufferLength"
+#define FS_PORT_RX_BUFFER_PARAM_NAME "Port%u_RxBufferLength"
+#define FS_PORT_RX_BUFFER_PARAM_NAME_U L"Port%u_RxBufferLength"
+
+// Note: UNDEF values means that the vars are ignored (i.e. different from DEFault values)
+
+/* Invert Rx clock values */
+#define FS_PORT_INVERT_RX_CLOCK_MIN FALSE
+#define FS_PORT_INVERT_RX_CLOCK_MAX TRUE
+#define FS_PORT_INVERT_RX_CLOCK_DEF FALSE
+#define FS_PORT_INVERT_RX_CLOCK_UNDEF 0xFFFFFFFF
+#define FS_PORT_INVERT_RX_CLOCK_PARAM_NAME "Port%u_InvertRxClock"
+#define FS_PORT_INVERT_RX_CLOCK_PARAM_NAME_U L"Port%u_InvertRxClock"
+
+/* Dual Clocking values */
+#define FS_PORT_DUAL_CLOCKING_DEF FALSE
+#define FS_PORT_DUAL_CLOCKING_PARAM_NAME "Port%u_DualClocking"
+#define FS_PORT_DUAL_CLOCKING_PARAM_NAME_U L"Port%u_DualClocking"
+
+/* Tx DMA values */
+#define FS_PORT_TX_DMA_UNDEF 0xFFFFFFFF
+#define FS_PORT_TX_DMA_PARAM_NAME "Port%u_TxDMA"
+#define FS_PORT_TX_DMA_PARAM_NAME_U L"Port%u_TxDMA"
+
+/* Rx DMA values */
+#define FS_PORT_RX_DMA_UNDEF 0xFFFFFFFF
+#define FS_PORT_RX_DMA_PARAM_NAME "Port%u_RxDMA"
+#define FS_PORT_RX_DMA_PARAM_NAME_U L"Port%u_RxDMA"
+
+#define FS_PORT_DMA_MAX FSDMAMODE_ON
+#define FS_PORT_DMA_MIN FSDMAMODE_OFF
+#define FS_PORT_DMA_DEF FSDMAMODE_OFF
+
+/* Number of Tx buffers */
+#define FS_PORT_TX_NUM_BUFFERS_MIN 2
+#define FS_PORT_TX_NUM_BUFFERS_MAX 128
+#define FS_PORT_TX_NUM_BUFFERS_DEF 8
+#define FS_PORT_TX_NUM_BUFFERS_UNDEF 0xFFFFFFFF
+#define FS_PORT_TX_NUM_BUFFERS_PARAM_NAME "Port%u_TxNumBuffers"
+#define FS_PORT_TX_NUM_BUFFERS_PARAM_NAME_U L"Port%u_TxNumBuffers"
+
+/* Number of Rx buffers */
+#define FS_PORT_RX_NUM_BUFFERS_MIN 2
+#define FS_PORT_RX_NUM_BUFFERS_MAX 128
+#define FS_PORT_RX_NUM_BUFFERS_DEF 8
+#define FS_PORT_RX_NUM_BUFFERS_UNDEF 0xFFFFFFFF
+#define FS_PORT_RX_NUM_BUFFERS_PARAM_NAME "Port%u_RxNumBuffers"
+#define FS_PORT_RX_NUM_BUFFERS_PARAM_NAME_U L"Port%u_RxNumBuffers"
+
+#ifdef FS_DECLARE_CFG_ARRAYS
+char* szFsNumBuffersTable[] = {"2", "4", "8", "16", "32", "64", "128", 0};
+#else
+char* szFsNumBuffersTable[];
+#endif
+
+/* Encoding values */
+#define FS_PORT_ENCODING_PARAM_NAME "Port%u_Encoding"
+#define FS_PORT_ENCODING_PARAM_NAME_U L"Port%u_Encoding"
+#define FS_PORT_ENCODING_NRZ 0x80
+#define FS_PORT_ENCODING_NRZI 0xa0
+#define FS_PORT_ENCODING_FM0 0xc0
+#define FS_PORT_ENCODING_FM1 0xd0
+#define FS_PORT_ENCODING_MAN 0xe0
+#define FS_PORT_ENCODING_MIN FS_PORT_ENCODING_NRZ
+#define FS_PORT_ENCODING_MAX FS_PORT_ENCODING_MAN
+#define FS_PORT_ENCODING_DEF FS_PORT_ENCODING_NRZ
+
+#ifdef FS_DECLARE_CFG_ARRAYS
+char* szFsEncodingTypesTable[] = {"NRZ", "NRZI", "FM0", "FM1", "MAN", 0};
+#else
+char* szFsEncodingTypesTable[];
+#endif
+
+
+/* Registry Config Names */
+#define FS_EVENT_SUBKEY_NAME "SYSTEM\\CurrentControlSet\\Services\\EventLog\\System\\farsynct"
+#define EVENT_VAR_TYPES_SUPPORTED "TypesSupported"
+#define EVENT_VAR_MESSAGE_FILE "EventMessageFile"
+#define FS_MESSAGE_FILE "%SystemRoot%\\System32\\IOLOGMSG.DLL;%SystemRoot%\\System32\\Drivers\\farsynct.sys"
+
+#define REG_SERVICES_ROOT_U L"\\REGISTRY\\Machine\\SYSTEM\\CurrentControlSet\\Services\\"
+#define REG_MACHINE_ROOT_U L"\\REGISTRY\\Machine\\"
+#define REG_FSWAN_CONFIG_PATH_U L"SOFTWARE\\FarSite\\FSWAN"
+
+/* Pool Tags */
+
+#define FARSYNCT_TAG1 '1TsF'
+#define FARSYNCM_TAG1 '1PsF'
+
+#define FSX25MDM_TAG1 '1MsF'
+
+#define FSKUTL_TAG1 '1UsF'
+
+#define FSWAN_TAG1 '1WsF'
+#define FSWAN_TAG2 '2WsF'
+
+/* fstap config */
+
+#define FSTAP_DEVICENAME_PARAM_NAME "DeviceName"
+#define FSTAP_PORT_PARAM_NAME "Port"
+#define FSTAP_IGNORE_SIGNALS_DEF FALSE
+#define FSTAP_IGNORE_SIGNALS_PARAM_NAME "IgnoreSignals"
+#define FSTAP_ENABLE_MONITORING_DEF TRUE
+#define FSTAP_ENABLE_MONITORING_PARAM_NAME "EnableMonitoring"
+
+/* te1 config */
+
+#define FS_PORT_FRAMING_MIN FRAMING_E1
+#define FS_PORT_FRAMING_MAX FRAMING_T1
+#define FS_PORT_FRAMING_PARAM_NAME "Port%u_Framing"
+#define FS_PORT_FRAMING_PARAM_NAME_U L"Port%u_Framing"
+
+#ifdef FS_DECLARE_CFG_ARRAYS
+char* szFsFramingTypesTable[] = {"E1", "J1", "T1", 0};
+#else
+char* szFsFramingTypesTable[];
+#endif
+
+#define FS_PORT_ECLOCKING_MIN CLOCKING_SLAVE
+#define FS_PORT_ECLOCKING_MAX CLOCKING_MASTER
+#ifdef notreq
+#define FS_PORT_ECLOCKING_PARAM_NAME "Port%u_Clocking"
+#define FS_PORT_ECLOCKING_PARAM_NAME_U L"Port%u_Clocking"
+#endif
+
+#ifdef FS_DECLARE_CFG_ARRAYS
+char* szFsEClockingTypesTable[] = {"Slave", "Master", 0};
+#else
+char* szFsEClockingTypesTable[];
+#endif
+
+#define FS_PORT_DATARATE_MIN 8000
+#define FS_PORT_E1_DATARATE_MAX 2048000
+#define FS_PORT_T1_DATARATE_MAX 1544000
+#ifdef notreq
+#define FS_PORT_DATARATE_PARAM_NAME "Port%u_DataRate"
+#define FS_PORT_DATARATE_PARAM_NAME_U L"Port%u_DataRate"
+
+#ifdef FS_DECLARE_CFG_ARRAYS
+char* szFsDataRateTable[] = {"1", "2", 0};
+#else
+char* szFsDataRateTable[];
+#endif
+#endif
+
+#define FS_PORT_STRUCTURE_MIN STRUCTURE_UNFRAMED
+#define FS_PORT_STRUCTURE_MAX STRUCTURE_T1_72
+#define FS_PORT_STRUCTURE_PARAM_NAME "Port%u_Structure"
+#define FS_PORT_STRUCTURE_PARAM_NAME_U L"Port%u_Structure"
+
+
+#define STRUCTURE_UNFRAMED 0
+#define STRUCTURE_E1_DOUBLE 1
+#define STRUCTURE_E1_CRC4 2
+#define STRUCTURE_E1_DEFAULT STRUCTURE_E1_CRC4
+#define STRUCTURE_DEFAULT STRUCTURE_E1_CRC4
+#define STRUCTURE_E1_CRC4M 3
+#define STRUCTURE_T1_4 4
+#define STRUCTURE_T1_12 5
+#define STRUCTURE_T1_24 6
+#define STRUCTURE_T1_DEFAULT STRUCTURE_T1_24
+#define STRUCTURE_T1_72 7
+
+#ifdef FS_DECLARE_CFG_ARRAYS
+char* szFsE1StructureTypesTable[] = {"Unframed", "Double", "CRC4", "CRC4M", 0};
+int iFsE1StructureValuesTable[] = {STRUCTURE_UNFRAMED, STRUCTURE_E1_DOUBLE, STRUCTURE_E1_CRC4, STRUCTURE_E1_CRC4M, -1};
+char* szFsT1StructureTypesTable[] = {"Unframed", "F4 (FT)", "F12 (D3/D4, SF)", "F24 (D5, Fe, ESF)", "F72 (SLC96)", 0};
+int iFsT1StructureValuesTable[] = {STRUCTURE_UNFRAMED, STRUCTURE_T1_4, STRUCTURE_T1_12, STRUCTURE_T1_24, STRUCTURE_T1_72, -1};
+#else
+char* szFsE1StructureTypesTable[];
+int iFsE1StructureValuesTable[];
+char* szFsT1StructureTypesTable[];
+int iFsT1StructureValuesTable[];
+#endif
+
+#define FS_PORT_IFACE_MIN INTERFACE_RJ48C
+#define FS_PORT_IFACE_MAX INTERFACE_BNC
+#define FS_PORT_IFACE_PARAM_NAME "Port%u_Iface"
+#define FS_PORT_IFACE_PARAM_NAME_U L"Port%u_Iface"
+
+#ifdef FS_DECLARE_CFG_ARRAYS
+char* szFsE1IfaceTypesTable[] = {"RJ48C", "BNC", 0};
+int iFsE1IfaceValuesTable[] = {INTERFACE_RJ48C, INTERFACE_BNC, -1};
+char* szFsT1IfaceTypesTable[] = {"RJ48C", 0};
+int iFsT1IfaceValuesTable[] = {INTERFACE_RJ48C, -1};
+#else
+char* szFsE1IfaceTypesTable[];
+int iFsE1IfaceValuesTable[];
+char* szFsT1IfaceTypesTable[];
+int iFsT1IfaceValuesTable[];
+#endif
+
+#define FS_PORT_CODING_MIN CODING_HDB3
+#define FS_PORT_CODING_MAX CODING_B8ZS
+#define FS_PORT_CODING_PARAM_NAME "Port%u_Coding"
+#define FS_PORT_CODING_PARAM_NAME_U L"Port%u_Coding"
+
+#ifdef FS_DECLARE_CFG_ARRAYS
+//char* szFsE1CodingTypesTable[] = {"HDB3", "NRZ", "CMI", "CMI-HDB3", "AMI", 0};
+//int iFsE1CodingValuesTable[] = {CODING_HDB3, CODING_NRZ, CODING_CMI, CODING_CMI_HDB3, CODING_AMI, -1};
+char* szFsE1CodingTypesTable[] = {"HDB3", "AMI", 0};
+int iFsE1CodingValuesTable[] = {CODING_HDB3, CODING_AMI, -1};
+//char* szFsT1CodingTypesTable[] = {"NRZ", "CMI", "CMI_B8ZS", "AMI", "AMI-ZCS", "B8ZS", 0};
+//int iFsT1CodingValuesTable[] = {CODING_NRZ, CODING_CMI, CODING_CMI_B8ZS, CODING_AMI, CODING_AMI_ZCS, CODING_B8ZS, -1};
+char* szFsT1CodingTypesTable[] = {"AMI", "AMI-ZCS", "B8ZS", 0};
+int iFsT1CodingValuesTable[] = {CODING_AMI, CODING_AMI_ZCS, CODING_B8ZS, -1};
+#else
+char* szFsE1CodingTypesTable[];
+int iFsE1CodingValuesTable[];
+char* szFsT1CodingTypesTable[];
+int iFsT1CodingValuesTable[];
+#endif
+
+#define FS_PORT_LBO_MIN LBO_0dB
+#define FS_PORT_LBO_MAX LBO_22dB5
+#define FS_PORT_LBO_PARAM_NAME "Port%u_LBO"
+#define FS_PORT_LBO_PARAM_NAME_U L"Port%u_LBO"
+
+#ifdef FS_DECLARE_CFG_ARRAYS
+char* szFsLBOTypesTable[] = {"0", "7.5", "15", "22.5", 0};
+#else
+char* szFsLBOTypesTable[];
+#endif
+
+#define FS_PORT_EQUALIZER_MIN EQUALIZER_SHORT
+#define FS_PORT_EQUALIZER_MAX EQUALIZER_LONG
+#define FS_PORT_EQUALIZER_PARAM_NAME "Port%u_Equalizer"
+#define FS_PORT_EQUALIZER_PARAM_NAME_U L"Port%u_Equalizer"
+
+#ifdef FS_DECLARE_CFG_ARRAYS
+char* szFsEqualizerTypesTable[] = {"Short", "Long", 0};
+#else
+char* szFsEqualizerTypesTable[];
+#endif
+
+#define FS_PORT_LOOP_MODE_MIN LOOP_NONE
+#define FS_PORT_LOOP_MODE_MAX LOOP_REMOTE
+#define FS_PORT_LOOP_MODE_PARAM_NAME "Port%u_LoopMode"
+#define FS_PORT_LOOP_MODE_PARAM_NAME_U L"Port%u_LoopMode"
+
+#ifdef FS_DECLARE_CFG_ARRAYS
+char* szFsLoopModeTypesTable[] = {"None", "Local", "Payload (excl TS0)", "Payload (incl TS0)", "Remote", 0};
+#else
+char* szFsLoopModeTypesTable[];
+#endif
+
+#define FS_PORT_RANGE_MIN RANGE_0_40_M
+#define FS_PORT_RANGE_MAX RANGE_162_200_M
+#define FS_PORT_RANGE_PARAM_NAME "Port%u_Range"
+#define FS_PORT_RANGE_PARAM_NAME_U L"Port%u_Range"
+
+#ifdef FS_DECLARE_CFG_ARRAYS
+char* szFsRangeTypesTable[] = {"0-133ft (0-40m)", "133-266ft (40-81m)", "266-399ft (81-122m)", "399-533ft (122-162m)", "533-655ft (162-200m)", 0};
+#else
+char* szFsRangeTypesTable[];
+#endif
+
+#define FS_PORT_BUFFER_MODE_MIN BUFFER_2_FRAME
+#define FS_PORT_BUFFER_MODE_MAX BUFFER_NONE
+#define FS_PORT_TX_BUFFER_MODE_PARAM_NAME "Port%u_TxBufferMode"
+#define FS_PORT_TX_BUFFER_MODE_PARAM_NAME_U L"Port%u_TxBufferMode"
+#define FS_PORT_RX_BUFFER_MODE_PARAM_NAME "Port%u_RxBufferMode"
+#define FS_PORT_RX_BUFFER_MODE_PARAM_NAME_U L"Port%u_RxBufferMode"
+
+#ifdef FS_DECLARE_CFG_ARRAYS
+char* szFsBufferModeTypesTable[] = {"2 Frame", "1 Frame", "96 bit", "None", 0};
+#else
+char* szFsBufferModeTypesTable[];
+#endif
+
+#define FS_PORT_STARTING_TS_MIN 0
+#define FS_PORT_STARTING_TS_MAX 31
+#define FS_PORT_STARTING_TS_PARAM_NAME "Port%u_StartingTs"
+#define FS_PORT_STARTING_TS_PARAM_NAME_U L"Port%u_StartingTs"
+
+#ifdef FS_DECLARE_CFG_ARRAYS
+char* szFsE1StartingTSTypesTable[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9",
+ "10", "11", "12", "13", "14", "15", "16", "17", "18", "19",
+ "20", "21", "22", "23", "24", "25", "26", "27", "28", "29",
+ "30", "31",
+ 0};
+char* szFsT1StartingTSTypesTable[] = { "0", "1", "2", "3", "4", "5", "6", "7", "8", "9",
+ "10", "11", "12", "13", "14", "15", "16", "17", "18", "19",
+ "20", "21", "22", "23",
+ 0};
+#else
+char* szFsE1StartingTSTypesTable[];
+char* szFsT1StartingTSTypesTable[];
+#endif
+
+#define FS_PORT_LOS_THRESHOLD_MIN 0
+#define FS_PORT_LOS_THRESHOLD_MAX 7
+#define FS_PORT_LOS_THRESHOLD_PARAM_NAME "Port%u_LOSThreshold"
+#define FS_PORT_LOS_THRESHOLD_PARAM_NAME_U L"Port%u_LOSThreshold"
+
+#ifdef FS_DECLARE_CFG_ARRAYS
+char* szFsLOSThresholdTypesTable[] = { "0", "1", "2", "3", "4", "5", "6", "7", 0};
+#else
+char* szFsLOSThresholdTypesTable[];
+#endif
+
+#define FS_PORT_ENABLE_IDLE_CODE_MIN 0
+#define FS_PORT_ENABLE_IDLE_CODE_MAX 1
+#define FS_PORT_ENABLE_IDLE_CODE_PARAM_NAME "Port%u_EnableIdleCode"
+#define FS_PORT_ENABLE_IDLE_CODE_PARAM_NAME_U L"Port%u_EnableIdleCode"
+
+#define FS_PORT_IDLE_CODE_MIN 0
+#define FS_PORT_IDLE_CODE_MAX 0xff
+#define FS_PORT_IDLE_CODE_PARAM_NAME "Port%u_IdleCode"
+#define FS_PORT_IDLE_CODE_PARAM_NAME_U L"Port%u_IdleCode"
+
+#define FS_PORT_START_TXRX_MIN 0
+#define FS_PORT_START_TXRX_DEF START_TX_AND_RX
+#define FS_PORT_START_TXRX_MAX START_TX_AND_RX
+#define FS_PORT_START_TXRX_PARAM_NAME "Port%u_StartTxRx"
+#define FS_PORT_START_TXRX_PARAM_NAME_U L"Port%u_StartTxRx"
+
+#define FS_PORT_CLOCK_SOURCE_MIN FS_CLOCK_REFERENCE_OSCILLATOR
+#define FS_PORT_CLOCK_SOURCE_DEF FS_CLOCK_REFERENCE_OSCILLATOR
+#define FS_PORT_CLOCK_SOURCE_MAX FS_CLOCK_REFERENCE_CTBUS
+#define FS_PORT_CLOCK_SOURCE_PARAM_NAME "Port%u_ClockSource"
+#define FS_PORT_CLOCK_SOURCE_PARAM_NAME_U L"Port%u_ClockSource"
+
+#ifdef FS_DECLARE_CFG_ARRAYS
+char* szFsClockSourceTable[] = {"Local Oscillator", "CT_BUS", 0};
+#else
+char* szFsClockSourceTable[];
+#endif
+
+#define FS_SERIAL_EXTENDED_CLOCKING_DEF FALSE
+#define FS_SERIAL_EXTENDED_CLOCKING_PARAM_NAME "Port%u_ExtendedClocking"
+#define FS_SERIAL_EXTENDED_CLOCKING_PARAM_NAME_U L"Port%u_ExtendedClocking"
+
+#define FS_SERIAL_INT_TX_CLOCK_DEF FALSE
+#define FS_SERIAL_INT_TX_CLOCK_PARAM_NAME "Port%u_InternalTxClock"
+#define FS_SERIAL_INT_TX_CLOCK_PARAM_NAME_U L"Port%u_InternalTxClock"
+
+#define FS_SERIAL_INT_RX_CLOCK_DEF FALSE
+#define FS_SERIAL_INT_RX_CLOCK_PARAM_NAME "Port%u_InternalRxClock"
+#define FS_SERIAL_INT_RX_CLOCK_PARAM_NAME_U L"Port%u_InternalRxClock"
+
+#define FS_SERIAL_TERM_TX_CLOCK_DEF FALSE
+#define FS_SERIAL_TERM_TX_CLOCK_PARAM_NAME "Port%u_TerminalTxClock"
+#define FS_SERIAL_TERM_TX_CLOCK_PARAM_NAME_U L"Port%u_TerminalTxClock"
+
+#define FS_SERIAL_TERM_RX_CLOCK_DEF FALSE
+#define FS_SERIAL_TERM_RX_CLOCK_PARAM_NAME "Port%u_TerminalRxClock"
+#define FS_SERIAL_TERM_RX_CLOCK_PARAM_NAME_U L"Port%u_TerminalRxClock"
+
+#define FS_SERIAL_DCD_OUTPUT_DEF FALSE
+#define FS_SERIAL_DCD_OUTPUT_PARAM_NAME "Port%u_DCDOutput"
+#define FS_SERIAL_DCD_OUTPUT_PARAM_NAME_U L"Port%u_DCDOutput"
+
+#define FS_PORT_MSB_DEF FALSE
+#define FS_PORT_TX_MSB_PARAM_NAME "Port%u_TxMSB"
+#define FS_PORT_TX_MSB_PARAM_NAME_U L"Port%u_TxMSB"
+#define FS_PORT_RX_MSB_PARAM_NAME "Port%u_RxMSB"
+#define FS_PORT_RX_MSB_PARAM_NAME_U L"Port%u_RxMSB"
+
+#endif // __FSCFG_H_
diff --git a/lib/farsync/windows/sdci.h b/lib/farsync/windows/sdci.h
new file mode 100644
index 0000000..220da48
--- /dev/null
+++ b/lib/farsync/windows/sdci.h
@@ -0,0 +1,700 @@
+/*******************************************************************************
+*
+* Program : FarSync (generic)
+*
+* File : sdci.h
+*
+* Description : This header file is based on the Equates and Structure Layouts
+* page of the SDCI section of the July '99 MSDN
+*
+* Modifications
+*
+* Version 2.1.0 01Mar01 WEB Add QuickStart and GetLinkInterface
+* Version 2.2.0 18Jul01 WEB Certification candidate
+* Version 2.2.1 07Aug01 JPG Add FarSyncReadSignals
+* Version 2.2.2 03Sep01 WEB Extend USERDPC definition to include indication
+* param instead of bReadIR
+* 22Oct01 MJD Added Transparent Mode support - defined
+* LinkOption_Transparent
+* Version 3.0.0 12Sep02 WEB Add dma mode and cardinfoex support definitions
+* Version 3.1.0 07Nov02 WEB Add interrupt handshake mode support definitions
+* Version 3.2.0 09Dec02 WEB Add LinkOption_InvertRxClock
+* Add ResetStats IOCTL and extended InterfaceRecord
+* Complete CardInfoEx definition
+* Version 3.3.0 30Apr04 WEB Extend CardInfoEx to include physical + IO address
+* Version 3.3.1 03Mar05 WEB Removed SA_TxAbort which was previously incorrectly
+* named
+* Version 4.0.1 03Mar05 WEB Correct IOCTL_SDCI_xxx definitions. Now requires
+* CTL_CODE to be defined i.e winioctl.h (user-mode) or
+* wdm.h (kernel-mode) must be included before this file.
+* Add USERDPC_INDICATION_TX, FarSyncSetUserDpcEx,
+* IoctlCodeFarSyncSetPortConfig,
+* IoctlCodeFarSyncGetPortConfig,
+* IoctlCodeFarSyncSetSerialConfig,
+* IoctlCodeFarSyncGetSerialConfig
+* IoctlCodeFarSyncSetCTBusConfig &
+* IoctlCodeFarSyncGetCTBusConfig
+* Version 4.0.1.1 03Mar05 WEB Update FS_XXX_CONFIG structures
+* Version 4.0.1.2 04Mar05 WEB Update error counter explanations,
+* FarSync-specific error codes & further
+* rationalisations
+* Version 4.1.0.0 15Jun05 WEB Add TE1 and additional T4E definitions
+* Add monitoring IOCTLs
+* Version 4.1.0.1 02Aug05 MJD Added USERDPC_INDICATION_CLOCK_SWITCH_TO_PRIMARY
+* Version 4.1.0.2 09Aug05 MJD Update FS_CLOCKING_STATUS to include uCTAInUse so
+* that apps can tell which CT Bus the hardware is
+* using in slave mode, structure version now 2.
+* Version 4.2.0 12Sep05 WEB Add async and synth detection fields to
+* FSCARDINFOEX
+* SA_RxFrameTooBig is now supported by M1P
+* Add FS_ERROR_INVALID_LENGTH definition
+*
+*******************************************************************************/
+
+#ifndef __SDCI_H_
+#define __SDCI_H_
+
+/*****************************************************************************/
+//
+// There are the IOCTL code values used to communicate with the SDCI driver.
+//
+/*****************************************************************************/
+
+#define IOCTL_SDCI_SetEvent CTL_CODE(0, (0x410 >> 2), METHOD_BUFFERED, FILE_ANY_ACCESS)
+#define IOCTL_SDCI_SetLinkCharacteristics CTL_CODE(0, (0x420 >> 2), METHOD_BUFFERED, FILE_ANY_ACCESS)
+#define IOCTL_SDCI_SetV24OutputStatus CTL_CODE(0, (0x430 >> 2), METHOD_BUFFERED, FILE_ANY_ACCESS)
+#define IOCTL_SDCI_TransmitFrame CTL_CODE(0, (0x440 >> 2), METHOD_IN_DIRECT, FILE_ANY_ACCESS)
+#define IOCTL_SDCI_AbortTransmit CTL_CODE(0, (0x450 >> 2), METHOD_BUFFERED, FILE_ANY_ACCESS)
+#define IOCTL_SDCI_AbortReceiver CTL_CODE(0, (0x460 >> 2), METHOD_BUFFERED, FILE_ANY_ACCESS)
+#define IOCTL_SDCI_OffBoardLoad CTL_CODE(0, (0x470 >> 2), METHOD_BUFFERED, FILE_ANY_ACCESS)
+#define IOCTL_SDCI_GetV24Status CTL_CODE(0, (0x620 >> 2), METHOD_NEITHER, FILE_ANY_ACCESS)
+#define IOCTL_SDCI_ReceiveFrame CTL_CODE(0, (0x630 >> 2), METHOD_OUT_DIRECT, FILE_ANY_ACCESS)
+#define IOCTL_SDCI_FarSyncReceiveFrame CTL_CODE(0, (0x630 >> 2), METHOD_NEITHER, FILE_ANY_ACCESS)
+#define IOCTL_SDCI_ReadInterfaceRecord CTL_CODE(0, (0x640 >> 2), METHOD_OUT_DIRECT, FILE_ANY_ACCESS)
+#define IOCTL_SDCI_FarSyncReadInterfaceRecord CTL_CODE(0, (0x640 >> 2), METHOD_NEITHER, FILE_ANY_ACCESS)
+#define IOCTL_SDCI_FarSyncReadInterfaceRecordEx CTL_CODE(0, (0x650 >> 2), METHOD_NEITHER, FILE_ANY_ACCESS)
+#define IOCTL_SDCI_FarSyncSetLinkInterface CTL_CODE(0, (0x710 >> 2), METHOD_BUFFERED, FILE_ANY_ACCESS)
+#define IOCTL_SDCI_FarSyncSetUserDpc CTL_CODE(0, (0x720 >> 2), METHOD_BUFFERED, FILE_ANY_ACCESS)
+#define IOCTL_SDCI_FarSyncSetCardMode CTL_CODE(0, (0x730 >> 2), METHOD_BUFFERED, FILE_ANY_ACCESS)
+#define IOCTL_SDCI_FarSyncReadCardInfo CTL_CODE(0, (0x740 >> 2), METHOD_NEITHER, FILE_ANY_ACCESS)
+#define IOCTL_SDCI_FarSyncQuickStart CTL_CODE(0, (0x750 >> 2), METHOD_BUFFERED, FILE_ANY_ACCESS)
+#define IOCTL_SDCI_FarSyncGetLinkInterface CTL_CODE(0, (0x760 >> 2), METHOD_NEITHER, FILE_ANY_ACCESS)
+#define IOCTL_SDCI_FarSyncReadSignals CTL_CODE(0, (0x770 >> 2), METHOD_NEITHER, FILE_ANY_ACCESS)
+#define IOCTL_SDCI_FarSyncSetDMAMode CTL_CODE(0, (0x780 >> 2), METHOD_BUFFERED, FILE_ANY_ACCESS)
+#define IOCTL_SDCI_FarSyncGetDMAMode CTL_CODE(0, (0x790 >> 2), METHOD_NEITHER, FILE_ANY_ACCESS)
+#define IOCTL_SDCI_FarSyncReadCardInfoEx CTL_CODE(0, (0x7a0 >> 2), METHOD_NEITHER, FILE_ANY_ACCESS)
+#define IOCTL_SDCI_FarSyncSetHandShakeMode CTL_CODE(0, (0x7b0 >> 2), METHOD_BUFFERED, FILE_ANY_ACCESS)
+#define IOCTL_SDCI_FarSyncGetHandShakeMode CTL_CODE(0, (0x7c0 >> 2), METHOD_NEITHER, FILE_ANY_ACCESS)
+#define IOCTL_SDCI_FarSyncResetStats CTL_CODE(0, (0x7d0 >> 2), METHOD_BUFFERED, FILE_ANY_ACCESS)
+#define IOCTL_SDCI_FarSyncReadTE1Status CTL_CODE(0, (0x7e0 >> 2), METHOD_NEITHER, FILE_ANY_ACCESS)
+#define IOCTL_SDCI_FarSyncSetUserDpcEx CTL_CODE(0, (0x7f0 >> 2), METHOD_BUFFERED, FILE_ANY_ACCESS)
+#define IOCTL_SDCI_FarSyncSetPortConfig CTL_CODE(0, (0x810 >> 2), METHOD_BUFFERED, FILE_ANY_ACCESS)
+#define IOCTL_SDCI_FarSyncGetPortConfig CTL_CODE(0, (0x820 >> 2), METHOD_NEITHER, FILE_ANY_ACCESS)
+#define IOCTL_SDCI_FarSyncSetSerialConfig CTL_CODE(0, (0x830 >> 2), METHOD_BUFFERED, FILE_ANY_ACCESS)
+#define IOCTL_SDCI_FarSyncGetSerialConfig CTL_CODE(0, (0x840 >> 2), METHOD_NEITHER, FILE_ANY_ACCESS)
+#define IOCTL_SDCI_FarSyncSetCTBusConfig CTL_CODE(0, (0x850 >> 2), METHOD_BUFFERED, FILE_ANY_ACCESS)
+#define IOCTL_SDCI_FarSyncGetCTBusConfig CTL_CODE(0, (0x860 >> 2), METHOD_NEITHER, FILE_ANY_ACCESS)
+#define IOCTL_SDCI_FarSyncSetTE1Config CTL_CODE(0, (0x870 >> 2), METHOD_BUFFERED, FILE_ANY_ACCESS)
+#define IOCTL_SDCI_FarSyncGetTE1Config CTL_CODE(0, (0x880 >> 2), METHOD_NEITHER, FILE_ANY_ACCESS)
+#define IOCTL_SDCI_FarSyncSetCTBusBackupConfig CTL_CODE(0, (0x890 >> 2), METHOD_BUFFERED, FILE_ANY_ACCESS)
+#define IOCTL_SDCI_FarSyncGetCTBusBackupConfig CTL_CODE(0, (0x8a0 >> 2), METHOD_NEITHER, FILE_ANY_ACCESS)
+#define IOCTL_SDCI_FarSyncGetClockingStatus CTL_CODE(0, (0x8b0 >> 2), METHOD_NEITHER, FILE_ANY_ACCESS)
+#define IOCTL_SDCI_FarSyncSetMonitoring CTL_CODE(0, (0x8c0 >> 2), METHOD_BUFFERED, FILE_ANY_ACCESS)
+#define IOCTL_SDCI_FarSyncGetMonitoringStatus CTL_CODE(0, (0x8d0 >> 2), METHOD_NEITHER, FILE_ANY_ACCESS)
+
+#define IoctlCodeSetEvent IOCTL_SDCI_SetEvent
+#define IoctlCodeSetLinkChar IOCTL_SDCI_SetLinkCharacteristics
+#define IoctlCodeSetV24 IOCTL_SDCI_SetV24OutputStatus
+#define IoctlCodeTxFrame IOCTL_SDCI_TransmitFrame
+#define IoctlCodeAbortTransmit IOCTL_SDCI_AbortTransmit
+#define IoctlCodeAbortReceiver IOCTL_SDCI_AbortReceiver
+#define IoctlCodeOffBoardLoad IOCTL_SDCI_OffBoardLoad
+#define IoctlCodeGetV24 IOCTL_SDCI_GetV24Status
+#define IoctlCodeRxFrame IOCTL_SDCI_ReceiveFrame
+#define IoctlCodeFarSyncRxFrame IOCTL_SDCI_FarSyncReceiveFrame
+#define IoctlCodeReadInterfaceRecord IOCTL_SDCI_ReadInterfaceRecord
+#define IoctlCodeFarSyncReadInterfaceRecord IOCTL_SDCI_FarSyncReadInterfaceRecord
+#define IoctlCodeFarSyncReadInterfaceRecordEx IOCTL_SDCI_FarSyncReadInterfaceRecordEx
+#define IoctlCodeFarSyncSetLinkInterface IOCTL_SDCI_FarSyncSetLinkInterface
+#define IoctlCodeSetLinkInterface IoctlCodeFarSyncSetLinkInterface
+#define IoctlCodeFarSyncSetUserDpc IOCTL_SDCI_FarSyncSetUserDpc
+#define IoctlCodeFarSyncSetCardMode IOCTL_SDCI_FarSyncSetCardMode
+#define IoctlCodeFarSyncReadCardInfo IOCTL_SDCI_FarSyncReadCardInfo
+#define IoctlCodeFarSyncQuickStart IOCTL_SDCI_FarSyncQuickStart
+#define IoctlCodeFarSyncGetLinkInterface IOCTL_SDCI_FarSyncGetLinkInterface
+#define IoctlCodeFarSyncReadSignals IOCTL_SDCI_FarSyncReadSignals
+#define IoctlCodeFarSyncSetDMAMode IOCTL_SDCI_FarSyncSetDMAMode
+#define IoctlCodeFarSyncGetDMAMode IOCTL_SDCI_FarSyncGetDMAMode
+#define IoctlCodeFarSyncReadCardInfoEx IOCTL_SDCI_FarSyncReadCardInfoEx
+#define IoctlCodeFarSyncSetHandShakeMode IOCTL_SDCI_FarSyncSetHandShakeMode
+#define IoctlCodeFarSyncGetHandShakeMode IOCTL_SDCI_FarSyncGetHandShakeMode
+#define IoctlCodeFarSyncResetStats IOCTL_SDCI_FarSyncResetStats
+#define IoctlCodeFarSyncReadTE1Status IOCTL_SDCI_FarSyncReadTE1Status
+#define IoctlCodeFarSyncSetUserDpcEx IOCTL_SDCI_FarSyncSetUserDpcEx
+#define IoctlCodeFarSyncSetPortConfig IOCTL_SDCI_FarSyncSetPortConfig
+#define IoctlCodeFarSyncGetPortConfig IOCTL_SDCI_FarSyncGetPortConfig
+#define IoctlCodeFarSyncSetSerialConfig IOCTL_SDCI_FarSyncSetSerialConfig
+#define IoctlCodeFarSyncGetSerialConfig IOCTL_SDCI_FarSyncGetSerialConfig
+#define IoctlCodeFarSyncSetCTBusConfig IOCTL_SDCI_FarSyncSetCTBusConfig
+#define IoctlCodeFarSyncGetCTBusConfig IOCTL_SDCI_FarSyncGetCTBusConfig
+#define IoctlCodeFarSyncSetTE1Config IOCTL_SDCI_FarSyncSetTE1Config
+#define IoctlCodeFarSyncGetTE1Config IOCTL_SDCI_FarSyncGetTE1Config
+#define IoctlCodeFarSyncSetCTBusBackupConfig IOCTL_SDCI_FarSyncSetCTBusBackupConfig
+#define IoctlCodeFarSyncGetCTBusBackupConfig IOCTL_SDCI_FarSyncGetCTBusBackupConfig
+#define IoctlCodeFarSyncGetClockingStatus IOCTL_SDCI_FarSyncGetClockingStatus
+#define IoctlCodeFarSyncSetMonitoring IOCTL_SDCI_FarSyncSetMonitoring
+#define IoctlCodeFarSyncGetMonitoringStatus IOCTL_SDCI_FarSyncGetMonitoringStatus
+
+/*****************************************************************************/
+/* Constants for the driver-specific IOCtl return codes. */
+/*****************************************************************************/
+#define CEDNODMA 0xff80 /* Warning (NO DMA!) from set link chrctrstcs */
+/*****************************************************************************/
+/* Equates for the link options byte 1. */
+/*****************************************************************************/
+#define CEL4WIRE 0x80
+#define CELNRZI 0x40
+#define CELPDPLX 0x20
+#define CELSDPLX 0x10
+#define CELCLOCK 0x08
+#define CELDSRS 0x04
+#define CELSTNBY 0x02
+#define CELDMA 0x01
+
+/*****************************************************************************/
+/* Equates for the driver set link characteristics byte 1. */
+/*****************************************************************************/
+#define CED4WIRE 0x80
+#define CEDNRZI 0x40
+#define CEDHDLC 0x20
+#define CEDFDPLX 0x10
+#define CEDCLOCK 0x08
+#define CEDDMA 0x04
+#define CEDRSTAT 0x02
+#define CEDCSTAT 0x01
+
+/* Nicer names for NT-style code */
+
+#define LinkOption_4Wire CED4WIRE
+#define LinkOption_InvertRxClock CEDDMA
+#define LinkOption_NRZI CEDNRZI
+#define LinkOption_HDLC CEDHDLC
+#define LinkOption_FullDuplex CEDFDPLX
+#define LinkOption_InternalClock CEDCLOCK
+#define LinkOption_DMA CEDDMA
+#define LinkOption_ResetStatistics CEDRSTAT
+#define LinkOption_Transparent CEDCSTAT
+
+/*****************************************************************************/
+/* Equates for the output V24 interface flags. */
+/*****************************************************************************/
+#define CED24RTS 0x01
+#define CED24DTR 0x02
+// #define CED24DRS 0x04- not used. 0x04 is instead used by DCD
+// i.e. when configured as an output - see below
+#define CED24SLS 0x08
+#define CED24TST 0x10
+
+/* Nicer names for NT-style code */
+
+#define IR_OV24RTS CED24RTS
+#define IR_OV24DTR CED24DTR
+//#define IR_OV24DSRS CED24DRS
+#define IR_OV24SlSt CED24SLS
+#define IR_OV24Test CED24TST
+
+
+/*****************************************************************************/
+/* Equates for the input V24 interface flags. */
+/*****************************************************************************/
+#define CED24CTS 0x01
+#define CED24DSR 0x02
+#define CED24DCD 0x04
+#define CED24RI 0x08
+
+// CEDCR indicates the presense of a generic carrier i.e. independent of port type
+// e.g. DCD for V.25, CTS for X.21
+#define CEDCR 0x10
+
+ // Note: DCD can only be used as an output signal on a FarSync T4E
+ // and only then if a FarSyncSetSerialConfig has been previously
+ // issued for this port, with FsSerialConfig.uDCDOutput set to
+ // TRUE
+
+/* Nicer names for NT-style code */
+
+#define IR_IV24CTS CED24CTS
+#define IR_IV24DSR CED24DSR
+#define IR_IV24DCD CED24DCD
+#define IR_IV24RI CED24RI
+#define IR_IV24Test 0x10
+
+
+/*****************************************************************************/
+/* Structure for the device driver interface record. */
+/*****************************************************************************/
+
+#define CEDSTCRC 0 /* Frames received with incorrect CRC */
+#define CEDSTOFL 1 /* Frames received longer than the maximum */
+#define CEDSTUFL 2 /* Frames received less than 4 octets long */
+#define CEDSTSPR 3 /* Frames received ending on a non-octet bndry */
+#define CEDSTABT 4 /* Aborted frames received */
+#define CEDSTTXU 5 /* Transmitter interrupt underruns */
+#define CEDSTRXO 6 /* Receiver interrupt overruns */
+#define CEDSTDCD 7 /* DCD (RLSD) lost during frame reception */
+#define CEDSTCTS 8 /* CTS lost while transmitting */
+#define CEDSTDSR 9 /* DSR drops */
+#define CEDSTHDW 10 /* Hardware failures - adapter errors */
+
+#define CEDSTMAX 11
+
+#define SA_CRC_Error CEDSTCRC
+#define SA_RxFrameTooBig CEDSTOFL
+#define SA_RxFrameTooShort CEDSTUFL
+#define SA_Spare CEDSTSPR
+#define SA_RxAbort CEDSTABT
+#define SA_TxUnderrun CEDSTTXU
+#define SA_RxOverrun CEDSTRXO
+#define SA_DCDDrop CEDSTDCD
+#define SA_CTSDrop CEDSTCTS
+#define SA_DSRDrop CEDSTDSR
+#define SA_HardwareError CEDSTHDW
+
+// FarSync-specific counters mapped to existing SDCI definitions
+#define SA_FramingError SA_Spare
+#define SA_RxError SA_HardwareError
+#define SA_BufferUnavailable SA_DCDDrop
+#define SA_Parity SA_CRC_Error
+
+#define SA_Max_Stat CEDSTMAX
+
+// ****************************************************************************************************
+// FarSync supports the following counters. All other counter indices are not used by FarSync.
+
+// SA_CRC_Error Sync & Async modes
+// SA_FramingError Sync & Async modes
+// SA_RxOverrun Sync & Async modes
+
+// SA_RxAbort (Async) & (M1P Sync) modes only
+// SA_RxError Sync mode only
+// SA_TxUnderrun Sync mode only
+// SA_RxFrameTooShort M1P Sync mode only
+
+// SA_RxFrameTooBig Async mode (fifo overflow) & M1P Sync
+
+// Note that
+// 1) Async mode is currently only supported on the T4U - it is an optional extra feature
+// 2) On a TxU an SA_RxError indicates a received abort OR a rx frame length error (too big OR too small)
+// 3) On an M1P an SA_RxError indicates a alternative type of RxO as reported via SA_RxOverrun
+// ****************************************************************************************************
+
+/*****************************************************************************/
+/* InterfaceRecord definition */
+/* */
+/* For use with: */
+/* */
+/* IoctlCodeReadInterfaceRecord, */
+/* IoctlCodeFarSyncReadInterfaceRecord */
+/* */
+/*****************************************************************************/
+typedef struct _INTERFACE_RECORD
+{
+ int RxFrameCount; /* incremented after each frame rx'd */
+ int TxMaxFrSizeNow; /* max available frame size av. now */
+ /* (changes after each Tx DevIoctl */
+ /* to DD or after Tx completed) */
+ int StatusCount; /* How many status events have been */
+ /* triggered. */
+ UCHAR V24In; /* Last 'getv24 i/p' value got */
+ UCHAR V24Out; /* Last 'setv24 o/p' value set */
+
+/* The values for the indexes into the link statistics array of the */
+/* various types of statistic. */
+
+ int StatusArray[SA_Max_Stat];
+
+} IR, * PIR;
+
+/*****************************************************************************/
+/* InterfaceRecordEx definition */
+/* */
+/* For use with: */
+/* */
+/* IoctlCodeFarSyncReadInterfaceRecordEx */
+/* */
+/*****************************************************************************/
+typedef struct _INTERFACE_RECORD_EX
+{
+ IR InterfaceRecord;
+ int StatusCount; /* How many status events have been */
+ ULONG OpenedCount;
+ ULONG TxRequestCount;
+ ULONG TxCompleteCount;
+ ULONG RxPostedCount;
+ ULONG RxCompleteCount;
+} IREX, * PIREX;
+
+/*****************************************************************************/
+/* Set link characteristics parameter block definition */
+/* */
+/* For use with: */
+/* */
+/* IoctlCodeSetLinkChar */
+/* */
+/*****************************************************************************/
+typedef struct _SLPARMS
+{
+ int SLFrameSize; /* max frame size on link, should */
+ /* include 2-byte CRC - max is 8K */
+ LONG SLDataRate; /* not used by us - external clocks */
+ UCHAR SLOurAddress1; /* ) e.g C1/FF or 00/00 or 01/03 */
+ UCHAR SLOurAddress2; /* ) */
+ UCHAR SLLinkOptionsByte; /* see documentation & LinkOption_* */
+ UCHAR SLSpare1;
+} SLPARMS, *PSLPARMS;
+
+/*****************************************************************************/
+/* Set link interface parameter block definition */
+/* */
+/* For use with: */
+/* */
+/* IoctlCodeFarSyncSetLinkInterface, */
+/* IoctlCodeFarSyncGetLinkInterface */
+/* */
+/*****************************************************************************/
+#pragma pack(push, 4) /* Note: sizeof(FsLinkIfParms) is expected to be 0x10 */
+typedef struct _FSLINKIFPARMS
+{
+ HANDLE Context; // context for completion routine - not used
+ USHORT MaxFrameSize; // maximum frame size - not used
+ USHORT Interface; // line interface:
+ ULONG BaudRate; // baud rate
+ UCHAR Reserved; // reserved
+} FSLINKIFPARMS, * PFSLINKIFPARMS;
+#pragma pack(pop)
+
+// USER DPC DEFINITIONS - KERNEL-MODE ONLY
+
+#define USERDPC_INDICATION_RX 0
+#define USERDPC_INDICATION_SIGNAL 1
+#define USERDPC_INDICATION_ERROR 2
+#define USERDPC_INDICATION_TX 3 /* indicates that the number of tx buffers
+ in use by the card has changed - examine
+ *pUserDpcTxBuffersInUse for the current value */
+
+// FarSync T4E clock notifications
+#define USERDPC_INDICATION_CLOCK_RATE_CHANGED FS_INDICATION_CLOCK_RATE_CHANGED
+#define USERDPC_INDICATION_CLOCK_OUT_OF_TOLERANCE1 FS_INDICATION_CLOCK_OUT_OF_TOLERANCE1
+#define USERDPC_INDICATION_CLOCK_IN_TOLERANCE1 FS_INDICATION_CLOCK_IN_TOLERANCE1
+#define USERDPC_INDICATION_CLOCK_SWITCH_TO_BACKUP FS_INDICATION_CLOCK_SWITCH_TO_BACKUP
+#define USERDPC_INDICATION_CLOCK_OUT_OF_TOLERANCE2 FS_INDICATION_CLOCK_OUT_OF_TOLERANCE2
+#define USERDPC_INDICATION_CLOCK_IN_TOLERANCE2 FS_INDICATION_CLOCK_IN_TOLERANCE2
+#define USERDPC_INDICATION_CLOCK_SWITCH_TO_OSC FS_INDICATION_CLOCK_SWITCH_TO_OSC
+#define USERDPC_INDICATION_CLOCK_SWITCH_TO_CTA FS_INDICATION_CLOCK_SWITCH_TO_CTA
+#define USERDPC_INDICATION_CLOCK_SWITCH_TO_CTB FS_INDICATION_CLOCK_SWITCH_TO_CTB
+#define USERDPC_INDICATION_CLOCK_SWITCH_TO_PRIMARY FS_INDICATION_CLOCK_SWITCH_TO_PRIMARY
+
+// user DPC callback - kernel mode only
+typedef VOID (*USERDPC)(PVOID /* caller's handle*/, unsigned char /* indication */);
+
+/*****************************************************************************/
+/* Set user dpc parameter block definition */
+/* */
+/* For use with: */
+/* */
+/* IoctlCodeFarSyncSetUserDpc , */
+/* */
+/*****************************************************************************/
+#pragma pack(push, 4)
+typedef struct _FSUSERDPCINFO
+{
+ USERDPC fUserDpc; // callback address
+ PVOID pUserDpcParam; // param to supply in callback
+} FSUSERDPCINFO, * PFSUSERDPCINFO;
+
+/*****************************************************************************/
+/* Extended set user dpc parameter block definition */
+/* */
+/* For use with: */
+/* */
+/* IoctlCodeFarSyncSetUserDpcEx , */
+/* */
+/* If used, this structure must be allocated in NonPaged memory. */
+/* */
+/*****************************************************************************/
+typedef struct _FSUSERDPCINFOEX
+{
+ FSUSERDPCINFO fUserDpcInfo;
+ long * pUserDpcTxBuffersInUse; // ref to a SDCI client-owned var that is used to maintain the number of tx buffers
+ // currently in use by the card.
+} FSUSERDPCINFOEX, * PFSUSERDPCINFOEX;
+#pragma pack(pop)
+
+/*****************************************************************************/
+/* Card mode parameter block definition */
+/* */
+/* For use with: */
+/* */
+/* IoctlCodeFarSyncSetCardMode , */
+/* */
+/*****************************************************************************/
+#pragma pack(push, 4)
+typedef struct _FSCARDMODE
+{
+ BOOLEAN bIdentifyMode;
+} FSCARDMODE, * PFSCARDMODE;
+#pragma pack(pop)
+
+/*****************************************************************************/
+/* Card info parameter block definition */
+/* */
+/* For use with: */
+/* */
+/* IoctlCodeFarSyncReadCardInfo , */
+/* */
+/*****************************************************************************/
+#pragma pack(push, 4)
+typedef struct _FSCARDINFO
+{
+ #define FSCARDINFO_VERSION 1
+ #define SERIAL_NO_LENGTH 8
+
+ ULONG uVersion; // Version of this structure
+ USHORT uDeviceId;
+ USHORT uSubSystemId;
+ ULONG uNumberOfPorts;
+ char szSerialNo[SERIAL_NO_LENGTH+1];
+ ULONG uMajorRevision;
+ ULONG uMinorRevision;
+ ULONG uBuildState;
+ ULONG uCPUSpeed;
+ ULONG uMode;
+} FSCARDINFO, * PFSCARDINFO;
+#pragma pack(pop)
+
+/*****************************************************************************/
+/* DMA mode parameter block definition */
+/* */
+/* For use with: */
+/* */
+/* IoctlCodeFarSyncSetDMAMode, */
+/* IoctlCodeFarSyncGetDMAMode , */
+/* */
+/*****************************************************************************/
+#pragma pack(push, 4)
+typedef struct _FSDMAMODE
+{
+ #define FSDMAMODE_VERSION 1
+ #define FSDMAMODE_OFF 1
+ #define FSDMAMODE_ON 2
+ #define FSDMAMODE_INTERMEDIATE 3 // use for processing rxs via intermediate buffer
+
+ ULONG uVersion; // Version of this structure
+ USHORT uTxDMAMode;
+ USHORT uRxDMAMode;
+} FSDMAMODE, * PFSDMAMODE;
+#pragma pack(pop)
+
+/*****************************************************************************/
+/* Interrupt handshake mode parameter block definition */
+/* */
+/* For use with: */
+/* */
+/* IoctlCodeFarSyncSetHandShakeMode, */
+/* IoctlCodeFarSyncGetHandShakeMode */
+/* */
+/*****************************************************************************/
+#pragma pack(push, 4)
+typedef struct _FSHANDSHAKEMODE
+{
+ #define FSHANDSHAKEMODE_VERSION 1
+ #define FSHANDSHAKEMODE_2 2
+ #define FSHANDSHAKEMODE_3 3
+
+ ULONG uVersion; // Version of this structure
+ USHORT uMode;
+} FSHANDSHAKEMODE, * PFSHANDSHAKEMODE;
+#pragma pack(pop)
+
+/*****************************************************************************/
+/* Extended card info parameter block definition */
+/* */
+/* For use with: */
+/* */
+/* IoctlCodeFarSyncReadCardInfoEx , */
+/* */
+/*****************************************************************************/
+#pragma pack(push, 4)
+typedef struct _FSCARDINFOEX
+{
+ #define FSCARDINFOEX_VERSION 2
+
+ ULONG uVersion; // Version of this structure
+
+ char szDeviceName[32+8]; // Including aligned PADDING to allow for null-terminator
+ PVOID w_memory; // Virtual addresses of Adapter Resources
+ PVOID w_controlSpace;
+ PVOID w_localCfg;
+ PVOID w_ioSpace;
+ ULONG z_memory; // Lengths of Adapter Resources
+ ULONG z_controlSpace;
+ ULONG z_localCfg;
+ ULONG z_ioSpace;
+
+ ULONG uHiVersion;
+ ULONG uLoVersion;
+
+ ULONG uReservedA[30]; // these are reserved for FarSite's own use
+
+ PVOID p_memory; // physical address of window - T-Series cards
+ PVOID p_io; // main IO address of card
+ ULONG uExtendedClockingSupported; // are (T4E) clock synths available on the card?
+ ULONG uAsyncSupported; // does the card support async
+ ULONG uReservedB[28]; // these are currently unused
+
+} FSCARDINFOEX, * PFSCARDINFOEX;
+#pragma pack(pop)
+
+/*****************************************************************************/
+/* Port config parameter block definition */
+/* */
+/* For use with: */
+/* */
+/* IoctlCodeFarSyncSetPortConfig, */
+/* IoctlCodeFarSyncGetPortConfig */
+/* */
+/*****************************************************************************/
+#pragma pack(push, 4)
+typedef struct _FS_PORT_CONFIG
+{
+ #define FSPORTCONFIG_VERSION 2
+
+ ULONG uVersion; // Version of this structure
+ ULONG uPortTxNumBuffers; // 2,4,8,16,32,64,128
+ ULONG uPortRxNumBuffers; // 2,4,8,16,32,64,128
+ ULONG uPortTxBufferLength; // Min=2 Max=64*1024 Def= 8*1024
+ ULONG uPortRxBufferLength; // Min=2 Max=64*1024 Def= 8*1024
+ ULONG uPortTxDMA; // See fscfg.h for values i.e. FSDMAMODE_OFF=1, FSDMAMODE_ON=2
+ ULONG uPortRxDMA; // See fscfg.h for values i.e. FSDMAMODE_OFF=1, FSDMAMODE_ON=2
+ ULONG uPortStartTxRx; // See smcuser.h for values i.e. START_TX=1 | START_RX=2
+ ULONG uPortClockSource; // See smcuser.h for values i.e. FS_CLOCK_REFERENCE_xxx
+ // Currently only supported on T4E
+ ULONG uPortTxMSB; // FALSE ==> LSB (Default)
+ ULONG uPortRxMSB; // FALSE ==> LSB (Default)
+ ULONG uPortMaxTxsOutstanding;// read-only - indicates how many txs can be outstanding at a time
+ ULONG uReserved[52];
+} FS_PORT_CONFIG, *PFS_PORT_CONFIG;
+#pragma pack(pop)
+
+/*****************************************************************************/
+/* Serial config parameter block definition */
+/* */
+/* For use with: */
+/* */
+/* IoctlCodeFarSyncSetSerialConfig, */
+/* IoctlCodeFarSyncGetSerialConfig */
+/* */
+/*****************************************************************************/
+#pragma pack(push, 4)
+typedef struct _FS_SERIAL_CONFIG
+{
+ #define FSSERIALCONFIG_VERSION 2
+
+ ULONG uVersion; // Version of this structure
+ ULONG uPortInterface; // See fscfg.h for values e.g. FS_LINE_INTERFACE_X21
+ ULONG uPortRate;
+ ULONG uPortClocking; // See fscfg.h for values e.g. FS_LINE_CLOCKING_INTERNAL
+ ULONG uPortTransparentMode; // HDLC=0 Transparent=1
+ ULONG uPortInvertRxClock; // TRUE(1) or FALSE(0)
+ ULONG uPortEncoding; // See fscfg for values i.e. FS_PORT_ENCODING_xxx
+ // Currently only supported on M1P
+
+ // The following fields have been added in Version 2 of this structure and not be
+ // processed if uVersion = 1
+ ULONG uExtendedClocking; // subsequent fields only used if this is TRUE
+ ULONG uInternalTxClock;
+ ULONG uInternalRxClock;
+ ULONG uTerminalTxClock;
+ ULONG uTerminalRxClock;
+ ULONG uDCDOutput; // TRUE => DCD is an output
+
+ ULONG uEstimatedLineSpeed; // returned by FarSyncGetSerialConfig for T4E only
+
+ ULONG uReserved[54];
+} FS_SERIAL_CONFIG, *PFS_SERIAL_CONFIG;
+#pragma pack(pop)
+
+/*****************************************************************************/
+/* CTBus config parameter block definition */
+/* */
+/* For use with: */
+/* */
+/* IoctlCodeFarSyncSetCTBusConfig */
+/* IoctlCodeFarSyncGetCTBusConfig */
+/* */
+/*****************************************************************************/
+#pragma pack(push, 4)
+typedef struct _FS_CT_BUS_CONFIG
+{
+ #define FSCTBUSCONFIG_VERSION 2
+
+ ULONG uVersion; // Version of this structure
+ ULONG uCTBusMode; // See smcuser.h for values i.e. FS_CT_BUS_MODE_xxx
+ ULONG uCTBusFeed; // See smcuser.h for values i.e. FS_CT_BUS_FEED_xxx
+ ULONG uFallback; // TRUE=>auto switch if clock ref fails
+ ULONG uReserved[60];
+} FS_CT_BUS_CONFIG, *PFS_CT_BUS_CONFIG;
+#pragma pack(pop)
+
+/*****************************************************************************/
+/* Clocking Status block definition */
+/* */
+/* For use with: */
+/* */
+/* IoctlCodeFarSyncGetClockingStatus */
+/* */
+/*****************************************************************************/
+#pragma pack(push, 4)
+typedef struct _FS_CLOCKING_STATUS
+{
+ #define FSCLOCKINGSTATUS_VERSION 2
+
+ ULONG uVersion; // Version of this structure
+ ULONG uPrimaryClockStatus; // 0=out-of-tolerance, 1=good
+ ULONG uBackupClockStatus; // 0=out-of-tolerance, 1=good
+ ULONG uCurrentConfigReference; // See smcuser.h for values i.e. FS_CT_CONFIG_xxx
+ ULONG uCTAStatus; // 0=out-of-tolerance, 1=good
+ ULONG uCTBStatus; // 0=out-of-tolerance, 1=good
+ USHORT uCurrentStatusSummary; // bit map status word describing clocking state/config
+ // see smcuser.h for bit definitions
+ USHORT uReserved1;
+ ULONG uCTAInUse; // 0=CTB, 1=CTA - shows which CT Bus the card
+ // has selected for the slave clock source
+ ULONG uReserved2[15];
+} FS_CLOCKING_STATUS, *PFS_CLOCKING_STATUS;
+#pragma pack(pop)
+
+//######################################################################################################
+//
+// FarSync Error Return Codes
+//
+// These return codes will be passed back from the FarSync SDCI driver in the IoStatus.Status field of
+// the IRP and (if the SDCI client is a user-mode app) will be passed through transparently to the app
+// via GetLastError().
+//
+
+#define FS_ERROR_INVALID_INPUT_BUFFER_LENGTH 0xE0000001
+#define FS_ERROR_INVALID_OUTPUT_BUFFER_LENGTH 0xE0000002
+#define FS_ERROR_PRIMARY_IOCTL 0xE0000003
+#define FS_ERROR_CARD_NOT_STARTED 0xE0000004
+#define FS_ERROR_INVALID_CT_BUS_MODE 0xE0000005
+#define FS_ERROR_INVALID_CT_BUS_FEED 0xE0000006
+#define FS_ERROR_INVALID_IOCTL_FOR_PORTTYPE 0xE0000007
+#define FS_ERROR_INVALID_LENGTH 0xE0000008
+
+//######################################################################################################
+
+
+
+#endif /* __SDCI_H_ */
+
diff --git a/lib/farsync/windows/smcuser.h b/lib/farsync/windows/smcuser.h
new file mode 100644
index 0000000..063c775
--- /dev/null
+++ b/lib/farsync/windows/smcuser.h
@@ -0,0 +1,451 @@
+/*******************************************************************************
+*
+* Program : FARSYNC
+*
+* File : smcuser.h
+*
+* Description : This common header file defines constants used throughout FarSync e.g. in
+*
+* 1) onboard software
+* 2) PC driver (farsynct)
+* 3) user-mode config apps
+* 4) higher-level drivers (e.g. fswan)
+*
+* Modifications
+*
+* Version 2.0.0 18Jan01 WEB Created
+* Version 2.2.0 18Jul01 WEB Certification candidate
+* 22Oct01 MJD Added Transparent Mode Support - moved number and
+* size of buffer definitions her from smc.h.
+* 19Nov02 MJD Added X.21 Dual clock interface mode X21D - only
+* for T1U/T2U/T4U.
+* 28Nov02 MJD Added NOCABLE interface mode - only for T1U/T2U/
+* T4U/T4P, used only by CDE when stopping a port.
+* Version 3.0.0 08Oct03 MJD Added TE1 parameter constants
+* Version 3.0.1 10Nov03 MJD Added tx/rxBufferMode constants for TE1.
+* Version 3.0.2 03Nov04 MJD Added DSL #define's
+* Version 3.0.3 24Feb05 WEB Add FS_CLOCK_SOURCE_xxx and FS_CT_BUS_xxx values
+* Version 4.1.0 15Jun05 WEB Update TE1 typedefs
+* Version 4.1.1 24Jun05 WEB Add T4E MkII defs
+* Version 4.1.2 30Jun05 MJD Add FS_CT_BUS_FEED_FROM_OSCILLATOR define.
+* Only define FS_CLOCK_SOURCE_PORT_A/B/C/D when
+* T4EMKI defined (not available on T4EMKII).
+* Version 4.1.3 07Jul05 MJD Add FS_CONFIG_IN_USE_XXX and FS_INDICATION_CLOCK_XXX
+* values for T4E MkII.
+* Version 4.1.4 08Jul05 MJD Added define for ANNEX_TYPE_AB (SHDSL)
+* Version 4.1.5 14Jul05 WEB Rationalise clock reference defines
+* Version 4.1.6 15Jul05 MJD Added FS_CCS_MASK_XXX defines
+* Version 4.1.7 02Aug05 MJD Added FS_INDICATION_CLOCK_SWITCH_TO_PRIMARY define
+*******************************************************************************/
+
+#ifndef SMCUSER_H
+#define SMCUSER_H
+
+#ifndef UINT8
+#define UINT8 unsigned char
+#define INT8 char
+#define INT32 long
+#define UINT16 unsigned short
+#define UINT32 unsigned long
+#endif
+
+#define MAX_PORTS 4 /* maximum ports on T4P - fixed don't change*/
+
+/* Interface Types */
+
+#define AUTO 0
+#define V24 1
+#define X21 2
+#define V35 3
+#define X21D 4
+#define NOCABLE 5
+#define RS530_449 6
+
+/* Clock Sources */
+
+#define INTCLK 1
+#define EXTCLK 0
+
+#define FS_CLOCK_REFERENCE_OSCILLATOR 0
+#define FS_CLOCK_REFERENCE_PORT_A 1
+#define FS_CLOCK_REFERENCE_PORT_B 2
+#define FS_CLOCK_REFERENCE_PORT_C 3
+#define FS_CLOCK_REFERENCE_PORT_D 4
+#define FS_CLOCK_REFERENCE_CTBUS 5 /* note: this value does not differentiate between CTA or CTB */
+#define FS_CLOCK_REFERENCE_CT_A 6
+#define FS_CLOCK_REFERENCE_CT_B 7
+
+#define FS_CT_BUS_MODE_SLAVE 0 /* FarSync card will act as SLAVE to the CT_BUS */
+#define FS_CT_BUS_MODE_MASTER_A 1 /* FarSync card will act as MASTER to the CT_BUS_A */
+#define FS_CT_BUS_MODE_MASTER_B 2 /* FarSync card will act as MASTER to the CT_BUS_B */
+#define FS_CT_BUS_MODE_DEFAULT FS_CT_BUS_MODE_SLAVE
+
+#define FS_CONFIG_IN_USE_PRIMARY 0 /* Primary clock reference is in use */
+#define FS_CONFIG_IN_USE_BACKUP 1 /* Backup clock reference is in use */
+#define FS_CONFIG_IN_USE_OSCILLATOR 2 /* Local oscillator clock reference is in use */
+#define FS_CONFIG_IN_USE_DEFAULT FS_CONFIG_IN_USE_PRIMARY
+
+// Indications to be signalled via the cardNotifications FIFO
+
+#define FS_INDICATION_CLOCK_RATE_CHANGED 0x0080 /* 2 LSB's denote port A, B, C or D */
+#define FS_INDICATION_CLOCK_OUT_OF_TOLERANCE1 0x0084
+#define FS_INDICATION_CLOCK_IN_TOLERANCE1 0x0088
+#define FS_INDICATION_CLOCK_SWITCH_TO_BACKUP 0x008c
+#define FS_INDICATION_CLOCK_OUT_OF_TOLERANCE2 0x0090
+#define FS_INDICATION_CLOCK_IN_TOLERANCE2 0x0094
+#define FS_INDICATION_CLOCK_SWITCH_TO_OSC 0x0098
+#define FS_INDICATION_CLOCK_SWITCH_TO_CTA 0x009c
+#define FS_INDICATION_CLOCK_SWITCH_TO_CTB 0x00a0
+#define FS_INDICATION_CLOCK_SWITCH_TO_PRIMARY 0x00a4
+
+// Bit masks for isolating fields in uCurrentStatusSummary
+
+#define FS_CSS_MASK_SLAVE_MASTER 0x0100 /* 0 = Slave, 1 = Master */
+#define FS_CSS_MASK_CTA_CTB 0x0080 /* 0 = A, 1 = B */
+#define FS_CSS_MASK_MASTER_SOURCE 0x0070 /* 000=A, 001=B, 010=C, 011=D, 100=LO */
+#define FS_CSS_MASK_PORT_A_SOURCE 0x0008 /* 0 = CT, 1 = LO */
+#define FS_CSS_MASK_PORT_B_SOURCE 0x0004 /* 0 = CT, 1 = LO */
+#define FS_CSS_MASK_PORT_C_SOURCE 0x0002 /* 0 = CT, 1 = LO */
+#define FS_CSS_MASK_PORT_D_SOURCE 0x0001 /* 0 = CT, 1 = LO */
+
+/* Tx/Rx Start Parameters */
+
+#define START_TX 1
+#define START_RX 2
+#define START_TX_AND_RX (START_TX | START_RX)
+#define START_DEFAULT START_TX_AND_RX
+
+
+// constants for t1/e1 service unit config
+// =======================================
+//
+// dataRate
+// rate is in bps: 8k - 1536/2048k (t1/e1), though n*64k is more usual
+// e1: 0 - 1984k => framed (fractional), 2048k => unframed
+// for e1 framed, bandwidth is allocated from the ninth bit of the frame
+// sequentially
+// for e1 unframed all 256 bits in the frame are used for data
+// t1: 0 - 1536k => framed (fractional), no unframed mode in t1.
+//
+
+#define DATARATE_DEFAULT 64000L
+
+// Clocking
+//
+
+#define CLOCKING_SLAVE 0
+#define CLOCKING_DEFAULT CLOCKING_SLAVE
+#define CLOCKING_MASTER 1
+
+// Framing
+//
+
+#define FRAMING_E1 0
+#define FRAMING_DEFAULT FRAMING_E1
+#define FRAMING_J1 1
+#define FRAMING_T1 2
+
+// Structure
+//
+
+#define STRUCTURE_UNFRAMED 0
+#define STRUCTURE_E1_DOUBLE 1
+#define STRUCTURE_E1_CRC4 2
+#define STRUCTURE_E1_DEFAULT STRUCTURE_E1_CRC4
+#define STRUCTURE_DEFAULT STRUCTURE_E1_CRC4
+#define STRUCTURE_E1_CRC4M 3
+#define STRUCTURE_T1_4 4
+#define STRUCTURE_T1_12 5
+#define STRUCTURE_T1_24 6
+#define STRUCTURE_T1_DEFAULT STRUCTURE_T1_24
+#define STRUCTURE_T1_72 7
+
+// Interface
+// RJ48C is available for e1 and t1, BNC is only available for e1
+//
+
+#define INTERFACE_RJ48C 0
+#define INTERFACE_DEFAULT INTERFACE_RJ48C
+#define INTERFACE_BNC 1
+
+// Coding
+// hdb3 is the normal coding scheme for e1
+// b8zs is the normal coding scheme for t1, though ami is sometimes used
+//
+
+#define CODING_HDB3 0
+#define CODING_E1_DEFAULT CODING_HDB3
+#define CODING_DEFAULT CODING_HDB3
+#define CODING_NRZ 1
+#define CODING_CMI 2
+#define CODING_CMI_HDB3 3
+#define CODING_CMI_B8ZS 4
+#define CODING_AMI 5
+#define CODING_AMI_ZCS 6
+#define CODING_B8ZS 7
+#define CODING_T1_DEFAULT CODING_B8ZS
+
+// Line Build Out - for long haul t1 > 655ft (200m). Use with EQUALIZER_LONG.
+// This parameter is ignored in e1 mode and t1/j1 short haul mode.
+//
+
+#define LBO_0dB 0
+#define LBO_DEFAULT LBO_0dB
+#define LBO_7dB5 1
+#define LBO_15dB 2
+#define LBO_22dB5 3
+
+// Range - for short haul t1 < 655ft (200m). Use with EQUALIZER_SHORT.
+// This parameter is ignored in e1 mode and t1/j1 long haul mode.
+//
+
+#define RANGE_0_133_FT 0
+#define RANGE_DEFAULT RANGE_0_133_FT
+#define RANGE_0_40_M RANGE_0_133_FT
+
+#define RANGE_133_266_FT 1
+#define RANGE_40_81_M RANGE_133_266_FT
+
+#define RANGE_266_399_FT 2
+#define RANGE_81_122_M RANGE_266_399_FT
+
+#define RANGE_399_533_FT 3
+#define RANGE_122_162_M RANGE_399_533_FT
+
+#define RANGE_533_655_FT 4
+#define RANGE_162_200_M RANGE_533_655_FT
+
+// Receive Equalizer
+// short haul -10dB
+// long haul -43dB (E1), -36dB (T1)
+// only -36dB can be met with 1.2 silicon, requires equalizer parameter RAM
+// changes for 2.1 silicon
+//
+
+#define EQUALIZER_SHORT 0
+#define EQUALIZER_DEFAULT EQUALIZER_SHORT
+#define EQUALIZER_LONG 1
+
+// Loop Mode
+// Local Loop transmits normally and loops PCM data on the line side of the
+// framers.
+// Payload Loop receives normally and loops TS0-TS31 or TS1-31 (with TS0
+// regenerated by FALC-56) to line on the PCM side of the framers.
+// Remote Loop receives normally and loops line data after clock recovery
+// the optional Jitter Attenuation is currently not enabled.
+
+#define LOOP_NONE 0
+#define LOOP_DEFAULT LOOP_NONE
+#define LOOP_LOCAL 1
+#define LOOP_PAYLOAD_EXC_TS0 2
+#define LOOP_PAYLOAD_INC_TS0 3
+#define LOOP_REMOTE 4
+
+// Buffer Mode
+// buffer_none bypasses the elastic buffer
+//
+
+#define BUFFER_2_FRAME 0
+#define BUFFER_DEFAULT BUFFER_2_FRAME
+#define BUFFER_1_FRAME 1
+#define BUFFER_96_BIT 2
+#define BUFFER_NONE 3
+
+//
+// Starting Timeslot (for fractional)
+// E1 range 1 to 31, T1/J1 range 0 to 23
+// Min/max values enforced by card. Actual speed may also be restricted if
+// starting timeslot is too late in the frame.
+// Parameter ignored in unchannelized mode
+//
+
+#define STARTING_DEFAULT 0
+
+//
+// LOS detection threshold
+// level 0 allows LOS to be detected with larger signal levels
+// level 7 allows LOS to be detected with smaller signal levels
+// the recommended default setting is level 2 - which is selected
+// by the card if LOS_DEFAULT is configured
+//
+
+#define LOS_DEFAULT 0
+
+#define LOS_LEVEL_0 1
+#define LOS_LEVEL_1 2
+#define LOS_LEVEL_2 3
+#define LOS_LEVEL_3 4
+#define LOS_LEVEL_4 5
+#define LOS_LEVEL_5 6
+#define LOS_LEVEL_6 7
+#define LOS_LEVEL_7 8
+
+#define LOS_SHORT 0x20
+#define LOS_LONG 0x70
+
+//
+// Idle code for unused timeslots
+//
+
+#define IDLE_HDLC_FLAG 0x7e
+#define IDLE_CODE_DEFAULT IDLE_HDLC_FLAG
+
+#define TRANSPARENT_MODE_DEFAULT FALSE
+#define ENABLE_IDLE_CODE_DEFAULT FALSE
+
+// constants for dsl service unit config
+// =======================================
+
+//
+// dataRate (G.SHDSL)
+// rate is in bps: 192kbps (3B + 0Z) - 2312kbps (36B + 1Z)
+// in 8kbps steps, where B is 64kbps and Z is 8kbps
+//
+
+//
+// Terminal Type
+//
+
+#define TERMINAL_TYPE_REMOTE 0
+#define TERMINAL_TYPE_CENTRAL 1
+
+//
+// Test Mode
+//
+// For User Diagnostics:
+//
+// Analog Transparent Loop - loops from transmit line driver output to
+// receive AGC input, bypassing the hybrid.
+// Analog Non-Transparent Loop - loops transmit DAC back to receive AGC,
+// bypassing transmit line driver and the hybrid.
+//
+// Others test modes are for Compliance Testing only
+//
+
+#define TEST_MODE_NONE 0
+#define TEST_MODE_DEFAULT TEST_MODE_NONE
+
+#define TEST_MODE_ALTERNATING_SINGLE_PULSE 1
+#define TEST_MODE_ANALOG_TRANSPARENT_LOOP 4
+#define TEST_MODE_ANALOG_NON_TRANSPARENT_LOOP 8
+#define TEST_MODE_TRANSMIT_SC_SR 9
+#define TEST_MODE_TRANSMIT_TC_PAM_SCRONE 10
+#define TEST_MODE_LINE_DRIVER_NO_SIGNAL 11
+#define TEST_MODE_AGC_TO_LINE_DRIVER_LOOP 12
+
+#define TEST_MODE_LOOP_TDM_TO_LINE 16
+#define TEST_MODE_LOOP_PAYLOAD_TO_LINE 17
+//
+// Annex Type A (US) or B (EU)
+//
+
+#define ANNEX_TYPE_B 0
+#define ANNEX_TYPE_DEFAULT ANNEX_TYPE_B
+#define ANNEX_TYPE_A 1
+#define ANNEX_TYPE_AB 2
+
+
+/* Small Buffers are used only for diagnostics */
+
+#define NUM_SMALL_TX_BUFFER 2
+#define NUM_SMALL_RX_BUFFER 8
+
+#define LEN_SMALL_TX_BUFFER 256 /* max size is 8192 */
+#define LEN_SMALL_RX_BUFFER 256
+
+/* Large Buffers are used for SDMA data */
+
+// MAX_TX/RX_BUFFER determines, at compile time, the maximum number of
+// descriptors (hence buffers) per port for transmitter and receiver. Host can
+// use any 2**N number of the descriptors between 1 and MAX_TX/RX_BUFFER, so
+// some descriptors may be unused. Number of Buffers * Size of Buffers <=
+// TX/RX_BUFFER_SPACE. Fewer buffers mean bigger buffers, more buffers mean
+// smaller buffers.
+
+#define MAX_TX_BUFFER 128
+#define MAX_RX_BUFFER 128
+
+// MAX_TX/RX_BUFFER_SPACE determines, at compile time, how much buffer space is
+// available per port for transmitter and receiver. Buffer space is subdivided
+// into 2**N buffers by host driver at runtime.
+// Host can allocate 1 - MAX_TX/RX_BUFFER buffers.
+// 0x10000 => 64KB for transmit, 64KB for receive; 4 ports => 512KB.
+// MAX_TX/RX_BUFFER must be a 2**N multiple (for easy logic anlyser trigger).
+
+#define TX_BUFFER_SPACE 0x10000
+#define RX_BUFFER_SPACE 0x10000
+
+/* Rx Descriptor bits */
+
+#define FS_RX_DESC_ERR 0x4000
+#define FS_RX_DESC_FRAM 0x2000
+#define FS_RX_DESC_OFLO 0x1000
+#define FS_RX_DESC_CRC 0x0800
+#define FS_RX_DESC_HBUF 0x0400
+#define FS_RX_DESC_ENP 0x0100
+
+#define FS_RX_DESC_FRAM_ENP 0x2100
+#define FS_RX_DESC_CRC_ENP 0x0900
+
+#define NO_OF_DMA_CHANNELS 2
+
+// The following structures require 2-byte packing.
+// This file is used in a number of different environments.
+// Windows SDCI applications should therefore include this file implicitly by explicitly
+// including fscfg.h which enables the packing directive to be used.
+
+#ifdef SMCUSER_PACKING
+
+#if (SMCUSER_PACKING==1)
+#pragma pack(push, 2)
+#endif
+
+typedef struct SU_CONFIG
+{
+ UINT32 dataRate; // data rate in bps
+ UINT8 clocking; // master or slave
+ UINT8 framing; // E1, T1 or J1
+ UINT8 structure; // E1: unframed, double frame, CRC4; T1: F4, F12, F24 or F72
+ UINT8 iface; // RJ48C or BNC
+ UINT8 coding; // HDB3 or B8ZS + some other less used codes
+ UINT8 lineBuildOut; // 0, -7.5, -15, -22.5dB for t1 long haul only
+ UINT8 equalizer; // short or long haul settings
+ UINT8 transparentMode; // FALSE (hdlc) or TRUE transparent data
+ UINT8 loopMode; // various local, payload and remote loops for test
+ UINT8 range; // 0-133, 133-266, 266-399, 399-533, 533-655ft for t1 short haul only
+ UINT8 txBufferMode; // transmit elastic buffer depth: 0 (bypass), 96 bits, 1 frame or 2 frame
+ UINT8 rxBufferMode; // receive elastic buffer depth: 0 (bypass), 96 bits, 1 frame or 2 frame
+ UINT8 startingTimeSlot;// startingTimeSlot: E1 1-31, T1/J1 0-23
+ UINT8 losThreshold; // LOS Threshold: E1/T1/J1 0-7
+ UINT8 enableIdleCode; // Enable idle code for unused timeslots: TRUE, FALSE
+ UINT8 idleCode; // Idle code for unused timeslots: 0x00 - 0xff
+
+ UINT8 spare[44]; // adjust to keep structure size 64 bytes
+} FS_TE1_CONFIG, *PFS_TE1_CONFIG;
+
+typedef struct SU_STATUS
+{
+ UINT32 receiveBufferDelay; // delay through receive bufffer time slots (0-63)
+ UINT32 framingErrorCounter; // count of framing errors
+ UINT32 codeViolationCounter; // count of code violations
+ UINT32 crcErrorCounter1; // count of CRC errors
+ INT32 lineAttenuation; // receive line attenuation in dB, -ve => unknown
+ BOOLEAN portStarted; //
+ BOOLEAN lossOfSignal; // LOS alarm
+ BOOLEAN receiveRemoteAlarm; // RRA alarm
+ BOOLEAN alarmIndicationSignal; // AIS alarm
+
+ UINT8 spare[40]; // adjust to keep structure size 64 bytes
+} FS_TE1_STATUS, *PFS_TE1_STATUS;
+
+#if (SMCUSER_PACKING==1)
+#pragma pack(pop)
+#endif
+
+#else
+#pragma message("!!! *** SMCUSER_PACKING not defined. Note: Windows SDCI apps should *** !!!")
+#pragma message("!!! *** not include smcuser.h directly, use fscfg.h instead *** !!!")
+#endif
+
+
+#endif
diff --git a/src/DabMux.cpp b/src/DabMux.cpp
new file mode 100644
index 0000000..59278f9
--- /dev/null
+++ b/src/DabMux.cpp
@@ -0,0 +1,3549 @@
+/*
+ Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
+ 2011 Her Majesty the Queen in Right of Canada (Communications
+ Research Center Canada)
+ */
+/*
+ This file is part of CRC-DabMux.
+
+ CRC-DabMux is free software: you can 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.
+
+ CRC-DabMux is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with CRC-DabMux. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <iostream>
+#include <fstream>
+#include <iomanip>
+#include <cstdio>
+#include <cstring>
+#include <errno.h>
+
+using namespace std;
+#include <vector>
+#include <set>
+#include <functional>
+#include <algorithm>
+
+#ifdef _WIN32
+# include <time.h>
+# include <process.h>
+# include <io.h>
+# include <conio.h>
+# include <winsock2.h> // For types...
+typedef u_char uint8_t;
+typedef WORD uint16_t;
+typedef DWORD32 uint32_t;
+
+# ifndef __MINGW32__
+# include "xgetopt.h"
+# endif
+# define read _read
+# define snprintf _snprintf
+# define sleep(a) Sleep((a) * 1000)
+#else
+# include <netinet/in.h>
+# include <unistd.h>
+# include <sys/time.h>
+# include <sys/wait.h>
+# include <sys/socket.h>
+# include <sys/ioctl.h>
+# include <sys/times.h>
+
+# include <linux/if_packet.h>
+# include <linux/netdevice.h>
+#endif
+
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <signal.h>
+
+#ifdef _WIN32
+# pragma warning ( disable : 4103 )
+# include "Eti.h"
+# pragma warning ( default : 4103 )
+#else
+# include "Eti.h"
+#endif
+#include "dabInputFile.h"
+#include "dabInputFifo.h"
+#include "dabInputMpegFile.h"
+#include "dabInputMpegFifo.h"
+#include "dabInputDabplusFile.h"
+#include "dabInputDabplusFifo.h"
+#include "dabInputPacketFile.h"
+#include "dabInputEnhancedPacketFile.h"
+#include "dabInputEnhancedFifo.h"
+#include "dabInputUdp.h"
+#include "dabInputBridgeUdp.h"
+#include "dabInputSlip.h"
+#include "dabInputTest.h"
+#include "dabInputPrbs.h"
+#include "dabInputRawFile.h"
+#include "dabInputRawFifo.h"
+#include "dabInputDmbFile.h"
+#include "dabInputDmbUdp.h"
+
+
+#include "dabOutput.h"
+#include "crc.h"
+#include "UdpSocket.h"
+#include "InetAddress.h"
+#include "dabUtils.h"
+#include "PcDebug.h"
+
+
+// DAB Mode
+#define DEFAULT_DAB_MODE 2
+
+// Taille de la trame de donnee, sous-canal 3, nb de paquets de 64bits,
+// STL3 * 8 = x kbytes par trame ETI
+
+// Data bitrate in kbits/s. Must be 64 kb/s multiple.
+#define DEFAULT_DATA_BITRATE 384
+#define DEFAULT_PACKET_BITRATE 32
+
+// Etiquettes des sous-canaux et de l'ensemble, 16 characteres incluant les
+// espaces
+#define DEFAULT_ENSEMBLE_LABEL "CRC-Dr.Radio"
+#define DEFAULT_ENSEMBLE_SHORT_LABEL 0xe000
+#define DEFAULT_ENSEMBLE_ID 0xc000
+#define DEFAULT_ENSEMBLE_ECC 0xa1
+
+//Numeros des sous-canaux
+#define DEFAULT_SERVICE_ID 50
+#define DEFAULT_PACKET_ADDRESS 0
+
+
+struct dabOutput {
+ const char* outputProto;
+ const char* outputName;
+ void* data;
+ dabOutputOperations operations;
+};
+
+
+struct dabLabel {
+ char text[16];
+ uint16_t flag;
+};
+
+
+struct dabService;
+struct dabComponent;
+struct dabSubchannel;
+struct dabEnsemble {
+ uint16_t id;
+ uint8_t ecc;
+ dabLabel label;
+ uint8_t mode;
+ vector<dabService*> services;
+ vector<dabComponent*> components;
+ vector<dabSubchannel*> subchannels;
+};
+
+
+struct dabProtectionShort {
+ unsigned char tableSwitch;
+ unsigned char tableIndex;
+};
+
+
+struct dabProtectionLong {
+ unsigned char option;
+};
+
+
+struct dabProtection {
+ unsigned char level;
+ unsigned char form;
+ union {
+ dabProtectionShort shortForm;
+ dabProtectionLong longForm;
+ };
+};
+
+
+struct dabSubchannel {
+ const char* inputProto;
+ const char* inputName;
+ void* data;
+ dabInputOperations operations;
+ unsigned char id;
+ unsigned char type;
+ uint16_t startAddress;
+ uint16_t bitrate;
+ dabProtection protection;
+};
+
+
+class SubchannelId : public std::binary_function <dabSubchannel*, int, bool> {
+public:
+ bool operator()(const dabSubchannel* subchannel, const int id) const {
+ return subchannel->id == id;
+ }
+};
+
+
+vector<dabSubchannel*>::iterator getSubchannel(
+ vector<dabSubchannel*>& subchannels, int id)
+{
+ return find_if(
+ subchannels.begin(),
+ subchannels.end(),
+ bind2nd(SubchannelId(), id)
+ );
+}
+
+
+struct dabAudioComponent {
+};
+
+
+struct dabDataComponent {
+};
+
+
+struct dabFidcComponent {
+};
+
+
+struct dabPacketComponent {
+ uint16_t id;
+ uint16_t address;
+ uint16_t appType;
+ bool datagroup;
+};
+
+
+struct dabComponent {
+ dabLabel label;
+ uint32_t serviceId;
+ uint8_t subchId;
+ uint8_t type;
+ uint8_t SCIdS;
+ union {
+ dabAudioComponent audio;
+ dabDataComponent data;
+ dabFidcComponent fidc;
+ dabPacketComponent packet;
+ };
+
+ bool isPacketComponent(vector<dabSubchannel*>& subchannels)
+ {
+ if (subchId > 63) {
+ etiLog.printHeader(TcpLog::ERR,
+ "You must define subchannel id in the "
+ "packet component before defining packet ");
+ return false;
+ }
+ if (getSubchannel(subchannels, subchId) == subchannels.end()) {
+ etiLog.printHeader(TcpLog::ERR,
+ "Invalid subchannel id in the packet component "
+ "for defining packet ");
+ return false;
+ }
+ if ((*getSubchannel(subchannels, subchId))->type != 3) {
+ etiLog.printHeader(TcpLog::ERR,
+ "Invalid component type for defining packet ");
+ return false;
+ }
+ return true;
+ }
+};
+
+
+vector<dabComponent*>::iterator getComponent(
+ vector<dabComponent*>& components,
+ uint32_t serviceId,
+ vector<dabComponent*>::iterator current)
+{
+ if (current == components.end()) {
+ current = components.begin();
+ } else {
+ ++current;
+ }
+
+ while (current != components.end()) {
+ if ((*current)->serviceId == serviceId) {
+ return current;
+ }
+ ++current;
+ }
+
+ return components.end();
+}
+
+
+vector<dabComponent*>::iterator getComponent(
+ vector<dabComponent*>& components,
+ uint32_t serviceId) {
+ return getComponent(components, serviceId, components.end());
+}
+
+
+struct dabService {
+ dabLabel label;
+ uint32_t id;
+ unsigned char pty;
+ unsigned char language;
+ bool program;
+
+ unsigned char getType(dabEnsemble* ensemble)
+ {
+ vector<dabSubchannel*>::iterator subchannel;
+ vector<dabComponent*>::iterator component =
+ getComponent(ensemble->components, id);
+ if (component == ensemble->components.end()) {
+ return 4;
+ }
+ subchannel = getSubchannel(ensemble->subchannels, (*component)->subchId);
+ if (subchannel == ensemble->subchannels.end()) {
+ return 8;
+ }
+
+ return (*subchannel)->type;
+ }
+ unsigned char nbComponent(vector<dabComponent*>& components)
+ {
+ int nb = 0;
+ vector<dabComponent*>::iterator current;
+
+ for (current = components.begin(); current != components.end();
+ ++current) {
+ if ((*current)->serviceId == id) {
+ ++nb;
+ }
+ }
+ return nb;
+ }
+};
+
+
+vector<dabService*>::iterator getService(
+ dabComponent* component,
+ vector<dabService*>& services)
+{
+ vector<dabService*>::iterator service;
+
+ for (service = services.begin(); service != services.end(); ++service) {
+ if ((*service)->id == component->serviceId) {
+ break;
+ }
+ }
+
+ return service;
+}
+
+
+/******************************************************************************
+ ***************** Definitions des stuctures des FIGs **********************
+ ******************************************************************************/
+struct FIGtype0 {
+ uint8_t Length:5;
+ uint8_t FIGtypeNumber:3;
+ uint8_t Extension:5;
+ uint8_t PD:1;
+ uint8_t OE:1;
+ uint8_t CN:1;
+} PACKED;
+
+
+struct FIGtype0_0 {
+ uint8_t Length:5;
+ uint8_t FIGtypeNumber:3;
+ uint8_t Extension:5;
+ uint8_t PD:1;
+ uint8_t OE:1;
+ uint8_t CN:1;
+
+ uint16_t EId;
+ uint8_t CIFcnt_hight:5;
+ uint8_t Al:1;
+ uint8_t Change:2;
+ uint8_t CIFcnt_low:8;
+} PACKED;
+
+
+struct FIGtype0_2 {
+ uint8_t Length:5;
+ uint8_t FIGtypeNumber:3;
+ uint8_t Extension:5;
+ uint8_t PD:1;
+ uint8_t OE:1;
+ uint8_t CN:1;
+} PACKED;
+
+
+struct FIGtype0_2_Service {
+ uint16_t SId;
+ uint8_t NbServiceComp:4;
+ uint8_t CAId:3;
+ uint8_t Local_flag:1;
+} PACKED;
+
+
+struct FIGtype0_2_Service_data {
+ uint32_t SId;
+ uint8_t NbServiceComp:4;
+ uint8_t CAId:3;
+ uint8_t Local_flag:1;
+} PACKED;
+
+
+struct FIGtype0_2_audio_component {
+ uint8_t ASCTy:6;
+ uint8_t TMid:2;
+ uint8_t CA_flag:1;
+ uint8_t PS:1;
+ uint8_t SubChId:6;
+} PACKED;
+
+
+struct FIGtype0_2_data_component {
+ uint8_t DSCTy:6;
+ uint8_t TMid:2;
+ uint8_t CA_flag:1;
+ uint8_t PS:1;
+ uint8_t SubChId:6;
+} PACKED;
+
+
+struct FIGtype0_2_packet_component {
+ uint8_t SCId_high:6;
+ uint8_t TMid:2;
+ uint8_t CA_flag:1;
+ uint8_t PS:1;
+ uint8_t SCId_low:6;
+ void setSCId(uint16_t SCId) {
+ SCId_high = SCId >> 6;
+ SCId_low = SCId & 0x3f;
+ }
+} PACKED;
+
+
+struct FIGtype0_3_header {
+ uint8_t Length:5;
+ uint8_t FIGtypeNumber:3;
+ uint8_t Extension:5;
+ uint8_t PD:1;
+ uint8_t OE:1;
+ uint8_t CN:1;
+} PACKED;
+
+
+/* Warning: When bit SCCA_flag is unset(0), the multiplexer R&S does not send
+ * the SCCA field. But, in the Factum ETI analyzer, if this field is not there,
+ * it is an error.
+ */
+struct FIGtype0_3_data {
+ uint8_t SCId_high;
+ uint8_t SCCA_flag:1;
+ uint8_t rfa:3;
+ uint8_t SCId_low:4;
+ uint8_t DSCTy:6;
+ uint8_t rfu:1;
+ uint8_t DG_flag:1;
+ uint8_t Packet_address_high:2;
+ uint8_t SubChId:6;
+ uint8_t Packet_address_low;
+ uint16_t SCCA;
+ void setSCId(uint16_t SCId) {
+ SCId_high = SCId >> 4;
+ SCId_low = SCId & 0xf;
+ }
+ void setPacketAddress(uint16_t address) {
+ Packet_address_high = address >> 8;
+ Packet_address_low = address & 0xff;
+ }
+} PACKED;
+
+
+struct FIGtype0_8_short {
+ uint8_t SCIdS:4;
+ uint8_t rfa_1:3;
+ uint8_t ext:1;
+ uint8_t Id:6;
+ uint8_t MscFic:1;
+ uint8_t LS:1;
+ uint8_t rfa_2;
+} PACKED;
+
+
+struct FIGtype0_8_long {
+ uint8_t SCIdS:4;
+ uint8_t rfa_1:3;
+ uint8_t ext:1;
+ uint8_t SCId_high:4;
+ uint8_t rfa:3;
+ uint8_t LS:1;
+ uint8_t SCId_low;
+ uint8_t rfa_2;
+ void setSCId(uint16_t id) {
+ SCId_high = id >> 8;
+ SCId_low = id & 0xff;
+ }
+ uint16_t getSCid() {
+ return (SCId_high << 8) | SCId_low;
+ }
+} PACKED;
+
+
+struct FIGtype0_9 {
+ uint8_t Length:5;
+ uint8_t FIGtypeNumber:3;
+ uint8_t Extension:5;
+ uint8_t PD:1;
+ uint8_t OE:1;
+ uint8_t CN:1;
+
+ uint8_t ensembleLto:6;
+ uint8_t lto:1;
+ uint8_t ext:1;
+ uint8_t ensembleEcc;
+ uint8_t tableId;
+} PACKED;
+
+
+struct FIGtype0_10 {
+ uint8_t Length:5;
+ uint8_t FIGtypeNumber:3;
+ uint8_t Extension:5;
+ uint8_t PD:1;
+ uint8_t OE:1;
+ uint8_t CN:1;
+
+ uint8_t MJD_high:7;
+ uint8_t RFU:1;
+ uint8_t MJD_med;
+ uint8_t Hours_high:3;
+ uint8_t UTC:1;
+ uint8_t ConfInd:1;
+ uint8_t LSI:1;
+ uint8_t MJD_low:2;
+ uint8_t Minutes:6;
+ uint8_t Hours_low:2;
+ void setMJD(uint32_t date) {
+ MJD_high = (date >> 10) & 0x7f;
+ MJD_med = (date >> 2) & 0xff;
+ MJD_low = date & 0x03;
+ }
+ void setHours(uint16_t hours) {
+ Hours_high = (hours >> 2) & 0x07;
+ Hours_low = hours & 0x03;
+ }
+} PACKED;
+
+
+struct FIGtype0_17_programme {
+ uint16_t SId;
+ uint8_t NFC:2;
+ uint8_t Rfa:2;
+ uint8_t CC:1;
+ uint8_t L:1;
+ uint8_t PS:1;
+ uint8_t SD:1;
+} PACKED;
+
+
+struct FIGtype0_1 {
+ uint8_t Length:5;
+ uint8_t FIGtypeNumber:3;
+ uint8_t Extension:5;
+ uint8_t PD:1;
+ uint8_t OE:1;
+ uint8_t CN:1;
+} PACKED;
+
+
+struct FIG_01_SubChannel_ShortF {
+ uint8_t StartAdress_high:2;
+ uint8_t SubChId:6;
+ uint8_t StartAdress_low:8;
+ uint8_t TableIndex:6;
+ uint8_t TableSwitch:1;
+ uint8_t Short_Long_form:1;
+} PACKED;
+
+
+struct FIG_01_SubChannel_LongF {
+ uint8_t StartAdress_high:2;
+ uint8_t SubChId:6;
+ uint8_t StartAdress_low:8;
+ uint8_t Sub_ChannelSize_high:2;
+ uint8_t ProtectionLevel:2;
+ uint8_t Option:3;
+ uint8_t Short_Long_form:1;
+ uint8_t Sub_ChannelSize_low:8;
+} PACKED;
+
+
+struct FIG0_13_shortAppInfo {
+ uint16_t SId;
+ uint8_t No:4;
+ uint8_t SCIdS:4;
+} PACKED;
+
+
+struct FIG0_13_longAppInfo {
+ uint32_t SId;
+ uint8_t No:4;
+ uint8_t SCIdS:4;
+} PACKED;
+
+
+struct FIG0_13_app {
+ uint8_t typeHigh;
+ uint8_t length:5;
+ uint8_t typeLow:3;
+ void setType(uint16_t type) {
+ typeHigh = type >> 3;
+ typeLow = type & 0x1f;
+ }
+} PACKED;
+
+
+struct FIGtype1_0 {
+ uint8_t Length:5;
+ uint8_t FIGtypeNumber:3;
+ uint8_t Extension:3;
+ uint8_t OE:1;
+ uint8_t Charset:4;
+
+ uint16_t EId;
+} PACKED;
+
+
+struct FIGtype1_1 {
+ uint8_t Length:5;
+ uint8_t FIGtypeNumber:3;
+ uint8_t Extension:3;
+ uint8_t OE:1;
+ uint8_t Charset:4;
+
+ uint16_t Sld;
+} PACKED;
+
+
+struct FIGtype1_5 {
+ uint8_t Length:5;
+ uint8_t FIGtypeNumber:3;
+ uint8_t Extension:3;
+ uint8_t OE:1;
+ uint8_t Charset:4;
+ uint32_t SId;
+} PACKED;
+
+
+struct FIGtype1_4_programme {
+ uint8_t Length:5;
+ uint8_t FIGtypeNumber:3;
+ uint8_t Extension:3;
+ uint8_t OE:1;
+ uint8_t Charset:4;
+ uint8_t SCIdS:4;
+ uint8_t rfa:3;
+ uint8_t PD:1;
+ uint16_t SId;
+} PACKED;
+
+
+struct FIGtype1_4_data {
+ uint8_t Length:5;
+ uint8_t FIGtypeNumber:3;
+ uint8_t Extension:3;
+ uint8_t OE:1;
+ uint8_t Charset:4;
+ uint8_t SCIdS:4;
+ uint8_t rfa:3;
+ uint8_t PD:1;
+ uint32_t SId;
+} PACKED;
+
+
+#ifdef _WIN32
+# pragma pack(pop)
+#endif
+
+static unsigned char Padding_FIB[] = {
+ 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+};
+
+/******************************************************************************
+ ************* Tables pour l'identification des fichiers mp2 ****************
+ *****************************************************************************/
+const unsigned short Bit_Rate_SpecifiedTable[16] = {
+ 0, 32, 48, 56, 64, 80, 96, 112,
+ 128, 160, 192, 224, 256, 320, 384, 0
+};
+
+
+const unsigned short Sub_Channel_SizeTable[64] = {
+ 16, 21, 24, 29, 35, 24, 29, 35,
+ 42, 52, 29, 35, 42, 52, 32, 42,
+ 48, 58, 70, 40, 52, 58, 70, 84,
+ 48, 58, 70, 84, 104, 58, 70, 84,
+ 104, 64, 84, 96, 116, 140, 80, 104,
+ 116, 140, 168, 96, 116, 140, 168, 208,
+ 116, 140, 168, 208, 232, 128, 168, 192,
+ 232, 280, 160, 208, 280, 192, 280, 416
+};
+
+
+const unsigned char ProtectionLevelTable[64] = {
+ 4, 3, 2, 1, 0, 4, 3, 2,
+ 1, 0, 4, 3, 2, 1, 4, 3,
+ 2, 1, 0, 4, 3, 2, 1, 0,
+ 4, 3, 2, 1, 0, 4, 3, 2,
+ 1, 4, 3, 2, 1, 0, 4, 3,
+ 2, 1, 0, 4, 3, 2, 1, 0,
+ 4, 3, 2, 1, 0, 4, 3, 2,
+ 1, 0, 4, 3, 1, 4, 2, 0
+};
+
+
+const unsigned short BitRateTable[64] = {
+ 32, 32, 32, 32, 32, 48, 48, 48,
+ 48, 48, 56, 56, 56, 56, 64, 64,
+ 64, 64, 64, 80, 80, 80, 80, 80,
+ 96, 96, 96, 96, 96, 112, 112, 112,
+ 112, 128, 128, 128, 128, 128, 160, 160,
+ 160, 160, 160, 192, 192, 192, 192, 192,
+ 224, 224, 224, 224, 224, 256, 256, 256,
+ 256, 256, 320, 320, 320, 384, 384, 384
+};
+
+
+unsigned short getSizeByte(dabSubchannel* subchannel)
+{
+ return subchannel->bitrate * 3;
+}
+
+
+unsigned short getSizeWord(dabSubchannel* subchannel)
+{
+ return (subchannel->bitrate * 3) >> 2;
+}
+
+
+unsigned short getSizeDWord(dabSubchannel* subchannel)
+{
+ return (subchannel->bitrate * 3) >> 3;
+}
+
+
+unsigned short getSizeCu(dabSubchannel* subchannel)
+{
+ if (subchannel->protection.form == 0) {
+ return Sub_Channel_SizeTable[subchannel->
+ protection.shortForm.tableIndex];
+ } else {
+ dabProtectionLong* protection =
+ &subchannel->protection.longForm;
+ switch (protection->option) {
+ case 0:
+ switch (subchannel->protection.level) {
+ case 0:
+ return (subchannel->bitrate * 12) >> 3;
+ break;
+ case 1:
+ return subchannel->bitrate;
+ break;
+ case 2:
+ return (subchannel->bitrate * 6) >> 3;
+ break;
+ case 3:
+ return (subchannel->bitrate >> 1);
+ break;
+ default: // Should not happens
+ etiLog.print(TcpLog::ERR, "Bad protection level on "
+ "subchannel\n");
+ return 0;
+ }
+ break;
+ case 1:
+ switch (subchannel->protection.level) {
+ case 0:
+ return (subchannel->bitrate * 27) >> 5;
+ break;
+ case 1:
+ return (subchannel->bitrate * 21) >> 5;
+ break;
+ case 2:
+ return (subchannel->bitrate * 18) >> 5;
+ break;
+ case 3:
+ return (subchannel->bitrate * 15) >> 5;
+ break;
+ default: // Should not happens
+ etiLog.print(TcpLog::ERR,
+ "Bad protection level on subchannel\n");
+ return 0;
+ }
+ break;
+ default:
+ etiLog.print(TcpLog::ERR, "Invalid protection option\n");
+ return 0;
+ }
+ }
+ return 0;
+}
+
+
+time_t getDabTime()
+{
+ static time_t oldTime = 0;
+ static int offset = 0;
+ if (oldTime == 0) {
+ oldTime = time(NULL);
+ } else {
+ offset+= 24;
+ if (offset >= 1000) {
+ offset -= 1000;
+ ++oldTime;
+ }
+ }
+ return oldTime;
+}
+
+
+void printUsage(char *name, FILE* out = stderr)
+{
+ fprintf(out, "NAME\n");
+ fprintf(out, " %s - A software DAB multiplexer\n", name);
+ fprintf(out, "\nSYNOPSYS\n");
+ fprintf(out, " %s"
+ " [ensemble]"
+ " [subchannel1 subchannel2 ...]"
+ " [service1 component1 [component2 ...] service2 ...]"
+ " [output1 ...]"
+ " [-h]"
+ " [-m mode]"
+ " [-n nbFrames]"
+ " [-o]"
+ " [-s]"
+ " [-V]"
+ " [-z]"
+ "\n",
+ name);
+ fprintf(out, "\n Where ensemble ="
+ " [-i ensembleId]"
+ " [-L label]"
+ " [-l sLabel]"
+ "\n");
+ fprintf(out, "\n Where subchannel ="
+ " -(A | B | D | E | F | M | P | T) inputName"
+ " [-b bitrate]"
+ " [-i subchannelId]"
+ " [-k]"
+ " [-p protection]"
+ "\n");
+ fprintf(out, "\n Where service ="
+ " -S"
+ " [-g language]"
+ " [-i serviceId]"
+ " [-L label]"
+ " [-l sLabel]"
+ " [-y PTy]"
+ "\n");
+ fprintf(out, "\n Where component ="
+ " -C"
+ " [-a address]"
+ " [-d]"
+ " [-f figType]"
+ " [-i subchannelId]"
+ " [-L label]"
+ " [-l sLabel]"
+ " [-t type]"
+ "\n");
+ fprintf(out, "\nDESCRIPTION\n");
+ fprintf(out,
+ " %s is a software multiplexer that generates an ETI stream from\n"
+ " audio and data streams. Because of its software based architecture,\n"
+ " many typical DAB services can be generated and multiplexed on a single\n"
+ " PC platform with live or pre-recorded sources.\n"
+ "\n"
+ " A DAB multiplex configuration is composed of one ensemble. An ensemble\n"
+ " is the entity that receivers tune to and process. An ensemble contains\n"
+ " several services. A service is the listener-selectable output. Each\n"
+ " service contains one mandatory service component which is called pri-\n"
+ " mary component. An audio primary component define a program service\n"
+ " while a data primary component define a data service. Service can con-\n"
+ " tain additional components which are called secondary components. Maxi-\n"
+ " mum total number of components is 12 for program services and 11 for\n"
+ " data services. A service component is a link to one subchannel (of Fast\n"
+ " Information Data Channel). A subchannel is the physical space used\n"
+ " within the common interleaved frame.\n"
+ "\n"
+ " __________________________________________________\n"
+ " | CRC-Ensemble | ENSEMBLE\n"
+ " |__________________________________________________|\n"
+ " | | |\n"
+ " | | |\n"
+ " _______V______ _______V______ _______V______\n"
+ " | CRC-Service1 | | CRC-Service2 | | CRC-Service3 | SERVICES\n"
+ " |______________| |______________| |______________|\n"
+ " | | | | |______ |\n"
+ " | | | | | |\n"
+ " __V__ __V__ __V__ __V__ __V__ __V__\n"
+ " | SC1 | | SC2 | | SC3 | | SC4 | | SC5 | | SC6 | SERVICE\n"
+ " |_____| |_____| |_____| |_____| |_____| |_____| COMPONENTS\n"
+ " | | _____| | | ____|\n"
+ " | | | | | |\n"
+ " __V________V__V______________V________V___V_______ COMMON\n"
+ " | SubCh1 | SubCh9 | ... | SubCh3 | SubCh60 | ... | INTERLEAVED\n"
+ " |________|________|_______|________|_________|_____| FRAME\n"
+ " Figure 1: An example of a DAB multiplex configuration\n",
+ name);
+
+ fprintf(out, "\nGENERAL OPTIONS\n");
+ fprintf(out, " -h : get this help\n");
+ fprintf(out, " -m : DAB mode (default: 2)\n");
+ fprintf(out, " -n nbFrames : number of frames to produce\n");
+ fprintf(out, " -o : turn on TCP log on port 12222\n");
+ fprintf(out, " -V : print version information and "
+ "exit\n");
+ fprintf(out, " -z : write SCCA field for Factum ETI"
+ " analyzer\n");
+ fprintf(out, "\nINPUT OPTIONS\n");
+ fprintf(out, " -A : set audio service\n");
+ fprintf(out, " -B : set CRC-Bridge data service\n");
+ fprintf(out, " -D : set data service\n");
+ fprintf(out, " -E : set enhanced packet service\n");
+ fprintf(out, " -F : set DAB+ service\n");
+ fprintf(out, " -M : set DMB service\n");
+ fprintf(out, " -P : set packet service\n");
+ fprintf(out, " -T : set test service\n");
+ fprintf(out, " inputName<n> : name of file for audio and "
+ "packet service and Udp input address for data service "
+ "([address]:port)\n");
+ fprintf(out, " -a : packet address (default: 0x%x "
+ "(%i))\n", DEFAULT_PACKET_ADDRESS, DEFAULT_PACKET_ADDRESS);
+ fprintf(out, " -b bitrate<n> : bitrate (in kbits/s) of the "
+ "subchannel (default: audio 1st frame, data %i, packet %i)\n",
+ DEFAULT_DATA_BITRATE, DEFAULT_PACKET_BITRATE);
+ fprintf(out, " -c : set the extendend country code ECC "
+ "(default: %u (0x%2x)\n");
+ fprintf(out, " -d : turn on datagroups in packet "
+ "mode\n");
+ fprintf(out, " -f figType : user application type in FIG "
+ "0/13 for packet mode\n");
+ fprintf(out, " -g language : Primary service component "
+ "language: english=9, french=15\n");
+ fprintf(out, " -i id<n> : service|subchannel|"
+ "serviceComponent id <n> (default: <n>)\n");
+ fprintf(out, " -k : set non-blocking file input "
+ "(audio and packet only)\n");
+ fprintf(out, " -L label<n> : label of service <n>"
+ " (default: CRC-Audio<n>)\n");
+ fprintf(out, " -l sLabel<n> : short label flag of service <n>"
+ " (default: 0xf040)\n");
+ fprintf(out, " -p protection<n> : protection level (default: 3)\n");
+ fprintf(out, " -s : enable TIST, synchronized on 1PPS at level 2\n");
+ fprintf(out, " -t type : audio/data service component type"
+ " (default: 0)\n");
+ fprintf(out, " audio: foreground=0, "
+ "background=1, multi-channel=2\n");
+ fprintf(out, " data: unspecified=0, TMC=1, "
+ "EWS=2, ITTS=3, paging=4, TDC=5, DMB=24, IP=59, MOT=60, "
+ "proprietary=61\n");
+ fprintf(out, " -y PTy : Primary service component program"
+ " type international code\n");
+ fprintf(out, "\nOUTPUT OPTIONS\n");
+ fprintf(out, " -O output : name of the output in format "
+ "scheme://[address][:port][/name]\n"
+ " where scheme is (raw|udp|tcp|file|fifo|simul)\n"
+ );
+}
+
+
+bool running = true;
+
+void signalHandler(int signum)
+{
+#ifdef _WIN32
+ etiLog.print(TcpLog::DBG, "\npid: %i\n", _getpid());
+#else
+ etiLog.print(TcpLog::DBG, "\npid: %i, ppid: %i\n", getpid(), getppid());
+#endif
+ etiLog.print(TcpLog::DBG, "Signal handler called with signal ");
+ switch (signum) {
+#ifndef _WIN32
+ case SIGHUP:
+ etiLog.print(TcpLog::DBG, "SIGHUP\n");
+ break;
+ case SIGQUIT:
+ etiLog.print(TcpLog::DBG, "SIGQUIT\n");
+ break;
+ case SIGPIPE:
+ etiLog.print(TcpLog::DBG, "SIGPIPE\n");
+ return;
+ break;
+#endif
+ case SIGINT:
+ etiLog.print(TcpLog::DBG, "SIGINT\n");
+ break;
+ case SIGTERM:
+ etiLog.print(TcpLog::DBG, "SIGTERM\n");
+ etiLog.print(TcpLog::DBG, "Exiting software\n");
+ exit(0);
+ break;
+ default:
+ etiLog.print(TcpLog::DBG, "number %i\n", signum);
+ }
+#ifndef _WIN32
+ killpg(0, SIGPIPE);
+#endif
+ running = false;
+}
+
+
+void printEnsemble(dabEnsemble* ensemble)
+{
+ char label[17];
+ memcpy(label, ensemble->label.text, 16);
+ label[16] = 0;
+
+ etiLog.printHeader(TcpLog::INFO, "Ensemble\n");
+ etiLog.printHeader(TcpLog::INFO, " id: 0x%lx (%lu)\n",
+ ensemble->id, ensemble->id);
+ etiLog.printHeader(TcpLog::INFO, " ecc: 0x%x (%u)\n",
+ ensemble->ecc, ensemble->ecc);
+ etiLog.printHeader(TcpLog::INFO, " label: %s\n", label);
+ etiLog.printHeader(TcpLog::INFO, " short label: ");
+ for (int i = 0; i < 32; ++i) {
+ if (ensemble->label.flag & 0x8000 >> i) {
+ etiLog.printHeader(TcpLog::INFO, "%c", ensemble->label.text[i]);
+ }
+ }
+ etiLog.printHeader(TcpLog::INFO, " (0x%x)\n", ensemble->label.flag);
+ etiLog.printHeader(TcpLog::INFO, " mode: %u\n", ensemble->mode);
+}
+
+
+void printSubchannels(vector<dabSubchannel*>& subchannels)
+{
+ vector<dabSubchannel*>::iterator subchannel;
+ int index = 0;
+
+ for (subchannel = subchannels.begin(); subchannel != subchannels.end();
+ ++subchannel) {
+ dabProtection* protection = &(*subchannel)->protection;
+ etiLog.printHeader(TcpLog::INFO, "Subchannel %i\n", index);
+ etiLog.printHeader(TcpLog::INFO, " input\n");
+ etiLog.printHeader(TcpLog::INFO, " protocol: %s\n",
+ (*subchannel)->inputProto);
+ etiLog.printHeader(TcpLog::INFO, " name: %s\n",
+ (*subchannel)->inputName);
+ etiLog.printHeader(TcpLog::INFO, " type: ");
+ switch ((*subchannel)->type) {
+ case 0:
+ etiLog.printHeader(TcpLog::INFO, "audio\n");
+ break;
+ case 1:
+ etiLog.printHeader(TcpLog::INFO, "data\n");
+ break;
+ case 2:
+ etiLog.printHeader(TcpLog::INFO, "fidc\n");
+ break;
+ case 3:
+ etiLog.printHeader(TcpLog::INFO, "packet\n");
+ break;
+ default:
+ etiLog.printHeader(TcpLog::INFO, "Unknown data type "
+ "(service->type)\n");
+ break;
+ }
+ etiLog.printHeader(TcpLog::INFO, " id: %i\n",
+ (*subchannel)->id);
+ etiLog.printHeader(TcpLog::INFO, " bitrate: %i\n",
+ (*subchannel)->bitrate);
+ etiLog.printHeader(TcpLog::INFO, " protection: ");
+ if (protection->form == 0) {
+ etiLog.printHeader(TcpLog::INFO, "UEP %i\n", protection->level + 1);
+ } else {
+ etiLog.printHeader(TcpLog::INFO, "EEP %i-%c\n",
+ protection->level + 1,
+ protection->longForm.option == 0 ? 'A' : 'B');
+ }
+ if (protection->form == 0) {
+ etiLog.printHeader(TcpLog::INFO,
+ " form: short\n switch: %i\n index: %i\n",
+ protection->shortForm.tableSwitch,
+ protection->shortForm.tableIndex);
+ } else {
+ etiLog.printHeader(TcpLog::INFO,
+ " form: long\n option: %i\n level: %i\n",
+ protection->longForm.option,
+ (*subchannel)->protection.level);
+ }
+ etiLog.printHeader(TcpLog::INFO, " SAD: %i\n",
+ (*subchannel)->startAddress);
+ etiLog.printHeader(TcpLog::INFO, " size (CU): %i\n",
+ getSizeCu(*subchannel));
+ ++index;
+ }
+}
+
+
+void printComponent(dabComponent* component)
+{
+ char label[17];
+ memcpy(label, component->label.text, 16);
+ label[16] = 0;
+ if (label[0] == 0) {
+ sprintf(label, "<none>");
+ }
+
+ etiLog.printHeader(TcpLog::INFO, " service id: %i\n",
+ component->serviceId);
+ etiLog.printHeader(TcpLog::INFO, " subchannel id: %i\n",
+ component->subchId);
+ etiLog.printHeader(TcpLog::INFO, " label: %s\n",
+ label);
+ etiLog.printHeader(TcpLog::INFO, " short label: ");
+ for (int i = 0; i < 32; ++i) {
+ if (component->label.flag & 0x8000 >> i) {
+ etiLog.printHeader(TcpLog::INFO, "%c", component->label.text[i]);
+ }
+ }
+ etiLog.printHeader(TcpLog::INFO, " (0x%x)\n", component->label.flag);
+ etiLog.printHeader(TcpLog::INFO, " service component type: 0x%x (%u)\n",
+ component->type, component->type);
+ etiLog.printHeader(TcpLog::INFO, " (packet) id: %u\n",
+ component->packet.id);
+ etiLog.printHeader(TcpLog::INFO, " (packet) address: %u\n",
+ component->packet.address);
+ etiLog.printHeader(TcpLog::INFO, " (packet) app type: %u\n",
+ component->packet.appType);
+ etiLog.printHeader(TcpLog::INFO, " (packet) datagroup: %u\n",
+ component->packet.datagroup);
+}
+
+
+void printComponents(vector<dabComponent*>& components)
+{
+ vector<dabComponent*>::const_iterator current;
+ unsigned int index = 0;
+
+ for (current = components.begin(); current != components.end(); ++current) {
+ etiLog.printHeader(TcpLog::INFO, "Component %i\n", index);
+ printComponent(*current);
+ ++index;
+ }
+}
+
+
+void printServices(vector<dabService*>& services)
+{
+ vector<dabService*>::const_iterator current;
+ int index = 0;
+
+ for (current = services.begin(); current != services.end(); ++current) {
+ char label[17];
+ memcpy(label, (*current)->label.text, 16);
+ label[16] = 0;
+
+ etiLog.printHeader(TcpLog::INFO, "Service %i\n", index);
+ etiLog.printHeader(TcpLog::INFO, " label: %s\n", label);
+ etiLog.printHeader(TcpLog::INFO, " short label: ");
+ for (int i = 0; i < 32; ++i) {
+ if ((*current)->label.flag & 0x8000 >> i) {
+ etiLog.printHeader(TcpLog::INFO, "%c", (*current)->label.text[i]);
+ }
+ }
+ etiLog.printHeader(TcpLog::INFO, " (0x%x)\n", (*current)->label.flag);
+ etiLog.printHeader(TcpLog::INFO, " id: 0x%lx (%lu)\n",
+ (*current)->id, (*current)->id);
+ etiLog.printHeader(TcpLog::INFO, " pty: 0x%x (%u)\n",
+ (*current)->pty, (*current)->pty);
+ etiLog.printHeader(TcpLog::INFO, " language: 0x%x (%u)\n",
+ (*current)->language, (*current)->language);
+ ++index;
+ }
+}
+
+
+void printOutputs(vector<dabOutput*>& outputs)
+{
+ vector<dabOutput*>::const_iterator output;
+ int index = 0;
+
+ for (output = outputs.begin(); output != outputs.end(); ++output) {
+ etiLog.printHeader(TcpLog::INFO, "Output %i\n", index);
+ etiLog.printHeader(TcpLog::INFO, " protocol: %s\n",
+ (*output)->outputProto);
+ etiLog.printHeader(TcpLog::INFO, " name: %s\n",
+ (*output)->outputName);
+ ++index;
+ }
+}
+
+
+int main(int argc, char *argv[])
+{
+ etiLog.printHeader(TcpLog::INFO,
+ "Welcome to %s %s, compiled at %s, %s\n\n",
+ PACKAGE_NAME, PACKAGE_VERSION, __DATE__, __TIME__);
+ etiLog.printHeader(TcpLog::INFO,
+ "Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011\n"
+ "Her Majesty the Queen in Right of Canada,\n"
+ "(Communications Research Centre Canada) All rights reserved.\n\n");
+ etiLog.printHeader(TcpLog::INFO, "Input URLs supported:");
+#if defined(HAVE_INPUT_PRBS)
+ etiLog.printHeader(TcpLog::INFO, " prbs");
+#endif
+#if defined(HAVE_INPUT_TEST)
+ etiLog.printHeader(TcpLog::INFO, " test");
+#endif
+#if defined(HAVE_INPUT_SLIP)
+ etiLog.printHeader(TcpLog::INFO, " slip");
+#endif
+#if defined(HAVE_INPUT_UDP)
+ etiLog.printHeader(TcpLog::INFO, " udp");
+#endif
+#if defined(HAVE_INPUT_FIFO)
+ etiLog.printHeader(TcpLog::INFO, " fifo");
+#endif
+#if defined(HAVE_INPUT_FILE)
+ etiLog.printHeader(TcpLog::INFO, " file");
+#endif
+ etiLog.printHeader(TcpLog::INFO, "\n");
+
+ etiLog.printHeader(TcpLog::INFO, "Inputs format supported:");
+#if defined(HAVE_FORMAT_RAW)
+ etiLog.printHeader(TcpLog::INFO, " raw");
+#endif
+#if defined(HAVE_FORMAT_BRIDGE)
+ etiLog.printHeader(TcpLog::INFO, " bridge");
+#endif
+#if defined(HAVE_FORMAT_MPEG)
+ etiLog.printHeader(TcpLog::INFO, " mpeg");
+#endif
+#if defined(HAVE_FORMAT_PACKET)
+ etiLog.printHeader(TcpLog::INFO, " packet");
+#endif
+#if defined(HAVE_FORMAT_DMB)
+ etiLog.printHeader(TcpLog::INFO, " dmb");
+#endif
+#if defined(HAVE_FORMAT_EPM)
+ etiLog.printHeader(TcpLog::INFO, " epm");
+#endif
+ etiLog.printHeader(TcpLog::INFO, "\n");
+
+ etiLog.printHeader(TcpLog::INFO, "Output URLs supported:");
+#if defined(HAVE_OUTPUT_FILE)
+ etiLog.printHeader(TcpLog::INFO, " file");
+#endif
+#if defined(HAVE_OUTPUT_FIFO)
+ etiLog.printHeader(TcpLog::INFO, " fifo");
+#endif
+#if defined(HAVE_OUTPUT_UDP)
+ etiLog.printHeader(TcpLog::INFO, " udp");
+#endif
+#if defined(HAVE_OUTPUT_TCP)
+ etiLog.printHeader(TcpLog::INFO, " tcp");
+#endif
+#if defined(HAVE_OUTPUT_RAW)
+ etiLog.printHeader(TcpLog::INFO, " raw");
+#endif
+#if defined(HAVE_OUTPUT_SIMUL)
+ etiLog.printHeader(TcpLog::INFO, " simul");
+#endif
+ etiLog.printHeader(TcpLog::INFO, "\n\n");
+
+ /* for (int signum = 1; signum < 16; ++signum) {
+ signal(signum, signalHandler);
+ }*/
+#ifndef _WIN32
+ signal(SIGHUP, signalHandler);
+ signal(SIGQUIT, signalHandler);
+#endif
+ signal(SIGINT, signalHandler);
+ signal(SIGTERM, signalHandler);
+ //signal(SIGPIPE, signalHandler);
+
+#ifdef _WIN32
+ if (SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_HIGHEST) == 0) {
+ etiLog.printHeader(TcpLog::WARNING, "Can't increase priority: %s\n",
+ strerror(errno));
+ }
+#else
+ if (setpriority(PRIO_PROCESS, 0, -20) == -1) {
+ etiLog.printHeader(TcpLog::WARNING, "Can't increase priority: %s\n",
+ strerror(errno));
+ }
+#endif
+ /*sched_param scheduler;
+ scheduler.sched_priority = 99; // sched_get_priority_max(SCHED_RR)
+ if (sched_setscheduler(0, SCHED_RR, &scheduler) == -1) {
+ etiLog.print(TcpLog::WARNING, "Can't increased priority: %s\n",
+ strerror(errno));
+ }*/
+
+ uint8_t watermarkData[128];
+ size_t watermarkSize = 0;
+ size_t watermarkPos = 0;
+ {
+ uint8_t buffer[sizeof(watermarkData) / 2];
+ snprintf((char*)buffer, sizeof(buffer),
+ "%s %s, compiled at %s, %s",
+ PACKAGE_NAME, PACKAGE_VERSION, __DATE__, __TIME__);
+ memset(watermarkData, 0, sizeof(watermarkData));
+ watermarkData[0] = 0x55; // Sync
+ watermarkData[1] = 0x55;
+ watermarkSize = 16;
+ for (unsigned i = 0; i < strlen((char*)buffer); ++i) {
+ for (int j = 0; j < 8; ++j) {
+ uint8_t bit = (buffer[watermarkPos >> 3] >> (7 - (watermarkPos & 0x07))) & 1;
+ watermarkData[watermarkSize >> 3] |= bit << (7 - (watermarkSize & 0x07));
+ ++watermarkSize;
+ bit = 1;
+ watermarkData[watermarkSize >> 3] |= bit << (7 - (watermarkSize & 0x07));
+ ++watermarkSize;
+ ++watermarkPos;
+ }
+ }
+ }
+ watermarkPos = 0;
+
+
+ dabEnsemble* ensemble = new dabEnsemble;
+ strncpy(ensemble->label.text, DEFAULT_ENSEMBLE_LABEL, 16);
+ ensemble->mode = DEFAULT_DAB_MODE;
+ ensemble->label.flag = DEFAULT_ENSEMBLE_SHORT_LABEL;
+ ensemble->id = DEFAULT_ENSEMBLE_ID;
+ ensemble->ecc = DEFAULT_ENSEMBLE_ECC;
+
+ vector<dabOutput*> outputs;
+ vector<dabService*>::iterator service = ensemble->services.end();
+ vector<dabService*>::iterator serviceProgramInd;
+ vector<dabService*>::iterator serviceDataInd;
+ vector<dabService*>::iterator servicePty;
+ vector<dabComponent*>::iterator component = ensemble->components.end();
+ vector<dabComponent*>::iterator componentIndicatorProgram;
+ vector<dabComponent*>::iterator componentIndicatorData;
+ vector<dabSubchannel*>::iterator subchannel = ensemble->subchannels.end();
+ vector<dabSubchannel*>::iterator subchannelIndicator;
+ vector<dabOutput*>::iterator output;
+ dabProtection* protection = NULL;
+
+ unsigned int currentFrame;
+ int returnCode = 0;
+ int result;
+ int cur;
+ unsigned char etiFrame[6144];
+ unsigned short index = 0;
+ //FIC Length, DAB Mode I, II, IV -> FICL = 24, DAB Mode III -> FICL = 32
+ unsigned FICL = (ensemble->mode == 3 ? 32 : 24);
+
+ unsigned long sync = 0x49C5F8;
+ unsigned short FLtmp = 0;
+ unsigned short nbBytesCRC = 0;
+ unsigned short CRCtmp = 0xFFFF;
+ unsigned short MSTsize = 0;
+
+ unsigned int insertFIG = 0;
+ unsigned int alterneFIB = 0;
+
+ bool factumAnalyzer = false;
+ unsigned long limit = 0;
+ time_t date;
+ unsigned timestamp = 0xffffff;
+
+
+ char* progName = strrchr(argv[0], '/');
+ if (progName == NULL) {
+ progName = argv[0];
+ } else {
+ ++progName;
+ }
+
+
+ while (1) {
+ int c = getopt(argc, argv,
+ "A:B:CD:E:F:L:M:O:P:STVa:b:c:de:f:g:hi:kl:m:n:op:st:y:z");
+ if (c == -1) {
+ break;
+ }
+ switch (c) {
+ case 'O':
+ outputs.push_back(new dabOutput);
+ output = outputs.end() - 1;
+
+ memset(*output, 0, sizeof(dabOutput));
+ (*output)->outputProto = NULL;
+ (*output)->outputName = NULL;
+ (*output)->data = NULL;
+ (*output)->operations = dabOutputDefaultOperations;
+
+ char* proto;
+
+ proto = strstr(optarg, "://");
+ if (proto == NULL) {
+ etiLog.printHeader(TcpLog::ERR,
+ "No protocol defined for output\n");
+ returnCode = -1;
+ goto EXIT;
+ } else {
+ (*output)->outputProto = optarg;
+ (*output)->outputName = proto + 3;
+ *proto = 0;
+ }
+ subchannel = ensemble->subchannels.end();
+ protection = NULL;
+ component = ensemble->components.end();
+ service = ensemble->services.end();
+ break;
+ case 'S':
+ ensemble->services.push_back(new dabService);
+
+ subchannel = ensemble->subchannels.end();
+ protection = NULL;
+ component = ensemble->components.end();
+ service = ensemble->services.end() - 1;
+ output = outputs.end();
+
+ memset((*service)->label.text, 0, 16);
+ sprintf((*service)->label.text, "CRC-Service%i",
+ (int)ensemble->services.size());
+ (*service)->label.flag = 0xe01f;
+ (*service)->id = DEFAULT_SERVICE_ID + ensemble->services.size();
+ (*service)->pty = 0;
+ (*service)->language = 0;
+ currentFrame = 0; // Will be used temporaly for SCIdS
+
+ break;
+ case 'C':
+ if (service == ensemble->services.end()) {
+ etiLog.printHeader(TcpLog::ERR, "You must define a service"
+ " before using option -%c\n", c);
+ printUsage(progName);
+ returnCode = -1;
+ goto EXIT;
+ }
+
+ ensemble->components.push_back(new dabComponent);
+
+ component = ensemble->components.end() - 1;
+ subchannel = ensemble->subchannels.end();
+ protection = NULL;
+ output = outputs.end();
+
+ memset(*component, 0, sizeof(dabComponent));
+ memset((*component)->label.text, 0, 16);
+ (*component)->label.flag = 0xffff;
+ (*component)->serviceId = (*service)->id;
+ (*component)->subchId = (*(ensemble->subchannels.end() - 1))->id;
+ (*component)->SCIdS = currentFrame++;
+ break;
+ case 'A':
+ case 'B':
+ case 'D':
+ case 'E':
+ case 'F':
+ case 'M':
+ case 'P':
+ case 'T':
+ if (optarg == NULL && c != 'T') {
+ etiLog.printHeader(TcpLog::ERR,
+ "Missing parameter for option -%c\n", c);
+ printUsage(progName);
+ returnCode = -1;
+ goto EXIT;
+ }
+
+ ensemble->subchannels.push_back(new dabSubchannel);
+
+ subchannel = ensemble->subchannels.end() - 1;
+ protection = &(*subchannel)->protection;
+ component = ensemble->components.end();
+ service = ensemble->services.end();
+ output = outputs.end();
+
+ if (c != 'T') {
+ (*subchannel)->inputName = optarg;
+ } else {
+ (*subchannel)->inputName = NULL;
+ }
+ if (0) {
+#if defined(HAVE_INPUT_FILE) && defined(HAVE_FORMAT_MPEG)
+ } else if (c == 'A') {
+ (*subchannel)->inputProto = "file";
+ (*subchannel)->type = 0;
+ (*subchannel)->bitrate = 0;
+ (*subchannel)->operations = dabInputMpegFileOperations;
+#endif // defined(HAVE_INPUT_FILE) && defined(HAVE_FORMAT_MPEG)
+#if defined(HAVE_FORMAT_DABPLUS)
+ } else if (c == 'F') {
+ (*subchannel)->type = 0;
+ (*subchannel)->bitrate = 32;
+
+ char* proto;
+
+ proto = strstr(optarg, "://");
+ if (proto == NULL) {
+ (*subchannel)->inputProto = "file";
+ } else {
+ (*subchannel)->inputProto = optarg;
+ (*subchannel)->inputName = proto + 3;
+ *proto = 0;
+ }
+
+ if (0) {
+#if defined(HAVE_INPUT_FILE)
+ } else if (strcmp((*subchannel)->inputProto, "file") == 0) {
+ (*subchannel)->operations = dabInputDabplusFileOperations;
+#endif // defined(HAVE_INPUT_FILE)
+ } else {
+ etiLog.printHeader(TcpLog::ERR,
+ "Invalid protocol for DAB+ input (%s)\n",
+ (*subchannel)->inputProto);
+ printUsage(progName);
+ returnCode = -1;
+ goto EXIT;
+ }
+#endif // defined(HAVE_FORMAT_DABPLUS)
+ } else if (c == 'B') {
+ char* proto;
+
+ proto = strstr(optarg, "://");
+ if (proto == NULL) {
+ (*subchannel)->inputProto = "udp";
+ } else {
+ (*subchannel)->inputProto = optarg;
+ (*subchannel)->inputName = proto + 3;
+ *proto = 0;
+ }
+ if (0) {
+#if defined(HAVE_FORMAT_BRIDGE)
+#if defined(HAVE_INPUT_UDP)
+ } else if (strcmp((*subchannel)->inputProto, "udp") == 0) {
+ (*subchannel)->operations = dabInputBridgeUdpOperations;
+#endif // defined(HAVE_INPUT_UDP)
+#if defined(HAVE_INPUT_SLIP)
+ } else if (strcmp((*subchannel)->inputProto, "slip") == 0) {
+ (*subchannel)->operations = dabInputSlipOperations;
+#endif // defined(HAVE_INPUT_SLIP)
+#endif // defined(HAVE_FORMAT_BRIDGE)
+ }
+ } else if (c == 'D') {
+ char* proto;
+
+ proto = strstr(optarg, "://");
+ if (proto == NULL) {
+ (*subchannel)->inputProto = "udp";
+ } else {
+ (*subchannel)->inputProto = optarg;
+ (*subchannel)->inputName = proto + 3;
+ *proto = 0;
+ }
+ if (0) {
+#if defined(HAVE_INPUT_UDP)
+ } else if (strcmp((*subchannel)->inputProto, "udp") == 0) {
+ (*subchannel)->operations = dabInputUdpOperations;
+#endif
+#if defined(HAVE_INPUT_PRBS) && defined(HAVE_FORMAT_RAW)
+ } else if (strcmp((*subchannel)->inputProto, "prbs") == 0) {
+ (*subchannel)->operations = dabInputPrbsOperations;
+#endif
+#if defined(HAVE_INPUT_FILE) && defined(HAVE_FORMAT_RAW)
+ } else if (strcmp((*subchannel)->inputProto, "file") == 0) {
+ (*subchannel)->operations = dabInputRawFileOperations;
+#endif
+ } else if (strcmp((*subchannel)->inputProto, "fifo") == 0) {
+ (*subchannel)->operations = dabInputRawFifoOperations;
+ } else {
+ etiLog.printHeader(TcpLog::ERR,
+ "Invalid protocol for data input (%s)\n",
+ (*subchannel)->inputProto);
+ printUsage(progName);
+ returnCode = -1;
+ goto EXIT;
+ }
+
+ (*subchannel)->type = 1;
+ (*subchannel)->bitrate = DEFAULT_DATA_BITRATE;
+#if defined(HAVE_INPUT_TEST) && defined(HAVE_FORMAT_RAW)
+ } else if (c == 'T') {
+ (*subchannel)->inputProto = "test";
+ (*subchannel)->type = 1;
+ (*subchannel)->bitrate = DEFAULT_DATA_BITRATE;
+ (*subchannel)->operations = dabInputTestOperations;
+#endif // defined(HAVE_INPUT_TEST)) && defined(HAVE_FORMAT_RAW)
+#ifdef HAVE_FORMAT_PACKET
+ } else if (c == 'P') {
+ (*subchannel)->inputProto = "file";
+ (*subchannel)->type = 3;
+ (*subchannel)->bitrate = DEFAULT_PACKET_BITRATE;
+#ifdef HAVE_INPUT_FILE
+ (*subchannel)->operations = dabInputPacketFileOperations;
+#elif defined(HAVE_INPUT_FIFO)
+ (*subchannel)->operations = dabInputFifoOperations;
+#else
+# pragma error("Must defined at least one packet input")
+#endif // defined(HAVE_INPUT_FILE)
+#ifdef HAVE_FORMAT_EPM
+ } else if (c == 'E') {
+ (*subchannel)->inputProto = "file";
+ (*subchannel)->type = 3;
+ (*subchannel)->bitrate = DEFAULT_PACKET_BITRATE;
+ (*subchannel)->operations = dabInputEnhancedPacketFileOperations;
+#endif // defined(HAVE_FORMAT_EPM)
+#endif // defined(HAVE_FORMAT_PACKET)
+#ifdef HAVE_FORMAT_DMB
+ } else if (c == 'M') {
+ char* proto;
+
+ proto = strstr(optarg, "://");
+ if (proto == NULL) {
+ (*subchannel)->inputProto = "udp";
+ } else {
+ (*subchannel)->inputProto = optarg;
+ (*subchannel)->inputName = proto + 3;
+ *proto = 0;
+ }
+ if (strcmp((*subchannel)->inputProto, "udp") == 0) {
+ (*subchannel)->operations = dabInputDmbUdpOperations;
+ } else if (strcmp((*subchannel)->inputProto, "file") == 0) {
+ (*subchannel)->operations = dabInputDmbFileOperations;
+ } else {
+ etiLog.printHeader(TcpLog::ERR,
+ "Invalid protocol for DMB input (%s)\n",
+ (*subchannel)->inputProto);
+ printUsage(progName);
+ returnCode = -1;
+ goto EXIT;
+ }
+
+ (*subchannel)->type = 1;
+ (*subchannel)->bitrate = DEFAULT_DATA_BITRATE;
+#endif
+ } else {
+ etiLog.printHeader(TcpLog::ERR,
+ "Service '%c' not yet coded!\n", c);
+ returnCode = -1;
+ goto EXIT;
+ }
+ (*subchannel)->operations.init(&(*subchannel)->data);
+ for (int i = 0; i < 64; ++i) { // Find first free subchannel
+ subchannel = getSubchannel(ensemble->subchannels, i);
+ if (subchannel == ensemble->subchannels.end()) {
+ subchannel = ensemble->subchannels.end() - 1;
+ (*subchannel)->id = i;
+ break;
+ }
+ }
+ (*subchannel)->startAddress = 0;
+
+ if (c == 'A') {
+ protection->form = 0;
+ protection->level = 2;
+ protection->shortForm.tableSwitch = 0;
+ protection->shortForm.tableIndex = 0;
+ } else {
+ protection->level = 2;
+ protection->form = 1;
+ protection->longForm.option = 0;
+ }
+ break;
+ case 'L':
+ if (optarg == NULL) {
+ etiLog.printHeader(TcpLog::ERR,
+ "Missing parameter for option -L\n");
+ printUsage(progName);
+ returnCode = -1;
+ goto EXIT;
+ }
+ if (service == ensemble->services.end()) {
+ memset(ensemble->label.text, 0, 16);
+ strncpy(ensemble->label.text, optarg, 16);
+ ensemble->label.flag = 0xff00;
+ } else if (component != ensemble->components.end()) {
+ memset((*component)->label.text, 0, 16);
+ strncpy((*component)->label.text, optarg, 16);
+ (*component)->label.flag = 0xff00;
+ } else { // Service
+ memset((*service)->label.text, 0, 16);
+ strncpy((*service)->label.text, optarg, 16);
+ (*service)->label.flag = 0xff00;
+ }
+ // TODO Check strlen before doing short label
+ // TODO Check if short label already set
+ break;
+ case 'V':
+ goto EXIT;
+ case 'l':
+ if (optarg == NULL) {
+ etiLog.printHeader(TcpLog::ERR,
+ "Missing parameter for option -l\n");
+ printUsage(progName);
+ returnCode = -1;
+ goto EXIT;
+ }
+ if (service == ensemble->services.end()) {
+ char* end;
+ ensemble->label.flag = strtoul(optarg, &end, 0);
+ if (*end != 0) {
+ end = optarg;
+ ensemble->label.flag = 0;
+ for (int i = 0; i < 32; ++i) {
+ if (*end == ensemble->label.text[i]) {
+ ensemble->label.flag |= 0x8000 >> i;
+ if (*(++end) == 0) {
+ break;
+ }
+ }
+ }
+ if (*end != 0) {
+ etiLog.printHeader(TcpLog::ERR,
+ "Error at '%c' in ensemble short label '%s'!\n"
+ "Not in label '%s'!\n",
+ *end, optarg, ensemble->label.text);
+ returnCode = -1;
+ goto EXIT;
+ }
+ }
+ int count = 0;
+ for (int i = 0; i < 16; ++i) {
+ if (ensemble->label.flag & (1 << i)) {
+ ++count;
+ }
+ }
+ if (count > 8) {
+ etiLog.printHeader(TcpLog::ERR,
+ "Ensemble short label too long!\n"
+ "Must be < 8 characters.\n");
+ returnCode = -1;
+ goto EXIT;
+ }
+ } else if (component != ensemble->components.end()) {
+ char* end;
+ (*component)->label.flag = strtoul(optarg, &end, 0);
+ if (*end != 0) {
+ end = optarg;
+ (*component)->label.flag = 0;
+ for (int i = 0; i < 32; ++i) {
+ if (*end == (*component)->label.text[i]) {
+ (*component)->label.flag |= 0x8000 >> i;
+ if (*(++end) == 0) {
+ break;
+ }
+ }
+ }
+ if (*end != 0) {
+ etiLog.printHeader(TcpLog::ERR,
+ "Error at '%c' in component short label '%s'!\n"
+ "Not in label '%s'!\n",
+ *end, optarg, (*component)->label.text);
+ returnCode = -1;
+ goto EXIT;
+ }
+ }
+ int count = 0;
+ for (int i = 0; i < 16; ++i) {
+ if ((*component)->label.flag & (1 << i)) {
+ ++count;
+ }
+ }
+ if (count > 8) {
+ etiLog.printHeader(TcpLog::ERR,
+ "Service '%s' short label too long!\n"
+ "Must be < 8 characters.\n", (*component)->label.text);
+ returnCode = -1;
+ goto EXIT;
+ }
+ } else {
+ char* end;
+ (*service)->label.flag = strtoul(optarg, &end, 0);
+ if (*end != 0) {
+ end = optarg;
+ (*service)->label.flag = 0;
+ for (int i = 0; i < 32; ++i) {
+ if (*end == (*service)->label.text[i]) {
+ (*service)->label.flag |= 0x8000 >> i;
+ if (*(++end) == 0) {
+ break;
+ }
+ }
+ }
+ if (*end != 0) {
+ etiLog.printHeader(TcpLog::ERR,
+ "Error at '%c' in service short label '%s'!\n"
+ "Not in label '%s'!\n",
+ *end, optarg, (*service)->label.text);
+ returnCode = -1;
+ goto EXIT;
+ }
+ }
+ int count = 0;
+ for (int i = 0; i < 16; ++i) {
+ if ((*service)->label.flag & (1 << i)) {
+ ++count;
+ }
+ }
+ if (count > 8) {
+ etiLog.printHeader(TcpLog::ERR,
+ "Service '%s' short label too long!\n"
+ "Must be < 8 characters.\n", (*service)->label.text);
+ returnCode = -1;
+ goto EXIT;
+ }
+ }
+ break;
+ case 'i':
+ if (optarg == NULL) {
+ etiLog.printHeader(TcpLog::ERR,
+ "Missing parameter for option -i\n");
+ printUsage(progName);
+ returnCode = -1;
+ goto EXIT;
+ }
+ if (component != ensemble->components.end()) {
+ (*component)->subchId = strtoul(optarg, NULL, 0);
+ } else if (subchannel != ensemble->subchannels.end()) {
+ (*subchannel)->id = strtoul(optarg, NULL, 0);
+ } else if (service != ensemble->services.end()) {
+ (*service)->id = strtoul(optarg, NULL, 0);
+ if ((*service)->id == 0) {
+ etiLog.printHeader(TcpLog::ERR,
+ "Service id 0 is invalid\n");
+ returnCode = -1;
+ goto EXIT;
+ }
+ } else {
+ ensemble->id = strtoul(optarg, NULL, 0);
+ }
+ break;
+ case 'b':
+ if (optarg == NULL) {
+ etiLog.printHeader(TcpLog::ERR,
+ "Missing parameter for option -b\n");
+ printUsage(progName);
+ returnCode = -1;
+ goto EXIT;
+ }
+ if (subchannel == ensemble->subchannels.end()) {
+ etiLog.printHeader(TcpLog::ERR,
+ "You must define a subchannel first!\n");
+ printUsage(progName);
+ returnCode = -1;
+ goto EXIT;
+ }
+ (*subchannel)->bitrate = strtoul(optarg, NULL, 0);
+ if (((*subchannel)->bitrate & 0x7) != 0) {
+ (*subchannel)->bitrate += 8;
+ (*subchannel)->bitrate &= ~0x7;
+ etiLog.printHeader(TcpLog::WARNING,
+ "bitrate must be multiple of 8 -> ceiling to %i\n",
+ (*subchannel)->bitrate);
+ }
+ break;
+ case 'c':
+ if (optarg == NULL) {
+ etiLog.printHeader(TcpLog::ERR,
+ "Missing parameter for option -c\n");
+ printUsage(progName);
+ returnCode = -1;
+ goto EXIT;
+ }
+ ensemble->ecc = strtoul(optarg, NULL, 0);
+ break;
+#if defined(HAVE_INPUT_FIFO) && defined(HAVE_INPUT_FILE)
+ case 'k':
+ if (subchannel == ensemble->subchannels.end()) {
+ etiLog.printHeader(TcpLog::ERR,
+ "You must define a subchannel first!\n");
+ printUsage(progName);
+ returnCode = -1;
+ goto EXIT;
+ }
+ switch ((*subchannel)->type) {
+#ifdef HAVE_FORMAT_PACKET
+ case 3:
+ (*subchannel)->operations.clean(&(*subchannel)->data);
+ if ((*subchannel)->operations == dabInputPacketFileOperations) {
+ (*subchannel)->operations = dabInputFifoOperations;
+#ifdef HAVE_FORMAT_EPM
+ } else if ((*subchannel)->operations == dabInputEnhancedPacketFileOperations) {
+ (*subchannel)->operations = dabInputEnhancedFifoOperations;
+#endif // defined(HAVE_FORMAT_EPM)
+ } else {
+ etiLog.printHeader(TcpLog::ERR,
+ "Error, wrong packet subchannel operations!\n");
+ returnCode = -1;
+ goto EXIT;
+ }
+ (*subchannel)->operations.init(&(*subchannel)->data);
+ (*subchannel)->inputProto = "fifo";
+ break;
+#endif // defined(HAVE_FORMAT_PACKET)
+#ifdef HAVE_FORMAT_MPEG
+ case 0:
+ (*subchannel)->operations.clean(&(*subchannel)->data);
+ if ((*subchannel)->operations == dabInputMpegFileOperations) {
+ (*subchannel)->operations = dabInputMpegFifoOperations;
+ } else if ((*subchannel)->operations ==
+ dabInputDabplusFileOperations) {
+ (*subchannel)->operations = dabInputDabplusFifoOperations;
+ } else {
+ etiLog.printHeader(TcpLog::ERR,
+ "Error, wrong audio subchannel operations!\n");
+ returnCode = -1;
+ goto EXIT;
+ }
+ (*subchannel)->operations.init(&(*subchannel)->data);
+ (*subchannel)->inputProto = "fifo";
+ break;
+#endif // defined(HAVE_FORMAT_MPEG)
+ default:
+ etiLog.printHeader(TcpLog::ERR,
+ "sorry, non-blocking input file is "
+ "only valid with audio or packet services\n");
+ returnCode = -1;
+ goto EXIT;
+ }
+ break;
+#endif // defined(HAVE_INPUT_FIFO) && defined(HAVE_INPUT_FILE)
+ case 'p':
+ int level;
+ if (optarg == NULL) {
+ etiLog.printHeader(TcpLog::ERR,
+ "Missing parameter for option -P\n");
+ printUsage(progName);
+ returnCode = -1;
+ goto EXIT;
+ }
+ if (subchannel == ensemble->subchannels.end()) {
+ etiLog.printHeader(TcpLog::ERR,
+ "You must define a subchannel first!\n");
+ printUsage(progName);
+ returnCode = -1;
+ goto EXIT;
+ }
+ level = strtoul(optarg, NULL, 0) - 1;
+ if (protection->form == 0) {
+ if ((level < 0) || (level > 4)) {
+ etiLog.printHeader(TcpLog::ERR,
+ "protection level must be between "
+ "1 to 5 inclusively (current = %i)\n", level);
+ returnCode = -1;
+ goto EXIT;
+ }
+ } else {
+ if ((level < 0) || (level > 3)) {
+ etiLog.printHeader(TcpLog::ERR,
+ "protection level must be between "
+ "1 to 4 inclusively (current = %i)\n", level);
+ returnCode = -1;
+ goto EXIT;
+ }
+ }
+ protection->level = level;
+ break;
+ case 'm':
+ if (optarg) {
+ ensemble->mode = strtoul(optarg, NULL, 0);
+ if ((ensemble->mode < 1) || (ensemble->mode > 4)) {
+ etiLog.printHeader(TcpLog::ERR,
+ "Mode must be between 1-4\n");
+ returnCode = -1;
+ goto EXIT;
+ }
+ if (ensemble->mode == 4)
+ ensemble->mode = 0;
+ if (ensemble->mode == 3) {
+ FICL = 32;
+ } else {
+ FICL = 24;
+ }
+ } else {
+ etiLog.printHeader(TcpLog::ERR,
+ "Missing parameter for option -m\n");
+ printUsage(progName);
+ returnCode = -1;
+ goto EXIT;
+ }
+ break;
+ case 'n':
+ if (optarg) {
+ limit = strtoul(optarg, NULL, 0);
+ } else {
+ etiLog.printHeader(TcpLog::ERR,
+ "Missing parameter for option -n\n");
+ printUsage(progName);
+ returnCode = -1;
+ goto EXIT;
+ }
+ break;
+ case 'o':
+ etiLog.open("createETI", 0, 12222);
+ break;
+ case 't':
+ if (optarg == NULL) {
+ etiLog.printHeader(TcpLog::ERR,
+ "Missing parameter for option -t\n");
+ printUsage(progName);
+ returnCode = -1;
+ goto EXIT;
+ }
+ if (component == ensemble->components.end()) {
+ etiLog.printHeader(TcpLog::ERR,
+ "You must define a component before setting "
+ "service type!\n");
+ printUsage(progName);
+ returnCode = -1;
+ goto EXIT;
+ }
+ (*component)->type = strtoul(optarg, NULL, 0);
+ break;
+ case 'a':
+ if (component == ensemble->components.end()) {
+ etiLog.printHeader(TcpLog::ERR,
+ "You must define a component before setting "
+ "packet address!\n");
+ printUsage(progName);
+ returnCode = -1;
+ goto EXIT;
+ }
+ if (!(*component)->isPacketComponent(ensemble->subchannels)) {
+ etiLog.printHeader(TcpLog::ERR, "address\n");
+ printUsage(progName);
+ returnCode = -1;
+ goto EXIT;
+ }
+ (*component)->packet.address = strtoul(optarg, NULL, 0);
+ break;
+ case 'd':
+ if (component == ensemble->components.end()) {
+ etiLog.printHeader(TcpLog::ERR,
+ "You must define a component before setting "
+ "datagroup!\n");
+ printUsage(progName);
+ returnCode = -1;
+ goto EXIT;
+ }
+ if (!(*component)->isPacketComponent(ensemble->subchannels)) {
+ etiLog.printHeader(TcpLog::ERR, "datagroup\n");
+ printUsage(progName);
+ returnCode = -1;
+ goto EXIT;
+ }
+ (*component)->packet.datagroup = true;
+ break;
+ case 'f':
+ if (component == ensemble->components.end()) {
+ etiLog.printHeader(TcpLog::ERR,
+ "You must define a component first!\n");
+ printUsage(progName);
+ returnCode = -1;
+ goto EXIT;
+ }
+ if (!(*component)->isPacketComponent(ensemble->subchannels)) {
+ etiLog.printHeader(TcpLog::ERR, "application type\n");
+ printUsage(progName);
+ returnCode = -1;
+ goto EXIT;
+ }
+ (*component)->packet.appType = strtoul(optarg, NULL, 0);
+ break;
+ case 'g':
+ if (service == ensemble->services.end()) {
+ etiLog.printHeader(TcpLog::ERR, "You must define a service"
+ " before using option -%c\n", c);
+ printUsage(progName);
+ returnCode = -1;
+ goto EXIT;
+ }
+ (*service)->language = strtoul(optarg, NULL, 0);
+ break;
+ case 's':
+ {
+ struct timeval tv;
+ gettimeofday(&tv, NULL);
+ unsigned _8ms = (tv.tv_usec / 1000) / 8;
+ unsigned _1ms = (tv.tv_usec - (_8ms * 8000)) / 1000;
+ unsigned _4us = 20;
+ unsigned _488ns = 0;
+ unsigned _61ns = 0;
+ timestamp = (((((((_8ms << 3) | _1ms) << 8) | _4us) << 3) | _488ns) << 8) | _61ns;
+ }
+ break;
+ case 'y':
+ if (service == ensemble->services.end()) {
+ etiLog.printHeader(TcpLog::ERR, "You must define a service"
+ " before using option -%c\n", c);
+ printUsage(progName);
+ returnCode = -1;
+ goto EXIT;
+ }
+ (*service)->pty = strtoul(optarg, NULL, 0);
+ break;
+ case 'z':
+ factumAnalyzer = true;
+ break;
+ case '?':
+ returnCode = -1;
+ case 'h':
+ printUsage(progName, stdout);
+ goto EXIT;
+ default:
+ etiLog.printHeader(TcpLog::ERR, "Option '%c' not coded yet\n", c);
+ returnCode = -1;
+ goto EXIT;
+ }
+ }
+ if (optind < argc) {
+ etiLog.printHeader(TcpLog::ERR, "Too much parameters:");
+ while (optind < argc) {
+ etiLog.printHeader(TcpLog::ERR, " %s", argv[optind++]);
+ }
+ etiLog.printHeader(TcpLog::ERR, "\n");
+ printUsage(progName);
+ returnCode = -1;
+ goto EXIT;
+ }
+
+ if (outputs.size() == 0) {
+ etiLog.printHeader(TcpLog::WARNING, "no output defined\n");
+
+ outputs.push_back(new dabOutput);
+ output = outputs.end() - 1;
+
+ memset(*output, 0, sizeof(dabOutput));
+ (*output)->outputProto = "simul";
+ (*output)->outputName = NULL;
+ (*output)->data = NULL;
+ (*output)->operations = dabOutputDefaultOperations;
+
+ printf("Press enter to continue\n");
+ getchar();
+ }
+
+ // Check and adjust subchannels
+ {
+ set<unsigned char> ids;
+ for (subchannel = ensemble->subchannels.begin();
+ subchannel != ensemble->subchannels.end();
+ ++subchannel) {
+ if (ids.find((*subchannel)->id) != ids.end()) {
+ etiLog.printHeader(TcpLog::ERR,
+ "Subchannel %u is set more than once!\n",
+ (*subchannel)->id);
+ returnCode = -1;
+ goto EXIT;
+ }
+ }
+ }
+
+ // Check and adjust services and components
+ {
+ set<uint32_t> ids;
+ for (service = ensemble->services.begin();
+ service != ensemble->services.end();
+ ++service) {
+ if (ids.find((*service)->id) != ids.end()) {
+ etiLog.printHeader(TcpLog::ERR,
+ "Service id 0x%x (%u) is set more than once!\n",
+ (*service)->id, (*service)->id);
+ returnCode = -1;
+ goto EXIT;
+ }
+
+ // Get first component of this service
+ component = getComponent(ensemble->components, (*service)->id);
+ if (component == ensemble->components.end()) {
+ etiLog.printHeader(TcpLog::ERR,
+ "Service %u includes no component!\n");
+ returnCode = -1;
+ goto EXIT;
+ }
+
+ // Adjust service type from this first component
+ switch ((*service)->getType(ensemble)) {
+ case 0: // Audio
+ (*service)->program = true;
+ break;
+ case 1:
+ case 2:
+ case 3:
+ (*service)->program = false;
+ break;
+ default:
+ etiLog.printHeader(TcpLog::ERR,
+ "Error, unknown service type: %u\n", (*service)->getType(ensemble));
+ returnCode = -1;
+ goto EXIT;
+ }
+
+ // Adjust components type for DAB+
+ while (component != ensemble->components.end()) {
+ subchannel =
+ getSubchannel(ensemble->subchannels, (*component)->subchId);
+ if (subchannel == ensemble->subchannels.end()) {
+ etiLog.printHeader(TcpLog::ERR, "Error, service %u component "
+ "links to the invalid subchannel %u\n",
+ (*component)->serviceId, (*component)->subchId);
+ returnCode = -1;
+ goto EXIT;
+ }
+
+ protection = &(*subchannel)->protection;
+ switch ((*subchannel)->type) {
+ case 0: // Audio
+ {
+ if (protection->form != 0) {
+ (*component)->type = 0x3f; // DAB+
+ }
+ }
+ break;
+ case 1:
+ case 2:
+ case 3:
+ break;
+ default:
+ etiLog.printHeader(TcpLog::ERR,
+ "Error, unknown subchannel type\n");
+ returnCode = -1;
+ goto EXIT;
+ }
+ component = getComponent(ensemble->components,
+ (*service)->id, component);
+ }
+ }
+ }
+
+
+ for (output = outputs.begin(); output != outputs.end() ; ++output) {
+#if defined(HAVE_OUTPUT_FILE)
+ if (strcmp((*output)->outputProto, "file") == 0) {
+ (*output)->operations = dabOutputFileOperations;
+#else // !defined(HAVE_OUTPUT_FILE)
+ if (0) {
+#endif // defined(HAVE_OUTPUT_FILE)
+#if defined(HAVE_OUTPUT_FIFO)
+ } else if (strcmp((*output)->outputProto, "fifo") == 0) {
+ (*output)->operations = dabOutputFifoOperations;
+#endif // !defined(HAVE_OUTPUT_FIFO)
+#if defined(HAVE_OUTPUT_RAW)
+ } else if (strcmp((*output)->outputProto, "raw") == 0) {
+ (*output)->operations = dabOutputRawOperations;
+#endif // defined(HAVE_OUTPUT_RAW)
+#if defined(HAVE_OUTPUT_UDP)
+ } else if (strcmp((*output)->outputProto, "udp") == 0) {
+ (*output)->operations = dabOutputUdpOperations;
+#endif // defined(HAVE_OUTPUT_UDP)
+#if defined(HAVE_OUTPUT_TCP)
+ } else if (strcmp((*output)->outputProto, "tcp") == 0) {
+ (*output)->operations = dabOutputTcpOperations;
+#endif // defined(HAVE_OUTPUT_TCP)
+#if defined(HAVE_OUTPUT_SIMUL)
+ } else if (strcmp((*output)->outputProto, "simul") == 0) {
+ (*output)->operations = dabOutputSimulOperations;
+#endif // defined(HAVE_OUTPUT_SIMUL)
+ } else {
+ etiLog.printHeader(TcpLog::ERR, "Output protcol unknown: %s\n",
+ (*output)->outputProto);
+ goto EXIT;
+ }
+
+ if ((*output)->operations.init(&(*output)->data) == -1) {
+ etiLog.printHeader(TcpLog::ERR, "Unable to init output %s://%s\n",
+ (*output)->outputProto, (*output)->outputName);
+ return -1;
+ }
+ if ((*output)->operations.open((*output)->data, (*output)->outputName)
+ == -1) {
+ etiLog.printHeader(TcpLog::ERR, "Unable to open output %s://%s\n",
+ (*output)->outputProto, (*output)->outputName);
+ return -1;
+ }
+ }
+
+ //Relatif aux fichiers d'entre
+ for (subchannel = ensemble->subchannels.begin();
+ subchannel != ensemble->subchannels.end();
+ ++subchannel) {
+ protection = &(*subchannel)->protection;
+ if (subchannel == ensemble->subchannels.begin()) {
+ (*subchannel)->startAddress = 0;
+ } else {
+ (*subchannel)->startAddress = (*(subchannel - 1))->startAddress +
+ getSizeCu(*(subchannel - 1));
+ }
+ if ((*subchannel)->operations.open((*subchannel)->data,
+ (*subchannel)->inputName) == -1) {
+ perror((*subchannel)->inputName);
+ returnCode = -1;
+ goto EXIT;
+ }
+
+ // TODO Check errors
+ int result = (*subchannel)->operations.setBitrate(
+ &(*subchannel)->operations, (*subchannel)->data,
+ (*subchannel)->bitrate);
+ if (result <= 0) {
+ etiLog.printHeader(TcpLog::ERR, "can't set bitrate for source %s\n",
+ (*subchannel)->inputName);
+ returnCode = -1;
+ goto EXIT;
+ }
+ (*subchannel)->bitrate = result;
+
+ if (protection->form == 0) {
+ protection->form = 1;
+ for (int i = 0; i < 64; i++) {
+ if ((*subchannel)->bitrate == BitRateTable[i]) {
+ if (protection->level == ProtectionLevelTable[i]) {
+ protection->form = 0;
+ protection->shortForm.tableIndex = i;
+ }
+ }
+ }
+ }
+ }
+
+ if (ensemble->subchannels.size() == 0) {
+ etiLog.printHeader(TcpLog::ERR, "can't multiplexed no subchannel!\n");
+ returnCode = -1;
+ goto EXIT;
+ }
+
+ subchannel = ensemble->subchannels.end() - 1;
+ if ((*subchannel)->startAddress + getSizeCu((*subchannel)) > 864) {
+ etiLog.printHeader(TcpLog::ERR, "Total size in CU exceeds 864\n");
+ printSubchannels(ensemble->subchannels);
+ returnCode = -1;
+ goto EXIT;
+ }
+
+ // Init packet components SCId
+ cur = 0;
+ for (component = ensemble->components.begin();
+ component != ensemble->components.end();
+ ++component) {
+ subchannel = getSubchannel(ensemble->subchannels,
+ (*component)->subchId);
+ if (subchannel == ensemble->subchannels.end()) {
+ etiLog.printHeader(TcpLog::ERR,
+ "Subchannel %i does not exist for component "
+ "of service %i\n",
+ (*component)->subchId, (*component)->serviceId);
+ returnCode = -1;
+ goto EXIT;
+ }
+ if ((*subchannel)->type != 3) continue;
+
+ (*component)->packet.id = cur++;
+ }
+
+ //Initialisation a 0 des cases de la trame ETI
+ memset(etiFrame, 0, 6144);
+
+ // Print settings before starting
+ etiLog.printHeader(TcpLog::INFO, "\n--- Multiplex configuration ---\n");
+ printEnsemble(ensemble);
+
+ etiLog.printHeader(TcpLog::INFO, "\n--- Subchannels list ---\n");
+ printSubchannels(ensemble->subchannels);
+
+ etiLog.printHeader(TcpLog::INFO, "\n--- Services list ---\n");
+ printServices(ensemble->services);
+
+ etiLog.printHeader(TcpLog::INFO, "\n--- Components list ---\n");
+ printComponents(ensemble->components);
+
+ etiLog.printHeader(TcpLog::INFO, "\n--- Output list ---\n");
+ printOutputs(outputs);
+
+ etiLog.printHeader(TcpLog::INFO, "\n");
+
+
+ /***************************************************************************
+ ********** Boucle principale, chaque passage cree une trame ************
+ **************************************************************************/
+ serviceProgramInd = ensemble->services.end();
+ serviceDataInd = ensemble->services.end();
+ componentIndicatorProgram = ensemble->components.end();
+ componentIndicatorData = ensemble->components.end();
+ servicePty = ensemble->services.end();
+ subchannelIndicator = ensemble->subchannels.end();
+
+
+ for (currentFrame = 0; running; currentFrame++) {
+ if ((limit > 0) && (currentFrame >= limit)) {
+ break;
+ }
+ date = getDabTime();
+
+ //Initialisation a 0 des cases de la trame
+ memset(etiFrame, 0, 6144);
+
+ /**********************************************************************
+ ********** Section SYNC du ETI(NI, G703) *************************
+ **********************************************************************/
+
+ //declare une instance d'une structure eti_SYNC
+ eti_SYNC *etiSync = (eti_SYNC *) etiFrame;
+ //****** Section ERR ******//
+ // 1 octet
+ etiSync->ERR = 0xFF; //Indique qu'il n'y a pas d'erreur
+ //****** Section FSYNC *****//
+ // 3 octets, pour la synchronisation, alterne a chaque trame entre les
+ // deux symboles
+ sync ^= 0xffffff;
+ etiSync->FSYNC = sync;
+
+ /**********************************************************************
+ *********** Section LIDATA du ETI(NI, G703) **********************
+ **********************************************************************/
+
+ //****** Section FC ***************************************************/
+ // 4 octets
+ // declare une instance d une structure eti_FC et la place dans la trame
+ eti_FC *fc = (eti_FC *) & etiFrame[4];
+
+ //****** FCT **********************//
+ //Incremente a chaque trame, de 0 a 249, 1 octet
+ fc->FCT = currentFrame % 250;
+
+ //****** FICF ******//
+ //Fast Information Channel Flag, 1 bit, =1 si le FIC est present
+ fc->FICF = 1;
+
+ //****** NST ******//
+ //Number of Stream, 7 bits, 0-64, 0 si reconfiguration du multiplex
+ fc->NST = ensemble->subchannels.size();
+
+ //****** FP ******//
+ // Frame Phase, 3 bits, compteur sur 3 bits, permet au COFDM generator
+ // de savoir quand inserer le TII utilise egalement par le MNST
+ fc->FP = currentFrame & 0x7;
+
+ //****** MID ******//
+ //Mode Identity, 2 bits, 01 ModeI, 10 modeII, 11 ModeIII, 00 ModeIV
+ fc->MID = ensemble->mode; //mode 2 demande 3 FIB, 3*32octets = 96octets
+
+ //****** FL ******//
+ //Frame Length, 11 bits, nb of words(4 bytes) in STC, EOH and MST
+ // si NST=0, FL=1+FICL words, FICL=24 ou 32 selon le mode
+ //en word ( 4 bytes), +1 pour la partie EOH
+ FLtmp = 1 + FICL + (fc->NST);
+
+ for (subchannel = ensemble->subchannels.begin();
+ subchannel != ensemble->subchannels.end();
+ ++subchannel) {
+ //Taille d'une trame audio mp2 en paquet de 64 bits
+ FLtmp += getSizeWord(*subchannel);
+ }
+
+ fc->setFrameLength(FLtmp);
+ index = 8;
+
+ /******* Section STC **************************************************/
+ // Stream Characterization,
+ // number of channel * 4 octets = nb octets total
+ for (subchannel = ensemble->subchannels.begin();
+ subchannel != ensemble->subchannels.end();
+ ++subchannel) {
+ protection = &(*subchannel)->protection;
+ eti_STC *sstc = (eti_STC *) & etiFrame[index];
+
+ sstc->SCID = (*subchannel)->id;
+ sstc->startAddress_high = (*subchannel)->startAddress / 256;
+ sstc->startAddress_low = (*subchannel)->startAddress % 256;
+ //devrait changer selon le mode de protection desire
+ if (protection->form == 0) {
+ sstc->TPL = 0x10 |
+ ProtectionLevelTable[protection->shortForm.tableIndex];
+ } else {
+ sstc->TPL = 0x20 |
+ (protection->longForm.option << 2) |
+ (protection->level);
+ }
+ //Sub-channel Stream Length, multiple de 64 bits
+ sstc->STL_high = getSizeDWord(*subchannel) / 256;
+ sstc->STL_low = getSizeDWord(*subchannel) % 256;
+ index += 4;
+ }
+
+ /******* Section EOH **************************************************/
+ // End of Header 4 octets
+ eti_EOH *eoh = (eti_EOH *) & etiFrame[index];
+
+ //MNSC Multiplex Network Signalling Channel, 2 octets
+ eoh->MNSC = 0;
+
+ //CRC Cyclic Redundancy Checksum du FC, STC et MNSC, 2 octets
+ nbBytesCRC = 4 + ((fc->NST) * 4) + 2;
+
+ CRCtmp = 0xffff;
+ CRCtmp = crc16(CRCtmp, &etiFrame[4], nbBytesCRC);
+ CRCtmp ^= 0xffff;
+ eoh->CRC = htons(CRCtmp);
+
+ /******* Section MST **************************************************/
+ // Main Stream Data, si FICF=1 alors les 96 ou 128 premiers octets
+ // transportent le FIC selon le mode
+ index = ((fc->NST) + 2 + 1) * 4;
+
+ //Insertion du FIC
+ FIGtype0* fig0;
+ FIGtype0_0 *fig0_0;
+ FIGtype0_1 *figtype0_1;
+
+ FIG_01_SubChannel_ShortF *fig0_1subchShort;
+ FIG_01_SubChannel_LongF *fig0_1subchLong1;
+
+ FIGtype0_2 *fig0_2;
+
+ FIGtype0_2_Service *fig0_2serviceAudio;
+ FIGtype0_2_Service_data *fig0_2serviceData;
+ FIGtype0_2_audio_component* audio_description;
+ FIGtype0_2_data_component* data_description;
+ FIGtype0_2_packet_component* packet_description;
+
+ FIGtype0_3_header *fig0_3_header;
+ FIGtype0_3_data *fig0_3_data;
+ FIGtype0_9 *fig0_9;
+ FIGtype0_10 *fig0_10;
+ FIGtype0_17_programme *programme;
+
+ FIGtype1_0 *fig1_0;
+ FIGtype1_1 *fig1_1;
+ FIGtype1_5 *fig1_5;
+
+ tm* timeData;
+
+ unsigned char figSize = 0;
+
+ //Insertion du FIB 0
+ switch (insertFIG) {
+
+ case 0:
+ case 4:
+ // FIG type 0/0, Multiplex Configuration Info (MCI),
+ // Ensemble information
+ fig0_0 = (FIGtype0_0 *) & etiFrame[index];
+
+ fig0_0->FIGtypeNumber = 0;
+ fig0_0->Length = 5;
+ fig0_0->CN = 0;
+ fig0_0->OE = 0;
+ fig0_0->PD = 0;
+ fig0_0->Extension = 0;
+
+ fig0_0->EId = htons(ensemble->id);
+ fig0_0->Change = 0;
+ fig0_0->Al = 0;
+ fig0_0->CIFcnt_hight = (currentFrame / 250) % 20;
+ fig0_0->CIFcnt_low = (currentFrame % 250);
+ index = index + 6;
+ figSize += 6;
+
+ break;
+
+ case 1:
+ // FIG type 0/1, MIC, Sub-Channel Organization, une instance de la
+ // sous-partie par sous-canal
+ figtype0_1 = (FIGtype0_1 *) & etiFrame[index];
+
+ figtype0_1->FIGtypeNumber = 0;
+ figtype0_1->Length = 1;
+ figtype0_1->CN = 0;
+ figtype0_1->OE = 0;
+ figtype0_1->PD = 0;
+ figtype0_1->Extension = 1;
+ index = index + 2;
+ figSize += 2;
+
+ //Sous-partie du FIG type 0/1
+ if (subchannelIndicator == ensemble->subchannels.end()) {
+ subchannelIndicator = ensemble->subchannels.begin();
+ }
+ for (; subchannelIndicator != ensemble->subchannels.end();
+ ++subchannelIndicator) {
+ protection = &(*subchannelIndicator)->protection;
+
+ if ((protection->form == 0 && figSize > 27) ||
+ (protection->form != 0 && figSize > 26)) {
+ break;
+ }
+
+ if (protection->form == 0) {
+ fig0_1subchShort =
+ (FIG_01_SubChannel_ShortF*) &etiFrame[index];
+ fig0_1subchShort->SubChId = (*subchannelIndicator)->id;
+ fig0_1subchShort->StartAdress_high =
+ (*subchannelIndicator)->startAddress / 256;
+ fig0_1subchShort->StartAdress_low =
+ (*subchannelIndicator)->startAddress % 256;
+ fig0_1subchShort->Short_Long_form = 0;
+ fig0_1subchShort->TableSwitch = 0;
+ fig0_1subchShort->TableIndex =
+ protection->shortForm.tableIndex;
+
+ index = index + 3;
+ figSize += 3;
+ figtype0_1->Length += 3;
+ } else {
+ fig0_1subchLong1 =
+ (FIG_01_SubChannel_LongF*) &etiFrame[index];
+ fig0_1subchLong1->SubChId = (*subchannelIndicator)->id;
+ fig0_1subchLong1->StartAdress_high =
+ (*subchannelIndicator)->startAddress / 256;
+ fig0_1subchLong1->StartAdress_low =
+ (*subchannelIndicator)->startAddress % 256;
+ fig0_1subchLong1->Short_Long_form = 1;
+ fig0_1subchLong1->Option = protection->longForm.option;
+ fig0_1subchLong1->ProtectionLevel =
+ protection->level;
+ fig0_1subchLong1->Sub_ChannelSize_high =
+ getSizeCu(*subchannelIndicator) / 256;
+ fig0_1subchLong1->Sub_ChannelSize_low =
+ getSizeCu(*subchannelIndicator) % 256;
+
+ index = index + 4;
+ figSize += 4;
+ figtype0_1->Length += 4;
+ }
+ }
+ break;
+
+ case 2:
+ // FIG type 0/2, MCI, Service Organization, une instance de
+ // FIGtype0_2_Service par sous-canal
+ fig0_2 = NULL;
+ cur = 0;
+
+ if (serviceProgramInd == ensemble->services.end()) {
+ serviceProgramInd = ensemble->services.begin();
+ }
+ for (; serviceProgramInd != ensemble->services.end();
+ ++serviceProgramInd) {
+ if (!(*serviceProgramInd)->nbComponent(ensemble->components)) {
+ continue;
+ }
+ if ((*serviceProgramInd)->getType(ensemble) != 0) {
+ continue;
+ }
+
+ ++cur;
+
+ if (fig0_2 == NULL) {
+ fig0_2 = (FIGtype0_2 *) & etiFrame[index];
+
+ fig0_2->FIGtypeNumber = 0;
+ fig0_2->Length = 1;
+ fig0_2->CN = 0;
+ fig0_2->OE = 0;
+ fig0_2->PD = 0;
+ fig0_2->Extension = 2;
+ index = index + 2;
+ figSize += 2;
+ }
+
+ if (figSize + 3
+ + (*serviceProgramInd)->nbComponent(ensemble->components)
+ * 2 > 30) {
+ break;
+ }
+
+ fig0_2serviceAudio = (FIGtype0_2_Service*) &etiFrame[index];
+
+ fig0_2serviceAudio->SId = htons((*serviceProgramInd)->id);
+ fig0_2serviceAudio->Local_flag = 0;
+ fig0_2serviceAudio->CAId = 0;
+ fig0_2serviceAudio->NbServiceComp =
+ (*serviceProgramInd)->nbComponent(ensemble->components);
+ index += 3;
+ fig0_2->Length += 3;
+ figSize += 3;
+
+ int curCpnt = 0;
+ for (component = getComponent(ensemble->components,
+ (*serviceProgramInd)->id);
+ component != ensemble->components.end();
+ component = getComponent(ensemble->components,
+ (*serviceProgramInd)->id, component)) {
+ subchannel = getSubchannel(ensemble->subchannels,
+ (*component)->subchId);
+ if (subchannel == ensemble->subchannels.end()) {
+ etiLog.printHeader(TcpLog::ERR,
+ "Subchannel %i does not exist for component "
+ "of service %i\n",
+ (*component)->subchId, (*component)->serviceId);
+ returnCode = -1;
+ goto EXIT;
+ }
+
+ switch ((*subchannel)->type) {
+ case 0: // Audio
+ audio_description =
+ (FIGtype0_2_audio_component*)&etiFrame[index];
+ audio_description->TMid = 0;
+ audio_description->ASCTy = (*component)->type;
+ audio_description->SubChId = (*subchannel)->id;
+ audio_description->PS = ((curCpnt == 0) ? 1 : 0);
+ audio_description->CA_flag = 0;
+ break;
+ case 1: // Data
+ data_description =
+ (FIGtype0_2_data_component*)&etiFrame[index];
+ data_description->TMid = 1;
+ data_description->DSCTy = (*component)->type;
+ data_description->SubChId = (*subchannel)->id;
+ data_description->PS = ((curCpnt == 0) ? 1 : 0);
+ data_description->CA_flag = 0;
+ break;
+ case 3: // Packet
+ packet_description =
+ (FIGtype0_2_packet_component*)&etiFrame[index];
+ packet_description->TMid = 3;
+ packet_description->setSCId((*component)->packet.id);
+ packet_description->PS = ((curCpnt == 0) ? 1 : 0);
+ packet_description->CA_flag = 0;
+ break;
+ default:
+ etiLog.printHeader(TcpLog::ERR,
+ "Component type not supported\n");
+ returnCode = -1;
+ goto EXIT;
+ }
+ index += 2;
+ fig0_2->Length += 2;
+ figSize += 2;
+ if (figSize > 30) {
+ etiLog.printHeader(TcpLog::ERR,
+ "Sorry, no place left in FIG 0/2 to insert "
+ "component %i of program service %i.\n",
+ curCpnt, cur);
+ returnCode = -1;
+ goto EXIT;
+ }
+ ++curCpnt;
+ }
+ }
+ break;
+
+ case 3:
+ fig0_2 = NULL;
+ cur = 0;
+
+ if (serviceDataInd == ensemble->services.end()) {
+ serviceDataInd = ensemble->services.begin();
+ }
+ for (; serviceDataInd != ensemble->services.end();
+ ++serviceDataInd) {
+ if (!(*serviceDataInd)->nbComponent(ensemble->components)) {
+ continue;
+ }
+ unsigned char type = (*serviceDataInd)->getType(ensemble);
+ if ((type == 0) || (type == 2)) {
+ continue;
+ }
+
+ ++cur;
+
+ if (fig0_2 == NULL) {
+ fig0_2 = (FIGtype0_2 *) & etiFrame[index];
+
+ fig0_2->FIGtypeNumber = 0;
+ fig0_2->Length = 1;
+ fig0_2->CN = 0;
+ fig0_2->OE = 0;
+ fig0_2->PD = 1;
+ fig0_2->Extension = 2;
+ index = index + 2;
+ figSize += 2;
+ }
+
+ if (figSize + 5
+ + (*serviceDataInd)->nbComponent(ensemble->components)
+ * 2 > 30) {
+ break;
+ }
+
+ fig0_2serviceData =
+ (FIGtype0_2_Service_data*) &etiFrame[index];
+
+ fig0_2serviceData->SId = htonl((*serviceDataInd)->id);
+ fig0_2serviceData->Local_flag = 0;
+ fig0_2serviceData->CAId = 0;
+ fig0_2serviceData->NbServiceComp =
+ (*serviceDataInd)->nbComponent(ensemble->components);
+ fig0_2->Length += 5;
+ index += 5;
+ figSize += 5;
+
+ int curCpnt = 0;
+ for (component = getComponent(ensemble->components,
+ (*serviceDataInd)->id);
+ component != ensemble->components.end();
+ component = getComponent(ensemble->components,
+ (*serviceDataInd)->id, component)) {
+ subchannel = getSubchannel(ensemble->subchannels,
+ (*component)->subchId);
+ if (subchannel == ensemble->subchannels.end()) {
+ etiLog.printHeader(TcpLog::ERR,
+ "Subchannel %i does not exist for component "
+ "of service %i\n",
+ (*component)->subchId, (*component)->serviceId);
+ returnCode = -1;
+ goto EXIT;
+ }
+
+ switch ((*subchannel)->type) {
+ case 0: // Audio
+ audio_description =
+ (FIGtype0_2_audio_component*)&etiFrame[index];
+ audio_description->TMid = 0;
+ audio_description->ASCTy = (*component)->type;
+ audio_description->SubChId = (*subchannel)->id;
+ audio_description->PS = ((curCpnt == 0) ? 1 : 0);
+ audio_description->CA_flag = 0;
+ break;
+ case 1: // Data
+ data_description =
+ (FIGtype0_2_data_component*)&etiFrame[index];
+ data_description->TMid = 1;
+ data_description->DSCTy = (*component)->type;
+ data_description->SubChId = (*subchannel)->id;
+ data_description->PS = ((curCpnt == 0) ? 1 : 0);
+ data_description->CA_flag = 0;
+ break;
+ case 3: // Packet
+ packet_description =
+ (FIGtype0_2_packet_component*)&etiFrame[index];
+ packet_description->TMid = 3;
+ packet_description->setSCId((*component)->packet.id);
+ packet_description->PS = ((curCpnt == 0) ? 1 : 0);
+ packet_description->CA_flag = 0;
+ break;
+ default:
+ etiLog.printHeader(TcpLog::ERR,
+ "Component type not supported\n");
+ returnCode = -1;
+ goto EXIT;
+ }
+ index += 2;
+ fig0_2->Length += 2;
+ figSize += 2;
+ if (figSize > 30) {
+ etiLog.printHeader(TcpLog::ERR,
+ "Sorry, no place left in FIG 0/2 to insert "
+ "component %i of data service %i.\n",
+ curCpnt, cur);
+ returnCode = -1;
+ goto EXIT;
+ }
+ ++curCpnt;
+ }
+ }
+ break;
+
+ case 5:
+ fig0_3_header = NULL;
+
+ for (component = ensemble->components.begin();
+ component != ensemble->components.end();
+ ++component) {
+ subchannel = getSubchannel(ensemble->subchannels,
+ (*component)->subchId);
+ if (subchannel == ensemble->subchannels.end()) {
+ etiLog.printHeader(TcpLog::ERR,
+ "Subchannel %i does not exist for component "
+ "of service %i\n",
+ (*component)->subchId, (*component)->serviceId);
+ returnCode = -1;
+ goto EXIT;
+ }
+
+ if ((*subchannel)->type != 3) continue;
+
+ if (fig0_3_header == NULL) {
+ fig0_3_header = (FIGtype0_3_header*)&etiFrame[index];
+ fig0_3_header->FIGtypeNumber = 0;
+ fig0_3_header->Length = 1;
+ fig0_3_header->CN = 0;
+ fig0_3_header->OE = 0;
+ fig0_3_header->PD = 0;
+ fig0_3_header->Extension = 3;
+
+ index += 2;
+ figSize += 2;
+ }
+
+ /* Warning: When bit SCCA_flag is unset(0), the multiplexer
+ * R&S does not send the SCCA field. But, in the Factum ETI
+ * analyzer, if this field is not there, it is an error.
+ */
+ fig0_3_data = (FIGtype0_3_data*)&etiFrame[index];
+ fig0_3_data->setSCId((*component)->packet.id);
+ fig0_3_data->rfa = 0;
+ fig0_3_data->SCCA_flag = 0;
+ // if 0, datagroups are used
+ fig0_3_data->DG_flag = !(*component)->packet.datagroup;
+ fig0_3_data->rfu = 0;
+ fig0_3_data->DSCTy = (*component)->type;
+ fig0_3_data->SubChId = (*subchannel)->id;
+ fig0_3_data->setPacketAddress((*component)->packet.address);
+ if (factumAnalyzer) {
+ fig0_3_data->SCCA = 0;
+ }
+
+ fig0_3_header->Length += 5;
+ index += 5;
+ figSize += 5;
+ if (factumAnalyzer) {
+ fig0_3_header->Length += 2;
+ index += 2;
+ figSize += 2;
+ }
+
+ if (figSize > 30) {
+ etiLog.printHeader(TcpLog::ERR,
+ "can't add to Fic Fig 0/3, "
+ "too much packet service\n");
+ returnCode = -1;
+ goto EXIT;
+ }
+ }
+ break;
+
+ case 7:
+ fig0 = NULL;
+ if (servicePty == ensemble->services.end()) {
+ servicePty = ensemble->services.begin();
+ }
+ for (; servicePty != ensemble->services.end();
+ ++servicePty) {
+ if ((*servicePty)->pty == 0 && (*servicePty)->language == 0) {
+ continue;
+ }
+ if (fig0 == NULL) {
+ fig0 = (FIGtype0*)&etiFrame[index];
+ fig0->FIGtypeNumber = 0;
+ fig0->Length = 1;
+ fig0->CN = 0;
+ fig0->OE = 0;
+ fig0->PD = 0;
+ fig0->Extension = 17;
+ index += 2;
+ figSize += 2;
+ }
+
+ if ((*servicePty)->language == 0) {
+ if (figSize + 4 > 30) {
+ break;
+ }
+ } else {
+ if (figSize + 5 > 30) {
+ break;
+ }
+ }
+
+ programme =
+ (FIGtype0_17_programme*)&etiFrame[index];
+ programme->SId = htons((*servicePty)->id);
+ programme->SD = 1;
+ programme->PS = 0;
+ programme->L = (*servicePty)->language != 0;
+ programme->CC = 0;
+ programme->Rfa = 0;
+ programme->NFC = 0;
+ if ((*servicePty)->language == 0) {
+ etiFrame[index + 3] = (*servicePty)->pty;
+ fig0->Length += 4;
+ index += 4;
+ figSize += 4;
+ } else {
+ etiFrame[index + 3] = (*servicePty)->language;
+ etiFrame[index + 4] = (*servicePty)->pty;
+ fig0->Length += 5;
+ index += 5;
+ figSize += 5;
+ }
+ }
+ break;
+ }
+
+ if (figSize > 30) {
+ etiLog.printHeader(TcpLog::ERR,
+ "FIG too big (%i > 30)\n", figSize);
+ returnCode = -1;
+ goto EXIT;
+ }
+
+ memcpy(&etiFrame[index], Padding_FIB, 30 - figSize);
+ index += 30 - figSize;
+
+ CRCtmp = 0xffff;
+ CRCtmp = crc16(CRCtmp, &etiFrame[(index - 30)], 30);
+ CRCtmp ^= 0xffff;
+ etiFrame[index++] = ((char *) &CRCtmp)[1];
+ etiFrame[index++] = ((char *) &CRCtmp)[0];
+
+ figSize = 0;
+ // Insertion du FIB 1
+ switch (alterneFIB) {
+ case 0: // FIG 0/8 program
+ fig0 = NULL;
+
+ if (componentIndicatorProgram == ensemble->components.end()) {
+ componentIndicatorProgram = ensemble->components.begin();
+ }
+ for (; componentIndicatorProgram != ensemble->components.end();
+ ++componentIndicatorProgram) {
+ service = getService(*componentIndicatorProgram,
+ ensemble->services);
+ subchannel = getSubchannel(ensemble->subchannels,
+ (*componentIndicatorProgram)->subchId);
+ if (subchannel == ensemble->subchannels.end()) {
+ etiLog.printHeader(TcpLog::ERR,
+ "Subchannel %i does not exist for component "
+ "of service %i\n",
+ (*componentIndicatorProgram)->subchId,
+ (*componentIndicatorProgram)->serviceId);
+ returnCode = -1;
+ goto EXIT;
+ }
+
+ if (!(*service)->program) continue;
+
+ if (fig0 == NULL) {
+ fig0 = (FIGtype0*)&etiFrame[index];
+ fig0->FIGtypeNumber = 0;
+ fig0->Length = 1;
+ fig0->CN = 0;
+ fig0->OE = 0;
+ fig0->PD = 0;
+ fig0->Extension = 8;
+ index += 2;
+ figSize += 2;
+ }
+
+ if ((*subchannel)->type == 3) { // Data packet
+ if (figSize > 30 - 5) {
+ break;
+ }
+ *((uint16_t*)&etiFrame[index]) =
+ htons((*componentIndicatorProgram)->serviceId);
+ fig0->Length += 2;
+ index += 2;
+ figSize += 2;
+
+ FIGtype0_8_long* definition =
+ (FIGtype0_8_long*)&etiFrame[index];
+ memset(definition, 0, 3);
+ definition->ext = 0; // no rfa
+ definition->SCIdS = (*componentIndicatorProgram)->SCIdS;
+ definition->LS = 1;
+ definition->setSCId((*componentIndicatorProgram)->packet.id);
+ fig0->Length += 3;
+ index += 3; // 8 minus rfa
+ figSize += 3;
+ } else { // Audio, data stream or FIDC
+ if (figSize > 30 - 4) {
+ break;
+ }
+ *((uint16_t*)&etiFrame[index]) =
+ htons((*componentIndicatorProgram)->serviceId);
+ fig0->Length += 2;
+ index += 2;
+ figSize += 2;
+
+ FIGtype0_8_short* definition =
+ (FIGtype0_8_short*)&etiFrame[index];
+ memset(definition, 0, 2);
+ definition->ext = 0; // no rfa
+ definition->SCIdS = (*componentIndicatorProgram)->SCIdS;
+ definition->LS = 0;
+ definition->MscFic = 0;
+ definition->Id = (*componentIndicatorProgram)->subchId;
+ fig0->Length += 2;
+ index += 2; // 4 minus rfa
+ figSize += 2;
+ }
+ }
+ break;
+
+ case 1: // FIG 0/8 data
+ fig0 = NULL;
+
+ if (componentIndicatorData == ensemble->components.end()) {
+ componentIndicatorData = ensemble->components.begin();
+ }
+ for (; componentIndicatorData != ensemble->components.end();
+ ++componentIndicatorData) {
+ service = getService(*componentIndicatorData,
+ ensemble->services);
+ subchannel = getSubchannel(ensemble->subchannels,
+ (*componentIndicatorData)->subchId);
+ if (subchannel == ensemble->subchannels.end()) {
+ etiLog.printHeader(TcpLog::ERR,
+ "Subchannel %i does not exist for component "
+ "of service %i\n",
+ (*componentIndicatorData)->subchId,
+ (*componentIndicatorData)->serviceId);
+ returnCode = -1;
+ goto EXIT;
+ }
+
+ if ((*service)->program) continue;
+
+ if (fig0 == NULL) {
+ fig0 = (FIGtype0*)&etiFrame[index];
+ fig0->FIGtypeNumber = 0;
+ fig0->Length = 1;
+ fig0->CN = 0;
+ fig0->OE = 0;
+ fig0->PD = 1;
+ fig0->Extension = 8;
+ index += 2;
+ figSize += 2;
+ }
+
+ if ((*subchannel)->type == 3) { // Data packet
+ if (figSize > 30 - 7) {
+ break;
+ }
+ *((uint32_t*)&etiFrame[index]) =
+ htonl((*componentIndicatorData)->serviceId);
+ fig0->Length += 4;
+ index += 4;
+ figSize += 4;
+
+ FIGtype0_8_long* definition =
+ (FIGtype0_8_long*)&etiFrame[index];
+ memset(definition, 0, 3);
+ definition->ext = 0; // no rfa
+ definition->SCIdS = (*componentIndicatorData)->SCIdS;
+ definition->LS = 1;
+ definition->setSCId((*componentIndicatorData)->packet.id);
+ fig0->Length += 3;
+ index += 3; // 8 minus rfa
+ figSize += 3;
+ } else { // Audio, data stream or FIDC
+ if (figSize > 30 - 6) {
+ break;
+ }
+ *((uint32_t*)&etiFrame[index]) =
+ htonl((*componentIndicatorData)->serviceId);
+ fig0->Length += 4;
+ index += 4;
+ figSize += 4;
+
+ FIGtype0_8_short* definition =
+ (FIGtype0_8_short*)&etiFrame[index];
+ memset(definition, 0, 2);
+ definition->ext = 0; // no rfa
+ definition->SCIdS = (*componentIndicatorData)->SCIdS;
+ definition->LS = 0;
+ definition->MscFic = 0;
+ definition->Id = (*componentIndicatorData)->subchId;
+ fig0->Length += 2;
+ index += 2; // 4 minus rfa
+ figSize += 2;
+ }
+ }
+ break;
+
+ case 3:
+ // FIG type 1/0, Service Information (SI), Ensemble Label
+ fig1_0 = (FIGtype1_0 *) & etiFrame[index];
+
+ fig1_0->Length = 21;
+ fig1_0->FIGtypeNumber = 1;
+ fig1_0->Extension = 0;
+ fig1_0->OE = 0;
+ fig1_0->Charset = 0;
+ fig1_0->EId = htons(ensemble->id);
+ index = index + 4;
+
+ memcpy(&etiFrame[index], ensemble->label.text, 16);
+ index = index + 16;
+
+ etiFrame[index++] = ((char *) &ensemble->label.flag)[1];
+ etiFrame[index++] = ((char *) &ensemble->label.flag)[0];
+
+ figSize += 22;
+ break;
+ case 5:
+ // FIG 0 / 13
+ fig0 = NULL;
+
+ for (component = ensemble->components.begin();
+ component != ensemble->components.end();
+ ++component) {
+ subchannel = getSubchannel(ensemble->subchannels,
+ (*component)->subchId);
+ if (subchannel == ensemble->subchannels.end()) {
+ etiLog.printHeader(TcpLog::ERR,
+ "Subchannel %i does not exist for component "
+ "of service %i\n",
+ (*component)->subchId, (*component)->serviceId);
+ returnCode = -1;
+ goto EXIT;
+ }
+
+ if ((*subchannel)->type != 3) continue;
+
+ if ((*component)->packet.appType != 0xffff) {
+ if (fig0 == NULL) {
+ fig0 = (FIGtype0*)&etiFrame[index];
+ fig0->FIGtypeNumber = 0;
+ fig0->Length = 1;
+ fig0->CN = 0;
+ fig0->OE = 0;
+ fig0->PD = 1;
+ fig0->Extension = 13;
+ index += 2;
+ figSize += 2;
+ }
+
+ FIG0_13_longAppInfo* info =
+ (FIG0_13_longAppInfo*)&etiFrame[index];
+ info->SId = htonl((*component)->serviceId);
+ info->SCIdS = (*component)->SCIdS;
+ info->No = 1;
+ index += 5;
+ figSize += 5;
+ fig0->Length += 5;
+
+ FIG0_13_app* app = (FIG0_13_app*)&etiFrame[index];
+ app->setType((*component)->packet.appType);
+ app->length = 0;
+ index += 2;
+ figSize += 2;
+ fig0->Length += 2;
+
+ if (figSize > 30) {
+ etiLog.printHeader(TcpLog::ERR,
+ "can't add to Fic Fig 0/13, "
+ "too much packet service\n");
+ returnCode = -1;
+ goto EXIT;
+ }
+ }
+ }
+ break;
+ case 7:
+ //Time and country identifier
+ fig0_10 = (FIGtype0_10 *) & etiFrame[index];
+
+ fig0_10->FIGtypeNumber = 0;
+ fig0_10->Length = 5;
+ fig0_10->CN = 0;
+ fig0_10->OE = 0;
+ fig0_10->PD = 0;
+ fig0_10->Extension = 10;
+ index = index + 2;
+
+ timeData = localtime(&date);
+
+ fig0_10->RFU = 0;
+ fig0_10->setMJD(gregorian2mjd(timeData->tm_year + 1900,
+ timeData->tm_mon + 1,
+ timeData->tm_mday));
+ fig0_10->LSI = 0;
+ fig0_10->ConfInd = (watermarkData[watermarkPos >> 3] >>
+ (7 - (watermarkPos & 0x07))) & 1;
+ if (++watermarkPos == watermarkSize) {
+ watermarkPos = 0;
+ }
+ fig0_10->UTC = 0;
+ fig0_10->setHours(timeData->tm_hour);
+ fig0_10->Minutes = timeData->tm_min;
+ index = index + 4;
+ figSize += 6;
+
+ fig0_9 = (FIGtype0_9*)&etiFrame[index];
+ fig0_9->FIGtypeNumber = 0;
+ fig0_9->Length = 4;
+ fig0_9->CN = 0;
+ fig0_9->OE = 0;
+ fig0_9->PD = 0;
+ fig0_9->Extension = 9;
+
+ fig0_9->ext = 0;
+ fig0_9->lto = 0;
+ fig0_9->ensembleLto = 0;
+ fig0_9->ensembleEcc = ensemble->ecc;
+ fig0_9->tableId = 0x2;
+ index += 5;
+ figSize += 5;
+
+ break;
+ }
+
+ memcpy(&etiFrame[index], Padding_FIB, 30 - figSize);
+ index += 30 - figSize;
+
+ CRCtmp = 0xffff;
+ CRCtmp = crc16(CRCtmp, &etiFrame[(index - 30)], 30);
+ CRCtmp ^= 0xffff;
+ etiFrame[index++] = ((char *) &CRCtmp)[1];
+ etiFrame[index++] = ((char *) &CRCtmp)[0];
+
+
+ figSize = 0;
+ // Insertion FIB 2
+ if (alterneFIB < ensemble->services.size()) {
+ service = ensemble->services.begin() + alterneFIB;
+
+ // FIG type 1/1, SI, Service label, une instance par sous-canal
+ if ((*service)->getType(ensemble) == 0) {
+ fig1_1 = (FIGtype1_1 *) & etiFrame[index];
+
+ fig1_1->FIGtypeNumber = 1;
+ fig1_1->Length = 21;
+ fig1_1->Charset = 0;
+ fig1_1->OE = 0;
+ fig1_1->Extension = 1;
+
+ fig1_1->Sld = htons((*service)->id);
+ index += 4;
+ figSize += 4;
+ } else {
+ fig1_5 = (FIGtype1_5 *) & etiFrame[index];
+ fig1_5->FIGtypeNumber = 1;
+ fig1_5->Length = 23;
+ fig1_5->Charset = 0;
+ fig1_5->OE = 0;
+ fig1_5->Extension = 5;
+
+ fig1_5->SId = htonl((*service)->id);
+ index += 6;
+ figSize += 6;
+ }
+ memcpy(&etiFrame[index], (*service)->label.text, 16);
+ index += 16;
+ figSize += 16;
+
+ etiFrame[index++] = ((char *) &(*service)->label.flag)[1];
+ etiFrame[index++] = ((char *) &(*service)->label.flag)[0];
+ figSize += 2;
+ } else if (alterneFIB <
+ ensemble->services.size() + ensemble->components.size()) {
+ component = ensemble->components.begin() +
+ (alterneFIB - ensemble->services.size());
+ service = getService(*component, ensemble->services);
+ subchannel =
+ getSubchannel(ensemble->subchannels, (*component)->subchId);
+
+ if ((*component)->label.text[0] != 0) {
+ if ((*service)->getType(ensemble) == 0) { // Programme
+ FIGtype1_4_programme *fig1_4;
+ fig1_4 = (FIGtype1_4_programme*)&etiFrame[index];
+
+ fig1_4->FIGtypeNumber = 1;
+ fig1_4->Length = 22;
+ fig1_4->Charset = 0;
+ fig1_4->OE = 0;
+ fig1_4->Extension = 4;
+ fig1_4->PD = 0;
+ fig1_4->rfa = 0;
+ fig1_4->SCIdS = (*component)->SCIdS;
+
+ fig1_4->SId = htons((*service)->id);
+ index += 5;
+ figSize += 5;
+ } else { // Data
+ FIGtype1_4_data *fig1_4;
+ fig1_4 = (FIGtype1_4_data *) & etiFrame[index];
+ fig1_4->FIGtypeNumber = 1;
+ fig1_4->Length = 24;
+ fig1_4->Charset = 0;
+ fig1_4->OE = 0;
+ fig1_4->Extension = 4;
+ fig1_4->PD = 1;
+ fig1_4->rfa = 0;
+ fig1_4->SCIdS = (*component)->SCIdS;
+
+ fig1_4->SId = htonl((*service)->id);
+ index += 7;
+ figSize += 7;
+ }
+ memcpy(&etiFrame[index], (*component)->label.text, 16);
+ index += 16;
+ figSize += 16;
+
+ etiFrame[index++] = ((char *) &(*component)->label.flag)[1];
+ etiFrame[index++] = ((char *) &(*component)->label.flag)[0];
+ figSize += 2;
+ }
+ }
+ memcpy(&etiFrame[index], Padding_FIB, 30 - figSize);
+ index += 30 - figSize;
+
+ CRCtmp = 0xffff;
+ CRCtmp = crc16(CRCtmp, &etiFrame[(index - 30)], 30);
+ CRCtmp ^= 0xffff;
+ etiFrame[index++] = ((char *) &CRCtmp)[1];
+ etiFrame[index++] = ((char *) &CRCtmp)[0];
+
+ if (ensemble->mode == 3) {
+ memcpy(&etiFrame[index], Padding_FIB, 30);
+ index += 30;
+
+ CRCtmp = 0xffff;
+ CRCtmp = crc16(CRCtmp, &etiFrame[(index - 30)], 30);
+ CRCtmp ^= 0xffff;
+ etiFrame[index++] = ((char *) &CRCtmp)[1];
+ etiFrame[index++] = ((char *) &CRCtmp)[0];
+ }
+
+ if (ensemble->services.size() > 30) {
+ etiLog.printHeader(TcpLog::ERR,
+ "Sorry, but this software currently can't write "
+ "Service Label of more than 30 services.\n");
+ returnCode = -1;
+ goto EXIT;
+ }
+
+ // compteur pour FIG 0/0
+ insertFIG = (insertFIG + 1) % 8;
+
+ // compteur pour inserer FIB a toutes les 30 trames
+ alterneFIB = (alterneFIB + 1) % 30;
+
+ /**********************************************************************
+ ****** Section de lecture de donnees *******************************
+ **********************************************************************/
+
+ //Lecture des donnees dans les fichiers d'entree
+ for (subchannel = ensemble->subchannels.begin();
+ subchannel != ensemble->subchannels.end();
+ ++subchannel) {
+ int sizeSubchannel = getSizeByte(*subchannel);
+ if ((*subchannel)->operations.lock != NULL) {
+ (*subchannel)->operations.lock((*subchannel)->data);
+ }
+ result = (*subchannel)->operations.readFrame(
+ &(*subchannel)->operations,
+ (*subchannel)->data, &etiFrame[index], sizeSubchannel);
+ if ((*subchannel)->operations.unlock != NULL) {
+ (*subchannel)->operations.unlock((*subchannel)->data);
+ }
+ if (result < 0) {
+ etiLog.print(TcpLog::INFO, "ETI frame number: %i\n", currentFrame);
+ }
+ index += sizeSubchannel;
+ }
+
+
+ index = (3 + fc->NST + FICL) * 4;
+ for (subchannel = ensemble->subchannels.begin();
+ subchannel != ensemble->subchannels.end();
+ ++subchannel) {
+ index += getSizeByte(*subchannel);
+ }
+
+ /******* Section EOF **************************************************/
+ // End of Frame, 4 octets
+ index = (FLtmp + 1 + 1) * 4;
+ eti_EOF *eof = (eti_EOF *) & etiFrame[index];
+
+ //CRC sur le Main Stream data (MST), sur 16 bits
+ index = ((fc->NST) + 2 + 1) * 4; //position du MST
+ MSTsize = ((FLtmp) - 1 - (fc->NST)) * 4; //nb d'octets de donnees
+
+ CRCtmp = 0xffff;
+ CRCtmp = crc16(CRCtmp, &etiFrame[index], MSTsize);
+ CRCtmp ^= 0xffff;
+ eof->CRC = htons(CRCtmp);
+
+ //RFU, Reserved for future use, 2 bytes, should be 0xFFFF
+ eof->RFU = htons(0xFFFF);
+
+ /******* Section TIST *************************************************/
+ // TimeStamps, 24 bits + 1 octet
+ index = (FLtmp + 2 + 1) * 4;
+ eti_TIST *tist = (eti_TIST *) & etiFrame[index];
+
+ tist->TIST = htonl(timestamp) | 0xff;
+ if (timestamp != 0xffffff) {
+ timestamp += 3 << 17;
+ if (timestamp > 0xf9ffff) {
+ timestamp -= 0xfa0000;
+ }
+ }
+
+ /**********************************************************************
+ *********** Section FRPD *****************************************
+ **********************************************************************/
+
+ //Donne le nombre total d'octets utils dans la trame
+ index = (FLtmp + 1 + 1 + 1 + 1) * 4;
+
+ for (output = outputs.begin() ; output != outputs.end(); ++output) {
+ if ((*output)->operations.write((*output)->data, etiFrame, index)
+ == -1) {
+ etiLog.print(TcpLog::ERR, "Can't write to output %s://%s\n",
+ (*output)->outputProto, (*output)->outputName);
+ }
+ }
+
+#ifdef DUMP_BRIDGE
+ dumpBytes(dumpData, sizeSubChannel, stderr);
+#endif // DUMP_BRIDGE
+
+ if (currentFrame % 100 == 0) {
+ etiLog.print(TcpLog::INFO, "ETI frame number %i \n", currentFrame);
+ }
+ }
+
+EXIT:
+ etiLog.print(TcpLog::DBG, "exiting...\n");
+ //fermeture des fichiers
+ for (subchannel = ensemble->subchannels.begin();
+ subchannel != ensemble->subchannels.end();
+ ++subchannel) {
+ (*subchannel)->operations.close((*subchannel)->data);
+ (*subchannel)->operations.clean(&(*subchannel)->data);
+ }
+ for (output = outputs.begin() ; output != outputs.end(); ++output) {
+ (*output)->operations.close((*output)->data);
+ (*output)->operations.clean(&(*output)->data);
+ }
+
+ for_each(ensemble->components.begin(), ensemble->components.end(), free);
+ for_each(ensemble->services.begin(), ensemble->services.end(), free);
+ for_each(ensemble->subchannels.begin(), ensemble->subchannels.end(), free);
+ for_each(outputs.begin(), outputs.end(), free);
+ ensemble->components.clear();
+ ensemble->services.clear();
+ ensemble->subchannels.clear();
+ free(ensemble);
+ outputs.clear();
+
+ UdpSocket::clean();
+
+ if (returnCode < 0) {
+ etiLog.print(TcpLog::EMERG, "...aborting\n");
+ } else {
+ etiLog.print(TcpLog::DBG, "...done\n");
+ }
+
+ return returnCode;
+}
diff --git a/src/Dmb.cpp b/src/Dmb.cpp
new file mode 100644
index 0000000..95742d0
--- /dev/null
+++ b/src/Dmb.cpp
@@ -0,0 +1,280 @@
+/*
+ Copyright (C) 2005, 2006, 2007, 2008, 2009 Her Majesty the Queen in Right
+ of Canada (Communications Research Center Canada)
+ */
+/*
+ This file is part of CRC-DabMux.
+
+ CRC-DabMux is free software: you can 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.
+
+ CRC-DabMux is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with CRC-DabMux. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "Dmb.h"
+
+#include <string.h>
+
+
+#ifdef _WIN32
+# define bzero(a, b) memset((a), 0, (b))
+#endif // _WIN32
+
+
+DmbStats::DmbStats()
+{
+ reset();
+}
+
+
+void DmbStats::reset()
+{
+ memset(this, 0, sizeof(*this));
+}
+
+
+Dmb::Dmb(bool reverse) :
+interleaver(12, 17),
+encoder(204, 188)
+{
+ buffer = NULL;
+ bufferSize = 0;
+ setReverse(reverse);
+}
+
+
+Dmb::~Dmb()
+{
+ if (buffer != NULL) {
+ delete[] buffer;
+ }
+}
+
+
+void Dmb::setReverse(bool state)
+{
+ reverse = state;
+ reset();
+
+ interleaver.setReverse(state);
+ encoder.setReverse(state);
+ stats.reset();
+}
+
+
+void Dmb::reset()
+{
+ bufferOffset = 0;
+ bufferLength = 0;
+ inputOffset = 0;
+ outputOffset = 0;
+// padding = 0;
+}
+
+
+#include <stdio.h>
+int Dmb::encode(
+ void* dataIn,
+ unsigned long sizeIn,
+ void* dataOut,
+ unsigned long sizeOut
+ )
+{
+ int ret = 0;
+ char* input = reinterpret_cast<char*>(dataIn);
+ char* output = reinterpret_cast<char*>(dataOut);
+
+ if (bufferSize < sizeIn + 204) {
+ if (buffer != NULL) {
+ delete[] buffer;
+ }
+ unsigned char* oldBuffer = buffer;
+ bufferSize = sizeIn + 204;
+ buffer = new unsigned char[bufferSize];
+ memcpy(buffer, oldBuffer, bufferLength);
+ }
+
+ if (reverse) {
+// fprintf(stderr, "*** Decode ***\n");
+// fprintf(stderr, " sizeIn: %i\n", sizeIn);
+// fprintf(stderr, " inputOffset: %i\n", inputOffset);
+// fprintf(stderr, " bufferLength: %i\n", bufferLength);
+// fprintf(stderr, " bufferOffset: %i\n", bufferOffset);
+// fprintf(stderr, " outputOffset: %i\n", outputOffset);
+
+ if (inputOffset == 0) {
+ ++stats.dmbFrame;
+ stats.rcvBytes += sizeIn;
+ }
+
+ memcpy(&buffer[bufferLength], &input[inputOffset],
+ sizeIn - inputOffset);
+ interleaver.encode(&buffer[bufferLength], sizeIn - inputOffset);
+ bufferLength += sizeIn - inputOffset;
+ inputOffset += sizeIn - inputOffset;
+ while (bufferLength - bufferOffset >= 204) {
+ if (buffer[bufferOffset] != 0x47) {
+ int offset = sync(&buffer[bufferOffset],
+ bufferLength - bufferOffset);
+ if (offset == 0) {
+ bufferLength = 0;
+ bufferOffset = 0;
+ } else {
+ bufferOffset += offset;
+ }
+ } else {
+ if (outputOffset + 188 <= sizeOut) { // If enough place
+ int error = encoder.encode(&buffer[bufferOffset], 204);
+ if (error != -1) {
+// if (true) {
+ if (error > 0) {
+ stats.corBytes += error;
+ }
+ memcpy(&output[outputOffset], &buffer[bufferOffset],
+ 188);
+ if (((buffer[bufferOffset + 1] & 0x1f) == 0x1f) &&
+ (buffer[bufferOffset + 2] == 0xff)) {
+ stats.nulBytes += 188;
+ } else {
+ ret += 188;
+ stats.sndBytes += 188;
+ outputOffset += 188;
+ }
+ bufferOffset += 204;
+ ++stats.mpgFrame;
+ } else {
+// interleaver.reset();
+// padding = 0;
+// bufferLength = 0;
+// inputOffset = 0;
+// stats.errBytes += 188;
+ bufferOffset += 12;
+ stats.errBytes += 12;
+ ++stats.synFrame;
+ int offset = sync (&buffer[bufferOffset],
+ bufferLength - bufferOffset);
+ if (offset == 0) {
+ stats.errBytes += bufferLength - bufferOffset;
+ bufferOffset = 0;
+ bufferLength = 0;
+ } else {
+ stats.errBytes += offset;
+ bufferOffset += offset;
+ }
+ }
+ } else {
+ outputOffset = 0;
+ goto ENCODE_END;
+ }
+ }
+ }
+ memmove(buffer, &buffer[bufferOffset], bufferLength - bufferOffset);
+ bufferLength -= bufferOffset;
+ bufferOffset = 0;
+ if (ret == 0) {
+ inputOffset = 0;
+ } else {
+ outputOffset = 0;
+ }
+// fprintf(stderr, " ret: %i\n\n", ret);
+ } else {
+ if (sizeIn == 0) {
+ bzero(&output[outputOffset], sizeOut - outputOffset);
+ interleaver.encode(&output[outputOffset], sizeOut - outputOffset);
+ outputOffset = 0;
+ ++stats.dmbFrame;
+ stats.sndBytes += sizeOut;
+ goto ENCODE_END;
+ }
+
+ if (bufferLength == 204) { // If buffer is not empty
+ // If there's more data in buffer than place in output
+ if (204 - bufferOffset > sizeOut - outputOffset) {
+ memcpy(&output[outputOffset], &buffer[bufferOffset],
+ sizeOut - outputOffset);
+ bufferOffset += sizeOut - outputOffset;
+ outputOffset = 0;
+ ++stats.dmbFrame;
+ stats.sndBytes += sizeOut;
+ goto ENCODE_END;
+ }
+ memcpy(&output[outputOffset], &buffer[bufferOffset],
+ 204 - bufferOffset);
+ outputOffset += 204 - bufferOffset;
+ bufferOffset = 0;
+ bufferLength = 0;
+ }
+
+ while (true) {
+ // If there's not enought input data
+ if (sizeIn - inputOffset < 188 - bufferLength) {
+ memcpy(&buffer[bufferLength], &input[inputOffset],
+ sizeIn - inputOffset);
+ bufferLength += sizeIn - inputOffset;
+ ret = outputOffset;
+ inputOffset = 0;
+ goto ENCODE_END;
+ }
+ if (buffer[bufferLength] == 0x47) {
+ ++stats.mpgFrame;
+ }
+// fprintf(stderr, "++mpg: %i, sizeIn: %i, inputOffset: %i\n",
+// stats.mpgFrame, sizeIn, inputOffset);
+ stats.rcvBytes += 188;
+
+ memcpy(&buffer[bufferLength], &input[inputOffset],
+ 188 - bufferLength);
+ inputOffset += 188 - bufferLength;
+
+ encoder.encode(buffer, 188);
+ interleaver.encode(buffer, 204);
+ bufferLength = 204;
+
+ if (sizeOut - outputOffset < 204) {
+ memcpy(&output[outputOffset], buffer, sizeOut - outputOffset);
+ bufferOffset += sizeOut - outputOffset;
+ outputOffset = 0;
+ ++stats.dmbFrame;
+ stats.sndBytes += sizeOut;
+ goto ENCODE_END;
+ }
+ memcpy(&output[outputOffset], buffer, 204);
+ outputOffset += 204;
+ bufferLength = 0;
+ }
+ }
+
+ENCODE_END:
+ return ret;
+}
+
+
+int Dmb::sync(void* dataIn, unsigned long sizeIn)
+{
+ char* input = reinterpret_cast<char*>(dataIn);
+ char* sync = input;
+ unsigned long size = sizeIn;
+
+ while (sync != NULL) {
+ sync = (char*)memchr(sync, 0x47, size);
+ if (sync != NULL) {
+ int offset = sync - input;
+ if (offset % 12 != 0) {
+ offset = ((offset / 12) * 12) + 12;
+ sync = &input[offset];
+ size = sizeIn - offset;
+ } else {
+ return offset;
+ }
+ }
+ }
+ return 0;
+}
diff --git a/src/Dmb.h b/src/Dmb.h
new file mode 100644
index 0000000..13ce340
--- /dev/null
+++ b/src/Dmb.h
@@ -0,0 +1,81 @@
+/*
+ Copyright (C) 2005, 2006, 2007, 2008, 2009 Her Majesty the Queen in Right
+ of Canada (Communications Research Center Canada)
+ */
+/*
+ This file is part of CRC-DabMux.
+
+ CRC-DabMux is free software: you can 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.
+
+ CRC-DabMux is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with CRC-DabMux. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef _DMB
+#define _DMB
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#include "Interleaver.h"
+#include "ReedSolomon.h"
+
+
+class DmbStats
+{
+public:
+ DmbStats();
+ void reset();
+
+ unsigned dmbFrame;
+ unsigned mpgFrame;
+ unsigned synFrame;
+ unsigned rcvBytes;
+ unsigned nulBytes;
+ unsigned sndBytes;
+ unsigned errBytes;
+ unsigned corBytes;
+};
+
+
+class Dmb
+{
+public:
+ Dmb(bool reverse = false);
+ Dmb(const Dmb& clone);
+ virtual ~Dmb();
+
+ void setReverse(bool state);
+ int encode(void* dataIn, unsigned long sizeIn, void* dataOut, unsigned long sizeOut);
+ void reset();
+ DmbStats getStats() { return stats; };
+
+private:
+ int sync(void* dataIn, unsigned long sizeIn);
+
+ Interleaver interleaver;
+ ReedSolomon encoder;
+ unsigned char* buffer;
+ unsigned bufferSize;
+ unsigned bufferOffset; // Encoded data written to output
+ unsigned bufferLength; // Encoded data
+ unsigned inputOffset;
+ unsigned outputOffset;
+// unsigned padding; // Padding data written
+
+ bool reverse;
+
+ DmbStats stats;
+};
+
+
+#endif // _DMB
diff --git a/src/Eti.cpp b/src/Eti.cpp
new file mode 100644
index 0000000..3dd11e2
--- /dev/null
+++ b/src/Eti.cpp
@@ -0,0 +1,70 @@
+/*
+ Copyright (C) 2005, 2006, 2007, 2008, 2009 Her Majesty the Queen in Right
+ of Canada (Communications Research Center Canada)
+ */
+/*
+ This file is part of CRC-DabMux.
+
+ CRC-DabMux is free software: you can 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.
+
+ CRC-DabMux is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with CRC-DabMux. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifdef _WIN32
+# pragma warning ( disable : 4103 )
+# include "Eti.h"
+# pragma warning ( default : 4103 )
+#else
+# include "Eti.h"
+#endif
+
+
+//definitions des structures des champs du ETI(NI, G703)
+
+
+unsigned short eti_FC::getFrameLength()
+{
+ return (unsigned short)((FL_high << 8) | FL_low);
+}
+
+
+void eti_FC::setFrameLength(uint16_t length)
+{
+ FL_high = (length >> 8) & 0x07;
+ FL_low = length & 0xff;
+}
+
+
+void eti_STC::setSTL(uint16_t length)
+{
+ STL_high = length >> 8;
+ STL_low = length & 0xff;
+}
+
+
+uint16_t eti_STC::getSTL()
+{
+ return (uint16_t)((STL_high << 8) + STL_low);
+}
+
+
+void eti_STC::setStartAddress(uint16_t address)
+{
+ startAddress_high = address >> 8;
+ startAddress_low = address & 0xff;
+}
+
+
+uint16_t eti_STC::getStartAddress()
+{
+ return (uint16_t)((startAddress_high << 8) + startAddress_low);
+}
diff --git a/src/Eti.h b/src/Eti.h
new file mode 100644
index 0000000..5580aaf
--- /dev/null
+++ b/src/Eti.h
@@ -0,0 +1,96 @@
+/*
+ Copyright (C) 2005, 2006, 2007, 2008, 2009 Her Majesty the Queen in Right
+ of Canada (Communications Research Center Canada)
+ */
+/*
+ This file is part of CRC-DabMux.
+
+ CRC-DabMux is free software: you can 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.
+
+ CRC-DabMux is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with CRC-DabMux. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef ETI_
+#define ETI_
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#ifdef _WIN32
+# include <winsock2.h> // For types...
+typedef WORD uint16_t;
+typedef DWORD32 uint32_t;
+
+# define PACKED
+# pragma pack(push, 1)
+#else
+# include <stdint.h>
+
+# define PACKED __attribute__ ((packed))
+#endif
+
+
+//definitions des structures des champs du ETI(NI, G703)
+
+
+struct eti_SYNC {
+ uint32_t ERR:8;
+ uint32_t FSYNC:24;
+} PACKED;
+
+
+struct eti_FC {
+ uint32_t FCT:8;
+ uint32_t NST:7;
+ uint32_t FICF:1;
+ uint32_t FL_high:3;
+ uint32_t MID:2;
+ uint32_t FP:3;
+ uint32_t FL_low:8;
+ uint16_t getFrameLength();
+ void setFrameLength(uint16_t length);
+} PACKED;
+
+
+struct eti_STC {
+ uint32_t startAddress_high:2;
+ uint32_t SCID:6;
+ uint32_t startAddress_low:8;
+ uint32_t STL_high:2;
+ uint32_t TPL:6;
+ uint32_t STL_low:8;
+ void setSTL(uint16_t length);
+ uint16_t getSTL();
+ void setStartAddress(uint16_t address);
+ uint16_t getStartAddress();
+} PACKED;
+
+
+struct eti_EOH {
+ uint16_t MNSC;
+ uint16_t CRC;
+} PACKED;
+
+
+struct eti_EOF {
+ uint16_t CRC;
+ uint16_t RFU;
+} PACKED;
+
+
+struct eti_TIST {
+ uint32_t TIST;
+} PACKED;
+
+
+#endif // ETI_
diff --git a/src/InetAddress.cpp b/src/InetAddress.cpp
new file mode 100644
index 0000000..8915285
--- /dev/null
+++ b/src/InetAddress.cpp
@@ -0,0 +1,259 @@
+/*
+ Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 Her Majesty the
+ Queen in Right of Canada (Communications Research Center Canada)
+ */
+/*
+ This file is part of CRC-DabMux.
+
+ CRC-DabMux is free software: you can 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.
+
+ CRC-DabMux is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with CRC-DabMux. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "InetAddress.h"
+#include <iostream>
+#include <stdio.h>
+
+#ifdef _WIN32
+#else
+# include <errno.h>
+# include <string.h>
+#endif
+
+#ifdef TRACE_ON
+# ifndef TRACE_CLASS
+# define TRACE_CLASS(clas, func) cout <<"-" <<(clas) <<"\t(" <<this <<")::" <<(func) <<endl
+# define TRACE_STATIC(clas, func) cout <<"-" <<(clas) <<"\t(static)::" <<(func) <<endl
+# endif
+#else
+# ifndef TRACE_CLASS
+# define TRACE_CLASS(clas, func)
+# define TRACE_STATIC(clas, func)
+# endif
+#endif
+
+
+int inetErrNo = 0;
+const char *inetErrMsg = NULL;
+const char *inetErrDesc = NULL;
+
+
+/**
+ * Constructs an IP address.
+ * @param port The port of this address
+ * @param name The name of this address
+ */
+InetAddress::InetAddress(int port, const char* name) {
+ TRACE_CLASS("InetAddress", "InetAddress(int, char)");
+ addr.sin_family = PF_INET;
+ addr.sin_addr.s_addr = htons(INADDR_ANY);
+ addr.sin_port = htons(port);
+ if (name)
+ setAddress(name);
+}
+
+
+/**
+ * Constructs a copy of inet
+ * @param inet The address to be copied
+ */
+InetAddress::InetAddress(const InetAddress &inet) {
+ TRACE_CLASS("InetAddress", "InetAddress(InetAddress)");
+ memcpy(&addr, &inet.addr, sizeof(addr));
+}
+
+
+/// Destructor
+InetAddress::~InetAddress() {
+ TRACE_CLASS("InetAddress" ,"~InetAddress()");
+}
+
+
+/// Returns the raw IP address of this InetAddress object.
+sockaddr *InetAddress::getAddress() {
+ TRACE_CLASS("InetAddress", "getAddress()");
+ return (sockaddr *)&addr;
+}
+
+
+/// Return the port of this address.
+int InetAddress::getPort()
+{
+ TRACE_CLASS("InetAddress", "getPort()");
+ return ntohs(addr.sin_port);
+}
+
+
+/**
+ * Returns the IP address string "%d.%d.%d.%d".
+ * @return IP address
+ */
+const char *InetAddress::getHostAddress() {
+ TRACE_CLASS("InetAddress", "getHostAddress()");
+ return inet_ntoa(addr.sin_addr);
+}
+
+
+/// Returns true if this address is multicast
+bool InetAddress::isMulticastAddress() {
+ TRACE_CLASS("InetAddress", "isMulticastAddress()");
+ return IN_MULTICAST(ntohl(addr.sin_addr.s_addr)); // a modifier
+}
+
+
+/**
+ * Set the port number
+ * @param port The new port number
+ */
+void InetAddress::setPort(int port)
+{
+ TRACE_CLASS("InetAddress", "setPort(int)");
+ addr.sin_port = htons(port);
+}
+
+
+/**
+ * Set the address
+ * @param name The new address name
+ * @return 0 if ok
+ * -1 if error
+ */
+int InetAddress::setAddress(const char *name)
+{
+ TRACE_CLASS("InetAddress", "setAddress(char*)");
+ if (name) {
+ if (atoi(name)) { // If it start with a number
+ if ((addr.sin_addr.s_addr = inet_addr(name)) == INADDR_NONE) {
+ addr.sin_addr.s_addr = htons(INADDR_ANY);
+ inetErrNo = 0;
+ inetErrMsg = "Invalid address";
+ inetErrDesc = name;
+ return -1;
+ }
+ } else { // Assume it's a real name
+ hostent *host = gethostbyname(name);
+ if (host) {
+ addr.sin_addr = *(in_addr *)(host->h_addr);
+ } else {
+ addr.sin_addr.s_addr = htons(INADDR_ANY);
+ inetErrNo = 0;
+ inetErrMsg = "Could not find address";
+ inetErrDesc = name;
+ return -1;
+ }
+ }
+ } else {
+ addr.sin_addr.s_addr = INADDR_ANY;
+ }
+ return 0;
+}
+
+
+void setInetError(const char* description)
+{
+ inetErrNo = 0;
+#ifdef _WIN32
+ inetErrNo = WSAGetLastError();
+ switch (inetErrNo) {
+ case WSANOTINITIALISED:
+ inetErrMsg = "WSANOTINITIALISED A successful WSAStartup must occur before using this function.";
+ break;
+ case WSAENETDOWN:
+ inetErrMsg = "WSAENETDOWN The network subsystem has failed.";
+ break;
+ case WSAEFAULT:
+ inetErrMsg = "WSAEFAULT The buf or from parameters are not part of the user address space, or the fromlen parameter is too small to accommodate the peer address.";
+ break;
+ case WSAEINTR:
+ inetErrMsg = "WSAEINTR The (blocking) call was canceled through WSACancelBlockingCall.";
+ break;
+ case WSAEINPROGRESS:
+ inetErrMsg = "WSAEINPROGRESS A blocking Windows Sockets 1.1 call is in progress, or the service provider is still processing a callback function.";
+ break;
+ case WSAEINVAL:
+ inetErrMsg = "WSAEINVAL The socket has not been bound with bind, or an unknown flag was specified, or MSG_OOB was specified for a socket with SO_OOBINLINE enabled, or (for byte stream-style sockets only) len was zero or negative.";
+ break;
+ case WSAEISCONN:
+ inetErrMsg = "WSAEISCONN The socket is connected. This function is not permitted with a connected socket, whether the socket is connection-oriented or connectionless.";
+ break;
+ case WSAENETRESET:
+ inetErrMsg = "WSAENETRESET The connection has been broken due to the \"keep-alive\" activity detecting a failure while the operation was in progress.";
+ break;
+ case WSAENOTSOCK:
+ inetErrMsg = "WSAENOTSOCK The descriptor is not a socket.";
+ break;
+ case WSAEOPNOTSUPP:
+ inetErrMsg = "WSAEOPNOTSUPP MSG_OOB was specified, but the socket is not stream-style such as type SOCK_STREAM, out-of-band data is not supported in the communication domain associated with this socket, or the socket is unidirectional and supports only send operations.";
+ break;
+ case WSAESHUTDOWN:
+ inetErrMsg = "WSAESHUTDOWN The socket has been shut down; it is not possible to recvfrom on a socket after shutdown has been invoked with how set to SD_RECEIVE or SD_BOTH.";
+ break;
+ case WSAEWOULDBLOCK:
+ inetErrMsg = "WSAEWOULDBLOCK The socket is marked as nonblocking and the recvfrom operation would block.";
+ break;
+ case WSAEMSGSIZE:
+ inetErrMsg = "WSAEMSGSIZE The message was too large to fit into the specified buffer and was truncated.";
+ break;
+ case WSAETIMEDOUT:
+ inetErrMsg = "WSAETIMEDOUT The connection has been dropped, because of a network failure or because the system on the other end went down without notice.";
+ break;
+ case WSAECONNRESET:
+ inetErrMsg = "WSAECONNRESET";
+ break;
+ case WSAEACCES:
+ inetErrMsg = "WSAEACCES The requested address is a broadcast address, but the appropriate flag was not set. Call setsockopt with the SO_BROADCAST parameter to allow the use of the broadcast address.";
+ break;
+ case WSAENOBUFS:
+ inetErrMsg = "WSAENOBUFS No buffer space is available.";
+ break;
+ case WSAENOTCONN:
+ inetErrMsg = "WSAENOTCONN The socket is not connected (connection-oriented sockets only)";
+ break;
+ case WSAEHOSTUNREACH:
+ inetErrMsg = "WSAEHOSTUNREACH The remote host cannot be reached from this host at this time.";
+ break;
+ case WSAECONNABORTED:
+ inetErrMsg = "WSAECONNABORTED The virtual circuit was terminated due to a time-out or other failure. The application should close the socket as it is no longer usable.";
+ break;
+ case WSAEADDRNOTAVAIL:
+ inetErrMsg = "WSAEADDRNOTAVAIL The remote address is not a valid address, for example, ADDR_ANY.";
+ break;
+ case WSAEAFNOSUPPORT:
+ inetErrMsg = "WSAEAFNOSUPPORT Addresses in the specified family cannot be used with this socket.";
+ break;
+ case WSAEDESTADDRREQ:
+ inetErrMsg = "WSAEDESTADDRREQ A destination address is required.";
+ break;
+ case WSAENETUNREACH:
+ inetErrMsg = "WSAENETUNREACH The network cannot be reached from this host at this time.";
+ break;
+ case WSAEMFILE:
+ inetErrMsg = "No more socket descriptors are available.";
+ break;
+ case WSAEPROTONOSUPPORT:
+ inetErrMsg = "The specified protocol is not supported.";
+ break;
+ case WSAEPROTOTYPE:
+ inetErrMsg = "The specified protocol is the wrong type for this socket.";
+ break;
+ case WSAESOCKTNOSUPPORT:
+ inetErrMsg = "The specified socket type is not supported in this address family.";
+ break;
+ default:
+ inetErrMsg = "Unknown";
+ };
+#else
+ inetErrNo = errno;
+ inetErrMsg = strerror(inetErrNo);
+#endif
+ inetErrDesc = description;
+}
diff --git a/src/InetAddress.h b/src/InetAddress.h
new file mode 100644
index 0000000..f818cbf
--- /dev/null
+++ b/src/InetAddress.h
@@ -0,0 +1,91 @@
+/*
+ Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 Her Majesty the
+ Queen in Right of Canada (Communications Research Center Canada)
+ */
+/*
+ This file is part of CRC-DabMux.
+
+ CRC-DabMux is free software: you can 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.
+
+ CRC-DabMux is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with CRC-DabMux. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef _InetAddress
+#define _InetAddress
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+// General libraries
+#include <stdlib.h>
+// Linux librairies
+#ifndef _WIN32
+// # include <sys/types.h>
+# include <sys/socket.h>
+# include <netinet/in.h>
+# include <unistd.h>
+# include <netdb.h>
+# include <arpa/inet.h>
+# include <pthread.h>
+# define SOCKET int
+# define INVALID_SOCKET -1
+# define closesocket ::close
+// Windows librairies
+#else
+# include <winsock.h>
+# ifdef _MSC_VER
+# pragma comment(lib, "wsock32.lib")
+# elif defined(__BORLANDC__)
+# pragma(lib, "mswsock.lib")
+# endif
+# ifndef IN_MULTICAST
+# define IN_MULTICAST(a) ((((unsigned long) (a)) & 0xf0000000) == 0xe0000000)
+# endif
+#endif
+// General definitions
+#define INVALID_PORT -1
+
+
+/// The last error number
+extern int inetErrNo;
+/// The last error message
+extern const char *inetErrMsg;
+/// The description of the last error
+extern const char *inetErrDesc;
+/// Set the number, message and description of the last error
+void setInetError(const char* description);
+
+
+/**
+ * This class represents an Internet Protocol (IP) address.
+ * @author Pascal Charest pascal.charest@crc.ca
+ */
+class InetAddress {
+ public:
+ InetAddress(int port = 0, const char* name = NULL);
+ InetAddress(const InetAddress &addr);
+ ~InetAddress();
+
+ sockaddr *getAddress();
+ const char *getHostAddress();
+ int getPort();
+ int setAddress(const char *name);
+ void setPort(int port);
+ bool isMulticastAddress();
+
+ private:
+ sockaddr_in addr;
+};
+
+
+#endif
diff --git a/src/Interleaver.cpp b/src/Interleaver.cpp
new file mode 100644
index 0000000..0b23b8d
--- /dev/null
+++ b/src/Interleaver.cpp
@@ -0,0 +1,143 @@
+/*
+ Copyright (C) 2005, 2006, 2007, 2008, 2009 Her Majesty the Queen in Right
+ of Canada (Communications Research Center Canada)
+ */
+/*
+ This file is part of CRC-DabMux.
+
+ CRC-DabMux is free software: you can 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.
+
+ CRC-DabMux is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with CRC-DabMux. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "Interleaver.h"
+
+#include <string.h>
+
+#ifdef _WIN32
+# define bzero(a, b) memset((a), 0, (b))
+#endif // _WIN32
+
+
+Interleaver::Interleaver(unsigned short I, unsigned short M, bool reverse)
+{
+ this->I = I;
+ this->M = M;
+ this->N = I * M;
+ this->memSize = (this->N * I) - 1;
+ this->mem = new char[memSize];
+ setReverse(reverse);
+}
+
+
+Interleaver::~Interleaver()
+{
+ delete []mem;
+}
+
+
+void Interleaver::setReverse(bool state)
+{
+ reverse = state;
+ reset();
+}
+
+
+void Interleaver::reset()
+{
+ j = 0;
+ index = 0;
+ bzero(mem, memSize);
+}
+
+
+void Interleaver::encode(void* data, unsigned long size)
+{
+ encode(data, data, size);
+}
+
+
+void Interleaver::encode(const void* inData, void* outData, unsigned long size)
+{
+ const char* input = reinterpret_cast<const char *>(inData);
+ char* output = reinterpret_cast<char *>(outData);
+ unsigned long i;
+
+ if (reverse) {
+ for (i = 0; i < size; ++i) {
+ mem[(index + ((I - 1 - j) * N)) % memSize] = *input;
+ *output = mem[index];
+ ++input;
+ ++output;
+ if (++j == I) {
+ j = 0;
+ }
+ if (++index == memSize) {
+ index = 0;
+ }
+ }
+ } else {
+ for (i = 0; i < size; ++i) {
+ if (j) {
+ mem[(index + (j * N)) % memSize] = *input;
+ *output = mem[index];
+ } else {
+ *output = *input;
+ }
+ ++input;
+ ++output;
+ if (++j == I) {
+ j = 0;
+ }
+ if (++index == memSize) {
+ index = 0;
+ }
+ }
+ }
+}
+
+
+unsigned long Interleaver::sync(void* data, unsigned long size, char padding)
+{
+ char* input = reinterpret_cast<char *>(data);
+ unsigned long index;
+
+ if (reverse) {
+ for (index = 0; index < size; ++index) {
+ mem[(index + ((I - 1 - j) * N)) % memSize] = padding;
+ *input = mem[index];
+ ++input;
+ if (++index == memSize) {
+ index = 0;
+ }
+ if (++j == I) {
+ j = 0;
+ break;
+ }
+ }
+ } else {
+ for (index = 0; index < size; ++index) {
+ mem[(index + (j * N)) % memSize] = padding;
+ *input = mem[index];
+ ++input;
+ if (++index == memSize) {
+ index = 0;
+ }
+ if (++j == I) {
+ j = 0;
+ break;
+ }
+ }
+ }
+
+ return index;
+}
diff --git a/src/Interleaver.h b/src/Interleaver.h
new file mode 100644
index 0000000..ad5cccf
--- /dev/null
+++ b/src/Interleaver.h
@@ -0,0 +1,56 @@
+/*
+ Copyright (C) 2005, 2006, 2007, 2008, 2009 Her Majesty the Queen in Right
+ of Canada (Communications Research Center Canada)
+ */
+/*
+ This file is part of CRC-DabMux.
+
+ CRC-DabMux is free software: you can 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.
+
+ CRC-DabMux is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with CRC-DabMux. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef _INTERLEAVER
+#define _INTERLEAVER
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+
+class Interleaver
+{
+public:
+ Interleaver(unsigned short I, unsigned short M, bool reverse = false);
+ Interleaver(Interleaver& clone);
+ virtual ~Interleaver();
+
+ void setReverse(bool state);
+ void encode(void* data, unsigned long size);
+ void encode(const void* inData, void* outData, unsigned long size);
+ unsigned long sync(void* data, unsigned long size, char padding = 0);
+ void reset();
+ void flush(char padding = 0);
+
+private:
+ unsigned short I;
+ unsigned short M;
+ unsigned long N;
+ unsigned long j;
+ unsigned long index;
+ unsigned long memSize;
+ char* mem;
+ bool reverse;
+};
+
+
+#endif // _INTERLEAVER
diff --git a/src/Makefile.am b/src/Makefile.am
new file mode 100644
index 0000000..956e0f4
--- /dev/null
+++ b/src/Makefile.am
@@ -0,0 +1,66 @@
+# Copyright (C) 2008, 2009 Her Majesty the Queen in Right of Canada
+# (Communications Research Center Canada)
+
+# This file is part of CRC-DabMux.
+#
+# CRC-DabMux is free software: you can 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.
+#
+# CRC-DabMux is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with CRC-DabMux. If not, see <http://www.gnu.org/licenses/>.
+
+bin_PROGRAMS =CRC-DabMux CRC-BridgeTest
+
+FEC_FLAGS =
+FEC_LIBS =-lfec
+
+CRC_DabMux_CPPFLAGS =-I$(FARSYNC_DIR)
+CRC_DabMux_LDADD =$(FEC_LIBS) -lpthread
+CRC_DabMux_SOURCES =DabMux.cpp \
+ dabInput.h dabInput.cpp \
+ dabInputBridgeUdp.h dabInputBridgeUdp.cpp \
+ dabInputDabplusFifo.h dabInputDabplusFifo.cpp \
+ dabInputDabplusFile.h dabInputDabplusFile.cpp \
+ dabInputDmbFile.h dabInputDmbFile.cpp \
+ dabInputDmbUdp.h dabInputDmbUdp.cpp \
+ dabInputEnhancedFifo.h dabInputEnhancedFifo.cpp \
+ dabInputEnhancedPacketFile.h dabInputEnhancedPacketFile.cpp \
+ dabInputFifo.h dabInputFifo.cpp \
+ dabInputFile.h dabInputFile.cpp \
+ dabInputMpegFifo.h dabInputMpegFifo.cpp \
+ dabInputMpegFile.h dabInputMpegFile.cpp \
+ dabInputPacketFile.h dabInputPacketFile.cpp \
+ dabInputPrbs.h dabInputPrbs.cpp \
+ dabInputRawFile.h dabInputRawFile.cpp \
+ dabInputRawFifo.h dabInputRawFifo.cpp \
+ dabInputSlip.h dabInputSlip.cpp \
+ dabInputTest.h dabInputTest.cpp \
+ dabInputUdp.h dabInputUdp.cpp \
+ dabOutput.h dabOutput.cpp \
+ bridge.h bridge.c \
+ \
+ Eti.h Eti.cpp \
+ TcpLog.h TcpLog.cpp \
+ UdpSocket.h UdpSocket.cpp \
+ InetAddress.h InetAddress.cpp \
+ prbs.h prbs.c \
+ crc.h crc.c \
+ dabUtils.h dabUtils.cpp \
+ PcDebug.h \
+ Dmb.h Dmb.cpp \
+ Interleaver.h Interleaver.cpp \
+ ReedSolomon.h ReedSolomon.cpp \
+ mpeg.h mpeg.c \
+ TcpServer.h TcpServer.cpp \
+ TcpSocket.h TcpSocket.cpp
+
+CRC_BridgeTest_CFLAGS =-DBRIDGE_TEST
+CRC_BridgeTest_SOURCES =bridge.c \
+ crc.c crc.h
diff --git a/src/Makefile.in b/src/Makefile.in
new file mode 100644
index 0000000..e3689b0
--- /dev/null
+++ b/src/Makefile.in
@@ -0,0 +1,1146 @@
+# Makefile.in generated by automake 1.11.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
+# Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+# Copyright (C) 2008, 2009 Her Majesty the Queen in Right of Canada
+# (Communications Research Center Canada)
+
+# This file is part of CRC-DabMux.
+#
+# CRC-DabMux is free software: you can 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.
+#
+# CRC-DabMux is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with CRC-DabMux. If not, see <http://www.gnu.org/licenses/>.
+
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+bin_PROGRAMS = CRC-DabMux$(EXEEXT) CRC-BridgeTest$(EXEEXT)
+subdir = src
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+am__installdirs = "$(DESTDIR)$(bindir)"
+PROGRAMS = $(bin_PROGRAMS)
+am_CRC_BridgeTest_OBJECTS = CRC_BridgeTest-bridge.$(OBJEXT) \
+ CRC_BridgeTest-crc.$(OBJEXT)
+CRC_BridgeTest_OBJECTS = $(am_CRC_BridgeTest_OBJECTS)
+CRC_BridgeTest_LDADD = $(LDADD)
+CRC_BridgeTest_LINK = $(CCLD) $(CRC_BridgeTest_CFLAGS) $(CFLAGS) \
+ $(AM_LDFLAGS) $(LDFLAGS) -o $@
+am_CRC_DabMux_OBJECTS = CRC_DabMux-DabMux.$(OBJEXT) \
+ CRC_DabMux-dabInput.$(OBJEXT) \
+ CRC_DabMux-dabInputBridgeUdp.$(OBJEXT) \
+ CRC_DabMux-dabInputDabplusFifo.$(OBJEXT) \
+ CRC_DabMux-dabInputDabplusFile.$(OBJEXT) \
+ CRC_DabMux-dabInputDmbFile.$(OBJEXT) \
+ CRC_DabMux-dabInputDmbUdp.$(OBJEXT) \
+ CRC_DabMux-dabInputEnhancedFifo.$(OBJEXT) \
+ CRC_DabMux-dabInputEnhancedPacketFile.$(OBJEXT) \
+ CRC_DabMux-dabInputFifo.$(OBJEXT) \
+ CRC_DabMux-dabInputFile.$(OBJEXT) \
+ CRC_DabMux-dabInputMpegFifo.$(OBJEXT) \
+ CRC_DabMux-dabInputMpegFile.$(OBJEXT) \
+ CRC_DabMux-dabInputPacketFile.$(OBJEXT) \
+ CRC_DabMux-dabInputPrbs.$(OBJEXT) \
+ CRC_DabMux-dabInputRawFile.$(OBJEXT) \
+ CRC_DabMux-dabInputRawFifo.$(OBJEXT) \
+ CRC_DabMux-dabInputSlip.$(OBJEXT) \
+ CRC_DabMux-dabInputTest.$(OBJEXT) \
+ CRC_DabMux-dabInputUdp.$(OBJEXT) \
+ CRC_DabMux-dabOutput.$(OBJEXT) CRC_DabMux-bridge.$(OBJEXT) \
+ CRC_DabMux-Eti.$(OBJEXT) CRC_DabMux-TcpLog.$(OBJEXT) \
+ CRC_DabMux-UdpSocket.$(OBJEXT) \
+ CRC_DabMux-InetAddress.$(OBJEXT) CRC_DabMux-prbs.$(OBJEXT) \
+ CRC_DabMux-crc.$(OBJEXT) CRC_DabMux-dabUtils.$(OBJEXT) \
+ CRC_DabMux-Dmb.$(OBJEXT) CRC_DabMux-Interleaver.$(OBJEXT) \
+ CRC_DabMux-ReedSolomon.$(OBJEXT) CRC_DabMux-mpeg.$(OBJEXT) \
+ CRC_DabMux-TcpServer.$(OBJEXT) CRC_DabMux-TcpSocket.$(OBJEXT)
+CRC_DabMux_OBJECTS = $(am_CRC_DabMux_OBJECTS)
+am__DEPENDENCIES_1 =
+CRC_DabMux_DEPENDENCIES = $(am__DEPENDENCIES_1)
+DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/build-aux/depcomp
+am__depfiles_maybe = depfiles
+am__mv = mv -f
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+CXXLD = $(CXX)
+CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \
+ -o $@
+SOURCES = $(CRC_BridgeTest_SOURCES) $(CRC_DabMux_SOURCES)
+DIST_SOURCES = $(CRC_BridgeTest_SOURCES) $(CRC_DabMux_SOURCES)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BUILD_HOST = @BUILD_HOST@
+BUILD_TARGET = @BUILD_TARGET@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FARSYNC_DIR = @FARSYNC_DIR@
+GETOPT = @GETOPT@
+GREP = @GREP@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MKDIR_P = @MKDIR_P@
+OBJEXT = @OBJEXT@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+VERSION = @VERSION@
+WSOCK32 = @WSOCK32@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+FEC_FLAGS =
+FEC_LIBS = -lfec
+CRC_DabMux_CPPFLAGS = -I$(FARSYNC_DIR)
+CRC_DabMux_LDADD = $(FEC_LIBS) -lpthread
+CRC_DabMux_SOURCES = DabMux.cpp \
+ dabInput.h dabInput.cpp \
+ dabInputBridgeUdp.h dabInputBridgeUdp.cpp \
+ dabInputDabplusFifo.h dabInputDabplusFifo.cpp \
+ dabInputDabplusFile.h dabInputDabplusFile.cpp \
+ dabInputDmbFile.h dabInputDmbFile.cpp \
+ dabInputDmbUdp.h dabInputDmbUdp.cpp \
+ dabInputEnhancedFifo.h dabInputEnhancedFifo.cpp \
+ dabInputEnhancedPacketFile.h dabInputEnhancedPacketFile.cpp \
+ dabInputFifo.h dabInputFifo.cpp \
+ dabInputFile.h dabInputFile.cpp \
+ dabInputMpegFifo.h dabInputMpegFifo.cpp \
+ dabInputMpegFile.h dabInputMpegFile.cpp \
+ dabInputPacketFile.h dabInputPacketFile.cpp \
+ dabInputPrbs.h dabInputPrbs.cpp \
+ dabInputRawFile.h dabInputRawFile.cpp \
+ dabInputRawFifo.h dabInputRawFifo.cpp \
+ dabInputSlip.h dabInputSlip.cpp \
+ dabInputTest.h dabInputTest.cpp \
+ dabInputUdp.h dabInputUdp.cpp \
+ dabOutput.h dabOutput.cpp \
+ bridge.h bridge.c \
+ \
+ Eti.h Eti.cpp \
+ TcpLog.h TcpLog.cpp \
+ UdpSocket.h UdpSocket.cpp \
+ InetAddress.h InetAddress.cpp \
+ prbs.h prbs.c \
+ crc.h crc.c \
+ dabUtils.h dabUtils.cpp \
+ PcDebug.h \
+ Dmb.h Dmb.cpp \
+ Interleaver.h Interleaver.cpp \
+ ReedSolomon.h ReedSolomon.cpp \
+ mpeg.h mpeg.c \
+ TcpServer.h TcpServer.cpp \
+ TcpSocket.h TcpSocket.cpp
+
+CRC_BridgeTest_CFLAGS = -DBRIDGE_TEST
+CRC_BridgeTest_SOURCES = bridge.c \
+ crc.c crc.h
+
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .c .cpp .o .obj
+$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+ && { if test -f $@; then exit 0; else break; fi; }; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/Makefile'; \
+ $(am__cd) $(top_srcdir) && \
+ $(AUTOMAKE) --gnu src/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+install-binPROGRAMS: $(bin_PROGRAMS)
+ @$(NORMAL_INSTALL)
+ test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)"
+ @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
+ for p in $$list; do echo "$$p $$p"; done | \
+ sed 's/$(EXEEXT)$$//' | \
+ while read p p1; do if test -f $$p; \
+ then echo "$$p"; echo "$$p"; else :; fi; \
+ done | \
+ sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \
+ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
+ sed 'N;N;N;s,\n, ,g' | \
+ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
+ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
+ if ($$2 == $$4) files[d] = files[d] " " $$1; \
+ else { print "f", $$3 "/" $$4, $$1; } } \
+ END { for (d in files) print "f", d, files[d] }' | \
+ while read type dir files; do \
+ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
+ test -z "$$files" || { \
+ echo " $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \
+ $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \
+ } \
+ ; done
+
+uninstall-binPROGRAMS:
+ @$(NORMAL_UNINSTALL)
+ @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
+ files=`for p in $$list; do echo "$$p"; done | \
+ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
+ -e 's/$$/$(EXEEXT)/' `; \
+ test -n "$$list" || exit 0; \
+ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \
+ cd "$(DESTDIR)$(bindir)" && rm -f $$files
+
+clean-binPROGRAMS:
+ -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS)
+CRC-BridgeTest$(EXEEXT): $(CRC_BridgeTest_OBJECTS) $(CRC_BridgeTest_DEPENDENCIES)
+ @rm -f CRC-BridgeTest$(EXEEXT)
+ $(CRC_BridgeTest_LINK) $(CRC_BridgeTest_OBJECTS) $(CRC_BridgeTest_LDADD) $(LIBS)
+CRC-DabMux$(EXEEXT): $(CRC_DabMux_OBJECTS) $(CRC_DabMux_DEPENDENCIES)
+ @rm -f CRC-DabMux$(EXEEXT)
+ $(CXXLINK) $(CRC_DabMux_OBJECTS) $(CRC_DabMux_LDADD) $(LIBS)
+
+mostlyclean-compile:
+ -rm -f *.$(OBJEXT)
+
+distclean-compile:
+ -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/CRC_BridgeTest-bridge.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/CRC_BridgeTest-crc.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/CRC_DabMux-DabMux.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/CRC_DabMux-Dmb.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/CRC_DabMux-Eti.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/CRC_DabMux-InetAddress.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/CRC_DabMux-Interleaver.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/CRC_DabMux-ReedSolomon.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/CRC_DabMux-TcpLog.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/CRC_DabMux-TcpServer.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/CRC_DabMux-TcpSocket.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/CRC_DabMux-UdpSocket.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/CRC_DabMux-bridge.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/CRC_DabMux-crc.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/CRC_DabMux-dabInput.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/CRC_DabMux-dabInputBridgeUdp.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/CRC_DabMux-dabInputDabplusFifo.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/CRC_DabMux-dabInputDabplusFile.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/CRC_DabMux-dabInputDmbFile.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/CRC_DabMux-dabInputDmbUdp.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/CRC_DabMux-dabInputEnhancedFifo.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/CRC_DabMux-dabInputEnhancedPacketFile.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/CRC_DabMux-dabInputFifo.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/CRC_DabMux-dabInputFile.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/CRC_DabMux-dabInputMpegFifo.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/CRC_DabMux-dabInputMpegFile.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/CRC_DabMux-dabInputPacketFile.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/CRC_DabMux-dabInputPrbs.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/CRC_DabMux-dabInputRawFifo.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/CRC_DabMux-dabInputRawFile.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/CRC_DabMux-dabInputSlip.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/CRC_DabMux-dabInputTest.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/CRC_DabMux-dabInputUdp.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/CRC_DabMux-dabOutput.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/CRC_DabMux-dabUtils.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/CRC_DabMux-mpeg.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/CRC_DabMux-prbs.Po@am__quote@
+
+.c.o:
+@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(COMPILE) -c $<
+
+.c.obj:
+@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
+
+CRC_BridgeTest-bridge.o: bridge.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(CRC_BridgeTest_CFLAGS) $(CFLAGS) -MT CRC_BridgeTest-bridge.o -MD -MP -MF $(DEPDIR)/CRC_BridgeTest-bridge.Tpo -c -o CRC_BridgeTest-bridge.o `test -f 'bridge.c' || echo '$(srcdir)/'`bridge.c
+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/CRC_BridgeTest-bridge.Tpo $(DEPDIR)/CRC_BridgeTest-bridge.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='bridge.c' object='CRC_BridgeTest-bridge.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(CRC_BridgeTest_CFLAGS) $(CFLAGS) -c -o CRC_BridgeTest-bridge.o `test -f 'bridge.c' || echo '$(srcdir)/'`bridge.c
+
+CRC_BridgeTest-bridge.obj: bridge.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(CRC_BridgeTest_CFLAGS) $(CFLAGS) -MT CRC_BridgeTest-bridge.obj -MD -MP -MF $(DEPDIR)/CRC_BridgeTest-bridge.Tpo -c -o CRC_BridgeTest-bridge.obj `if test -f 'bridge.c'; then $(CYGPATH_W) 'bridge.c'; else $(CYGPATH_W) '$(srcdir)/bridge.c'; fi`
+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/CRC_BridgeTest-bridge.Tpo $(DEPDIR)/CRC_BridgeTest-bridge.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='bridge.c' object='CRC_BridgeTest-bridge.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(CRC_BridgeTest_CFLAGS) $(CFLAGS) -c -o CRC_BridgeTest-bridge.obj `if test -f 'bridge.c'; then $(CYGPATH_W) 'bridge.c'; else $(CYGPATH_W) '$(srcdir)/bridge.c'; fi`
+
+CRC_BridgeTest-crc.o: crc.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(CRC_BridgeTest_CFLAGS) $(CFLAGS) -MT CRC_BridgeTest-crc.o -MD -MP -MF $(DEPDIR)/CRC_BridgeTest-crc.Tpo -c -o CRC_BridgeTest-crc.o `test -f 'crc.c' || echo '$(srcdir)/'`crc.c
+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/CRC_BridgeTest-crc.Tpo $(DEPDIR)/CRC_BridgeTest-crc.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='crc.c' object='CRC_BridgeTest-crc.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(CRC_BridgeTest_CFLAGS) $(CFLAGS) -c -o CRC_BridgeTest-crc.o `test -f 'crc.c' || echo '$(srcdir)/'`crc.c
+
+CRC_BridgeTest-crc.obj: crc.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(CRC_BridgeTest_CFLAGS) $(CFLAGS) -MT CRC_BridgeTest-crc.obj -MD -MP -MF $(DEPDIR)/CRC_BridgeTest-crc.Tpo -c -o CRC_BridgeTest-crc.obj `if test -f 'crc.c'; then $(CYGPATH_W) 'crc.c'; else $(CYGPATH_W) '$(srcdir)/crc.c'; fi`
+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/CRC_BridgeTest-crc.Tpo $(DEPDIR)/CRC_BridgeTest-crc.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='crc.c' object='CRC_BridgeTest-crc.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(CRC_BridgeTest_CFLAGS) $(CFLAGS) -c -o CRC_BridgeTest-crc.obj `if test -f 'crc.c'; then $(CYGPATH_W) 'crc.c'; else $(CYGPATH_W) '$(srcdir)/crc.c'; fi`
+
+CRC_DabMux-bridge.o: bridge.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CRC_DabMux_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT CRC_DabMux-bridge.o -MD -MP -MF $(DEPDIR)/CRC_DabMux-bridge.Tpo -c -o CRC_DabMux-bridge.o `test -f 'bridge.c' || echo '$(srcdir)/'`bridge.c
+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/CRC_DabMux-bridge.Tpo $(DEPDIR)/CRC_DabMux-bridge.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='bridge.c' object='CRC_DabMux-bridge.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CRC_DabMux_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o CRC_DabMux-bridge.o `test -f 'bridge.c' || echo '$(srcdir)/'`bridge.c
+
+CRC_DabMux-bridge.obj: bridge.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CRC_DabMux_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT CRC_DabMux-bridge.obj -MD -MP -MF $(DEPDIR)/CRC_DabMux-bridge.Tpo -c -o CRC_DabMux-bridge.obj `if test -f 'bridge.c'; then $(CYGPATH_W) 'bridge.c'; else $(CYGPATH_W) '$(srcdir)/bridge.c'; fi`
+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/CRC_DabMux-bridge.Tpo $(DEPDIR)/CRC_DabMux-bridge.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='bridge.c' object='CRC_DabMux-bridge.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CRC_DabMux_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o CRC_DabMux-bridge.obj `if test -f 'bridge.c'; then $(CYGPATH_W) 'bridge.c'; else $(CYGPATH_W) '$(srcdir)/bridge.c'; fi`
+
+CRC_DabMux-prbs.o: prbs.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CRC_DabMux_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT CRC_DabMux-prbs.o -MD -MP -MF $(DEPDIR)/CRC_DabMux-prbs.Tpo -c -o CRC_DabMux-prbs.o `test -f 'prbs.c' || echo '$(srcdir)/'`prbs.c
+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/CRC_DabMux-prbs.Tpo $(DEPDIR)/CRC_DabMux-prbs.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='prbs.c' object='CRC_DabMux-prbs.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CRC_DabMux_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o CRC_DabMux-prbs.o `test -f 'prbs.c' || echo '$(srcdir)/'`prbs.c
+
+CRC_DabMux-prbs.obj: prbs.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CRC_DabMux_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT CRC_DabMux-prbs.obj -MD -MP -MF $(DEPDIR)/CRC_DabMux-prbs.Tpo -c -o CRC_DabMux-prbs.obj `if test -f 'prbs.c'; then $(CYGPATH_W) 'prbs.c'; else $(CYGPATH_W) '$(srcdir)/prbs.c'; fi`
+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/CRC_DabMux-prbs.Tpo $(DEPDIR)/CRC_DabMux-prbs.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='prbs.c' object='CRC_DabMux-prbs.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CRC_DabMux_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o CRC_DabMux-prbs.obj `if test -f 'prbs.c'; then $(CYGPATH_W) 'prbs.c'; else $(CYGPATH_W) '$(srcdir)/prbs.c'; fi`
+
+CRC_DabMux-crc.o: crc.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CRC_DabMux_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT CRC_DabMux-crc.o -MD -MP -MF $(DEPDIR)/CRC_DabMux-crc.Tpo -c -o CRC_DabMux-crc.o `test -f 'crc.c' || echo '$(srcdir)/'`crc.c
+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/CRC_DabMux-crc.Tpo $(DEPDIR)/CRC_DabMux-crc.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='crc.c' object='CRC_DabMux-crc.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CRC_DabMux_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o CRC_DabMux-crc.o `test -f 'crc.c' || echo '$(srcdir)/'`crc.c
+
+CRC_DabMux-crc.obj: crc.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CRC_DabMux_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT CRC_DabMux-crc.obj -MD -MP -MF $(DEPDIR)/CRC_DabMux-crc.Tpo -c -o CRC_DabMux-crc.obj `if test -f 'crc.c'; then $(CYGPATH_W) 'crc.c'; else $(CYGPATH_W) '$(srcdir)/crc.c'; fi`
+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/CRC_DabMux-crc.Tpo $(DEPDIR)/CRC_DabMux-crc.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='crc.c' object='CRC_DabMux-crc.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CRC_DabMux_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o CRC_DabMux-crc.obj `if test -f 'crc.c'; then $(CYGPATH_W) 'crc.c'; else $(CYGPATH_W) '$(srcdir)/crc.c'; fi`
+
+CRC_DabMux-mpeg.o: mpeg.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CRC_DabMux_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT CRC_DabMux-mpeg.o -MD -MP -MF $(DEPDIR)/CRC_DabMux-mpeg.Tpo -c -o CRC_DabMux-mpeg.o `test -f 'mpeg.c' || echo '$(srcdir)/'`mpeg.c
+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/CRC_DabMux-mpeg.Tpo $(DEPDIR)/CRC_DabMux-mpeg.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='mpeg.c' object='CRC_DabMux-mpeg.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CRC_DabMux_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o CRC_DabMux-mpeg.o `test -f 'mpeg.c' || echo '$(srcdir)/'`mpeg.c
+
+CRC_DabMux-mpeg.obj: mpeg.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CRC_DabMux_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT CRC_DabMux-mpeg.obj -MD -MP -MF $(DEPDIR)/CRC_DabMux-mpeg.Tpo -c -o CRC_DabMux-mpeg.obj `if test -f 'mpeg.c'; then $(CYGPATH_W) 'mpeg.c'; else $(CYGPATH_W) '$(srcdir)/mpeg.c'; fi`
+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/CRC_DabMux-mpeg.Tpo $(DEPDIR)/CRC_DabMux-mpeg.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='mpeg.c' object='CRC_DabMux-mpeg.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CRC_DabMux_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o CRC_DabMux-mpeg.obj `if test -f 'mpeg.c'; then $(CYGPATH_W) 'mpeg.c'; else $(CYGPATH_W) '$(srcdir)/mpeg.c'; fi`
+
+.cpp.o:
+@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $<
+
+.cpp.obj:
+@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+CRC_DabMux-DabMux.o: DabMux.cpp
+@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CRC_DabMux_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT CRC_DabMux-DabMux.o -MD -MP -MF $(DEPDIR)/CRC_DabMux-DabMux.Tpo -c -o CRC_DabMux-DabMux.o `test -f 'DabMux.cpp' || echo '$(srcdir)/'`DabMux.cpp
+@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/CRC_DabMux-DabMux.Tpo $(DEPDIR)/CRC_DabMux-DabMux.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='DabMux.cpp' object='CRC_DabMux-DabMux.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CRC_DabMux_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o CRC_DabMux-DabMux.o `test -f 'DabMux.cpp' || echo '$(srcdir)/'`DabMux.cpp
+
+CRC_DabMux-DabMux.obj: DabMux.cpp
+@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CRC_DabMux_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT CRC_DabMux-DabMux.obj -MD -MP -MF $(DEPDIR)/CRC_DabMux-DabMux.Tpo -c -o CRC_DabMux-DabMux.obj `if test -f 'DabMux.cpp'; then $(CYGPATH_W) 'DabMux.cpp'; else $(CYGPATH_W) '$(srcdir)/DabMux.cpp'; fi`
+@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/CRC_DabMux-DabMux.Tpo $(DEPDIR)/CRC_DabMux-DabMux.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='DabMux.cpp' object='CRC_DabMux-DabMux.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CRC_DabMux_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o CRC_DabMux-DabMux.obj `if test -f 'DabMux.cpp'; then $(CYGPATH_W) 'DabMux.cpp'; else $(CYGPATH_W) '$(srcdir)/DabMux.cpp'; fi`
+
+CRC_DabMux-dabInput.o: dabInput.cpp
+@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CRC_DabMux_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT CRC_DabMux-dabInput.o -MD -MP -MF $(DEPDIR)/CRC_DabMux-dabInput.Tpo -c -o CRC_DabMux-dabInput.o `test -f 'dabInput.cpp' || echo '$(srcdir)/'`dabInput.cpp
+@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/CRC_DabMux-dabInput.Tpo $(DEPDIR)/CRC_DabMux-dabInput.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='dabInput.cpp' object='CRC_DabMux-dabInput.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CRC_DabMux_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o CRC_DabMux-dabInput.o `test -f 'dabInput.cpp' || echo '$(srcdir)/'`dabInput.cpp
+
+CRC_DabMux-dabInput.obj: dabInput.cpp
+@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CRC_DabMux_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT CRC_DabMux-dabInput.obj -MD -MP -MF $(DEPDIR)/CRC_DabMux-dabInput.Tpo -c -o CRC_DabMux-dabInput.obj `if test -f 'dabInput.cpp'; then $(CYGPATH_W) 'dabInput.cpp'; else $(CYGPATH_W) '$(srcdir)/dabInput.cpp'; fi`
+@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/CRC_DabMux-dabInput.Tpo $(DEPDIR)/CRC_DabMux-dabInput.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='dabInput.cpp' object='CRC_DabMux-dabInput.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CRC_DabMux_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o CRC_DabMux-dabInput.obj `if test -f 'dabInput.cpp'; then $(CYGPATH_W) 'dabInput.cpp'; else $(CYGPATH_W) '$(srcdir)/dabInput.cpp'; fi`
+
+CRC_DabMux-dabInputBridgeUdp.o: dabInputBridgeUdp.cpp
+@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CRC_DabMux_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT CRC_DabMux-dabInputBridgeUdp.o -MD -MP -MF $(DEPDIR)/CRC_DabMux-dabInputBridgeUdp.Tpo -c -o CRC_DabMux-dabInputBridgeUdp.o `test -f 'dabInputBridgeUdp.cpp' || echo '$(srcdir)/'`dabInputBridgeUdp.cpp
+@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/CRC_DabMux-dabInputBridgeUdp.Tpo $(DEPDIR)/CRC_DabMux-dabInputBridgeUdp.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='dabInputBridgeUdp.cpp' object='CRC_DabMux-dabInputBridgeUdp.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CRC_DabMux_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o CRC_DabMux-dabInputBridgeUdp.o `test -f 'dabInputBridgeUdp.cpp' || echo '$(srcdir)/'`dabInputBridgeUdp.cpp
+
+CRC_DabMux-dabInputBridgeUdp.obj: dabInputBridgeUdp.cpp
+@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CRC_DabMux_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT CRC_DabMux-dabInputBridgeUdp.obj -MD -MP -MF $(DEPDIR)/CRC_DabMux-dabInputBridgeUdp.Tpo -c -o CRC_DabMux-dabInputBridgeUdp.obj `if test -f 'dabInputBridgeUdp.cpp'; then $(CYGPATH_W) 'dabInputBridgeUdp.cpp'; else $(CYGPATH_W) '$(srcdir)/dabInputBridgeUdp.cpp'; fi`
+@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/CRC_DabMux-dabInputBridgeUdp.Tpo $(DEPDIR)/CRC_DabMux-dabInputBridgeUdp.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='dabInputBridgeUdp.cpp' object='CRC_DabMux-dabInputBridgeUdp.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CRC_DabMux_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o CRC_DabMux-dabInputBridgeUdp.obj `if test -f 'dabInputBridgeUdp.cpp'; then $(CYGPATH_W) 'dabInputBridgeUdp.cpp'; else $(CYGPATH_W) '$(srcdir)/dabInputBridgeUdp.cpp'; fi`
+
+CRC_DabMux-dabInputDabplusFifo.o: dabInputDabplusFifo.cpp
+@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CRC_DabMux_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT CRC_DabMux-dabInputDabplusFifo.o -MD -MP -MF $(DEPDIR)/CRC_DabMux-dabInputDabplusFifo.Tpo -c -o CRC_DabMux-dabInputDabplusFifo.o `test -f 'dabInputDabplusFifo.cpp' || echo '$(srcdir)/'`dabInputDabplusFifo.cpp
+@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/CRC_DabMux-dabInputDabplusFifo.Tpo $(DEPDIR)/CRC_DabMux-dabInputDabplusFifo.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='dabInputDabplusFifo.cpp' object='CRC_DabMux-dabInputDabplusFifo.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CRC_DabMux_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o CRC_DabMux-dabInputDabplusFifo.o `test -f 'dabInputDabplusFifo.cpp' || echo '$(srcdir)/'`dabInputDabplusFifo.cpp
+
+CRC_DabMux-dabInputDabplusFifo.obj: dabInputDabplusFifo.cpp
+@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CRC_DabMux_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT CRC_DabMux-dabInputDabplusFifo.obj -MD -MP -MF $(DEPDIR)/CRC_DabMux-dabInputDabplusFifo.Tpo -c -o CRC_DabMux-dabInputDabplusFifo.obj `if test -f 'dabInputDabplusFifo.cpp'; then $(CYGPATH_W) 'dabInputDabplusFifo.cpp'; else $(CYGPATH_W) '$(srcdir)/dabInputDabplusFifo.cpp'; fi`
+@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/CRC_DabMux-dabInputDabplusFifo.Tpo $(DEPDIR)/CRC_DabMux-dabInputDabplusFifo.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='dabInputDabplusFifo.cpp' object='CRC_DabMux-dabInputDabplusFifo.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CRC_DabMux_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o CRC_DabMux-dabInputDabplusFifo.obj `if test -f 'dabInputDabplusFifo.cpp'; then $(CYGPATH_W) 'dabInputDabplusFifo.cpp'; else $(CYGPATH_W) '$(srcdir)/dabInputDabplusFifo.cpp'; fi`
+
+CRC_DabMux-dabInputDabplusFile.o: dabInputDabplusFile.cpp
+@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CRC_DabMux_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT CRC_DabMux-dabInputDabplusFile.o -MD -MP -MF $(DEPDIR)/CRC_DabMux-dabInputDabplusFile.Tpo -c -o CRC_DabMux-dabInputDabplusFile.o `test -f 'dabInputDabplusFile.cpp' || echo '$(srcdir)/'`dabInputDabplusFile.cpp
+@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/CRC_DabMux-dabInputDabplusFile.Tpo $(DEPDIR)/CRC_DabMux-dabInputDabplusFile.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='dabInputDabplusFile.cpp' object='CRC_DabMux-dabInputDabplusFile.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CRC_DabMux_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o CRC_DabMux-dabInputDabplusFile.o `test -f 'dabInputDabplusFile.cpp' || echo '$(srcdir)/'`dabInputDabplusFile.cpp
+
+CRC_DabMux-dabInputDabplusFile.obj: dabInputDabplusFile.cpp
+@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CRC_DabMux_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT CRC_DabMux-dabInputDabplusFile.obj -MD -MP -MF $(DEPDIR)/CRC_DabMux-dabInputDabplusFile.Tpo -c -o CRC_DabMux-dabInputDabplusFile.obj `if test -f 'dabInputDabplusFile.cpp'; then $(CYGPATH_W) 'dabInputDabplusFile.cpp'; else $(CYGPATH_W) '$(srcdir)/dabInputDabplusFile.cpp'; fi`
+@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/CRC_DabMux-dabInputDabplusFile.Tpo $(DEPDIR)/CRC_DabMux-dabInputDabplusFile.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='dabInputDabplusFile.cpp' object='CRC_DabMux-dabInputDabplusFile.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CRC_DabMux_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o CRC_DabMux-dabInputDabplusFile.obj `if test -f 'dabInputDabplusFile.cpp'; then $(CYGPATH_W) 'dabInputDabplusFile.cpp'; else $(CYGPATH_W) '$(srcdir)/dabInputDabplusFile.cpp'; fi`
+
+CRC_DabMux-dabInputDmbFile.o: dabInputDmbFile.cpp
+@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CRC_DabMux_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT CRC_DabMux-dabInputDmbFile.o -MD -MP -MF $(DEPDIR)/CRC_DabMux-dabInputDmbFile.Tpo -c -o CRC_DabMux-dabInputDmbFile.o `test -f 'dabInputDmbFile.cpp' || echo '$(srcdir)/'`dabInputDmbFile.cpp
+@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/CRC_DabMux-dabInputDmbFile.Tpo $(DEPDIR)/CRC_DabMux-dabInputDmbFile.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='dabInputDmbFile.cpp' object='CRC_DabMux-dabInputDmbFile.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CRC_DabMux_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o CRC_DabMux-dabInputDmbFile.o `test -f 'dabInputDmbFile.cpp' || echo '$(srcdir)/'`dabInputDmbFile.cpp
+
+CRC_DabMux-dabInputDmbFile.obj: dabInputDmbFile.cpp
+@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CRC_DabMux_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT CRC_DabMux-dabInputDmbFile.obj -MD -MP -MF $(DEPDIR)/CRC_DabMux-dabInputDmbFile.Tpo -c -o CRC_DabMux-dabInputDmbFile.obj `if test -f 'dabInputDmbFile.cpp'; then $(CYGPATH_W) 'dabInputDmbFile.cpp'; else $(CYGPATH_W) '$(srcdir)/dabInputDmbFile.cpp'; fi`
+@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/CRC_DabMux-dabInputDmbFile.Tpo $(DEPDIR)/CRC_DabMux-dabInputDmbFile.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='dabInputDmbFile.cpp' object='CRC_DabMux-dabInputDmbFile.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CRC_DabMux_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o CRC_DabMux-dabInputDmbFile.obj `if test -f 'dabInputDmbFile.cpp'; then $(CYGPATH_W) 'dabInputDmbFile.cpp'; else $(CYGPATH_W) '$(srcdir)/dabInputDmbFile.cpp'; fi`
+
+CRC_DabMux-dabInputDmbUdp.o: dabInputDmbUdp.cpp
+@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CRC_DabMux_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT CRC_DabMux-dabInputDmbUdp.o -MD -MP -MF $(DEPDIR)/CRC_DabMux-dabInputDmbUdp.Tpo -c -o CRC_DabMux-dabInputDmbUdp.o `test -f 'dabInputDmbUdp.cpp' || echo '$(srcdir)/'`dabInputDmbUdp.cpp
+@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/CRC_DabMux-dabInputDmbUdp.Tpo $(DEPDIR)/CRC_DabMux-dabInputDmbUdp.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='dabInputDmbUdp.cpp' object='CRC_DabMux-dabInputDmbUdp.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CRC_DabMux_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o CRC_DabMux-dabInputDmbUdp.o `test -f 'dabInputDmbUdp.cpp' || echo '$(srcdir)/'`dabInputDmbUdp.cpp
+
+CRC_DabMux-dabInputDmbUdp.obj: dabInputDmbUdp.cpp
+@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CRC_DabMux_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT CRC_DabMux-dabInputDmbUdp.obj -MD -MP -MF $(DEPDIR)/CRC_DabMux-dabInputDmbUdp.Tpo -c -o CRC_DabMux-dabInputDmbUdp.obj `if test -f 'dabInputDmbUdp.cpp'; then $(CYGPATH_W) 'dabInputDmbUdp.cpp'; else $(CYGPATH_W) '$(srcdir)/dabInputDmbUdp.cpp'; fi`
+@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/CRC_DabMux-dabInputDmbUdp.Tpo $(DEPDIR)/CRC_DabMux-dabInputDmbUdp.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='dabInputDmbUdp.cpp' object='CRC_DabMux-dabInputDmbUdp.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CRC_DabMux_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o CRC_DabMux-dabInputDmbUdp.obj `if test -f 'dabInputDmbUdp.cpp'; then $(CYGPATH_W) 'dabInputDmbUdp.cpp'; else $(CYGPATH_W) '$(srcdir)/dabInputDmbUdp.cpp'; fi`
+
+CRC_DabMux-dabInputEnhancedFifo.o: dabInputEnhancedFifo.cpp
+@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CRC_DabMux_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT CRC_DabMux-dabInputEnhancedFifo.o -MD -MP -MF $(DEPDIR)/CRC_DabMux-dabInputEnhancedFifo.Tpo -c -o CRC_DabMux-dabInputEnhancedFifo.o `test -f 'dabInputEnhancedFifo.cpp' || echo '$(srcdir)/'`dabInputEnhancedFifo.cpp
+@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/CRC_DabMux-dabInputEnhancedFifo.Tpo $(DEPDIR)/CRC_DabMux-dabInputEnhancedFifo.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='dabInputEnhancedFifo.cpp' object='CRC_DabMux-dabInputEnhancedFifo.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CRC_DabMux_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o CRC_DabMux-dabInputEnhancedFifo.o `test -f 'dabInputEnhancedFifo.cpp' || echo '$(srcdir)/'`dabInputEnhancedFifo.cpp
+
+CRC_DabMux-dabInputEnhancedFifo.obj: dabInputEnhancedFifo.cpp
+@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CRC_DabMux_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT CRC_DabMux-dabInputEnhancedFifo.obj -MD -MP -MF $(DEPDIR)/CRC_DabMux-dabInputEnhancedFifo.Tpo -c -o CRC_DabMux-dabInputEnhancedFifo.obj `if test -f 'dabInputEnhancedFifo.cpp'; then $(CYGPATH_W) 'dabInputEnhancedFifo.cpp'; else $(CYGPATH_W) '$(srcdir)/dabInputEnhancedFifo.cpp'; fi`
+@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/CRC_DabMux-dabInputEnhancedFifo.Tpo $(DEPDIR)/CRC_DabMux-dabInputEnhancedFifo.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='dabInputEnhancedFifo.cpp' object='CRC_DabMux-dabInputEnhancedFifo.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CRC_DabMux_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o CRC_DabMux-dabInputEnhancedFifo.obj `if test -f 'dabInputEnhancedFifo.cpp'; then $(CYGPATH_W) 'dabInputEnhancedFifo.cpp'; else $(CYGPATH_W) '$(srcdir)/dabInputEnhancedFifo.cpp'; fi`
+
+CRC_DabMux-dabInputEnhancedPacketFile.o: dabInputEnhancedPacketFile.cpp
+@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CRC_DabMux_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT CRC_DabMux-dabInputEnhancedPacketFile.o -MD -MP -MF $(DEPDIR)/CRC_DabMux-dabInputEnhancedPacketFile.Tpo -c -o CRC_DabMux-dabInputEnhancedPacketFile.o `test -f 'dabInputEnhancedPacketFile.cpp' || echo '$(srcdir)/'`dabInputEnhancedPacketFile.cpp
+@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/CRC_DabMux-dabInputEnhancedPacketFile.Tpo $(DEPDIR)/CRC_DabMux-dabInputEnhancedPacketFile.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='dabInputEnhancedPacketFile.cpp' object='CRC_DabMux-dabInputEnhancedPacketFile.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CRC_DabMux_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o CRC_DabMux-dabInputEnhancedPacketFile.o `test -f 'dabInputEnhancedPacketFile.cpp' || echo '$(srcdir)/'`dabInputEnhancedPacketFile.cpp
+
+CRC_DabMux-dabInputEnhancedPacketFile.obj: dabInputEnhancedPacketFile.cpp
+@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CRC_DabMux_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT CRC_DabMux-dabInputEnhancedPacketFile.obj -MD -MP -MF $(DEPDIR)/CRC_DabMux-dabInputEnhancedPacketFile.Tpo -c -o CRC_DabMux-dabInputEnhancedPacketFile.obj `if test -f 'dabInputEnhancedPacketFile.cpp'; then $(CYGPATH_W) 'dabInputEnhancedPacketFile.cpp'; else $(CYGPATH_W) '$(srcdir)/dabInputEnhancedPacketFile.cpp'; fi`
+@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/CRC_DabMux-dabInputEnhancedPacketFile.Tpo $(DEPDIR)/CRC_DabMux-dabInputEnhancedPacketFile.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='dabInputEnhancedPacketFile.cpp' object='CRC_DabMux-dabInputEnhancedPacketFile.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CRC_DabMux_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o CRC_DabMux-dabInputEnhancedPacketFile.obj `if test -f 'dabInputEnhancedPacketFile.cpp'; then $(CYGPATH_W) 'dabInputEnhancedPacketFile.cpp'; else $(CYGPATH_W) '$(srcdir)/dabInputEnhancedPacketFile.cpp'; fi`
+
+CRC_DabMux-dabInputFifo.o: dabInputFifo.cpp
+@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CRC_DabMux_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT CRC_DabMux-dabInputFifo.o -MD -MP -MF $(DEPDIR)/CRC_DabMux-dabInputFifo.Tpo -c -o CRC_DabMux-dabInputFifo.o `test -f 'dabInputFifo.cpp' || echo '$(srcdir)/'`dabInputFifo.cpp
+@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/CRC_DabMux-dabInputFifo.Tpo $(DEPDIR)/CRC_DabMux-dabInputFifo.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='dabInputFifo.cpp' object='CRC_DabMux-dabInputFifo.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CRC_DabMux_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o CRC_DabMux-dabInputFifo.o `test -f 'dabInputFifo.cpp' || echo '$(srcdir)/'`dabInputFifo.cpp
+
+CRC_DabMux-dabInputFifo.obj: dabInputFifo.cpp
+@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CRC_DabMux_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT CRC_DabMux-dabInputFifo.obj -MD -MP -MF $(DEPDIR)/CRC_DabMux-dabInputFifo.Tpo -c -o CRC_DabMux-dabInputFifo.obj `if test -f 'dabInputFifo.cpp'; then $(CYGPATH_W) 'dabInputFifo.cpp'; else $(CYGPATH_W) '$(srcdir)/dabInputFifo.cpp'; fi`
+@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/CRC_DabMux-dabInputFifo.Tpo $(DEPDIR)/CRC_DabMux-dabInputFifo.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='dabInputFifo.cpp' object='CRC_DabMux-dabInputFifo.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CRC_DabMux_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o CRC_DabMux-dabInputFifo.obj `if test -f 'dabInputFifo.cpp'; then $(CYGPATH_W) 'dabInputFifo.cpp'; else $(CYGPATH_W) '$(srcdir)/dabInputFifo.cpp'; fi`
+
+CRC_DabMux-dabInputFile.o: dabInputFile.cpp
+@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CRC_DabMux_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT CRC_DabMux-dabInputFile.o -MD -MP -MF $(DEPDIR)/CRC_DabMux-dabInputFile.Tpo -c -o CRC_DabMux-dabInputFile.o `test -f 'dabInputFile.cpp' || echo '$(srcdir)/'`dabInputFile.cpp
+@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/CRC_DabMux-dabInputFile.Tpo $(DEPDIR)/CRC_DabMux-dabInputFile.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='dabInputFile.cpp' object='CRC_DabMux-dabInputFile.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CRC_DabMux_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o CRC_DabMux-dabInputFile.o `test -f 'dabInputFile.cpp' || echo '$(srcdir)/'`dabInputFile.cpp
+
+CRC_DabMux-dabInputFile.obj: dabInputFile.cpp
+@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CRC_DabMux_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT CRC_DabMux-dabInputFile.obj -MD -MP -MF $(DEPDIR)/CRC_DabMux-dabInputFile.Tpo -c -o CRC_DabMux-dabInputFile.obj `if test -f 'dabInputFile.cpp'; then $(CYGPATH_W) 'dabInputFile.cpp'; else $(CYGPATH_W) '$(srcdir)/dabInputFile.cpp'; fi`
+@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/CRC_DabMux-dabInputFile.Tpo $(DEPDIR)/CRC_DabMux-dabInputFile.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='dabInputFile.cpp' object='CRC_DabMux-dabInputFile.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CRC_DabMux_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o CRC_DabMux-dabInputFile.obj `if test -f 'dabInputFile.cpp'; then $(CYGPATH_W) 'dabInputFile.cpp'; else $(CYGPATH_W) '$(srcdir)/dabInputFile.cpp'; fi`
+
+CRC_DabMux-dabInputMpegFifo.o: dabInputMpegFifo.cpp
+@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CRC_DabMux_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT CRC_DabMux-dabInputMpegFifo.o -MD -MP -MF $(DEPDIR)/CRC_DabMux-dabInputMpegFifo.Tpo -c -o CRC_DabMux-dabInputMpegFifo.o `test -f 'dabInputMpegFifo.cpp' || echo '$(srcdir)/'`dabInputMpegFifo.cpp
+@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/CRC_DabMux-dabInputMpegFifo.Tpo $(DEPDIR)/CRC_DabMux-dabInputMpegFifo.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='dabInputMpegFifo.cpp' object='CRC_DabMux-dabInputMpegFifo.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CRC_DabMux_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o CRC_DabMux-dabInputMpegFifo.o `test -f 'dabInputMpegFifo.cpp' || echo '$(srcdir)/'`dabInputMpegFifo.cpp
+
+CRC_DabMux-dabInputMpegFifo.obj: dabInputMpegFifo.cpp
+@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CRC_DabMux_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT CRC_DabMux-dabInputMpegFifo.obj -MD -MP -MF $(DEPDIR)/CRC_DabMux-dabInputMpegFifo.Tpo -c -o CRC_DabMux-dabInputMpegFifo.obj `if test -f 'dabInputMpegFifo.cpp'; then $(CYGPATH_W) 'dabInputMpegFifo.cpp'; else $(CYGPATH_W) '$(srcdir)/dabInputMpegFifo.cpp'; fi`
+@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/CRC_DabMux-dabInputMpegFifo.Tpo $(DEPDIR)/CRC_DabMux-dabInputMpegFifo.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='dabInputMpegFifo.cpp' object='CRC_DabMux-dabInputMpegFifo.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CRC_DabMux_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o CRC_DabMux-dabInputMpegFifo.obj `if test -f 'dabInputMpegFifo.cpp'; then $(CYGPATH_W) 'dabInputMpegFifo.cpp'; else $(CYGPATH_W) '$(srcdir)/dabInputMpegFifo.cpp'; fi`
+
+CRC_DabMux-dabInputMpegFile.o: dabInputMpegFile.cpp
+@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CRC_DabMux_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT CRC_DabMux-dabInputMpegFile.o -MD -MP -MF $(DEPDIR)/CRC_DabMux-dabInputMpegFile.Tpo -c -o CRC_DabMux-dabInputMpegFile.o `test -f 'dabInputMpegFile.cpp' || echo '$(srcdir)/'`dabInputMpegFile.cpp
+@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/CRC_DabMux-dabInputMpegFile.Tpo $(DEPDIR)/CRC_DabMux-dabInputMpegFile.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='dabInputMpegFile.cpp' object='CRC_DabMux-dabInputMpegFile.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CRC_DabMux_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o CRC_DabMux-dabInputMpegFile.o `test -f 'dabInputMpegFile.cpp' || echo '$(srcdir)/'`dabInputMpegFile.cpp
+
+CRC_DabMux-dabInputMpegFile.obj: dabInputMpegFile.cpp
+@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CRC_DabMux_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT CRC_DabMux-dabInputMpegFile.obj -MD -MP -MF $(DEPDIR)/CRC_DabMux-dabInputMpegFile.Tpo -c -o CRC_DabMux-dabInputMpegFile.obj `if test -f 'dabInputMpegFile.cpp'; then $(CYGPATH_W) 'dabInputMpegFile.cpp'; else $(CYGPATH_W) '$(srcdir)/dabInputMpegFile.cpp'; fi`
+@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/CRC_DabMux-dabInputMpegFile.Tpo $(DEPDIR)/CRC_DabMux-dabInputMpegFile.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='dabInputMpegFile.cpp' object='CRC_DabMux-dabInputMpegFile.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CRC_DabMux_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o CRC_DabMux-dabInputMpegFile.obj `if test -f 'dabInputMpegFile.cpp'; then $(CYGPATH_W) 'dabInputMpegFile.cpp'; else $(CYGPATH_W) '$(srcdir)/dabInputMpegFile.cpp'; fi`
+
+CRC_DabMux-dabInputPacketFile.o: dabInputPacketFile.cpp
+@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CRC_DabMux_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT CRC_DabMux-dabInputPacketFile.o -MD -MP -MF $(DEPDIR)/CRC_DabMux-dabInputPacketFile.Tpo -c -o CRC_DabMux-dabInputPacketFile.o `test -f 'dabInputPacketFile.cpp' || echo '$(srcdir)/'`dabInputPacketFile.cpp
+@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/CRC_DabMux-dabInputPacketFile.Tpo $(DEPDIR)/CRC_DabMux-dabInputPacketFile.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='dabInputPacketFile.cpp' object='CRC_DabMux-dabInputPacketFile.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CRC_DabMux_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o CRC_DabMux-dabInputPacketFile.o `test -f 'dabInputPacketFile.cpp' || echo '$(srcdir)/'`dabInputPacketFile.cpp
+
+CRC_DabMux-dabInputPacketFile.obj: dabInputPacketFile.cpp
+@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CRC_DabMux_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT CRC_DabMux-dabInputPacketFile.obj -MD -MP -MF $(DEPDIR)/CRC_DabMux-dabInputPacketFile.Tpo -c -o CRC_DabMux-dabInputPacketFile.obj `if test -f 'dabInputPacketFile.cpp'; then $(CYGPATH_W) 'dabInputPacketFile.cpp'; else $(CYGPATH_W) '$(srcdir)/dabInputPacketFile.cpp'; fi`
+@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/CRC_DabMux-dabInputPacketFile.Tpo $(DEPDIR)/CRC_DabMux-dabInputPacketFile.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='dabInputPacketFile.cpp' object='CRC_DabMux-dabInputPacketFile.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CRC_DabMux_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o CRC_DabMux-dabInputPacketFile.obj `if test -f 'dabInputPacketFile.cpp'; then $(CYGPATH_W) 'dabInputPacketFile.cpp'; else $(CYGPATH_W) '$(srcdir)/dabInputPacketFile.cpp'; fi`
+
+CRC_DabMux-dabInputPrbs.o: dabInputPrbs.cpp
+@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CRC_DabMux_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT CRC_DabMux-dabInputPrbs.o -MD -MP -MF $(DEPDIR)/CRC_DabMux-dabInputPrbs.Tpo -c -o CRC_DabMux-dabInputPrbs.o `test -f 'dabInputPrbs.cpp' || echo '$(srcdir)/'`dabInputPrbs.cpp
+@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/CRC_DabMux-dabInputPrbs.Tpo $(DEPDIR)/CRC_DabMux-dabInputPrbs.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='dabInputPrbs.cpp' object='CRC_DabMux-dabInputPrbs.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CRC_DabMux_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o CRC_DabMux-dabInputPrbs.o `test -f 'dabInputPrbs.cpp' || echo '$(srcdir)/'`dabInputPrbs.cpp
+
+CRC_DabMux-dabInputPrbs.obj: dabInputPrbs.cpp
+@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CRC_DabMux_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT CRC_DabMux-dabInputPrbs.obj -MD -MP -MF $(DEPDIR)/CRC_DabMux-dabInputPrbs.Tpo -c -o CRC_DabMux-dabInputPrbs.obj `if test -f 'dabInputPrbs.cpp'; then $(CYGPATH_W) 'dabInputPrbs.cpp'; else $(CYGPATH_W) '$(srcdir)/dabInputPrbs.cpp'; fi`
+@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/CRC_DabMux-dabInputPrbs.Tpo $(DEPDIR)/CRC_DabMux-dabInputPrbs.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='dabInputPrbs.cpp' object='CRC_DabMux-dabInputPrbs.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CRC_DabMux_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o CRC_DabMux-dabInputPrbs.obj `if test -f 'dabInputPrbs.cpp'; then $(CYGPATH_W) 'dabInputPrbs.cpp'; else $(CYGPATH_W) '$(srcdir)/dabInputPrbs.cpp'; fi`
+
+CRC_DabMux-dabInputRawFile.o: dabInputRawFile.cpp
+@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CRC_DabMux_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT CRC_DabMux-dabInputRawFile.o -MD -MP -MF $(DEPDIR)/CRC_DabMux-dabInputRawFile.Tpo -c -o CRC_DabMux-dabInputRawFile.o `test -f 'dabInputRawFile.cpp' || echo '$(srcdir)/'`dabInputRawFile.cpp
+@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/CRC_DabMux-dabInputRawFile.Tpo $(DEPDIR)/CRC_DabMux-dabInputRawFile.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='dabInputRawFile.cpp' object='CRC_DabMux-dabInputRawFile.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CRC_DabMux_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o CRC_DabMux-dabInputRawFile.o `test -f 'dabInputRawFile.cpp' || echo '$(srcdir)/'`dabInputRawFile.cpp
+
+CRC_DabMux-dabInputRawFile.obj: dabInputRawFile.cpp
+@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CRC_DabMux_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT CRC_DabMux-dabInputRawFile.obj -MD -MP -MF $(DEPDIR)/CRC_DabMux-dabInputRawFile.Tpo -c -o CRC_DabMux-dabInputRawFile.obj `if test -f 'dabInputRawFile.cpp'; then $(CYGPATH_W) 'dabInputRawFile.cpp'; else $(CYGPATH_W) '$(srcdir)/dabInputRawFile.cpp'; fi`
+@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/CRC_DabMux-dabInputRawFile.Tpo $(DEPDIR)/CRC_DabMux-dabInputRawFile.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='dabInputRawFile.cpp' object='CRC_DabMux-dabInputRawFile.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CRC_DabMux_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o CRC_DabMux-dabInputRawFile.obj `if test -f 'dabInputRawFile.cpp'; then $(CYGPATH_W) 'dabInputRawFile.cpp'; else $(CYGPATH_W) '$(srcdir)/dabInputRawFile.cpp'; fi`
+
+CRC_DabMux-dabInputRawFifo.o: dabInputRawFifo.cpp
+@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CRC_DabMux_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT CRC_DabMux-dabInputRawFifo.o -MD -MP -MF $(DEPDIR)/CRC_DabMux-dabInputRawFifo.Tpo -c -o CRC_DabMux-dabInputRawFifo.o `test -f 'dabInputRawFifo.cpp' || echo '$(srcdir)/'`dabInputRawFifo.cpp
+@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/CRC_DabMux-dabInputRawFifo.Tpo $(DEPDIR)/CRC_DabMux-dabInputRawFifo.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='dabInputRawFifo.cpp' object='CRC_DabMux-dabInputRawFifo.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CRC_DabMux_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o CRC_DabMux-dabInputRawFifo.o `test -f 'dabInputRawFifo.cpp' || echo '$(srcdir)/'`dabInputRawFifo.cpp
+
+CRC_DabMux-dabInputRawFifo.obj: dabInputRawFifo.cpp
+@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CRC_DabMux_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT CRC_DabMux-dabInputRawFifo.obj -MD -MP -MF $(DEPDIR)/CRC_DabMux-dabInputRawFifo.Tpo -c -o CRC_DabMux-dabInputRawFifo.obj `if test -f 'dabInputRawFifo.cpp'; then $(CYGPATH_W) 'dabInputRawFifo.cpp'; else $(CYGPATH_W) '$(srcdir)/dabInputRawFifo.cpp'; fi`
+@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/CRC_DabMux-dabInputRawFifo.Tpo $(DEPDIR)/CRC_DabMux-dabInputRawFifo.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='dabInputRawFifo.cpp' object='CRC_DabMux-dabInputRawFifo.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CRC_DabMux_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o CRC_DabMux-dabInputRawFifo.obj `if test -f 'dabInputRawFifo.cpp'; then $(CYGPATH_W) 'dabInputRawFifo.cpp'; else $(CYGPATH_W) '$(srcdir)/dabInputRawFifo.cpp'; fi`
+
+CRC_DabMux-dabInputSlip.o: dabInputSlip.cpp
+@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CRC_DabMux_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT CRC_DabMux-dabInputSlip.o -MD -MP -MF $(DEPDIR)/CRC_DabMux-dabInputSlip.Tpo -c -o CRC_DabMux-dabInputSlip.o `test -f 'dabInputSlip.cpp' || echo '$(srcdir)/'`dabInputSlip.cpp
+@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/CRC_DabMux-dabInputSlip.Tpo $(DEPDIR)/CRC_DabMux-dabInputSlip.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='dabInputSlip.cpp' object='CRC_DabMux-dabInputSlip.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CRC_DabMux_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o CRC_DabMux-dabInputSlip.o `test -f 'dabInputSlip.cpp' || echo '$(srcdir)/'`dabInputSlip.cpp
+
+CRC_DabMux-dabInputSlip.obj: dabInputSlip.cpp
+@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CRC_DabMux_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT CRC_DabMux-dabInputSlip.obj -MD -MP -MF $(DEPDIR)/CRC_DabMux-dabInputSlip.Tpo -c -o CRC_DabMux-dabInputSlip.obj `if test -f 'dabInputSlip.cpp'; then $(CYGPATH_W) 'dabInputSlip.cpp'; else $(CYGPATH_W) '$(srcdir)/dabInputSlip.cpp'; fi`
+@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/CRC_DabMux-dabInputSlip.Tpo $(DEPDIR)/CRC_DabMux-dabInputSlip.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='dabInputSlip.cpp' object='CRC_DabMux-dabInputSlip.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CRC_DabMux_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o CRC_DabMux-dabInputSlip.obj `if test -f 'dabInputSlip.cpp'; then $(CYGPATH_W) 'dabInputSlip.cpp'; else $(CYGPATH_W) '$(srcdir)/dabInputSlip.cpp'; fi`
+
+CRC_DabMux-dabInputTest.o: dabInputTest.cpp
+@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CRC_DabMux_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT CRC_DabMux-dabInputTest.o -MD -MP -MF $(DEPDIR)/CRC_DabMux-dabInputTest.Tpo -c -o CRC_DabMux-dabInputTest.o `test -f 'dabInputTest.cpp' || echo '$(srcdir)/'`dabInputTest.cpp
+@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/CRC_DabMux-dabInputTest.Tpo $(DEPDIR)/CRC_DabMux-dabInputTest.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='dabInputTest.cpp' object='CRC_DabMux-dabInputTest.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CRC_DabMux_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o CRC_DabMux-dabInputTest.o `test -f 'dabInputTest.cpp' || echo '$(srcdir)/'`dabInputTest.cpp
+
+CRC_DabMux-dabInputTest.obj: dabInputTest.cpp
+@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CRC_DabMux_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT CRC_DabMux-dabInputTest.obj -MD -MP -MF $(DEPDIR)/CRC_DabMux-dabInputTest.Tpo -c -o CRC_DabMux-dabInputTest.obj `if test -f 'dabInputTest.cpp'; then $(CYGPATH_W) 'dabInputTest.cpp'; else $(CYGPATH_W) '$(srcdir)/dabInputTest.cpp'; fi`
+@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/CRC_DabMux-dabInputTest.Tpo $(DEPDIR)/CRC_DabMux-dabInputTest.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='dabInputTest.cpp' object='CRC_DabMux-dabInputTest.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CRC_DabMux_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o CRC_DabMux-dabInputTest.obj `if test -f 'dabInputTest.cpp'; then $(CYGPATH_W) 'dabInputTest.cpp'; else $(CYGPATH_W) '$(srcdir)/dabInputTest.cpp'; fi`
+
+CRC_DabMux-dabInputUdp.o: dabInputUdp.cpp
+@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CRC_DabMux_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT CRC_DabMux-dabInputUdp.o -MD -MP -MF $(DEPDIR)/CRC_DabMux-dabInputUdp.Tpo -c -o CRC_DabMux-dabInputUdp.o `test -f 'dabInputUdp.cpp' || echo '$(srcdir)/'`dabInputUdp.cpp
+@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/CRC_DabMux-dabInputUdp.Tpo $(DEPDIR)/CRC_DabMux-dabInputUdp.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='dabInputUdp.cpp' object='CRC_DabMux-dabInputUdp.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CRC_DabMux_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o CRC_DabMux-dabInputUdp.o `test -f 'dabInputUdp.cpp' || echo '$(srcdir)/'`dabInputUdp.cpp
+
+CRC_DabMux-dabInputUdp.obj: dabInputUdp.cpp
+@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CRC_DabMux_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT CRC_DabMux-dabInputUdp.obj -MD -MP -MF $(DEPDIR)/CRC_DabMux-dabInputUdp.Tpo -c -o CRC_DabMux-dabInputUdp.obj `if test -f 'dabInputUdp.cpp'; then $(CYGPATH_W) 'dabInputUdp.cpp'; else $(CYGPATH_W) '$(srcdir)/dabInputUdp.cpp'; fi`
+@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/CRC_DabMux-dabInputUdp.Tpo $(DEPDIR)/CRC_DabMux-dabInputUdp.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='dabInputUdp.cpp' object='CRC_DabMux-dabInputUdp.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CRC_DabMux_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o CRC_DabMux-dabInputUdp.obj `if test -f 'dabInputUdp.cpp'; then $(CYGPATH_W) 'dabInputUdp.cpp'; else $(CYGPATH_W) '$(srcdir)/dabInputUdp.cpp'; fi`
+
+CRC_DabMux-dabOutput.o: dabOutput.cpp
+@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CRC_DabMux_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT CRC_DabMux-dabOutput.o -MD -MP -MF $(DEPDIR)/CRC_DabMux-dabOutput.Tpo -c -o CRC_DabMux-dabOutput.o `test -f 'dabOutput.cpp' || echo '$(srcdir)/'`dabOutput.cpp
+@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/CRC_DabMux-dabOutput.Tpo $(DEPDIR)/CRC_DabMux-dabOutput.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='dabOutput.cpp' object='CRC_DabMux-dabOutput.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CRC_DabMux_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o CRC_DabMux-dabOutput.o `test -f 'dabOutput.cpp' || echo '$(srcdir)/'`dabOutput.cpp
+
+CRC_DabMux-dabOutput.obj: dabOutput.cpp
+@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CRC_DabMux_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT CRC_DabMux-dabOutput.obj -MD -MP -MF $(DEPDIR)/CRC_DabMux-dabOutput.Tpo -c -o CRC_DabMux-dabOutput.obj `if test -f 'dabOutput.cpp'; then $(CYGPATH_W) 'dabOutput.cpp'; else $(CYGPATH_W) '$(srcdir)/dabOutput.cpp'; fi`
+@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/CRC_DabMux-dabOutput.Tpo $(DEPDIR)/CRC_DabMux-dabOutput.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='dabOutput.cpp' object='CRC_DabMux-dabOutput.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CRC_DabMux_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o CRC_DabMux-dabOutput.obj `if test -f 'dabOutput.cpp'; then $(CYGPATH_W) 'dabOutput.cpp'; else $(CYGPATH_W) '$(srcdir)/dabOutput.cpp'; fi`
+
+CRC_DabMux-Eti.o: Eti.cpp
+@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CRC_DabMux_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT CRC_DabMux-Eti.o -MD -MP -MF $(DEPDIR)/CRC_DabMux-Eti.Tpo -c -o CRC_DabMux-Eti.o `test -f 'Eti.cpp' || echo '$(srcdir)/'`Eti.cpp
+@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/CRC_DabMux-Eti.Tpo $(DEPDIR)/CRC_DabMux-Eti.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Eti.cpp' object='CRC_DabMux-Eti.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CRC_DabMux_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o CRC_DabMux-Eti.o `test -f 'Eti.cpp' || echo '$(srcdir)/'`Eti.cpp
+
+CRC_DabMux-Eti.obj: Eti.cpp
+@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CRC_DabMux_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT CRC_DabMux-Eti.obj -MD -MP -MF $(DEPDIR)/CRC_DabMux-Eti.Tpo -c -o CRC_DabMux-Eti.obj `if test -f 'Eti.cpp'; then $(CYGPATH_W) 'Eti.cpp'; else $(CYGPATH_W) '$(srcdir)/Eti.cpp'; fi`
+@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/CRC_DabMux-Eti.Tpo $(DEPDIR)/CRC_DabMux-Eti.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Eti.cpp' object='CRC_DabMux-Eti.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CRC_DabMux_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o CRC_DabMux-Eti.obj `if test -f 'Eti.cpp'; then $(CYGPATH_W) 'Eti.cpp'; else $(CYGPATH_W) '$(srcdir)/Eti.cpp'; fi`
+
+CRC_DabMux-TcpLog.o: TcpLog.cpp
+@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CRC_DabMux_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT CRC_DabMux-TcpLog.o -MD -MP -MF $(DEPDIR)/CRC_DabMux-TcpLog.Tpo -c -o CRC_DabMux-TcpLog.o `test -f 'TcpLog.cpp' || echo '$(srcdir)/'`TcpLog.cpp
+@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/CRC_DabMux-TcpLog.Tpo $(DEPDIR)/CRC_DabMux-TcpLog.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='TcpLog.cpp' object='CRC_DabMux-TcpLog.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CRC_DabMux_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o CRC_DabMux-TcpLog.o `test -f 'TcpLog.cpp' || echo '$(srcdir)/'`TcpLog.cpp
+
+CRC_DabMux-TcpLog.obj: TcpLog.cpp
+@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CRC_DabMux_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT CRC_DabMux-TcpLog.obj -MD -MP -MF $(DEPDIR)/CRC_DabMux-TcpLog.Tpo -c -o CRC_DabMux-TcpLog.obj `if test -f 'TcpLog.cpp'; then $(CYGPATH_W) 'TcpLog.cpp'; else $(CYGPATH_W) '$(srcdir)/TcpLog.cpp'; fi`
+@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/CRC_DabMux-TcpLog.Tpo $(DEPDIR)/CRC_DabMux-TcpLog.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='TcpLog.cpp' object='CRC_DabMux-TcpLog.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CRC_DabMux_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o CRC_DabMux-TcpLog.obj `if test -f 'TcpLog.cpp'; then $(CYGPATH_W) 'TcpLog.cpp'; else $(CYGPATH_W) '$(srcdir)/TcpLog.cpp'; fi`
+
+CRC_DabMux-UdpSocket.o: UdpSocket.cpp
+@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CRC_DabMux_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT CRC_DabMux-UdpSocket.o -MD -MP -MF $(DEPDIR)/CRC_DabMux-UdpSocket.Tpo -c -o CRC_DabMux-UdpSocket.o `test -f 'UdpSocket.cpp' || echo '$(srcdir)/'`UdpSocket.cpp
+@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/CRC_DabMux-UdpSocket.Tpo $(DEPDIR)/CRC_DabMux-UdpSocket.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='UdpSocket.cpp' object='CRC_DabMux-UdpSocket.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CRC_DabMux_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o CRC_DabMux-UdpSocket.o `test -f 'UdpSocket.cpp' || echo '$(srcdir)/'`UdpSocket.cpp
+
+CRC_DabMux-UdpSocket.obj: UdpSocket.cpp
+@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CRC_DabMux_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT CRC_DabMux-UdpSocket.obj -MD -MP -MF $(DEPDIR)/CRC_DabMux-UdpSocket.Tpo -c -o CRC_DabMux-UdpSocket.obj `if test -f 'UdpSocket.cpp'; then $(CYGPATH_W) 'UdpSocket.cpp'; else $(CYGPATH_W) '$(srcdir)/UdpSocket.cpp'; fi`
+@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/CRC_DabMux-UdpSocket.Tpo $(DEPDIR)/CRC_DabMux-UdpSocket.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='UdpSocket.cpp' object='CRC_DabMux-UdpSocket.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CRC_DabMux_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o CRC_DabMux-UdpSocket.obj `if test -f 'UdpSocket.cpp'; then $(CYGPATH_W) 'UdpSocket.cpp'; else $(CYGPATH_W) '$(srcdir)/UdpSocket.cpp'; fi`
+
+CRC_DabMux-InetAddress.o: InetAddress.cpp
+@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CRC_DabMux_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT CRC_DabMux-InetAddress.o -MD -MP -MF $(DEPDIR)/CRC_DabMux-InetAddress.Tpo -c -o CRC_DabMux-InetAddress.o `test -f 'InetAddress.cpp' || echo '$(srcdir)/'`InetAddress.cpp
+@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/CRC_DabMux-InetAddress.Tpo $(DEPDIR)/CRC_DabMux-InetAddress.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='InetAddress.cpp' object='CRC_DabMux-InetAddress.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CRC_DabMux_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o CRC_DabMux-InetAddress.o `test -f 'InetAddress.cpp' || echo '$(srcdir)/'`InetAddress.cpp
+
+CRC_DabMux-InetAddress.obj: InetAddress.cpp
+@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CRC_DabMux_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT CRC_DabMux-InetAddress.obj -MD -MP -MF $(DEPDIR)/CRC_DabMux-InetAddress.Tpo -c -o CRC_DabMux-InetAddress.obj `if test -f 'InetAddress.cpp'; then $(CYGPATH_W) 'InetAddress.cpp'; else $(CYGPATH_W) '$(srcdir)/InetAddress.cpp'; fi`
+@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/CRC_DabMux-InetAddress.Tpo $(DEPDIR)/CRC_DabMux-InetAddress.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='InetAddress.cpp' object='CRC_DabMux-InetAddress.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CRC_DabMux_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o CRC_DabMux-InetAddress.obj `if test -f 'InetAddress.cpp'; then $(CYGPATH_W) 'InetAddress.cpp'; else $(CYGPATH_W) '$(srcdir)/InetAddress.cpp'; fi`
+
+CRC_DabMux-dabUtils.o: dabUtils.cpp
+@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CRC_DabMux_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT CRC_DabMux-dabUtils.o -MD -MP -MF $(DEPDIR)/CRC_DabMux-dabUtils.Tpo -c -o CRC_DabMux-dabUtils.o `test -f 'dabUtils.cpp' || echo '$(srcdir)/'`dabUtils.cpp
+@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/CRC_DabMux-dabUtils.Tpo $(DEPDIR)/CRC_DabMux-dabUtils.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='dabUtils.cpp' object='CRC_DabMux-dabUtils.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CRC_DabMux_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o CRC_DabMux-dabUtils.o `test -f 'dabUtils.cpp' || echo '$(srcdir)/'`dabUtils.cpp
+
+CRC_DabMux-dabUtils.obj: dabUtils.cpp
+@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CRC_DabMux_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT CRC_DabMux-dabUtils.obj -MD -MP -MF $(DEPDIR)/CRC_DabMux-dabUtils.Tpo -c -o CRC_DabMux-dabUtils.obj `if test -f 'dabUtils.cpp'; then $(CYGPATH_W) 'dabUtils.cpp'; else $(CYGPATH_W) '$(srcdir)/dabUtils.cpp'; fi`
+@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/CRC_DabMux-dabUtils.Tpo $(DEPDIR)/CRC_DabMux-dabUtils.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='dabUtils.cpp' object='CRC_DabMux-dabUtils.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CRC_DabMux_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o CRC_DabMux-dabUtils.obj `if test -f 'dabUtils.cpp'; then $(CYGPATH_W) 'dabUtils.cpp'; else $(CYGPATH_W) '$(srcdir)/dabUtils.cpp'; fi`
+
+CRC_DabMux-Dmb.o: Dmb.cpp
+@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CRC_DabMux_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT CRC_DabMux-Dmb.o -MD -MP -MF $(DEPDIR)/CRC_DabMux-Dmb.Tpo -c -o CRC_DabMux-Dmb.o `test -f 'Dmb.cpp' || echo '$(srcdir)/'`Dmb.cpp
+@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/CRC_DabMux-Dmb.Tpo $(DEPDIR)/CRC_DabMux-Dmb.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Dmb.cpp' object='CRC_DabMux-Dmb.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CRC_DabMux_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o CRC_DabMux-Dmb.o `test -f 'Dmb.cpp' || echo '$(srcdir)/'`Dmb.cpp
+
+CRC_DabMux-Dmb.obj: Dmb.cpp
+@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CRC_DabMux_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT CRC_DabMux-Dmb.obj -MD -MP -MF $(DEPDIR)/CRC_DabMux-Dmb.Tpo -c -o CRC_DabMux-Dmb.obj `if test -f 'Dmb.cpp'; then $(CYGPATH_W) 'Dmb.cpp'; else $(CYGPATH_W) '$(srcdir)/Dmb.cpp'; fi`
+@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/CRC_DabMux-Dmb.Tpo $(DEPDIR)/CRC_DabMux-Dmb.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Dmb.cpp' object='CRC_DabMux-Dmb.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CRC_DabMux_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o CRC_DabMux-Dmb.obj `if test -f 'Dmb.cpp'; then $(CYGPATH_W) 'Dmb.cpp'; else $(CYGPATH_W) '$(srcdir)/Dmb.cpp'; fi`
+
+CRC_DabMux-Interleaver.o: Interleaver.cpp
+@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CRC_DabMux_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT CRC_DabMux-Interleaver.o -MD -MP -MF $(DEPDIR)/CRC_DabMux-Interleaver.Tpo -c -o CRC_DabMux-Interleaver.o `test -f 'Interleaver.cpp' || echo '$(srcdir)/'`Interleaver.cpp
+@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/CRC_DabMux-Interleaver.Tpo $(DEPDIR)/CRC_DabMux-Interleaver.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Interleaver.cpp' object='CRC_DabMux-Interleaver.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CRC_DabMux_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o CRC_DabMux-Interleaver.o `test -f 'Interleaver.cpp' || echo '$(srcdir)/'`Interleaver.cpp
+
+CRC_DabMux-Interleaver.obj: Interleaver.cpp
+@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CRC_DabMux_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT CRC_DabMux-Interleaver.obj -MD -MP -MF $(DEPDIR)/CRC_DabMux-Interleaver.Tpo -c -o CRC_DabMux-Interleaver.obj `if test -f 'Interleaver.cpp'; then $(CYGPATH_W) 'Interleaver.cpp'; else $(CYGPATH_W) '$(srcdir)/Interleaver.cpp'; fi`
+@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/CRC_DabMux-Interleaver.Tpo $(DEPDIR)/CRC_DabMux-Interleaver.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Interleaver.cpp' object='CRC_DabMux-Interleaver.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CRC_DabMux_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o CRC_DabMux-Interleaver.obj `if test -f 'Interleaver.cpp'; then $(CYGPATH_W) 'Interleaver.cpp'; else $(CYGPATH_W) '$(srcdir)/Interleaver.cpp'; fi`
+
+CRC_DabMux-ReedSolomon.o: ReedSolomon.cpp
+@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CRC_DabMux_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT CRC_DabMux-ReedSolomon.o -MD -MP -MF $(DEPDIR)/CRC_DabMux-ReedSolomon.Tpo -c -o CRC_DabMux-ReedSolomon.o `test -f 'ReedSolomon.cpp' || echo '$(srcdir)/'`ReedSolomon.cpp
+@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/CRC_DabMux-ReedSolomon.Tpo $(DEPDIR)/CRC_DabMux-ReedSolomon.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='ReedSolomon.cpp' object='CRC_DabMux-ReedSolomon.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CRC_DabMux_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o CRC_DabMux-ReedSolomon.o `test -f 'ReedSolomon.cpp' || echo '$(srcdir)/'`ReedSolomon.cpp
+
+CRC_DabMux-ReedSolomon.obj: ReedSolomon.cpp
+@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CRC_DabMux_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT CRC_DabMux-ReedSolomon.obj -MD -MP -MF $(DEPDIR)/CRC_DabMux-ReedSolomon.Tpo -c -o CRC_DabMux-ReedSolomon.obj `if test -f 'ReedSolomon.cpp'; then $(CYGPATH_W) 'ReedSolomon.cpp'; else $(CYGPATH_W) '$(srcdir)/ReedSolomon.cpp'; fi`
+@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/CRC_DabMux-ReedSolomon.Tpo $(DEPDIR)/CRC_DabMux-ReedSolomon.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='ReedSolomon.cpp' object='CRC_DabMux-ReedSolomon.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CRC_DabMux_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o CRC_DabMux-ReedSolomon.obj `if test -f 'ReedSolomon.cpp'; then $(CYGPATH_W) 'ReedSolomon.cpp'; else $(CYGPATH_W) '$(srcdir)/ReedSolomon.cpp'; fi`
+
+CRC_DabMux-TcpServer.o: TcpServer.cpp
+@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CRC_DabMux_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT CRC_DabMux-TcpServer.o -MD -MP -MF $(DEPDIR)/CRC_DabMux-TcpServer.Tpo -c -o CRC_DabMux-TcpServer.o `test -f 'TcpServer.cpp' || echo '$(srcdir)/'`TcpServer.cpp
+@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/CRC_DabMux-TcpServer.Tpo $(DEPDIR)/CRC_DabMux-TcpServer.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='TcpServer.cpp' object='CRC_DabMux-TcpServer.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CRC_DabMux_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o CRC_DabMux-TcpServer.o `test -f 'TcpServer.cpp' || echo '$(srcdir)/'`TcpServer.cpp
+
+CRC_DabMux-TcpServer.obj: TcpServer.cpp
+@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CRC_DabMux_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT CRC_DabMux-TcpServer.obj -MD -MP -MF $(DEPDIR)/CRC_DabMux-TcpServer.Tpo -c -o CRC_DabMux-TcpServer.obj `if test -f 'TcpServer.cpp'; then $(CYGPATH_W) 'TcpServer.cpp'; else $(CYGPATH_W) '$(srcdir)/TcpServer.cpp'; fi`
+@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/CRC_DabMux-TcpServer.Tpo $(DEPDIR)/CRC_DabMux-TcpServer.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='TcpServer.cpp' object='CRC_DabMux-TcpServer.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CRC_DabMux_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o CRC_DabMux-TcpServer.obj `if test -f 'TcpServer.cpp'; then $(CYGPATH_W) 'TcpServer.cpp'; else $(CYGPATH_W) '$(srcdir)/TcpServer.cpp'; fi`
+
+CRC_DabMux-TcpSocket.o: TcpSocket.cpp
+@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CRC_DabMux_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT CRC_DabMux-TcpSocket.o -MD -MP -MF $(DEPDIR)/CRC_DabMux-TcpSocket.Tpo -c -o CRC_DabMux-TcpSocket.o `test -f 'TcpSocket.cpp' || echo '$(srcdir)/'`TcpSocket.cpp
+@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/CRC_DabMux-TcpSocket.Tpo $(DEPDIR)/CRC_DabMux-TcpSocket.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='TcpSocket.cpp' object='CRC_DabMux-TcpSocket.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CRC_DabMux_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o CRC_DabMux-TcpSocket.o `test -f 'TcpSocket.cpp' || echo '$(srcdir)/'`TcpSocket.cpp
+
+CRC_DabMux-TcpSocket.obj: TcpSocket.cpp
+@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CRC_DabMux_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT CRC_DabMux-TcpSocket.obj -MD -MP -MF $(DEPDIR)/CRC_DabMux-TcpSocket.Tpo -c -o CRC_DabMux-TcpSocket.obj `if test -f 'TcpSocket.cpp'; then $(CYGPATH_W) 'TcpSocket.cpp'; else $(CYGPATH_W) '$(srcdir)/TcpSocket.cpp'; fi`
+@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/CRC_DabMux-TcpSocket.Tpo $(DEPDIR)/CRC_DabMux-TcpSocket.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='TcpSocket.cpp' object='CRC_DabMux-TcpSocket.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CRC_DabMux_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o CRC_DabMux-TcpSocket.obj `if test -f 'TcpSocket.cpp'; then $(CYGPATH_W) 'TcpSocket.cpp'; else $(CYGPATH_W) '$(srcdir)/TcpSocket.cpp'; fi`
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ mkid -fID $$unique
+tags: TAGS
+
+TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ set x; \
+ here=`pwd`; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ shift; \
+ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ if test $$# -gt 0; then \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ "$$@" $$unique; \
+ else \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$unique; \
+ fi; \
+ fi
+ctags: CTAGS
+CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ test -z "$(CTAGS_ARGS)$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && $(am__cd) $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) "$$here"
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ list='$(DISTFILES)'; \
+ dist_files=`for file in $$list; do echo $$file; done | \
+ sed -e "s|^$$srcdirstrip/||;t" \
+ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+ case $$dist_files in \
+ */*) $(MKDIR_P) `echo "$$dist_files" | \
+ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+ sort -u` ;; \
+ esac; \
+ for file in $$dist_files; do \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ if test -d $$d/$$file; then \
+ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test -d "$(distdir)/$$file"; then \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+ else \
+ test -f "$(distdir)/$$file" \
+ || cp -p $$d/$$file "$(distdir)/$$file" \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+check: check-am
+all-am: Makefile $(PROGRAMS)
+installdirs:
+ for dir in "$(DESTDIR)$(bindir)"; do \
+ test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+ done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+ -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-binPROGRAMS clean-generic mostlyclean-am
+
+distclean: distclean-am
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+ distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am: install-binPROGRAMS
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-binPROGRAMS
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \
+ clean-generic ctags distclean distclean-compile \
+ distclean-generic distclean-tags distdir dvi dvi-am html \
+ html-am info info-am install install-am install-binPROGRAMS \
+ install-data install-data-am install-dvi install-dvi-am \
+ install-exec install-exec-am install-html install-html-am \
+ install-info install-info-am install-man install-pdf \
+ install-pdf-am install-ps install-ps-am install-strip \
+ installcheck installcheck-am installdirs maintainer-clean \
+ maintainer-clean-generic mostlyclean mostlyclean-compile \
+ mostlyclean-generic pdf pdf-am ps ps-am tags uninstall \
+ uninstall-am uninstall-binPROGRAMS
+
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/src/PcDebug.h b/src/PcDebug.h
new file mode 100644
index 0000000..4e966d3
--- /dev/null
+++ b/src/PcDebug.h
@@ -0,0 +1,76 @@
+/*
+ Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 Her Majesty the
+ Queen in Right of Canada (Communications Research Center Canada)
+ */
+/*
+ This file is part of CRC-DabMux.
+
+ CRC-DabMux is free software: you can 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.
+
+ CRC-DabMux is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with CRC-DabMux. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef PC_DEBUG_
+#define PC_DEBUG_
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#include <stdio.h>
+
+#define LOG stderr
+
+#if !defined(_WIN32) || defined(__MINGW32__)
+# ifndef PDEBUG
+# ifdef DEBUG
+# define PDEBUG(fmt, args...) fprintf (LOG, fmt , ## args)
+# else
+# define PDEBUG(fmt, args...)
+# endif
+# endif
+# ifdef DEBUG
+# define PDEBUG_VERBOSE(level, verbosity, fmt, args...) if (level <= verbosity) { fprintf(LOG, fmt, ## args); fflush(LOG); }
+# define PDEBUG0_VERBOSE(level, verbosity, txt) if (level <= verbosity) { fprintf(LOG, txt); fflush(LOG); }
+# define PDEBUG1_VERBOSE(level, verbosity, txt, arg0) if (level <= verbosity) { fprintf(LOG, txt, arg0); fflush(LOG); }
+# define PDEBUG2_VERBOSE(level, verbosity, txt, arg0, arg1) if (level <= verbosity) { fprintf(LOG, txt, arg0, arg1); fflush(LOG); }
+# define PDEBUG3_VERBOSE(level, verbosity, txt, arg0, arg1, arg2) if (level <= verbosity) { fprintf(LOG, txt, arg0, arg1, arg2); fflush(LOG); }
+# define PDEBUG4_VERBOSE(level, verbosity, txt, arg0, arg1, arg2, arg3) if (level <= verbosity) { fprintf(LOG, txt, arg0, arg1, arg2, arg3); fflush(LOG); }
+# else
+# define PDEBUG_VERBOSE(level, verbosity, fmt, args...)
+# define PDEBUG0_VERBOSE(level, verbosity, txt)
+# define PDEBUG1_VERBOSE(level, verbosity, txt, arg0)
+# define PDEBUG2_VERBOSE(level, verbosity, txt, arg0, arg1)
+# define PDEBUG3_VERBOSE(level, verbosity, txt, arg0, arg1, arg2)
+# define PDEBUG4_VERBOSE(level, verbosity, txt, arg0, arg1, arg2, arg3)
+# endif // DEBUG
+#else // _WIN32
+# ifdef _DEBUG
+# define PDEBUG
+# define PDEBUG_VERBOSE
+# define PDEBUG0_VERBOSE(level, verbosity, txt) if (level <= verbosity) { fprintf(LOG, txt); fflush(LOG); }
+# define PDEBUG1_VERBOSE(level, verbosity, txt, arg0) if (level <= verbosity) { fprintf(LOG, txt, arg0); fflush(LOG); }
+# define PDEBUG2_VERBOSE(level, verbosity, txt, arg0, arg1) if (level <= verbosity) { fprintf(LOG, txt, arg0, arg1); fflush(LOG); }
+# define PDEBUG3_VERBOSE(level, verbosity, txt, arg0, arg1, arg2) if (level <= verbosity) { fprintf(LOG, txt, arg0, arg1, arg2); fflush(LOG); }
+# define PDEBUG4_VERBOSE(level, verbosity, txt, arg0, arg1, arg2, arg3) if (level <= verbosity) { fprintf(LOG, txt, arg0, arg1, arg2, arg3); fflush(LOG); }
+# else
+# define PDEBUG
+# define PDEBUG_VERBOSE
+# define PDEBUG0_VERBOSE(level, verbosity, txt)
+# define PDEBUG1_VERBOSE(level, verbosity, txt, arg0)
+# define PDEBUG2_VERBOSE(level, verbosity, txt, arg0, arg1)
+# define PDEBUG3_VERBOSE(level, verbosity, txt, arg0, arg1, arg2)
+# define PDEBUG4_VERBOSE(level, verbosity, txt, arg0, arg1, arg2, arg3)
+# endif
+#endif
+
+#endif // PC_DEBUG_
diff --git a/src/ReedSolomon.cpp b/src/ReedSolomon.cpp
new file mode 100644
index 0000000..31d5021
--- /dev/null
+++ b/src/ReedSolomon.cpp
@@ -0,0 +1,105 @@
+/*
+ Copyright (C) 2005, 2006, 2007, 2008, 2009 Her Majesty the Queen in Right
+ of Canada (Communications Research Center Canada)
+ */
+/*
+ This file is part of CRC-DabMux.
+
+ CRC-DabMux is free software: you can 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.
+
+ CRC-DabMux is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with CRC-DabMux. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "ReedSolomon.h"
+#include <stdio.h> // For galois.h ...
+#include <string.h> // For memcpy
+
+extern "C" {
+#include <fec.h>
+}
+#include <assert.h>
+#include <stdlib.h>
+
+#define SYMSIZE 8
+
+
+ReedSolomon::ReedSolomon(int N, int K, bool reverse, int gfpoly, int firstRoot, int primElem)
+{
+ setReverse(reverse);
+
+ myN = N;
+ myK = K;
+
+ int symsize = SYMSIZE;
+ int nroots = N - K;
+ int pad = ((1 << symsize) - 1) - N;
+
+ rsData = init_rs_char(symsize, gfpoly, firstRoot, primElem, nroots, pad);
+
+ if (rsData == NULL) {
+ fprintf(stderr, "ERROR: Invalid Reed Solomon parameters!\n");
+ abort();
+ }
+}
+
+
+ReedSolomon::~ReedSolomon()
+{
+ free_rs_char(rsData);
+}
+
+
+void ReedSolomon::setReverse(bool state)
+{
+ reverse = state;
+}
+
+
+int ReedSolomon::encode(void* data, void* fec, unsigned long size)
+{
+ unsigned char* input = reinterpret_cast<unsigned char*>(data);
+ unsigned char* output = reinterpret_cast<unsigned char*>(fec);
+ int ret = 0;
+
+ if (reverse) {
+ unsigned char* buffer = new unsigned char[myN];
+ memcpy(buffer, input, myK);
+ memcpy(&buffer[myK], output, myN - myK);
+
+ ret = decode_rs_char(rsData, buffer, NULL, 0);
+ if ((ret != 0) && (ret != -1)) {
+ memcpy(input, buffer, myK);
+ memcpy(output, &buffer[myK], myN - myK);
+ }
+
+ delete[] buffer;
+ } else {
+ encode_rs_char(rsData, input, output);
+ }
+
+ return ret;
+}
+
+
+int ReedSolomon::encode(void* data, unsigned long size)
+{
+ unsigned char* input = reinterpret_cast<unsigned char*>(data);
+ int ret = 0;
+
+ if (reverse) {
+ ret = decode_rs_char(rsData, input, NULL, 0);
+ } else {
+ encode_rs_char(rsData, input, &input[188]);
+ }
+
+ return ret;
+}
diff --git a/src/ReedSolomon.h b/src/ReedSolomon.h
new file mode 100644
index 0000000..2a94542
--- /dev/null
+++ b/src/ReedSolomon.h
@@ -0,0 +1,52 @@
+/*
+ Copyright (C) 2005, 2006, 2007, 2008, 2009 Her Majesty the Queen in Right
+ of Canada (Communications Research Center Canada)
+ */
+/*
+ This file is part of CRC-DabMux.
+
+ CRC-DabMux is free software: you can 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.
+
+ CRC-DabMux is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with CRC-DabMux. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef _REEDSOLOMON
+#define _REEDSOLOMON
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+
+class ReedSolomon
+{
+public:
+ ReedSolomon(int N, int K, bool reverse = false,
+ int gfpoly = 0x11d, int firstRoot = 0, int primElem = 1);
+ ReedSolomon(const ReedSolomon& clone);
+ virtual ~ReedSolomon();
+
+ void setReverse(bool state);
+ int encode(void* data, void* fec, unsigned long size);
+ int encode(void* data, unsigned long size);
+
+protected:
+ int myN;
+ int myK;
+
+private:
+ void* rsData;
+ bool reverse;
+};
+
+
+#endif // _REEDSOLOMON
diff --git a/src/TcpLog.cpp b/src/TcpLog.cpp
new file mode 100644
index 0000000..7161c92
--- /dev/null
+++ b/src/TcpLog.cpp
@@ -0,0 +1,330 @@
+/*
+ Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Her Majesty the Queen in
+ Right of Canada (Communications Research Center Canada)
+ */
+/*
+ This file is part of CRC-DabMux.
+
+ CRC-DabMux is free software: you can 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.
+
+ CRC-DabMux is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with CRC-DabMux. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "TcpLog.h"
+#include "InetAddress.h"
+#include <string.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <stdarg.h>
+
+#ifdef _WIN32
+# include <io.h>
+#
+# define vsnprintf _vsnprintf
+# define MSG_NOSIGNAL 0
+# define socklen_t int
+#else
+# include <sys/socket.h>
+# include <netinet/in.h>
+# include <arpa/inet.h>
+# include <unistd.h>
+#endif
+
+#include <sstream>
+
+
+const int TcpLog::EMERG = 0; // system is unusable
+const int TcpLog::ALERT = 1; // action must be taken immediately
+const int TcpLog::CRIT = 2; // critical conditions
+const int TcpLog::ERR = 3; // error conditions
+const int TcpLog::WARNING = 4; // warning conditions
+const int TcpLog::NOTICE = 5; // normal but significant condition
+const int TcpLog::INFO = 6; // informational
+const int TcpLog::DBG = 7; // debug-level messages
+
+
+TcpLog::TcpLog() : listenPort(0), client(-1), name(NULL), serverThread(0), running(false)
+{
+ buffer = (char*)malloc(512);
+ bufferSize = 512;
+ headers = (char**)malloc(sizeof(char**));
+ headers[0] = NULL;
+}
+
+
+TcpLog::~TcpLog()
+{
+ if (running) {
+ running = false;
+ }
+ if (client != -1) {
+ ::close(client);
+ }
+ if (headers != NULL) {
+ for (int count = 0; headers[count] != NULL; ++count) {
+ free(headers[count]);
+ }
+ free(headers);
+ }
+}
+
+
+//TcpLog::TcpLog(int port);
+
+
+void TcpLog::open(const char *ident, const int option, const int port)
+{
+ listenPort = port;
+
+ if (name != NULL) {
+ free(name);
+ }
+ name = strdup(ident);
+
+ if (running) {
+ running = false;
+#ifdef WIN32
+ DWORD status;
+ for (int i = 0; i < 5; ++i) {
+ if (GetExitCodeThread(serverThread, &status)) {
+ break;
+ }
+ Sleep(100);
+ }
+ TerminateThread(serverThread, 1);
+#else
+ pthread_join(serverThread, NULL);
+#endif
+ }
+ running = true;
+#ifdef _WIN32
+ serverThread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)listen, this, 0, NULL);
+ if (serverThread == NULL) {
+ fprintf(stderr, "Can't create TCP listen thread\n");
+ }
+#else
+ pthread_create(&serverThread, NULL, (void*(*)(void*))listen, this);
+#endif
+}
+
+
+void TcpLog::printHeader(const int priority, const char *format, ...)
+{
+ static char last = '\n';
+ std::string beginning;
+ std::string message;
+ int ret;
+
+
+ beginning = "<";
+ beginning += '0' + (priority % 10);
+ beginning += "> ";
+
+ va_list argp;
+ va_start(argp, format);
+ for (ret = vsnprintf(buffer, bufferSize, format, argp);
+ ret >= bufferSize || ret == -1;
+ ret = vsprintf(buffer, format, argp)) {
+ if (ret == -1) {
+ buffer = (char*)realloc(buffer, bufferSize * 2);
+ bufferSize *= 2;
+ } else {
+ buffer = (char*)realloc(buffer, ret + 1);
+ bufferSize = ret + 1;
+ }
+ }
+ va_end(argp);
+
+ if (last == '\n') {
+ message += beginning;
+ }
+ message += buffer;
+
+ last = buffer[ret - 1];
+
+ for (unsigned long pos = message.find('\n');
+ pos != std::string::npos && ++pos != message.size();
+ pos = message.find('\n', pos)) {
+ message.insert(pos, beginning);
+ }
+
+ fprintf(stderr, message.c_str());
+ if (client != -1) {
+ if (write(client, message.c_str(), message.size())
+ != (int)message.size()) {
+ fprintf(stderr, "<6> Client closed\n");
+ ::close(client);
+ client = -1;
+ }
+ }
+
+ int count = 0;
+ while (headers[count++] != NULL) {
+ }
+ headers = (char**)realloc(headers, sizeof(char**) * (count + 1));
+ headers[count - 1] = strdup(message.c_str());
+ headers[count] = NULL;
+}
+
+
+void TcpLog::print(const int priority, const char *format, ...)
+{
+ static char last = '\n';
+ std::string beginning;
+ std::string message;
+ int ret;
+
+
+ beginning = "<";
+ beginning += '0' + (priority % 10);
+ beginning += "> ";
+
+ va_list argp;
+ va_start(argp, format);
+ for (ret = vsnprintf(buffer, bufferSize, format, argp);
+ ret >= bufferSize || ret == -1;
+ ret = vsprintf(buffer, format, argp)) {
+ if (ret == -1) {
+ buffer = (char*)realloc(buffer, bufferSize * 2);
+ bufferSize *= 2;
+ } else {
+ buffer = (char*)realloc(buffer, ret + 1);
+ bufferSize = ret + 1;
+ }
+ }
+ va_end(argp);
+
+ if (last == '\n') {
+ message += beginning;
+ }
+ message += buffer;
+
+ last = buffer[ret - 1];
+
+ for (unsigned long pos = message.find('\n');
+ pos != std::string::npos && ++pos != message.size();
+ pos = message.find('\n', pos)) {
+ message.insert(pos, beginning);
+ }
+
+ fprintf(stderr, message.c_str());
+ if (client != -1) {
+ if (send(client, message.c_str(), message.size(), MSG_NOSIGNAL)
+ != (int)message.size()) {
+ fprintf(stderr, "<6> Client closed\n");
+ ::close(client);
+ client = -1;
+ }
+ }
+}
+
+
+void TcpLog::close(void)
+{
+}
+
+
+void* TcpLog::listen(TcpLog* obj)
+{
+ int server;
+ struct sockaddr_in server_addr;
+ struct sockaddr_in client_addr;
+ socklen_t addrlen = sizeof(client_addr);
+
+#ifdef _WIN32
+ WSADATA wsaData;
+ WORD wVersionRequested = wVersionRequested = MAKEWORD( 2, 2 );
+
+ int res = WSAStartup( wVersionRequested, &wsaData );
+ if (res) {
+ fprintf(stderr, "Can't initialize winsock\n");
+ ExitThread(1);
+ }
+#endif
+ server = socket(PF_INET, SOCK_STREAM, 0);
+ if (server == INVALID_SOCKET) {
+#ifdef _WIN32
+ fprintf(stderr, "Can't create socket\n");
+ ExitThread(1);
+#else
+ perror("Can't create socket");
+ pthread_exit(NULL);
+#endif
+ }
+
+ int reuse = 1;
+ if (setsockopt(server, SOL_SOCKET, SO_REUSEADDR, (char*)&reuse, sizeof(reuse))
+ == -1) {
+ perror("Can't set socket reusable");
+ }
+
+ server_addr.sin_family = AF_INET;
+ server_addr.sin_port = htons(obj->listenPort);
+ server_addr.sin_addr.s_addr = INADDR_ANY;
+
+ if (bind(server, (struct sockaddr*)&server_addr, sizeof(server_addr))
+ == -1) {
+ perror("Can't bind socket");
+ fprintf(stderr, " port: %i\n", obj->listenPort);
+#ifdef _WIN32
+ ExitThread(1);
+#else
+ pthread_exit(NULL);
+#endif
+ }
+
+ if (::listen(server, 1) == -1) {
+ perror("Can't listen on socket");
+#ifdef _WIN32
+ ExitThread(1);
+#else
+ pthread_exit(NULL);
+#endif
+ }
+
+ while (obj->running) {
+ int client = accept(server, (struct sockaddr*)&client_addr, &addrlen);
+ if (client == INVALID_SOCKET) {
+#ifdef _WIN32
+ if (WSAGetLastError() != WSAEINTR) {
+ setInetError("Can't accept client");
+ fprintf(stderr, "%s: %s\n", inetErrDesc, inetErrMsg);
+ ExitThread(1);
+ }
+#else
+ perror("Can't accept client");
+ pthread_exit(NULL);
+#endif
+ }
+ obj->print(INFO, "%s:%d connected\n",
+ inet_ntoa(client_addr.sin_addr), ntohs(client_addr.sin_port));
+ if (obj->client != -1) {
+ ::close(obj->client);
+ }
+ obj->client = client;
+ for (int i = 0; obj->headers[i] != NULL; ++i) {
+ send(client, obj->headers[i], strlen(obj->headers[i]), MSG_NOSIGNAL);
+ }
+ }
+ if (obj->client != -1) {
+ ::close(obj->client);
+ obj->client = -1;
+ }
+ ::close(server);
+
+#ifdef _WIN32
+ ExitThread(1);
+#else
+ pthread_exit(NULL);
+#endif
+ return NULL;
+}
diff --git a/src/TcpLog.h b/src/TcpLog.h
new file mode 100644
index 0000000..c9abd70
--- /dev/null
+++ b/src/TcpLog.h
@@ -0,0 +1,69 @@
+/*
+ Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Her Majesty the Queen in
+ Right of Canada (Communications Research Center Canada)
+ */
+/*
+ This file is part of CRC-DabMux.
+
+ CRC-DabMux is free software: you can 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.
+
+ CRC-DabMux is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with CRC-DabMux. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef _TCP_LOG
+#define _TCP_LOG
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#ifndef _WIN32
+# include <pthread.h>
+#else
+# include <winsock2.h>
+# define pthread_t HANDLE
+#endif
+
+class TcpLog {
+public:
+ TcpLog();
+ ~TcpLog();
+
+ void open(const char *ident, const int option, const int port);
+ void printHeader(const int priority, const char *format, ...);
+ void print(const int priority, const char *format, ...);
+ void close(void);
+
+ const static int EMERG; // system is unusable
+ const static int ALERT; // action must be taken immediately
+ const static int CRIT; // critical conditions
+ const static int ERR; // error conditions
+ const static int WARNING; // warning conditions
+ const static int NOTICE; // normal but significant condition
+ const static int INFO; // informational
+ const static int DBG; // debug-level messages
+
+private:
+ static void* listen(TcpLog* obj);
+
+ int listenPort;
+ int client;
+ char* name;
+ pthread_t serverThread;
+ bool running;
+ char* buffer;
+ int bufferSize;
+ char** headers;
+};
+
+
+#endif // _TCP_LOG
diff --git a/src/TcpServer.cpp b/src/TcpServer.cpp
new file mode 100644
index 0000000..00a50e9
--- /dev/null
+++ b/src/TcpServer.cpp
@@ -0,0 +1,243 @@
+/*
+ Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Her Majesty the Queen in
+ Right of Canada (Communications Research Center Canada)
+ */
+/*
+ This file is part of CRC-DabMux.
+
+ CRC-DabMux is free software: you can 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.
+
+ CRC-DabMux is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with CRC-DabMux. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "TcpServer.h"
+#include <iostream>
+#include <stdio.h>
+#include <errno.h>
+
+#ifdef _WIN32
+#else
+# include <sys/socket.h>
+#endif
+
+#ifdef TRACE_ON
+# ifndef TRACE_CLASS
+# define TRACE_CLASS(class, func) cout <<"-" <<(class) <<"\t(" <<this <<")::" <<(func) <<endl
+# define TRACE_STATIC(class, func) cout <<"-" <<(class) <<"\t(static)::" <<(func) <<endl
+# endif
+#else
+# ifndef TRACE_CLASS
+# define TRACE_CLASS(class, func)
+# define TRACE_STATIC(class, func)
+# endif
+#endif
+
+
+/// Must be call once before doing any operation on sockets
+int TcpServer::init()
+{
+#ifdef _WIN32
+ WSADATA wsaData;
+ WORD wVersionRequested = wVersionRequested = MAKEWORD( 2, 2 );
+
+ int res = WSAStartup( wVersionRequested, &wsaData );
+ if (res) {
+ setInetError("Can't initialize winsock");
+ return -1;
+ }
+#endif
+ return 0;
+}
+
+
+/// Must be call once before leaving application
+int TcpServer::clean()
+{
+#ifdef _WIN32
+ int res = WSACleanup();
+ if (res) {
+ setInetError("Can't initialize winsock");
+ return -1;
+ }
+#endif
+ return 0;
+}
+
+
+/**
+ * Two step constructor. Create must be called prior to use this
+ * socket.
+ */
+TcpServer::TcpServer() :
+ listenSocket(INVALID_SOCKET)
+{
+ TRACE_CLASS("TcpServer", "TcpServer()");
+}
+
+
+/**
+ * One step constructor.
+ * @param port The port number on which the socket will be bind
+ * @param name The IP address on which the socket will be bind.
+ * It is used to bind the socket on a specific interface if
+ * the computer have many NICs.
+ */
+TcpServer::TcpServer(int port, const char *name) :
+ listenSocket(INVALID_SOCKET)
+{
+ TRACE_CLASS("TcpServer", "TcpServer(int, char*)");
+ create(port, name);
+}
+
+
+/**
+ * Two step initializer. This function must be called after the constructor
+ * without argument as been called.
+ * @param port The port number on which the socket will be bind
+ * @param name The IP address on which the socket will be bind.
+ * It is used to bind the socket on a specific interface if
+ * the computer have many NICs.
+ * @return 0 if ok
+ * -1 if error
+ */
+int TcpServer::create(int port, const char *name)
+{
+ TRACE_CLASS("TcpServer", "create(int, char*)");
+ if (listenSocket != INVALID_SOCKET)
+ closesocket(listenSocket);
+ address.setAddress(name);
+ address.setPort(port);
+ if ((listenSocket = socket(PF_INET, SOCK_STREAM, 0)) == INVALID_SOCKET) {
+ setInetError("Can't create socket");
+ return -1;
+ }
+ reuseopt_t reuse = 1;
+ if (setsockopt(listenSocket, SOL_SOCKET, SO_REUSEADDR, &reuse, sizeof(reuse))
+ == SOCKET_ERROR) {
+ setInetError("Can't reuse address");
+ return -1;
+ }
+ if (bind(listenSocket, address.getAddress(), sizeof(sockaddr_in)) == SOCKET_ERROR) {
+ setInetError("Can't bind socket");
+ closesocket(listenSocket);
+ listenSocket = INVALID_SOCKET;
+ return -1;
+ }
+ return 0;
+}
+
+
+/**
+ * Close the underlying socket.
+ * @return 0 if ok
+ * -1 if error
+ */
+int TcpServer::close()
+{
+ TRACE_CLASS("TcpServer", "close()");
+ if (listenSocket != INVALID_SOCKET) {
+ int res = closesocket(listenSocket);
+ if (res != 0) {
+ setInetError("Can't close socket");
+ return -1;
+ }
+ listenSocket = INVALID_SOCKET;
+ }
+ return 0;
+}
+
+
+/// Destructor
+TcpServer::~TcpServer()
+{
+ TRACE_CLASS("TcpServer", "~TcpServer()");
+ close();
+}
+
+
+int TcpServer::listen()
+{
+ TRACE_CLASS("TcpServer", "listen()");
+ if (::listen(listenSocket, 1) == SOCKET_ERROR) {
+ setInetError("Can't listen on socket");
+ return -1;
+ }
+ return 0;
+}
+
+
+TcpSocket* TcpServer::accept()
+{
+ SOCKET socket;
+ TcpSocket* client = NULL;
+ InetAddress addr;
+ socklen_t addrLen = sizeof(sockaddr_in);
+
+ socket = ::accept(listenSocket, addr.getAddress(), &addrLen);
+ if (socket == SOCKET_ERROR) {
+ setInetError("Can't accept connection on socket");
+ } else {
+ client = new TcpSocket();
+ client->setSocket(socket, addr);
+ }
+ return client;
+}
+
+/*
+WSAEINTR
+WSAEBADF
+WSAEACCES
+WSAEFAULT
+WSAEINVAL
+WSAEMFILE
+WSAEWOULDBLOCK
+WSAEINPROGRESS
+WSAEALREADY
+WSAENOTSOCK
+WSAEDESTADDRREQ
+WSAEMSGSIZE
+WSAEPROTOTYPE
+WSAENOPROTOOPT
+WSAEPROTONOSUPPORT
+WSAESOCKTNOSUPPORT
+WSAEOPNOTSUPP
+WSAEPFNOSUPPORT
+WSAEAFNOSUPPORT
+WSAEADDRINUSE
+WSAEADDRNOTAVAIL
+WSAENETDOWN
+WSAENETUNREACH
+WSAENETRESET
+WSAECONNABORTED
+WSAECONNRESET
+WSAENOBUFS
+WSAEISCONN
+WSAENOTCONN
+WSAESHUTDOWN
+WSAETOOMANYREFS
+WSAETIMEDOUT
+WSAECONNREFUSED
+WSAELOOP
+WSAENAMETOOLONG
+WSAEHOSTDOWN
+WSAEHOSTUNREACH
+WSAENOTEMPTY
+WSAEPROCLIM
+WSAEUSERS
+WSAEDQUOT
+WSAESTALE
+WSAEREMOTE
+WSAEDISCON
+WSASYSNOTREADY
+WSAVERNOTSUPPORTED
+WSANOTINITIALISED
+*/
diff --git a/src/TcpServer.h b/src/TcpServer.h
new file mode 100644
index 0000000..c4d9a4d
--- /dev/null
+++ b/src/TcpServer.h
@@ -0,0 +1,84 @@
+/*
+ Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Her Majesty the Queen in
+ Right of Canada (Communications Research Center Canada)
+ */
+/*
+ This file is part of CRC-DabMux.
+
+ CRC-DabMux is free software: you can 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.
+
+ CRC-DabMux is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with CRC-DabMux. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef _TCPSERVER
+#define _TCPSERVER
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#include "InetAddress.h"
+#ifdef _WIN32
+# include <winsock.h>
+# define socklen_t int
+# define reuseopt_t char
+#else
+# include <sys/socket.h>
+# include <netinet/in.h>
+# include <unistd.h>
+# include <netdb.h>
+# include <arpa/inet.h>
+# include <pthread.h>
+# define SOCKET int
+# define INVALID_SOCKET -1
+# define SOCKET_ERROR -1
+# define reuseopt_t int
+#endif
+//#define INVALID_PORT -1
+
+#include <iostream>
+#include "TcpSocket.h"
+//#include "SocketSelector.h"
+
+/**
+ * This class represents a socket for sending and receiving UDP packets.
+ *
+ * A UDP socket is the sending or receiving point for a packet delivery service.
+ * Each packet sent or received on a datagram socket is individually
+ * addressed and routed. Multiple packets sent from one machine to another may
+ * be routed differently, and may arrive in any order.
+ * @author Pascal Charest pascal.charest@crc.ca
+ */
+class TcpServer {
+ friend class SocketSelector;
+public:
+ TcpServer();
+ TcpServer(int port, const char *name = NULL);
+ ~TcpServer();
+
+ static int init();
+ static int clean();
+
+ int create(int port, const char *name = NULL);
+ int close();
+ int listen();
+ TcpSocket* accept();
+
+
+ protected:
+ /// The address on which the socket is binded.
+ InetAddress address;
+ /// The low-level socket used by system functions.
+ SOCKET listenSocket;
+};
+
+#endif // _TCPSERVER
diff --git a/src/TcpSocket.cpp b/src/TcpSocket.cpp
new file mode 100644
index 0000000..723d06b
--- /dev/null
+++ b/src/TcpSocket.cpp
@@ -0,0 +1,366 @@
+/*
+ Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Her Majesty the Queen in
+ Right of Canada (Communications Research Center Canada)
+ */
+/*
+ This file is part of CRC-DabMux.
+
+ CRC-DabMux is free software: you can 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.
+
+ CRC-DabMux is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with CRC-DabMux. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "TcpSocket.h"
+#include <iostream>
+#include <stdio.h>
+#include <errno.h>
+#include <string.h>
+#include <signal.h>
+
+#ifdef _WIN32
+#else
+# include <unistd.h>
+#endif
+
+#ifdef TRACE_ON
+# ifndef TRACE_CLASS
+# define TRACE_CLASS(class, func) cout <<"-" <<(class) <<"\t(" <<this <<")::" <<(func) <<endl
+# define TRACE_STATIC(class, func) cout <<"-" <<(class) <<"\t(static)::" <<(func) <<endl
+# endif
+#else
+# ifndef TRACE_CLASS
+# define TRACE_CLASS(class, func)
+# define TRACE_STATIC(class, func)
+# endif
+#endif
+
+
+/// Must be call once before doing any operation on sockets
+int TcpSocket::init()
+{
+#ifdef _WIN32
+ WSADATA wsaData;
+ WORD wVersionRequested = wVersionRequested = MAKEWORD( 2, 2 );
+
+ int res = WSAStartup( wVersionRequested, &wsaData );
+ if (res) {
+ setInetError("Can't initialize winsock");
+ return -1;
+ }
+#endif
+ return 0;
+}
+
+
+/// Must be call once before leaving application
+int TcpSocket::clean()
+{
+#ifdef _WIN32
+ int res = WSACleanup();
+ if (res) {
+ setInetError("Can't initialize winsock");
+ return -1;
+ }
+#endif
+ return 0;
+}
+
+
+/**
+ * Two step constructor. Create must be called prior to use this
+ * socket.
+ */
+TcpSocket::TcpSocket() :
+ listenSocket(INVALID_SOCKET)
+{
+ TRACE_CLASS("TcpSocket", "TcpSocket()");
+}
+
+
+/**
+ * One step constructor.
+ * @param port The port number on which the socket will be bind
+ * @param name The IP address on which the socket will be bind.
+ * It is used to bind the socket on a specific interface if
+ * the computer have many NICs.
+ */
+TcpSocket::TcpSocket(int port, char *name) :
+ listenSocket(INVALID_SOCKET)
+{
+ TRACE_CLASS("TcpSocket", "TcpSocket(int, char*)");
+ create(port, name);
+}
+
+
+/**
+ * Close the underlying socket.
+ * @return 0 if ok
+ * -1 if error
+ */
+int TcpSocket::close()
+{
+ TRACE_CLASS("TcpSocket", "close()");
+ if (listenSocket != INVALID_SOCKET) {
+ int res = closesocket(listenSocket);
+ if (res != 0) {
+ setInetError("Can't close socket");
+ return -1;
+ }
+ listenSocket = INVALID_SOCKET;
+ }
+ return 0;
+}
+
+
+/**
+ * Two step initializer. This function must be called after the constructor
+ * without argument as been called.
+ * @param port The port number on which the socket will be bind
+ * @param name The IP address on which the socket will be bind.
+ * It is used to bind the socket on a specific interface if
+ * the computer have many NICs.
+ * @return 0 if ok
+ * -1 if error
+ */
+int TcpSocket::create(int port, char *name)
+{
+ TRACE_CLASS("TcpSocket", "create(int, char*)");
+ if (listenSocket != INVALID_SOCKET)
+ closesocket(listenSocket);
+ address.setAddress(name);
+ address.setPort(port);
+ if ((listenSocket = socket(PF_INET, SOCK_STREAM, 0)) == INVALID_SOCKET) {
+ setInetError("Can't create socket");
+ return -1;
+ }
+ reuseopt_t reuse = 1;
+ if (setsockopt(listenSocket, SOL_SOCKET, SO_REUSEADDR, &reuse, sizeof(reuse))
+ == SOCKET_ERROR) {
+ setInetError("Can't reuse address");
+ return -1;
+ }
+ if (bind(listenSocket, address.getAddress(), sizeof(sockaddr_in)) == SOCKET_ERROR) {
+ setInetError("Can't bind socket");
+ closesocket(listenSocket);
+ listenSocket = INVALID_SOCKET;
+ return -1;
+ }
+ return 0;
+}
+
+
+/// Destructor
+TcpSocket::~TcpSocket() {
+ TRACE_CLASS("TcpSocket", "~TcpSocket()");
+ close();
+}
+
+
+/**
+ * Receive an telnet packet, i.e a TCP stream ending with carriage return.
+ * @param data The buffer that will receive data.
+ * @param size The buffer size.
+ * @return > 0 if ok, -1 (SOCKET_ERROR) if error
+ */
+int TcpSocket::telnetRead(void* data, int size)
+{
+ TRACE_CLASS("TcpSocket", "read(void*, size)");
+ int ret;
+
+ printf("selectCall\n");
+
+ printf("readread 1\n");
+ char *line=GetLine(listenSocket);
+ ret=strlen(line);
+ printf("readread 2\n");
+ if (ret <= size)
+ {
+ strcpy((char*)data, line);
+ }
+ else
+ {
+// size_t n = size;
+ strcpy((char*)data, line);
+ ret = size;
+ }
+ printf("TELNET READ returned %d\n", ret);
+ return ret;
+}
+
+/**
+ * Receive a TCP stream.
+ * @param data The buffer that will receive data.
+ * @param size The buffer size.
+ * @return > 0 if ok, -1 (SOCKET_ERROR) if error
+ */
+int TcpSocket::read(void* data, int size)
+{
+ TRACE_CLASS("TcpSocket", "read(void*, size)");
+
+ int ret = recv(listenSocket, (char*)data, size, 0);
+ if (ret == SOCKET_ERROR) {
+ setInetError("Can't receive TCP packet");
+ return -1;
+ }
+ return ret;
+}
+
+
+#define MAX 512
+char* TcpSocket::GetLine(int fd)
+{
+ static char line[MAX];
+ static char netread[MAX] = "";
+ int n, len;
+ char *p;
+
+ len = strlen(netread);
+
+ /* look for \r\n in netread buffer */
+ p = strstr(netread, "\r\n");
+ if (p == NULL) {
+ /* fill buff - no \r\n found */
+ //n = ::read(fd, (void*)(netread+len), (size_t)(MAX-len));
+ n = recv(fd, (netread+len), MAX-len, 0);
+ if (n == SOCKET_ERROR) {
+ setInetError("Can't receive TCP packet");
+ return NULL;
+ }
+ len += n;
+ netread[len] = '\0';
+ if (n>0)
+ return GetLine(fd);
+ }
+ if (p!=NULL)
+ {
+ *p = '\0';
+ strcpy(line, netread);
+ /* copy rest of buf down */
+ memmove(netread, p+2, strlen(p+2)+1);
+ }
+ return line;
+}
+
+
+/**
+ * Send an TCP packet.
+ * @param data The buffer taht will be sent.
+ * @param size Number of bytes to send.
+ * return 0 if ok, -1 if error
+ */
+int TcpSocket::write(const void* data, int size)
+{
+#ifdef DUMP
+ TRACE_CLASS("TcpSocket", "write(const void*, int)");
+#endif
+
+ // ignore BROKENPIPE signal (we handle it instead)
+// void* old_sigpipe = signal ( SIGPIPE, SIG_IGN );
+ // try to send data
+ int ret = send(listenSocket, (char*)data, size, 0 /*MSG_NOSIGNAL*/ );
+ // restore the BROKENPIPE handling
+// signal ( SIGPIPE, (__sighandler_t)old_sigpipe );
+ if (ret == SOCKET_ERROR) {
+ setInetError("Can't send TCP packet");
+ return -1;
+ }
+ return ret;
+}
+
+
+int TcpSocket::setDestination(InetAddress &addr)
+{
+ address = addr;
+ int ret = connect(listenSocket, addr.getAddress(), sizeof(*addr.getAddress()));
+ // A etre verifier: code de retour differend entre Linux et Windows
+ return ret;
+}
+
+
+void TcpSocket::setSocket(SOCKET socket, InetAddress &addr)
+{
+ if (listenSocket != INVALID_SOCKET)
+ closesocket(listenSocket);
+ listenSocket = socket;
+ address = addr;
+}
+
+
+InetAddress TcpSocket::getAddress()
+{
+ return address;
+}
+
+
+int TcpSocket::PeekCount()
+{
+ int count;
+ char tempBuffer[3];
+ int size=3;
+
+ count = recv(listenSocket, tempBuffer, size, MSG_PEEK);
+ if (count == -1)
+ {
+ printf("ERROR WHEN PEEKING SOCKET\n");
+ }
+ return count;
+}
+
+/*
+WSAEINTR
+WSAEBADF
+WSAEACCES
+WSAEFAULT
+WSAEINVAL
+WSAEMFILE
+WSAEWOULDBLOCK
+WSAEINPROGRESS
+WSAEALREADY
+WSAENOTSOCK
+WSAEDESTADDRREQ
+WSAEMSGSIZE
+WSAEPROTOTYPE
+WSAENOPROTOOPT
+WSAEPROTONOSUPPORT
+WSAESOCKTNOSUPPORT
+WSAEOPNOTSUPP
+WSAEPFNOSUPPORT
+WSAEAFNOSUPPORT
+WSAEADDRINUSE
+WSAEADDRNOTAVAIL
+WSAENETDOWN
+WSAENETUNREACH
+WSAENETRESET
+WSAECONNABORTED
+WSAECONNRESET
+WSAENOBUFS
+WSAEISCONN
+WSAENOTCONN
+WSAESHUTDOWN
+WSAETOOMANYREFS
+WSAETIMEDOUT
+WSAECONNREFUSED
+WSAELOOP
+WSAENAMETOOLONG
+WSAEHOSTDOWN
+WSAEHOSTUNREACH
+WSAENOTEMPTY
+WSAEPROCLIM
+WSAEUSERS
+WSAEDQUOT
+WSAESTALE
+WSAEREMOTE
+WSAEDISCON
+WSASYSNOTREADY
+WSAVERNOTSUPPORTED
+WSANOTINITIALISED
+*/
diff --git a/src/TcpSocket.h b/src/TcpSocket.h
new file mode 100644
index 0000000..7c92af0
--- /dev/null
+++ b/src/TcpSocket.h
@@ -0,0 +1,97 @@
+/*
+ Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Her Majesty the Queen in
+ Right of Canada (Communications Research Center Canada)
+ */
+/*
+ This file is part of CRC-DabMux.
+
+ CRC-DabMux is free software: you can 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.
+
+ CRC-DabMux is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with CRC-DabMux. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef _TCPSOCKET
+#define _TCPSOCKET
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#include "InetAddress.h"
+#ifdef _WIN32
+# include <winsock.h>
+# define socklen_t int
+# define reuseopt_t char
+#else
+# include <sys/socket.h>
+# include <netinet/in.h>
+# include <unistd.h>
+# include <netdb.h>
+# include <arpa/inet.h>
+# include <pthread.h>
+# define SOCKET int
+# define INVALID_SOCKET -1
+# define SOCKET_ERROR -1
+# define reuseopt_t int
+#endif
+//#define INVALID_PORT -1
+
+//# include "SocketSelector.h"
+
+#include <iostream>
+
+/**
+ * This class represents a socket for sending and receiving UDP packets.
+ *
+ * A UDP socket is the sending or receiving point for a packet delivery service.
+ * Each packet sent or received on a datagram socket is individually
+ * addressed and routed. Multiple packets sent from one machine to another may
+ * be routed differently, and may arrive in any order.
+ * @author Pascal Charest pascal.charest@crc.ca
+ */
+class TcpSocket {
+ friend class SocketSelector;
+ public:
+ TcpSocket();
+ TcpSocket(int port, char *name = NULL);
+ ~TcpSocket();
+
+ static int init();
+ static int clean();
+
+ int create(int port = 0, char *name = NULL);
+ int close();
+
+ int write(const void* data, int size);
+ int read(void* data, int size);
+ int telnetRead(void* data, int size);
+ /**
+ * Connects the socket on a specific address. Only data from this address
+ * will be received.
+ * @param addr The address to connect the socket
+ * @warning Not implemented yet.
+ */
+ int setDestination(InetAddress &addr);
+ InetAddress getAddress();
+ void setSocket(SOCKET socket, InetAddress &addr);
+ char* GetLine(int fd);
+
+ int PeekCount();
+
+ protected:
+ /// The address on which the socket is binded.
+ InetAddress address;
+ /// The low-level socket used by system functions.
+ SOCKET listenSocket;
+};
+
+#endif // _TCPSOCKET
diff --git a/src/UdpSocket.cpp b/src/UdpSocket.cpp
new file mode 100644
index 0000000..f3b2ca0
--- /dev/null
+++ b/src/UdpSocket.cpp
@@ -0,0 +1,455 @@
+/*
+ Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 Her Majesty the
+ Queen in Right of Canada (Communications Research Center Canada)
+ */
+/*
+ This file is part of CRC-DabMux.
+
+ CRC-DabMux is free software: you can 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.
+
+ CRC-DabMux is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with CRC-DabMux. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "UdpSocket.h"
+
+#include <iostream>
+#include <stdio.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <string.h>
+
+#ifdef TRACE_ON
+# ifndef TRACE_CLASS
+# define TRACE_CLASS(class, func) cout <<"-" <<(class) <<"\t(" <<this <<")::" <<(func) <<endl
+# define TRACE_STATIC(class, func) cout <<"-" <<(class) <<"\t(static)::" <<(func) <<endl
+# endif
+#else
+# ifndef TRACE_CLASS
+# define TRACE_CLASS(class, func)
+# define TRACE_STATIC(class, func)
+# endif
+#endif
+
+
+/// Must be call once before doing any operation on sockets
+int UdpSocket::init()
+{
+#ifdef _WIN32
+ WSADATA wsaData;
+ WORD wVersionRequested = wVersionRequested = MAKEWORD( 2, 2 );
+
+ int res = WSAStartup( wVersionRequested, &wsaData );
+ if (res) {
+ setInetError("Can't initialize winsock");
+ return -1;
+ }
+#endif
+ return 0;
+}
+
+
+/// Must be call once before leaving application
+int UdpSocket::clean()
+{
+#ifdef _WIN32
+ int res = WSACleanup();
+ if (res) {
+ setInetError("Can't initialize winsock");
+ return -1;
+ }
+#endif
+ return 0;
+}
+
+
+/**
+ * Two step constructor. Create must be called prior to use this
+ * socket.
+ */
+UdpSocket::UdpSocket() :
+ listenSocket(INVALID_SOCKET)
+{
+ TRACE_CLASS("UdpSocket", "UdpSocket()");
+}
+
+
+/**
+ * One step constructor.
+ * @param port The port number on which the socket will be bind
+ * @param name The IP address on which the socket will be bind.
+ * It is used to bind the socket on a specific interface if
+ * the computer have many NICs.
+ */
+UdpSocket::UdpSocket(int port, char *name) :
+ listenSocket(INVALID_SOCKET)
+{
+ TRACE_CLASS("UdpSocket", "UdpSocket(int, char*)");
+ create(port, name);
+}
+
+
+/**
+ * This functin set blocking mode. The socket can be blocking or not,
+ * depending of the parametre. By default, the socket is blocking.
+ * @param block If true, set the socket blocking, otherwise set non-blocking
+ * @return 0 if ok
+ * -1 if error
+ */
+int UdpSocket::setBlocking(bool block)
+{
+#ifdef _WIN32
+ unsigned long res = block ? 0 : 1;
+ if (ioctlsocket(listenSocket, FIONBIO, &res) != 0) {
+ setInetError("Can't change blocking state of socket");
+ return -1;
+ }
+ return 0;
+#else
+ int res;
+ if (block)
+ res = fcntl(listenSocket, F_SETFL, 0);
+ else
+ res = fcntl(listenSocket, F_SETFL, O_NONBLOCK);
+ if (res == SOCKET_ERROR) {
+ setInetError("Can't change blocking state of socket");
+ return -1;
+ }
+ return 0;
+#endif
+}
+
+
+/**
+ * Two step initializer. This function must be called after the constructor
+ * without argument as been called.
+ * @param port The port number on which the socket will be bind
+ * @param name The IP address on which the socket will be bind.
+ * It is used to bind the socket on a specific interface if
+ * the computer have many NICs.
+ * @return 0 if ok
+ * -1 if error
+ */
+int UdpSocket::create(int port, char *name)
+{
+ TRACE_CLASS("UdpSocket", "create(int, char*)");
+ if (listenSocket != INVALID_SOCKET)
+ closesocket(listenSocket);
+ address.setAddress(name);
+ address.setPort(port);
+ if ((listenSocket = socket(PF_INET, SOCK_DGRAM, 0)) == INVALID_SOCKET) {
+ setInetError("Can't create socket");
+ return -1;
+ }
+ reuseopt_t reuse = 1;
+ if (setsockopt(listenSocket, SOL_SOCKET, SO_REUSEADDR, &reuse, sizeof(reuse))
+ == SOCKET_ERROR) {
+ setInetError("Can't reuse address");
+ return -1;
+ }
+ if (bind(listenSocket, address.getAddress(), sizeof(sockaddr_in)) == SOCKET_ERROR) {
+ setInetError("Can't bind socket");
+ closesocket(listenSocket);
+ listenSocket = INVALID_SOCKET;
+ return -1;
+ }
+ return 0;
+}
+
+
+/// Destructor
+UdpSocket::~UdpSocket() {
+ TRACE_CLASS("UdpSocket", "~UdpSocket()");
+ if (listenSocket != INVALID_SOCKET)
+ closesocket(listenSocket);
+}
+
+
+/**
+ * Receive an UDP packet.
+ * @param packet The packet that will receive data. The address will be set
+ * to the source address.
+ * @return 0 if ok, -1 if error
+ */
+int UdpSocket::receive(UdpPacket &packet)
+{
+ TRACE_CLASS("UdpSocket", "receive(UdpPacket)");
+ socklen_t addrSize;
+ addrSize = sizeof(*packet.getAddress().getAddress());
+ int ret = recvfrom(listenSocket, packet.getData(), packet.getSize() - packet.getOffset(), 0,
+ packet.getAddress().getAddress(), &addrSize);
+ if (ret == SOCKET_ERROR) {
+ packet.setLength(0);
+#ifndef _WIN32
+ if (errno == EAGAIN)
+ return 0;
+#endif
+ setInetError("Can't receive UDP packet");
+ return -1;
+ }
+ packet.setLength(ret);
+ if (ret == (long)packet.getSize()) {
+ packet.setSize(packet.getSize() << 1);
+ }
+ return 0;
+}
+
+
+/**
+ * Send an UDP packet.
+ * @param packet The UDP packet to be sent. It includes the data and the
+ * destination address
+ * return 0 if ok, -1 if error
+ */
+int UdpSocket::send(UdpPacket &packet)
+{
+#ifdef DUMP
+ TRACE_CLASS("UdpSocket", "send(UdpPacket)");
+#endif
+ int ret = sendto(listenSocket, packet.getData(), packet.getLength(), 0,
+ packet.getAddress().getAddress(), sizeof(*packet.getAddress().getAddress()));
+ if (ret == SOCKET_ERROR
+#ifndef _WIN32
+ && errno != ECONNREFUSED
+#endif
+ ) {
+ setInetError("Can't send UDP packet");
+ return -1;
+ }
+ return 0;
+}
+
+
+/**
+ * Must be called to receive data on a multicast address.
+ * @param groupname The multica
+st address to join.
+ * @return 0 if ok, -1 if error
+ */
+int UdpSocket::joinGroup(char* groupname)
+{
+ TRACE_CLASS("UdpSocket", "joinGroup(char*)");
+#ifdef _WIN32
+ ip_mreq group;
+#else
+ ip_mreqn group;
+#endif
+ if ((group.imr_multiaddr.s_addr = inet_addr(groupname)) == INADDR_NONE) {
+ setInetError(groupname);
+ return -1;
+ }
+ if (!IN_MULTICAST(ntohl(group.imr_multiaddr.s_addr))) {
+ setInetError("Not a multicast address");
+ return -1;
+ }
+#ifdef _WIN32
+ group.imr_interface.s_addr = 0;
+ if (setsockopt(listenSocket, IPPROTO_IP, IP_ADD_MEMBERSHIP, (char*)&group, sizeof(group))
+ == SOCKET_ERROR) {
+ setInetError("Can't join multicast group");
+ return -1;
+ }
+#else
+ group.imr_address.s_addr = htons(INADDR_ANY);;
+ group.imr_ifindex = 0;
+ if (setsockopt(listenSocket, SOL_IP, IP_ADD_MEMBERSHIP, &group, sizeof(group))
+ == SOCKET_ERROR) {
+ setInetError("Can't join multicast group");
+ }
+#endif
+ return 0;
+}
+
+
+/**
+ * Constructs an UDP packet.
+ * @param initSize The initial size of the data buffer
+ */
+UdpPacket::UdpPacket(unsigned int initSize) :
+ dataBuf(new char[initSize]),
+ length(0),
+ size(initSize),
+ offset(0)
+{
+ TRACE_CLASS("UdpPacket", "UdpPacket(unsigned int)");
+ if (dataBuf == NULL)
+ size = 0;
+}
+
+
+/// Destructor
+UdpPacket::~UdpPacket()
+{
+ TRACE_CLASS("UdpPacket", "~UdpPacket()");
+ if (dataBuf != NULL) {
+ delete []dataBuf;
+ dataBuf = NULL;
+ }
+}
+
+
+/**
+ * Changes size of the data buffer size. \a Length + \a offset data will be copied
+ * in the new buffer.
+ * @warning The pointer to data will be changed
+ * @param newSize The new data buffer size
+ */
+void UdpPacket::setSize(unsigned newSize)
+{
+ TRACE_CLASS("UdpPacket", "setSize(unsigned)");
+ char *tmp = new char[newSize];
+ if (length > newSize)
+ length = newSize;
+ if (tmp) {
+ memcpy(tmp, dataBuf, length);
+ delete []dataBuf;
+ dataBuf = tmp;
+ size = newSize;
+ }
+}
+
+
+/**
+ * Give the pointer to data. It is ajusted with the \a offset.
+ * @warning This pointer change. when the \a size of the buffer and the \a offset change.
+ * @return The pointer
+ */
+char *UdpPacket::getData()
+{
+ return dataBuf + offset;
+}
+
+
+/**
+ * Add some data at the end of data buffer and adjust size.
+ * @param data Pointer to the data to add
+ * @param size Size in bytes of new data
+ */
+void UdpPacket::addData(void *data, unsigned size)
+{
+ if (length + size > this->size) {
+ setSize(this->size << 1);
+ }
+ memcpy(dataBuf + length, data, size);
+ length += size;
+}
+
+
+/**
+ * Returns the length of useful data. Data before the \a offset are ignored.
+ * @return The data length
+ */
+unsigned long UdpPacket::getLength()
+{
+ return length - offset;
+}
+
+
+/**
+ * Returns the size of the data buffer.
+ * @return The data buffer size
+ */
+unsigned long UdpPacket::getSize()
+{
+ return size;
+}
+
+
+/**
+ * Returns the offset value.
+ * @return The offset value
+ */
+unsigned long UdpPacket::getOffset()
+{
+ return offset;
+}
+
+
+/**
+ * Sets the data length value. Data before the \a offset are ignored.
+ * @param len The new length of data
+ */
+void UdpPacket::setLength(unsigned long len)
+{
+ length = len + offset;
+}
+
+
+/**
+ * Sets the data offset. Data length is ajusted to ignore data before the \a offset.
+ * @param val The new data offset.
+ */
+void UdpPacket::setOffset(unsigned long val)
+{
+ offset = val;
+ if (offset > length)
+ length = offset;
+}
+
+
+/**
+ * Returns the UDP address of the data.
+ * @return The UDP address
+ */
+InetAddress &UdpPacket::getAddress()
+{
+ return address;
+}
+
+/*
+WSAEINTR
+WSAEBADF
+WSAEACCES
+WSAEFAULT
+WSAEINVAL
+WSAEMFILE
+WSAEWOULDBLOCK
+WSAEINPROGRESS
+WSAEALREADY
+WSAENOTSOCK
+WSAEDESTADDRREQ
+WSAEMSGSIZE
+WSAEPROTOTYPE
+WSAENOPROTOOPT
+WSAEPROTONOSUPPORT
+WSAESOCKTNOSUPPORT
+WSAEOPNOTSUPP
+WSAEPFNOSUPPORT
+WSAEAFNOSUPPORT
+WSAEADDRINUSE
+WSAEADDRNOTAVAIL
+WSAENETDOWN
+WSAENETUNREACH
+WSAENETRESET
+WSAECONNABORTED
+WSAECONNRESET
+WSAENOBUFS
+WSAEISCONN
+WSAENOTCONN
+WSAESHUTDOWN
+WSAETOOMANYREFS
+WSAETIMEDOUT
+WSAECONNREFUSED
+WSAELOOP
+WSAENAMETOOLONG
+WSAEHOSTDOWN
+WSAEHOSTUNREACH
+WSAENOTEMPTY
+WSAEPROCLIM
+WSAEUSERS
+WSAEDQUOT
+WSAESTALE
+WSAEREMOTE
+WSAEDISCON
+WSASYSNOTREADY
+WSAVERNOTSUPPORTED
+WSANOTINITIALISED
+*/
diff --git a/src/UdpSocket.h b/src/UdpSocket.h
new file mode 100644
index 0000000..a500606
--- /dev/null
+++ b/src/UdpSocket.h
@@ -0,0 +1,126 @@
+/*
+ Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 Her Majesty the
+ Queen in Right of Canada (Communications Research Center Canada)
+ */
+/*
+ This file is part of CRC-DabMux.
+
+ CRC-DabMux is free software: you can 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.
+
+ CRC-DabMux is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with CRC-DabMux. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef _UDPSOCKET
+#define _UDPSOCKET
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#include "InetAddress.h"
+#ifdef _WIN32
+# include <winsock.h>
+# define socklen_t int
+# define reuseopt_t char
+#else
+# include <sys/socket.h>
+# include <netinet/in.h>
+# include <unistd.h>
+# include <netdb.h>
+# include <arpa/inet.h>
+# include <pthread.h>
+# define SOCKET int
+# define INVALID_SOCKET -1
+# define SOCKET_ERROR -1
+# define reuseopt_t int
+#endif
+//#define INVALID_PORT -1
+
+#include <stdlib.h>
+#include <iostream>
+class UdpPacket;
+
+
+/**
+ * This class represents a socket for sending and receiving UDP packets.
+ *
+ * A UDP socket is the sending or receiving point for a packet delivery service.
+ * Each packet sent or received on a datagram socket is individually
+ * addressed and routed. Multiple packets sent from one machine to another may
+ * be routed differently, and may arrive in any order.
+ * @author Pascal Charest pascal.charest@crc.ca
+ */
+class UdpSocket {
+ public:
+ UdpSocket();
+ UdpSocket(int port, char *name = NULL);
+ ~UdpSocket();
+
+ static int init();
+ static int clean();
+
+ int create(int port = 0, char *name = NULL);
+
+ int send(UdpPacket &packet);
+ int receive(UdpPacket &packet);
+ int joinGroup(char* groupname);
+ /**
+ * Connects the socket on a specific address. Only data from this address
+ * will be received.
+ * @param addr The address to connect the socket
+ * @warning Not implemented yet.
+ */
+ void connect(InetAddress &addr);
+ int setBlocking(bool block);
+
+ protected:
+ /// The address on which the socket is binded.
+ InetAddress address;
+ /// The low-level socket used by system functions.
+ SOCKET listenSocket;
+};
+
+/**
+ * This class represents a UDP packet.
+ *
+ * UDP packets are used to implement a connectionless packet delivery service.
+ * Each message is routed from one machine to another based solely on
+ * information contained within that packet. Multiple packets sent from one
+ * machine to another might be routed differently, and might arrive in any order.
+ * @author Pascal Charest pascal.charest@crc.ca
+ */
+class UdpPacket {
+ public:
+ UdpPacket(unsigned int initSize = 1024);
+ // Not implemented
+ UdpPacket(const UdpPacket& packet);
+ ~UdpPacket();
+
+ char *getData();
+ void addData(void *data, unsigned size);
+ unsigned long getLength();
+ unsigned long getSize();
+ unsigned long getOffset();
+ void setLength(unsigned long len);
+ void setOffset(unsigned long val);
+ void setSize(unsigned newSize);
+ InetAddress &getAddress();
+ // Not implemented
+ const UdpPacket &operator=(const UdpPacket&);
+
+ private:
+ char *dataBuf;
+ unsigned long length, size, offset;
+ InetAddress address;
+};
+
+#endif // _UDPSOCKET
diff --git a/src/bridge.c b/src/bridge.c
new file mode 100644
index 0000000..5a9de23
--- /dev/null
+++ b/src/bridge.c
@@ -0,0 +1,515 @@
+/*
+ Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 Her Majesty the
+ Queen in Right of Canada (Communications Research Center Canada)
+ */
+/*
+ This file is part of CRC-DabMux.
+
+ CRC-DabMux is free software: you can 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.
+
+ CRC-DabMux is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with CRC-DabMux. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include <stdio.h>
+#ifdef _WIN32
+# include <winsock2.h>
+#else
+# include <netinet/in.h>
+#endif // _WIN32
+#include <string.h>
+#include "bridge.h"
+#include "crc.h"
+
+#include <assert.h>
+#include "PcDebug.h"
+
+#ifdef _WIN32
+# ifdef _DEBUG
+ int bridgeVerbosity = 0;
+# endif
+#else
+# ifdef DEBUG
+ int bridgeVerbosity = 0;
+# endif
+#endif
+
+void printStats(struct bridgeInfo* info, FILE* out)
+{
+ struct bridgeStats stats = getStats(info);
+ fprintf(out, "frames : %lu\n", stats.frames);
+ fprintf(out, " valids : %lu\n", stats.valids);
+ fprintf(out, " invalids : %lu\n", stats.invalids);
+ fprintf(out, " bytes : %lu\n", stats.bytes);
+ fprintf(out, " packets : %lu\n", stats.packets);
+ fprintf(out, " errors : %lu\n", stats.errors);
+ fprintf(out, " missings : %lu\n", stats.missings);
+ fprintf(out, " dropped : %lu\n", stats.dropped);
+ fprintf(out, " crc : %lu\n", stats.crc);
+ fprintf(out, " overruns : %lu\n", stats.overruns);
+}
+
+
+void resetStats(struct bridgeInfo* info)
+{
+ memset(&info->stats, 0, sizeof(info->stats));
+}
+
+
+struct bridgeStats getStats(struct bridgeInfo* info)
+{
+ return info->stats;
+}
+
+
+void bridgeInitInfo(struct bridgeInfo* info)
+{
+ memset(info, 0, sizeof(*info));
+ info->transmitted = -8;
+};
+
+
+int writePacket(void* dataIn, int sizeIn, void* dataOut, int sizeOut,
+ struct bridgeInfo* info)
+{
+ static struct bridgeHdr header = { 0 };
+
+ PDEBUG4_VERBOSE(1, bridgeVerbosity, "writePacket\n sizeIn: %i, sizeOut: %i, "
+ "offset: %i, transmitted: %i\n",
+ sizeIn, sizeOut, info->offset, info->transmitted);
+
+ assert(info->transmitted < sizeIn);
+
+ if ((info->offset == 0) && (sizeIn > 0)) {
+ ((unsigned short*)dataOut)[0] = 0xb486;
+ info->offset = 2;
+ }
+ if (sizeIn == 0) {
+ memset((unsigned char*)dataOut + info->offset, 0, sizeOut - info->offset);
+ info->offset = 0;
+ info->transmitted = -8;
+ PDEBUG1_VERBOSE(1, bridgeVerbosity, " return %i (sizeIn == 0)\n",
+ sizeOut);
+ return 0;
+ }
+
+ while (info->offset < sizeOut) {
+ switch (info->transmitted) {
+ case (-8):
+ ((unsigned char*)dataOut)[info->offset++] = 0xcb;
+ ++info->transmitted;
+ break;
+ case (-7):
+ ((unsigned char*)dataOut)[info->offset++] = 0x28;
+ ++info->transmitted;
+ break;
+ case (-6):
+ header.size = htons((unsigned short)sizeIn);
+ header.crc = htons((unsigned short)(crc16(0xffff, &header, 4) ^ 0xffff));
+ ((unsigned char*)dataOut)[info->offset++] = ((char*)&header)[0];
+ ++info->transmitted;
+ break;
+ case (-5):
+ ((unsigned char*)dataOut)[info->offset++] = ((char*)&header)[1];
+ ++info->transmitted;
+ break;
+ case (-4):
+ ((unsigned char*)dataOut)[info->offset++] = ((char*)&header)[2];
+ ++info->transmitted;
+ break;
+ case (-3):
+ ((unsigned char*)dataOut)[info->offset++] = ((char*)&header)[3];
+ ++info->transmitted;
+ break;
+ case (-2):
+ ((unsigned char*)dataOut)[info->offset++] = ((char*)&header)[4];
+ ++info->transmitted;
+ break;
+ case (-1):
+ ((unsigned char*)dataOut)[info->offset++] = ((char*)&header)[5];
+ ++info->transmitted;
+ header.seqNb = htons((unsigned short)(ntohs(header.seqNb) + 1));
+ break;
+ default:
+ ((unsigned char*)dataOut)[info->offset++] =
+ ((unsigned char*)dataIn)[info->transmitted++];
+ if (info->transmitted == sizeIn) {
+ PDEBUG2_VERBOSE(1, bridgeVerbosity,
+ " Packet done, %i bytes at offset %i\n",
+ info->transmitted, info->offset);
+ PDEBUG1_VERBOSE(1, bridgeVerbosity,
+ " return %i (sizeIn == transmitted)\n", info->offset);
+ info->transmitted = -8;
+ return info->offset;
+ }
+ }
+ }
+
+ PDEBUG1_VERBOSE(1, bridgeVerbosity, " return %i (offset >= sizeOut)\n",
+ info->offset);
+ info->offset = 0;
+ return 0;
+}
+
+
+int getPacket(void* dataIn, int sizeIn, void* dataOut, int sizeOut,
+ struct bridgeInfo* info, char async)
+{
+ unsigned char* in = (unsigned char*)dataIn;
+ unsigned char* out = (unsigned char*)dataOut;
+ unsigned char ch;
+ unsigned short crc;
+ unsigned short diff;
+
+ PDEBUG3_VERBOSE(1, bridgeVerbosity,
+ "getPacket\n pos\t%i\n state\t%i\n received\t%i\n",
+ info->pos, info->state, info->received);
+
+ if (info->pos == 0) {
+ ++info->stats.frames;
+ if (((unsigned short*)dataIn)[0] != 0xb486) {
+ if (((unsigned short*)dataIn)[0] != 0) {
+ ++info->stats.invalids;
+ printf("WARNING: processing frame with invalid magic "
+ "number!\n");
+ } else {
+ PDEBUG0_VERBOSE(1, bridgeVerbosity,
+ "getPacket: not a valid frame\n");
+ return 0;
+ }
+ } else {
+ PDEBUG0_VERBOSE(2, bridgeVerbosity, "Valid frame\n");
+ info->pos += 2;
+ ++info->stats.valids;
+ }
+ info->stats.bytes += sizeIn;
+ }
+ while (info->pos < sizeIn) {
+ ch = in[info->pos++];
+ switch (info->state) {
+ case 0: // sync search
+ info->sync <<= 8;
+ info->sync |= ch;
+ if (info->sync == 0xcb28) {
+ PDEBUG0_VERBOSE(2, bridgeVerbosity, "Sync found\n");
+ ++info->stats.packets;
+ info->received = 0;
+ info->state = 1;
+ }
+ if (info->sync == 0) { // Padding
+ info->pos = 0;
+ return 0;
+ }
+ break;
+ case 1: // header search
+ ((char*)&info->header)[info->received++] = ch;
+ if (info->received == sizeof(struct bridgeHdr)) {
+ PDEBUG0_VERBOSE(2, bridgeVerbosity, "Header found\n");
+ out = (unsigned char*)dataOut;
+ info->received = 0;
+ info->state = 2;
+ crc = crc16(0xffff, &info->header, 4);
+ crc ^= 0xffff;
+ info->header.size = ntohs(info->header.size);
+ info->header.seqNb = ntohs(info->header.seqNb);
+ info->header.crc = ntohs(info->header.crc);
+ PDEBUG4_VERBOSE(2, bridgeVerbosity,
+ " size\t%i\n seq\t%i\n crc\t0x%.4x (0x%.4x)\n",
+ info->header.size, info->header.seqNb,
+ info->header.crc, crc);
+ if (crc != info->header.crc) {
+ PDEBUG0_VERBOSE(2, bridgeVerbosity, "CRC error\n");
+ ++info->stats.errors;
+ ++info->stats.crc;
+ info->state = 0;
+ if (info->pos < sizeof(struct bridgeHdr) + 2 + 2) {
+ info->pos = 2;
+ }
+ } else {
+ if (!info->initSeq) {
+ info->lastSeq = info->header.seqNb;
+ info->initSeq = 1;
+ } else {
+ if (info->header.seqNb > info->lastSeq) {
+ diff = (info->header.seqNb - info->lastSeq) - 1;
+ } else {
+ diff = ((short)info->lastSeq -
+ (short)info->header.seqNb) - 1;
+ }
+ info->stats.errors += diff;
+ info->stats.missings += diff;
+ info->lastSeq = info->header.seqNb;
+ }
+ }
+ }
+ break;
+ case 2: // data
+ out[info->received++] = ch;
+ if (info->received == info->header.size) {
+ PDEBUG0_VERBOSE(2, bridgeVerbosity, "data found\n");
+ info->state = 0;
+ return info->received;
+ }
+ if (info->received == sizeOut) {
+ PDEBUG1_VERBOSE(1, bridgeVerbosity, "To much data: %i\n",
+ info->received);
+ ++info->stats.errors;
+ ++info->stats.overruns;
+ info->sync = 0;
+ info->state = 0;
+ return -1;
+ }
+ break;
+ case 3: // Padding or sync
+ if (ch == 0) { // Padding
+ info->pos = 0;
+ return 0;
+ }
+ if (ch != 0xcb) { // error
+ info->sync = ch;
+ info->state = 0;
+ } else {
+ info->state = 4;
+ }
+ break;
+ case 4: // Low byte sync
+ if (ch != 28) { // error
+ info->sync <<= 8;
+ info->sync |= ch;
+ info->state = 0;
+ } else {
+ info->state = 2;
+ }
+ break;
+ }
+ }
+ info->pos = 0;
+ return 0;
+}
+
+
+void dump(void* data, int size, FILE* stream)
+{
+ int i;
+ fprintf(stream, "%i bytes\n", size);
+ for (i = 0; i < size; ++i) {
+ fprintf(stream, " 0x%.2x", ((unsigned char*)data)[i]);
+ if (i % 8 == 7)
+ fprintf(stream, "\n");
+ }
+ fprintf(stream, "\n");
+}
+
+
+#ifdef BRIDGE_TEST
+#include <stdlib.h>
+
+
+int test(const unsigned char* data)
+{
+ unsigned char bridgeSize = data[0];
+ unsigned char nbInput = data[1];
+ unsigned char nbBridge = 1;
+ struct bridgeInfo info;
+
+ int i, j;
+ int index = 0;
+ int max = 0;
+ int nbBytes;
+
+ unsigned char** inputData;
+ unsigned char** bridgeData;
+ unsigned char* outputData;
+
+ inputData = malloc(nbInput * 4);
+ bridgeData = malloc(nbBridge * 4);
+ for (i = 0; i < nbInput; ++i) {
+ if (data[i + 2] > 0)
+ inputData[i] = malloc(data[i + 2]);
+ if (data[i + 2] > max) {
+ max = data[i + 2];
+ }
+ for (j = 0; j < data[i + 2]; ++j) {
+ inputData[i][j] = index++;
+ }
+ }
+ bridgeData[0] = malloc(bridgeSize);
+ memset(bridgeData[0], 0, bridgeSize);
+ outputData = malloc(max);
+ bridgeInitInfo(&info);
+
+ // Write packets
+ index = 0;
+ while (1) {
+ if (data[index + 2] == 0) {
+ if (++index == nbInput)
+ break;
+ }
+ while ((nbBytes = writePacket(inputData[index], data[index + 2],
+ bridgeData[nbBridge - 1], bridgeSize, &info))
+ != 0) {
+ if (++index == nbInput) {
+ break;
+ }
+ }
+ if (index == nbInput)
+ break;
+ // TODO check null
+ bridgeData = realloc(bridgeData, (++nbBridge) * 4);
+ bridgeData[nbBridge - 1] = malloc(bridgeSize);
+ memset(bridgeData[nbBridge - 1], 0, bridgeSize);
+ }
+// if (nbBytes != bridgeSize) {
+ writePacket(NULL, 0, bridgeData[nbBridge - 1], bridgeSize, &info);
+// }
+
+ // read packets
+ index = 0;
+ for (i = 0; i < nbBridge; ++i) {
+ while ((nbBytes = getPacket(bridgeData[i], bridgeSize, outputData, max,
+ &info, 0)) != 0) {
+ while (data[index + 2] == 0) {
+ ++index;
+ }
+ if (nbBytes != data[index + 2]) {
+ printf("FAILED\n");
+ printf("Invalid size at bridge %i, data %i: %i != %i\n",
+ i, index, nbBytes, data[index + 2]);
+ for (i = 0; i < nbInput; ++i) {
+ printf("Input %i: ", i);
+ dump(inputData[i], data[i + 2], stdout);
+ }
+ for (i = 0; i < nbBridge; ++i) {
+ printf("Bridge %i: ", i);
+ dump(bridgeData[i], bridgeSize, stdout);
+ }
+ printf("Output %i: ", index);
+ dump(outputData, nbBytes, stdout);
+ return -1;
+ }
+ if (memcmp(outputData, inputData[index], data[index + 2]) != 0) {
+ printf("FAILED\n");
+ printf("output != input\n");
+ for (i = 0; i < nbInput; ++i) {
+ printf("Input %i: ", i);
+ dump(inputData[i], data[i + 2], stdout);
+ }
+ for (i = 0; i < nbBridge; ++i) {
+ printf("Bridge %i: ", i);
+ dump(bridgeData[i], bridgeSize, stdout);
+ }
+ printf("Output %i: ", index);
+ dump(outputData, nbBytes, stdout);
+ }
+ ++index;
+ }
+ }
+
+ printf("SUCCESS\n");
+
+ for (i = 0; i < nbInput; ++i) {
+ if (data[i + 2] > 0)
+ free(inputData[i]);
+ }
+ free(inputData);
+ free(outputData);
+ for (i = 0; i < nbBridge; ++i) {
+ free(bridgeData[i]);
+ }
+ free(bridgeData);
+
+ return -1;
+}
+
+
+int main(int argc, char* argv[])
+{
+ int i;
+ // test: bridgesize, nbinput [, input1, input2, ... ]
+ const unsigned char complete[] = { 32, 1, 16 };
+ const unsigned char split[] = { 32, 1, 48 };
+ const unsigned char twice[] = {32, 2, 8, 4 };
+ const unsigned char secondSplit[] = { 32, 2, 16, 16 };
+ const unsigned char headerSplit[][4] = {
+ { 32, 2, 23, 16 },
+ { 32, 2, 22, 16 },
+ { 32, 2, 21, 16 },
+ { 32, 2, 20, 16 },
+ { 32, 2, 19, 16 },
+ { 32, 2, 18, 16 },
+ { 32, 2, 17, 16 }
+ };
+ const unsigned char two[] = { 32, 3, 16, 0, 16 };
+ const unsigned char doubleSplit[] = { 32, 2, 32, 32 };
+ const unsigned char full[] = { 32, 2, 24, 12 };
+ const unsigned char empty[] = { 32, 3, 0, 0, 5 };
+
+#ifdef _WIN32
+ #ifdef _DEBUG
+ bridgeVerbosity = argc - 1;
+ #endif // DEBUG
+#else
+ #ifdef DEBUG
+ bridgeVerbosity = argc - 1;
+ #endif // DEBUG
+#endif // _WIN32
+
+ printf("Complete: ");
+ test(complete);
+ // printStats(stdout);
+ fflush(stdout);
+
+ printf("split: ");
+ test(split);
+ // printStats(stdout);
+ fflush(stdout);
+
+ printf("twice: ");
+ test(twice);
+ // printStats(stdout);
+ fflush(stdout);
+
+ printf("second split: ");
+ test(secondSplit);
+ // printStats(stdout);
+ fflush(stdout);
+
+ for (i = 0; i < sizeof(headerSplit) / sizeof(headerSplit[0]); ++i) {
+ printf("headerSplit%i: ", i);
+ test(headerSplit[i]);
+ // printStats(stdout);
+ fflush(stdout);
+ }
+
+ printf("two: ");
+ test(two);
+ // printStats(stdout);
+ fflush(stdout);
+
+ printf("doubleSplit: ");
+ test(doubleSplit);
+ // printStats(stdout);
+ fflush(stdout);
+
+ printf("full: ");
+ test(full);
+ // printStats(stdout);
+ fflush(stdout);
+
+ printf("empty: ");
+ test(empty);
+ // printStats(stdout);
+ fflush(stdout);
+
+ return 0;
+}
+
+#endif // BRIDGE_TEST
diff --git a/src/bridge.h b/src/bridge.h
new file mode 100644
index 0000000..f7d3f41
--- /dev/null
+++ b/src/bridge.h
@@ -0,0 +1,112 @@
+/*
+ Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 Her Majesty the
+ Queen in Right of Canada (Communications Research Center Canada)
+ */
+/*
+ This file is part of CRC-DabMux.
+
+ CRC-DabMux is free software: you can 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.
+
+ CRC-DabMux is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with CRC-DabMux. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef _BRIDGE
+#define _BRIDGE
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#include <stdio.h>
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifdef _WIN32
+# ifdef _DEBUG
+ extern int bridgeVerbosity;
+# endif // _DEBUG
+#else
+# ifndef DEBUG
+# ifndef NDEBUG
+# define NDEBUG
+# endif
+# else
+ extern int bridgeVerbosity;
+# endif // DEBUG
+#endif // _WIN32
+
+struct bridgeStats {
+ unsigned long frames; // Number of frames analyzed
+ unsigned long valids; // Nb of frames with a good magic number
+ unsigned long invalids; // Nb of frames with a good magic number
+ unsigned long bytes; // Nb of data bytes
+ unsigned long packets; // Nb of packets found
+ unsigned long errors;
+ unsigned long missings;
+ unsigned long dropped;
+ unsigned long crc; // Nb of crc errors
+ unsigned long overruns; // Nb of packet too big
+};
+
+
+struct bridgeHdr {
+ unsigned short size;
+ unsigned short seqNb;
+ unsigned short crc;
+};
+
+
+struct bridgeInfo {
+ // Tx
+ int transmitted; // Nb bytes written
+ int offset; // Offset of the next byte to write
+ // Rx
+ int received;
+ int pos;
+ int state;
+ unsigned short lastSeq;
+ unsigned short sync;
+ char initSeq;
+ // General
+ struct bridgeHdr header;
+ struct bridgeStats stats;
+};
+
+
+
+void dump(void* data, int size, FILE* stream);
+
+/*
+ * Example of usae:
+ * if (data.length == 0)
+ * read(data)
+ * while (writePacket() != 0)
+ * read(read)
+ * ...
+ */
+int writePacket(void* dataIn, int sizeIn, void* dataOut, int sizeOut, struct bridgeInfo* info);
+
+int getPacket(void* dataIn, int sizeIn, void* dataOut, int sizeOut, struct bridgeInfo* info, char async);
+
+void bridgeInitInfo(struct bridgeInfo* info);
+struct bridgeStats getStats(struct bridgeInfo* info);
+void resetStats(struct bridgeInfo* info);
+void printStats(struct bridgeInfo* info, FILE* out);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // _BRIDGE
diff --git a/src/crc.c b/src/crc.c
new file mode 100644
index 0000000..8dc9966
--- /dev/null
+++ b/src/crc.c
@@ -0,0 +1,266 @@
+/*
+ Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 Her Majesty the
+ Queen in Right of Canada (Communications Research Center Canada)
+ */
+/*
+ This file is part of CRC-DabMux.
+
+ CRC-DabMux is free software: you can 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.
+
+ CRC-DabMux is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with CRC-DabMux. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "crc.h"
+#ifndef _WIN32
+# include <unistd.h>
+# include <netinet/in.h>
+#endif
+#include <stdio.h>
+#include <fcntl.h>
+
+//#define CCITT 0x1021
+
+uint8_t crc8tab[256] = {
+ 0x00, 0x07, 0x0e, 0x09, 0x1c, 0x1b, 0x12, 0x15,
+ 0x38, 0x3f, 0x36, 0x31, 0x24, 0x23, 0x2a, 0x2d,
+ 0x70, 0x77, 0x7e, 0x79, 0x6c, 0x6b, 0x62, 0x65,
+ 0x48, 0x4f, 0x46, 0x41, 0x54, 0x53, 0x5a, 0x5d,
+ 0xe0, 0xe7, 0xee, 0xe9, 0xfc, 0xfb, 0xf2, 0xf5,
+ 0xd8, 0xdf, 0xd6, 0xd1, 0xc4, 0xc3, 0xca, 0xcd,
+ 0x90, 0x97, 0x9e, 0x99, 0x8c, 0x8b, 0x82, 0x85,
+ 0xa8, 0xaf, 0xa6, 0xa1, 0xb4, 0xb3, 0xba, 0xbd,
+ 0xc7, 0xc0, 0xc9, 0xce, 0xdb, 0xdc, 0xd5, 0xd2,
+ 0xff, 0xf8, 0xf1, 0xf6, 0xe3, 0xe4, 0xed, 0xea,
+ 0xb7, 0xb0, 0xb9, 0xbe, 0xab, 0xac, 0xa5, 0xa2,
+ 0x8f, 0x88, 0x81, 0x86, 0x93, 0x94, 0x9d, 0x9a,
+ 0x27, 0x20, 0x29, 0x2e, 0x3b, 0x3c, 0x35, 0x32,
+ 0x1f, 0x18, 0x11, 0x16, 0x03, 0x04, 0x0d, 0x0a,
+ 0x57, 0x50, 0x59, 0x5e, 0x4b, 0x4c, 0x45, 0x42,
+ 0x6f, 0x68, 0x61, 0x66, 0x73, 0x74, 0x7d, 0x7a,
+ 0x89, 0x8e, 0x87, 0x80, 0x95, 0x92, 0x9b, 0x9c,
+ 0xb1, 0xb6, 0xbf, 0xb8, 0xad, 0xaa, 0xa3, 0xa4,
+ 0xf9, 0xfe, 0xf7, 0xf0, 0xe5, 0xe2, 0xeb, 0xec,
+ 0xc1, 0xc6, 0xcf, 0xc8, 0xdd, 0xda, 0xd3, 0xd4,
+ 0x69, 0x6e, 0x67, 0x60, 0x75, 0x72, 0x7b, 0x7c,
+ 0x51, 0x56, 0x5f, 0x58, 0x4d, 0x4a, 0x43, 0x44,
+ 0x19, 0x1e, 0x17, 0x10, 0x05, 0x02, 0x0b, 0x0c,
+ 0x21, 0x26, 0x2f, 0x28, 0x3d, 0x3a, 0x33, 0x34,
+ 0x4e, 0x49, 0x40, 0x47, 0x52, 0x55, 0x5c, 0x5b,
+ 0x76, 0x71, 0x78, 0x7f, 0x6a, 0x6d, 0x64, 0x63,
+ 0x3e, 0x39, 0x30, 0x37, 0x22, 0x25, 0x2c, 0x2b,
+ 0x06, 0x01, 0x08, 0x0f, 0x1a, 0x1d, 0x14, 0x13,
+ 0xae, 0xa9, 0xa0, 0xa7, 0xb2, 0xb5, 0xbc, 0xbb,
+ 0x96, 0x91, 0x98, 0x9f, 0x8a, 0x8d, 0x84, 0x83,
+ 0xde, 0xd9, 0xd0, 0xd7, 0xc2, 0xc5, 0xcc, 0xcb,
+ 0xe6, 0xe1, 0xe8, 0xef, 0xfa, 0xfd, 0xf4, 0xf3
+};
+
+
+uint16_t crc16tab[256] = {
+ 0x0000, 0x1021, 0x2042, 0x3063, 0x4084, 0x50a5, 0x60c6, 0x70e7,
+ 0x8108, 0x9129, 0xa14a, 0xb16b, 0xc18c, 0xd1ad, 0xe1ce, 0xf1ef,
+ 0x1231, 0x0210, 0x3273, 0x2252, 0x52b5, 0x4294, 0x72f7, 0x62d6,
+ 0x9339, 0x8318, 0xb37b, 0xa35a, 0xd3bd, 0xc39c, 0xf3ff, 0xe3de,
+ 0x2462, 0x3443, 0x0420, 0x1401, 0x64e6, 0x74c7, 0x44a4, 0x5485,
+ 0xa56a, 0xb54b, 0x8528, 0x9509, 0xe5ee, 0xf5cf, 0xc5ac, 0xd58d,
+ 0x3653, 0x2672, 0x1611, 0x0630, 0x76d7, 0x66f6, 0x5695, 0x46b4,
+ 0xb75b, 0xa77a, 0x9719, 0x8738, 0xf7df, 0xe7fe, 0xd79d, 0xc7bc,
+ 0x48c4, 0x58e5, 0x6886, 0x78a7, 0x0840, 0x1861, 0x2802, 0x3823,
+ 0xc9cc, 0xd9ed, 0xe98e, 0xf9af, 0x8948, 0x9969, 0xa90a, 0xb92b,
+ 0x5af5, 0x4ad4, 0x7ab7, 0x6a96, 0x1a71, 0x0a50, 0x3a33, 0x2a12,
+ 0xdbfd, 0xcbdc, 0xfbbf, 0xeb9e, 0x9b79, 0x8b58, 0xbb3b, 0xab1a,
+ 0x6ca6, 0x7c87, 0x4ce4, 0x5cc5, 0x2c22, 0x3c03, 0x0c60, 0x1c41,
+ 0xedae, 0xfd8f, 0xcdec, 0xddcd, 0xad2a, 0xbd0b, 0x8d68, 0x9d49,
+ 0x7e97, 0x6eb6, 0x5ed5, 0x4ef4, 0x3e13, 0x2e32, 0x1e51, 0x0e70,
+ 0xff9f, 0xefbe, 0xdfdd, 0xcffc, 0xbf1b, 0xaf3a, 0x9f59, 0x8f78,
+ 0x9188, 0x81a9, 0xb1ca, 0xa1eb, 0xd10c, 0xc12d, 0xf14e, 0xe16f,
+ 0x1080, 0x00a1, 0x30c2, 0x20e3, 0x5004, 0x4025, 0x7046, 0x6067,
+ 0x83b9, 0x9398, 0xa3fb, 0xb3da, 0xc33d, 0xd31c, 0xe37f, 0xf35e,
+ 0x02b1, 0x1290, 0x22f3, 0x32d2, 0x4235, 0x5214, 0x6277, 0x7256,
+ 0xb5ea, 0xa5cb, 0x95a8, 0x8589, 0xf56e, 0xe54f, 0xd52c, 0xc50d,
+ 0x34e2, 0x24c3, 0x14a0, 0x0481, 0x7466, 0x6447, 0x5424, 0x4405,
+ 0xa7db, 0xb7fa, 0x8799, 0x97b8, 0xe75f, 0xf77e, 0xc71d, 0xd73c,
+ 0x26d3, 0x36f2, 0x0691, 0x16b0, 0x6657, 0x7676, 0x4615, 0x5634,
+ 0xd94c, 0xc96d, 0xf90e, 0xe92f, 0x99c8, 0x89e9, 0xb98a, 0xa9ab,
+ 0x5844, 0x4865, 0x7806, 0x6827, 0x18c0, 0x08e1, 0x3882, 0x28a3,
+ 0xcb7d, 0xdb5c, 0xeb3f, 0xfb1e, 0x8bf9, 0x9bd8, 0xabbb, 0xbb9a,
+ 0x4a75, 0x5a54, 0x6a37, 0x7a16, 0x0af1, 0x1ad0, 0x2ab3, 0x3a92,
+ 0xfd2e, 0xed0f, 0xdd6c, 0xcd4d, 0xbdaa, 0xad8b, 0x9de8, 0x8dc9,
+ 0x7c26, 0x6c07, 0x5c64, 0x4c45, 0x3ca2, 0x2c83, 0x1ce0, 0x0cc1,
+ 0xef1f, 0xff3e, 0xcf5d, 0xdf7c, 0xaf9b, 0xbfba, 0x8fd9, 0x9ff8,
+ 0x6e17, 0x7e36, 0x4e55, 0x5e74, 0x2e93, 0x3eb2, 0x0ed1, 0x1ef0
+};
+
+
+uint32_t crc32tab[256] = {
+ 0x00000000, 0x04c11db7, 0x09823b6e, 0x0d4326d9,
+ 0x130476dc, 0x17c56b6b, 0x1a864db2, 0x1e475005,
+ 0x2608edb8, 0x22c9f00f, 0x2f8ad6d6, 0x2b4bcb61,
+ 0x350c9b64, 0x31cd86d3, 0x3c8ea00a, 0x384fbdbd,
+ 0x4c11db70, 0x48d0c6c7, 0x4593e01e, 0x4152fda9,
+ 0x5f15adac, 0x5bd4b01b, 0x569796c2, 0x52568b75,
+ 0x6a1936c8, 0x6ed82b7f, 0x639b0da6, 0x675a1011,
+ 0x791d4014, 0x7ddc5da3, 0x709f7b7a, 0x745e66cd,
+ 0x9823b6e0, 0x9ce2ab57, 0x91a18d8e, 0x95609039,
+ 0x8b27c03c, 0x8fe6dd8b, 0x82a5fb52, 0x8664e6e5,
+ 0xbe2b5b58, 0xbaea46ef, 0xb7a96036, 0xb3687d81,
+ 0xad2f2d84, 0xa9ee3033, 0xa4ad16ea, 0xa06c0b5d,
+ 0xd4326d90, 0xd0f37027, 0xddb056fe, 0xd9714b49,
+ 0xc7361b4c, 0xc3f706fb, 0xceb42022, 0xca753d95,
+ 0xf23a8028, 0xf6fb9d9f, 0xfbb8bb46, 0xff79a6f1,
+ 0xe13ef6f4, 0xe5ffeb43, 0xe8bccd9a, 0xec7dd02d,
+ 0x34867077, 0x30476dc0, 0x3d044b19, 0x39c556ae,
+ 0x278206ab, 0x23431b1c, 0x2e003dc5, 0x2ac12072,
+ 0x128e9dcf, 0x164f8078, 0x1b0ca6a1, 0x1fcdbb16,
+ 0x018aeb13, 0x054bf6a4, 0x0808d07d, 0x0cc9cdca,
+ 0x7897ab07, 0x7c56b6b0, 0x71159069, 0x75d48dde,
+ 0x6b93dddb, 0x6f52c06c, 0x6211e6b5, 0x66d0fb02,
+ 0x5e9f46bf, 0x5a5e5b08, 0x571d7dd1, 0x53dc6066,
+ 0x4d9b3063, 0x495a2dd4, 0x44190b0d, 0x40d816ba,
+ 0xaca5c697, 0xa864db20, 0xa527fdf9, 0xa1e6e04e,
+ 0xbfa1b04b, 0xbb60adfc, 0xb6238b25, 0xb2e29692,
+ 0x8aad2b2f, 0x8e6c3698, 0x832f1041, 0x87ee0df6,
+ 0x99a95df3, 0x9d684044, 0x902b669d, 0x94ea7b2a,
+ 0xe0b41de7, 0xe4750050, 0xe9362689, 0xedf73b3e,
+ 0xf3b06b3b, 0xf771768c, 0xfa325055, 0xfef34de2,
+ 0xc6bcf05f, 0xc27dede8, 0xcf3ecb31, 0xcbffd686,
+ 0xd5b88683, 0xd1799b34, 0xdc3abded, 0xd8fba05a,
+ 0x690ce0ee, 0x6dcdfd59, 0x608edb80, 0x644fc637,
+ 0x7a089632, 0x7ec98b85, 0x738aad5c, 0x774bb0eb,
+ 0x4f040d56, 0x4bc510e1, 0x46863638, 0x42472b8f,
+ 0x5c007b8a, 0x58c1663d, 0x558240e4, 0x51435d53,
+ 0x251d3b9e, 0x21dc2629, 0x2c9f00f0, 0x285e1d47,
+ 0x36194d42, 0x32d850f5, 0x3f9b762c, 0x3b5a6b9b,
+ 0x0315d626, 0x07d4cb91, 0x0a97ed48, 0x0e56f0ff,
+ 0x1011a0fa, 0x14d0bd4d, 0x19939b94, 0x1d528623,
+ 0xf12f560e, 0xf5ee4bb9, 0xf8ad6d60, 0xfc6c70d7,
+ 0xe22b20d2, 0xe6ea3d65, 0xeba91bbc, 0xef68060b,
+ 0xd727bbb6, 0xd3e6a601, 0xdea580d8, 0xda649d6f,
+ 0xc423cd6a, 0xc0e2d0dd, 0xcda1f604, 0xc960ebb3,
+ 0xbd3e8d7e, 0xb9ff90c9, 0xb4bcb610, 0xb07daba7,
+ 0xae3afba2, 0xaafbe615, 0xa7b8c0cc, 0xa379dd7b,
+ 0x9b3660c6, 0x9ff77d71, 0x92b45ba8, 0x9675461f,
+ 0x8832161a, 0x8cf30bad, 0x81b02d74, 0x857130c3,
+ 0x5d8a9099, 0x594b8d2e, 0x5408abf7, 0x50c9b640,
+ 0x4e8ee645, 0x4a4ffbf2, 0x470cdd2b, 0x43cdc09c,
+ 0x7b827d21, 0x7f436096, 0x7200464f, 0x76c15bf8,
+ 0x68860bfd, 0x6c47164a, 0x61043093, 0x65c52d24,
+ 0x119b4be9, 0x155a565e, 0x18197087, 0x1cd86d30,
+ 0x029f3d35, 0x065e2082, 0x0b1d065b, 0x0fdc1bec,
+ 0x3793a651, 0x3352bbe6, 0x3e119d3f, 0x3ad08088,
+ 0x2497d08d, 0x2056cd3a, 0x2d15ebe3, 0x29d4f654,
+ 0xc5a92679, 0xc1683bce, 0xcc2b1d17, 0xc8ea00a0,
+ 0xd6ad50a5, 0xd26c4d12, 0xdf2f6bcb, 0xdbee767c,
+ 0xe3a1cbc1, 0xe760d676, 0xea23f0af, 0xeee2ed18,
+ 0xf0a5bd1d, 0xf464a0aa, 0xf9278673, 0xfde69bc4,
+ 0x89b8fd09, 0x8d79e0be, 0x803ac667, 0x84fbdbd0,
+ 0x9abc8bd5, 0x9e7d9662, 0x933eb0bb, 0x97ffad0c,
+ 0xafb010b1, 0xab710d06, 0xa6322bdf, 0xa2f33668,
+ 0xbcb4666d, 0xb8757bda, 0xb5365d03, 0xb1f740b4
+};
+
+// This function can be used to create a new table with a different polynom
+void init_crc8tab(uint8_t l_code, uint8_t l_init)
+{
+ unsigned i, j, msb;
+ uint8_t nb;
+ uint8_t crc;
+
+ for (i = 0; i < 256; ++i) {
+ crc = l_init;
+ nb = i ^ 0xff;
+ for (j = 0; j < 8; ++j) {
+ msb = (nb & (0x80 >> j)) && 1;
+ msb ^= (crc >> 7);
+ crc <<= 1;
+ if (msb)
+ crc ^= l_code;
+ }
+ crc8tab[i] = crc;
+ }
+}
+
+
+void init_crc16tab(uint16_t l_code, uint16_t l_init)
+{
+ unsigned i, j, msb;
+ uint8_t nb;
+ uint16_t crc;
+
+ for (i = 0; i < 256; ++i) {
+ crc = l_init;
+ nb = i ^ 0xff;
+ for (j = 0; j < 8; ++j) {
+ msb = (nb & (0x80 >> j)) && 1;
+ msb ^= (crc >> 15);
+ crc <<= 1;
+ if (msb)
+ crc ^= l_code;
+ }
+ crc ^= 0xff00;
+ crc16tab[i] = crc;
+ }
+}
+
+
+void init_crc32tab(uint32_t l_code, uint32_t l_init)
+{
+ unsigned i, j, msb;
+ uint8_t nb;
+ uint32_t crc;
+
+ for (i = 0; i < 256; ++i) {
+ crc = l_init;
+ nb = i ^ 0xff;
+ for (j = 0; j < 8; ++j) {
+ msb = (nb & (0x80 >> j)) && 1;
+ msb ^= (crc >> 31);
+ crc <<= 1;
+ if (msb)
+ crc ^= l_code;
+ }
+ crc ^= 0xffffff00;
+ crc32tab[i] = crc;
+ }
+}
+
+
+uint8_t crc8(uint8_t l_crc, const void *lp_data, unsigned l_nb)
+{
+ uint8_t* data = (uint8_t*)lp_data;
+ while (l_nb--) {
+ l_crc = crc8tab[l_crc ^ *(data++)];
+ }
+ return (l_crc);
+}
+
+
+uint16_t crc16(uint16_t l_crc, const void *lp_data, unsigned l_nb)
+{
+ uint8_t* data = (uint8_t*)lp_data;
+ while (l_nb--) {
+ l_crc =
+ (l_crc << 8) ^ crc16tab[(l_crc >> 8) ^ *(data++)];
+ }
+ return (l_crc);
+}
+
+
+uint32_t crc32(uint32_t l_crc, const void *lp_data, unsigned l_nb)
+{
+ uint8_t* data = (uint8_t*)lp_data;
+ while (l_nb--) {
+ l_crc =
+ (l_crc << 8) ^ crc32tab[((l_crc >> 24) ^ *(data++)) & 0xff];
+ }
+ return (l_crc);
+}
diff --git a/src/crc.h b/src/crc.h
new file mode 100644
index 0000000..f0da0f5
--- /dev/null
+++ b/src/crc.h
@@ -0,0 +1,59 @@
+/*
+ Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 Her Majesty the
+ Queen in Right of Canada (Communications Research Center Canada)
+ */
+/*
+ This file is part of CRC-DabMux.
+
+ CRC-DabMux is free software: you can 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.
+
+ CRC-DabMux is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with CRC-DabMux. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef _CRC
+#define _CRC
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#ifndef _WIN32
+ #include <stdint.h>
+#else
+ #include <winsock2.h> // For types...
+ typedef BYTE uint8_t;
+ typedef WORD uint16_t;
+ typedef DWORD32 uint32_t;
+#endif
+
+
+#ifdef __cplusplus
+extern "C" { // }
+#endif
+
+void init_crc8tab(uint8_t l_code, uint8_t l_init);
+uint8_t crc8(uint8_t l_crc, const void *lp_data, unsigned l_nb);
+extern uint8_t crc8tab[];
+
+void init_crc16tab(uint16_t l_code, uint16_t l_init);
+uint16_t crc16(uint16_t l_crc, const void *lp_data, unsigned l_nb);
+extern uint16_t crc16tab[];
+
+void init_crc32tab(uint32_t l_code, uint32_t l_init);
+uint32_t crc32(uint32_t l_crc, const void *lp_data, unsigned l_nb);
+extern uint32_t crc32tab[];
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif //_CRC
diff --git a/src/dabInput.cpp b/src/dabInput.cpp
new file mode 100644
index 0000000..e937008
--- /dev/null
+++ b/src/dabInput.cpp
@@ -0,0 +1,51 @@
+/*
+ Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Her Majesty the Queen in
+ Right of Canada (Communications Research Center Canada)
+ */
+/*
+ This file is part of CRC-DabMux.
+
+ CRC-DabMux is free software: you can 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.
+
+ CRC-DabMux is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with CRC-DabMux. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "dabInput.h"
+
+#include <string.h>
+
+TcpLog etiLog;
+
+
+bool dabInputOperations::operator==(const dabInputOperations& ops)
+{
+ return memcmp(this, &ops, sizeof(*this)) == 0;
+}
+
+
+int dabInputSetbuf(void* args, int size)
+{
+ return 0;
+}
+
+
+int dabInputSetbitrate(dabInputOperations* ops, void* args, int bitrate)
+{
+ if (bitrate <= 0) {
+ etiLog.print(TcpLog::ERR, "Invalid bitrate (%i)\n", bitrate);
+ return -1;
+ }
+ if (ops->setbuf(args, bitrate * 3) == 0) {
+ return bitrate;
+ }
+ return -1;
+}
diff --git a/src/dabInput.h b/src/dabInput.h
new file mode 100644
index 0000000..245a162
--- /dev/null
+++ b/src/dabInput.h
@@ -0,0 +1,52 @@
+/*
+ Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Her Majesty the Queen in
+ Right of Canada (Communications Research Center Canada)
+ */
+/*
+ This file is part of CRC-DabMux.
+
+ CRC-DabMux is free software: you can 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.
+
+ CRC-DabMux is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with CRC-DabMux. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef DAB_INPUT_H
+#define DAB_INPUT_H
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+#include "TcpLog.h"
+extern TcpLog etiLog;
+
+
+struct dabInputOperations {
+ int (*init)(void** args);
+ int (*open)(void* args, const char* name);
+ int (*setbuf)(void* args, int size);
+ int (*read)(void* args, void* buffer, int size);
+ int (*lock)(void* args);
+ int (*unlock)(void* args);
+ int (*readFrame)(dabInputOperations* ops, void* args, void* buffer, int size);
+ int (*setBitrate)(dabInputOperations* ops, void* args, int bitrate);
+ int (*close)(void* args);
+ int (*clean)(void** args);
+ int (*rewind)(void* args);
+ bool operator==(const dabInputOperations&);
+};
+
+
+int dabInputSetbuf(void* args, int size);
+int dabInputSetbitrate(dabInputOperations* ops, void* args, int bitrate);
+
+
+#endif // DAB_INPUT_H
diff --git a/src/dabInputBridgeUdp.cpp b/src/dabInputBridgeUdp.cpp
new file mode 100644
index 0000000..a2ccf85
--- /dev/null
+++ b/src/dabInputBridgeUdp.cpp
@@ -0,0 +1,124 @@
+/*
+ Copyright (C) 2009 Her Majesty the Queen in Right of Canada (Communications
+ Research Center Canada)
+ */
+/*
+ This file is part of CRC-DabMux.
+
+ CRC-DabMux is free software: you can 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.
+
+ CRC-DabMux is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with CRC-DabMux. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "dabInputBridgeUdp.h"
+#include "dabInputUdp.h"
+#include "bridge.h"
+
+
+struct dabInputBridgeUdpData {
+ dabInputUdpData* udpData;
+ bridgeInfo* info;
+};
+
+
+struct dabInputOperations dabInputBridgeUdpOperations = {
+ dabInputBridgeUdpInit,
+ dabInputBridgeUdpOpen,
+ dabInputSetbuf,
+ NULL,
+ NULL,
+ NULL,
+ dabInputBridgeUdpRead,
+ dabInputSetbitrate,
+ dabInputBridgeUdpClose,
+ dabInputBridgeUdpClean,
+ NULL
+};
+
+
+int dabInputBridgeUdpInit(void** args)
+{
+ dabInputBridgeUdpData* input = new dabInputBridgeUdpData;
+ dabInputUdpInit((void**)&input->udpData);
+ input->info = new bridgeInfo;
+ bridgeInitInfo(input->info);
+ *args = input;
+
+ return 0;
+}
+
+
+int dabInputBridgeUdpOpen(void* args, const char* inputName)
+{
+ dabInputBridgeUdpData* input = (dabInputBridgeUdpData*)args;
+
+ return dabInputUdpOpen(input->udpData, inputName);
+}
+
+
+int dabInputBridgeUdpRead(dabInputOperations* ops, void* args, void* buffer, int size)
+{
+ int nbBytes = 0;
+ dabInputBridgeUdpData* input = (dabInputBridgeUdpData*)args;
+ dabInputFifoStats* stats = (dabInputFifoStats*)&input->udpData->stats;
+
+ stats->frameRecords[stats->frameCount].curSize = 0;
+ stats->frameRecords[stats->frameCount].maxSize = size;
+
+ if (input->udpData->packet->getLength() == 0) {
+ input->udpData->socket->receive(*input->udpData->packet);
+ }
+ while ((nbBytes = writePacket(input->udpData->packet->getData(),
+ input->udpData->packet->getLength(), buffer, size,
+ input->info))
+ != 0) {
+ stats->frameRecords[stats->frameCount].curSize = nbBytes;
+ input->udpData->socket->receive(*input->udpData->packet);
+ }
+
+ if (input->udpData->packet->getLength() != 0) {
+ stats->frameRecords[stats->frameCount].curSize = size;
+ }
+
+ if (++stats->frameCount == NB_RECORDS) {
+ etiLog.print(TcpLog::INFO, "Data subchannel usage: (%i)",
+ stats->id);
+ for (int i = 0; i < stats->frameCount; ++i) {
+ etiLog.print(TcpLog::INFO, " %i/%i",
+ stats->frameRecords[i].curSize,
+ stats->frameRecords[i].maxSize);
+ }
+ etiLog.print(TcpLog::INFO, "\n");
+ stats->frameCount = 0;
+ }
+ return size;
+}
+
+
+int dabInputBridgeUdpClose(void* args)
+{
+ dabInputBridgeUdpData* input = (dabInputBridgeUdpData*)args;
+
+ return dabInputUdpClose(input->udpData);
+}
+
+
+int dabInputBridgeUdpClean(void** args)
+{
+ dabInputBridgeUdpData* input = (dabInputBridgeUdpData*)(*args);
+ dabInputUdpClean((void**)&input->udpData);
+ delete input->info;
+ delete input;
+ return 0;
+}
+
+
diff --git a/src/dabInputBridgeUdp.h b/src/dabInputBridgeUdp.h
new file mode 100644
index 0000000..c75f838
--- /dev/null
+++ b/src/dabInputBridgeUdp.h
@@ -0,0 +1,49 @@
+/*
+ Copyright (C) 2009 Her Majesty the Queen in Right of Canada (Communications
+ Research Center Canada)
+ */
+/*
+ This file is part of CRC-DabMux.
+
+ CRC-DabMux is free software: you can 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.
+
+ CRC-DabMux is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with CRC-DabMux. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef DAB_INPUT_BRIDGE_UDP_H
+#define DAB_INPUT_BRIDGE_UDP_H
+
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+#include "dabInput.h"
+
+
+#ifdef HAVE_FORMAT_BRIDGE
+# ifdef HAVE_INPUT_UDP
+
+
+extern struct dabInputOperations dabInputBridgeUdpOperations;
+
+int dabInputBridgeUdpInit(void** args);
+int dabInputBridgeUdpOpen(void* args, const char* inputName);
+int dabInputBridgeUdpRead(dabInputOperations* ops, void* args, void* buffer, int size);
+int dabInputBridgeUdpClose(void* args);
+int dabInputBridgeUdpClean(void** args);
+
+
+# endif
+#endif
+
+
+#endif // DAB_INPUT_BRIDGE_UDP_H
diff --git a/src/dabInputDabplusFifo.cpp b/src/dabInputDabplusFifo.cpp
new file mode 100644
index 0000000..fdff5ad
--- /dev/null
+++ b/src/dabInputDabplusFifo.cpp
@@ -0,0 +1,186 @@
+/*
+ Copyright (C) 2009 Her Majesty the Queen in Right of Canada (Communications
+ Research Center Canada)
+ */
+/*
+ This file is part of CRC-DabMux.
+
+ CRC-DabMux is free software: you can 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.
+
+ CRC-DabMux is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with CRC-DabMux. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "dabInputDabplusFifo.h"
+#include "dabInputDabplusFile.h"
+#include "dabInputFifo.h"
+#include "dabInput.h"
+
+#include <stdint.h>
+#include <stdio.h>
+#include <string.h>
+#include <unistd.h>
+#include <fcntl.h>
+
+#ifndef _WIN32
+# define O_BINARY 0
+#endif
+
+
+#ifdef HAVE_FORMAT_DABPLUS
+# ifdef HAVE_INPUT_FILE
+
+
+struct dabInputDabplusFifoData {
+ void* fifoData;
+ uint8_t* buffer;
+ size_t bufferSize;
+ size_t bufferIndex;
+ size_t bufferOffset;
+};
+
+
+struct dabInputOperations dabInputDabplusFifoOperations = {
+ dabInputDabplusFifoInit,
+ dabInputDabplusFifoOpen,
+ dabInputDabplusFifoSetbuf,
+ dabInputDabplusFifoRead,
+ dabInputDabplusFifoLock,
+ dabInputDabplusFifoUnlock,
+ dabInputDabplusFileReadFrame,
+ dabInputSetbitrate,
+ dabInputDabplusFifoClose,
+ dabInputDabplusFifoClean,
+ dabInputDabplusFifoRewind
+};
+
+
+int dabInputDabplusFifoInit(void** args)
+{
+ dabInputDabplusFifoData* data = new dabInputDabplusFifoData;
+
+ dabInputFifoInit(&data->fifoData);
+ data->buffer = NULL;
+ data->bufferSize = 0;
+ data->bufferIndex = 0;
+ data->bufferOffset = 0;
+
+ *args = data;
+}
+
+
+int dabInputDabplusFifoOpen(void* args, const char* filename)
+{
+ dabInputDabplusFifoData* data = (dabInputDabplusFifoData*)args;
+
+ return dabInputFifoOpen(data->fifoData, filename);
+}
+
+
+int dabInputDabplusFifoSetbuf(void* args, int size)
+{
+ dabInputDabplusFifoData* data = (dabInputDabplusFifoData*)args;
+
+ return dabInputFifoSetbuf(data->fifoData, size);
+}
+
+
+int dabInputDabplusFifoRead(void* args, void* buffer, int size)
+{
+ dabInputDabplusFifoData* data = (dabInputDabplusFifoData*)args;
+
+ if (data->bufferSize != size * 5) {
+ if (data->buffer != NULL) {
+ delete[] data->buffer;
+ }
+ data->buffer = new uint8_t[size * 5];
+ data->bufferSize = size * 5;
+ data->bufferIndex = 0;
+ }
+
+ if (data->bufferOffset < data->bufferSize) {
+ int ret = dabInputFifoRead(data->fifoData,
+ &data->buffer[data->bufferOffset],
+ data->bufferSize - data->bufferOffset);
+ if (ret < 0) {
+ return ret;
+ }
+ data->bufferOffset += ret;
+ if (data->bufferOffset != data->bufferSize) {
+ etiLog.print(TcpLog::CRIT, "ERROR: Incomplete DAB+ frame!\n");
+ return 0;
+ }
+ }
+
+ memcpy(buffer, &data->buffer[data->bufferIndex], size);
+ data->bufferIndex += size;
+ if (data->bufferIndex >= data->bufferSize) {
+ data->bufferIndex = 0;
+ data->bufferOffset = 0;
+ }
+ return size;
+}
+
+
+int dabInputDabplusFifoLock(void* args)
+{
+ dabInputDabplusFifoData* data = (dabInputDabplusFifoData*)args;
+
+ return dabInputFifoLock(data->fifoData);
+}
+
+
+int dabInputDabplusFifoUnlock(void* args)
+{
+ dabInputDabplusFifoData* data = (dabInputDabplusFifoData*)args;
+
+ return dabInputFifoUnlock(data->fifoData);
+}
+
+
+int dabInputDabplusFifoReadFrame(dabInputOperations* ops, void* args,
+ void* buffer, int size)
+{
+ dabInputDabplusFifoData* data = (dabInputDabplusFifoData*)args;
+
+ return ops->read(args, buffer, size);
+}
+
+
+int dabInputDabplusFifoClose(void* args)
+{
+ dabInputDabplusFifoData* data = (dabInputDabplusFifoData*)args;
+
+ return dabInputFifoClose(data->fifoData);
+}
+
+
+int dabInputDabplusFifoClean(void** args)
+{
+ dabInputDabplusFifoData* data = (dabInputDabplusFifoData*)args;
+
+ dabInputFifoClean(&data->fifoData);
+ delete data;
+
+ return 0;
+}
+
+
+int dabInputDabplusFifoRewind(void* args)
+{
+ dabInputDabplusFifoData* data = (dabInputDabplusFifoData*)args;
+
+ return dabInputFifoRewind(data->fifoData);
+}
+
+
+# endif
+#endif
diff --git a/src/dabInputDabplusFifo.h b/src/dabInputDabplusFifo.h
new file mode 100644
index 0000000..a02513a
--- /dev/null
+++ b/src/dabInputDabplusFifo.h
@@ -0,0 +1,54 @@
+/*
+ Copyright (C) 2009 Her Majesty the Queen in Right of Canada (Communications
+ Research Center Canada)
+ */
+/*
+ This file is part of CRC-DabMux.
+
+ CRC-DabMux is free software: you can 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.
+
+ CRC-DabMux is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with CRC-DabMux. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef DAB_INPUT_DABPLUS_FIFO_H
+#define DAB_INPUT_DABPLUS_FIFO_H
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+
+#ifdef HAVE_FORMAT_DABPLUS
+# ifdef HAVE_INPUT_FIFO
+
+
+extern struct dabInputOperations dabInputDabplusFifoOperations;
+
+
+int dabInputDabplusFifoInit(void** args);
+int dabInputDabplusFifoOpen(void* args, const char* filename);
+int dabInputDabplusFifoSetbuf(void* args, int size);
+int dabInputDabplusFifoRead(void* args, void* buffer, int size);
+int dabInputDabplusFifoLock(void* args);
+int dabInputDabplusFifoUnlock(void* args);
+int dabInputDabplusFifoReadFrame(dabInputOperations* ops, void* args,
+ void* buffer, int size);
+int dabInputDabplusFifoClose(void* args);
+int dabInputDabplusFifoClean(void** args);
+int dabInputDabplusFifoRewind(void* args);
+
+
+# endif
+#endif
+
+
+#endif // DAB_INPUT_DABPLUS_FIFO_H
diff --git a/src/dabInputDabplusFile.cpp b/src/dabInputDabplusFile.cpp
new file mode 100644
index 0000000..8d46ea1
--- /dev/null
+++ b/src/dabInputDabplusFile.cpp
@@ -0,0 +1,176 @@
+/*
+ Copyright (C) 2009 Her Majesty the Queen in Right of Canada (Communications
+ Research Center Canada)
+ */
+/*
+ This file is part of CRC-DabMux.
+
+ CRC-DabMux is free software: you can 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.
+
+ CRC-DabMux is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with CRC-DabMux. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "dabInputDabplusFile.h"
+#include "dabInput.h"
+
+#include <stdio.h>
+#include <string.h>
+#include <fcntl.h>
+
+#ifndef _WIN32
+# define O_BINARY 0
+#endif
+
+
+#ifdef HAVE_FORMAT_DABPLUS
+# ifdef HAVE_INPUT_FILE
+
+
+struct dabInputOperations dabInputDabplusFileOperations = {
+ dabInputDabplusFileInit,
+ dabInputDabplusFileOpen,
+ dabInputSetbuf,
+ dabInputDabplusFileRead,
+ NULL,
+ NULL,
+ dabInputDabplusFileReadFrame,
+ dabInputSetbitrate,
+ dabInputDabplusFileClose,
+ dabInputDabplusFileClean,
+ dabInputDabplusFileRewind
+};
+
+
+int dabInputDabplusFileInit(void** args)
+{
+ dabInputDabplusFileData* data = new dabInputDabplusFileData;
+ data->file = -1;
+ data->buffer = NULL;
+ data->bufferSize = 0;
+ data->bufferIndex = 0;
+
+ *args = data;
+ return 0;
+}
+
+
+int dabInputDabplusFileOpen(void* args, const char* filename)
+{
+ dabInputDabplusFileData* data = (dabInputDabplusFileData*)args;
+ data->file = open(filename, O_RDONLY | O_BINARY);
+ if (data->file == -1) {
+ perror(filename);
+ return -1;
+ }
+
+ return 0;
+}
+
+
+int dabInputDabplusFileRead(void* args, void* buffer, int size)
+{
+ dabInputDabplusFileData* data = (dabInputDabplusFileData*)args;
+ if (data->bufferSize != size * 5) {
+ if (data->buffer == NULL) {
+ delete[] data->buffer;
+ }
+ data->buffer = new uint8_t[size * 5];
+ data->bufferSize = size * 5;
+ data->bufferIndex = 0;
+ }
+
+ if (data->bufferIndex + size > data->bufferSize) {
+ int ret = read(data->file, data->buffer, data->bufferSize);
+ if (ret != data->bufferSize) {
+ if (ret != 0) {
+ etiLog.print(TcpLog::CRIT, "ERROR: Incomplete DAB+ frame!\n");
+ }
+ return 0;
+ }
+ data->bufferIndex = 0;
+ }
+
+ memcpy(buffer, &data->buffer[data->bufferIndex], size);
+ data->bufferIndex += size;
+
+ return size;
+}
+
+
+int dabInputDabplusFileReadFrame(dabInputOperations* ops, void* args,
+ void* buffer, int size)
+{
+ //dabInputDabplusFileData* data = (dabInputDabplusFileData*)args;
+ int result;
+ uint8_t* dataOut = reinterpret_cast<uint8_t*>(buffer);
+
+ result = ops->read(args, dataOut, size);
+ if (result == -1) {
+ etiLog.print(TcpLog::CRIT, "ERROR: Can't read file\n");
+ perror("");
+ return -1;
+ }
+ if (result < size) {
+ int sizeOut = result;
+ etiLog.print(TcpLog::NOTICE, "reach end of file -> rewinding\n");
+ if (ops->rewind(args) == -1) {
+ etiLog.print(TcpLog::CRIT, "ERROR: Can't rewind file\n");
+ return -1;
+ }
+
+ result = ops->read(args, dataOut + sizeOut, size - sizeOut);
+ if (result == -1) {
+ etiLog.print(TcpLog::CRIT, "ERROR: Can't read file\n");
+ perror("");
+ return -1;
+ }
+
+ if (result < size) {
+ etiLog.print(TcpLog::CRIT, "ERROR: Not enought data in file\n");
+ return -1;
+ }
+ }
+
+ return size;
+}
+
+
+int dabInputDabplusFileClose(void* args)
+{
+ dabInputDabplusFileData* data = (dabInputDabplusFileData*)args;
+ if (data->file != -1) {
+ close(data->file);
+ }
+ return 0;
+}
+
+
+int dabInputDabplusFileClean(void** args)
+{
+ dabInputDabplusFileData* data = (dabInputDabplusFileData*)*args;
+ if (data->buffer != NULL) {
+ delete[] data->buffer;
+ }
+ delete data;
+ return 0;
+}
+
+
+int dabInputDabplusFileRewind(void* args)
+{
+ dabInputDabplusFileData* data = (dabInputDabplusFileData*)args;
+ return lseek(data->file, 0, SEEK_SET);
+}
+
+
+# endif
+#endif
diff --git a/src/dabInputDabplusFile.h b/src/dabInputDabplusFile.h
new file mode 100644
index 0000000..26a67a5
--- /dev/null
+++ b/src/dabInputDabplusFile.h
@@ -0,0 +1,62 @@
+/*
+ Copyright (C) 2009 Her Majesty the Queen in Right of Canada (Communications
+ Research Center Canada)
+ */
+/*
+ This file is part of CRC-DabMux.
+
+ CRC-DabMux is free software: you can 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.
+
+ CRC-DabMux is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with CRC-DabMux. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef DAB_INPUT_DABPLUS_FILE_H
+#define DAB_INPUT_DABPLUS_FILE_H
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#include <stdint.h>
+#include <unistd.h>
+
+
+#ifdef HAVE_FORMAT_DABPLUS
+# ifdef HAVE_INPUT_FILE
+
+
+extern struct dabInputOperations dabInputDabplusFileOperations;
+
+
+struct dabInputDabplusFileData {
+ int file;
+ uint8_t* buffer;
+ size_t bufferSize;
+ size_t bufferIndex;
+};
+
+
+int dabInputDabplusFileInit(void** args);
+int dabInputDabplusFileOpen(void* args, const char* filename);
+int dabInputDabplusFileRead(void* args, void* buffer, int size);
+int dabInputDabplusFileReadFrame(dabInputOperations* ops, void* args,
+ void* buffer, int size);
+int dabInputDabplusFileClose(void* args);
+int dabInputDabplusFileClean(void** args);
+int dabInputDabplusFileRewind(void* args);
+
+
+# endif
+#endif
+
+
+#endif // DAB_INPUT_DABPLUS_FILE_H
diff --git a/src/dabInputDmbFile.cpp b/src/dabInputDmbFile.cpp
new file mode 100644
index 0000000..a057764
--- /dev/null
+++ b/src/dabInputDmbFile.cpp
@@ -0,0 +1,161 @@
+/*
+ Copyright (C) 2009 Her Majesty the Queen in Right of Canada (Communications
+ Research Center Canada)
+ */
+/*
+ This file is part of CRC-DabMux.
+
+ CRC-DabMux is free software: you can 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.
+
+ CRC-DabMux is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with CRC-DabMux. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "dabInputDmbFile.h"
+#include "dabInputFifo.h"
+#include "Dmb.h"
+#include "UdpSocket.h"
+
+#include <string.h>
+#include <stdio.h>
+
+
+struct dabInputDmbFileData {
+ FILE* file;
+ Dmb* dmb;
+ dabInputFifoStats stats;
+ unsigned char buffer[188];
+ unsigned bufferLength;
+};
+
+
+struct dabInputOperations dabInputDmbFileOperations = {
+ dabInputDmbFileInit,
+ dabInputDmbFileOpen,
+ dabInputSetbuf,
+ NULL,
+ NULL,
+ NULL,
+ dabInputDmbFileRead,
+ dabInputSetbitrate,
+ dabInputDmbFileClose,
+ dabInputDmbFileClean,
+ NULL
+};
+
+
+int dabInputDmbFileInit(void** args)
+{
+ dabInputDmbFileData* input = new dabInputDmbFileData;
+ memset(&input->stats, 0, sizeof(input->stats));
+ input->stats.id = dabInputFifoData::nb++;
+ input->file = NULL;
+ input->bufferLength = 0;
+ input->dmb = new Dmb();
+ *args = input;
+
+ UdpSocket::init();
+ return 0;
+}
+
+
+int dabInputDmbFileOpen(void* args, const char* inputName)
+{
+ int returnCode = 0;
+ dabInputDmbFileData* input = (dabInputDmbFileData*)args;
+
+ input->file = fopen(inputName, "r");
+ if (input->file == NULL) {
+ perror(inputName);
+ returnCode = -1;
+ }
+
+ return returnCode;;
+}
+
+
+int dabInputDmbFileRead(dabInputOperations* ops, void* args, void* buffer, int size)
+{
+ int nbBytes = 0;
+ dabInputDmbFileData* input = (dabInputDmbFileData*)args;
+ dabInputFifoStats* stats = (dabInputFifoStats*)&input->stats;
+
+ input->stats.frameRecords[input->stats.frameCount].curSize = 0;
+ input->stats.frameRecords[input->stats.frameCount].maxSize = size;
+
+ if (input->bufferLength == 0) {
+ input->bufferLength = fread(input->buffer, 188, 1, input->file);
+ }
+/* while ((nbBytes = writePacket(input->packet->getData(),
+ input->packet->getLength(), buffer, size, input->info))
+ != 0) {
+ input->stats.frameRecords[input->stats.frameCount].curSize = nbBytes;
+ input->socket->receive(*input->packet);
+ }*/
+ while ((nbBytes = input->dmb->encode(input->buffer,
+ input->bufferLength * 188, buffer, size))
+ != 0) {
+ input->stats.frameRecords[input->stats.frameCount].curSize = nbBytes;
+ input->bufferLength = fread(input->buffer, 188, 1, input->file);
+ if (input->bufferLength == 0) {
+ etiLog.print(TcpLog::NOTICE, "reach end of file -> rewinding\n");
+ if (fseek(input->file, 0, SEEK_SET) == 0) {
+ input->bufferLength = fread(input->buffer, 188, 1, input->file);
+ }
+ }
+ //++mpgFrameNb;
+ }
+ //++dmbFrameNb;
+
+ if (input->bufferLength != 0) {
+ input->stats.frameRecords[input->stats.frameCount].curSize = size;
+ }
+
+ if (++stats->frameCount == NB_RECORDS) {
+ etiLog.print(TcpLog::INFO, "Data subchannel usage: (%i)",
+ stats->id);
+ for (int i = 0; i < stats->frameCount; ++i) {
+ etiLog.print(TcpLog::INFO, " %i/%i",
+ stats->frameRecords[i].curSize,
+ stats->frameRecords[i].maxSize);
+ }
+ etiLog.print(TcpLog::INFO, "\n");
+ stats->frameCount = 0;
+ }
+ return size;
+}
+
+
+int dabInputDmbFileClose(void* args)
+{
+ dabInputDmbFileData* input = (dabInputDmbFileData*)args;
+
+ if (input->file != NULL) {
+ if (fclose(input->file)) {
+ perror("");
+ return -1;
+ }
+ }
+
+ return 0;
+}
+
+
+int dabInputDmbFileClean(void** args)
+{
+ dabInputDmbFileData* input = (dabInputDmbFileData*)(*args);
+ dabInputDmbFileClose(args);
+ delete input->dmb;
+ delete input;
+ return 0;
+}
+
+
diff --git a/src/dabInputDmbFile.h b/src/dabInputDmbFile.h
new file mode 100644
index 0000000..f77ab77
--- /dev/null
+++ b/src/dabInputDmbFile.h
@@ -0,0 +1,49 @@
+/*
+ Copyright (C) 2009 Her Majesty the Queen in Right of Canada (Communications
+ Research Center Canada)
+ */
+/*
+ This file is part of CRC-DabMux.
+
+ CRC-DabMux is free software: you can 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.
+
+ CRC-DabMux is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with CRC-DabMux. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef DAB_INPUT_DMB_FILE_H
+#define DAB_INPUT_DMB_FILE_H
+
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+#include "dabInput.h"
+
+
+#ifdef HAVE_FORMAT_DMB
+# ifdef HAVE_INPUT_FILE
+
+
+extern struct dabInputOperations dabInputDmbFileOperations;
+
+int dabInputDmbFileInit(void** args);
+int dabInputDmbFileOpen(void* args, const char* inputName);
+int dabInputDmbFileRead(dabInputOperations* ops, void* args, void* buffer, int size);
+int dabInputDmbFileClose(void* args);
+int dabInputDmbFileClean(void** args);
+
+
+# endif
+#endif
+
+
+#endif // DAB_INPUT_DMB_FILE_H
diff --git a/src/dabInputDmbUdp.cpp b/src/dabInputDmbUdp.cpp
new file mode 100644
index 0000000..935e925
--- /dev/null
+++ b/src/dabInputDmbUdp.cpp
@@ -0,0 +1,191 @@
+/*
+ Copyright (C) 2009 Her Majesty the Queen in Right of Canada (Communications
+ Research Center Canada)
+ */
+/*
+ This file is part of CRC-DabMux.
+
+ CRC-DabMux is free software: you can 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.
+
+ CRC-DabMux is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with CRC-DabMux. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "dabInputDmbUdp.h"
+#include "dabInputFifo.h"
+#include "Dmb.h"
+#include "UdpSocket.h"
+
+#include <string.h>
+#include <limits.h>
+
+
+#ifdef HAVE_FORMAT_DMB
+# ifdef HAVE_INPUT_UDP
+
+
+struct dabInputDmbUdpData {
+ UdpSocket* socket;
+ UdpPacket* packet;
+ Dmb* dmb;
+ dabInputFifoStats stats;
+};
+
+
+struct dabInputOperations dabInputDmbUdpOperations = {
+ dabInputDmbUdpInit,
+ dabInputDmbUdpOpen,
+ dabInputSetbuf,
+ NULL,
+ NULL,
+ NULL,
+ dabInputDmbUdpRead,
+ dabInputSetbitrate,
+ dabInputDmbUdpClose,
+ dabInputDmbUdpClean,
+ NULL
+};
+
+
+int dabInputDmbUdpInit(void** args)
+{
+ dabInputDmbUdpData* input = new dabInputDmbUdpData;
+ memset(&input->stats, 0, sizeof(input->stats));
+ input->stats.id = dabInputFifoData::nb++;
+ input->socket = new UdpSocket();
+ input->packet = new UdpPacket(2048);
+ input->dmb = new Dmb();
+ *args = input;
+
+ UdpSocket::init();
+ return 0;
+}
+
+
+int dabInputDmbUdpOpen(void* args, const char* inputName)
+{
+ int returnCode = 0;
+ char* address;
+ char* ptr;
+ long port;
+ address = strdup(inputName);
+ ptr = strchr(address, ':');
+ if (ptr == NULL) {
+ etiLog.print(TcpLog::ERR,
+ "\"%s\" is an invalid format for udp address: "
+ "should be [address]:port - > aborting\n", address);
+ returnCode = -1;
+ }
+ *(ptr++) = 0;
+ port = strtol(ptr, (char **)NULL, 10);
+ if ((port == LONG_MIN) || (port == LONG_MAX)) {
+ etiLog.print(TcpLog::ERR,
+ "can't convert port number in udp address %s\n",
+ address);
+ returnCode = -1;
+ }
+ if (port == 0) {
+ etiLog.print(TcpLog::ERR, "can't use port number 0 in udp address\n");
+ returnCode = -1;
+ }
+ dabInputDmbUdpData* input = (dabInputDmbUdpData*)args;
+ if (input->socket->create(port) == -1) {
+ etiLog.print(TcpLog::ERR, "can't set port %i on Dmb input (%s: %s)\n",
+ port, inetErrDesc, inetErrMsg);
+ returnCode = -1;
+ }
+
+ if (*address != 0) {
+ if (input->socket->joinGroup(address) == -1) {
+ etiLog.print(TcpLog::ERR,
+ "can't join multicast group %s (%s: %s)\n",
+ address, inetErrDesc, inetErrMsg);
+ returnCode = -1;
+ }
+ }
+
+ if (input->socket->setBlocking(false) == -1) {
+ etiLog.print(TcpLog::ERR, "can't set Dmb input socket in blocking mode "
+ "(%s: %s)\n", inetErrDesc, inetErrMsg);
+ returnCode = -1;
+ }
+
+ free(address);
+ etiLog.print(TcpLog::DBG, "check return code of create\n");
+ return returnCode;;
+}
+
+
+int dabInputDmbUdpRead(dabInputOperations* ops, void* args, void* buffer, int size)
+{
+ int nbBytes = 0;
+ dabInputDmbUdpData* input = (dabInputDmbUdpData*)args;
+ dabInputFifoStats* stats = (dabInputFifoStats*)&input->stats;
+
+ input->stats.frameRecords[input->stats.frameCount].curSize = 0;
+ input->stats.frameRecords[input->stats.frameCount].maxSize = size;
+
+ if (input->packet->getLength() == 0) {
+ input->socket->receive(*input->packet);
+ }
+/* while ((nbBytes = writePacket(input->packet->getData(),
+ input->packet->getLength(), buffer, size, input->info))
+ != 0) {
+ input->stats.frameRecords[input->stats.frameCount].curSize = nbBytes;
+ input->socket->receive(*input->packet);
+ }*/
+ while ((nbBytes = input->dmb->encode(input->packet->getData(),
+ input->packet->getLength(), buffer, size))
+ != 0) {
+ input->stats.frameRecords[input->stats.frameCount].curSize = nbBytes;
+ input->socket->receive(*input->packet);
+ //++mpgFrameNb;
+ }
+ //++dmbFrameNb;
+
+ if (input->packet->getLength() != 0) {
+ input->stats.frameRecords[input->stats.frameCount].curSize = size;
+ }
+
+ if (++stats->frameCount == NB_RECORDS) {
+ etiLog.print(TcpLog::INFO, "Data subchannel usage: (%i)",
+ stats->id);
+ for (int i = 0; i < stats->frameCount; ++i) {
+ etiLog.print(TcpLog::INFO, " %i/%i",
+ stats->frameRecords[i].curSize,
+ stats->frameRecords[i].maxSize);
+ }
+ etiLog.print(TcpLog::INFO, "\n");
+ stats->frameCount = 0;
+ }
+ return size;
+}
+
+
+int dabInputDmbUdpClose(void* args)
+{
+ return 0;
+}
+
+
+int dabInputDmbUdpClean(void** args)
+{
+ dabInputDmbUdpData* input = (dabInputDmbUdpData*)(*args);
+ delete input->socket;
+ delete input->packet;
+ delete input->dmb;
+ delete input;
+ return 0;
+}
+
+
+# endif
+#endif
diff --git a/src/dabInputDmbUdp.h b/src/dabInputDmbUdp.h
new file mode 100644
index 0000000..1dfcf35
--- /dev/null
+++ b/src/dabInputDmbUdp.h
@@ -0,0 +1,49 @@
+/*
+ Copyright (C) 2009 Her Majesty the Queen in Right of Canada (Communications
+ Research Center Canada)
+ */
+/*
+ This file is part of CRC-DabMux.
+
+ CRC-DabMux is free software: you can 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.
+
+ CRC-DabMux is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with CRC-DabMux. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef DAB_INPUT_DMB_UDP_H
+#define DAB_INPUT_DMB_UDP_H
+
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+#include "dabInput.h"
+
+
+#ifdef HAVE_FORMAT_DMB
+# ifdef HAVE_INPUT_UDP
+
+
+extern struct dabInputOperations dabInputDmbUdpOperations;
+
+int dabInputDmbUdpInit(void** args);
+int dabInputDmbUdpOpen(void* args, const char* inputName);
+int dabInputDmbUdpRead(dabInputOperations* ops, void* args, void* buffer, int size);
+int dabInputDmbUdpClose(void* args);
+int dabInputDmbUdpClean(void** args);
+
+
+# endif
+#endif
+
+
+#endif // DAB_INPUT_DMB_UDP_H
diff --git a/src/dabInputEnhancedFifo.cpp b/src/dabInputEnhancedFifo.cpp
new file mode 100644
index 0000000..b187aec
--- /dev/null
+++ b/src/dabInputEnhancedFifo.cpp
@@ -0,0 +1,64 @@
+/*
+ Copyright (C) 2009 Her Majesty the Queen in Right of Canada (Communications
+ Research Center Canada)
+ */
+/*
+ This file is part of CRC-DabMux.
+
+ CRC-DabMux is free software: you can 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.
+
+ CRC-DabMux is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with CRC-DabMux. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "dabInputEnhancedFifo.h"
+#include "dabInputPacketFile.h"
+#include "dabInputFifo.h"
+
+
+#ifdef HAVE_FORMAT_PACKET
+# ifdef HAVE_FORMAT_EPM
+# ifdef HAVE_INPUT_FIFO
+
+
+struct dabInputOperations dabInputEnhancedFifoOperations = {
+ dabInputEnhancedFifoInit,
+ dabInputFifoOpen,
+ dabInputFifoSetbuf,
+ dabInputFifoRead,
+ dabInputFifoLock,
+ dabInputFifoUnlock,
+ dabInputPacketFileRead,
+ dabInputSetbitrate,
+ dabInputFifoClose,
+ dabInputFifoClean,
+ dabInputFifoRewind
+};
+
+
+int dabInputEnhancedFifoInit(void** args)
+{
+ dabInputFifoInit(args);
+ dabInputFifoData* data = (dabInputFifoData*)*args;
+
+ data->packetData = new unsigned char[96];
+ data->enhancedPacketData = new unsigned char*[12];
+ for (int i = 0; i < 12; ++i) {
+ data->enhancedPacketData[i] = new unsigned char[204];
+ }
+
+ return 0;
+}
+
+
+# endif
+# endif
+#endif
diff --git a/src/dabInputEnhancedFifo.h b/src/dabInputEnhancedFifo.h
new file mode 100644
index 0000000..2479c88
--- /dev/null
+++ b/src/dabInputEnhancedFifo.h
@@ -0,0 +1,46 @@
+/*
+ Copyright (C) 2009 Her Majesty the Queen in Right of Canada (Communications
+ Research Center Canada)
+ */
+/*
+ This file is part of CRC-DabMux.
+
+ CRC-DabMux is free software: you can 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.
+
+ CRC-DabMux is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with CRC-DabMux. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef DAB_INPUT_ENHANCED_FIFO_H
+#define DAB_INPUT_ENHANCED_FIFO_H
+
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+#include "dabInput.h"
+
+
+#ifdef HAVE_FORMAT_PACKET
+# ifdef HAVE_FORMAT_EPM
+# ifdef HAVE_INPUT_FIFO
+
+
+extern struct dabInputOperations dabInputEnhancedFifoOperations;
+int dabInputEnhancedFifoInit(void** args);
+
+
+# endif
+# endif
+#endif
+
+
+#endif // DAB_INPUT_ENHANCED_FIFO_H
diff --git a/src/dabInputEnhancedPacketFile.cpp b/src/dabInputEnhancedPacketFile.cpp
new file mode 100644
index 0000000..b3b48bf
--- /dev/null
+++ b/src/dabInputEnhancedPacketFile.cpp
@@ -0,0 +1,53 @@
+/*
+ Copyright (C) 2009 Her Majesty the Queen in Right of Canada (Communications
+ Research Center Canada)
+ */
+/*
+ This file is part of CRC-DabMux.
+
+ CRC-DabMux is free software: you can 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.
+
+ CRC-DabMux is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with CRC-DabMux. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "dabInputEnhancedPacketFile.h"
+#include "dabInputPacketFile.h"
+#include "dabInputFile.h"
+
+
+struct dabInputOperations dabInputEnhancedPacketFileOperations = {
+ dabInputEnhancedFileInit,
+ dabInputFileOpen,
+ dabInputSetbuf,
+ dabInputFileRead,
+ NULL,
+ NULL,
+ dabInputPacketFileRead,
+ dabInputSetbitrate,
+ dabInputFileClose,
+ dabInputFileClean,
+ dabInputFileRewind
+};
+
+
+int dabInputEnhancedFileInit(void** args)
+{
+ dabInputFileInit(args);
+ dabInputFileData* data = (dabInputFileData*)*args;
+
+ data->enhancedPacketData = new unsigned char*[12];
+ for (int i = 0; i < 12; ++i) {
+ data->enhancedPacketData[i] = new unsigned char[204];
+ }
+
+ return 0;
+}
diff --git a/src/dabInputEnhancedPacketFile.h b/src/dabInputEnhancedPacketFile.h
new file mode 100644
index 0000000..0f419e0
--- /dev/null
+++ b/src/dabInputEnhancedPacketFile.h
@@ -0,0 +1,47 @@
+/*
+ Copyright (C) 2009 Her Majesty the Queen in Right of Canada (Communications
+ Research Center Canada)
+ */
+/*
+ This file is part of CRC-DabMux.
+
+ CRC-DabMux is free software: you can 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.
+
+ CRC-DabMux is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with CRC-DabMux. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef DAB_INPUT_ENHANCED_PACKET_FILE_H
+#define DAB_INPUT_ENHANCED_PACKET_FILE_H
+
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+#include "dabInput.h"
+
+
+#ifdef HAVE_FORMAT_PACKET
+# ifdef HAVE_FORMAT_EPM
+# ifdef HAVE_INPUT_FILE
+
+
+extern struct dabInputOperations dabInputEnhancedPacketFileOperations;
+
+int dabInputEnhancedFileInit(void** args);
+
+
+# endif
+# endif
+#endif
+
+
+#endif // DAB_INPUT_ENHANCED_PACKET_FILE_H
diff --git a/src/dabInputFifo.cpp b/src/dabInputFifo.cpp
new file mode 100644
index 0000000..a2c2ef7
--- /dev/null
+++ b/src/dabInputFifo.cpp
@@ -0,0 +1,513 @@
+/*
+ Copyright (C) 2009 Her Majesty the Queen in Right of Canada (Communications
+ Research Center Canada)
+ */
+/*
+ This file is part of CRC-DabMux.
+
+ CRC-DabMux is free software: you can 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.
+
+ CRC-DabMux is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with CRC-DabMux. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "dabInputFifo.h"
+#include "dabInputPacketFile.h"
+#include "dabInput.h"
+
+#include <unistd.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <fcntl.h>
+
+
+#ifdef HAVE_FORMAT_PACKET
+# ifdef HAVE_INPUT_FIFO
+
+
+int dabInputFifoData::nb = 0;
+
+
+struct dabInputOperations dabInputFifoOperations = {
+ dabInputFifoInit,
+ dabInputFifoOpen,
+ dabInputFifoSetbuf,
+ dabInputFifoRead,
+ dabInputFifoLock,
+ dabInputFifoUnlock,
+ dabInputPacketFileRead,
+ dabInputSetbitrate,
+ dabInputFifoClose,
+ dabInputFifoClean,
+ dabInputFifoRewind
+};
+
+
+int dabInputFifoInit(void** args)
+{
+ dabInputFifoData* data = new dabInputFifoData;
+ memset(data, 0, sizeof(*data));
+ data->stats.id = dabInputFifoData::nb++;
+ data->maxSize = 0;
+ data->curSize = 0;
+ data->head = 0;
+ data->tail = 0;
+ data->buffer = NULL;
+ data->packetData = NULL;
+ data->enhancedPacketData = NULL;
+ data->packetLength = 0;
+ data->enhancedPacketLength = 0;
+ data->enhancedPacketWaiting = 0;
+ data->full = false;
+ data->running = true;
+ data->thread = (pthread_t)NULL;
+#ifdef _WIN32
+ char semName[32];
+ sprintf(semName, "semInfo%i", data->stats.id);
+ data->semInfo = CreateSemaphore(NULL, 1, 1, semName);
+ if (data->semInfo == NULL) {
+ fprintf(stderr, "Can't init FIFO data semaphore %s\n", semName);
+ return -1;
+ }
+ sprintf(semName, "semBuffer%i", data->stats.id);
+ data->semBuffer = CreateSemaphore(NULL, 1, 1, semName);
+ if (data->semBuffer == NULL) {
+ fprintf(stderr, "Can't init FIFO buffer semaphore %s\n", semName);
+ return -1;
+ }
+ sprintf(semName, "semFull%i", data->stats.id);
+ data->semFull = CreateSemaphore(NULL, 1, 1, semName);
+ if (data->semFull == NULL) {
+ fprintf(stderr, "Can't init FIFO semaphore %s\n", semName);
+ return -1;
+ }
+#else
+ if (sem_init(&data->semInfo, 0, 1) == -1) {
+ perror("Can't init FIFO data semaphore");
+ return -1;
+ }
+ if (sem_init(&data->semBuffer, 0, 0) == -1) {
+ perror("Can't init fIFO buffer semaphore");
+ return -1;
+ }
+ if (sem_init(&data->semFull, 0, 0) == -1) {
+ perror("Can't init FIFO semaphore");
+ return -1;
+ }
+#endif
+
+ if (data->maxSize > 0) {
+#ifdef _WIN32
+ ReleaseSemaphore(data->semBuffer, 1, NULL);
+#else
+ sem_post(&data->semBuffer);
+#endif
+ }
+ *args = data;
+ return 0;
+}
+
+
+int dabInputFifoOpen(void* args, const char* filename)
+{
+ dabInputFifoData* data = (dabInputFifoData*)args;
+ data->file = open(filename, O_RDONLY | O_BINARY | O_NONBLOCK);
+ if (data->file == -1) {
+ perror(filename);
+ return -1;
+ }
+#ifdef _WIN32
+#else
+ int flags = fcntl(data->file, F_GETFL);
+ if (flags == -1) {
+ perror(filename);
+ return -1;
+ }
+ if (fcntl(data->file, F_SETFL, flags & ~O_NONBLOCK) == -1) {
+ perror(filename);
+ return -1;
+ }
+#endif
+
+#ifdef _WIN32
+ data->thread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)dabInputFifoThread, data, 0, NULL);
+ if (data->thread == NULL) {
+ fprintf(stderr, "Can't create FIFO child\n");
+ return -1;
+ }
+#else
+ if (pthread_create(&data->thread, NULL, dabInputFifoThread, data)) {
+ perror("Can't create FIFO child");
+ return -1;
+ }
+#endif
+
+ return 0;
+}
+
+
+int dabInputFifoSetbuf(void* args, int size)
+{
+ dabInputFifoData* data = (dabInputFifoData*)args;
+
+ if (data->maxSize > 0) {
+#ifdef _WIN32
+ WaitForSingleObject(data->semBuffer, INFINITE);
+#else
+ sem_wait(&data->semBuffer);
+#endif
+ }
+ if (data->buffer != NULL) {
+ delete data->buffer;
+ }
+ if (size == 0) {
+ size = 1024;
+ }
+ data->buffer = new unsigned char[size * 16];
+ data->maxSize = size * 16;
+#ifdef _WIN32
+ ReleaseSemaphore(data->semBuffer, 1, NULL);
+#else
+ sem_post(&data->semBuffer);
+#endif
+
+ return 0;
+}
+
+
+int dabInputFifoRead(void* args, void* buffer, int size)
+{
+ //fprintf(stderr, "INFO: read %i bytes\n", size);
+ dabInputFifoData* data = (dabInputFifoData*)args;
+ dabInputFifoStats* stats = &data->stats;
+ int head;
+ int tail;
+ int curSize;
+ int maxSize;
+#ifdef _WIN32
+ WaitForSingleObject(data->semInfo, INFINITE);
+#else
+ sem_wait(&data->semInfo);
+#endif
+ head = data->head;
+ tail = data->tail;
+ curSize = data->curSize;
+ maxSize = data->maxSize;
+#ifdef _WIN32
+ ReleaseSemaphore(data->semInfo, 1, NULL);
+#else
+ sem_post(&data->semInfo);
+#endif
+ //fprintf(stderr, "head: %i, tail: %i, curSize: %i\n", head, tail, curSize);
+ if (size > curSize) {
+ if (curSize == 0) {
+ stats->empty = true;
+ } else {
+ etiLog.print(TcpLog::WARNING, "Not enough data in FIFO buffer: (%i) %i/%i\n",
+ data->stats.id, curSize, size);
+ }
+ return 0;
+ }
+ if (head > tail) {
+ memcpy(buffer, data->buffer + tail, size);
+#ifdef _WIN32
+ WaitForSingleObject(data->semInfo, INFINITE);
+#else
+ sem_wait(&data->semInfo);
+#endif
+ data->tail += size;
+ data->curSize -= size;
+#ifdef _WIN32
+ ReleaseSemaphore(data->semInfo, 1, NULL);
+#else
+ sem_post(&data->semInfo);
+#endif
+ return size;
+ } else {
+ if (maxSize - tail >= size) {
+ memcpy(buffer, data->buffer + tail, size);
+#ifdef _WIN32
+ WaitForSingleObject(data->semInfo, INFINITE);
+#else
+ sem_wait(&data->semInfo);
+#endif
+ data->tail += size;
+ data->curSize -= size;
+#ifdef _WIN32
+ ReleaseSemaphore(data->semInfo, 1, NULL);
+#else
+ sem_post(&data->semInfo);
+#endif
+ return size;
+ } else {
+ memcpy(buffer, data->buffer + tail, maxSize - tail);
+#ifdef _WIN32
+ WaitForSingleObject(data->semInfo, INFINITE);
+#else
+ sem_wait(&data->semInfo);
+#endif
+ data->tail = 0;
+ data->curSize -= maxSize - tail;
+#ifdef _WIN32
+ ReleaseSemaphore(data->semInfo, 1, NULL);
+#else
+ sem_post(&data->semInfo);
+#endif
+ return maxSize - tail + dabInputFifoRead(data, (char*)buffer + maxSize - tail, size - (maxSize - tail));
+ }
+ }
+ return -1;
+}
+
+
+int dabInputFifoLock(void* args) {
+ dabInputFifoData* data = (dabInputFifoData*)args;
+ dabInputFifoStats* stats = &data->stats;
+
+ int maxSize;
+ int curSize;
+#ifdef _WIN32
+ WaitForSingleObject(data->semInfo, INFINITE);
+#else
+ sem_wait(&data->semInfo);
+#endif
+ maxSize = data->maxSize;
+ curSize = data->curSize;
+#ifdef _WIN32
+ ReleaseSemaphore(data->semInfo, 1, NULL);
+#else
+ sem_post(&data->semInfo);
+#endif
+
+ stats->bufferRecords[stats->bufferCount].curSize = curSize;
+ stats->bufferRecords[stats->bufferCount].maxSize = maxSize;
+
+ if (++stats->bufferCount == NB_RECORDS) {
+ etiLog.print(TcpLog::INFO, "FIFO buffer state: (%i)", stats->id);
+ for (int i = 0; i < stats->bufferCount; ++i) {
+ etiLog.print(TcpLog::INFO, " %i/%i",
+ stats->bufferRecords[i].curSize,
+ stats->bufferRecords[i].maxSize);
+ }
+ etiLog.print(TcpLog::INFO, "\n");
+
+ if (stats->full) {
+ etiLog.print(TcpLog::WARNING, "FIFO buffer full: (%i)\n",
+ data->stats.id);
+ stats->full = false;
+ }
+ if (stats->empty) {
+ etiLog.print(TcpLog::WARNING, "FIFO buffer empty: (%i)\n",
+ data->stats.id);
+ stats->empty = false;
+ }
+ if (stats->error) {
+ etiLog.print(TcpLog::ERR, "FIFO input read error: (%i)\n",
+ data->stats.id);
+ stats->error = false;
+ }
+ if (stats->input) {
+ etiLog.print(TcpLog::ERR, "FIFO input not connected: (%i)\n",
+ data->stats.id);
+ stats->input = false;
+ }
+
+ stats->bufferCount = 0;
+ }
+ return 0;
+}
+
+
+int dabInputFifoUnlock(void* args) {
+ dabInputFifoData* data = (dabInputFifoData*)args;
+ if (data->full) {
+#ifdef _WIN32
+ ReleaseSemaphore(data->semFull, 1, NULL);
+#else
+ sem_post(&data->semFull);
+#endif
+ }
+ return 0;
+}
+
+
+int dabInputFifoClose(void* args)
+{
+ dabInputFifoData* data = (dabInputFifoData*)args;
+ close(data->file);
+ return 0;
+}
+
+
+int dabInputFifoClean(void** args)
+{
+ dabInputFifoData* data = (dabInputFifoData*)*args;
+ data->running = false;
+ etiLog.print(TcpLog::DBG, "Wait FIFO child...\n");
+#ifdef WIN32
+ DWORD status;
+ for (int i = 0; i < 5; ++i) {
+ if (GetExitCodeThread(data->thread, &status)) {
+ break;
+ }
+ Sleep(100);
+ }
+ TerminateThread(data->thread, 1);
+ if (CloseHandle(data->thread) == 0) {
+ etiLog.print(TcpLog::DBG, "ERROR: Failed to close FIFO child thread\n");
+ }
+#else
+ if (data->thread != (pthread_t)NULL) {
+ if (pthread_join(data->thread, NULL)) {
+ etiLog.print(TcpLog::DBG, "ERROR: FIFO child thread had not exit normally\n");
+ }
+ }
+#endif
+ etiLog.print(TcpLog::DBG, "Done\n");
+#ifdef _WIN32
+ CloseHandle(data->semInfo);
+ CloseHandle(data->semFull);
+ CloseHandle(data->semBuffer);
+#else
+ sem_destroy(&data->semInfo);
+ sem_destroy(&data->semFull);
+ sem_destroy(&data->semBuffer);
+#endif
+ if (data->packetData != NULL) {
+ delete[] data->packetData;
+ }
+ if (data->enhancedPacketData != NULL) {
+ for (int i = 0; i < 12; ++i) {
+ if (data->enhancedPacketData[i] != NULL) {
+ delete[] data->enhancedPacketData[i];
+ }
+ }
+ delete[] data->enhancedPacketData;
+ }
+ delete data->buffer;
+ delete data;
+ return 0;
+}
+
+
+int dabInputFifoRewind(void* args)
+{
+ return -1;
+}
+
+
+void* dabInputFifoThread(void* args)
+{
+ dabInputFifoData* data = (dabInputFifoData*)args;
+ int head;
+ int tail;
+ int curSize;
+ int maxSize;
+ int ret;
+ while (data->running) {
+#ifdef _WIN32
+ WaitForSingleObject(data->semBuffer, INFINITE);
+ WaitForSingleObject(data->semInfo, INFINITE);
+#else
+ sem_wait(&data->semBuffer);
+ sem_wait(&data->semInfo);
+#endif
+ head = data->head;
+ tail = data->tail;
+ curSize = data->curSize;
+ maxSize = data->maxSize;
+#ifdef _WIN32
+ ReleaseSemaphore(data->semInfo, 1, NULL);
+#else
+ sem_post(&data->semInfo);
+#endif
+ //fprintf(stderr, "thread, head: %i, tail: %i, curSize: %i\n", head, tail, curSize);
+
+ if (curSize == maxSize) {
+ data->stats.full = true;
+ data->full = true;
+#ifdef _WIN32
+ WaitForSingleObject(data->semFull, INFINITE);
+#else
+ sem_wait(&data->semFull);
+#endif
+ } else if (head >= tail) { // 2 blocks
+ ret = read(data->file, data->buffer + head, maxSize - head);
+ if (ret == 0) {
+ data->stats.input = true;
+ data->full = true;
+#ifdef _WIN32
+ WaitForSingleObject(data->semFull, INFINITE);
+#else
+ sem_wait(&data->semFull);
+#endif
+ } else if (ret == -1) {
+ data->stats.error = true;
+ } else {
+#ifdef _WIN32
+ WaitForSingleObject(data->semInfo, INFINITE);
+#else
+ sem_wait(&data->semInfo);
+#endif
+ data->head += ret;
+ data->curSize += ret;
+ if (data->head == maxSize) {
+ data->head = 0;
+ }
+#ifdef _WIN32
+ ReleaseSemaphore(data->semInfo, 1, NULL);
+#else
+ sem_post(&data->semInfo);
+#endif
+ }
+ } else { // 1 block
+ ret = read(data->file, data->buffer + head, tail - head);
+ if (ret == 0) {
+ data->stats.input = true;
+ data->full = true;
+#ifdef _WIN32
+ WaitForSingleObject(data->semFull, INFINITE);
+#else
+ sem_wait(&data->semFull);
+#endif
+ } else if (ret == -1) {
+ data->stats.error = true;
+ } else {
+#ifdef _WIN32
+ WaitForSingleObject(data->semInfo, INFINITE);
+#else
+ sem_wait(&data->semInfo);
+#endif
+ data->head += ret;
+ data->curSize += ret;
+ if (data->head == maxSize) {
+ data->head = 0;
+ }
+#ifdef _WIN32
+ ReleaseSemaphore(data->semInfo, 1, NULL);
+#else
+ sem_post(&data->semInfo);
+#endif
+ }
+ }
+#ifdef _WIN32
+ ReleaseSemaphore(data->semBuffer, 1, NULL);
+#else
+ sem_post(&data->semBuffer);
+#endif
+ }
+ return NULL;
+}
+
+
+# endif
+#endif
diff --git a/src/dabInputFifo.h b/src/dabInputFifo.h
new file mode 100644
index 0000000..1844d1e
--- /dev/null
+++ b/src/dabInputFifo.h
@@ -0,0 +1,101 @@
+/*
+ Copyright (C) 2009 Her Majesty the Queen in Right of Canada (Communications
+ Research Center Canada)
+ */
+/*
+ This file is part of CRC-DabMux.
+
+ CRC-DabMux is free software: you can 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.
+
+ CRC-DabMux is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with CRC-DabMux. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef DAB_INPUT_FIFO_H
+#define DAB_INPUT_FIFO_H
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+#include "dabInputFile.h"
+#include "TcpLog.h"
+extern TcpLog etiLog;
+
+
+#ifdef _WIN32
+# include <io.h>
+
+# define sem_t HANDLE
+# define O_NONBLOCK 0
+#else
+# include <semaphore.h>
+# define O_BINARY 0
+#endif
+
+
+#ifdef HAVE_FORMAT_PACKET
+# ifdef HAVE_INPUT_FIFO
+extern struct dabInputOperations dabInputFifoOperations;
+
+
+struct dabInputFifoStatRecord {
+ int curSize;
+ int maxSize;
+};
+
+
+#define NB_RECORDS 10
+struct dabInputFifoStats {
+ int id;
+ bool full;
+ bool empty;
+ bool error;
+ bool input;
+ int bufferCount;
+ dabInputFifoStatRecord bufferRecords[NB_RECORDS];
+ int frameCount;
+ dabInputFifoStatRecord frameRecords[NB_RECORDS];
+};
+
+
+struct dabInputFifoData : dabInputFileData {
+ static int nb;
+ int maxSize;
+ int curSize;
+ int head;
+ int tail;
+ dabInputFifoStats stats;
+ unsigned char* buffer;
+ pthread_t thread;
+ sem_t semInfo;
+ sem_t semBuffer;
+ sem_t semFull;
+ bool full;
+ bool running;
+};
+
+
+int dabInputFifoInit(void** args);
+int dabInputFifoOpen(void* args, const char* filename);
+int dabInputFifoSetbuf(void* args, int size);
+int dabInputFifoRead(void* args, void* buffer, int size);
+int dabInputFifoLock(void* args);
+int dabInputFifoUnlock(void* args);
+int dabInputFifoClose(void* args);
+int dabInputFifoClean(void** args);
+int dabInputFifoRewind(void* args);
+void* dabInputFifoThread(void* args);
+
+
+# endif
+#endif
+
+#endif // DAB_INPUT_FIFO_H
diff --git a/src/dabInputFile.cpp b/src/dabInputFile.cpp
new file mode 100644
index 0000000..330519a
--- /dev/null
+++ b/src/dabInputFile.cpp
@@ -0,0 +1,104 @@
+/*
+ Copyright (C) 2009,2011 Her Majesty the Queen in Right of Canada
+ (Communications Research Center Canada)
+ */
+/*
+ This file is part of CRC-DabMux.
+
+ CRC-DabMux is free software: you can 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.
+
+ CRC-DabMux is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with CRC-DabMux. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "dabInputFile.h"
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <fcntl.h>
+#include <unistd.h>
+
+#ifndef _WIN32
+# define O_BINARY 0
+#endif
+
+
+int dabInputFileInit(void** args)
+{
+ dabInputFileData* data = new dabInputFileData;
+ data->file = -1;
+ data->parity = false;
+ data->packetLength = 0;
+ data->packetData = new unsigned char[96];
+ data->enhancedPacketData = NULL;
+ data->enhancedPacketLength = 0;
+ data->enhancedPacketWaiting = 0;
+
+ *args = data;
+ return 0;
+}
+
+
+int dabInputFileOpen(void* args, const char* filename)
+{
+ dabInputFileData* data = (dabInputFileData*)args;
+ data->file = open(filename, O_RDONLY | O_BINARY);
+ if (data->file == -1) {
+ perror(filename);
+ return -1;
+ }
+ return 0;
+}
+
+
+int dabInputFileRead(void* args, void* buffer, int size)
+{
+ dabInputFileData* data = (dabInputFileData*)args;
+ return read(data->file, buffer, size);
+}
+
+
+int dabInputFileClose(void* args)
+{
+ dabInputFileData* data = (dabInputFileData*)args;
+ if (data->file != -1) {
+ close(data->file);
+ }
+ return 0;
+}
+
+
+int dabInputFileClean(void** args)
+{
+ dabInputFileData* data = (dabInputFileData*)*args;
+ if (data->packetData != NULL) {
+ delete[] data->packetData;
+ }
+ if (data->enhancedPacketData != NULL) {
+ for (int i = 0; i < 12; ++i) {
+ if (data->enhancedPacketData[i] != NULL) {
+ delete[] data->enhancedPacketData[i];
+ }
+ }
+ delete[] data->enhancedPacketData;
+ }
+ delete data;
+ return 0;
+}
+
+
+int dabInputFileRewind(void* args)
+{
+ dabInputFileData* data = (dabInputFileData*)args;
+ return lseek(data->file, 0, SEEK_SET);
+}
+
+
diff --git a/src/dabInputFile.h b/src/dabInputFile.h
new file mode 100644
index 0000000..af2798b
--- /dev/null
+++ b/src/dabInputFile.h
@@ -0,0 +1,49 @@
+/*
+ Copyright (C) 2009 Her Majesty the Queen in Right of Canada (Communications
+ Research Center Canada)
+ */
+/*
+ This file is part of CRC-DabMux.
+
+ CRC-DabMux is free software: you can 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.
+
+ CRC-DabMux is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with CRC-DabMux. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef DAB_INPUT_FILE_H
+#define DAB_INPUT_FILE_H
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+
+struct dabInputFileData {
+ int file;
+ bool parity;
+ unsigned packetLength;
+ unsigned char* packetData;
+ unsigned char** enhancedPacketData;
+ unsigned enhancedPacketLength;
+ unsigned enhancedPacketWaiting;
+};
+
+
+int dabInputFileInit(void** args);
+int dabInputFileOpen(void* args, const char* filename);
+int dabInputFileRead(void* args, void* buffer, int size);
+int dabInputFileClose(void* args);
+int dabInputFileClean(void** args);
+int dabInputFileRewind(void* args);
+
+
+#endif // DAB_INPUT_FILE_H
diff --git a/src/dabInputMpegFifo.cpp b/src/dabInputMpegFifo.cpp
new file mode 100644
index 0000000..b34ee76
--- /dev/null
+++ b/src/dabInputMpegFifo.cpp
@@ -0,0 +1,47 @@
+/*
+ Copyright (C) 2009 Her Majesty the Queen in Right of Canada (Communications
+ Research Center Canada)
+ */
+/*
+ This file is part of CRC-DabMux.
+
+ CRC-DabMux is free software: you can 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.
+
+ CRC-DabMux is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with CRC-DabMux. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "dabInputMpegFifo.h"
+#include "dabInputFifo.h"
+#include "dabInputMpegFile.h"
+
+
+#ifdef HAVE_FORMAT_MPEG
+# ifdef HAVE_INPUT_FIFO
+
+
+struct dabInputOperations dabInputMpegFifoOperations = {
+ dabInputFifoInit,
+ dabInputFifoOpen,
+ dabInputFifoSetbuf,
+ dabInputFifoRead,
+ dabInputFifoLock,
+ dabInputFifoUnlock,
+ dabInputMpegFileRead,
+ dabInputSetbitrate,
+ dabInputFifoClose,
+ dabInputFifoClean,
+ dabInputFifoRewind
+};
+
+
+# endif
+#endif
diff --git a/src/dabInputMpegFifo.h b/src/dabInputMpegFifo.h
new file mode 100644
index 0000000..e7b54dd
--- /dev/null
+++ b/src/dabInputMpegFifo.h
@@ -0,0 +1,37 @@
+/*
+ Copyright (C) 2009 Her Majesty the Queen in Right of Canada (Communications
+ Research Center Canada)
+ */
+/*
+ This file is part of CRC-DabMux.
+
+ CRC-DabMux is free software: you can 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.
+
+ CRC-DabMux is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with CRC-DabMux. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef DAB_INPUT_MPEG_FIFO_H
+#define DAB_INPUT_MPEG_FIFO_H
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+
+#ifdef HAVE_FORMAT_MPEG
+# ifdef HAVE_INPUT_FIFO
+extern struct dabInputOperations dabInputMpegFifoOperations;
+# endif
+#endif
+
+
+#endif // DAB_INPUT_MPEG_FIFO_H
diff --git a/src/dabInputMpegFile.cpp b/src/dabInputMpegFile.cpp
new file mode 100644
index 0000000..0a06b2f
--- /dev/null
+++ b/src/dabInputMpegFile.cpp
@@ -0,0 +1,201 @@
+/*
+ Copyright (C) 2009 Her Majesty the Queen in Right of Canada (Communications
+ Research Center Canada)
+ */
+/*
+ This file is part of CRC-DabMux.
+
+ CRC-DabMux is free software: you can 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.
+
+ CRC-DabMux is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with CRC-DabMux. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "dabInputMpegFile.h"
+#include "dabInputFile.h"
+#include "mpeg.h"
+
+#include <stdio.h>
+#include <errno.h>
+#include <string.h>
+
+
+#ifdef HAVE_FORMAT_MPEG
+# ifdef HAVE_INPUT_FILE
+
+
+struct dabInputOperations dabInputMpegFileOperations = {
+ dabInputFileInit,
+ dabInputFileOpen,
+ dabInputSetbuf,
+ dabInputFileRead,
+ NULL,
+ NULL,
+ dabInputMpegFileRead,
+ dabInputMpegSetbitrate,
+ dabInputFileClose,
+ dabInputFileClean,
+ dabInputFileRewind
+};
+
+
+#define MPEG_FREQUENCY -2
+#define MPEG_PADDING -3
+#define MPEG_COPYRIGHT -4
+#define MPEG_ORIGINAL -5
+#define MPEG_EMPHASIS -6
+int checkDabMpegFrame(void* data) {
+ mpegHeader* header = (mpegHeader*)data;
+ unsigned long* headerData = (unsigned long*)data;
+ if ((*headerData & 0x0f0ffcff) == 0x0004fcff) return 0;
+ if ((*headerData & 0x0f0ffcff) == 0x0004f4ff) return 0;
+ if (getMpegFrequency(header) != 48000) {
+ if (getMpegFrequency(header) != 24000) {
+ return MPEG_FREQUENCY;
+ }
+ }
+ if (header->padding != 0) {
+ return MPEG_PADDING;
+ }
+ if (header->copyright != 0) {
+ return MPEG_COPYRIGHT;
+ }
+ if (header->original != 0) {
+ return MPEG_ORIGINAL;
+ }
+ if (header->emphasis != 0) {
+ return MPEG_EMPHASIS;
+ }
+ return -1;
+}
+
+
+int dabInputMpegFileRead(dabInputOperations* ops, void* args, void* buffer, int size)
+{
+ dabInputFileData* data = (dabInputFileData*)args;
+ int result;
+ bool rewind = false;
+READ_SUBCHANNEL:
+ if (data->parity) {
+ result = readData(data->file, buffer, size, 2);
+ data->parity = false;
+ return 0;
+ } else {
+ result = readMpegHeader(data->file, buffer, size);
+ if (result > 0) {
+ result = readMpegFrame(data->file, buffer, size);
+ if (result < 0 && getMpegFrequency(buffer) == 24000) {
+ data->parity = true;
+ result = size;
+ }
+ }
+ }
+ switch (result) {
+ case MPEG_BUFFER_UNDERFLOW:
+ etiLog.print(TcpLog::WARNING, "data underflow -> frame muted\n");
+ goto MUTE_SUBCHANNEL;
+ case MPEG_BUFFER_OVERFLOW:
+ etiLog.print(TcpLog::WARNING, "bitrate too high -> frame muted\n");
+ goto MUTE_SUBCHANNEL;
+ case MPEG_FILE_EMPTY:
+ if (rewind) {
+ etiLog.print(TcpLog::ERR, "file rewinded and still empty "
+ "-> frame muted\n");
+ goto MUTE_SUBCHANNEL;
+ } else {
+ rewind = true;
+ etiLog.print(TcpLog::NOTICE, "reach end of file -> rewinding\n");
+ lseek(data->file, 0, SEEK_SET);
+ goto READ_SUBCHANNEL;
+ }
+ case MPEG_FILE_ERROR:
+ etiLog.print(TcpLog::CRIT, "can't read file (%i) -> frame muted\n", errno);
+ perror("");
+ goto MUTE_SUBCHANNEL;
+ case MPEG_SYNC_NOT_FOUND:
+ etiLog.print(TcpLog::CRIT, "mpeg sync not found, maybe is not a valid file "
+ "-> frame muted\n");
+ goto MUTE_SUBCHANNEL;
+ case MPEG_INVALID_FRAME:
+ etiLog.print(TcpLog::CRIT, "file is not a valid mpeg file "
+ "-> frame muted\n");
+ goto MUTE_SUBCHANNEL;
+ default:
+ if (result < 0) {
+ etiLog.print(TcpLog::CRIT,
+ "unknown error (code = %i) -> frame muted\n",
+ result);
+MUTE_SUBCHANNEL:
+ memset(buffer, 0, size);
+ } else {
+ if (result < size) {
+ etiLog.print(TcpLog::WARNING, "bitrate too low from file "
+ "-> frame padded\n");
+ memset((char*)buffer + result, 0, size - result);
+ }
+ result = checkDabMpegFrame(buffer);
+ switch (result) {
+ case MPEG_FREQUENCY:
+ etiLog.print(TcpLog::ERR, "file has a frame with an invalid "
+ "frequency: %i, should be 48000 or 24000\n",
+ getMpegFrequency(buffer));
+ break;
+ case MPEG_PADDING:
+ etiLog.print(TcpLog::WARNING,
+ "file has a frame with padding bit set\n");
+ break;
+ case MPEG_COPYRIGHT:
+ etiLog.print(TcpLog::WARNING,
+ "file has a frame with copyright bit set\n");
+ break;
+ case MPEG_ORIGINAL:
+ etiLog.print(TcpLog::WARNING,
+ "file has a frame with original bit set\n");
+ break;
+ case MPEG_EMPHASIS:
+ etiLog.print(TcpLog::WARNING,
+ "file has a frame with emphasis bits set\n");
+ break;
+ default:
+ if (result < 0) {
+ etiLog.print(TcpLog::CRIT, "mpeg file has an invalid DAB "
+ "mpeg frame (unknown reason: %i)\n", result);
+ }
+ break;
+ }
+ }
+ }
+ return result;
+}
+
+
+int dabInputMpegSetbitrate(dabInputOperations* ops, void* args, int bitrate)
+{
+ //dabInputFileData* data = (dabInputFileData*)args;
+ if (bitrate == 0) {
+ char buffer[4];
+
+ if (ops->readFrame(ops, args, buffer, 4) == 0) {
+ bitrate = getMpegBitrate(buffer);
+ } else {
+ bitrate = -1;
+ }
+ ops->rewind(args);
+ }
+ if (ops->setbuf(args, bitrate * 3) != 0) {
+ bitrate = -1;
+ }
+ return bitrate;
+}
+
+
+# endif
+#endif
diff --git a/src/dabInputMpegFile.h b/src/dabInputMpegFile.h
new file mode 100644
index 0000000..741a5f7
--- /dev/null
+++ b/src/dabInputMpegFile.h
@@ -0,0 +1,42 @@
+/*
+ Copyright (C) 2009 Her Majesty the Queen in Right of Canada (Communications
+ Research Center Canada)
+ */
+/*
+ This file is part of CRC-DabMux.
+
+ CRC-DabMux is free software: you can 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.
+
+ CRC-DabMux is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with CRC-DabMux. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef DAB_INPUT_MPEG_FILE_H
+#define DAB_INPUT_MPEG_FILE_H
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+#include "dabInput.h"
+
+
+#ifdef HAVE_FORMAT_MPEG
+# ifdef HAVE_INPUT_FILE
+extern struct dabInputOperations dabInputMpegFileOperations;
+
+int dabInputMpegFileRead(dabInputOperations* ops, void* args, void* buffer, int size);
+int dabInputMpegSetbitrate(dabInputOperations* ops, void* args, int bitrate);
+int checkDabMpegFrame(void* data);
+# endif
+#endif
+
+
+#endif // DAB_INPUT_MPEG_FILE_H
diff --git a/src/dabInputPacketFile.cpp b/src/dabInputPacketFile.cpp
new file mode 100644
index 0000000..65b5ebe
--- /dev/null
+++ b/src/dabInputPacketFile.cpp
@@ -0,0 +1,263 @@
+/*
+ Copyright (C) 2009, 2011 Her Majesty the Queen in Right of Canada
+ (Communications Research Center Canada)
+ */
+/*
+ This file is part of CRC-DabMux.
+
+ CRC-DabMux is free software: you can 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.
+
+ CRC-DabMux is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with CRC-DabMux. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "dabInputPacketFile.h"
+#include "dabInputFile.h"
+#include "dabInputFifo.h"
+#include "ReedSolomon.h"
+
+#ifdef HAVE_FORMAT_PACKET
+# ifdef HAVE_INPUT_FILE
+
+
+#include <string.h>
+#include <stdio.h>
+#include <errno.h>
+
+
+#ifdef _WIN32
+# pragma pack(push, 1)
+#endif
+struct packetHeader {
+ unsigned char addressHigh:2;
+ unsigned char last:1;
+ unsigned char first:1;
+ unsigned char continuityIndex:2;
+ unsigned char packetLength:2;
+ unsigned char addressLow;
+ unsigned char dataLength:7;
+ unsigned char command;
+}
+#ifdef _WIN32
+# pragma pack(pop)
+#else
+__attribute((packed))
+#endif
+;
+
+
+struct dabInputOperations dabInputPacketFileOperations = {
+ dabInputFileInit,
+ dabInputFileOpen,
+ dabInputSetbuf,
+ dabInputFileRead,
+ NULL,
+ NULL,
+ dabInputPacketFileRead,
+ dabInputSetbitrate,
+ dabInputFileClose,
+ dabInputFileClean,
+ dabInputFileRewind
+};
+
+
+int dabInputPacketFileRead(dabInputOperations* ops, void* args, void* buffer,
+ int size)
+{
+ dabInputFileData* data = (dabInputFileData*)args;
+ unsigned char* dataBuffer = (unsigned char*)buffer;
+ int written = 0;
+ int length;
+ packetHeader* header;
+ int indexRow;
+ int indexCol;
+
+ while (written < size) {
+ if (data->enhancedPacketWaiting > 0) {
+ *dataBuffer = 192 - data->enhancedPacketWaiting;
+ *dataBuffer /= 22;
+ *dataBuffer <<= 2;
+ *(dataBuffer++) |= 0x03;
+ *(dataBuffer++) = 0xfe;
+ indexCol = 188;
+ indexCol += (192 - data->enhancedPacketWaiting) / 12;
+ indexRow = 0;
+ indexRow += (192 - data->enhancedPacketWaiting) % 12;
+ for (int j = 0; j < 22; ++j) {
+ if (data->enhancedPacketWaiting == 0) {
+ *(dataBuffer++) = 0;
+ } else {
+ *(dataBuffer++) = data->enhancedPacketData[indexRow][indexCol];
+ if (++indexRow == 12) {
+ indexRow = 0;
+ ++indexCol;
+ }
+ --data->enhancedPacketWaiting;
+ }
+ }
+ written += 24;
+ if (data->enhancedPacketWaiting == 0) {
+ data->enhancedPacketLength = 0;
+ }
+ } else if (data->packetLength != 0) {
+ header = (packetHeader*)data->packetData;
+ if (written + data->packetLength > (unsigned)size) {
+ memset(dataBuffer, 0, 22);
+ dataBuffer[22] = 0x60;
+ dataBuffer[23] = 0x4b;
+ length = 24;
+ } else if (data->enhancedPacketData != NULL) {
+ if (data->enhancedPacketLength + data->packetLength
+ > (12 * 188)) {
+ memset(dataBuffer, 0, 22);
+ dataBuffer[22] = 0x60;
+ dataBuffer[23] = 0x4b;
+ length = 24;
+ } else {
+ memcpy(dataBuffer, data->packetData, data->packetLength);
+ length = data->packetLength;
+ data->packetLength = 0;
+ }
+ } else {
+ memcpy(dataBuffer, data->packetData, data->packetLength);
+ length = data->packetLength;
+ data->packetLength = 0;
+ }
+ if (data->enhancedPacketData != NULL) {
+ indexCol = data->enhancedPacketLength / 12;
+ indexRow = data->enhancedPacketLength % 12; // TODO Check if always 0
+ for (int j = 0; j < length; ++j) {
+ data->enhancedPacketData[indexRow][indexCol] = dataBuffer[j];
+ if (++indexRow == 12) {
+ indexRow = 0;
+ ++indexCol;
+ }
+ }
+ data->enhancedPacketLength += length;
+ if (data->enhancedPacketLength >= (12 * 188)) {
+ data->enhancedPacketLength = (12 * 188);
+ ReedSolomon encoder(204, 188);
+ for (int j = 0; j < 12; ++j) {
+ encoder.encode(data->enhancedPacketData[j], 188);
+ }
+ data->enhancedPacketWaiting = 192;
+ }
+ }
+ written += length;
+ dataBuffer += length;
+ } else {
+ int nbBytes = ops->read(args, dataBuffer, 3);
+ header = (packetHeader*)dataBuffer;
+ if (nbBytes == -1) {
+ if (errno == EAGAIN) goto END_PACKET;
+ perror("Packet file");
+ return -1;
+ } else if (nbBytes == 0) {
+ if (ops->rewind(args) == -1) {
+ goto END_PACKET;
+ }
+ continue;
+ } else if (nbBytes < 3) {
+ etiLog.print(TcpLog::ERR,
+ "Error while reading file for packet header; "
+ "read %i out of 3 bytes\n", nbBytes);
+ break;
+ }
+
+ length = header->packetLength * 24 + 24;
+ if (written + length > size) {
+ memcpy(data->packetData, header, 3);
+ ops->read(args, &data->packetData[3], length - 3);
+ data->packetLength = length;
+ continue;
+ }
+ if (data->enhancedPacketData != NULL) {
+ if (data->enhancedPacketLength + length > (12 * 188)) {
+ memcpy(data->packetData, header, 3);
+ ops->read(args, &data->packetData[3], length - 3);
+ data->packetLength = length;
+ continue;
+ }
+ }
+ nbBytes = ops->read(args, dataBuffer + 3, length - 3);
+ if (nbBytes == -1) {
+ perror("Packet file");
+ return -1;
+ } else if (nbBytes == 0) {
+ etiLog.print(TcpLog::NOTICE,
+ "Packet header read, but no data!\n");
+ if (ops->rewind(args) == -1) {
+ goto END_PACKET;
+ }
+ continue;
+ } else if (nbBytes < length - 3) {
+ etiLog.print(TcpLog::ERR, "Error while reading packet file; "
+ "read %i out of %i bytes\n", nbBytes, length - 3);
+ break;
+ }
+ if (data->enhancedPacketData != NULL) {
+ indexCol = data->enhancedPacketLength / 12;
+ indexRow = data->enhancedPacketLength % 12; // TODO Check if always 0
+ for (int j = 0; j < length; ++j) {
+ data->enhancedPacketData[indexRow][indexCol] = dataBuffer[j];
+ if (++indexRow == 12) {
+ indexRow = 0;
+ ++indexCol;
+ }
+ }
+ data->enhancedPacketLength += length;
+ if (data->enhancedPacketLength >= (12 * 188)) {
+ if (data->enhancedPacketLength > (12 * 188)) {
+ etiLog.print(TcpLog::ERR,
+ "Error, too much enhanced packet data!\n");
+ }
+ ReedSolomon encoder(204, 188);
+ for (int j = 0; j < 12; ++j) {
+ encoder.encode(data->enhancedPacketData[j], 188);
+ }
+ data->enhancedPacketWaiting = 192;
+ }
+ }
+ written += length;
+ dataBuffer += length;
+ }
+ }
+END_PACKET:
+ if (ops->read == dabInputFifoRead) {
+ dabInputFifoData* fifoData = (dabInputFifoData*)args;
+ dabInputFifoStats* fifoStats = (dabInputFifoStats*)&fifoData->stats;
+ fifoStats->frameRecords[fifoStats->frameCount].curSize = written;
+ fifoStats->frameRecords[fifoStats->frameCount].maxSize = size;
+ if (++fifoStats->frameCount == NB_RECORDS) {
+ etiLog.print(TcpLog::INFO, "Packet subchannel usage: (%i)",
+ fifoStats->id);
+ for (int i = 0; i < fifoStats->frameCount; ++i) {
+ etiLog.print(TcpLog::INFO, " %i/%i",
+ fifoStats->frameRecords[i].curSize,
+ fifoStats->frameRecords[i].maxSize);
+ }
+ etiLog.print(TcpLog::INFO, "\n");
+ fifoStats->frameCount = 0;
+ }
+ }
+ while (written < size) {
+ memset(dataBuffer, 0, 22);
+ dataBuffer[22] = 0x60;
+ dataBuffer[23] = 0x4b;
+ dataBuffer += 24;
+ written += 24;
+ }
+ return written;
+}
+
+
+# endif
+#endif
diff --git a/src/dabInputPacketFile.h b/src/dabInputPacketFile.h
new file mode 100644
index 0000000..9559ac1
--- /dev/null
+++ b/src/dabInputPacketFile.h
@@ -0,0 +1,46 @@
+/*
+ Copyright (C) 2009 Her Majesty the Queen in Right of Canada (Communications
+ Research Center Canada)
+ */
+/*
+ This file is part of CRC-DabMux.
+
+ CRC-DabMux is free software: you can 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.
+
+ CRC-DabMux is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with CRC-DabMux. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef DAB_INPUT_PACKET_FILE_H
+#define DAB_INPUT_PACKET_FILE_H
+
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+#include "dabInput.h"
+
+
+#ifdef HAVE_FORMAT_PACKET
+# ifdef HAVE_INPUT_FILE
+
+
+extern struct dabInputOperations dabInputPacketFileOperations;
+
+int dabInputPacketFileRead(dabInputOperations* ops, void* args, void* buffer,
+ int size);
+
+
+# endif
+#endif
+
+
+#endif // DAB_INPUT_PACKET_FILE_H
diff --git a/src/dabInputPrbs.cpp b/src/dabInputPrbs.cpp
new file mode 100644
index 0000000..3b7a0dc
--- /dev/null
+++ b/src/dabInputPrbs.cpp
@@ -0,0 +1,146 @@
+/*
+ Copyright (C) 2009 Her Majesty the Queen in Right of Canada (Communications
+ Research Center Canada)
+ */
+/*
+ This file is part of CRC-DabMux.
+
+ CRC-DabMux is free software: you can 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.
+
+ CRC-DabMux is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with CRC-DabMux. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "dabInputPrbs.h"
+
+#include <string.h>
+#include <limits.h>
+#include <stdlib.h>
+
+
+#ifdef HAVE_FORMAT_RAW
+# ifdef HAVE_INPUT_PRBS
+
+
+struct dabInputOperations dabInputPrbsOperations = {
+ dabInputPrbsInit,
+ dabInputPrbsOpen,
+ NULL,
+ dabInputPrbsRead,
+ NULL,
+ NULL,
+ dabInputPrbsReadFrame,
+ dabInputPrbsBitrate,
+ dabInputPrbsClose,
+ dabInputPrbsClean,
+ dabInputPrbsRewind,
+};
+
+
+int dabInputPrbsInit(void** args)
+{
+ prbs_data* data = new prbs_data;
+
+ memset(data, 0, sizeof(*data));
+
+ *args = data;
+ return 0;
+}
+
+
+int dabInputPrbsOpen(void* args, const char* name)
+{
+ prbs_data* data = (prbs_data*)args;
+
+ if (*name != ':') {
+ etiLog.print(TcpLog::ERR,
+ "Sorry, PRBS address format is prbs://:polynomial.\n");
+ errno = EINVAL;
+ return -1;
+ }
+
+ long polynomial = strtol(++name, (char **)NULL, 10);
+ if ((polynomial == LONG_MIN) || (polynomial == LONG_MAX)) {
+ etiLog.print(TcpLog::ERR, "can't convert polynomial number %s\n", name);
+ errno = EINVAL;
+ return -1;
+ }
+ if (polynomial == 0) {
+ etiLog.print(TcpLog::ERR, "you must specify a polynomial number\n");
+ errno = EINVAL;
+ return -1;
+ }
+
+ data->polynomial = polynomial;
+ data->accum = 0;
+ gen_prbs_table(data);
+ gen_weight_table(data);
+ dabInputPrbsRewind(args);
+
+ return 0;
+}
+
+
+int dabInputPrbsRead(void* args, void* buffer, int size)
+{
+ prbs_data* data = (prbs_data*)args;
+ unsigned char* cbuffer = reinterpret_cast<unsigned char*>(buffer);
+
+ for(int i = 0; i < size; ++i) {
+ data->accum = update_prbs(args);
+ *(cbuffer++) = (unsigned char)(data->accum & 0xff);
+ }
+
+ return size;
+}
+
+
+int dabInputPrbsReadFrame(dabInputOperations* ops, void* args,
+ void* buffer, int size)
+{
+ return ops->read(args, buffer, size);
+}
+
+
+int dabInputPrbsBitrate(dabInputOperations* ops, void* args, int bitrate)
+{
+ return bitrate;
+}
+
+
+int dabInputPrbsClose(void* args)
+{
+ return 0;
+}
+
+
+int dabInputPrbsClean(void** args)
+{
+ delete (prbs_data*)(*args);
+ return 0;
+}
+
+
+int dabInputPrbsRewind(void* args)
+{
+ prbs_data* data = (prbs_data*)args;
+
+ while (data->accum < data->polynomial) {
+ data->accum <<= 1;
+ data->accum |= 1;
+ }
+
+ return 0;
+}
+
+
+# endif
+#endif
diff --git a/src/dabInputPrbs.h b/src/dabInputPrbs.h
new file mode 100644
index 0000000..e51b79f
--- /dev/null
+++ b/src/dabInputPrbs.h
@@ -0,0 +1,56 @@
+/*
+ Copyright (C) 2009 Her Majesty the Queen in Right of Canada (Communications
+ Research Center Canada)
+ */
+/*
+ This file is part of CRC-DabMux.
+
+ CRC-DabMux is free software: you can 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.
+
+ CRC-DabMux is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with CRC-DabMux. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef DAB_INPUT_PRBS_H
+#define DAB_INPUT_PRBS_H
+
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+#include "dabInput.h"
+#include "prbs.h"
+
+#include <errno.h>
+
+
+#ifdef HAVE_FORMAT_RAW
+# ifdef HAVE_INPUT_PRBS
+
+
+extern struct dabInputOperations dabInputPrbsOperations;
+
+int dabInputPrbsInit(void** args);
+int dabInputPrbsOpen(void* args, const char* name);
+int dabInputPrbsRead(void* args, void* buffer, int size);
+int dabInputPrbsReadFrame(dabInputOperations* ops, void* args,
+ void* buffer, int size);
+int dabInputPrbsBitrate(dabInputOperations* ops, void* args, int bitrate);
+int dabInputPrbsClose(void* args);
+int dabInputPrbsClean(void** args);
+int dabInputPrbsRewind(void* args);
+
+
+# endif
+#endif
+
+
+#endif // DAB_INPUT_PRBS_H
diff --git a/src/dabInputRawFifo.cpp b/src/dabInputRawFifo.cpp
new file mode 100644
index 0000000..b40e14d
--- /dev/null
+++ b/src/dabInputRawFifo.cpp
@@ -0,0 +1,193 @@
+/*
+ Copyright (C) 2009 Her Majesty the Queen in Right of Canada (Communications
+ Research Center Canada)
+ */
+/*
+ This file is part of CRC-DabMux.
+
+ CRC-DabMux is free software: you can 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.
+
+ CRC-DabMux is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with CRC-DabMux. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "dabInputRawFifo.h"
+
+#include <unistd.h>
+#include <stdio.h>
+#include <fcntl.h>
+#include <string.h>
+
+#ifndef _WIN32
+# define O_BINARY 0
+#endif
+
+
+#ifdef HAVE_FORMAT_RAW
+# ifdef HAVE_INPUT_FILE
+
+
+struct dabInputOperations dabInputRawFifoOperations = {
+ dabInputRawFifoInit,
+ dabInputRawFifoOpen,
+ dabInputRawFifoSetbuf,
+ dabInputRawFifoRead,
+ NULL,
+ NULL,
+ dabInputRawFifoReadFrame,
+ dabInputSetbitrate,
+ dabInputRawFifoClose,
+ dabInputRawFifoClean,
+ dabInputRawFifoRewind
+};
+
+
+int dabInputRawFifoInit(void** args)
+{
+ dabInputRawFifoData* data = new dabInputRawFifoData;
+ data->file = -1;
+ data->buffer = NULL;
+ data->bufferSize = 0;
+ data->bufferOffset = 0;
+
+ *args = data;
+ return 0;
+}
+
+
+int dabInputRawFifoOpen(void* args, const char* filename)
+{
+ dabInputRawFifoData* data = (dabInputRawFifoData*)args;
+ data->file = open(filename, O_RDONLY | O_BINARY | O_NONBLOCK);
+ if (data->file == -1) {
+ perror(filename);
+ return -1;
+ }
+#ifdef _WIN32
+#else
+ int flags = fcntl(data->file, F_GETFL);
+ if (flags == -1) {
+ perror(filename);
+ return -1;
+ }
+ if (fcntl(data->file, F_SETFL, flags & ~O_NONBLOCK) == -1) {
+ perror(filename);
+ return -1;
+ }
+#endif
+
+ return 0;
+}
+
+
+int dabInputRawFifoSetbuf(void* args, int size)
+{
+ dabInputRawFifoData* data = (dabInputRawFifoData*)args;
+
+ if (size <= 0) {
+ return size;
+ }
+
+ if (data->bufferSize != size) {
+ if (data->buffer != NULL) {
+ delete[] data->buffer;
+ }
+ data->buffer = new uint8_t[size];
+ data->bufferSize = size;
+ data->bufferOffset = 0;
+ }
+
+ return 0;
+}
+
+
+int dabInputRawFifoRead(void* args, void* buffer, int size)
+{
+ dabInputRawFifoData* data = (dabInputRawFifoData*)args;
+
+ return read(data->file, buffer, size);
+}
+
+
+int dabInputRawFifoReadFrame(dabInputOperations* ops, void* args,
+ void* buffer, int size)
+{
+ dabInputRawFifoData* data = (dabInputRawFifoData*)args;
+ int result;
+
+ result = ops->read(args, data->buffer + data->bufferOffset, size - data->bufferOffset);
+ if (result == -1) {
+ etiLog.print(TcpLog::CRIT, "ERROR: Can't read fifo\n");
+ perror("");
+ return -1;
+ }
+
+ if (result + data->bufferOffset < size) {
+ data->bufferOffset += result;
+
+ etiLog.print(TcpLog::NOTICE, "reach end of fifo -> rewinding\n");
+ if (ops->rewind(args) == -1) {
+ etiLog.print(TcpLog::CRIT, "ERROR: Can't rewind fifo\n");
+ return -1;
+ }
+
+ result = ops->read(args, data->buffer + data->bufferOffset, size - data->bufferOffset);
+ if (result == -1) {
+ etiLog.print(TcpLog::CRIT, "ERROR: Can't read fifo\n");
+ perror("");
+ return -1;
+ }
+
+ if (result < size) {
+ etiLog.print(TcpLog::CRIT, "ERROR: Not enought data in fifo\n");
+ return 0;
+ }
+ }
+
+ memcpy(buffer, data->buffer, size);
+ data->bufferOffset = 0;
+
+ return size;
+}
+
+
+int dabInputRawFifoClose(void* args)
+{
+ dabInputRawFifoData* data = (dabInputRawFifoData*)args;
+
+ if (data->file != -1) {
+ close(data->file);
+ data->file = -1;
+ }
+ return 0;
+}
+
+
+int dabInputRawFifoClean(void** args)
+{
+ dabInputRawFifoData* data = (dabInputRawFifoData*)*args;
+ if (data->buffer != NULL) {
+ delete[] data->buffer;
+ }
+ delete data;
+ return 0;
+}
+
+
+int dabInputRawFifoRewind(void* args)
+{
+ dabInputRawFifoData* data = (dabInputRawFifoData*)args;
+ return lseek(data->file, 0, SEEK_SET);
+}
+
+
+# endif
+#endif
diff --git a/src/dabInputRawFifo.h b/src/dabInputRawFifo.h
new file mode 100644
index 0000000..4afe55d
--- /dev/null
+++ b/src/dabInputRawFifo.h
@@ -0,0 +1,63 @@
+/*
+ Copyright (C) 2009 Her Majesty the Queen in Right of Canada (Communications
+ Research Center Canada)
+ */
+/*
+ This file is part of CRC-DabMux.
+
+ CRC-DabMux is free software: you can 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.
+
+ CRC-DabMux is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with CRC-DabMux. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef DAB_INPUT_RAW_FIFO_H
+#define DAB_INPUT_RAW_FIFO_H
+
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#include "dabInput.h"
+
+#include <stdint.h>
+
+
+#ifdef HAVE_FORMAT_RAW
+# ifdef HAVE_INPUT_FILE
+
+
+extern struct dabInputOperations dabInputRawFifoOperations;
+
+int dabInputRawFifoInit(void** args);
+int dabInputRawFifoOpen(void* args, const char* filename);
+int dabInputRawFifoSetbuf(void* args, int size);
+int dabInputRawFifoRead(void* args, void* buffer, int size);
+int dabInputRawFifoReadFrame(dabInputOperations* ops, void* args,
+ void* buffer, int size);
+int dabInputRawFifoClose(void* args);
+int dabInputRawFifoClean(void** args);
+int dabInputRawFifoRewind(void* args);
+
+
+struct dabInputRawFifoData {
+ int file;
+ uint8_t* buffer;
+ size_t bufferSize;
+ size_t bufferOffset;
+};
+
+
+# endif
+#endif
+
+#endif // DAB_INPUT_RAW_FIFO_H
diff --git a/src/dabInputRawFile.cpp b/src/dabInputRawFile.cpp
new file mode 100644
index 0000000..17be73c
--- /dev/null
+++ b/src/dabInputRawFile.cpp
@@ -0,0 +1,59 @@
+/*
+ Copyright (C) 2009 Her Majesty the Queen in Right of Canada (Communications
+ Research Center Canada)
+ */
+/*
+ This file is part of CRC-DabMux.
+
+ CRC-DabMux is free software: you can 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.
+
+ CRC-DabMux is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with CRC-DabMux. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "dabInputRawFile.h"
+#include "dabInputFile.h"
+
+
+#ifdef HAVE_FORMAT_RAW
+# ifdef HAVE_INPUT_FILE
+
+
+struct dabInputOperations dabInputRawFileOperations = {
+ dabInputFileInit,
+ dabInputFileOpen,
+ dabInputSetbuf,
+ dabInputFileRead,
+ NULL,
+ NULL,
+ dabInputRawFileRead,
+ dabInputSetbitrate,
+ dabInputFileClose,
+ dabInputFileClean,
+ dabInputFileRewind
+};
+
+
+int dabInputRawFileRead(dabInputOperations* ops, void* args, void* buffer,
+ int size)
+{
+ int ret = ops->read(args, buffer, size);
+ if (ret == 0) {
+ etiLog.print(TcpLog::NOTICE, "reach end of raw file -> rewinding\n");
+ ops->rewind(args);
+ ret = ops->read(args, buffer, size);
+ }
+ return ret;
+}
+
+
+# endif
+#endif
diff --git a/src/dabInputRawFile.h b/src/dabInputRawFile.h
new file mode 100644
index 0000000..e75f962
--- /dev/null
+++ b/src/dabInputRawFile.h
@@ -0,0 +1,45 @@
+/*
+ Copyright (C) 2009 Her Majesty the Queen in Right of Canada (Communications
+ Research Center Canada)
+ */
+/*
+ This file is part of CRC-DabMux.
+
+ CRC-DabMux is free software: you can 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.
+
+ CRC-DabMux is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with CRC-DabMux. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef DAB_INPUT_RAW_FILE_H
+#define DAB_INPUT_RAW_FILE_H
+
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+#include "dabInput.h"
+
+
+#ifdef HAVE_FORMAT_RAW
+# ifdef HAVE_INPUT_FILE
+
+
+extern struct dabInputOperations dabInputRawFileOperations;
+
+int dabInputRawFileRead(dabInputOperations* ops, void* args, void* buffer,
+ int size);
+
+
+# endif
+#endif
+
+#endif // DAB_INPUT_RAW_FILE_H
diff --git a/src/dabInputSlip.cpp b/src/dabInputSlip.cpp
new file mode 100644
index 0000000..7663d2c
--- /dev/null
+++ b/src/dabInputSlip.cpp
@@ -0,0 +1,408 @@
+/*
+ Copyright (C) 2009 Her Majesty the Queen in Right of Canada (Communications
+ Research Center Canada)
+ */
+/*
+ This file is part of CRC-DabMux.
+
+ CRC-DabMux is free software: you can 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.
+
+ CRC-DabMux is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with CRC-DabMux. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "dabInputSlip.h"
+#include "dabInputFifo.h"
+#include "TcpServer.h"
+#include "UdpSocket.h"
+#include "bridge.h"
+
+#include <signal.h>
+#include <string.h>
+#include <limits.h>
+
+
+#ifdef _WIN32
+# include <io.h>
+
+# define sem_t HANDLE
+# define O_NONBLOCK 0
+#else
+# include <semaphore.h>
+# define O_BINARY 0
+#endif
+
+
+struct dabInputSlipData {
+ TcpServer* server;
+ UdpPacket** packets;
+ UdpPacket* buffer;
+ bridgeInfo* info;
+ dabInputFifoStats stats;
+ pthread_t thread;
+ sem_t semWrite;
+ sem_t semQueue;
+ bool reading;
+ volatile int nbPackets;
+ volatile int queueSize;
+ volatile int packetSize;
+};
+
+
+struct dabInputOperations dabInputSlipOperations = {
+ dabInputSlipInit,
+ dabInputSlipOpen,
+ dabInputSlipSetbuf,
+ dabInputSlipRead,
+ NULL,
+ NULL,
+ dabInputSlipReadFrame,
+ dabInputSetbitrate,
+ dabInputSlipClose,
+ dabInputSlipClean,
+ NULL
+};
+
+
+int dabInputSlipInit(void** args)
+{
+ dabInputSlipData* data = new dabInputSlipData;
+ memset(&data->stats, 0, sizeof(data->stats));
+ data->stats.id = dabInputFifoData::nb++;
+ data->server = new TcpServer();
+ data->packetSize = 1500;
+ data->queueSize = 10;
+ data->packets = new UdpPacket*[data->queueSize];
+ for (int i = 0; i < data->queueSize; ++i) {
+ data->packets[i] = new UdpPacket(data->packetSize);
+ }
+ data->buffer = new UdpPacket(data->packetSize);
+ data->nbPackets = 0;
+ data->info = new bridgeInfo;
+ data->thread = (pthread_t)NULL;
+ bridgeInitInfo(data->info);
+
+#ifdef _WIN32
+ char semName[32];
+ sprintf(semName, "semWrite%i", data->stats.id);
+ data->semWrite = CreateSemaphore(NULL, 1, 1, semName);
+ if (data->semWrite == NULL) {
+ fprintf(stderr, "Can't init SLIP data write semaphore %s\n", semName);
+ return -1;
+ }
+ sprintf(semName, "semQueue%i", data->stats.id);
+ data->semQueue = CreateSemaphore(NULL, 1, 1, semName);
+ if (data->semQueue == NULL) {
+ fprintf(stderr, "Can't init SLIP data index semaphore %s\n", semName);
+ return -1;
+ }
+#else
+ if (sem_init(&data->semWrite, 0, data->queueSize) == -1) {
+ perror("Can't init SLIP data write semaphore");
+ return -1;
+ }
+ if (sem_init(&data->semQueue, 0, 1) == -1) {
+ perror("Can't init SLIP data index semaphore");
+ return -1;
+ }
+#endif
+ data->reading = false;
+
+ *args = data;
+ return 0;
+}
+
+
+void* dabInputSlipThread(void* args)
+{
+ dabInputSlipData* data = (dabInputSlipData*)args;
+ TcpSocket* client;
+
+ while ((client = data->server->accept()) != NULL) {
+ int size = 0;
+ etiLog.print(TcpLog::INFO, "SLIP server got a new client.\n");
+
+#ifdef _WIN32
+ WaitForSingleObject(data->semWrite, INFINITE);
+ WaitForSingleObject(data->semQueue, INFINITE);
+#else
+ sem_wait(&data->semWrite);
+ sem_wait(&data->semQueue);
+#endif
+ UdpPacket* packet = data->packets[data->nbPackets];
+#ifdef _WIN32
+ ReleaseSemaphore(data->semQueue, 1, NULL);
+#else
+ sem_post(&data->semQueue);
+#endif
+
+ while ((size = client->read(packet->getData(), packet->getSize()))
+ > 0) {
+ packet->setLength(size);
+#ifdef _WIN32
+ WaitForSingleObject(data->semQueue, INFINITE);
+#else
+ sem_wait(&data->semQueue);
+#endif
+ data->nbPackets++;
+#ifdef _WIN32
+ ReleaseSemaphore(data->semQueue, 1, NULL);
+#else
+ sem_post(&data->semQueue);
+#endif
+
+#ifdef _WIN32
+ WaitForSingleObject(data->semWrite, INFINITE);
+ WaitForSingleObject(data->semQueue, INFINITE);
+#else
+ sem_wait(&data->semWrite);
+ sem_wait(&data->semQueue);
+#endif
+ packet = data->packets[data->nbPackets];
+#ifdef _WIN32
+ ReleaseSemaphore(data->semQueue, 1, NULL);
+#else
+ sem_post(&data->semQueue);
+#endif
+ }
+ etiLog.print(TcpLog::INFO, "SLIP server client deconnected.\n");
+ client->close();
+ }
+ etiLog.print(TcpLog::ERR, "SLIP thread can't accept new client (%s)\n",
+ inetErrDesc, inetErrMsg);
+
+ return NULL;
+}
+
+
+int dabInputSlipOpen(void* args, const char* inputName)
+{
+ const char* address;
+ long port;
+ address = strchr(inputName, ':');
+ if (address == NULL) {
+ etiLog.print(TcpLog::ERR, "\"%s\" SLIP address format is invalid: "
+ "should be [address]:port - > aborting\n", inputName);
+ return -1;
+ }
+ ++address;
+ port = strtol(address, (char **)NULL, 10);
+ if ((port == LONG_MIN) || (port == LONG_MAX)) {
+ etiLog.print(TcpLog::ERR, "can't convert port number in SLIP address %s\n",
+ address);
+ return -1;
+ }
+ if (port == 0) {
+ etiLog.print(TcpLog::ERR, "can't use port number 0 in SLIP address\n");
+ return -1;
+ }
+ dabInputSlipData* data = (dabInputSlipData*)args;
+ if (data->server->create(port) == -1) {
+ etiLog.print(TcpLog::ERR, "can't set port %i on SLIP input (%s: %s)\n",
+ port, inetErrDesc, inetErrMsg);
+ return -1;
+ }
+
+ if (data->server->listen() == -1) {
+ etiLog.print(TcpLog::ERR, "can't listen on SLIP socket(%s: %s)\n",
+ inetErrDesc, inetErrMsg);
+ return -1;
+ }
+#ifdef _WIN32
+ data->thread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)dabInputSlipThread, data, 0, NULL);
+ if (data->thread == NULL) {
+ fprintf(stderr, "Can't create SLIP child");
+ return -1;
+ }
+#else
+ if (pthread_create(&data->thread, NULL, dabInputSlipThread, data)) {
+ perror("Can't create SLIP child");
+ return -1;
+ }
+#endif
+
+ etiLog.print(TcpLog::DBG, "check return code of create\n");
+ return 0;
+}
+
+
+int dabInputSlipSetbuf(void* args, int size)
+{
+ dabInputSlipData* data = (dabInputSlipData*)args;
+
+ if (size <= 10) {
+ return -1;
+ }
+
+ data->packetSize = size - 10;
+ if (data->packets == NULL) {
+ data->packets = new UdpPacket*[data->queueSize];
+ }
+ for (int i = 0; i < data->queueSize; ++i) {
+ if (data->packets[i] == NULL) {
+ data->packets[i] = new UdpPacket(data->packetSize);
+ } else {
+ data->packets[i]->setSize(data->packetSize);
+ }
+ }
+ if (data->buffer == NULL) {
+ data->buffer = new UdpPacket(data->packetSize);
+ } else {
+ data->buffer->setSize(data->packetSize);
+ }
+
+ return 0;
+}
+
+
+int dabInputSlipRead(void* args, void* buffer, int size)
+{
+ dabInputSlipData* data = (dabInputSlipData*)args;
+
+ if (data->nbPackets > 0) { // data ready
+ UdpPacket* temp;
+ temp = data->buffer;
+ data->buffer = data->packets[0];
+
+#ifdef _WIN32
+ WaitForSingleObject(data->semQueue, INFINITE);
+#else
+ sem_wait(&data->semQueue);
+#endif
+ for (int i = 1; i < data->queueSize; ++i) {
+ data->packets[i - 1] = data->packets[i];
+ }
+ data->packets[data->queueSize - 1] = temp;
+ --data->nbPackets;
+#ifdef _WIN32
+ ReleaseSemaphore(data->semQueue, 1, NULL);
+ ReleaseSemaphore(data->semWrite, 1, NULL);
+#else
+ sem_post(&data->semQueue);
+ sem_post(&data->semWrite);
+#endif
+ } else {
+ data->buffer->setLength(0);
+ }
+
+ return data->buffer->getLength();
+}
+
+
+int dabInputSlipReadFrame(dabInputOperations* ops, void* args, void* buffer, int size)
+{
+ int nbBytes = 0;
+ dabInputSlipData* data = (dabInputSlipData*)args;
+ dabInputFifoStats* stats = (dabInputFifoStats*)&data->stats;
+
+#ifdef _WIN32
+ WaitForSingleObject(data->semQueue, INFINITE);
+#else
+ sem_wait(&data->semQueue);
+#endif
+ stats->bufferRecords[stats->bufferCount].curSize = data->nbPackets;
+ stats->bufferRecords[stats->bufferCount].maxSize = data->queueSize;
+#ifdef _WIN32
+ ReleaseSemaphore(data->semQueue, 1, NULL);
+#else
+ sem_post(&data->semQueue);
+#endif
+ if (++stats->bufferCount == NB_RECORDS) {
+ etiLog.print(TcpLog::INFO, "SLIP buffer state: (%i)", stats->id);
+ for (int i = 0; i < stats->bufferCount; ++i) {
+ etiLog.print(TcpLog::INFO, " %i/%i",
+ stats->bufferRecords[i].curSize,
+ stats->bufferRecords[i].maxSize);
+ }
+ etiLog.print(TcpLog::INFO, "\n");
+
+ stats->bufferCount = 0;
+ }
+
+ data->stats.frameRecords[data->stats.frameCount].curSize = 0;
+ data->stats.frameRecords[data->stats.frameCount].maxSize = size;
+
+ if (data->buffer->getLength() == 0) {
+ ops->read(args, NULL, 0);
+ }
+ while ((nbBytes = writePacket(data->buffer->getData(),
+ data->buffer->getLength(), buffer, size, data->info))
+ != 0) {
+ data->stats.frameRecords[data->stats.frameCount].curSize = nbBytes;
+ ops->read(args, NULL, 0);
+ }
+
+ if (data->buffer->getLength() != 0) {
+ data->stats.frameRecords[data->stats.frameCount].curSize = size;
+ }
+
+ if (++stats->frameCount == NB_RECORDS) {
+ etiLog.print(TcpLog::INFO, "Data subchannel usage: (%i)",
+ stats->id);
+ for (int i = 0; i < stats->frameCount; ++i) {
+ etiLog.print(TcpLog::INFO, " %i/%i",
+ stats->frameRecords[i].curSize,
+ stats->frameRecords[i].maxSize);
+ }
+ etiLog.print(TcpLog::INFO, "\n");
+ stats->frameCount = 0;
+ }
+ return size;
+}
+
+
+int dabInputSlipClose(void* args)
+{
+ dabInputSlipData* data = (dabInputSlipData*)args;
+ data->server->close();
+#ifdef WIN32
+ DWORD status;
+ for (int i = 0; i < 5; ++i) {
+ if (GetExitCodeThread(data->thread, &status)) {
+ break;
+ }
+ Sleep(100);
+ }
+ TerminateThread(data->thread, 1);
+#else
+ if (data->thread != (pthread_t)NULL) {
+ pthread_kill(data->thread, SIGPIPE);
+ }
+#endif
+ return 0;
+}
+
+
+int dabInputSlipClean(void** args)
+{
+ dabInputSlipData* data = (dabInputSlipData*)(*args);
+#ifdef _WIN32
+ CloseHandle(data->thread);
+ CloseHandle(data->semWrite);
+ CloseHandle(data->semQueue);
+#else
+ sem_destroy(&data->semWrite);
+ sem_destroy(&data->semQueue);
+#endif
+ for (int i = 0; i < data->queueSize; ++i) {
+ if (data->packets[i] != NULL) {
+ delete data->packets[i];
+ }
+ }
+ delete []data->packets;
+ delete data->buffer;
+ delete data->server;
+ delete data->info;
+ delete data;
+ return 0;
+}
+
+
diff --git a/src/dabInputSlip.h b/src/dabInputSlip.h
new file mode 100644
index 0000000..bcaf0d1
--- /dev/null
+++ b/src/dabInputSlip.h
@@ -0,0 +1,52 @@
+/*
+ Copyright (C) 2009 Her Majesty the Queen in Right of Canada (Communications
+ Research Center Canada)
+ */
+/*
+ This file is part of CRC-DabMux.
+
+ CRC-DabMux is free software: you can 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.
+
+ CRC-DabMux is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with CRC-DabMux. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef DAB_INPUT_SLIP_H
+#define DAB_INPUT_SLIP_H
+
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+#include "dabInput.h"
+
+
+#ifdef HAVE_FORMAT_BRIDGE
+# ifdef HAVE_INPUT_SLIP
+
+
+extern struct dabInputOperations dabInputSlipOperations;
+
+int dabInputSlipInit(void** args);
+void* dabInputSlipThread(void* args);
+int dabInputSlipOpen(void* args, const char* inputName);
+int dabInputSlipSetbuf(void* args, int size);
+int dabInputSlipRead(void* args, void* buffer, int size);
+int dabInputSlipReadFrame(dabInputOperations* ops, void* args, void* buffer, int size);
+int dabInputSlipClose(void* args);
+int dabInputSlipClean(void** args);
+
+
+# endif
+#endif
+
+
+#endif // DAB_INPUT_SLIP_H
diff --git a/src/dabInputTest.cpp b/src/dabInputTest.cpp
new file mode 100644
index 0000000..78adaa8
--- /dev/null
+++ b/src/dabInputTest.cpp
@@ -0,0 +1,105 @@
+/*
+ Copyright (C) 2009 Her Majesty the Queen in Right of Canada (Communications
+ Research Center Canada)
+ */
+/*
+ This file is part of CRC-DabMux.
+
+ CRC-DabMux is free software: you can 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.
+
+ CRC-DabMux is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with CRC-DabMux. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "dabInputTest.h"
+
+#include <string.h>
+#ifdef _WIN32
+#else
+# include <arpa/inet.h>
+#endif
+
+
+#ifdef HAVE_FORMAT_RAW
+# ifdef HAVE_INPUT_TEST
+
+
+struct dabInputTestData {
+ unsigned long counter;
+};
+
+
+struct dabInputOperations dabInputTestOperations = {
+ dabInputTestInit,
+ dabInputTestOpen,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ dabInputTestRead,
+ dabInputTestSetbitrate,
+ dabInputTestClose,
+ dabInputTestClean,
+ NULL
+};
+
+
+int dabInputTestInit(void** args)
+{
+ dabInputTestData* input = new dabInputTestData;
+ memset(input, 0, sizeof(*input));
+ input->counter = 0;
+ *args = input;
+ return 0;
+}
+
+
+int dabInputTestOpen(void* args, const char* inputName)
+{
+ return 0;
+}
+
+
+int dabInputTestRead(dabInputOperations* ops, void* args, void* buffer, int size)
+{
+ dabInputTestData* input = (dabInputTestData*)args;
+ char* data = (char*)buffer;
+
+ *((long*)buffer) = htonl(input->counter++);
+ for (int i = sizeof(input->counter); i < size; ++i) {
+ data[i] = i;
+ }
+ return size;
+}
+
+
+int dabInputTestSetbitrate(dabInputOperations* ops, void* args, int bitrate)
+{
+ return bitrate;
+}
+
+
+int dabInputTestClose(void* args)
+{
+ return 0;
+}
+
+
+int dabInputTestClean(void** args)
+{
+ dabInputTestData* input = (dabInputTestData*)(*args);
+ delete input;
+ return 0;
+}
+
+
+# endif
+#endif
diff --git a/src/dabInputTest.h b/src/dabInputTest.h
new file mode 100644
index 0000000..5e21e80
--- /dev/null
+++ b/src/dabInputTest.h
@@ -0,0 +1,50 @@
+/*
+ Copyright (C) 2009 Her Majesty the Queen in Right of Canada (Communications
+ Research Center Canada)
+ */
+/*
+ This file is part of CRC-DabMux.
+
+ CRC-DabMux is free software: you can 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.
+
+ CRC-DabMux is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with CRC-DabMux. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef DAB_INPUT_TEST_H
+#define DAB_INPUT_TEST_H
+
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+#include "dabInput.h"
+
+
+#ifdef HAVE_FORMAT_RAW
+# ifdef HAVE_INPUT_TEST
+
+
+extern struct dabInputOperations dabInputTestOperations;
+
+int dabInputTestInit(void** args);
+int dabInputTestOpen(void* args, const char* inputName);
+int dabInputTestRead(dabInputOperations* ops, void* args, void* buffer, int size);
+int dabInputTestSetbitrate(dabInputOperations* ops, void* args, int bitrate);
+int dabInputTestClose(void* args);
+int dabInputTestClean(void** args);
+
+
+# endif
+#endif
+
+
+#endif // DAB_INPUT_TEST_H
diff --git a/src/dabInputUdp.cpp b/src/dabInputUdp.cpp
new file mode 100644
index 0000000..b128584
--- /dev/null
+++ b/src/dabInputUdp.cpp
@@ -0,0 +1,189 @@
+/*
+ Copyright (C) 2009 Her Majesty the Queen in Right of Canada (Communications
+ Research Center Canada)
+ */
+/*
+ This file is part of CRC-DabMux.
+
+ CRC-DabMux is free software: you can 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.
+
+ CRC-DabMux is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with CRC-DabMux. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "dabInputUdp.h"
+
+#include <string.h>
+#include <limits.h>
+
+
+#ifdef __MINGW32__
+# define bzero(s, n) memset(s, 0, n)
+#endif
+
+#ifdef HAVE_FORMAT_RAW
+# ifdef HAVE_INPUT_UDP
+
+
+struct dabInputOperations dabInputUdpOperations = {
+ dabInputUdpInit,
+ dabInputUdpOpen,
+ dabInputSetbuf,
+ NULL,
+ NULL,
+ NULL,
+ dabInputUdpRead,
+ dabInputSetbitrate,
+ dabInputUdpClose,
+ dabInputUdpClean,
+ NULL
+};
+
+
+int dabInputUdpInit(void** args)
+{
+ dabInputUdpData* input = new dabInputUdpData;
+ memset(&input->stats, 0, sizeof(input->stats));
+ input->stats.id = dabInputFifoData::nb++;
+ input->socket = new UdpSocket();
+ input->packet = new UdpPacket(2048);
+ *args = input;
+
+ UdpSocket::init();
+ return 0;
+}
+
+
+int dabInputUdpOpen(void* args, const char* inputName)
+{
+ int returnCode = 0;
+ char* address;
+ char* ptr;
+ long port;
+ address = strdup(inputName);
+ ptr = strchr(address, ':');
+ if (ptr == NULL) {
+ etiLog.print(TcpLog::ERR,
+ "\"%s\" is an invalid format for udp address: "
+ "should be [address]:port - > aborting\n", address);
+ returnCode = -1;
+ }
+ *(ptr++) = 0;
+ port = strtol(ptr, (char **)NULL, 10);
+ if ((port == LONG_MIN) || (port == LONG_MAX)) {
+ etiLog.print(TcpLog::ERR,
+ "can't convert port number in udp address %s\n",
+ address);
+ returnCode = -1;
+ }
+ if (port == 0) {
+ etiLog.print(TcpLog::ERR, "can't use port number 0 in udp address\n");
+ returnCode = -1;
+ }
+ dabInputUdpData* input = (dabInputUdpData*)args;
+ if (input->socket->create(port) == -1) {
+ etiLog.print(TcpLog::ERR, "can't set port %i on Udp input (%s: %s)\n",
+ port, inetErrDesc, inetErrMsg);
+ returnCode = -1;
+ }
+
+ if (*address != 0) {
+ if (input->socket->joinGroup(address) == -1) {
+ etiLog.print(TcpLog::ERR,
+ "can't join multicast group %s (%s: %s)\n",
+ address, inetErrDesc, inetErrMsg);
+ returnCode = -1;
+ }
+ }
+
+ if (input->socket->setBlocking(false) == -1) {
+ etiLog.print(TcpLog::ERR, "can't set Udp input socket in blocking mode "
+ "(%s: %s)\n", inetErrDesc, inetErrMsg);
+ returnCode = -1;
+ }
+
+ free(address);
+ etiLog.print(TcpLog::DBG, "check return code of create\n");
+ return returnCode;;
+}
+
+
+int dabInputUdpRead(dabInputOperations* ops, void* args, void* buffer, int size)
+{
+ int nbBytes = 0;
+ uint8_t* data = reinterpret_cast<uint8_t*>(buffer);
+
+ dabInputUdpData* input = (dabInputUdpData*)args;
+ dabInputFifoStats* stats = (dabInputFifoStats*)&input->stats;
+
+ input->stats.frameRecords[input->stats.frameCount].curSize = 0;
+ input->stats.frameRecords[input->stats.frameCount].maxSize = size;
+
+ if (input->packet->getLength() == 0) {
+ input->socket->receive(*input->packet);
+ }
+
+ while (nbBytes < size) {
+ unsigned freeSize = size - nbBytes;
+ if (input->packet->getLength() > freeSize) {
+ // Not enought place in output
+ memcpy(&data[nbBytes], input->packet->getData(), freeSize);
+ nbBytes = size;
+ input->packet->setOffset(input->packet->getOffset() + freeSize);
+ } else {
+ unsigned length = input->packet->getLength();
+ memcpy(&data[nbBytes], input->packet->getData(), length);
+ nbBytes += length;
+ input->packet->setOffset(0);
+ input->socket->receive(*input->packet);
+ if (input->packet->getLength() == 0) {
+ break;
+ }
+ }
+ }
+ input->stats.frameRecords[input->stats.frameCount].curSize = nbBytes;
+ bzero(&data[nbBytes], size - nbBytes);
+
+ input->stats.frameRecords[input->stats.frameCount].curSize = nbBytes;
+ if (++stats->frameCount == NB_RECORDS) {
+ etiLog.print(TcpLog::INFO, "Data subchannel usage: (%i)",
+ stats->id);
+ for (int i = 0; i < stats->frameCount; ++i) {
+ etiLog.print(TcpLog::INFO, " %i/%i",
+ stats->frameRecords[i].curSize,
+ stats->frameRecords[i].maxSize);
+ }
+ etiLog.print(TcpLog::INFO, "\n");
+ stats->frameCount = 0;
+ }
+
+ return size;
+}
+
+
+int dabInputUdpClose(void* args)
+{
+ return 0;
+}
+
+
+int dabInputUdpClean(void** args)
+{
+ dabInputUdpData* input = (dabInputUdpData*)(*args);
+ delete input->socket;
+ delete input->packet;
+ delete input;
+ return 0;
+}
+
+
+# endif
+#endif
diff --git a/src/dabInputUdp.h b/src/dabInputUdp.h
new file mode 100644
index 0000000..c0de1dd
--- /dev/null
+++ b/src/dabInputUdp.h
@@ -0,0 +1,59 @@
+/*
+ Copyright (C) 2009 Her Majesty the Queen in Right of Canada (Communications
+ Research Center Canada)
+ */
+/*
+ This file is part of CRC-DabMux.
+
+ CRC-DabMux is free software: you can 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.
+
+ CRC-DabMux is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with CRC-DabMux. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef DAB_INPUT_UDP_H
+#define DAB_INPUT_UDP_H
+
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+#include "dabInput.h"
+#include "dabInputFifo.h"
+#include "UdpSocket.h"
+
+
+#ifdef HAVE_FORMAT_RAW
+# ifdef HAVE_INPUT_UDP
+
+
+extern struct dabInputOperations dabInputUdpOperations;
+
+
+struct dabInputUdpData {
+ UdpSocket* socket;
+ UdpPacket* packet;
+ dabInputFifoStats stats;
+};
+
+
+int dabInputUdpInit(void** args);
+int dabInputUdpOpen(void* args, const char* inputName);
+int dabInputUdpRead(dabInputOperations* ops, void* args, void* buffer, int size);
+int dabInputUdpClose(void* args);
+int dabInputUdpClean(void** args);
+
+
+# endif
+#endif
+
+
+#endif // DAB_INPUT_UDP_H
diff --git a/src/dabOutput.cpp b/src/dabOutput.cpp
new file mode 100644
index 0000000..5351501
--- /dev/null
+++ b/src/dabOutput.cpp
@@ -0,0 +1,1112 @@
+/*
+ Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Her Majesty the Queen in
+ Right of Canada (Communications Research Center Canada)
+ */
+/*
+ This file is part of CRC-DabMux.
+
+ CRC-DabMux is free software: you can 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.
+
+ CRC-DabMux is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with CRC-DabMux. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "dabOutput.h"
+#include "UdpSocket.h"
+
+#include <string.h>
+#include <stdio.h>
+#include <fcntl.h>
+#include <limits.h>
+
+#ifdef _WIN32
+# include <io.h>
+# ifdef __MINGW32__
+# define FS_DECLARE_CFG_ARRAYS
+# include <winioctl.h>
+# endif
+# include <sdci.h>
+#else
+# include <farsync.h>
+# include <unistd.h>
+# include <sys/time.h>
+# ifndef O_BINARY
+# define O_BINARY 0
+# endif // O_BINARY
+#endif
+
+
+int dabOutputDefaultInit(void** args) {
+ return -1;
+}
+
+
+int dabOutputDefaultOpen(void* args, const char* filename)
+{
+ return -1;
+}
+
+
+int dabOutputDefaultWrite(void* args, void* buffer, int size)
+{
+ return -1;
+}
+
+
+int dabOutputDefaultClose(void* args)
+{
+ return -1;
+}
+
+
+int dabOutputDefaultClean(void** args)
+{
+ return -1;
+}
+
+
+struct dabOutputOperations dabOutputDefaultOperations = {
+ dabOutputDefaultInit,
+ dabOutputDefaultOpen,
+ dabOutputDefaultWrite,
+ dabOutputDefaultClose,
+ dabOutputDefaultClean
+};
+
+
+enum EtiFileType {
+ ETI_FILE_TYPE_NONE = 0,
+ ETI_FILE_TYPE_RAW,
+ ETI_FILE_TYPE_STREAMED,
+ ETI_FILE_TYPE_FRAMED
+};
+
+
+struct dabOutputFifoData {
+ int file;
+ EtiFileType type;
+ unsigned long nbFrames;
+};
+
+
+int dabOutputFifoInit(void** args)
+{
+ dabOutputFifoData* data = new dabOutputFifoData;
+
+ *args = data;
+ data->file = -1;
+ data->type = ETI_FILE_TYPE_STREAMED;
+ data->nbFrames = 0;
+ return 0;
+}
+
+
+int dabOutputFifoOpen(void* args, const char* filename)
+{
+ dabOutputFifoData* data = (dabOutputFifoData*)args;
+
+ char* token = strchr((char*)filename, '?');
+ if (token != NULL) {
+ *(token++) = 0;
+ char* nextPair;
+ char* key;
+ char* value;
+ do {
+ nextPair = strchr(token, '&');
+ if (nextPair != NULL) {
+ *nextPair = 0;
+ }
+ key = token;
+ value = strchr(token, '=');
+ if (value != NULL) {
+ *(value++) = 0;
+ if (strcmp(key, "type") == 0) {
+ if (strcmp(value, "raw") == 0) {
+ data->type = ETI_FILE_TYPE_RAW;
+ break;
+ } else if (strcmp(value, "framed") == 0) {
+ data->type = ETI_FILE_TYPE_FRAMED;
+ break;
+ } else if (strcmp(value, "streamed") == 0) {
+ data->type = ETI_FILE_TYPE_STREAMED;
+ break;
+ } else {
+ etiLog.printHeader(TcpLog::ERR,
+ "File type '%s' is not supported.\n", value);
+ return -1;
+ }
+ }
+ }
+ } while (nextPair != NULL);
+ }
+
+ data->file = open(filename, O_WRONLY | O_CREAT | O_TRUNC | O_BINARY, 0666);
+ if (data->file == -1) {
+ perror(filename);
+ return -1;
+ }
+ return 0;
+}
+
+
+int dabOutputFifoWrite(void* args, void* buffer, int size)
+{
+ dabOutputFifoData* data = (dabOutputFifoData*)args;
+ uint8_t padding[6144];
+
+ switch (data->type) {
+ case ETI_FILE_TYPE_FRAMED:
+ if (data->nbFrames == 0) {
+ uint32_t nbFrames = (uint32_t)-1;
+ // Writting nb frame
+ if (write(data->file, &nbFrames, 4) == -1) goto FIFO_WRITE_ERROR;
+ }
+ case ETI_FILE_TYPE_STREAMED:
+ // Writting frame length
+ if (write(data->file, &size, 2) == -1) goto FIFO_WRITE_ERROR;
+ // Appending data
+ if (write(data->file, buffer, size) == -1) goto FIFO_WRITE_ERROR;
+ break;
+ case ETI_FILE_TYPE_RAW:
+ // Appending data
+ if (write(data->file, buffer, size) == -1) goto FIFO_WRITE_ERROR;
+ // Appending padding
+ memset(padding, 0x55, 6144 - size);
+ if (write(data->file, padding, 6144 - size) == -1) goto FIFO_WRITE_ERROR;
+ break;
+ default:
+ etiLog.printHeader(TcpLog::ERR, "File type is not supported.\n");
+ return -1;
+ }
+
+
+ return size;
+
+FIFO_WRITE_ERROR:
+ perror("Error while writting to file");
+ return -1;
+}
+
+
+int dabOutputFifoClose(void* args)
+{
+ dabOutputFifoData* data = (dabOutputFifoData*)args;
+
+ if (close(data->file) == 0) {
+ data->file = -1;
+ return 0;
+ }
+ perror("Can't close file");
+ return -1;
+}
+
+
+int dabOutputFifoClean(void** args)
+{
+ delete (dabOutputFifoData*)(*args);
+ return 0;
+}
+
+
+struct dabOutputOperations dabOutputFifoOperations = {
+ dabOutputFifoInit,
+ dabOutputFifoOpen,
+ dabOutputFifoWrite,
+ dabOutputFifoClose,
+ dabOutputFifoClean
+};
+
+
+struct dabOutputFileData {
+ int file;
+ EtiFileType type;
+ unsigned long nbFrames;
+};
+
+
+int dabOutputFileInit(void** args)
+{
+ dabOutputFileData* data = new dabOutputFileData;
+
+ *args = data;
+ data->file = -1;
+ data->type = ETI_FILE_TYPE_FRAMED;
+ data->nbFrames = 0;
+ return 0;
+}
+
+
+int dabOutputFileWrite(void* args, void* buffer, int size)
+{
+ dabOutputFileData* data = (dabOutputFileData*)args;
+
+ uint8_t padding[6144];
+ ++data->nbFrames;
+
+ switch (data->type) {
+ case ETI_FILE_TYPE_FRAMED:
+ // Writting nb of frames at beginning of file
+ if (lseek(data->file, 0, SEEK_SET) == -1) goto FILE_WRITE_ERROR;
+ if (write(data->file, &data->nbFrames, 4) == -1) goto FILE_WRITE_ERROR;
+
+ // Writting nb frame length at end of file
+ if (lseek(data->file, 0, SEEK_END) == -1) goto FILE_WRITE_ERROR;
+ if (write(data->file, &size, 2) == -1) goto FILE_WRITE_ERROR;
+
+ // Appending data
+ if (write(data->file, buffer, size) == -1) goto FILE_WRITE_ERROR;
+ break;
+ case ETI_FILE_TYPE_STREAMED:
+ // Writting nb frame length at end of file
+ if (write(data->file, &size, 2) == -1) goto FILE_WRITE_ERROR;
+
+ // Appending data
+ if (write(data->file, buffer, size) == -1) goto FILE_WRITE_ERROR;
+ break;
+ case ETI_FILE_TYPE_RAW:
+ // Appending data
+ if (write(data->file, buffer, size) == -1) goto FILE_WRITE_ERROR;
+
+ // Appending padding
+ memset(padding, 0x55, 6144 - size);
+ if (write(data->file, padding, 6144 - size) == -1) goto FILE_WRITE_ERROR;
+ break;
+ default:
+ etiLog.printHeader(TcpLog::ERR, "File type is not supported.\n");
+ return -1;
+ }
+
+ return size;
+
+FILE_WRITE_ERROR:
+ perror("Error while writting to file");
+ return -1;
+}
+
+
+int dabOutputFileClean(void** args)
+{
+ delete (dabOutputFileData*)(*args);
+ return 0;
+}
+
+
+struct dabOutputOperations dabOutputFileOperations = {
+ dabOutputFileInit,
+ dabOutputFifoOpen,
+ dabOutputFileWrite,
+ dabOutputFifoClose,
+ dabOutputFileClean
+};
+
+
+struct dabOutputRawData {
+#ifdef _WIN32
+ HANDLE socket;
+#else
+ int socket;
+ bool isCyclades;
+#endif
+ unsigned char* buffer;
+};
+
+
+const unsigned char revTable[] = {
+ 0x00, 0x80, 0x40, 0xc0, 0x20, 0xa0, 0x60, 0xe0,
+ 0x10, 0x90, 0x50, 0xd0, 0x30, 0xb0, 0x70, 0xf0,
+ 0x08, 0x88, 0x48, 0xc8, 0x28, 0xa8, 0x68, 0xe8,
+ 0x18, 0x98, 0x58, 0xd8, 0x38, 0xb8, 0x78, 0xf8,
+ 0x04, 0x84, 0x44, 0xc4, 0x24, 0xa4, 0x64, 0xe4,
+ 0x14, 0x94, 0x54, 0xd4, 0x34, 0xb4, 0x74, 0xf4,
+ 0x0c, 0x8c, 0x4c, 0xcc, 0x2c, 0xac, 0x6c, 0xec,
+ 0x1c, 0x9c, 0x5c, 0xdc, 0x3c, 0xbc, 0x7c, 0xfc,
+ 0x02, 0x82, 0x42, 0xc2, 0x22, 0xa2, 0x62, 0xe2,
+ 0x12, 0x92, 0x52, 0xd2, 0x32, 0xb2, 0x72, 0xf2,
+ 0x0a, 0x8a, 0x4a, 0xca, 0x2a, 0xaa, 0x6a, 0xea,
+ 0x1a, 0x9a, 0x5a, 0xda, 0x3a, 0xba, 0x7a, 0xfa,
+ 0x06, 0x86, 0x46, 0xc6, 0x26, 0xa6, 0x66, 0xe6,
+ 0x16, 0x96, 0x56, 0xd6, 0x36, 0xb6, 0x76, 0xf6,
+ 0x0e, 0x8e, 0x4e, 0xce, 0x2e, 0xae, 0x6e, 0xee,
+ 0x1e, 0x9e, 0x5e, 0xde, 0x3e, 0xbe, 0x7e, 0xfe,
+ 0x01, 0x81, 0x41, 0xc1, 0x21, 0xa1, 0x61, 0xe1,
+ 0x11, 0x91, 0x51, 0xd1, 0x31, 0xb1, 0x71, 0xf1,
+ 0x09, 0x89, 0x49, 0xc9, 0x29, 0xa9, 0x69, 0xe9,
+ 0x19, 0x99, 0x59, 0xd9, 0x39, 0xb9, 0x79, 0xf9,
+ 0x05, 0x85, 0x45, 0xc5, 0x25, 0xa5, 0x65, 0xe5,
+ 0x15, 0x95, 0x55, 0xd5, 0x35, 0xb5, 0x75, 0xf5,
+ 0x0d, 0x8d, 0x4d, 0xcd, 0x2d, 0xad, 0x6d, 0xed,
+ 0x1d, 0x9d, 0x5d, 0xdd, 0x3d, 0xbd, 0x7d, 0xfd,
+ 0x03, 0x83, 0x43, 0xc3, 0x23, 0xa3, 0x63, 0xe3,
+ 0x13, 0x93, 0x53, 0xd3, 0x33, 0xb3, 0x73, 0xf3,
+ 0x0b, 0x8b, 0x4b, 0xcb, 0x2b, 0xab, 0x6b, 0xeb,
+ 0x1b, 0x9b, 0x5b, 0xdb, 0x3b, 0xbb, 0x7b, 0xfb,
+ 0x07, 0x87, 0x47, 0xc7, 0x27, 0xa7, 0x67, 0xe7,
+ 0x17, 0x97, 0x57, 0xd7, 0x37, 0xb7, 0x77, 0xf7,
+ 0x0f, 0x8f, 0x4f, 0xcf, 0x2f, 0xaf, 0x6f, 0xef,
+ 0x1f, 0x9f, 0x5f, 0xdf, 0x3f, 0xbf, 0x7f, 0xff
+};
+
+
+int dabOutputRawInit(void** args)
+{
+ dabOutputRawData* data = new dabOutputRawData;
+
+ *args = data;
+#ifdef _WIN32
+ data->socket = INVALID_HANDLE_VALUE;
+#else
+ data->socket = -1;
+ data->isCyclades = false;
+#endif
+ data->buffer = new unsigned char[6144];
+ return 0;
+}
+
+
+#ifdef _WIN32
+# include <fscfg.h>
+# include <sdci.h>
+#else
+# include <netinet/in.h>
+# include <sys/types.h>
+# include <sys/socket.h>
+# include <sys/ioctl.h>
+# include <linux/if_packet.h>
+# include <linux/netdevice.h>
+# include <net/if_arp.h>
+#endif
+int dabOutputRawOpen(void* args, const char* filename)
+{
+ dabOutputRawData* data = (dabOutputRawData*)args;
+
+ if (filename == NULL) {
+ etiLog.printHeader(TcpLog::ERR, "Socket name must be provided!\n");
+ return -1;
+ }
+
+#ifdef _WIN32
+ // Opening device
+ data->socket = CreateFile(filename, GENERIC_WRITE, 0, NULL, OPEN_EXISTING,
+ FILE_ATTRIBUTE_NORMAL, NULL);
+ if (data->socket == INVALID_HANDLE_VALUE) {
+ etiLog.printHeader(TcpLog::ERR, "Can't open raw device '%s': %i\n",
+ filename, GetLastError());
+ return -1;
+ }
+
+ // Configuring device
+ DWORD result;
+ FS_TE1_CONFIG config;
+ if (!DeviceIoControl(data->socket, IoctlCodeFarSyncGetTE1Config, NULL, 0,
+ &config, sizeof(config), &result, NULL)) {
+ etiLog.printHeader(TcpLog::ERR,
+ "Can't get raw device '%s' config: %i\n",
+ filename, GetLastError());
+ return -1;
+ }
+ config.dataRate = 2048000;
+ config.clocking = CLOCKING_MASTER;
+ config.framing = FRAMING_E1;
+ config.structure = STRUCTURE_UNFRAMED;
+ config.iface = INTERFACE_BNC;
+ config.coding = CODING_HDB3;
+ config.lineBuildOut = LBO_0dB;
+ config.equalizer = EQUALIZER_SHORT;
+ config.transparentMode = TRUE;
+ config.loopMode = LOOP_NONE;
+ config.range = RANGE_0_40_M;
+ config.txBufferMode = BUFFER_2_FRAME;
+ config.rxBufferMode = BUFFER_2_FRAME;
+ config.startingTimeSlot = 0;
+ config.losThreshold = 2;
+ config.enableIdleCode = TRUE;
+ config.idleCode = 0xff;
+ if (!DeviceIoControl(data->socket, IoctlCodeFarSyncSetTE1Config,
+ &config, sizeof(config), NULL, 0, &result, NULL)) {
+ etiLog.printHeader(TcpLog::ERR,
+ "Can't set raw device '%s' config: %i\n",
+ filename, GetLastError());
+ return -1;
+ }
+
+ // Starting device
+ if (!DeviceIoControl(data->socket, IoctlCodeFarSyncQuickStart, NULL, 0,
+ NULL, 0, &result, NULL)) {
+ etiLog.printHeader(TcpLog::ERR, "Can't start raw device '%s': %i\n",
+ filename, GetLastError());
+ return -1;
+ }
+#else
+ data->socket = socket(PF_INET, SOCK_DGRAM, IPPROTO_IP);
+ if (data->socket == -1) {
+ etiLog.printHeader(TcpLog::ERR, "Are you logged as root?\n");
+ perror(filename);
+ return -1;
+ }
+
+ struct ifreq ifr;
+ struct sockaddr_ll saddr;
+ memset(&ifr, 0, sizeof(struct ifreq));
+ (void)strncpy(ifr.ifr_name, filename, sizeof(ifr.ifr_name));
+
+ // Get current Farsync configuration
+ struct fstioc_info info;
+ memset(&info, 0, sizeof(info));
+ ifr.ifr_data = (char*)&info;
+ if (ioctl(data->socket, FSTGETCONF, &ifr) == -1) {
+ etiLog.printHeader(TcpLog::DBG, "Cyclades card identified.\n");
+ data->isCyclades = true;
+
+ // Set the interface MTU if needed
+ if (ioctl(data->socket, SIOCGIFMTU, &ifr) == -1) {
+ etiLog.printHeader(TcpLog::ERR, "Can't get raw device MTU!\n");
+ perror(filename);
+ return -1;
+ } else {
+ if (ifr.ifr_mtu != 6143) {
+ ifr.ifr_mtu = 6143;
+ if (ioctl(data->socket, SIOCSIFMTU, &ifr) == -1) {
+ etiLog.printHeader(TcpLog::ERR,
+ "Can't Cyclades device MTU!\n");
+ perror(filename);
+ return -1;
+ }
+ }
+ }
+ } else {
+ etiLog.printHeader(TcpLog::DBG, "Farsync card identified.\n");
+ data->isCyclades = false;
+
+ info.lineInterface = E1;
+ info.proto = FST_RAW;
+ info.internalClock = EXTCLK;
+ info.lineSpeed = 2048000;
+ //info.debug = DBG_INIT | DBG_OPEN | DBG_PCI | DBG_IOCTL | DBG_TX;
+ info.transparentMode = 1;
+ info.ignoreCarrier = 1;
+ info.numTxBuffers = 8;
+ info.numRxBuffers = 8;
+ info.txBufferSize = 6144;
+ info.rxBufferSize = 6144;
+ // E1 specific config
+ info.clockSource = CLOCKING_SLAVE;
+ info.structure = STRUCTURE_UNFRAMED;
+ info.interface = INTERFACE_BNC; //RJ48C;
+ info.coding = CODING_HDB3;
+ info.txBufferMode = BUFFER_2_FRAME;
+ info.idleCode = 0xff;
+ info.valid = FSTVAL_ALL;
+
+ // Setting configuration
+ etiLog.printHeader(TcpLog::DBG, "Set configuration.\n");
+ ifr.ifr_data = (char*)&info;
+ if (ioctl(data->socket, FSTSETCONF, &ifr) == -1) {
+ etiLog.printHeader(TcpLog::ERR,
+ "Can't set Farsync configurationi!\n");
+ perror(filename);
+ return -1;
+ }
+
+ // Disabling notify
+ etiLog.printHeader(TcpLog::DBG, "Disable notify.\n");
+ int notify = 0;
+ ifr.ifr_data = (char*)&notify;
+ if (ioctl(data->socket, FSTSNOTIFY, &ifr) == -1) {
+ etiLog.printHeader(TcpLog::ERR, "Can't disable Farsync notify!\n");
+ perror(filename);
+ return -1;
+ }
+
+ // Apply the new configuration
+ // Set the interface down if needed
+ etiLog.printHeader(TcpLog::DBG, "Get flags.\n");
+ if (ioctl(data->socket, SIOCGIFFLAGS, &ifr) == -1) {
+ etiLog.printHeader(TcpLog::ERR, "Can't get Farsync flags!\n");
+ perror(filename);
+ return -1;
+ } else {
+ if (ifr.ifr_flags & IFF_UP) {
+ etiLog.printHeader(TcpLog::DBG, "Set flags.\n");
+ ifr.ifr_flags &= ~IFF_UP;
+ if (ioctl(data->socket, SIOCSIFFLAGS, &ifr) == -1) {
+ etiLog.printHeader(TcpLog::ERR,
+ "Can't turn down Farsync device!\n");
+ perror(filename);
+ return -1;
+ }
+ }
+ }
+
+ // Set the interface MTU if needed
+ etiLog.printHeader(TcpLog::DBG, "Get MTU.\n");
+ if (ioctl(data->socket, SIOCGIFMTU, &ifr) == -1) {
+ etiLog.printHeader(TcpLog::ERR, "Can't get Farsync MTU!\n");
+ perror(filename);
+ return -1;
+ } else {
+ if (ifr.ifr_mtu != 6144) {
+ etiLog.printHeader(TcpLog::DBG, "Set MTU.\n");
+ ifr.ifr_mtu = 6144;
+ if (ioctl(data->socket, SIOCSIFMTU, &ifr) == -1) {
+ etiLog.printHeader(TcpLog::ERR, "Can't set Farsync MTU!\n");
+ perror(filename);
+ return -1;
+ }
+ }
+ }
+ }
+
+ // Set the interface up if needed
+ etiLog.printHeader(TcpLog::DBG, "Get flags.\n");
+ if (ioctl(data->socket, SIOCGIFFLAGS, &ifr) == -1) {
+ etiLog.printHeader(TcpLog::ERR, "Can't get raw device flags!\n");
+ perror(filename);
+ return -1;
+ } else {
+ if (!(ifr.ifr_flags & IFF_UP)) {
+ ifr.ifr_flags |= IFF_UP;
+ etiLog.printHeader(TcpLog::DBG, "Set flags.\n");
+ if (ioctl(data->socket, SIOCSIFFLAGS, &ifr) == -1) {
+ etiLog.printHeader(TcpLog::ERR, "Can't turn up raw device!\n");
+ perror(filename);
+ return -1;
+ }
+ }
+ }
+
+ close(data->socket);
+
+ ////////////////////
+ // Opening device //
+ ////////////////////
+
+ if ((data->socket = socket(PF_PACKET, SOCK_RAW, htons(ETH_P_CUST))) == -1) {
+ etiLog.printHeader(TcpLog::ERR, "Are you logged as root?\n");
+ perror(filename);
+ return -1;
+ }
+
+ // ioctl to read the interface number
+ etiLog.printHeader(TcpLog::DBG, "Get index.\n");
+ memset(&ifr, 0, sizeof(struct ifreq));
+ strncpy(ifr.ifr_name, filename, sizeof(ifr.ifr_name));
+ if (ioctl(data->socket, SIOCGIFINDEX, (char *) &ifr) == -1) {
+ perror(filename);
+ return -1;
+ }
+
+ // Bind to the interface name
+ etiLog.printHeader(TcpLog::DBG, "Bind interface.\n");
+ memset(&saddr, 0, sizeof(struct sockaddr_ll));
+ saddr.sll_family = AF_PACKET;
+ saddr.sll_protocol = ARPHRD_RAWHDLC;
+ saddr.sll_ifindex = ifr.ifr_ifindex;
+ if (bind(data->socket, (struct sockaddr *) &saddr, sizeof(saddr)) == -1) {
+ etiLog.printHeader(TcpLog::ERR, "Can't bind raw device!\n");
+ perror(filename);
+ return -1;
+ }
+#endif
+
+ return 0;
+}
+
+
+int dabOutputRawWrite(void* args, void* buffer, int size)
+{
+ dabOutputRawData* data = (dabOutputRawData*)args;
+
+ // Encoding data
+ memcpy(data->buffer, buffer, size);
+ memset(data->buffer + size, 0x55, 6144 - size);
+ for (int i = 0; i < 6144; ++i) {
+ data->buffer[i] = revTable[data->buffer[i]];
+ }
+
+ // Writting data
+#ifdef _WIN32
+ DWORD result;
+ if(!DeviceIoControl(data->socket, IoctlCodeTxFrame, data->buffer, 6144,
+ NULL, 0, &result, NULL)) {
+ goto RAW_WRITE_ERROR;
+ }
+#else
+ /*
+ if (write(data->socket, data->buffer + 1, 6143) != 6143) {
+ goto RAW_WRITE_ERROR;
+ }
+ */
+ if (data->isCyclades) {
+ if (write(data->socket, data->buffer + 1, 6143) != 6143) {
+ goto RAW_WRITE_ERROR;
+ }
+ } else {
+ int ret = send(data->socket, data->buffer, 6144, 0);
+ if (ret != 6144) {
+ fprintf(stderr, "%i/6144 bytes written\n", ret);
+ goto RAW_WRITE_ERROR;
+ }
+ }
+#endif
+
+ return size;
+
+RAW_WRITE_ERROR:
+#ifdef _WIN32
+ DWORD err = GetLastError();
+ LPSTR errMsg;
+ if(FormatMessage(
+ FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM,
+ NULL,
+ err,
+ 0,
+ (LPTSTR)&errMsg,
+ 0,
+ NULL) == 0) {
+ fprintf(stderr, "Error while writting to raw socket: %i\n", err);
+ } else {
+ fprintf(stderr, "Error while writting to raw socket: %s\n", errMsg);
+ LocalFree(errMsg);
+ }
+#else
+ perror("Error while writting to raw socket");
+#endif
+
+ return -1;
+}
+
+
+int dabOutputRawClose(void* args)
+{
+ dabOutputRawData* data = (dabOutputRawData*)args;
+
+#ifdef _WIN32
+ CancelIo(data->socket);
+ CloseHandle(data->socket);
+ return 0;
+#else
+ if (close(data->socket) == 0) {
+ data->socket = -1;
+ return 0;
+ }
+ perror("Can't close raw socket");
+#endif
+
+ return -1;
+}
+
+
+int dabOutputRawClean(void** args)
+{
+ dabOutputRawData* data = *((dabOutputRawData**)args);
+
+ delete []data->buffer;
+ delete data;
+ return 0;
+}
+
+
+struct dabOutputOperations dabOutputRawOperations = {
+ dabOutputRawInit,
+ dabOutputRawOpen,
+ dabOutputRawWrite,
+ dabOutputRawClose,
+ dabOutputRawClean
+};
+
+
+struct dabOutputUdpData {
+ UdpSocket* socket;
+ UdpPacket* packet;
+};
+
+
+int dabOutputUdpInit(void** args)
+{
+ dabOutputUdpData* data = new dabOutputUdpData;
+
+ *args = data;
+ UdpSocket::init();
+ data->packet = new UdpPacket(6144);
+ data->socket = new UdpSocket();
+
+ return 0;
+}
+
+
+int dabOutputUdpOpen(void* args, const char* filename)
+{
+ dabOutputUdpData* data = (dabOutputUdpData*)args;
+ filename = strdup(filename);
+
+ char* address;
+ long port;
+ address = strchr((char*)filename, ':');
+ if (address == NULL) {
+ etiLog.printHeader(TcpLog::ERR,
+ "\"%s\" is an invalid format for udp address: "
+ "should be [address]:port - > aborting\n",
+ filename);
+ return -1;
+ }
+ *(address++) = 0;
+ port = strtol(address, (char **)NULL, 10);
+ if ((port == LONG_MIN) || (port == LONG_MAX)) {
+ etiLog.printHeader(TcpLog::ERR,
+ "can't convert port number in udp address %s\n", address);
+ return -1;
+ }
+ if (port == 0) {
+ etiLog.printHeader(TcpLog::ERR,
+ "can't use port number 0 in udp address\n");
+ return -1;
+ }
+ address = (char*)filename;
+ if (strlen(address) > 0) {
+ if (data->packet->getAddress().setAddress(address) == -1) {
+ etiLog.printHeader(TcpLog::ERR, "can't set address %s (%s: %s) "
+ "-> aborting\n", address, inetErrDesc, inetErrMsg);
+ return -1;
+ }
+ }
+ data->packet->getAddress().setPort(port);
+
+ if (data->socket->create() == -1) {
+ etiLog.printHeader(TcpLog::ERR, "can't create Udp socket (%s: %s) "
+ "-> aborting\n)", inetErrDesc, inetErrMsg);
+ return -1;
+ }
+
+ //sprintf(filename, "%s:%i", data->packet->getAddress().getHostAddress(),
+ // data->packet->getAddress().getPort());
+ return 0;
+}
+
+
+int dabOutputUdpWrite(void* args, void* buffer, int size)
+{
+ dabOutputUdpData* data = (dabOutputUdpData*)args;
+
+ data->packet->setLength(0);
+ data->packet->addData(buffer, size);
+ return data->socket->send(*data->packet);
+}
+
+
+int dabOutputUdpClose(void* args)
+{
+ //dabOutputUdpData* data = (dabOutputUdpData*)args;
+
+ return 0;
+}
+
+
+int dabOutputUdpClean(void** args)
+{
+ dabOutputUdpData* data = *((dabOutputUdpData**)args);
+
+ delete data->socket;
+ delete data->packet;
+ delete data;
+
+ return 0;
+}
+
+
+struct dabOutputOperations dabOutputUdpOperations = {
+ dabOutputUdpInit,
+ dabOutputUdpOpen,
+ dabOutputUdpWrite,
+ dabOutputUdpClose,
+ dabOutputUdpClean
+};
+
+
+#include "TcpServer.h"
+struct dabOutputTcpData {
+ TcpServer* server;
+ TcpSocket* client;
+ pthread_t thread;
+};
+
+
+int dabOutputTcpInit(void** args)
+{
+ dabOutputTcpData* data = new dabOutputTcpData;
+
+ *args = data;
+ TcpSocket::init();
+ data->server = new TcpServer();
+ data->client = NULL;
+
+ return 0;
+}
+
+
+void* dabOutputTcpThread(void* args)
+{
+ dabOutputTcpData* data = (dabOutputTcpData*)args;
+ TcpSocket* client;
+
+ while ((client = data->server->accept()) != NULL) {
+ etiLog.print(TcpLog::INFO, "TCP server got a new client.\n");
+ if (data->client != NULL) {
+ delete data->client;
+ }
+ data->client = client;
+ }
+ etiLog.print(TcpLog::ERR, "TCP thread can't accept new client (%s)\n",
+ inetErrDesc, inetErrMsg);
+
+ return NULL;
+}
+
+
+int dabOutputTcpOpen(void* args, const char* filename)
+{
+ dabOutputTcpData* data = (dabOutputTcpData*)args;
+ filename = strdup(filename);
+
+ char* address;
+ long port;
+ address = strchr((char*)filename, ':');
+ if (address == NULL) {
+ etiLog.printHeader(TcpLog::ERR,
+ "\"%s\" is an invalid format for tcp address: "
+ "should be [address]:port - > aborting\n",
+ filename);
+ return -1;
+ }
+ *(address++) = 0;
+ port = strtol(address, (char **)NULL, 10);
+ if ((port == LONG_MIN) || (port == LONG_MAX)) {
+ etiLog.printHeader(TcpLog::ERR,
+ "can't convert port number in tcp address %s\n", address);
+ return -1;
+ }
+ if (port == 0) {
+ etiLog.printHeader(TcpLog::ERR,
+ "can't use port number 0 in tcp address\n");
+ return -1;
+ }
+ address = (char*)filename;
+ if (strlen(address) > 0) {
+ if (data->server->create(port, address) == -1) {
+ etiLog.printHeader(TcpLog::ERR, "Can't create Tcp server on %s:%i "
+ "(%s: %s) -> aborting\n",
+ address, port, inetErrDesc, inetErrMsg);
+ return -1;
+ }
+ } else {
+ if (data->server->create(port) == -1) {
+ etiLog.printHeader(TcpLog::ERR, "Can't create Tcp server on :%i "
+ "(%s: %s) -> aborting\n",
+ port, inetErrDesc, inetErrMsg);
+ return -1;
+ }
+ }
+
+ //sprintf(filename, "%s:%i", data->packet->getAddress().getHostAddress(),
+ // data->packet->getAddress().getPort());
+
+ if (data->server->listen() == -1) {
+ etiLog.printHeader(TcpLog::ERR, "Can't listen on Tcp socket (%s: %s)\n",
+ inetErrDesc, inetErrMsg);
+ return -1;
+ }
+#ifdef _WIN32
+ data->thread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)dabOutputTcpThread, data, 0, NULL);
+ if (data->thread == NULL) {
+ fprintf(stderr, "Can't create TCP child");
+ return -1;
+ }
+#else
+ if (pthread_create(&data->thread, NULL, dabOutputTcpThread, data)) {
+ perror("Can't create TCP child");
+ return -1;
+ }
+#endif
+
+ return 0;
+}
+
+
+int dabOutputTcpWrite(void* args, void* buffer, int size)
+{
+ dabOutputTcpData* data = (dabOutputTcpData*)args;
+
+ if (data->client != NULL) {
+ if (data->client->write(&size, 2) == 2) {
+ if (data->client->write(buffer, size) != size) {
+ return size;
+ }
+ }
+ else {
+ etiLog.print(TcpLog::INFO, "TCP server client disconnected.\n");
+ delete data->client;
+ data->client = NULL;
+ }
+ }
+ return size;
+}
+
+
+#include <signal.h>
+int dabOutputTcpClose(void* args)
+{
+ dabOutputTcpData* data = (dabOutputTcpData*)args;
+
+ data->server->close();
+ if( data->client != NULL )
+ data->client->close();
+#ifdef WIN32
+ DWORD status;
+ for (int i = 0; i < 5; ++i) {
+ if (GetExitCodeThread(data->thread, &status)) {
+ break;
+ }
+ Sleep(100);
+ }
+ TerminateThread(data->thread, 1);
+#else
+ pthread_kill(data->thread, SIGPIPE);
+#endif
+
+ return 0;
+}
+
+
+int dabOutputTcpClean(void** args)
+{
+ dabOutputTcpData* data = *((dabOutputTcpData**)args);
+
+#ifdef _WIN32
+ CloseHandle(data->thread);
+#endif
+
+ delete data->server;
+ delete data->client;
+ delete data;
+
+ return 0;
+}
+
+
+struct dabOutputOperations dabOutputTcpOperations = {
+ dabOutputTcpInit,
+ dabOutputTcpOpen,
+ dabOutputTcpWrite,
+ dabOutputTcpClose,
+ dabOutputTcpClean
+};
+
+
+struct dabOutputSimulData {
+#ifdef _WIN32
+ DWORD startTime;
+#else
+ timeval startTime;
+#endif
+};
+
+
+int dabOutputSimulInit(void** args) {
+ dabOutputSimulData* data = new dabOutputSimulData;
+
+ *args = data;
+
+ return 0;
+}
+
+
+int dabOutputSimulOpen(void* args, const char* filename)
+{
+ dabOutputSimulData* data = (dabOutputSimulData*)args;
+
+#ifdef _WIN32
+ data->startTime = GetTickCount();
+#else
+ gettimeofday(&data->startTime, NULL);
+#endif
+
+ return 0;
+}
+
+
+int dabOutputSimulWrite(void* args, void* buffer, int size)
+{
+ dabOutputSimulData* data = (dabOutputSimulData*)args;
+
+ unsigned long current;
+ unsigned long start;
+ unsigned long waiting;
+
+#ifdef _WIN32
+ current = GetTickCount();
+ start = data->startTime;
+ if (current < start) {
+ waiting = start - current + 24;
+ Sleep(waiting);
+ } else {
+ waiting = 24 - (current - start);
+ if ((current - start) < 24) {
+ Sleep(waiting);
+ }
+ }
+ data->startTime += 24;
+#else
+ timeval curTime;
+ gettimeofday(&curTime, NULL);
+ current = (1000000ul * curTime.tv_sec) + curTime.tv_usec;
+ start = (1000000ul * data->startTime.tv_sec) + data->startTime.tv_usec;
+ waiting = 24000ul - (current - start);
+ if ((current - start) < 24000ul) {
+ usleep(waiting);
+ }
+
+ data->startTime.tv_usec += 24000;
+ if (data->startTime.tv_usec >= 1000000) {
+ data->startTime.tv_usec -= 1000000;
+ ++data->startTime.tv_sec;
+ }
+#endif
+
+ return size;
+}
+
+
+int dabOutputSimulClose(void* args)
+{
+ //dabOutputSimulData* data = (dabOutputSimulData*)args);
+
+ return 0;
+}
+
+
+int dabOutputSimulClean(void** args)
+{
+ dabOutputSimulData* data = *((dabOutputSimulData**)args);
+
+ delete data;
+
+ return 0;
+}
+
+
+struct dabOutputOperations dabOutputSimulOperations = {
+ dabOutputSimulInit,
+ dabOutputSimulOpen,
+ dabOutputSimulWrite,
+ dabOutputSimulClose,
+ dabOutputSimulClean
+};
+
+
diff --git a/src/dabOutput.h b/src/dabOutput.h
new file mode 100644
index 0000000..26c154a
--- /dev/null
+++ b/src/dabOutput.h
@@ -0,0 +1,72 @@
+/*
+ Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Her Majesty the Queen in
+ Right of Canada (Communications Research Center Canada)
+ */
+/*
+ This file is part of CRC-DabMux.
+
+ CRC-DabMux is free software: you can 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.
+
+ CRC-DabMux is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with CRC-DabMux. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef _DABOUTPUT
+#define _DABOUTPUT
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+
+struct dabOutputOperations {
+ int (*init)(void** args);
+ int (*open)(void* args, const char* name);
+ int (*write)(void* args, void* buffer, int size);
+ int (*close)(void* args);
+ int (*clean)(void** args);
+};
+
+extern struct dabOutputOperations dabOutputDefaultOperations;
+
+#if defined(HAVE_OUTPUT_FILE)
+extern struct dabOutputOperations dabOutputFileOperations;
+#endif // defined(HAVE_OUTPUT_FILE)
+
+#if defined(HAVE_OUTPUT_FIFO)
+extern struct dabOutputOperations dabOutputFifoOperations;
+#endif // defined(HAVE_OUTPUT_FIFO)
+
+#if defined(HAVE_OUTPUT_UDP)
+extern struct dabOutputOperations dabOutputUdpOperations;
+#endif // defined(HAVE_OUTPUT_UDP)
+
+#if defined(HAVE_OUTPUT_TCP)
+extern struct dabOutputOperations dabOutputTcpOperations;
+#endif // defined(HAVE_OUTPUT_TCP)
+
+#if defined(HAVE_OUTPUT_RAW)
+extern struct dabOutputOperations dabOutputRawOperations;
+#endif // defined(HAVE_OUTPUT_RAW)
+
+#if defined(HAVE_OUTPUT_SIMUL)
+extern struct dabOutputOperations dabOutputSimulOperations;
+#endif // defined(HAVE_OUTPUT_SIMUL)
+
+
+extern const unsigned char revTable[];
+
+
+#include "TcpLog.h"
+extern TcpLog etiLog;
+
+
+#endif // _DABOUTPUT
diff --git a/src/dabUtils.cpp b/src/dabUtils.cpp
new file mode 100644
index 0000000..693d300
--- /dev/null
+++ b/src/dabUtils.cpp
@@ -0,0 +1,52 @@
+/*
+ Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 Her Majesty the
+ Queen in Right of Canada (Communications Research Center Canada)
+ */
+/*
+ This file is part of CRC-DabMux.
+
+ CRC-DabMux is free software: you can 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.
+
+ CRC-DabMux is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with CRC-DabMux. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "dabUtils.h"
+
+long gregorian2mjd(int year,int month,int day)
+{
+ long MJD;
+
+ //This is the algorithm for the JD, just substract 2400000.5 for MJD
+ year += 8000;
+ if(month < 3) {
+ year--;
+ month += 12;
+ }
+ MJD = (year * 365) + (year / 4) - (year / 100) + (year / 400) - 1200820
+ + ((month * 153 + 3) / 5) - 92 + (day - 1);
+
+ return (long)(MJD - 2400000.5); //truncation, loss of data OK!
+}
+
+
+void dumpBytes(void* data, int size, FILE* out)
+{
+ fprintf(out, "Packet of %i bytes", size);
+
+ for (int index = 0; index < size; ++index) {
+ if ((index % 8) == 0) {
+ fprintf(out, "\n 0x%.4x(%.4i):", index, index);
+ }
+ fprintf(out, " 0x%.2x", ((unsigned char*)data)[index]);
+ }
+ fprintf(out, "\n\n");
+}
diff --git a/src/dabUtils.h b/src/dabUtils.h
new file mode 100644
index 0000000..04bb468
--- /dev/null
+++ b/src/dabUtils.h
@@ -0,0 +1,35 @@
+/*
+ Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 Her Majesty the
+ Queen in Right of Canada (Communications Research Center Canada)
+ */
+/*
+ This file is part of CRC-DabMux.
+
+ CRC-DabMux is free software: you can 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.
+
+ CRC-DabMux is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with CRC-DabMux. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef DABUTILS
+#define DABUTILS
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#include <stdio.h>
+
+long gregorian2mjd(int year,int month,int day);
+void dumpBytes(void* data, int size, FILE* out = stdout);
+
+
+#endif // DABUTILS
diff --git a/src/mpeg.c b/src/mpeg.c
new file mode 100644
index 0000000..57f4231
--- /dev/null
+++ b/src/mpeg.c
@@ -0,0 +1,221 @@
+/*
+ Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 Her Majesty
+ the Queen in Right of Canada (Communications Research Center Canada)
+ */
+/*
+ This file is part of CRC-DabMux.
+
+ CRC-DabMux is free software: you can 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.
+
+ CRC-DabMux is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with CRC-DabMux. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "mpeg.h"
+
+#include <stdio.h>
+#include <errno.h>
+
+
+const static short bitrateArray[4][4][16] = {
+ { // MPEG 2.5
+ { -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1 }, // layer invalid
+ { 0, 8, 16, 24, 32, 40, 48, 56,
+ 64, 80, 96, 112, 128, 144, 160, -1 }, // layer 3
+ { 0, 8, 16, 24, 32, 40, 48, 56,
+ 64, 80, 96, 112, 128, 144, 160, -1 }, // layer 2
+ { 0, 32, 48, 56, 64, 80, 96, 112,
+ 128, 144, 160, 176, 192, 224, 256, -1 } // layer 1
+ },
+ {
+ { -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1 }, // MPEG invalid
+ { -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1 },
+ { -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1 },
+ { -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1 }
+ },
+ {
+ { -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1 }, // MPEG 2
+ { 0, 8, 16, 24, 32, 40, 48, 56,
+ 64, 80, 96, 112, 128, 144, 160, -1 },
+ { 0, 8, 16, 24, 32, 40, 48, 56,
+ 64, 80, 96, 112, 128, 144, 160, -1 },
+ { 0, 32, 48, 56, 64, 80, 96, 112,
+ 128, 144, 160, 176, 192, 224, 256, -1 }
+ },
+ {
+ { -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1 }, // MPEG 1
+ { 0, 32, 40, 48, 56, 64, 80, 96,
+ 112, 128, 160, 192, 224, 256, 320, -1 },
+ { 0, 32, 48, 56, 64, 80, 96, 112,
+ 128, 160, 192, 224, 256, 320, 384, -1 },
+ { 0, 32, 64, 96, 128, 160, 192, 224,
+ 256, 288, 320, 352, 384, 416, 448, -1 }
+ }
+};
+
+
+const static int samplingrateArray[4][4] = {
+ { 11025, 12000, 8000, 0 }, // MPEG 2.5
+ { -1, -1, -1, -1 }, // MPEG invalid
+ { 22050, 24000, 16000, 0 }, // MPEG 2
+ { 44100, 48000, 32000, 0 } // MPEG 1
+};
+
+
+short getMpegBitrate(void* data)
+{
+ mpegHeader* header = (mpegHeader*)data;
+ return bitrateArray[header->id][header->layer][header->bitrate];
+}
+
+
+int getMpegFrequency(void* data)
+{
+ mpegHeader* header = (mpegHeader*)data;
+ return samplingrateArray[header->id][header->samplingrate];
+}
+
+
+int getMpegFrameLength(mpegHeader* header)
+{
+ short bitrate = getMpegBitrate(header);
+ int samplingrate = getMpegFrequency(header);
+ int framelength = -1;
+
+
+ if (bitrate <= 0) {
+ return -1;
+ }
+ if (samplingrate <= 0) {
+ return -1;
+ }
+
+ switch (header->layer) {
+ case 1: // layer III
+ case 2: // layer II
+ framelength = (int)144000 * bitrate / samplingrate + header->padding;
+ break;
+ case 3: // layer I
+ framelength = (12 * bitrate / samplingrate + header->padding) * 4;
+ break;
+ default:
+ framelength = -1;
+ }
+ return framelength;
+}
+
+
+/**
+ * This function replace the read function by trying many times a reading.
+ * It tries to read until all bytes are read. Very useful when reading from a
+ * pipe because sometimes 2 pass is necessary to read all bytes.
+ * @param file File descriptor.
+ * @param data Address of the buffer to write data into.
+ * @param size Number of bytes to read.
+ * @param tries Max number of tries to read.
+ * @return Same as read function:
+ * Nb of bytes read.
+ * -1 if error.
+ */
+ssize_t readData(int file, void* data, size_t size, unsigned int tries)
+{
+ ssize_t result;
+ size_t offset = 0;
+ if (size == 0) return 0;
+ if (tries == 0) return 0;
+ result = read(file, data, size);
+ if (result == -1) {
+ if (errno == EAGAIN) {
+ return readData(file, data, size, tries - 1);
+ }
+ return -1;
+ }
+ offset = result;
+ size -= offset;
+ data = (char*)data + offset;
+ result = readData(file, data, size, tries - 1);
+ if (result == -1) {
+ return -1;
+ }
+ offset += result;
+ return offset;
+}
+
+
+int readMpegHeader(int file, void* data, int size)
+{
+ // Max byte reading for searching sync
+ unsigned int flagmax = 0;
+ unsigned long* syncword = (unsigned long*)data;
+ int result;
+
+ if (size < 4) return MPEG_BUFFER_OVERFLOW;
+ // Mpeg header reading
+ result = readData(file, data, 4, 2);
+ if (result == 0) return MPEG_FILE_EMPTY;
+ if (result == -1) {
+ fprintf(stderr, "header\n");
+ return MPEG_FILE_ERROR;
+ }
+ if (result < 4) {
+ return MPEG_BUFFER_UNDERFLOW;
+ }
+ while ((*syncword & 0xe0ff) != 0xe0ff) {
+ *syncword >>= 8;
+ result = readData(file, (char*)data + 3, 1, 2);
+ if (result == 0) {
+ return MPEG_FILE_EMPTY;
+ } else if (result == -1) {
+ return MPEG_FILE_ERROR;
+ }
+ if (++flagmax > 1200) {
+ return MPEG_SYNC_NOT_FOUND;
+ }
+ }
+ return 4;
+}
+
+
+int readMpegFrame(int file, void* data, int size)
+{
+ mpegHeader* header = (mpegHeader*)data;
+ int framelength;
+ int result;
+
+ framelength = getMpegFrameLength(header);
+ if (framelength < 0) return MPEG_INVALID_FRAME;
+ if (framelength > size) {
+ //lseek(file, framelength - 4, SEEK_CUR);
+ //return MPEG_BUFFER_OVERFLOW;
+ result = readData(file, ((char*)data) + 4, size - 4, 2);
+ if (size == 4) {
+ lseek(file, framelength - size, SEEK_CUR);
+ result = framelength - 4;
+ }
+ } else {
+ result = readData(file, ((char*)data) + 4, framelength - 4, 2);
+ }
+ if (result == 0) return MPEG_FILE_EMPTY;
+ if (result == -1) {
+ return MPEG_FILE_ERROR;
+ }
+ if (result < framelength - 4) {
+ return MPEG_BUFFER_UNDERFLOW;
+ }
+ return framelength;
+}
diff --git a/src/mpeg.h b/src/mpeg.h
new file mode 100644
index 0000000..d892225
--- /dev/null
+++ b/src/mpeg.h
@@ -0,0 +1,82 @@
+/*
+ Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 Her Majesty
+ the Queen in Right of Canada (Communications Research Center Canada)
+ */
+/*
+ This file is part of CRC-DabMux.
+
+ CRC-DabMux is free software: you can 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.
+
+ CRC-DabMux is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with CRC-DabMux. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef _MPEG
+#define _MPEG
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#ifdef _WIN32
+# include <stddef.h>
+# include <basetsd.h>
+# include <io.h>
+
+# define ssize_t SSIZE_T
+#else
+# include <unistd.h>
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef struct {
+ unsigned long sync1:8;
+
+ unsigned long protection:1;
+ unsigned long layer:2;
+ unsigned long id:2;
+ unsigned long sync2:3;
+
+ unsigned long priv:1;
+ unsigned long padding:1;
+ unsigned long samplingrate:2;
+ unsigned long bitrate:4;
+
+ unsigned long emphasis:2;
+ unsigned long original:1;
+ unsigned long copyright:1;
+ unsigned long mode:2;
+ unsigned long channel:2;
+} mpegHeader;
+
+
+extern short getMpegBitrate(void* data);
+extern int getMpegFrequency(void* data);
+int getMpegFrameLength(mpegHeader* header);
+ssize_t readData(int file, void* data, size_t size, unsigned int tries);
+
+#define MPEG_BUFFER_OVERFLOW -2
+#define MPEG_FILE_EMPTY -3
+#define MPEG_FILE_ERROR -4
+#define MPEG_SYNC_NOT_FOUND -5
+#define MPEG_INVALID_FRAME -6
+#define MPEG_BUFFER_UNDERFLOW -7
+int readMpegHeader(int file, void* data, int size);
+int readMpegFrame(int file, void* data, int size);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // _MPEG
diff --git a/src/prbs.c b/src/prbs.c
new file mode 100644
index 0000000..8a11266
--- /dev/null
+++ b/src/prbs.c
@@ -0,0 +1,140 @@
+/*
+ Copyright (C) 2005, 2006, 2007, 2008, 2009 Her Majesty the Queen in Right
+ of Canada (Communications Research Center Canada)
+ */
+/*
+ This file is part of CRC-DabMux.
+
+ CRC-DabMux is free software: you can 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.
+
+ CRC-DabMux is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with CRC-DabMux. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "prbs.h"
+
+#include <string.h>
+#include <stdlib.h>
+#include <limits.h>
+
+
+/*
+ * Generate a parity check for a 32-bit word.
+ */
+unsigned long parity_check(unsigned long prbs_accum)
+{
+ unsigned long mask=1UL, parity=0UL;
+ int i;
+ for (i = 0; i < 32; ++i) {
+ parity ^= ((prbs_accum & mask) != 0UL);
+ mask <<= 1;
+ }
+ return parity;
+}
+
+/*
+ * Generate a table of matrix products to update a 32-bit PRBS generator.
+ */
+void gen_prbs_table(void* args)
+{
+ prbs_data* data = (prbs_data*)args;
+ int i;
+ for (i = 0; i < 4; ++i) {
+ int j;
+ for (j = 0; j < 256; ++j) {
+ unsigned long prbs_accum = ((unsigned long)j << (i * 8));
+ int k;
+ for (k = 0; k < 8; ++k) {
+ prbs_accum = (prbs_accum << 1)
+ ^ parity_check(prbs_accum & data->polynomial);
+ }
+ data->prbs_table[i][j] = (prbs_accum & 0xff);
+ }
+ }
+}
+
+/*
+ * Update a 32-bit PRBS generator eight bits at a time.
+ */
+unsigned long update_prbs(void* args)
+{
+ prbs_data* data = (prbs_data*)args;
+ unsigned char acc_lsb = 0;
+ int i;
+ for (i = 0; i < 4; ++i ) {
+ acc_lsb ^= data->prbs_table [i] [ (data->accum >> (i * 8) ) & 0xff ];
+ }
+ return (data->accum << 8) ^ ((unsigned long)acc_lsb);
+}
+
+/*
+ * Generate the weight table.
+ */
+void gen_weight_table(void* args)
+{
+ prbs_data* data = (prbs_data*)args;
+ int i;
+ for (i = 0; i < 256; ++i) {
+ unsigned char mask=1U, ones_count = 0U;
+ int j;
+ for (j = 0; j < 8; ++j) {
+ ones_count += ((i & mask) != 0U);
+ mask = mask << 1;
+ }
+ data->weight[i] = ones_count;
+ }
+}
+
+/*
+ * Count the number of errors in a block of received data.
+ */
+unsigned long error_count(void* args, unsigned char *rx_data,
+ int rx_data_length)
+{
+ prbs_data* data = (prbs_data*)args;
+ unsigned long error_count = 0U;
+ unsigned long prbs_accum = 0U;
+ int i;
+
+ /* seed the PRBS accumulator */
+ for (i = 0; i < 4; ++i) {
+ prbs_accum = (prbs_accum << 8) ^ (rx_data[i] ^ data->polarity_mask);
+ }
+
+ /* check the received data */
+ for (i = 0; i < rx_data_length; ++i) {
+ unsigned char error_pattern = (unsigned char)
+ ((prbs_accum >> 24)
+ ^ (rx_data[i] ^ data->polarity_mask));
+ if (error_pattern != 0U) {
+ error_count += data->weight[error_pattern];
+ }
+ prbs_accum = update_prbs(data);
+ }
+ return error_count;
+}
+
+void gen_sequence(void* args, unsigned char *tx_data, int tx_data_length,
+ unsigned long polynomial)
+{
+ prbs_data* data = (prbs_data*)args;
+ unsigned long prbs_accum = 0U;
+
+ while (prbs_accum < polynomial) {
+ prbs_accum <<= 1;
+ prbs_accum |= 1;
+ }
+
+ while (tx_data_length-- > 0) {
+ prbs_accum = update_prbs(data);
+ *(tx_data++) = (unsigned char)(prbs_accum & 0xff);
+ }
+}
diff --git a/src/prbs.h b/src/prbs.h
new file mode 100644
index 0000000..827ded6
--- /dev/null
+++ b/src/prbs.h
@@ -0,0 +1,61 @@
+/*
+ Copyright (C) 2005, 2006, 2007, 2008, 2009 Her Majesty the Queen in Right
+ of Canada (Communications Research Center Canada)
+ */
+/*
+ This file is part of CRC-DabMux.
+
+ CRC-DabMux is free software: you can 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.
+
+ CRC-DabMux is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with CRC-DabMux. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef _PRBS
+#define _PRBS
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+
+#ifdef __cplusplus
+extern "C" { // }
+#endif
+
+typedef struct {
+ // table of matrix products used to update a 32-bit PRBS generator
+ unsigned long prbs_table [4] [256];
+ // table of weights for 8-bit bytes
+ unsigned char weight[256];
+ // PRBS polynomial generator
+ unsigned long polynomial;
+ // PRBS generator polarity mask
+ unsigned char polarity_mask;
+ // PRBS accumulator
+ unsigned long accum;
+} prbs_data;
+
+
+unsigned long parity_check(unsigned long prbs_accum);
+void gen_prbs_table(void* args);
+unsigned long update_prbs(void* args);
+void gen_weight_table(void* args);
+unsigned long error_count(void* args, unsigned char *rx_data,
+ int rx_data_length);
+void gen_sequence(void* args, unsigned char *tx_data, int tx_data_length,
+ unsigned long polynomial);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // _PRBS