added Open Lighting Architecture files
parent
a0e5b74975
commit
e7c42a9351
|
@ -0,0 +1,4 @@
|
|||
|
||||
Simon Newton
|
||||
nomis52@westnet.com.au
|
||||
|
|
@ -0,0 +1,340 @@
|
|||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 2, June 1991
|
||||
|
||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
|
||||
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your
|
||||
freedom to share and change it. By contrast, the GNU General Public
|
||||
License is intended to guarantee your freedom to share and change free
|
||||
software--to make sure the software is free for all its users. This
|
||||
General Public License applies to most of the Free Software
|
||||
Foundation's software and to any other program whose authors commit to
|
||||
using it. (Some other Free Software Foundation software is covered by
|
||||
the GNU Library General Public License instead.) You can apply it to
|
||||
your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
this service if you wish), that you receive source code or can get it
|
||||
if you want it, that you can change the software or use pieces of it
|
||||
in new free programs; and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid
|
||||
anyone to deny you these rights or to ask you to surrender the rights.
|
||||
These restrictions translate to certain responsibilities for you if you
|
||||
distribute copies of the software, or if you modify it.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must give the recipients all the rights that
|
||||
you have. You must make sure that they, too, receive or can get the
|
||||
source code. And you must show them these terms so they know their
|
||||
rights.
|
||||
|
||||
We protect your rights with two steps: (1) copyright the software, and
|
||||
(2) offer you this license which gives you legal permission to copy,
|
||||
distribute and/or modify the software.
|
||||
|
||||
Also, for each author's protection and ours, we want to make certain
|
||||
that everyone understands that there is no warranty for this free
|
||||
software. If the software is modified by someone else and passed on, we
|
||||
want its recipients to know that what they have is not the original, so
|
||||
that any problems introduced by others will not reflect on the original
|
||||
authors' reputations.
|
||||
|
||||
Finally, any free program is threatened constantly by software
|
||||
patents. We wish to avoid the danger that redistributors of a free
|
||||
program will individually obtain patent licenses, in effect making the
|
||||
program proprietary. To prevent this, we have made it clear that any
|
||||
patent must be licensed for everyone's free use or not licensed at all.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License applies to any program or other work which contains
|
||||
a notice placed by the copyright holder saying it may be distributed
|
||||
under the terms of this General Public License. The "Program", below,
|
||||
refers to any such program or work, and a "work based on the Program"
|
||||
means either the Program or any derivative work under copyright law:
|
||||
that is to say, a work containing the Program or a portion of it,
|
||||
either verbatim or with modifications and/or translated into another
|
||||
language. (Hereinafter, translation is included without limitation in
|
||||
the term "modification".) Each licensee is addressed as "you".
|
||||
|
||||
Activities other than copying, distribution and modification are not
|
||||
covered by this License; they are outside its scope. The act of
|
||||
running the Program is not restricted, and the output from the Program
|
||||
is covered only if its contents constitute a work based on the
|
||||
Program (independent of having been made by running the Program).
|
||||
Whether that is true depends on what the Program does.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Program's
|
||||
source code as you receive it, in any medium, provided that you
|
||||
conspicuously and appropriately publish on each copy an appropriate
|
||||
copyright notice and disclaimer of warranty; keep intact all the
|
||||
notices that refer to this License and to the absence of any warranty;
|
||||
and give any other recipients of the Program a copy of this License
|
||||
along with the Program.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy, and
|
||||
you may at your option offer warranty protection in exchange for a fee.
|
||||
|
||||
2. You may modify your copy or copies of the Program or any portion
|
||||
of it, thus forming a work based on the Program, and copy and
|
||||
distribute such modifications or work under the terms of Section 1
|
||||
above, provided that you also meet all of these conditions:
|
||||
|
||||
a) You must cause the modified files to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
|
||||
b) You must cause any work that you distribute or publish, that in
|
||||
whole or in part contains or is derived from the Program or any
|
||||
part thereof, to be licensed as a whole at no charge to all third
|
||||
parties under the terms of this License.
|
||||
|
||||
c) If the modified program normally reads commands interactively
|
||||
when run, you must cause it, when started running for such
|
||||
interactive use in the most ordinary way, to print or display an
|
||||
announcement including an appropriate copyright notice and a
|
||||
notice that there is no warranty (or else, saying that you provide
|
||||
a warranty) and that users may redistribute the program under
|
||||
these conditions, and telling the user how to view a copy of this
|
||||
License. (Exception: if the Program itself is interactive but
|
||||
does not normally print such an announcement, your work based on
|
||||
the Program is not required to print an announcement.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If
|
||||
identifiable sections of that work are not derived from the Program,
|
||||
and can be reasonably considered independent and separate works in
|
||||
themselves, then this License, and its terms, do not apply to those
|
||||
sections when you distribute them as separate works. But when you
|
||||
distribute the same sections as part of a whole which is a work based
|
||||
on the Program, the distribution of the whole must be on the terms of
|
||||
this License, whose permissions for other licensees extend to the
|
||||
entire whole, and thus to each and every part regardless of who wrote it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest
|
||||
your rights to work written entirely by you; rather, the intent is to
|
||||
exercise the right to control the distribution of derivative or
|
||||
collective works based on the Program.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Program
|
||||
with the Program (or with a work based on the Program) on a volume of
|
||||
a storage or distribution medium does not bring the other work under
|
||||
the scope of this License.
|
||||
|
||||
3. You may copy and distribute the Program (or a work based on it,
|
||||
under Section 2) in object code or executable form under the terms of
|
||||
Sections 1 and 2 above provided that you also do one of the following:
|
||||
|
||||
a) Accompany it with the complete corresponding machine-readable
|
||||
source code, which must be distributed under the terms of Sections
|
||||
1 and 2 above on a medium customarily used for software interchange; or,
|
||||
|
||||
b) Accompany it with a written offer, valid for at least three
|
||||
years, to give any third party, for a charge no more than your
|
||||
cost of physically performing source distribution, a complete
|
||||
machine-readable copy of the corresponding source code, to be
|
||||
distributed under the terms of Sections 1 and 2 above on a medium
|
||||
customarily used for software interchange; or,
|
||||
|
||||
c) Accompany it with the information you received as to the offer
|
||||
to distribute corresponding source code. (This alternative is
|
||||
allowed only for noncommercial distribution and only if you
|
||||
received the program in object code or executable form with such
|
||||
an offer, in accord with Subsection b above.)
|
||||
|
||||
The source code for a work means the preferred form of the work for
|
||||
making modifications to it. For an executable work, complete source
|
||||
code means all the source code for all modules it contains, plus any
|
||||
associated interface definition files, plus the scripts used to
|
||||
control compilation and installation of the executable. However, as a
|
||||
special exception, the source code distributed need not include
|
||||
anything that is normally distributed (in either source or binary
|
||||
form) with the major components (compiler, kernel, and so on) of the
|
||||
operating system on which the executable runs, unless that component
|
||||
itself accompanies the executable.
|
||||
|
||||
If distribution of executable or object code is made by offering
|
||||
access to copy from a designated place, then offering equivalent
|
||||
access to copy the source code from the same place counts as
|
||||
distribution of the source code, even though third parties are not
|
||||
compelled to copy the source along with the object code.
|
||||
|
||||
4. You may not copy, modify, sublicense, or distribute the Program
|
||||
except as expressly provided under this License. Any attempt
|
||||
otherwise to copy, modify, sublicense or distribute the Program is
|
||||
void, and will automatically terminate your rights under this License.
|
||||
However, parties who have received copies, or rights, from you under
|
||||
this License will not have their licenses terminated so long as such
|
||||
parties remain in full compliance.
|
||||
|
||||
5. You are not required to accept this License, since you have not
|
||||
signed it. However, nothing else grants you permission to modify or
|
||||
distribute the Program or its derivative works. These actions are
|
||||
prohibited by law if you do not accept this License. Therefore, by
|
||||
modifying or distributing the Program (or any work based on the
|
||||
Program), you indicate your acceptance of this License to do so, and
|
||||
all its terms and conditions for copying, distributing or modifying
|
||||
the Program or works based on it.
|
||||
|
||||
6. Each time you redistribute the Program (or any work based on the
|
||||
Program), the recipient automatically receives a license from the
|
||||
original licensor to copy, distribute or modify the Program subject to
|
||||
these terms and conditions. You may not impose any further
|
||||
restrictions on the recipients' exercise of the rights granted herein.
|
||||
You are not responsible for enforcing compliance by third parties to
|
||||
this License.
|
||||
|
||||
7. If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent issues),
|
||||
conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot
|
||||
distribute so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you
|
||||
may not distribute the Program at all. For example, if a patent
|
||||
license would not permit royalty-free redistribution of the Program by
|
||||
all those who receive copies directly or indirectly through you, then
|
||||
the only way you could satisfy both it and this License would be to
|
||||
refrain entirely from distribution of the Program.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under
|
||||
any particular circumstance, the balance of the section is intended to
|
||||
apply and the section as a whole is intended to apply in other
|
||||
circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any
|
||||
patents or other property right claims or to contest validity of any
|
||||
such claims; this section has the sole purpose of protecting the
|
||||
integrity of the free software distribution system, which is
|
||||
implemented by public license practices. Many people have made
|
||||
generous contributions to the wide range of software distributed
|
||||
through that system in reliance on consistent application of that
|
||||
system; it is up to the author/donor to decide if he or she is willing
|
||||
to distribute software through any other system and a licensee cannot
|
||||
impose that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to
|
||||
be a consequence of the rest of this License.
|
||||
|
||||
8. If the distribution and/or use of the Program is restricted in
|
||||
certain countries either by patents or by copyrighted interfaces, the
|
||||
original copyright holder who places the Program under this License
|
||||
may add an explicit geographical distribution limitation excluding
|
||||
those countries, so that distribution is permitted only in or among
|
||||
countries not thus excluded. In such case, this License incorporates
|
||||
the limitation as if written in the body of this License.
|
||||
|
||||
9. The Free Software Foundation may publish revised and/or new versions
|
||||
of the General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Program
|
||||
specifies a version number of this License which applies to it and "any
|
||||
later version", you have the option of following the terms and conditions
|
||||
either of that version or of any later version published by the Free
|
||||
Software Foundation. If the Program does not specify a version number of
|
||||
this License, you may choose any version ever published by the Free Software
|
||||
Foundation.
|
||||
|
||||
10. If you wish to incorporate parts of the Program into other free
|
||||
programs whose distribution conditions are different, write to the author
|
||||
to ask for permission. For software which is copyrighted by the Free
|
||||
Software Foundation, write to the Free Software Foundation; we sometimes
|
||||
make exceptions for this. Our decision will be guided by the two goals
|
||||
of preserving the free status of all derivatives of our free software and
|
||||
of promoting the sharing and reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
|
||||
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
|
||||
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
|
||||
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
|
||||
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
|
||||
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
|
||||
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
|
||||
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
|
||||
REPAIR OR CORRECTION.
|
||||
|
||||
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
|
||||
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
|
||||
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
|
||||
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
|
||||
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
|
||||
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
|
||||
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGES.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
convey the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<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 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program is interactive, make it output a short notice like this
|
||||
when it starts in an interactive mode:
|
||||
|
||||
Gnomovision version 69, Copyright (C) year name of author
|
||||
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||
parts of the General Public License. Of course, the commands you use may
|
||||
be called something other than `show w' and `show c'; they could even be
|
||||
mouse-clicks or menu items--whatever suits your program.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or your
|
||||
school, if any, to sign a "copyright disclaimer" for the program, if
|
||||
necessary. Here is a sample; alter the names:
|
||||
|
||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
|
||||
`Gnomovision' (which makes passes at compilers) written by James Hacker.
|
||||
|
||||
<signature of Ty Coon>, 1 April 1989
|
||||
Ty Coon, President of Vice
|
||||
|
||||
This General Public License does not permit incorporating your program into
|
||||
proprietary programs. If your program is a subroutine library, you may
|
||||
consider it more useful to permit linking proprietary applications with the
|
||||
library. If this is what you want to do, use the GNU Library General
|
||||
Public License instead of this License.
|
|
@ -0,0 +1,47 @@
|
|||
28/8/2006 Simon Newton <nomis52@westnet.com.au>
|
||||
|
||||
* added artnet_dmxmonitor
|
||||
|
||||
23/8/2006 Simon Newton <nomis52@westnet.com.au>
|
||||
|
||||
* fixed off by one error in artnet-usb
|
||||
|
||||
|
||||
9/05/2006 Simon Newton <nomis52@westnet.com.au>
|
||||
|
||||
* removed compat mode
|
||||
* changed to single sd
|
||||
|
||||
25/04/2006 Simon Newton <nomis52@westnet.com.au>
|
||||
|
||||
* added artnet_setdmx
|
||||
* examples now support compatability mode (libartnet >= 1.0.2)
|
||||
|
||||
|
||||
30/01/2006 Simon Newton <nomis52@westnet.com.au>
|
||||
|
||||
* Build scripts now detect ncurses
|
||||
|
||||
30/01/2006 Simon Newton <nomis52@westnet.com.au>
|
||||
|
||||
* More OSX fixes
|
||||
|
||||
13/04/2005 Simon Newton <nomis52@westnet.com.au>
|
||||
|
||||
* Mac OSX portability fixes
|
||||
|
||||
12/03/2005 Simon Newton <nomis52@westnet.com.au>
|
||||
|
||||
* Split from libartnet
|
||||
* Added node joining support, two nodes can now be joined to get 8 ports -
|
||||
new example program artnet_multiport (you'll need to edit the second ip)
|
||||
|
||||
12/02/2005 Simon Newton <nomis52@westnet.com.au>
|
||||
|
||||
* Fixed compiler warnings
|
||||
|
||||
11/02/2005 Simon Newton <nomis52@westnet.com.au>
|
||||
|
||||
* Added firmware receive support - new example program artnet_firmware_node
|
||||
* Added firmware send support - new example program artnet_firmware_server
|
||||
|
|
@ -0,0 +1,234 @@
|
|||
Installation Instructions
|
||||
*************************
|
||||
|
||||
Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005,
|
||||
2006 Free Software Foundation, Inc.
|
||||
|
||||
This file is free documentation; the Free Software Foundation gives
|
||||
unlimited permission to copy, distribute and modify it.
|
||||
|
||||
Basic Installation
|
||||
==================
|
||||
|
||||
Briefly, the shell commands `./configure; make; make install' should
|
||||
configure, build, and install this package. The following
|
||||
more-detailed instructions are generic; see the `README' file for
|
||||
instructions specific to this package.
|
||||
|
||||
The `configure' shell script attempts to guess correct values for
|
||||
various system-dependent variables used during compilation. It uses
|
||||
those values to create a `Makefile' in each directory of the package.
|
||||
It may also create one or more `.h' files containing system-dependent
|
||||
definitions. Finally, it creates a shell script `config.status' that
|
||||
you can run in the future to recreate the current configuration, and a
|
||||
file `config.log' containing compiler output (useful mainly for
|
||||
debugging `configure').
|
||||
|
||||
It can also use an optional file (typically called `config.cache'
|
||||
and enabled with `--cache-file=config.cache' or simply `-C') that saves
|
||||
the results of its tests to speed up reconfiguring. Caching is
|
||||
disabled by default to prevent problems with accidental use of stale
|
||||
cache files.
|
||||
|
||||
If you need to do unusual things to compile the package, please try
|
||||
to figure out how `configure' could check whether to do them, and mail
|
||||
diffs or instructions to the address given in the `README' so they can
|
||||
be considered for the next release. If you are using the cache, and at
|
||||
some point `config.cache' contains results you don't want to keep, you
|
||||
may remove or edit it.
|
||||
|
||||
The file `configure.ac' (or `configure.in') is used to create
|
||||
`configure' by a program called `autoconf'. You need `configure.ac' if
|
||||
you want to change it or regenerate `configure' using a newer version
|
||||
of `autoconf'.
|
||||
|
||||
The simplest way to compile this package is:
|
||||
|
||||
1. `cd' to the directory containing the package's source code and type
|
||||
`./configure' to configure the package for your system.
|
||||
|
||||
Running `configure' might take a while. While running, it prints
|
||||
some messages telling which features it is checking for.
|
||||
|
||||
2. Type `make' to compile the package.
|
||||
|
||||
3. Optionally, type `make check' to run any self-tests that come with
|
||||
the package.
|
||||
|
||||
4. Type `make install' to install the programs and any data files and
|
||||
documentation.
|
||||
|
||||
5. You can remove the program binaries and object files from the
|
||||
source code directory by typing `make clean'. To also remove the
|
||||
files that `configure' created (so you can compile the package for
|
||||
a different kind of computer), type `make distclean'. There is
|
||||
also a `make maintainer-clean' target, but that is intended mainly
|
||||
for the package's developers. If you use it, you may have to get
|
||||
all sorts of other programs in order to regenerate files that came
|
||||
with the distribution.
|
||||
|
||||
Compilers and Options
|
||||
=====================
|
||||
|
||||
Some systems require unusual options for compilation or linking that the
|
||||
`configure' script does not know about. Run `./configure --help' for
|
||||
details on some of the pertinent environment variables.
|
||||
|
||||
You can give `configure' initial values for configuration parameters
|
||||
by setting variables in the command line or in the environment. Here
|
||||
is an example:
|
||||
|
||||
./configure CC=c99 CFLAGS=-g LIBS=-lposix
|
||||
|
||||
*Note Defining Variables::, for more details.
|
||||
|
||||
Compiling For Multiple Architectures
|
||||
====================================
|
||||
|
||||
You can compile the package for more than one kind of computer at the
|
||||
same time, by placing the object files for each architecture in their
|
||||
own directory. To do this, you can use GNU `make'. `cd' to the
|
||||
directory where you want the object files and executables to go and run
|
||||
the `configure' script. `configure' automatically checks for the
|
||||
source code in the directory that `configure' is in and in `..'.
|
||||
|
||||
With a non-GNU `make', it is safer to compile the package for one
|
||||
architecture at a time in the source code directory. After you have
|
||||
installed the package for one architecture, use `make distclean' before
|
||||
reconfiguring for another architecture.
|
||||
|
||||
Installation Names
|
||||
==================
|
||||
|
||||
By default, `make install' installs the package's commands under
|
||||
`/usr/local/bin', include files under `/usr/local/include', etc. You
|
||||
can specify an installation prefix other than `/usr/local' by giving
|
||||
`configure' the option `--prefix=PREFIX'.
|
||||
|
||||
You can specify separate installation prefixes for
|
||||
architecture-specific files and architecture-independent files. If you
|
||||
pass the option `--exec-prefix=PREFIX' to `configure', the package uses
|
||||
PREFIX as the prefix for installing programs and libraries.
|
||||
Documentation and other data files still use the regular prefix.
|
||||
|
||||
In addition, if you use an unusual directory layout you can give
|
||||
options like `--bindir=DIR' to specify different values for particular
|
||||
kinds of files. Run `configure --help' for a list of the directories
|
||||
you can set and what kinds of files go in them.
|
||||
|
||||
If the package supports it, you can cause programs to be installed
|
||||
with an extra prefix or suffix on their names by giving `configure' the
|
||||
option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
|
||||
|
||||
Optional Features
|
||||
=================
|
||||
|
||||
Some packages pay attention to `--enable-FEATURE' options to
|
||||
`configure', where FEATURE indicates an optional part of the package.
|
||||
They may also pay attention to `--with-PACKAGE' options, where PACKAGE
|
||||
is something like `gnu-as' or `x' (for the X Window System). The
|
||||
`README' should mention any `--enable-' and `--with-' options that the
|
||||
package recognizes.
|
||||
|
||||
For packages that use the X Window System, `configure' can usually
|
||||
find the X include and library files automatically, but if it doesn't,
|
||||
you can use the `configure' options `--x-includes=DIR' and
|
||||
`--x-libraries=DIR' to specify their locations.
|
||||
|
||||
Specifying the System Type
|
||||
==========================
|
||||
|
||||
There may be some features `configure' cannot figure out automatically,
|
||||
but needs to determine by the type of machine the package will run on.
|
||||
Usually, assuming the package is built to be run on the _same_
|
||||
architectures, `configure' can figure that out, but if it prints a
|
||||
message saying it cannot guess the machine type, give it the
|
||||
`--build=TYPE' option. TYPE can either be a short name for the system
|
||||
type, such as `sun4', or a canonical name which has the form:
|
||||
|
||||
CPU-COMPANY-SYSTEM
|
||||
|
||||
where SYSTEM can have one of these forms:
|
||||
|
||||
OS KERNEL-OS
|
||||
|
||||
See the file `config.sub' for the possible values of each field. If
|
||||
`config.sub' isn't included in this package, then this package doesn't
|
||||
need to know the machine type.
|
||||
|
||||
If you are _building_ compiler tools for cross-compiling, you should
|
||||
use the option `--target=TYPE' to select the type of system they will
|
||||
produce code for.
|
||||
|
||||
If you want to _use_ a cross compiler, that generates code for a
|
||||
platform different from the build platform, you should specify the
|
||||
"host" platform (i.e., that on which the generated programs will
|
||||
eventually be run) with `--host=TYPE'.
|
||||
|
||||
Sharing Defaults
|
||||
================
|
||||
|
||||
If you want to set default values for `configure' scripts to share, you
|
||||
can create a site shell script called `config.site' that gives default
|
||||
values for variables like `CC', `cache_file', and `prefix'.
|
||||
`configure' looks for `PREFIX/share/config.site' if it exists, then
|
||||
`PREFIX/etc/config.site' if it exists. Or, you can set the
|
||||
`CONFIG_SITE' environment variable to the location of the site script.
|
||||
A warning: not all `configure' scripts look for a site script.
|
||||
|
||||
Defining Variables
|
||||
==================
|
||||
|
||||
Variables not defined in a site shell script can be set in the
|
||||
environment passed to `configure'. However, some packages may run
|
||||
configure again during the build, and the customized values of these
|
||||
variables may be lost. In order to avoid this problem, you should set
|
||||
them in the `configure' command line, using `VAR=value'. For example:
|
||||
|
||||
./configure CC=/usr/local2/bin/gcc
|
||||
|
||||
causes the specified `gcc' to be used as the C compiler (unless it is
|
||||
overridden in the site shell script).
|
||||
|
||||
Unfortunately, this technique does not work for `CONFIG_SHELL' due to
|
||||
an Autoconf bug. Until the bug is fixed you can use this workaround:
|
||||
|
||||
CONFIG_SHELL=/bin/bash /bin/bash ./configure CONFIG_SHELL=/bin/bash
|
||||
|
||||
`configure' Invocation
|
||||
======================
|
||||
|
||||
`configure' recognizes the following options to control how it operates.
|
||||
|
||||
`--help'
|
||||
`-h'
|
||||
Print a summary of the options to `configure', and exit.
|
||||
|
||||
`--version'
|
||||
`-V'
|
||||
Print the version of Autoconf used to generate the `configure'
|
||||
script, and exit.
|
||||
|
||||
`--cache-file=FILE'
|
||||
Enable the cache: use and save the results of the tests in FILE,
|
||||
traditionally `config.cache'. FILE defaults to `/dev/null' to
|
||||
disable caching.
|
||||
|
||||
`--config-cache'
|
||||
`-C'
|
||||
Alias for `--cache-file=config.cache'.
|
||||
|
||||
`--quiet'
|
||||
`--silent'
|
||||
`-q'
|
||||
Do not print messages saying which checks are being made. To
|
||||
suppress all normal output, redirect it to `/dev/null' (any error
|
||||
messages will still be shown).
|
||||
|
||||
`--srcdir=DIR'
|
||||
Look for the package's source code in directory DIR. Usually
|
||||
`configure' can determine that directory automatically.
|
||||
|
||||
`configure' also accepts some other, not widely useful, options. Run
|
||||
`configure --help' for more details.
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
CLOCAL = aclocal -I $(auxdir)
|
||||
ACLOCAL_AMFLAGS = -I config
|
||||
|
||||
SUBDIRS = src
|
|
@ -0,0 +1,597 @@
|
|||
# Makefile.in generated by automake 1.10 from Makefile.am.
|
||||
# @configure_input@
|
||||
|
||||
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
|
||||
# 2003, 2004, 2005, 2006 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@
|
||||
pkglibdir = $(libdir)/@PACKAGE@
|
||||
pkgincludedir = $(includedir)/@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 = :
|
||||
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 \
|
||||
config/depcomp config/install-sh config/missing depcomp \
|
||||
install-sh missing
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
am__aclocal_m4_deps = $(top_srcdir)/config/pkg.m4 \
|
||||
$(top_srcdir)/configure.in
|
||||
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 =
|
||||
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
|
||||
ETAGS = etags
|
||||
CTAGS = ctags
|
||||
DIST_SUBDIRS = $(SUBDIRS)
|
||||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
||||
distdir = $(PACKAGE)-$(VERSION)
|
||||
top_distdir = $(distdir)
|
||||
am__remove_distdir = \
|
||||
{ test ! -d $(distdir) \
|
||||
|| { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \
|
||||
&& rm -fr $(distdir); }; }
|
||||
DIST_ARCHIVES = $(distdir).tar.gz
|
||||
GZIP_ENV = --best
|
||||
distuninstallcheck_listfiles = find . -type f -print
|
||||
distcleancheck_listfiles = find . -type f -print
|
||||
ACLOCAL = @ACLOCAL@
|
||||
AMTAR = @AMTAR@
|
||||
AUTOCONF = @AUTOCONF@
|
||||
AUTOHEADER = @AUTOHEADER@
|
||||
AUTOMAKE = @AUTOMAKE@
|
||||
AWK = @AWK@
|
||||
CC = @CC@
|
||||
CCDEPMODE = @CCDEPMODE@
|
||||
CFLAGS = @CFLAGS@
|
||||
CPP = @CPP@
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
CYGPATH_W = @CYGPATH_W@
|
||||
DEFS = @DEFS@
|
||||
DEPDIR = @DEPDIR@
|
||||
ECHO_C = @ECHO_C@
|
||||
ECHO_N = @ECHO_N@
|
||||
ECHO_T = @ECHO_T@
|
||||
EGREP = @EGREP@
|
||||
EXEEXT = @EXEEXT@
|
||||
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_VERSION = @PACKAGE_VERSION@
|
||||
PATH_SEPARATOR = @PATH_SEPARATOR@
|
||||
PKG_CONFIG = @PKG_CONFIG@
|
||||
SET_MAKE = @SET_MAKE@
|
||||
SHELL = @SHELL@
|
||||
STRIP = @STRIP@
|
||||
VERSION = @VERSION@
|
||||
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@
|
||||
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_alias = @build_alias@
|
||||
builddir = @builddir@
|
||||
datadir = @datadir@
|
||||
datarootdir = @datarootdir@
|
||||
docdir = @docdir@
|
||||
dvidir = @dvidir@
|
||||
exec_prefix = @exec_prefix@
|
||||
host_alias = @host_alias@
|
||||
htmldir = @htmldir@
|
||||
includedir = @includedir@
|
||||
infodir = @infodir@
|
||||
install_sh = @install_sh@
|
||||
libartnet_CFLAGS = @libartnet_CFLAGS@
|
||||
libartnet_LIBS = @libartnet_LIBS@
|
||||
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_alias = @target_alias@
|
||||
top_builddir = @top_builddir@
|
||||
top_srcdir = @top_srcdir@
|
||||
CLOCAL = aclocal -I $(auxdir)
|
||||
ACLOCAL_AMFLAGS = -I config
|
||||
SUBDIRS = src
|
||||
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 '; \
|
||||
cd $(srcdir) && $(AUTOMAKE) --gnu \
|
||||
&& exit 0; \
|
||||
exit 1;; \
|
||||
esac; \
|
||||
done; \
|
||||
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \
|
||||
cd $(top_srcdir) && \
|
||||
$(AUTOMAKE) --gnu Makefile
|
||||
.PRECIOUS: Makefile
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||
@case '$?' in \
|
||||
*config.status*) \
|
||||
echo ' $(SHELL) ./config.status'; \
|
||||
$(SHELL) ./config.status;; \
|
||||
*) \
|
||||
echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \
|
||||
esac;
|
||||
|
||||
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
|
||||
$(SHELL) ./config.status --recheck
|
||||
|
||||
$(top_srcdir)/configure: $(am__configure_deps)
|
||||
cd $(srcdir) && $(AUTOCONF)
|
||||
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
|
||||
cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
|
||||
|
||||
config.h: stamp-h1
|
||||
@if test ! -f $@; then \
|
||||
rm -f stamp-h1; \
|
||||
$(MAKE) $(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)
|
||||
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):
|
||||
@failcom='exit 1'; \
|
||||
for f in x $$MAKEFLAGS; do \
|
||||
case $$f in \
|
||||
*=* | --[!k]*);; \
|
||||
*k*) failcom='fail=yes';; \
|
||||
esac; \
|
||||
done; \
|
||||
dot_seen=no; \
|
||||
target=`echo $@ | sed s/-recursive//`; \
|
||||
list='$(SUBDIRS)'; for subdir in $$list; do \
|
||||
echo "Making $$target in $$subdir"; \
|
||||
if test "$$subdir" = "."; then \
|
||||
dot_seen=yes; \
|
||||
local_target="$$target-am"; \
|
||||
else \
|
||||
local_target="$$target"; \
|
||||
fi; \
|
||||
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|
||||
|| eval $$failcom; \
|
||||
done; \
|
||||
if test "$$dot_seen" = "no"; then \
|
||||
$(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
|
||||
fi; test -z "$$fail"
|
||||
|
||||
$(RECURSIVE_CLEAN_TARGETS):
|
||||
@failcom='exit 1'; \
|
||||
for f in x $$MAKEFLAGS; do \
|
||||
case $$f in \
|
||||
*=* | --[!k]*);; \
|
||||
*k*) failcom='fail=yes';; \
|
||||
esac; \
|
||||
done; \
|
||||
dot_seen=no; \
|
||||
case "$@" in \
|
||||
distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
|
||||
*) list='$(SUBDIRS)' ;; \
|
||||
esac; \
|
||||
rev=''; for subdir in $$list; do \
|
||||
if test "$$subdir" = "."; then :; else \
|
||||
rev="$$subdir $$rev"; \
|
||||
fi; \
|
||||
done; \
|
||||
rev="$$rev ."; \
|
||||
target=`echo $@ | sed s/-recursive//`; \
|
||||
for subdir in $$rev; do \
|
||||
echo "Making $$target in $$subdir"; \
|
||||
if test "$$subdir" = "."; then \
|
||||
local_target="$$target-am"; \
|
||||
else \
|
||||
local_target="$$target"; \
|
||||
fi; \
|
||||
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|
||||
|| eval $$failcom; \
|
||||
done && test -z "$$fail"
|
||||
tags-recursive:
|
||||
list='$(SUBDIRS)'; for subdir in $$list; do \
|
||||
test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
|
||||
done
|
||||
ctags-recursive:
|
||||
list='$(SUBDIRS)'; for subdir in $$list; do \
|
||||
test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
|
||||
done
|
||||
|
||||
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) ' { files[$$0] = 1; } \
|
||||
END { for (i in files) print i; }'`; \
|
||||
mkid -fID $$unique
|
||||
tags: TAGS
|
||||
|
||||
TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
|
||||
$(TAGS_FILES) $(LISP)
|
||||
tags=; \
|
||||
here=`pwd`; \
|
||||
if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
|
||||
include_option=--etags-include; \
|
||||
empty_fix=.; \
|
||||
else \
|
||||
include_option=--include; \
|
||||
empty_fix=; \
|
||||
fi; \
|
||||
list='$(SUBDIRS)'; for subdir in $$list; do \
|
||||
if test "$$subdir" = .; then :; else \
|
||||
test ! -f $$subdir/TAGS || \
|
||||
tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
|
||||
fi; \
|
||||
done; \
|
||||
list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) ' { files[$$0] = 1; } \
|
||||
END { for (i in files) print i; }'`; \
|
||||
if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
|
||||
test -n "$$unique" || unique=$$empty_fix; \
|
||||
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
|
||||
$$tags $$unique; \
|
||||
fi
|
||||
ctags: CTAGS
|
||||
CTAGS: ctags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
|
||||
$(TAGS_FILES) $(LISP)
|
||||
tags=; \
|
||||
here=`pwd`; \
|
||||
list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) ' { files[$$0] = 1; } \
|
||||
END { for (i in files) print i; }'`; \
|
||||
test -z "$(CTAGS_ARGS)$$tags$$unique" \
|
||||
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
|
||||
$$tags $$unique
|
||||
|
||||
GTAGS:
|
||||
here=`$(am__cd) $(top_builddir) && pwd` \
|
||||
&& cd $(top_srcdir) \
|
||||
&& gtags -i $(GTAGS_ARGS) $$here
|
||||
|
||||
distclean-tags:
|
||||
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
|
||||
|
||||
distdir: $(DISTFILES)
|
||||
$(am__remove_distdir)
|
||||
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 $(srcdir)/$$file && test $$d != $(srcdir); then \
|
||||
cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
|
||||
fi; \
|
||||
cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
|
||||
else \
|
||||
test -f $(distdir)/$$file \
|
||||
|| cp -p $$d/$$file $(distdir)/$$file \
|
||||
|| exit 1; \
|
||||
fi; \
|
||||
done
|
||||
list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
|
||||
if test "$$subdir" = .; then :; else \
|
||||
test -d "$(distdir)/$$subdir" \
|
||||
|| $(MKDIR_P) "$(distdir)/$$subdir" \
|
||||
|| exit 1; \
|
||||
distdir=`$(am__cd) $(distdir) && pwd`; \
|
||||
top_distdir=`$(am__cd) $(top_distdir) && pwd`; \
|
||||
(cd $$subdir && \
|
||||
$(MAKE) $(AM_MAKEFLAGS) \
|
||||
top_distdir="$$top_distdir" \
|
||||
distdir="$$distdir/$$subdir" \
|
||||
am__remove_distdir=: \
|
||||
am__skip_length_check=: \
|
||||
distdir) \
|
||||
|| exit 1; \
|
||||
fi; \
|
||||
done
|
||||
-find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \
|
||||
! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
|
||||
! -type d ! -perm -400 -exec chmod a+r {} \; -o \
|
||||
! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \
|
||||
|| chmod -R a+r $(distdir)
|
||||
dist-gzip: distdir
|
||||
tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
|
||||
$(am__remove_distdir)
|
||||
|
||||
dist-bzip2: distdir
|
||||
tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2
|
||||
$(am__remove_distdir)
|
||||
|
||||
dist-tarZ: distdir
|
||||
tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
|
||||
$(am__remove_distdir)
|
||||
|
||||
dist-shar: distdir
|
||||
shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
|
||||
$(am__remove_distdir)
|
||||
|
||||
dist-zip: distdir
|
||||
-rm -f $(distdir).zip
|
||||
zip -rq $(distdir).zip $(distdir)
|
||||
$(am__remove_distdir)
|
||||
|
||||
dist dist-all: distdir
|
||||
tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
|
||||
$(am__remove_distdir)
|
||||
|
||||
# This target untars the dist file and tries a VPATH configuration. Then
|
||||
# it guarantees that the distribution is self-contained by making another
|
||||
# tarfile.
|
||||
distcheck: dist
|
||||
case '$(DIST_ARCHIVES)' in \
|
||||
*.tar.gz*) \
|
||||
GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(am__untar) ;;\
|
||||
*.tar.bz2*) \
|
||||
bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\
|
||||
*.tar.Z*) \
|
||||
uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
|
||||
*.shar.gz*) \
|
||||
GZIP=$(GZIP_ENV) gunzip -c $(distdir).shar.gz | unshar ;;\
|
||||
*.zip*) \
|
||||
unzip $(distdir).zip ;;\
|
||||
esac
|
||||
chmod -R a-w $(distdir); chmod a+w $(distdir)
|
||||
mkdir $(distdir)/_build
|
||||
mkdir $(distdir)/_inst
|
||||
chmod a-w $(distdir)
|
||||
dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
|
||||
&& dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
|
||||
&& cd $(distdir)/_build \
|
||||
&& ../configure --srcdir=.. --prefix="$$dc_install_base" \
|
||||
$(DISTCHECK_CONFIGURE_FLAGS) \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) dvi \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) check \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) install \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) installcheck \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) uninstall \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \
|
||||
distuninstallcheck \
|
||||
&& chmod -R a-w "$$dc_install_base" \
|
||||
&& ({ \
|
||||
(cd ../.. && umask 077 && mkdir "$$dc_destdir") \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \
|
||||
distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \
|
||||
} || { rm -rf "$$dc_destdir"; exit 1; }) \
|
||||
&& rm -rf "$$dc_destdir" \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) dist \
|
||||
&& rm -rf $(DIST_ARCHIVES) \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) distcleancheck
|
||||
$(am__remove_distdir)
|
||||
@(echo "$(distdir) archives ready for distribution: "; \
|
||||
list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \
|
||||
sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x'
|
||||
distuninstallcheck:
|
||||
@cd $(distuninstallcheck_dir) \
|
||||
&& test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \
|
||||
|| { echo "ERROR: files left after uninstall:" ; \
|
||||
if test -n "$(DESTDIR)"; then \
|
||||
echo " (check DESTDIR support)"; \
|
||||
fi ; \
|
||||
$(distuninstallcheck_listfiles) ; \
|
||||
exit 1; } >&2
|
||||
distcleancheck: distclean
|
||||
@if test '$(srcdir)' = . ; then \
|
||||
echo "ERROR: distcleancheck can only run from a VPATH build" ; \
|
||||
exit 1 ; \
|
||||
fi
|
||||
@test `$(distcleancheck_listfiles) | wc -l` -eq 0 \
|
||||
|| { echo "ERROR: files left in build directory after distclean:" ; \
|
||||
$(distcleancheck_listfiles) ; \
|
||||
exit 1; } >&2
|
||||
check-am: all-am
|
||||
check: check-recursive
|
||||
all-am: Makefile config.h
|
||||
installdirs: installdirs-recursive
|
||||
installdirs-am:
|
||||
install: install-recursive
|
||||
install-exec: install-exec-recursive
|
||||
install-data: install-data-recursive
|
||||
uninstall: uninstall-recursive
|
||||
|
||||
install-am: all-am
|
||||
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
|
||||
|
||||
installcheck: installcheck-recursive
|
||||
install-strip:
|
||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
||||
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
|
||||
`test -z '$(STRIP)' || \
|
||||
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
|
||||
mostlyclean-generic:
|
||||
|
||||
clean-generic:
|
||||
|
||||
distclean-generic:
|
||||
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
|
||||
|
||||
maintainer-clean-generic:
|
||||
@echo "This command is intended for maintainers to use"
|
||||
@echo "it deletes files that may require special tools to rebuild."
|
||||
clean: clean-recursive
|
||||
|
||||
clean-am: clean-generic 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
|
||||
|
||||
info: info-recursive
|
||||
|
||||
info-am:
|
||||
|
||||
install-data-am:
|
||||
|
||||
install-dvi: install-dvi-recursive
|
||||
|
||||
install-exec-am:
|
||||
|
||||
install-html: install-html-recursive
|
||||
|
||||
install-info: install-info-recursive
|
||||
|
||||
install-man:
|
||||
|
||||
install-pdf: install-pdf-recursive
|
||||
|
||||
install-ps: install-ps-recursive
|
||||
|
||||
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) install-am \
|
||||
install-strip
|
||||
|
||||
.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-shar dist-tarZ 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:
|
|
@ -0,0 +1,22 @@
|
|||
13/04/2005 artnet-examples-0.3.2
|
||||
|
||||
Addition of artnet_setdmx
|
||||
Upgraded examples to support compatability mode (libartnet >= 1.0.2)
|
||||
|
||||
13/04/2005 artnet-examples-0.3.2
|
||||
|
||||
Mac OS X fixes
|
||||
|
||||
12/03/2005 artnet-examples-0.3.1
|
||||
|
||||
Split from libartnet package
|
||||
Added artnet-multiport
|
||||
|
||||
12/2/2005 libartnet-0.1.3
|
||||
|
||||
Fixed compiler warnings
|
||||
|
||||
11/02/2005 libartnet-0.1.2
|
||||
|
||||
Now includes support for Firmware send/receive.
|
||||
|
|
@ -0,0 +1,57 @@
|
|||
|
||||
This package provides example programs for use with libartnet.
|
||||
|
||||
For installation notes, see the INSTALL file.
|
||||
|
||||
Examples provided:
|
||||
|
||||
A. artnet-usb
|
||||
B. artnet-dmxconsole
|
||||
C. artnet-discover
|
||||
|
||||
A. artnet-usb
|
||||
-------------
|
||||
|
||||
Usage: artnet-usb [OPTIONS]
|
||||
Acts as an ArtNet to DMX node using the Enttec Open Usb Interface
|
||||
|
||||
-a <ip-address> IP address to listen on (defaults to the address
|
||||
of the first non loopback interface)
|
||||
-d <dmx-device> device for dmx output (default /dev/dmx0)
|
||||
-p <port-address> port address for output universe (default 0)
|
||||
-s <subnet-address> subnet address for output universe (default 0)
|
||||
-v be verbose (prints data for first four channels)
|
||||
|
||||
The universe address of the port is made up from the subnet address and the
|
||||
port address. The four least significat bits are the port address, the four
|
||||
most significat are the subnet address.
|
||||
|
||||
For example :
|
||||
|
||||
artnet-usb -p 3 -s 2
|
||||
|
||||
sets the universe address to 0x23
|
||||
|
||||
|
||||
B. artnet-dmxconsole
|
||||
--------------------
|
||||
Usage: artnet-dmxconsole [OPTIONS]
|
||||
A console based controller which outputs DMX data over ArtNet.
|
||||
Modified from the original dmxconsole in dmx4linux.
|
||||
|
||||
-a <ip-address> IP address to send from (defaults to the address
|
||||
of the first non loopback interface)
|
||||
-p <port-address> port address for universe (default 0)
|
||||
-s <subnet-address> subnet address for universe (default 0)
|
||||
|
||||
|
||||
C. artnet-discover
|
||||
------------------
|
||||
|
||||
Usage: artnet-discover [OPTIONS]
|
||||
Prints information about ArtNet nodes
|
||||
|
||||
-a <ip-address> IP address to use (defaults to the address
|
||||
of the first non loopback interface)
|
||||
-t <seconds> The number of seconds to wait for replies
|
||||
(defaults to 2 seconds)
|
|
@ -0,0 +1,875 @@
|
|||
# generated automatically by aclocal 1.10 -*- Autoconf -*-
|
||||
|
||||
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 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.
|
||||
|
||||
# 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_if(m4_PACKAGE_VERSION, [2.61],,
|
||||
[m4_fatal([this file was generated for autoconf 2.61.
|
||||
You have another version of autoconf. If you want to use that,
|
||||
you should regenerate the build system entirely.], [63])])
|
||||
|
||||
# Copyright (C) 2002, 2003, 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_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.10'
|
||||
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.10], [],
|
||||
[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 AC_INIT_AUTOMAKE.
|
||||
AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
|
||||
[AM_AUTOMAKE_VERSION([1.10])dnl
|
||||
_AM_AUTOCONF_VERSION(m4_PACKAGE_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
|
||||
# Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# serial 8
|
||||
|
||||
# AM_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
|
||||
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
|
||||
# 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
|
||||
|
||||
# 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
|
||||
for depmode in $am_compiler_list; do
|
||||
# Setup a source with many dependencies, because some compilers
|
||||
# like to wrap large dependency lists on column 80 (with \), and
|
||||
# we should not choose a depcomp mode which is confused by this.
|
||||
#
|
||||
# We need to recreate these files for each test, as the compiler may
|
||||
# overwrite some of them when testing with obscure command lines.
|
||||
# This happens at least with the AIX C compiler.
|
||||
: > sub/conftest.c
|
||||
for i in 1 2 3 4 5 6; do
|
||||
echo '#include "conftst'$i'.h"' >> sub/conftest.c
|
||||
# Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
|
||||
# Solaris 8's {/usr,}/bin/sh.
|
||||
touch sub/conftst$i.h
|
||||
done
|
||||
echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
|
||||
|
||||
case $depmode in
|
||||
nosideeffect)
|
||||
# after this tag, mechanisms are not by side-effect, so they'll
|
||||
# only be used when explicitly requested
|
||||
if test "x$enable_dependency_tracking" = xyes; then
|
||||
continue
|
||||
else
|
||||
break
|
||||
fi
|
||||
;;
|
||||
none) break ;;
|
||||
esac
|
||||
# We check with `-c' and `-o' for the sake of the "dashmstdout"
|
||||
# mode. It turns out that the SunPro C++ compiler does not properly
|
||||
# handle `-M -o', and we need to detect this.
|
||||
if depmode=$depmode \
|
||||
source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
|
||||
depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
|
||||
$SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
|
||||
>/dev/null 2>conftest.err &&
|
||||
grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
|
||||
grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
|
||||
grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
|
||||
${MAKE-make} -s -f confmf > /dev/null 2>&1; then
|
||||
# icc doesn't choke on unknown options, it will just issue warnings
|
||||
# or remarks (even with -Werror). So we grep stderr for any message
|
||||
# that says an option was ignored or not supported.
|
||||
# When given -MP, icc 7.0 and 7.1 complain thusly:
|
||||
# icc: Command line warning: ignoring option '-M'; no argument required
|
||||
# The diagnosis changed in icc 8.0:
|
||||
# icc: Command line remark: option '-MP' not supported
|
||||
if (grep 'ignoring option' conftest.err ||
|
||||
grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
|
||||
am_cv_$1_dependencies_compiler_type=$depmode
|
||||
break
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
||||
cd ..
|
||||
rm -rf conftest.dir
|
||||
else
|
||||
am_cv_$1_dependencies_compiler_type=none
|
||||
fi
|
||||
])
|
||||
AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
|
||||
AM_CONDITIONAL([am__fastdep$1], [
|
||||
test "x$enable_dependency_tracking" != xno \
|
||||
&& test "$am_cv_$1_dependencies_compiler_type" = gcc3])
|
||||
])
|
||||
|
||||
|
||||
# AM_SET_DEPDIR
|
||||
# -------------
|
||||
# Choose a directory name for dependency files.
|
||||
# This macro is AC_REQUIREd in _AM_DEPENDENCIES
|
||||
AC_DEFUN([AM_SET_DEPDIR],
|
||||
[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
|
||||
AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
|
||||
])
|
||||
|
||||
|
||||
# AM_DEP_TRACK
|
||||
# ------------
|
||||
AC_DEFUN([AM_DEP_TRACK],
|
||||
[AC_ARG_ENABLE(dependency-tracking,
|
||||
[ --disable-dependency-tracking speeds up one-time build
|
||||
--enable-dependency-tracking do not reject slow dependency extractors])
|
||||
if test "x$enable_dependency_tracking" != xno; then
|
||||
am_depcomp="$ac_aux_dir/depcomp"
|
||||
AMDEPBACKSLASH='\'
|
||||
fi
|
||||
AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
|
||||
AC_SUBST([AMDEPBACKSLASH])dnl
|
||||
_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
|
||||
])
|
||||
|
||||
# Generate code to set up dependency tracking. -*- Autoconf -*-
|
||||
|
||||
# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
|
||||
# Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
#serial 3
|
||||
|
||||
# _AM_OUTPUT_DEPENDENCY_COMMANDS
|
||||
# ------------------------------
|
||||
AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
|
||||
[for mf in $CONFIG_FILES; do
|
||||
# Strip MF so we end up with the name of the file.
|
||||
mf=`echo "$mf" | sed -e 's/:.*$//'`
|
||||
# Check whether this is an Automake generated Makefile or not.
|
||||
# We used to match only the files named `Makefile.in', but
|
||||
# some people rename them; so instead we look at the file content.
|
||||
# Grep'ing the first line is not enough: some people post-process
|
||||
# each Makefile.in and add a new line on top of each file to say so.
|
||||
# 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 10q "$mf" | grep '^#.*generated by automake' > /dev/null 2>&1; then
|
||||
dirpart=`AS_DIRNAME("$mf")`
|
||||
else
|
||||
continue
|
||||
fi
|
||||
# Extract the definition of DEPDIR, am__include, and am__quote
|
||||
# from the Makefile without running `make'.
|
||||
DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
|
||||
test -z "$DEPDIR" && continue
|
||||
am__include=`sed -n 's/^am__include = //p' < "$mf"`
|
||||
test -z "am__include" && continue
|
||||
am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
|
||||
# When using ansi2knr, U may be empty or an underscore; expand it
|
||||
U=`sed -n 's/^U = //p' < "$mf"`
|
||||
# Find all dependency output files, they are included files with
|
||||
# $(DEPDIR) in their names. We invoke sed twice because it is the
|
||||
# simplest approach to changing $(DEPDIR) to its actual value in the
|
||||
# expansion.
|
||||
for file in `sed -n "
|
||||
s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
|
||||
sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
|
||||
# Make sure the directory exists.
|
||||
test -f "$dirpart/$file" && continue
|
||||
fdir=`AS_DIRNAME(["$file"])`
|
||||
AS_MKDIR_P([$dirpart/$fdir])
|
||||
# echo "creating $dirpart/$file"
|
||||
echo '# dummy' > "$dirpart/$file"
|
||||
done
|
||||
done
|
||||
])# _AM_OUTPUT_DEPENDENCY_COMMANDS
|
||||
|
||||
|
||||
# AM_OUTPUT_DEPENDENCY_COMMANDS
|
||||
# -----------------------------
|
||||
# This macro should only be invoked once -- use via AC_REQUIRE.
|
||||
#
|
||||
# This code is only required when automatic dependency tracking
|
||||
# is enabled. FIXME. This creates each `.P' file that we will
|
||||
# need in order to bootstrap the dependency handling code.
|
||||
AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
|
||||
[AC_CONFIG_COMMANDS([depfiles],
|
||||
[test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
|
||||
[AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
|
||||
])
|
||||
|
||||
# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
|
||||
# Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# serial 8
|
||||
|
||||
# AM_CONFIG_HEADER is obsolete. It has been replaced by AC_CONFIG_HEADERS.
|
||||
AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)])
|
||||
|
||||
# Do all the work for Automake. -*- Autoconf -*-
|
||||
|
||||
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
|
||||
# 2005, 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.
|
||||
|
||||
# serial 12
|
||||
|
||||
# This macro actually does too much. Some checks are only needed if
|
||||
# your package does certain things. But this isn't really a big deal.
|
||||
|
||||
# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
|
||||
# AM_INIT_AUTOMAKE([OPTIONS])
|
||||
# -----------------------------------------------
|
||||
# The call with PACKAGE and VERSION arguments is the old style
|
||||
# call (pre autoconf-2.50), which is being phased out. PACKAGE
|
||||
# and VERSION should now be passed to AC_INIT and removed from
|
||||
# the call to AM_INIT_AUTOMAKE.
|
||||
# We support both call styles for the transition. After
|
||||
# the next Automake release, Autoconf can make the AC_INIT
|
||||
# arguments mandatory, and then we can depend on a new Autoconf
|
||||
# release and drop the old call support.
|
||||
AC_DEFUN([AM_INIT_AUTOMAKE],
|
||||
[AC_PREREQ([2.60])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)
|
||||
AM_PROG_INSTALL_SH
|
||||
AM_PROG_INSTALL_STRIP
|
||||
AC_REQUIRE([AM_PROG_MKDIR_P])dnl
|
||||
# We need awk for the "check" target. The system "awk" is bad on
|
||||
# some platforms.
|
||||
AC_REQUIRE([AC_PROG_AWK])dnl
|
||||
AC_REQUIRE([AC_PROG_MAKE_SET])dnl
|
||||
AC_REQUIRE([AM_SET_LEADING_DOT])dnl
|
||||
_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
|
||||
[_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
|
||||
[_AM_PROG_TAR([v7])])])
|
||||
_AM_IF_OPTION([no-dependencies],,
|
||||
[AC_PROVIDE_IFELSE([AC_PROG_CC],
|
||||
[_AM_DEPENDENCIES(CC)],
|
||||
[define([AC_PROG_CC],
|
||||
defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
|
||||
AC_PROVIDE_IFELSE([AC_PROG_CXX],
|
||||
[_AM_DEPENDENCIES(CXX)],
|
||||
[define([AC_PROG_CXX],
|
||||
defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
|
||||
AC_PROVIDE_IFELSE([AC_PROG_OBJC],
|
||||
[_AM_DEPENDENCIES(OBJC)],
|
||||
[define([AC_PROG_OBJC],
|
||||
defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
|
||||
])
|
||||
])
|
||||
|
||||
|
||||
# When config.status generates a header, we must update the stamp-h file.
|
||||
# This file resides in the same directory as the config header
|
||||
# that is generated. The stamp files are numbered to have different names.
|
||||
|
||||
# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
|
||||
# loop where config.status creates the headers, so we can generate
|
||||
# our stamp files there.
|
||||
AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
|
||||
[# Compute $1's index in $config_headers.
|
||||
_am_stamp_count=1
|
||||
for _am_header in $config_headers :; do
|
||||
case $_am_header in
|
||||
$1 | $1:* )
|
||||
break ;;
|
||||
* )
|
||||
_am_stamp_count=`expr $_am_stamp_count + 1` ;;
|
||||
esac
|
||||
done
|
||||
echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count])
|
||||
|
||||
# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# AM_PROG_INSTALL_SH
|
||||
# ------------------
|
||||
# Define $install_sh.
|
||||
AC_DEFUN([AM_PROG_INSTALL_SH],
|
||||
[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
|
||||
install_sh=${install_sh-"\$(SHELL) $am_aux_dir/install-sh"}
|
||||
AC_SUBST(install_sh)])
|
||||
|
||||
# Copyright (C) 2003, 2005 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# serial 2
|
||||
|
||||
# Check whether the underlying file-system supports filenames
|
||||
# with a leading dot. For instance MS-DOS doesn't.
|
||||
AC_DEFUN([AM_SET_LEADING_DOT],
|
||||
[rm -rf .tst 2>/dev/null
|
||||
mkdir .tst 2>/dev/null
|
||||
if test -d .tst; then
|
||||
am__leading_dot=.
|
||||
else
|
||||
am__leading_dot=_
|
||||
fi
|
||||
rmdir .tst 2>/dev/null
|
||||
AC_SUBST([am__leading_dot])])
|
||||
|
||||
# Check to see how 'make' treats includes. -*- Autoconf -*-
|
||||
|
||||
# Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# serial 3
|
||||
|
||||
# AM_MAKE_INCLUDE()
|
||||
# -----------------
|
||||
# Check to see how make treats includes.
|
||||
AC_DEFUN([AM_MAKE_INCLUDE],
|
||||
[am_make=${MAKE-make}
|
||||
cat > confinc << 'END'
|
||||
am__doit:
|
||||
@echo done
|
||||
.PHONY: am__doit
|
||||
END
|
||||
# If we don't find an include directive, just comment out the code.
|
||||
AC_MSG_CHECKING([for style of include used by $am_make])
|
||||
am__include="#"
|
||||
am__quote=
|
||||
_am_result=none
|
||||
# First try GNU make style include.
|
||||
echo "include confinc" > confmf
|
||||
# We grep out `Entering directory' and `Leaving directory'
|
||||
# messages which can occur if `w' ends up in MAKEFLAGS.
|
||||
# In particular we don't look at `^make:' because GNU make might
|
||||
# be invoked under some other name (usually "gmake"), in which
|
||||
# case it prints its new name instead of `make'.
|
||||
if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
|
||||
am__include=include
|
||||
am__quote=
|
||||
_am_result=GNU
|
||||
fi
|
||||
# Now try BSD make style include.
|
||||
if test "$am__include" = "#"; then
|
||||
echo '.include "confinc"' > confmf
|
||||
if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
|
||||
am__include=.include
|
||||
am__quote="\""
|
||||
_am_result=BSD
|
||||
fi
|
||||
fi
|
||||
AC_SUBST([am__include])
|
||||
AC_SUBST([am__quote])
|
||||
AC_MSG_RESULT([$_am_result])
|
||||
rm -f confinc confmf
|
||||
])
|
||||
|
||||
# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*-
|
||||
|
||||
# Copyright (C) 1997, 1999, 2000, 2001, 2003, 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 5
|
||||
|
||||
# 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
|
||||
test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
|
||||
# Use eval to expand $SHELL
|
||||
if eval "$MISSING --run true"; then
|
||||
am_missing_run="$MISSING --run "
|
||||
else
|
||||
am_missing_run=
|
||||
AC_MSG_WARN([`missing' script is too old or missing])
|
||||
fi
|
||||
])
|
||||
|
||||
# Copyright (C) 2003, 2004, 2005, 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 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# serial 3
|
||||
|
||||
# _AM_MANGLE_OPTION(NAME)
|
||||
# -----------------------
|
||||
AC_DEFUN([_AM_MANGLE_OPTION],
|
||||
[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
|
||||
|
||||
# _AM_SET_OPTION(NAME)
|
||||
# ------------------------------
|
||||
# Set option NAME. Presently that only means defining a flag for this option.
|
||||
AC_DEFUN([_AM_SET_OPTION],
|
||||
[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
|
||||
|
||||
# _AM_SET_OPTIONS(OPTIONS)
|
||||
# ----------------------------------
|
||||
# OPTIONS is a space-separated list of Automake options.
|
||||
AC_DEFUN([_AM_SET_OPTIONS],
|
||||
[AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
|
||||
|
||||
# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
|
||||
# -------------------------------------------
|
||||
# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
|
||||
AC_DEFUN([_AM_IF_OPTION],
|
||||
[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
|
||||
|
||||
# Check to make sure that the build environment is sane. -*- Autoconf -*-
|
||||
|
||||
# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
|
||||
# Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# serial 4
|
||||
|
||||
# AM_SANITY_CHECK
|
||||
# ---------------
|
||||
AC_DEFUN([AM_SANITY_CHECK],
|
||||
[AC_MSG_CHECKING([whether build environment is sane])
|
||||
# Just in case
|
||||
sleep 1
|
||||
echo timestamp > conftest.file
|
||||
# Do `set' in a subshell so we don't clobber the current shell's
|
||||
# arguments. Must try -L first in case configure is actually a
|
||||
# symlink; some systems play weird games with the mod time of symlinks
|
||||
# (eg FreeBSD returns the mod time of the symlink's containing
|
||||
# directory).
|
||||
if (
|
||||
set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
|
||||
if test "$[*]" = "X"; then
|
||||
# -L didn't work.
|
||||
set X `ls -t $srcdir/configure conftest.file`
|
||||
fi
|
||||
rm -f conftest.file
|
||||
if test "$[*]" != "X $srcdir/configure conftest.file" \
|
||||
&& test "$[*]" != "X conftest.file $srcdir/configure"; then
|
||||
|
||||
# If neither matched, then we have a broken ls. This can happen
|
||||
# if, for instance, CONFIG_SHELL is bash and it inherits a
|
||||
# broken ls alias from the environment. This has actually
|
||||
# happened. Such a system could not be considered "sane".
|
||||
AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
|
||||
alias in your environment])
|
||||
fi
|
||||
|
||||
test "$[2]" = conftest.file
|
||||
)
|
||||
then
|
||||
# Ok.
|
||||
:
|
||||
else
|
||||
AC_MSG_ERROR([newly created file is older than distributed files!
|
||||
Check your system clock])
|
||||
fi
|
||||
AC_MSG_RESULT(yes)])
|
||||
|
||||
# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# AM_PROG_INSTALL_STRIP
|
||||
# ---------------------
|
||||
# One issue with vendor `install' (even GNU) is that you can't
|
||||
# specify the program used to strip binaries. This is especially
|
||||
# annoying in cross-compiling environments, where the build's strip
|
||||
# is unlikely to handle the host's binaries.
|
||||
# Fortunately install-sh will honor a STRIPPROG variable, so we
|
||||
# always use install-sh in `make install-strip', and initialize
|
||||
# STRIPPROG with the value of the STRIP variable (set by the user).
|
||||
AC_DEFUN([AM_PROG_INSTALL_STRIP],
|
||||
[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
|
||||
# Installed binaries are usually stripped using `strip' when the user
|
||||
# run `make install-strip'. However `strip' might not be the right
|
||||
# tool to use in cross-compilation environments, therefore Automake
|
||||
# will honor the `STRIP' environment variable to overrule this program.
|
||||
dnl Don't test for $cross_compiling = yes, because it might be `maybe'.
|
||||
if test "$cross_compiling" != no; then
|
||||
AC_CHECK_TOOL([STRIP], [strip], :)
|
||||
fi
|
||||
INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
|
||||
AC_SUBST([INSTALL_STRIP_PROGRAM])])
|
||||
|
||||
# Copyright (C) 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_SUBST_NOTMAKE(VARIABLE)
|
||||
# ---------------------------
|
||||
# Prevent Automake from outputing VARIABLE = @VARIABLE@ in Makefile.in.
|
||||
# This macro is traced by Automake.
|
||||
AC_DEFUN([_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
|
||||
|
||||
m4_include([config/pkg.m4])
|
|
@ -0,0 +1,132 @@
|
|||
/* config.h.in. Generated from configure.in by autoheader. */
|
||||
|
||||
/* Define to 1 if you have the `atexit' function. */
|
||||
#undef HAVE_ATEXIT
|
||||
|
||||
/* Define to 1 if you have the <fcntl.h> header file. */
|
||||
#undef HAVE_FCNTL_H
|
||||
|
||||
/* Define to 1 if you have the `ftime' function. */
|
||||
#undef HAVE_FTIME
|
||||
|
||||
/* Define to 1 if you have the `gettimeofday' function. */
|
||||
#undef HAVE_GETTIMEOFDAY
|
||||
|
||||
/* Define to 1 if you have the <inttypes.h> header file. */
|
||||
#undef HAVE_INTTYPES_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 <malloc.h> header file. */
|
||||
#undef HAVE_MALLOC_H
|
||||
|
||||
/* 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 your system has a GNU libc compatible `realloc' function,
|
||||
and to 0 otherwise. */
|
||||
#undef HAVE_REALLOC
|
||||
|
||||
/* Define to 1 if you have the `select' function. */
|
||||
#undef HAVE_SELECT
|
||||
|
||||
/* 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 `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 <sys/ioctl.h> header file. */
|
||||
#undef HAVE_SYS_IOCTL_H
|
||||
|
||||
/* Define to 1 if you have the <sys/select.h> header file. */
|
||||
#undef HAVE_SYS_SELECT_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/timeb.h> header file. */
|
||||
#undef HAVE_SYS_TIMEB_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 the <termios.h> header file. */
|
||||
#undef HAVE_TERMIOS_H
|
||||
|
||||
/* Define to 1 if you have the <unistd.h> header file. */
|
||||
#undef HAVE_UNISTD_H
|
||||
|
||||
/* Name of package */
|
||||
#undef PACKAGE
|
||||
|
||||
/* Define to the address where bug reports for this package should be sent. */
|
||||
#undef PACKAGE_BUGREPORT
|
||||
|
||||
/* Define to the full name of this package. */
|
||||
#undef PACKAGE_NAME
|
||||
|
||||
/* Define to the full name and version of this package. */
|
||||
#undef PACKAGE_STRING
|
||||
|
||||
/* Define to the one symbol short name of this package. */
|
||||
#undef PACKAGE_TARNAME
|
||||
|
||||
/* Define to the version of this package. */
|
||||
#undef PACKAGE_VERSION
|
||||
|
||||
/* Define as the return type of signal handlers (`int' or `void'). */
|
||||
#undef RETSIGTYPE
|
||||
|
||||
/* Define to the type of arg 1 for `select'. */
|
||||
#undef SELECT_TYPE_ARG1
|
||||
|
||||
/* Define to the type of args 2, 3 and 4 for `select'. */
|
||||
#undef SELECT_TYPE_ARG234
|
||||
|
||||
/* Define to the type of arg 5 for `select'. */
|
||||
#undef SELECT_TYPE_ARG5
|
||||
|
||||
/* 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 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
|
|
@ -0,0 +1,584 @@
|
|||
#! /bin/sh
|
||||
# depcomp - compile a program generating dependencies as side-effects
|
||||
|
||||
scriptversion=2006-10-15.18
|
||||
|
||||
# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006 Free Software
|
||||
# Foundation, Inc.
|
||||
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2, or (at your option)
|
||||
# any later version.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
# 02110-1301, USA.
|
||||
|
||||
# As a special exception to the GNU General Public License, if you
|
||||
# distribute this file as part of a program that contains a
|
||||
# configuration script generated by Autoconf, you may include it under
|
||||
# the same distribution terms that you use for the rest of that program.
|
||||
|
||||
# Originally written by Alexandre Oliva <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
|
||||
|
||||
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.
|
||||
stripped=`echo "$object" | sed 's/\(.*\)\..*$/\1/'`
|
||||
tmpdepfile="$stripped.u"
|
||||
if test "$libtool" = yes; then
|
||||
"$@" -Wc,-M
|
||||
else
|
||||
"$@" -M
|
||||
fi
|
||||
stat=$?
|
||||
|
||||
if test -f "$tmpdepfile"; then :
|
||||
else
|
||||
stripped=`echo "$stripped" | sed 's,^.*/,,'`
|
||||
tmpdepfile="$stripped.u"
|
||||
fi
|
||||
|
||||
if test $stat -eq 0; then :
|
||||
else
|
||||
rm -f "$tmpdepfile"
|
||||
exit $stat
|
||||
fi
|
||||
|
||||
if test -f "$tmpdepfile"; then
|
||||
outname="$stripped.o"
|
||||
# Each line is of the form `foo.o: dependent.h'.
|
||||
# Do two passes, one to just change these to
|
||||
# `$object: dependent.h' and one to simply `dependent.h:'.
|
||||
sed -e "s,^$outname:,$object :," < "$tmpdepfile" > "$depfile"
|
||||
sed -e "s,^$outname: \(.*\)$,\1:," < "$tmpdepfile" >> "$depfile"
|
||||
else
|
||||
# The sourcefile does not contain any dependencies, so just
|
||||
# store a dummy comment line, to avoid errors with the Makefile
|
||||
# "include basename.Plo" scheme.
|
||||
echo "#dummy" > "$depfile"
|
||||
fi
|
||||
rm -f "$tmpdepfile"
|
||||
;;
|
||||
|
||||
icc)
|
||||
# Intel's C compiler understands `-MD -MF file'. However on
|
||||
# icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c
|
||||
# ICC 7.0 will fill foo.d with something like
|
||||
# foo.o: sub/foo.c
|
||||
# foo.o: sub/foo.h
|
||||
# which is wrong. We want:
|
||||
# sub/foo.o: sub/foo.c
|
||||
# sub/foo.o: sub/foo.h
|
||||
# sub/foo.c:
|
||||
# sub/foo.h:
|
||||
# ICC 7.1 will output
|
||||
# foo.o: sub/foo.c sub/foo.h
|
||||
# and will wrap long lines using \ :
|
||||
# foo.o: sub/foo.c ... \
|
||||
# sub/foo.h ... \
|
||||
# ...
|
||||
|
||||
"$@" -MD -MF "$tmpdepfile"
|
||||
stat=$?
|
||||
if test $stat -eq 0; then :
|
||||
else
|
||||
rm -f "$tmpdepfile"
|
||||
exit $stat
|
||||
fi
|
||||
rm -f "$depfile"
|
||||
# Each line is of the form `foo.o: dependent.h',
|
||||
# or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'.
|
||||
# Do two passes, one to just change these to
|
||||
# `$object: dependent.h' and one to simply `dependent.h:'.
|
||||
sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile"
|
||||
# Some versions of the HPUX 10.20 sed can't process this invocation
|
||||
# correctly. Breaking it into two sed invocations is a workaround.
|
||||
sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" |
|
||||
sed -e 's/$/ :/' >> "$depfile"
|
||||
rm -f "$tmpdepfile"
|
||||
;;
|
||||
|
||||
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 $1 != '--mode=compile'; do
|
||||
shift
|
||||
done
|
||||
shift
|
||||
fi
|
||||
|
||||
# Remove `-o $object'.
|
||||
IFS=" "
|
||||
for arg
|
||||
do
|
||||
case $arg in
|
||||
-o)
|
||||
shift
|
||||
;;
|
||||
$object)
|
||||
shift
|
||||
;;
|
||||
*)
|
||||
set fnord "$@" "$arg"
|
||||
shift # fnord
|
||||
shift # $arg
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
test -z "$dashmflag" && dashmflag=-M
|
||||
# Require at least two characters before searching for `:'
|
||||
# in the target name. This is to cope with DOS-style filenames:
|
||||
# a dependency such as `c:/foo/bar' could be seen as target `c' otherwise.
|
||||
"$@" $dashmflag |
|
||||
sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile"
|
||||
rm -f "$depfile"
|
||||
cat < "$tmpdepfile" > "$depfile"
|
||||
tr ' ' '
|
||||
' < "$tmpdepfile" | \
|
||||
## Some versions of the HPUX 10.20 sed can't process this invocation
|
||||
## correctly. Breaking it into two sed invocations is a workaround.
|
||||
sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
|
||||
rm -f "$tmpdepfile"
|
||||
;;
|
||||
|
||||
dashXmstdout)
|
||||
# This case only exists to satisfy depend.m4. It is never actually
|
||||
# run, as this mode is specially recognized in the preamble.
|
||||
exit 1
|
||||
;;
|
||||
|
||||
makedepend)
|
||||
"$@" || exit $?
|
||||
# Remove any Libtool call
|
||||
if test "$libtool" = yes; then
|
||||
while test $1 != '--mode=compile'; do
|
||||
shift
|
||||
done
|
||||
shift
|
||||
fi
|
||||
# X makedepend
|
||||
shift
|
||||
cleared=no
|
||||
for arg in "$@"; do
|
||||
case $cleared in
|
||||
no)
|
||||
set ""; shift
|
||||
cleared=yes ;;
|
||||
esac
|
||||
case "$arg" in
|
||||
-D*|-I*)
|
||||
set fnord "$@" "$arg"; shift ;;
|
||||
# Strip any option that makedepend may not understand. Remove
|
||||
# the object too, otherwise makedepend will parse it as a source file.
|
||||
-*|$object)
|
||||
;;
|
||||
*)
|
||||
set fnord "$@" "$arg"; shift ;;
|
||||
esac
|
||||
done
|
||||
obj_suffix="`echo $object | sed 's/^.*\././'`"
|
||||
touch "$tmpdepfile"
|
||||
${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@"
|
||||
rm -f "$depfile"
|
||||
cat < "$tmpdepfile" > "$depfile"
|
||||
sed '1,2d' "$tmpdepfile" | tr ' ' '
|
||||
' | \
|
||||
## Some versions of the HPUX 10.20 sed can't process this invocation
|
||||
## correctly. Breaking it into two sed invocations is a workaround.
|
||||
sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
|
||||
rm -f "$tmpdepfile" "$tmpdepfile".bak
|
||||
;;
|
||||
|
||||
cpp)
|
||||
# Important note: in order to support this mode, a compiler *must*
|
||||
# always write the preprocessed file to stdout.
|
||||
"$@" || exit $?
|
||||
|
||||
# Remove the call to Libtool.
|
||||
if test "$libtool" = yes; then
|
||||
while test $1 != '--mode=compile'; do
|
||||
shift
|
||||
done
|
||||
shift
|
||||
fi
|
||||
|
||||
# Remove `-o $object'.
|
||||
IFS=" "
|
||||
for arg
|
||||
do
|
||||
case $arg in
|
||||
-o)
|
||||
shift
|
||||
;;
|
||||
$object)
|
||||
shift
|
||||
;;
|
||||
*)
|
||||
set fnord "$@" "$arg"
|
||||
shift # fnord
|
||||
shift # $arg
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
"$@" -E |
|
||||
sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
|
||||
-e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' |
|
||||
sed '$ s: \\$::' > "$tmpdepfile"
|
||||
rm -f "$depfile"
|
||||
echo "$object : \\" > "$depfile"
|
||||
cat < "$tmpdepfile" >> "$depfile"
|
||||
sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile"
|
||||
rm -f "$tmpdepfile"
|
||||
;;
|
||||
|
||||
msvisualcpp)
|
||||
# Important note: in order to support this mode, a compiler *must*
|
||||
# always write the preprocessed file to stdout, regardless of -o,
|
||||
# because we must use -o when running libtool.
|
||||
"$@" || exit $?
|
||||
IFS=" "
|
||||
for arg
|
||||
do
|
||||
case "$arg" in
|
||||
"-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
|
||||
set fnord "$@"
|
||||
shift
|
||||
shift
|
||||
;;
|
||||
*)
|
||||
set fnord "$@" "$arg"
|
||||
shift
|
||||
shift
|
||||
;;
|
||||
esac
|
||||
done
|
||||
"$@" -E |
|
||||
sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile"
|
||||
rm -f "$depfile"
|
||||
echo "$object : \\" > "$depfile"
|
||||
. "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile"
|
||||
echo " " >> "$depfile"
|
||||
. "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile"
|
||||
rm -f "$tmpdepfile"
|
||||
;;
|
||||
|
||||
none)
|
||||
exec "$@"
|
||||
;;
|
||||
|
||||
*)
|
||||
echo "Unknown depmode $depmode" 1>&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
exit 0
|
||||
|
||||
# Local Variables:
|
||||
# mode: shell-script
|
||||
# sh-indentation: 2
|
||||
# eval: (add-hook 'write-file-hooks 'time-stamp)
|
||||
# time-stamp-start: "scriptversion="
|
||||
# time-stamp-format: "%:y-%02m-%02d.%02H"
|
||||
# time-stamp-end: "$"
|
||||
# End:
|
|
@ -0,0 +1,507 @@
|
|||
#!/bin/sh
|
||||
# install - install a program, script, or datafile
|
||||
|
||||
scriptversion=2006-10-14.15
|
||||
|
||||
# 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.
|
||||
|
||||
mvprog="${MVPROG-mv}"
|
||||
cpprog="${CPPROG-cp}"
|
||||
chmodprog="${CHMODPROG-chmod}"
|
||||
chownprog="${CHOWNPROG-chown}"
|
||||
chgrpprog="${CHGRPPROG-chgrp}"
|
||||
stripprog="${STRIPPROG-strip}"
|
||||
rmprog="${RMPROG-rm}"
|
||||
mkdirprog="${MKDIRPROG-mkdir}"
|
||||
|
||||
posix_glob=
|
||||
posix_mkdir=
|
||||
|
||||
# Desired mode of installed file.
|
||||
mode=0755
|
||||
|
||||
chmodcmd=$chmodprog
|
||||
chowncmd=
|
||||
chgrpcmd=
|
||||
stripcmd=
|
||||
rmcmd="$rmprog -f"
|
||||
mvcmd="$mvprog"
|
||||
src=
|
||||
dst=
|
||||
dir_arg=
|
||||
dstarg=
|
||||
no_target_directory=
|
||||
|
||||
usage="Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
|
||||
or: $0 [OPTION]... SRCFILES... DIRECTORY
|
||||
or: $0 [OPTION]... -t DIRECTORY SRCFILES...
|
||||
or: $0 [OPTION]... -d DIRECTORIES...
|
||||
|
||||
In the 1st form, copy SRCFILE to DSTFILE.
|
||||
In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
|
||||
In the 4th, create DIRECTORIES.
|
||||
|
||||
Options:
|
||||
-c (ignored)
|
||||
-d create directories instead of installing files.
|
||||
-g GROUP $chgrpprog installed files to GROUP.
|
||||
-m MODE $chmodprog installed files to MODE.
|
||||
-o USER $chownprog installed files to USER.
|
||||
-s $stripprog installed files.
|
||||
-t DIRECTORY install into DIRECTORY.
|
||||
-T report an error if DSTFILE is a directory.
|
||||
--help display this help and exit.
|
||||
--version display version info and exit.
|
||||
|
||||
Environment variables override the default commands:
|
||||
CHGRPPROG CHMODPROG CHOWNPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG
|
||||
"
|
||||
|
||||
while test $# -ne 0; do
|
||||
case $1 in
|
||||
-c) shift
|
||||
continue;;
|
||||
|
||||
-d) dir_arg=true
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-g) chgrpcmd="$chgrpprog $2"
|
||||
shift
|
||||
shift
|
||||
continue;;
|
||||
|
||||
--help) echo "$usage"; exit $?;;
|
||||
|
||||
-m) mode=$2
|
||||
shift
|
||||
shift
|
||||
case $mode in
|
||||
*' '* | *' '* | *'
|
||||
'* | *'*'* | *'?'* | *'['*)
|
||||
echo "$0: invalid mode: $mode" >&2
|
||||
exit 1;;
|
||||
esac
|
||||
continue;;
|
||||
|
||||
-o) chowncmd="$chownprog $2"
|
||||
shift
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-s) stripcmd=$stripprog
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-t) dstarg=$2
|
||||
shift
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-T) no_target_directory=true
|
||||
shift
|
||||
continue;;
|
||||
|
||||
--version) echo "$0 $scriptversion"; exit $?;;
|
||||
|
||||
--) shift
|
||||
break;;
|
||||
|
||||
-*) echo "$0: invalid option: $1" >&2
|
||||
exit 1;;
|
||||
|
||||
*) break;;
|
||||
esac
|
||||
done
|
||||
|
||||
if test $# -ne 0 && test -z "$dir_arg$dstarg"; 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 "$dstarg"; then
|
||||
# $@ is not empty: it contains at least $arg.
|
||||
set fnord "$@" "$dstarg"
|
||||
shift # fnord
|
||||
fi
|
||||
shift # arg
|
||||
dstarg=$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 "$dstarg"; then
|
||||
echo "$0: no destination specified." >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
dst=$dstarg
|
||||
# Protect names starting with `-'.
|
||||
case $dst in
|
||||
-*) dst=./$dst ;;
|
||||
esac
|
||||
|
||||
# If destination is a directory, append the input filename; won't work
|
||||
# if double slashes aren't ignored.
|
||||
if test -d "$dst"; then
|
||||
if test -n "$no_target_directory"; then
|
||||
echo "$0: $dstarg: Is a directory" >&2
|
||||
exit 1
|
||||
fi
|
||||
dstdir=$dst
|
||||
dst=$dstdir/`basename "$src"`
|
||||
dstdir_status=0
|
||||
else
|
||||
# Prefer dirname, but fall back on a substitute if dirname fails.
|
||||
dstdir=`
|
||||
(dirname "$dst") 2>/dev/null ||
|
||||
expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
|
||||
X"$dst" : 'X\(//\)[^/]' \| \
|
||||
X"$dst" : 'X\(//\)$' \| \
|
||||
X"$dst" : 'X\(/\)' \| . 2>/dev/null ||
|
||||
echo X"$dst" |
|
||||
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
|
||||
s//\1/
|
||||
q
|
||||
}
|
||||
/^X\(\/\/\)[^/].*/{
|
||||
s//\1/
|
||||
q
|
||||
}
|
||||
/^X\(\/\/\)$/{
|
||||
s//\1/
|
||||
q
|
||||
}
|
||||
/^X\(\/\).*/{
|
||||
s//\1/
|
||||
q
|
||||
}
|
||||
s/.*/./; q'
|
||||
`
|
||||
|
||||
test -d "$dstdir"
|
||||
dstdir_status=$?
|
||||
fi
|
||||
fi
|
||||
|
||||
obsolete_mkdir_used=false
|
||||
|
||||
if test $dstdir_status != 0; then
|
||||
case $posix_mkdir in
|
||||
'')
|
||||
# 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
|
||||
|
||||
case $posix_glob in
|
||||
'')
|
||||
if (set -f) 2>/dev/null; then
|
||||
posix_glob=true
|
||||
else
|
||||
posix_glob=false
|
||||
fi ;;
|
||||
esac
|
||||
|
||||
oIFS=$IFS
|
||||
IFS=/
|
||||
$posix_glob && set -f
|
||||
set fnord $dstdir
|
||||
shift
|
||||
$posix_glob && set +f
|
||||
IFS=$oIFS
|
||||
|
||||
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"; } &&
|
||||
|
||||
# Now rename the file to the real destination.
|
||||
{ $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null \
|
||||
|| {
|
||||
# The rename failed, perhaps because mv can't rename something else
|
||||
# to itself, or perhaps because mv is so ancient that it does not
|
||||
# support -f.
|
||||
|
||||
# Now remove or move aside any old file at destination location.
|
||||
# We try this two ways since rm can't unlink itself on some
|
||||
# systems and the destination file might be busy for other
|
||||
# reasons. In this case, the final cleanup might fail but the new
|
||||
# file should still install successfully.
|
||||
{
|
||||
if test -f "$dst"; then
|
||||
$doit $rmcmd -f "$dst" 2>/dev/null \
|
||||
|| { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null \
|
||||
&& { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }; }\
|
||||
|| {
|
||||
echo "$0: cannot unlink or rename $dst" >&2
|
||||
(exit 1); exit 1
|
||||
}
|
||||
else
|
||||
:
|
||||
fi
|
||||
} &&
|
||||
|
||||
# Now rename the file to the real destination.
|
||||
$doit $mvcmd "$dsttmp" "$dst"
|
||||
}
|
||||
} || exit 1
|
||||
|
||||
trap '' 0
|
||||
fi
|
||||
done
|
||||
|
||||
# Local variables:
|
||||
# eval: (add-hook 'write-file-hooks 'time-stamp)
|
||||
# time-stamp-start: "scriptversion="
|
||||
# time-stamp-format: "%:y-%02m-%02d.%02H"
|
||||
# time-stamp-end: "$"
|
||||
# End:
|
|
@ -0,0 +1,367 @@
|
|||
#! /bin/sh
|
||||
# Common stub for a few missing GNU programs while installing.
|
||||
|
||||
scriptversion=2006-05-10.23
|
||||
|
||||
# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006
|
||||
# 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, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
# 02110-1301, USA.
|
||||
|
||||
# As a special exception to the GNU General Public License, if you
|
||||
# distribute this file as part of a program that contains a
|
||||
# configuration script generated by Autoconf, you may include it under
|
||||
# the same distribution terms that you use for the rest of that program.
|
||||
|
||||
if test $# -eq 0; then
|
||||
echo 1>&2 "Try \`$0 --help' for more information"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
run=:
|
||||
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]
|
||||
|
||||
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
|
||||
|
||||
# Now exit if we have it, but it failed. Also exit now if we
|
||||
# don't have it and --version was passed (most likely to detect
|
||||
# the program).
|
||||
case $1 in
|
||||
lex|yacc)
|
||||
# Not GNU programs, they don't have --version.
|
||||
;;
|
||||
|
||||
tar)
|
||||
if test -n "$run"; then
|
||||
echo 1>&2 "ERROR: \`tar' requires --run"
|
||||
exit 1
|
||||
elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
|
||||
exit 1
|
||||
fi
|
||||
;;
|
||||
|
||||
*)
|
||||
if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
|
||||
# We have it, but it failed.
|
||||
exit 1
|
||||
elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
|
||||
# Could not run --version or --help. This is probably someone
|
||||
# running `$TOOL --version' or `$TOOL --help' to check whether
|
||||
# $TOOL exists and not knowing $TOOL uses missing.
|
||||
exit 1
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
# If it does not exist, or fails to run (possibly an outdated version),
|
||||
# try to emulate it.
|
||||
case $1 in
|
||||
aclocal*)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is $msg. You should only need it if
|
||||
you modified \`acinclude.m4' or \`${configure_ac}'. You might want
|
||||
to install the \`Automake' and \`Perl' packages. Grab them from
|
||||
any GNU archive site."
|
||||
touch aclocal.m4
|
||||
;;
|
||||
|
||||
autoconf)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is $msg. You should only need it if
|
||||
you modified \`${configure_ac}'. You might want to install the
|
||||
\`Autoconf' and \`GNU m4' packages. Grab them from any GNU
|
||||
archive site."
|
||||
touch configure
|
||||
;;
|
||||
|
||||
autoheader)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is $msg. You should only need it if
|
||||
you modified \`acconfig.h' or \`${configure_ac}'. You might want
|
||||
to install the \`Autoconf' and \`GNU m4' packages. Grab them
|
||||
from any GNU archive site."
|
||||
files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}`
|
||||
test -z "$files" && files="config.h"
|
||||
touch_files=
|
||||
for f in $files; do
|
||||
case $f in
|
||||
*:*) touch_files="$touch_files "`echo "$f" |
|
||||
sed -e 's/^[^:]*://' -e 's/:.*//'`;;
|
||||
*) touch_files="$touch_files $f.in";;
|
||||
esac
|
||||
done
|
||||
touch $touch_files
|
||||
;;
|
||||
|
||||
automake*)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is $msg. You should only need it if
|
||||
you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'.
|
||||
You might want to install the \`Automake' and \`Perl' packages.
|
||||
Grab them from any GNU archive site."
|
||||
find . -type f -name Makefile.am -print |
|
||||
sed 's/\.am$/.in/' |
|
||||
while read f; do touch "$f"; done
|
||||
;;
|
||||
|
||||
autom4te)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is needed, but is $msg.
|
||||
You might have modified some files without having the
|
||||
proper tools for further handling them.
|
||||
You can get \`$1' as part of \`Autoconf' from any GNU
|
||||
archive site."
|
||||
|
||||
file=`echo "$*" | sed -n "$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 1
|
||||
fi
|
||||
;;
|
||||
|
||||
makeinfo)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is $msg. You should only need it if
|
||||
you modified a \`.texi' or \`.texinfo' file, or any other file
|
||||
indirectly affecting the aspect of the manual. The spurious
|
||||
call might also be the consequence of using a buggy \`make' (AIX,
|
||||
DU, IRIX). You might want to install the \`Texinfo' package or
|
||||
the \`GNU make' package. Grab either from any GNU archive site."
|
||||
# The file to touch is that specified with -o ...
|
||||
file=`echo "$*" | sed -n "$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-end: "$"
|
||||
# End:
|
|
@ -0,0 +1,155 @@
|
|||
# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
|
||||
#
|
||||
# Copyright © 2004 Scott James Remnant <scott@netsplit.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 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful, but
|
||||
# WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
# General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
#
|
||||
# As a special exception to the GNU General Public License, if you
|
||||
# distribute this file as part of a program that contains a
|
||||
# configuration script generated by Autoconf, you may include it under
|
||||
# the same distribution terms that you use for the rest of that program.
|
||||
|
||||
# PKG_PROG_PKG_CONFIG([MIN-VERSION])
|
||||
# ----------------------------------
|
||||
AC_DEFUN([PKG_PROG_PKG_CONFIG],
|
||||
[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
|
||||
m4_pattern_allow([^PKG_CONFIG(_PATH)?$])
|
||||
AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl
|
||||
if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
|
||||
AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
|
||||
fi
|
||||
if test -n "$PKG_CONFIG"; then
|
||||
_pkg_min_version=m4_default([$1], [0.9.0])
|
||||
AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
|
||||
if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
|
||||
AC_MSG_RESULT([yes])
|
||||
else
|
||||
AC_MSG_RESULT([no])
|
||||
PKG_CONFIG=""
|
||||
fi
|
||||
|
||||
fi[]dnl
|
||||
])# PKG_PROG_PKG_CONFIG
|
||||
|
||||
# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
|
||||
#
|
||||
# Check to see whether a particular set of modules exists. Similar
|
||||
# to PKG_CHECK_MODULES(), but does not set variables or print errors.
|
||||
#
|
||||
#
|
||||
# Similar to PKG_CHECK_MODULES, make sure that the first instance of
|
||||
# this or PKG_CHECK_MODULES is called, or make sure to call
|
||||
# PKG_CHECK_EXISTS manually
|
||||
# --------------------------------------------------------------
|
||||
AC_DEFUN([PKG_CHECK_EXISTS],
|
||||
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
|
||||
if test -n "$PKG_CONFIG" && \
|
||||
AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
|
||||
m4_ifval([$2], [$2], [:])
|
||||
m4_ifvaln([$3], [else
|
||||
$3])dnl
|
||||
fi])
|
||||
|
||||
|
||||
# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
|
||||
# ---------------------------------------------
|
||||
m4_define([_PKG_CONFIG],
|
||||
[if test -n "$$1"; then
|
||||
pkg_cv_[]$1="$$1"
|
||||
elif test -n "$PKG_CONFIG"; then
|
||||
PKG_CHECK_EXISTS([$3],
|
||||
[pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
|
||||
[pkg_failed=yes])
|
||||
else
|
||||
pkg_failed=untried
|
||||
fi[]dnl
|
||||
])# _PKG_CONFIG
|
||||
|
||||
# _PKG_SHORT_ERRORS_SUPPORTED
|
||||
# -----------------------------
|
||||
AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
|
||||
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
|
||||
if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
|
||||
_pkg_short_errors_supported=yes
|
||||
else
|
||||
_pkg_short_errors_supported=no
|
||||
fi[]dnl
|
||||
])# _PKG_SHORT_ERRORS_SUPPORTED
|
||||
|
||||
|
||||
# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
|
||||
# [ACTION-IF-NOT-FOUND])
|
||||
#
|
||||
#
|
||||
# Note that if there is a possibility the first call to
|
||||
# PKG_CHECK_MODULES might not happen, you should be sure to include an
|
||||
# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
|
||||
#
|
||||
#
|
||||
# --------------------------------------------------------------
|
||||
AC_DEFUN([PKG_CHECK_MODULES],
|
||||
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
|
||||
AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
|
||||
AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
|
||||
|
||||
pkg_failed=no
|
||||
AC_MSG_CHECKING([for $1])
|
||||
|
||||
_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
|
||||
_PKG_CONFIG([$1][_LIBS], [libs], [$2])
|
||||
|
||||
m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
|
||||
and $1[]_LIBS to avoid the need to call pkg-config.
|
||||
See the pkg-config man page for more details.])
|
||||
|
||||
if test $pkg_failed = yes; then
|
||||
_PKG_SHORT_ERRORS_SUPPORTED
|
||||
if test $_pkg_short_errors_supported = yes; then
|
||||
$1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1`
|
||||
else
|
||||
$1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1`
|
||||
fi
|
||||
# Put the nasty error message in config.log where it belongs
|
||||
echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
|
||||
|
||||
ifelse([$4], , [AC_MSG_ERROR(dnl
|
||||
[Package requirements ($2) were not met:
|
||||
|
||||
$$1_PKG_ERRORS
|
||||
|
||||
Consider adjusting the PKG_CONFIG_PATH environment variable if you
|
||||
installed software in a non-standard prefix.
|
||||
|
||||
_PKG_TEXT
|
||||
])],
|
||||
[AC_MSG_RESULT([no])
|
||||
$4])
|
||||
elif test $pkg_failed = untried; then
|
||||
ifelse([$4], , [AC_MSG_FAILURE(dnl
|
||||
[The pkg-config script could not be found or is too old. Make sure it
|
||||
is in your PATH or set the PKG_CONFIG environment variable to the full
|
||||
path to pkg-config.
|
||||
|
||||
_PKG_TEXT
|
||||
|
||||
To get pkg-config, see <http://pkg-config.freedesktop.org/>.])],
|
||||
[$4])
|
||||
else
|
||||
$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
|
||||
$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
|
||||
AC_MSG_RESULT([yes])
|
||||
ifelse([$3], , :, [$3])
|
||||
fi[]dnl
|
||||
])# PKG_CHECK_MODULES
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,40 @@
|
|||
# -*- Autoconf -*-
|
||||
# Process this file with autoconf to produce a configure script.
|
||||
|
||||
AC_PREREQ(2.57)
|
||||
AC_INIT(configure.in)
|
||||
AC_CONFIG_AUX_DIR(config)
|
||||
AM_INIT_AUTOMAKE(artnet-examples, 0.3.11)
|
||||
AM_CONFIG_HEADER(config.h)
|
||||
|
||||
# Checks for programs.
|
||||
AC_PROG_CC
|
||||
AC_PROG_INSTALL
|
||||
|
||||
# Checks for libraries.
|
||||
# FIXME: Replace `main' with a function in `-lncurses':
|
||||
AC_CHECK_LIB([ncurses], [initscr], [have_ncurses="yes"])
|
||||
AM_CONDITIONAL(HAVE_NCURSES, test "${have_ncurses}" = "yes")
|
||||
|
||||
# Checks for header files.
|
||||
AC_HEADER_STDC
|
||||
AC_CHECK_HEADERS([fcntl.h malloc.h stdlib.h string.h sys/ioctl.h sys/time.h sys/timeb.h termios.h unistd.h])
|
||||
|
||||
|
||||
# check for libartnet
|
||||
PKG_CHECK_MODULES(libartnet, [libartnet >= 1.0.6])
|
||||
|
||||
# Checks for typedefs, structures, and compiler characteristics.
|
||||
AC_C_CONST
|
||||
AC_HEADER_TIME
|
||||
AC_STRUCT_TM
|
||||
|
||||
# Checks for library functions.
|
||||
AC_PROG_GCC_TRADITIONAL
|
||||
AC_FUNC_MALLOC
|
||||
AC_FUNC_REALLOC
|
||||
AC_FUNC_SELECT_ARGTYPES
|
||||
AC_TYPE_SIGNAL
|
||||
AC_CHECK_FUNCS([gettimeofday atexit ftime memset select strdup strerror])
|
||||
|
||||
AC_OUTPUT(Makefile src/Makefile)
|
|
@ -0,0 +1,584 @@
|
|||
#! /bin/sh
|
||||
# depcomp - compile a program generating dependencies as side-effects
|
||||
|
||||
scriptversion=2006-10-15.18
|
||||
|
||||
# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006 Free Software
|
||||
# Foundation, Inc.
|
||||
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2, or (at your option)
|
||||
# any later version.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
# 02110-1301, USA.
|
||||
|
||||
# As a special exception to the GNU General Public License, if you
|
||||
# distribute this file as part of a program that contains a
|
||||
# configuration script generated by Autoconf, you may include it under
|
||||
# the same distribution terms that you use for the rest of that program.
|
||||
|
||||
# Originally written by Alexandre Oliva <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
|
||||
|
||||
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.
|
||||
stripped=`echo "$object" | sed 's/\(.*\)\..*$/\1/'`
|
||||
tmpdepfile="$stripped.u"
|
||||
if test "$libtool" = yes; then
|
||||
"$@" -Wc,-M
|
||||
else
|
||||
"$@" -M
|
||||
fi
|
||||
stat=$?
|
||||
|
||||
if test -f "$tmpdepfile"; then :
|
||||
else
|
||||
stripped=`echo "$stripped" | sed 's,^.*/,,'`
|
||||
tmpdepfile="$stripped.u"
|
||||
fi
|
||||
|
||||
if test $stat -eq 0; then :
|
||||
else
|
||||
rm -f "$tmpdepfile"
|
||||
exit $stat
|
||||
fi
|
||||
|
||||
if test -f "$tmpdepfile"; then
|
||||
outname="$stripped.o"
|
||||
# Each line is of the form `foo.o: dependent.h'.
|
||||
# Do two passes, one to just change these to
|
||||
# `$object: dependent.h' and one to simply `dependent.h:'.
|
||||
sed -e "s,^$outname:,$object :," < "$tmpdepfile" > "$depfile"
|
||||
sed -e "s,^$outname: \(.*\)$,\1:," < "$tmpdepfile" >> "$depfile"
|
||||
else
|
||||
# The sourcefile does not contain any dependencies, so just
|
||||
# store a dummy comment line, to avoid errors with the Makefile
|
||||
# "include basename.Plo" scheme.
|
||||
echo "#dummy" > "$depfile"
|
||||
fi
|
||||
rm -f "$tmpdepfile"
|
||||
;;
|
||||
|
||||
icc)
|
||||
# Intel's C compiler understands `-MD -MF file'. However on
|
||||
# icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c
|
||||
# ICC 7.0 will fill foo.d with something like
|
||||
# foo.o: sub/foo.c
|
||||
# foo.o: sub/foo.h
|
||||
# which is wrong. We want:
|
||||
# sub/foo.o: sub/foo.c
|
||||
# sub/foo.o: sub/foo.h
|
||||
# sub/foo.c:
|
||||
# sub/foo.h:
|
||||
# ICC 7.1 will output
|
||||
# foo.o: sub/foo.c sub/foo.h
|
||||
# and will wrap long lines using \ :
|
||||
# foo.o: sub/foo.c ... \
|
||||
# sub/foo.h ... \
|
||||
# ...
|
||||
|
||||
"$@" -MD -MF "$tmpdepfile"
|
||||
stat=$?
|
||||
if test $stat -eq 0; then :
|
||||
else
|
||||
rm -f "$tmpdepfile"
|
||||
exit $stat
|
||||
fi
|
||||
rm -f "$depfile"
|
||||
# Each line is of the form `foo.o: dependent.h',
|
||||
# or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'.
|
||||
# Do two passes, one to just change these to
|
||||
# `$object: dependent.h' and one to simply `dependent.h:'.
|
||||
sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile"
|
||||
# Some versions of the HPUX 10.20 sed can't process this invocation
|
||||
# correctly. Breaking it into two sed invocations is a workaround.
|
||||
sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" |
|
||||
sed -e 's/$/ :/' >> "$depfile"
|
||||
rm -f "$tmpdepfile"
|
||||
;;
|
||||
|
||||
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 $1 != '--mode=compile'; do
|
||||
shift
|
||||
done
|
||||
shift
|
||||
fi
|
||||
|
||||
# Remove `-o $object'.
|
||||
IFS=" "
|
||||
for arg
|
||||
do
|
||||
case $arg in
|
||||
-o)
|
||||
shift
|
||||
;;
|
||||
$object)
|
||||
shift
|
||||
;;
|
||||
*)
|
||||
set fnord "$@" "$arg"
|
||||
shift # fnord
|
||||
shift # $arg
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
test -z "$dashmflag" && dashmflag=-M
|
||||
# Require at least two characters before searching for `:'
|
||||
# in the target name. This is to cope with DOS-style filenames:
|
||||
# a dependency such as `c:/foo/bar' could be seen as target `c' otherwise.
|
||||
"$@" $dashmflag |
|
||||
sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile"
|
||||
rm -f "$depfile"
|
||||
cat < "$tmpdepfile" > "$depfile"
|
||||
tr ' ' '
|
||||
' < "$tmpdepfile" | \
|
||||
## Some versions of the HPUX 10.20 sed can't process this invocation
|
||||
## correctly. Breaking it into two sed invocations is a workaround.
|
||||
sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
|
||||
rm -f "$tmpdepfile"
|
||||
;;
|
||||
|
||||
dashXmstdout)
|
||||
# This case only exists to satisfy depend.m4. It is never actually
|
||||
# run, as this mode is specially recognized in the preamble.
|
||||
exit 1
|
||||
;;
|
||||
|
||||
makedepend)
|
||||
"$@" || exit $?
|
||||
# Remove any Libtool call
|
||||
if test "$libtool" = yes; then
|
||||
while test $1 != '--mode=compile'; do
|
||||
shift
|
||||
done
|
||||
shift
|
||||
fi
|
||||
# X makedepend
|
||||
shift
|
||||
cleared=no
|
||||
for arg in "$@"; do
|
||||
case $cleared in
|
||||
no)
|
||||
set ""; shift
|
||||
cleared=yes ;;
|
||||
esac
|
||||
case "$arg" in
|
||||
-D*|-I*)
|
||||
set fnord "$@" "$arg"; shift ;;
|
||||
# Strip any option that makedepend may not understand. Remove
|
||||
# the object too, otherwise makedepend will parse it as a source file.
|
||||
-*|$object)
|
||||
;;
|
||||
*)
|
||||
set fnord "$@" "$arg"; shift ;;
|
||||
esac
|
||||
done
|
||||
obj_suffix="`echo $object | sed 's/^.*\././'`"
|
||||
touch "$tmpdepfile"
|
||||
${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@"
|
||||
rm -f "$depfile"
|
||||
cat < "$tmpdepfile" > "$depfile"
|
||||
sed '1,2d' "$tmpdepfile" | tr ' ' '
|
||||
' | \
|
||||
## Some versions of the HPUX 10.20 sed can't process this invocation
|
||||
## correctly. Breaking it into two sed invocations is a workaround.
|
||||
sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
|
||||
rm -f "$tmpdepfile" "$tmpdepfile".bak
|
||||
;;
|
||||
|
||||
cpp)
|
||||
# Important note: in order to support this mode, a compiler *must*
|
||||
# always write the preprocessed file to stdout.
|
||||
"$@" || exit $?
|
||||
|
||||
# Remove the call to Libtool.
|
||||
if test "$libtool" = yes; then
|
||||
while test $1 != '--mode=compile'; do
|
||||
shift
|
||||
done
|
||||
shift
|
||||
fi
|
||||
|
||||
# Remove `-o $object'.
|
||||
IFS=" "
|
||||
for arg
|
||||
do
|
||||
case $arg in
|
||||
-o)
|
||||
shift
|
||||
;;
|
||||
$object)
|
||||
shift
|
||||
;;
|
||||
*)
|
||||
set fnord "$@" "$arg"
|
||||
shift # fnord
|
||||
shift # $arg
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
"$@" -E |
|
||||
sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
|
||||
-e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' |
|
||||
sed '$ s: \\$::' > "$tmpdepfile"
|
||||
rm -f "$depfile"
|
||||
echo "$object : \\" > "$depfile"
|
||||
cat < "$tmpdepfile" >> "$depfile"
|
||||
sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile"
|
||||
rm -f "$tmpdepfile"
|
||||
;;
|
||||
|
||||
msvisualcpp)
|
||||
# Important note: in order to support this mode, a compiler *must*
|
||||
# always write the preprocessed file to stdout, regardless of -o,
|
||||
# because we must use -o when running libtool.
|
||||
"$@" || exit $?
|
||||
IFS=" "
|
||||
for arg
|
||||
do
|
||||
case "$arg" in
|
||||
"-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
|
||||
set fnord "$@"
|
||||
shift
|
||||
shift
|
||||
;;
|
||||
*)
|
||||
set fnord "$@" "$arg"
|
||||
shift
|
||||
shift
|
||||
;;
|
||||
esac
|
||||
done
|
||||
"$@" -E |
|
||||
sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile"
|
||||
rm -f "$depfile"
|
||||
echo "$object : \\" > "$depfile"
|
||||
. "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile"
|
||||
echo " " >> "$depfile"
|
||||
. "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile"
|
||||
rm -f "$tmpdepfile"
|
||||
;;
|
||||
|
||||
none)
|
||||
exec "$@"
|
||||
;;
|
||||
|
||||
*)
|
||||
echo "Unknown depmode $depmode" 1>&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
exit 0
|
||||
|
||||
# Local Variables:
|
||||
# mode: shell-script
|
||||
# sh-indentation: 2
|
||||
# eval: (add-hook 'write-file-hooks 'time-stamp)
|
||||
# time-stamp-start: "scriptversion="
|
||||
# time-stamp-format: "%:y-%02m-%02d.%02H"
|
||||
# time-stamp-end: "$"
|
||||
# End:
|
|
@ -0,0 +1,507 @@
|
|||
#!/bin/sh
|
||||
# install - install a program, script, or datafile
|
||||
|
||||
scriptversion=2006-10-14.15
|
||||
|
||||
# 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.
|
||||
|
||||
mvprog="${MVPROG-mv}"
|
||||
cpprog="${CPPROG-cp}"
|
||||
chmodprog="${CHMODPROG-chmod}"
|
||||
chownprog="${CHOWNPROG-chown}"
|
||||
chgrpprog="${CHGRPPROG-chgrp}"
|
||||
stripprog="${STRIPPROG-strip}"
|
||||
rmprog="${RMPROG-rm}"
|
||||
mkdirprog="${MKDIRPROG-mkdir}"
|
||||
|
||||
posix_glob=
|
||||
posix_mkdir=
|
||||
|
||||
# Desired mode of installed file.
|
||||
mode=0755
|
||||
|
||||
chmodcmd=$chmodprog
|
||||
chowncmd=
|
||||
chgrpcmd=
|
||||
stripcmd=
|
||||
rmcmd="$rmprog -f"
|
||||
mvcmd="$mvprog"
|
||||
src=
|
||||
dst=
|
||||
dir_arg=
|
||||
dstarg=
|
||||
no_target_directory=
|
||||
|
||||
usage="Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
|
||||
or: $0 [OPTION]... SRCFILES... DIRECTORY
|
||||
or: $0 [OPTION]... -t DIRECTORY SRCFILES...
|
||||
or: $0 [OPTION]... -d DIRECTORIES...
|
||||
|
||||
In the 1st form, copy SRCFILE to DSTFILE.
|
||||
In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
|
||||
In the 4th, create DIRECTORIES.
|
||||
|
||||
Options:
|
||||
-c (ignored)
|
||||
-d create directories instead of installing files.
|
||||
-g GROUP $chgrpprog installed files to GROUP.
|
||||
-m MODE $chmodprog installed files to MODE.
|
||||
-o USER $chownprog installed files to USER.
|
||||
-s $stripprog installed files.
|
||||
-t DIRECTORY install into DIRECTORY.
|
||||
-T report an error if DSTFILE is a directory.
|
||||
--help display this help and exit.
|
||||
--version display version info and exit.
|
||||
|
||||
Environment variables override the default commands:
|
||||
CHGRPPROG CHMODPROG CHOWNPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG
|
||||
"
|
||||
|
||||
while test $# -ne 0; do
|
||||
case $1 in
|
||||
-c) shift
|
||||
continue;;
|
||||
|
||||
-d) dir_arg=true
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-g) chgrpcmd="$chgrpprog $2"
|
||||
shift
|
||||
shift
|
||||
continue;;
|
||||
|
||||
--help) echo "$usage"; exit $?;;
|
||||
|
||||
-m) mode=$2
|
||||
shift
|
||||
shift
|
||||
case $mode in
|
||||
*' '* | *' '* | *'
|
||||
'* | *'*'* | *'?'* | *'['*)
|
||||
echo "$0: invalid mode: $mode" >&2
|
||||
exit 1;;
|
||||
esac
|
||||
continue;;
|
||||
|
||||
-o) chowncmd="$chownprog $2"
|
||||
shift
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-s) stripcmd=$stripprog
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-t) dstarg=$2
|
||||
shift
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-T) no_target_directory=true
|
||||
shift
|
||||
continue;;
|
||||
|
||||
--version) echo "$0 $scriptversion"; exit $?;;
|
||||
|
||||
--) shift
|
||||
break;;
|
||||
|
||||
-*) echo "$0: invalid option: $1" >&2
|
||||
exit 1;;
|
||||
|
||||
*) break;;
|
||||
esac
|
||||
done
|
||||
|
||||
if test $# -ne 0 && test -z "$dir_arg$dstarg"; 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 "$dstarg"; then
|
||||
# $@ is not empty: it contains at least $arg.
|
||||
set fnord "$@" "$dstarg"
|
||||
shift # fnord
|
||||
fi
|
||||
shift # arg
|
||||
dstarg=$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 "$dstarg"; then
|
||||
echo "$0: no destination specified." >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
dst=$dstarg
|
||||
# Protect names starting with `-'.
|
||||
case $dst in
|
||||
-*) dst=./$dst ;;
|
||||
esac
|
||||
|
||||
# If destination is a directory, append the input filename; won't work
|
||||
# if double slashes aren't ignored.
|
||||
if test -d "$dst"; then
|
||||
if test -n "$no_target_directory"; then
|
||||
echo "$0: $dstarg: Is a directory" >&2
|
||||
exit 1
|
||||
fi
|
||||
dstdir=$dst
|
||||
dst=$dstdir/`basename "$src"`
|
||||
dstdir_status=0
|
||||
else
|
||||
# Prefer dirname, but fall back on a substitute if dirname fails.
|
||||
dstdir=`
|
||||
(dirname "$dst") 2>/dev/null ||
|
||||
expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
|
||||
X"$dst" : 'X\(//\)[^/]' \| \
|
||||
X"$dst" : 'X\(//\)$' \| \
|
||||
X"$dst" : 'X\(/\)' \| . 2>/dev/null ||
|
||||
echo X"$dst" |
|
||||
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
|
||||
s//\1/
|
||||
q
|
||||
}
|
||||
/^X\(\/\/\)[^/].*/{
|
||||
s//\1/
|
||||
q
|
||||
}
|
||||
/^X\(\/\/\)$/{
|
||||
s//\1/
|
||||
q
|
||||
}
|
||||
/^X\(\/\).*/{
|
||||
s//\1/
|
||||
q
|
||||
}
|
||||
s/.*/./; q'
|
||||
`
|
||||
|
||||
test -d "$dstdir"
|
||||
dstdir_status=$?
|
||||
fi
|
||||
fi
|
||||
|
||||
obsolete_mkdir_used=false
|
||||
|
||||
if test $dstdir_status != 0; then
|
||||
case $posix_mkdir in
|
||||
'')
|
||||
# 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
|
||||
|
||||
case $posix_glob in
|
||||
'')
|
||||
if (set -f) 2>/dev/null; then
|
||||
posix_glob=true
|
||||
else
|
||||
posix_glob=false
|
||||
fi ;;
|
||||
esac
|
||||
|
||||
oIFS=$IFS
|
||||
IFS=/
|
||||
$posix_glob && set -f
|
||||
set fnord $dstdir
|
||||
shift
|
||||
$posix_glob && set +f
|
||||
IFS=$oIFS
|
||||
|
||||
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"; } &&
|
||||
|
||||
# Now rename the file to the real destination.
|
||||
{ $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null \
|
||||
|| {
|
||||
# The rename failed, perhaps because mv can't rename something else
|
||||
# to itself, or perhaps because mv is so ancient that it does not
|
||||
# support -f.
|
||||
|
||||
# Now remove or move aside any old file at destination location.
|
||||
# We try this two ways since rm can't unlink itself on some
|
||||
# systems and the destination file might be busy for other
|
||||
# reasons. In this case, the final cleanup might fail but the new
|
||||
# file should still install successfully.
|
||||
{
|
||||
if test -f "$dst"; then
|
||||
$doit $rmcmd -f "$dst" 2>/dev/null \
|
||||
|| { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null \
|
||||
&& { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }; }\
|
||||
|| {
|
||||
echo "$0: cannot unlink or rename $dst" >&2
|
||||
(exit 1); exit 1
|
||||
}
|
||||
else
|
||||
:
|
||||
fi
|
||||
} &&
|
||||
|
||||
# Now rename the file to the real destination.
|
||||
$doit $mvcmd "$dsttmp" "$dst"
|
||||
}
|
||||
} || exit 1
|
||||
|
||||
trap '' 0
|
||||
fi
|
||||
done
|
||||
|
||||
# Local variables:
|
||||
# eval: (add-hook 'write-file-hooks 'time-stamp)
|
||||
# time-stamp-start: "scriptversion="
|
||||
# time-stamp-format: "%:y-%02m-%02d.%02H"
|
||||
# time-stamp-end: "$"
|
||||
# End:
|
|
@ -0,0 +1,367 @@
|
|||
#! /bin/sh
|
||||
# Common stub for a few missing GNU programs while installing.
|
||||
|
||||
scriptversion=2006-05-10.23
|
||||
|
||||
# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006
|
||||
# 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, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
# 02110-1301, USA.
|
||||
|
||||
# As a special exception to the GNU General Public License, if you
|
||||
# distribute this file as part of a program that contains a
|
||||
# configuration script generated by Autoconf, you may include it under
|
||||
# the same distribution terms that you use for the rest of that program.
|
||||
|
||||
if test $# -eq 0; then
|
||||
echo 1>&2 "Try \`$0 --help' for more information"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
run=:
|
||||
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]
|
||||
|
||||
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
|
||||
|
||||
# Now exit if we have it, but it failed. Also exit now if we
|
||||
# don't have it and --version was passed (most likely to detect
|
||||
# the program).
|
||||
case $1 in
|
||||
lex|yacc)
|
||||
# Not GNU programs, they don't have --version.
|
||||
;;
|
||||
|
||||
tar)
|
||||
if test -n "$run"; then
|
||||
echo 1>&2 "ERROR: \`tar' requires --run"
|
||||
exit 1
|
||||
elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
|
||||
exit 1
|
||||
fi
|
||||
;;
|
||||
|
||||
*)
|
||||
if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
|
||||
# We have it, but it failed.
|
||||
exit 1
|
||||
elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
|
||||
# Could not run --version or --help. This is probably someone
|
||||
# running `$TOOL --version' or `$TOOL --help' to check whether
|
||||
# $TOOL exists and not knowing $TOOL uses missing.
|
||||
exit 1
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
# If it does not exist, or fails to run (possibly an outdated version),
|
||||
# try to emulate it.
|
||||
case $1 in
|
||||
aclocal*)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is $msg. You should only need it if
|
||||
you modified \`acinclude.m4' or \`${configure_ac}'. You might want
|
||||
to install the \`Automake' and \`Perl' packages. Grab them from
|
||||
any GNU archive site."
|
||||
touch aclocal.m4
|
||||
;;
|
||||
|
||||
autoconf)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is $msg. You should only need it if
|
||||
you modified \`${configure_ac}'. You might want to install the
|
||||
\`Autoconf' and \`GNU m4' packages. Grab them from any GNU
|
||||
archive site."
|
||||
touch configure
|
||||
;;
|
||||
|
||||
autoheader)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is $msg. You should only need it if
|
||||
you modified \`acconfig.h' or \`${configure_ac}'. You might want
|
||||
to install the \`Autoconf' and \`GNU m4' packages. Grab them
|
||||
from any GNU archive site."
|
||||
files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}`
|
||||
test -z "$files" && files="config.h"
|
||||
touch_files=
|
||||
for f in $files; do
|
||||
case $f in
|
||||
*:*) touch_files="$touch_files "`echo "$f" |
|
||||
sed -e 's/^[^:]*://' -e 's/:.*//'`;;
|
||||
*) touch_files="$touch_files $f.in";;
|
||||
esac
|
||||
done
|
||||
touch $touch_files
|
||||
;;
|
||||
|
||||
automake*)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is $msg. You should only need it if
|
||||
you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'.
|
||||
You might want to install the \`Automake' and \`Perl' packages.
|
||||
Grab them from any GNU archive site."
|
||||
find . -type f -name Makefile.am -print |
|
||||
sed 's/\.am$/.in/' |
|
||||
while read f; do touch "$f"; done
|
||||
;;
|
||||
|
||||
autom4te)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is needed, but is $msg.
|
||||
You might have modified some files without having the
|
||||
proper tools for further handling them.
|
||||
You can get \`$1' as part of \`Autoconf' from any GNU
|
||||
archive site."
|
||||
|
||||
file=`echo "$*" | sed -n "$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 1
|
||||
fi
|
||||
;;
|
||||
|
||||
makeinfo)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is $msg. You should only need it if
|
||||
you modified a \`.texi' or \`.texinfo' file, or any other file
|
||||
indirectly affecting the aspect of the manual. The spurious
|
||||
call might also be the consequence of using a buggy \`make' (AIX,
|
||||
DU, IRIX). You might want to install the \`Texinfo' package or
|
||||
the \`GNU make' package. Grab either from any GNU archive site."
|
||||
# The file to touch is that specified with -o ...
|
||||
file=`echo "$*" | sed -n "$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-end: "$"
|
||||
# End:
|
|
@ -0,0 +1,31 @@
|
|||
|
||||
AM_CFLAGS = -Wall -Werror
|
||||
AM_LDFLAGS = $(libartnet_LIBS)
|
||||
|
||||
if HAVE_NCURSES
|
||||
NCURSES_PROGS = artnet_dmxconsole artnet_dmxmonitor
|
||||
artnet_dmxconsole_SOURCES = artnet-dmxconsole.c
|
||||
artnet_dmxconsole_LDADD = @LIBS@ -lcurses
|
||||
|
||||
artnet_dmxmonitor_SOURCES = artnet-dmxmonitor.c
|
||||
artnet_dmxmonitor_LDADD = @LIBS@ -lcurses
|
||||
endif
|
||||
|
||||
|
||||
bin_PROGRAMS = artnet_usb artnet_discover artnet_flood_rx artnet_flood_tx artnet_firmware_node artnet_firmware_server artnet_multiport artnet_profile_tx artnet_profile_rx artnet_rdm_output artnet_setdmx $(NCURSES_PROGS)
|
||||
|
||||
artnet_usb_SOURCES = artnet-usb.c
|
||||
artnet_usb_LDADD = @LIBS@ -lpthread
|
||||
artnet_discover_SOURCES = artnet-discover.c
|
||||
artnet_flood_rx_SOURCES = artnet-flood-rx.c
|
||||
artnet_flood_tx_SOURCES = artnet-flood-tx.c
|
||||
artnet_profile_tx_SOURCES = artnet-profile-tx.c
|
||||
artnet_profile_rx_SOURCES = artnet-profile-rx.c
|
||||
artnet_firmware_node_SOURCES = artnet-firmware-node.c
|
||||
artnet_firmware_server_SOURCES = artnet-firmware-server.c
|
||||
artnet_multiport_SOURCES = artnet-multiport.c
|
||||
artnet_rdm_output_SOURCES = artnet-rdm-output.c
|
||||
artnet_setdmx_SOURCES = artnet-setdmx.c
|
||||
|
||||
#artnet_test_master_SOURCES = artnet-test-master.c artnet-test-defaults.h
|
||||
#artnet_test_slave_SOURCES = artnet-test-slave.c artnet-test-defaults.h artnet-test-defns.h artnet-test-defns.c
|
|
@ -0,0 +1,541 @@
|
|||
# Makefile.in generated by automake 1.10 from Makefile.am.
|
||||
# @configure_input@
|
||||
|
||||
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
|
||||
# 2003, 2004, 2005, 2006 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@
|
||||
pkglibdir = $(libdir)/@PACKAGE@
|
||||
pkgincludedir = $(includedir)/@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 = :
|
||||
bin_PROGRAMS = artnet_usb$(EXEEXT) artnet_discover$(EXEEXT) \
|
||||
artnet_flood_rx$(EXEEXT) artnet_flood_tx$(EXEEXT) \
|
||||
artnet_firmware_node$(EXEEXT) artnet_firmware_server$(EXEEXT) \
|
||||
artnet_multiport$(EXEEXT) artnet_profile_tx$(EXEEXT) \
|
||||
artnet_profile_rx$(EXEEXT) artnet_rdm_output$(EXEEXT) \
|
||||
artnet_setdmx$(EXEEXT) $(am__EXEEXT_1)
|
||||
subdir = src
|
||||
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
am__aclocal_m4_deps = $(top_srcdir)/config/pkg.m4 \
|
||||
$(top_srcdir)/configure.in
|
||||
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
|
||||
$(ACLOCAL_M4)
|
||||
mkinstalldirs = $(install_sh) -d
|
||||
CONFIG_HEADER = $(top_builddir)/config.h
|
||||
CONFIG_CLEAN_FILES =
|
||||
@HAVE_NCURSES_TRUE@am__EXEEXT_1 = artnet_dmxconsole$(EXEEXT) \
|
||||
@HAVE_NCURSES_TRUE@ artnet_dmxmonitor$(EXEEXT)
|
||||
am__installdirs = "$(DESTDIR)$(bindir)"
|
||||
binPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
|
||||
PROGRAMS = $(bin_PROGRAMS)
|
||||
am_artnet_discover_OBJECTS = artnet-discover.$(OBJEXT)
|
||||
artnet_discover_OBJECTS = $(am_artnet_discover_OBJECTS)
|
||||
artnet_discover_LDADD = $(LDADD)
|
||||
am__artnet_dmxconsole_SOURCES_DIST = artnet-dmxconsole.c
|
||||
@HAVE_NCURSES_TRUE@am_artnet_dmxconsole_OBJECTS = \
|
||||
@HAVE_NCURSES_TRUE@ artnet-dmxconsole.$(OBJEXT)
|
||||
artnet_dmxconsole_OBJECTS = $(am_artnet_dmxconsole_OBJECTS)
|
||||
artnet_dmxconsole_DEPENDENCIES =
|
||||
am__artnet_dmxmonitor_SOURCES_DIST = artnet-dmxmonitor.c
|
||||
@HAVE_NCURSES_TRUE@am_artnet_dmxmonitor_OBJECTS = \
|
||||
@HAVE_NCURSES_TRUE@ artnet-dmxmonitor.$(OBJEXT)
|
||||
artnet_dmxmonitor_OBJECTS = $(am_artnet_dmxmonitor_OBJECTS)
|
||||
artnet_dmxmonitor_DEPENDENCIES =
|
||||
am_artnet_firmware_node_OBJECTS = artnet-firmware-node.$(OBJEXT)
|
||||
artnet_firmware_node_OBJECTS = $(am_artnet_firmware_node_OBJECTS)
|
||||
artnet_firmware_node_LDADD = $(LDADD)
|
||||
am_artnet_firmware_server_OBJECTS = artnet-firmware-server.$(OBJEXT)
|
||||
artnet_firmware_server_OBJECTS = $(am_artnet_firmware_server_OBJECTS)
|
||||
artnet_firmware_server_LDADD = $(LDADD)
|
||||
am_artnet_flood_rx_OBJECTS = artnet-flood-rx.$(OBJEXT)
|
||||
artnet_flood_rx_OBJECTS = $(am_artnet_flood_rx_OBJECTS)
|
||||
artnet_flood_rx_LDADD = $(LDADD)
|
||||
am_artnet_flood_tx_OBJECTS = artnet-flood-tx.$(OBJEXT)
|
||||
artnet_flood_tx_OBJECTS = $(am_artnet_flood_tx_OBJECTS)
|
||||
artnet_flood_tx_LDADD = $(LDADD)
|
||||
am_artnet_multiport_OBJECTS = artnet-multiport.$(OBJEXT)
|
||||
artnet_multiport_OBJECTS = $(am_artnet_multiport_OBJECTS)
|
||||
artnet_multiport_LDADD = $(LDADD)
|
||||
am_artnet_profile_rx_OBJECTS = artnet-profile-rx.$(OBJEXT)
|
||||
artnet_profile_rx_OBJECTS = $(am_artnet_profile_rx_OBJECTS)
|
||||
artnet_profile_rx_LDADD = $(LDADD)
|
||||
am_artnet_profile_tx_OBJECTS = artnet-profile-tx.$(OBJEXT)
|
||||
artnet_profile_tx_OBJECTS = $(am_artnet_profile_tx_OBJECTS)
|
||||
artnet_profile_tx_LDADD = $(LDADD)
|
||||
am_artnet_rdm_output_OBJECTS = artnet-rdm-output.$(OBJEXT)
|
||||
artnet_rdm_output_OBJECTS = $(am_artnet_rdm_output_OBJECTS)
|
||||
artnet_rdm_output_LDADD = $(LDADD)
|
||||
am_artnet_setdmx_OBJECTS = artnet-setdmx.$(OBJEXT)
|
||||
artnet_setdmx_OBJECTS = $(am_artnet_setdmx_OBJECTS)
|
||||
artnet_setdmx_LDADD = $(LDADD)
|
||||
am_artnet_usb_OBJECTS = artnet-usb.$(OBJEXT)
|
||||
artnet_usb_OBJECTS = $(am_artnet_usb_OBJECTS)
|
||||
artnet_usb_DEPENDENCIES =
|
||||
DEFAULT_INCLUDES = -I. -I$(top_builddir)@am__isrc@
|
||||
depcomp = $(SHELL) $(top_srcdir)/config/depcomp
|
||||
am__depfiles_maybe = depfiles
|
||||
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
|
||||
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
|
||||
CCLD = $(CC)
|
||||
LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
|
||||
SOURCES = $(artnet_discover_SOURCES) $(artnet_dmxconsole_SOURCES) \
|
||||
$(artnet_dmxmonitor_SOURCES) $(artnet_firmware_node_SOURCES) \
|
||||
$(artnet_firmware_server_SOURCES) $(artnet_flood_rx_SOURCES) \
|
||||
$(artnet_flood_tx_SOURCES) $(artnet_multiport_SOURCES) \
|
||||
$(artnet_profile_rx_SOURCES) $(artnet_profile_tx_SOURCES) \
|
||||
$(artnet_rdm_output_SOURCES) $(artnet_setdmx_SOURCES) \
|
||||
$(artnet_usb_SOURCES)
|
||||
DIST_SOURCES = $(artnet_discover_SOURCES) \
|
||||
$(am__artnet_dmxconsole_SOURCES_DIST) \
|
||||
$(am__artnet_dmxmonitor_SOURCES_DIST) \
|
||||
$(artnet_firmware_node_SOURCES) \
|
||||
$(artnet_firmware_server_SOURCES) $(artnet_flood_rx_SOURCES) \
|
||||
$(artnet_flood_tx_SOURCES) $(artnet_multiport_SOURCES) \
|
||||
$(artnet_profile_rx_SOURCES) $(artnet_profile_tx_SOURCES) \
|
||||
$(artnet_rdm_output_SOURCES) $(artnet_setdmx_SOURCES) \
|
||||
$(artnet_usb_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@
|
||||
CC = @CC@
|
||||
CCDEPMODE = @CCDEPMODE@
|
||||
CFLAGS = @CFLAGS@
|
||||
CPP = @CPP@
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
CYGPATH_W = @CYGPATH_W@
|
||||
DEFS = @DEFS@
|
||||
DEPDIR = @DEPDIR@
|
||||
ECHO_C = @ECHO_C@
|
||||
ECHO_N = @ECHO_N@
|
||||
ECHO_T = @ECHO_T@
|
||||
EGREP = @EGREP@
|
||||
EXEEXT = @EXEEXT@
|
||||
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_VERSION = @PACKAGE_VERSION@
|
||||
PATH_SEPARATOR = @PATH_SEPARATOR@
|
||||
PKG_CONFIG = @PKG_CONFIG@
|
||||
SET_MAKE = @SET_MAKE@
|
||||
SHELL = @SHELL@
|
||||
STRIP = @STRIP@
|
||||
VERSION = @VERSION@
|
||||
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@
|
||||
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_alias = @build_alias@
|
||||
builddir = @builddir@
|
||||
datadir = @datadir@
|
||||
datarootdir = @datarootdir@
|
||||
docdir = @docdir@
|
||||
dvidir = @dvidir@
|
||||
exec_prefix = @exec_prefix@
|
||||
host_alias = @host_alias@
|
||||
htmldir = @htmldir@
|
||||
includedir = @includedir@
|
||||
infodir = @infodir@
|
||||
install_sh = @install_sh@
|
||||
libartnet_CFLAGS = @libartnet_CFLAGS@
|
||||
libartnet_LIBS = @libartnet_LIBS@
|
||||
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_alias = @target_alias@
|
||||
top_builddir = @top_builddir@
|
||||
top_srcdir = @top_srcdir@
|
||||
AM_CFLAGS = -Wall -Werror
|
||||
AM_LDFLAGS = $(libartnet_LIBS)
|
||||
@HAVE_NCURSES_TRUE@NCURSES_PROGS = artnet_dmxconsole artnet_dmxmonitor
|
||||
@HAVE_NCURSES_TRUE@artnet_dmxconsole_SOURCES = artnet-dmxconsole.c
|
||||
@HAVE_NCURSES_TRUE@artnet_dmxconsole_LDADD = @LIBS@ -lcurses
|
||||
@HAVE_NCURSES_TRUE@artnet_dmxmonitor_SOURCES = artnet-dmxmonitor.c
|
||||
@HAVE_NCURSES_TRUE@artnet_dmxmonitor_LDADD = @LIBS@ -lcurses
|
||||
artnet_usb_SOURCES = artnet-usb.c
|
||||
artnet_usb_LDADD = @LIBS@ -lpthread
|
||||
artnet_discover_SOURCES = artnet-discover.c
|
||||
artnet_flood_rx_SOURCES = artnet-flood-rx.c
|
||||
artnet_flood_tx_SOURCES = artnet-flood-tx.c
|
||||
artnet_profile_tx_SOURCES = artnet-profile-tx.c
|
||||
artnet_profile_rx_SOURCES = artnet-profile-rx.c
|
||||
artnet_firmware_node_SOURCES = artnet-firmware-node.c
|
||||
artnet_firmware_server_SOURCES = artnet-firmware-server.c
|
||||
artnet_multiport_SOURCES = artnet-multiport.c
|
||||
artnet_rdm_output_SOURCES = artnet-rdm-output.c
|
||||
artnet_setdmx_SOURCES = artnet-setdmx.c
|
||||
all: all-am
|
||||
|
||||
.SUFFIXES:
|
||||
.SUFFIXES: .c .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 \
|
||||
&& exit 0; \
|
||||
exit 1;; \
|
||||
esac; \
|
||||
done; \
|
||||
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/Makefile'; \
|
||||
cd $(top_srcdir) && \
|
||||
$(AUTOMAKE) --gnu src/Makefile
|
||||
.PRECIOUS: Makefile
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||
@case '$?' in \
|
||||
*config.status*) \
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
|
||||
*) \
|
||||
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
|
||||
esac;
|
||||
|
||||
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
|
||||
$(top_srcdir)/configure: $(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
|
||||
install-binPROGRAMS: $(bin_PROGRAMS)
|
||||
@$(NORMAL_INSTALL)
|
||||
test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)"
|
||||
@list='$(bin_PROGRAMS)'; for p in $$list; do \
|
||||
p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
|
||||
if test -f $$p \
|
||||
; then \
|
||||
f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \
|
||||
echo " $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \
|
||||
$(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \
|
||||
else :; fi; \
|
||||
done
|
||||
|
||||
uninstall-binPROGRAMS:
|
||||
@$(NORMAL_UNINSTALL)
|
||||
@list='$(bin_PROGRAMS)'; for p in $$list; do \
|
||||
f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
|
||||
echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \
|
||||
rm -f "$(DESTDIR)$(bindir)/$$f"; \
|
||||
done
|
||||
|
||||
clean-binPROGRAMS:
|
||||
-test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS)
|
||||
artnet_discover$(EXEEXT): $(artnet_discover_OBJECTS) $(artnet_discover_DEPENDENCIES)
|
||||
@rm -f artnet_discover$(EXEEXT)
|
||||
$(LINK) $(artnet_discover_OBJECTS) $(artnet_discover_LDADD) $(LIBS)
|
||||
artnet_dmxconsole$(EXEEXT): $(artnet_dmxconsole_OBJECTS) $(artnet_dmxconsole_DEPENDENCIES)
|
||||
@rm -f artnet_dmxconsole$(EXEEXT)
|
||||
$(LINK) $(artnet_dmxconsole_OBJECTS) $(artnet_dmxconsole_LDADD) $(LIBS)
|
||||
artnet_dmxmonitor$(EXEEXT): $(artnet_dmxmonitor_OBJECTS) $(artnet_dmxmonitor_DEPENDENCIES)
|
||||
@rm -f artnet_dmxmonitor$(EXEEXT)
|
||||
$(LINK) $(artnet_dmxmonitor_OBJECTS) $(artnet_dmxmonitor_LDADD) $(LIBS)
|
||||
artnet_firmware_node$(EXEEXT): $(artnet_firmware_node_OBJECTS) $(artnet_firmware_node_DEPENDENCIES)
|
||||
@rm -f artnet_firmware_node$(EXEEXT)
|
||||
$(LINK) $(artnet_firmware_node_OBJECTS) $(artnet_firmware_node_LDADD) $(LIBS)
|
||||
artnet_firmware_server$(EXEEXT): $(artnet_firmware_server_OBJECTS) $(artnet_firmware_server_DEPENDENCIES)
|
||||
@rm -f artnet_firmware_server$(EXEEXT)
|
||||
$(LINK) $(artnet_firmware_server_OBJECTS) $(artnet_firmware_server_LDADD) $(LIBS)
|
||||
artnet_flood_rx$(EXEEXT): $(artnet_flood_rx_OBJECTS) $(artnet_flood_rx_DEPENDENCIES)
|
||||
@rm -f artnet_flood_rx$(EXEEXT)
|
||||
$(LINK) $(artnet_flood_rx_OBJECTS) $(artnet_flood_rx_LDADD) $(LIBS)
|
||||
artnet_flood_tx$(EXEEXT): $(artnet_flood_tx_OBJECTS) $(artnet_flood_tx_DEPENDENCIES)
|
||||
@rm -f artnet_flood_tx$(EXEEXT)
|
||||
$(LINK) $(artnet_flood_tx_OBJECTS) $(artnet_flood_tx_LDADD) $(LIBS)
|
||||
artnet_multiport$(EXEEXT): $(artnet_multiport_OBJECTS) $(artnet_multiport_DEPENDENCIES)
|
||||
@rm -f artnet_multiport$(EXEEXT)
|
||||
$(LINK) $(artnet_multiport_OBJECTS) $(artnet_multiport_LDADD) $(LIBS)
|
||||
artnet_profile_rx$(EXEEXT): $(artnet_profile_rx_OBJECTS) $(artnet_profile_rx_DEPENDENCIES)
|
||||
@rm -f artnet_profile_rx$(EXEEXT)
|
||||
$(LINK) $(artnet_profile_rx_OBJECTS) $(artnet_profile_rx_LDADD) $(LIBS)
|
||||
artnet_profile_tx$(EXEEXT): $(artnet_profile_tx_OBJECTS) $(artnet_profile_tx_DEPENDENCIES)
|
||||
@rm -f artnet_profile_tx$(EXEEXT)
|
||||
$(LINK) $(artnet_profile_tx_OBJECTS) $(artnet_profile_tx_LDADD) $(LIBS)
|
||||
artnet_rdm_output$(EXEEXT): $(artnet_rdm_output_OBJECTS) $(artnet_rdm_output_DEPENDENCIES)
|
||||
@rm -f artnet_rdm_output$(EXEEXT)
|
||||
$(LINK) $(artnet_rdm_output_OBJECTS) $(artnet_rdm_output_LDADD) $(LIBS)
|
||||
artnet_setdmx$(EXEEXT): $(artnet_setdmx_OBJECTS) $(artnet_setdmx_DEPENDENCIES)
|
||||
@rm -f artnet_setdmx$(EXEEXT)
|
||||
$(LINK) $(artnet_setdmx_OBJECTS) $(artnet_setdmx_LDADD) $(LIBS)
|
||||
artnet_usb$(EXEEXT): $(artnet_usb_OBJECTS) $(artnet_usb_DEPENDENCIES)
|
||||
@rm -f artnet_usb$(EXEEXT)
|
||||
$(LINK) $(artnet_usb_OBJECTS) $(artnet_usb_LDADD) $(LIBS)
|
||||
|
||||
mostlyclean-compile:
|
||||
-rm -f *.$(OBJEXT)
|
||||
|
||||
distclean-compile:
|
||||
-rm -f *.tab.c
|
||||
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/artnet-discover.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/artnet-dmxconsole.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/artnet-dmxmonitor.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/artnet-firmware-node.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/artnet-firmware-server.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/artnet-flood-rx.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/artnet-flood-tx.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/artnet-multiport.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/artnet-profile-rx.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/artnet-profile-tx.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/artnet-rdm-output.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/artnet-setdmx.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/artnet-usb.Po@am__quote@
|
||||
|
||||
.c.o:
|
||||
@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
|
||||
@am__fastdepCC_TRUE@ mv -f $(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@ mv -f $(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) '$<'`
|
||||
|
||||
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) ' { files[$$0] = 1; } \
|
||||
END { for (i in files) print i; }'`; \
|
||||
mkid -fID $$unique
|
||||
tags: TAGS
|
||||
|
||||
TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
|
||||
$(TAGS_FILES) $(LISP)
|
||||
tags=; \
|
||||
here=`pwd`; \
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) ' { files[$$0] = 1; } \
|
||||
END { for (i in files) print i; }'`; \
|
||||
if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
|
||||
test -n "$$unique" || unique=$$empty_fix; \
|
||||
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
|
||||
$$tags $$unique; \
|
||||
fi
|
||||
ctags: CTAGS
|
||||
CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
|
||||
$(TAGS_FILES) $(LISP)
|
||||
tags=; \
|
||||
here=`pwd`; \
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) ' { files[$$0] = 1; } \
|
||||
END { for (i in files) print i; }'`; \
|
||||
test -z "$(CTAGS_ARGS)$$tags$$unique" \
|
||||
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
|
||||
$$tags $$unique
|
||||
|
||||
GTAGS:
|
||||
here=`$(am__cd) $(top_builddir) && pwd` \
|
||||
&& cd $(top_srcdir) \
|
||||
&& gtags -i $(GTAGS_ARGS) $$here
|
||||
|
||||
distclean-tags:
|
||||
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
|
||||
|
||||
distdir: $(DISTFILES)
|
||||
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
||||
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
||||
list='$(DISTFILES)'; \
|
||||
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 $(srcdir)/$$file && test $$d != $(srcdir); then \
|
||||
cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
|
||||
fi; \
|
||||
cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
|
||||
else \
|
||||
test -f $(distdir)/$$file \
|
||||
|| cp -p $$d/$$file $(distdir)/$$file \
|
||||
|| exit 1; \
|
||||
fi; \
|
||||
done
|
||||
check-am: all-am
|
||||
check: check-am
|
||||
all-am: Makefile $(PROGRAMS)
|
||||
installdirs:
|
||||
for dir in "$(DESTDIR)$(bindir)"; do \
|
||||
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
|
||||
done
|
||||
install: install-am
|
||||
install-exec: install-exec-am
|
||||
install-data: install-data-am
|
||||
uninstall: uninstall-am
|
||||
|
||||
install-am: all-am
|
||||
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
|
||||
|
||||
installcheck: installcheck-am
|
||||
install-strip:
|
||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
||||
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
|
||||
`test -z '$(STRIP)' || \
|
||||
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
|
||||
mostlyclean-generic:
|
||||
|
||||
clean-generic:
|
||||
|
||||
distclean-generic:
|
||||
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
|
||||
|
||||
maintainer-clean-generic:
|
||||
@echo "This command is intended for maintainers to use"
|
||||
@echo "it deletes files that may require special tools to rebuild."
|
||||
clean: clean-am
|
||||
|
||||
clean-am: clean-binPROGRAMS clean-generic 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
|
||||
|
||||
info: info-am
|
||||
|
||||
info-am:
|
||||
|
||||
install-data-am:
|
||||
|
||||
install-dvi: install-dvi-am
|
||||
|
||||
install-exec-am: install-binPROGRAMS
|
||||
|
||||
install-html: install-html-am
|
||||
|
||||
install-info: install-info-am
|
||||
|
||||
install-man:
|
||||
|
||||
install-pdf: install-pdf-am
|
||||
|
||||
install-ps: 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
|
||||
|
||||
|
||||
#artnet_test_master_SOURCES = artnet-test-master.c artnet-test-defaults.h
|
||||
#artnet_test_slave_SOURCES = artnet-test-slave.c artnet-test-defaults.h artnet-test-defns.h artnet-test-defns.c
|
||||
# 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:
|
|
@ -0,0 +1,144 @@
|
|||
/*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include <string.h>
|
||||
#include <time.h>
|
||||
|
||||
#include <artnet/artnet.h>
|
||||
|
||||
int verbose = 0;
|
||||
int nodes_found = 0;
|
||||
|
||||
|
||||
void print_node_config(artnet_node_entry ne) {
|
||||
printf("--------- %d.%d.%d.%d -------------\n", ne->ip[0], ne->ip[1], ne->ip[2], ne->ip[3]);
|
||||
printf("Short Name: %s\n", ne->shortname);
|
||||
printf("Long Name: %s\n", ne->longname);
|
||||
printf("Node Report: %s\n", ne->nodereport);
|
||||
printf("Subnet: 0x%hhx\n", ne->sub);
|
||||
printf("Numb Ports: %d\n", ne->numbports);
|
||||
printf("Input Addrs: 0x%hhx, 0x%hhx, 0x%hhx, 0x%hhx\n", ne->swin[0], ne->swin[1], ne->swin[2], ne->swin[3] );
|
||||
printf("Output Addrs: 0x%hhx, 0x%hhx, 0x%hhx, 0x%hhx\n", ne->swout[0], ne->swout[1], ne->swout[2], ne->swout[3] );
|
||||
printf("----------------------------------\n");
|
||||
}
|
||||
|
||||
int reply_handler(artnet_node n, void *pp, void *d) {
|
||||
artnet_node_list nl = artnet_get_nl(n);
|
||||
|
||||
if (nodes_found == artnet_nl_get_length(nl)) {
|
||||
// this is not a new node, just a previously discovered one sending
|
||||
// another reply
|
||||
return 0;
|
||||
} else if(nodes_found == 0) {
|
||||
// first node found
|
||||
nodes_found++;
|
||||
print_node_config( artnet_nl_first(nl));
|
||||
} else {
|
||||
// new node
|
||||
nodes_found++;
|
||||
print_node_config( artnet_nl_next(nl));
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
artnet_node node;
|
||||
char *ip_addr = NULL;
|
||||
int optc, sd, maxsd, timeout = 2;
|
||||
fd_set rset;
|
||||
struct timeval tv;
|
||||
time_t start;
|
||||
|
||||
// parse options
|
||||
while ((optc = getopt (argc, argv, "va:t:")) != EOF) {
|
||||
switch (optc) {
|
||||
case 'a':
|
||||
ip_addr = (char *) strdup(optarg);
|
||||
break;
|
||||
case 't':
|
||||
timeout = atoi(optarg);
|
||||
break;
|
||||
case 'v':
|
||||
verbose = 1;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ((node = artnet_new(ip_addr, verbose)) == NULL) {
|
||||
printf("new failed %s\n" , artnet_strerror());
|
||||
goto error;
|
||||
}
|
||||
|
||||
artnet_set_short_name(node, "artnet-discovery");
|
||||
artnet_set_long_name(node, "ArtNet Discovery Node");
|
||||
artnet_set_node_type(node, ARTNET_SRV);
|
||||
|
||||
// set poll reply handler
|
||||
artnet_set_handler(node, ARTNET_REPLY_HANDLER, reply_handler, NULL);
|
||||
|
||||
if( artnet_start(node) != ARTNET_EOK) {
|
||||
printf("Failed to start: %s\n", artnet_strerror());
|
||||
goto error_destroy;
|
||||
}
|
||||
|
||||
sd = artnet_get_sd(node);
|
||||
|
||||
if (artnet_send_poll(node, NULL, ARTNET_TTM_DEFAULT) != ARTNET_EOK) {
|
||||
printf("send poll failed\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
start = time(NULL);
|
||||
// wait for timeout seconds before quitting
|
||||
while (time(NULL) - start < timeout) {
|
||||
FD_ZERO(&rset);
|
||||
FD_SET(sd, &rset);
|
||||
|
||||
tv.tv_usec = 0;
|
||||
tv.tv_sec = 1;
|
||||
maxsd = sd;
|
||||
|
||||
switch (select(maxsd+1, &rset, NULL, NULL, &tv)) {
|
||||
case 0:
|
||||
// timeout
|
||||
break;
|
||||
case -1:
|
||||
printf("select error\n");
|
||||
break;
|
||||
default:
|
||||
artnet_read(node,0);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
error_destroy :
|
||||
artnet_destroy(node);
|
||||
|
||||
error:
|
||||
free(ip_addr);
|
||||
exit(1);
|
||||
}
|
|
@ -0,0 +1,913 @@
|
|||
/*
|
||||
* Copyright (C) 2001 Dirk Jagdmann <doj@cubic.org>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Edited by Simon Newton (nomis52<AT>westnet.com.au)
|
||||
* to use libartnet
|
||||
*
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
|
||||
#include <curses.h>
|
||||
#include <errno.h>
|
||||
#include <fcntl.h>
|
||||
#include <getopt.h>
|
||||
#ifdef HAVE_MALLOC_H
|
||||
#include <malloc.h>
|
||||
#endif
|
||||
#include <signal.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <sys/time.h>
|
||||
#include <termios.h>
|
||||
#include <time.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/timeb.h>
|
||||
|
||||
#include <artnet/artnet.h>
|
||||
|
||||
/* color names used */
|
||||
enum {
|
||||
CHANNEL = 1,
|
||||
ZERO,
|
||||
NORM,
|
||||
FULL,
|
||||
HEADLINE,
|
||||
HEADEMPH,
|
||||
HEADERROR,
|
||||
|
||||
MAXCOLOR
|
||||
};
|
||||
|
||||
/* display modes */
|
||||
enum {
|
||||
DISP_MODE_DMX = 0,
|
||||
DISP_MODE_HEX,
|
||||
DISP_MODE_DEC,
|
||||
DISP_MODE_MAX,
|
||||
};
|
||||
|
||||
int MAXCHANNELS=512;
|
||||
int MAXFKEY=12;
|
||||
|
||||
int verbose = 0;
|
||||
|
||||
typedef unsigned char dmx_t;
|
||||
|
||||
static dmx_t *dmx;
|
||||
static dmx_t *dmxsave;
|
||||
static dmx_t *dmxundo;
|
||||
|
||||
static int display_mode = DISP_MODE_DMX;
|
||||
static int current_channel = 0; /* channel cursor is positioned on */
|
||||
static int first_channel = 0; /* channel in upper left corner */
|
||||
static int channels_per_line=80/4;
|
||||
static int channels_per_screen=80/4*24/2;
|
||||
static int undo_possible=0;
|
||||
static int current_cue=0; /* select with F keys */
|
||||
static float fadetime=1.0f;
|
||||
static int fading=0; /* percentage counter of fade process */
|
||||
static int palette_number=0;
|
||||
static int palette[MAXCOLOR];
|
||||
static char *errorstr=NULL;
|
||||
static int channels_offset=1;
|
||||
|
||||
static artnet_node node;
|
||||
|
||||
void DMXsleep(int usec)
|
||||
{
|
||||
struct timeval tv;
|
||||
tv.tv_sec = usec/1000000;
|
||||
tv.tv_usec = usec%1000000;
|
||||
if(select(1, NULL, NULL, NULL, &tv) < 0)
|
||||
perror("could not select");
|
||||
}
|
||||
|
||||
// returns the time in milliseconds
|
||||
unsigned long timeGetTime()
|
||||
{
|
||||
#ifdef HAVE_GETTIMEOFDAY
|
||||
struct timeval tv;
|
||||
gettimeofday(&tv, NULL);
|
||||
return (unsigned long)tv.tv_sec*1000UL+ (unsigned long)tv.tv_usec/1000;
|
||||
|
||||
#else
|
||||
# ifdef HAVE_FTIME
|
||||
struct timeb t;
|
||||
ftime(&t);
|
||||
return (unsigned long)t.time*1000UL+(unsigned long)t.millitm;
|
||||
# else
|
||||
|
||||
# endif
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* set all DMX channels */
|
||||
void setall()
|
||||
{
|
||||
artnet_send_dmx(node,0,MAXCHANNELS, dmx);
|
||||
}
|
||||
|
||||
/* set current DMX channel */
|
||||
void set()
|
||||
{
|
||||
setall();
|
||||
}
|
||||
|
||||
|
||||
/* display the channels numbers */
|
||||
void mask()
|
||||
{
|
||||
int i=0,x,y,z=first_channel;
|
||||
|
||||
erase();
|
||||
|
||||
/* clear headline */
|
||||
attrset(palette[HEADLINE]);
|
||||
move(0,0);
|
||||
for(x=0; x<COLS; x++)
|
||||
addch(' ');
|
||||
|
||||
/* write channel numbers */
|
||||
attrset(palette[CHANNEL]);
|
||||
for(y=1; y<LINES && z<MAXCHANNELS && i<channels_per_screen; y+=2)
|
||||
{
|
||||
move(y,0);
|
||||
for(x=0; x<channels_per_line && z<MAXCHANNELS && i<channels_per_screen; x++, i++, z++)
|
||||
switch(display_mode)
|
||||
{
|
||||
case DISP_MODE_DMX:
|
||||
case DISP_MODE_DEC:
|
||||
default:
|
||||
printw("%03d ",z+channels_offset); break;
|
||||
|
||||
case DISP_MODE_HEX:
|
||||
printw("%03X ",z+channels_offset); break;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/* update the screen */
|
||||
void values()
|
||||
{
|
||||
int i=0,x,y,z=first_channel;
|
||||
|
||||
/* headline */
|
||||
if(COLS>24)
|
||||
{
|
||||
time_t t=time(NULL);
|
||||
struct tm *tt=localtime(&t);
|
||||
char *s=asctime(tt);
|
||||
s[strlen(s)-1]=0; /* strip newline at end of string */
|
||||
|
||||
attrset(palette[HEADLINE]);
|
||||
mvprintw(0,1,"%s", s);
|
||||
}
|
||||
if(COLS>31)
|
||||
{
|
||||
attrset(palette[HEADLINE]);
|
||||
printw(" cue:");
|
||||
attrset(palette[HEADEMPH]);
|
||||
printw("%02i", current_cue+1);
|
||||
}
|
||||
if(COLS>44)
|
||||
{
|
||||
attrset(palette[HEADLINE]);
|
||||
printw(" fadetime:");
|
||||
|
||||
attrset(palette[HEADEMPH]);
|
||||
printw("%1.1f", fadetime);
|
||||
}
|
||||
if(COLS>55)
|
||||
{
|
||||
if(fading)
|
||||
{
|
||||
attrset(palette[HEADLINE]);
|
||||
printw(" fading:");
|
||||
|
||||
attrset(palette[HEADEMPH]);
|
||||
printw("%02i%%", (fading<100)?fading:99);
|
||||
}
|
||||
else
|
||||
{
|
||||
attrset(palette[HEADLINE]);
|
||||
printw(" ");
|
||||
}
|
||||
}
|
||||
|
||||
if(COLS>80)
|
||||
if(errorstr)
|
||||
{
|
||||
attrset(palette[HEADERROR]);
|
||||
printw("ERROR:%s", errorstr);
|
||||
}
|
||||
|
||||
/* values */
|
||||
for(y=2; y<LINES && z<MAXCHANNELS && i<channels_per_screen; y+=2)
|
||||
{
|
||||
move(y,0);
|
||||
for(x=0; x<channels_per_line && z<MAXCHANNELS && i<channels_per_screen; x++, z++, i++)
|
||||
{
|
||||
const int d=dmx[z];
|
||||
switch(d)
|
||||
{
|
||||
case 0: attrset(palette[ZERO]); break;
|
||||
case 255: attrset(palette[FULL]); break;
|
||||
default: attrset(palette[NORM]);
|
||||
}
|
||||
if(z==current_channel)
|
||||
attron(A_REVERSE);
|
||||
switch(display_mode)
|
||||
{
|
||||
case DISP_MODE_HEX:
|
||||
if(d==0)
|
||||
addstr(" ");
|
||||
else
|
||||
printw(" %02x ", d);
|
||||
break;
|
||||
case DISP_MODE_DEC:
|
||||
if(d==0)
|
||||
addstr(" ");
|
||||
else if(d<100)
|
||||
printw(" %02d ", d);
|
||||
else
|
||||
printw("%03d ", d);
|
||||
break;
|
||||
case DISP_MODE_DMX:
|
||||
default:
|
||||
switch(d)
|
||||
{
|
||||
case 0: addstr(" "); break;
|
||||
case 255: addstr(" FL "); break;
|
||||
default: printw(" %02d ", (d*100)/255);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* save current cue into cuebuffer */
|
||||
void savecue()
|
||||
{
|
||||
memcpy(&dmxsave[current_cue*MAXCHANNELS], dmx, MAXCHANNELS);
|
||||
}
|
||||
|
||||
/* get new cue from cuebuffer */
|
||||
void loadcue()
|
||||
{
|
||||
memcpy(dmx, &dmxsave[current_cue*MAXCHANNELS], MAXCHANNELS);
|
||||
}
|
||||
|
||||
/* fade cue "new_cue" into current cue */
|
||||
void crossfade(int new_cue)
|
||||
{
|
||||
dmx_t *dmxold;
|
||||
dmx_t *dmxnew;
|
||||
int i;
|
||||
int max=MAXCHANNELS;
|
||||
|
||||
/* check parameter */
|
||||
if(new_cue>MAXFKEY || new_cue<0)
|
||||
return;
|
||||
|
||||
undo_possible=0;
|
||||
|
||||
/* don't crossfade for small fadetimes */
|
||||
if(fadetime<0.1f)
|
||||
{
|
||||
savecue();
|
||||
current_cue=new_cue;
|
||||
loadcue();
|
||||
setall();
|
||||
return;
|
||||
}
|
||||
|
||||
savecue();
|
||||
dmxold=&dmxsave[current_cue*MAXCHANNELS];
|
||||
dmxnew=&dmxsave[new_cue*MAXCHANNELS];
|
||||
|
||||
/* try to find the last channel value > 0, so we don't have to
|
||||
crossfade large blocks of 0s */
|
||||
for(i=MAXCHANNELS-1; i>=0; max=i, i--)
|
||||
if(dmxold[i]||dmxnew[i])
|
||||
break;
|
||||
|
||||
{
|
||||
const unsigned long tstart=timeGetTime();
|
||||
const unsigned long tend=tstart+(int)(fadetime*1000.0);
|
||||
unsigned long t=tstart;
|
||||
while(t<=tend)
|
||||
{
|
||||
/* calculate new cue */
|
||||
t=timeGetTime();
|
||||
{
|
||||
const float p=(float)(t-tstart)/1000.0f/fadetime;
|
||||
const float q=1.0f-p;
|
||||
for(i=1; i<max; i++)
|
||||
if(dmxold[i] || dmxnew[i]) /* avoid calculating with only 0 */
|
||||
dmx[i]=(int)((float)dmxold[i]*q + (float)dmxnew[i]*p);
|
||||
setall();
|
||||
|
||||
/* update screen */
|
||||
fading=(int)(p*100.0f);
|
||||
values();
|
||||
refresh();
|
||||
DMXsleep(100000);
|
||||
|
||||
t=timeGetTime(); /* get current time, because the last time is too old (due to the sleep) */
|
||||
}
|
||||
}
|
||||
fading=0;
|
||||
|
||||
/* set the new cue */
|
||||
current_cue=new_cue;
|
||||
loadcue();
|
||||
setall();
|
||||
}
|
||||
}
|
||||
|
||||
void save(const char *filename)
|
||||
{
|
||||
FILE *file=fopen(filename, "wb");
|
||||
if(file==NULL)
|
||||
errorstr="could not open savefile";
|
||||
else
|
||||
{
|
||||
if(fwrite(dmxsave, MAXCHANNELS, MAXFKEY, file) != MAXFKEY)
|
||||
errorstr="could not write complete savefile";
|
||||
fprintf(file, "\nfadetime %i\n", (int)(fadetime*1000.0f));
|
||||
fprintf(file, "current_cue %i\n", current_cue);
|
||||
fprintf(file, "current_channel %i\n", current_channel);
|
||||
fprintf(file, "first_channel %i\n", first_channel);
|
||||
fprintf(file, "palette_number %i\n", palette_number);
|
||||
if(fclose(file) < 0)
|
||||
errorstr="could not close savefile";
|
||||
}
|
||||
}
|
||||
|
||||
void load(const char *filename)
|
||||
{
|
||||
FILE *file=fopen(filename, "rb");
|
||||
if(file==NULL)
|
||||
{
|
||||
fprintf(stderr, "unable to open %s : %s\n", filename, strerror(errno));
|
||||
exit(1);
|
||||
}
|
||||
fread(dmxsave, MAXCHANNELS, MAXFKEY, file);
|
||||
while(!feof(file))
|
||||
{
|
||||
char buf[1024];
|
||||
int i;
|
||||
if(fscanf(file, "%s %i\n", buf, &i) != 2)
|
||||
continue;
|
||||
if(!strcmp("fadetime", buf))
|
||||
fadetime=i/1000.0f;
|
||||
else if(!strcmp("current_channel", buf))
|
||||
current_channel=i;
|
||||
else if(!strcmp("first_channel", buf))
|
||||
first_channel=i;
|
||||
else if(!strcmp("current_cue", buf))
|
||||
current_cue=i;
|
||||
else if(!strcmp("palette_number", buf))
|
||||
palette_number=i;
|
||||
}
|
||||
fclose(file);
|
||||
}
|
||||
|
||||
void undo()
|
||||
{
|
||||
if(undo_possible)
|
||||
{
|
||||
memcpy(dmx, dmxundo, MAXCHANNELS);
|
||||
undo_possible=0;
|
||||
}
|
||||
}
|
||||
|
||||
void undoprep()
|
||||
{
|
||||
memcpy(dmxundo, dmx, MAXCHANNELS);
|
||||
undo_possible=1;
|
||||
}
|
||||
|
||||
/* change palette to "p". If p is invalid new palette is number "0". */
|
||||
void changepalette(int p)
|
||||
{
|
||||
/* COLOR_BLACK
|
||||
COLOR_RED
|
||||
COLOR_GREEN
|
||||
COLOR_YELLOW
|
||||
COLOR_BLUE
|
||||
COLOR_MAGENTA
|
||||
COLOR_CYAN
|
||||
COLOR_WHITE
|
||||
|
||||
A_NORMAL
|
||||
A_ATTRIBUTES
|
||||
A_CHARTEXT
|
||||
A_COLOR
|
||||
A_STANDOUT
|
||||
A_UNDERLINE
|
||||
A_REVERSE
|
||||
A_BLINK
|
||||
A_DIM
|
||||
A_BOLD
|
||||
A_ALTCHARSET
|
||||
A_INVIS
|
||||
*/
|
||||
switch(p)
|
||||
{
|
||||
default:
|
||||
palette_number=0;
|
||||
case 0:
|
||||
init_pair(CHANNEL, COLOR_BLACK, COLOR_CYAN);
|
||||
init_pair(ZERO, COLOR_BLACK, COLOR_WHITE);
|
||||
init_pair(NORM, COLOR_BLUE, COLOR_WHITE);
|
||||
init_pair(FULL, COLOR_RED, COLOR_WHITE);
|
||||
init_pair(HEADLINE, COLOR_WHITE, COLOR_BLUE);
|
||||
init_pair(HEADEMPH, COLOR_YELLOW, COLOR_BLUE);
|
||||
init_pair(HEADERROR, COLOR_RED, COLOR_BLUE);
|
||||
goto color;
|
||||
|
||||
case 2:
|
||||
init_pair(CHANNEL, COLOR_BLACK, COLOR_WHITE);
|
||||
init_pair(ZERO, COLOR_BLUE, COLOR_BLACK);
|
||||
init_pair(NORM, COLOR_GREEN, COLOR_BLACK);
|
||||
init_pair(FULL, COLOR_RED, COLOR_BLACK);
|
||||
init_pair(HEADLINE, COLOR_WHITE, COLOR_BLACK);
|
||||
init_pair(HEADEMPH, COLOR_CYAN, COLOR_BLACK);
|
||||
init_pair(HEADERROR, COLOR_RED, COLOR_BLACK);
|
||||
goto color;
|
||||
|
||||
color:
|
||||
palette[CHANNEL]=COLOR_PAIR(CHANNEL);
|
||||
palette[ZERO]=COLOR_PAIR(ZERO);
|
||||
palette[NORM]=COLOR_PAIR(NORM);
|
||||
palette[FULL]=COLOR_PAIR(FULL);
|
||||
palette[HEADLINE]=COLOR_PAIR(HEADLINE);
|
||||
palette[HEADEMPH]=COLOR_PAIR(HEADEMPH);
|
||||
palette[HEADERROR]=COLOR_PAIR(HEADERROR);
|
||||
break;
|
||||
|
||||
case 1:
|
||||
palette[CHANNEL]=A_REVERSE;
|
||||
palette[ZERO]=A_NORMAL;
|
||||
palette[NORM]=A_NORMAL;
|
||||
palette[FULL]=A_BOLD;
|
||||
palette[HEADLINE]=A_NORMAL;
|
||||
palette[HEADEMPH]=A_NORMAL;
|
||||
palette[HEADERROR]=A_BOLD;
|
||||
break;
|
||||
}
|
||||
|
||||
mask();
|
||||
}
|
||||
|
||||
void CHECK(void *p)
|
||||
{
|
||||
if(p==NULL)
|
||||
{
|
||||
fprintf(stderr, "could not alloc\n");
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
/* signal handler for crashes. Program is aborted and cues are saved to "crash.chn". */
|
||||
void crash(int sig)
|
||||
{
|
||||
save("crash.chn");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
/* calculate channels_per_line and channels_per_screen from LINES and COLS */
|
||||
void calcscreengeometry()
|
||||
{
|
||||
int c=LINES;
|
||||
if(c<3)
|
||||
{
|
||||
errorstr="screen to small, we need at least 3 lines";
|
||||
exit(1);
|
||||
}
|
||||
c--; /* one line for headline */
|
||||
if(c%2==1)
|
||||
c--;
|
||||
channels_per_line=COLS/4;
|
||||
channels_per_screen=channels_per_line*c/2;
|
||||
}
|
||||
|
||||
/* signal handler for SIGWINCH */
|
||||
void terminalresize(int sig)
|
||||
{
|
||||
struct winsize size;
|
||||
if(ioctl(0, TIOCGWINSZ, &size) < 0)
|
||||
return;
|
||||
|
||||
resizeterm(size.ws_row, size.ws_col);
|
||||
calcscreengeometry();
|
||||
mask();
|
||||
}
|
||||
|
||||
WINDOW *w=NULL;
|
||||
|
||||
/* cleanup handler for program exit. */
|
||||
void cleanup()
|
||||
{
|
||||
if(w)
|
||||
{
|
||||
resetty();
|
||||
endwin();
|
||||
}
|
||||
|
||||
artnet_stop(node);
|
||||
|
||||
if(errorstr)
|
||||
puts(errorstr);
|
||||
}
|
||||
|
||||
int main (int argc, char *argv[])
|
||||
{
|
||||
int c=0;
|
||||
int optc, subnet_addr = 0, port_addr = 0;
|
||||
int bcast_limit = 0;
|
||||
const char *f;
|
||||
char *ip_addr = NULL;
|
||||
|
||||
int an_sd;
|
||||
int sigcrash[] = {
|
||||
//SIGABRT,
|
||||
//SIGALRM,
|
||||
SIGBUS,
|
||||
//SIGCHLD,
|
||||
//SIGCONT,
|
||||
SIGFPE,
|
||||
//SIGHUP,
|
||||
SIGILL,
|
||||
//SIGINT,
|
||||
SIGIO,
|
||||
SIGIOT,
|
||||
//SIGKILL,
|
||||
//SIGPIPE,
|
||||
//SIGPOLL,
|
||||
SIGPROF,
|
||||
//SIGPWR,
|
||||
//SIGQUIT,
|
||||
#if 0 /* these may cause errors */
|
||||
SIGRTMAX,
|
||||
SIGRTMIN,
|
||||
#endif
|
||||
SIGSEGV,
|
||||
#ifdef SIGSTKFLT
|
||||
SIGSTKFLT,
|
||||
#endif
|
||||
//SIGSTOP,
|
||||
#ifdef SIGSYS
|
||||
SIGSYS,
|
||||
#endif
|
||||
//SIGTERM,
|
||||
//SIGTRAP,
|
||||
//SIGTSTP,
|
||||
SIGTTIN,
|
||||
SIGTTOU,
|
||||
SIGURG,
|
||||
//SIGUSR1,
|
||||
//SIGUSR2,
|
||||
//SIGVTALRM,
|
||||
//SIGWINCH,
|
||||
SIGXCPU,
|
||||
SIGXFSZ,
|
||||
};
|
||||
|
||||
/* install signal handler */
|
||||
for(c=0; c<sizeof(sigcrash)/sizeof(sigcrash[0]); c++)
|
||||
signal(sigcrash[c], crash);
|
||||
|
||||
signal(SIGWINCH, terminalresize);
|
||||
atexit(cleanup);
|
||||
|
||||
/* alloc */
|
||||
dmx=calloc(MAXCHANNELS+10, sizeof(dmx_t)); /* 10 bytes security, for file IO routines, will be optimized and checked later */
|
||||
CHECK(dmx);
|
||||
|
||||
dmxsave=calloc(MAXCHANNELS*MAXFKEY, sizeof(dmx_t));
|
||||
CHECK(dmxsave);
|
||||
|
||||
dmxundo=calloc(MAXCHANNELS, sizeof(dmx_t));
|
||||
CHECK(dmxundo);
|
||||
|
||||
// parse options
|
||||
while ((optc = getopt (argc, argv, "va:b:p:s:")) != EOF) {
|
||||
switch (optc) {
|
||||
case 'a':
|
||||
ip_addr = (char *) strdup(optarg);
|
||||
break;
|
||||
case 'b':
|
||||
bcast_limit = atoi(optarg);
|
||||
break;
|
||||
case 's':
|
||||
subnet_addr = atoi(optarg);
|
||||
|
||||
if(subnet_addr < 0 && subnet_addr > 15) {
|
||||
printf("Subnet address must be between 0 and 15\n");
|
||||
exit(1);
|
||||
}
|
||||
break;
|
||||
case 'p':
|
||||
port_addr = atoi(optarg);
|
||||
|
||||
if(port_addr < 0 && port_addr > 15) {
|
||||
printf("Port address must be between 0 and 15\n");
|
||||
exit(1);
|
||||
}
|
||||
break;
|
||||
case 'v':
|
||||
verbose = 1;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/* check for file to load */
|
||||
if (optind < argc) {
|
||||
f=argv[optind];
|
||||
load(f);
|
||||
loadcue();
|
||||
setall();
|
||||
}
|
||||
else {
|
||||
f="default.chn";
|
||||
}
|
||||
|
||||
/* set up artnet node */
|
||||
node = artnet_new(ip_addr, verbose);;
|
||||
|
||||
if(node == NULL) {
|
||||
printf ("Unable to set up artnet node: %s\n", artnet_strerror() );
|
||||
return 1;
|
||||
}
|
||||
|
||||
// set names and node type
|
||||
artnet_set_short_name(node, "DMX Console ");
|
||||
artnet_set_long_name(node, "ArtNet DMX Console for Linux");
|
||||
artnet_set_node_type(node, ARTNET_SRV);
|
||||
|
||||
artnet_set_subnet_addr(node, subnet_addr);
|
||||
|
||||
// enable the first input port (1 universe only)
|
||||
artnet_set_port_type(node, 0, ARTNET_ENABLE_INPUT, ARTNET_PORT_DMX);
|
||||
artnet_set_port_addr(node, 0, ARTNET_INPUT_PORT, port_addr);
|
||||
artnet_set_bcast_limit(node, bcast_limit);
|
||||
|
||||
//start the node
|
||||
artnet_start(node);
|
||||
|
||||
// store the sds
|
||||
an_sd = artnet_get_sd(node);
|
||||
|
||||
/* init curses */
|
||||
w = initscr();
|
||||
if (!w)
|
||||
{
|
||||
printf ("unable to open main-screen\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
savetty();
|
||||
start_color();
|
||||
noecho();
|
||||
raw();
|
||||
keypad(w, TRUE);
|
||||
|
||||
calcscreengeometry();
|
||||
changepalette(palette_number);
|
||||
|
||||
/* main loop */
|
||||
c=0;
|
||||
while (c!='q')
|
||||
{
|
||||
int n;
|
||||
fd_set rd_fds;
|
||||
struct timeval tv;
|
||||
|
||||
FD_ZERO(&rd_fds);
|
||||
FD_SET(0, &rd_fds);
|
||||
FD_SET(an_sd, &rd_fds);
|
||||
|
||||
tv.tv_sec = 1;
|
||||
tv.tv_usec = 0;
|
||||
|
||||
n = select(an_sd+1, &rd_fds, NULL, NULL, &tv);
|
||||
if(n>0)
|
||||
{
|
||||
if(FD_ISSET(0, &rd_fds))
|
||||
{
|
||||
c=wgetch(w);
|
||||
switch (c)
|
||||
{
|
||||
case KEY_PPAGE:
|
||||
undoprep();
|
||||
if(dmx[current_channel] < 255-0x10)
|
||||
dmx[current_channel]+=0x10;
|
||||
else
|
||||
dmx[current_channel]=255;
|
||||
set();
|
||||
break;
|
||||
|
||||
case '+':
|
||||
if(dmx[current_channel] < 255)
|
||||
{
|
||||
undoprep();
|
||||
dmx[current_channel]++;
|
||||
}
|
||||
set();
|
||||
break;
|
||||
|
||||
case KEY_NPAGE:
|
||||
undoprep();
|
||||
if(dmx[current_channel]==255)
|
||||
dmx[current_channel]=0xe0;
|
||||
else if(dmx[current_channel] > 0x10)
|
||||
dmx[current_channel]-=0x10;
|
||||
else
|
||||
dmx[current_channel]=0;
|
||||
set();
|
||||
break;
|
||||
|
||||
case '-':
|
||||
if(dmx[current_channel] > 0)
|
||||
{
|
||||
undoprep();
|
||||
dmx[current_channel]--;
|
||||
}
|
||||
set();
|
||||
break;
|
||||
|
||||
case ' ':
|
||||
undoprep();
|
||||
if(dmx[current_channel]<128)
|
||||
dmx[current_channel]=255;
|
||||
else
|
||||
dmx[current_channel]=0;
|
||||
set();
|
||||
break;
|
||||
|
||||
case '0' ... '9':
|
||||
fadetime=c-'0';
|
||||
break;
|
||||
|
||||
case KEY_HOME:
|
||||
current_channel=0;
|
||||
first_channel=0;
|
||||
mask();
|
||||
break;
|
||||
|
||||
case KEY_RIGHT:
|
||||
if(current_channel < MAXCHANNELS-1)
|
||||
{
|
||||
current_channel++;
|
||||
if(current_channel >= first_channel+channels_per_screen)
|
||||
{
|
||||
first_channel+=channels_per_line;
|
||||
mask();
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case KEY_LEFT:
|
||||
if(current_channel > 0)
|
||||
{
|
||||
current_channel--;
|
||||
if(current_channel < first_channel)
|
||||
{
|
||||
first_channel-=channels_per_line;
|
||||
if(first_channel<0)
|
||||
first_channel=0;
|
||||
mask();
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case KEY_DOWN:
|
||||
current_channel+=channels_per_line;
|
||||
if(current_channel>=MAXCHANNELS)
|
||||
current_channel=MAXCHANNELS-1;
|
||||
if(current_channel >= first_channel+channels_per_screen)
|
||||
{
|
||||
first_channel+=channels_per_line;
|
||||
mask();
|
||||
}
|
||||
break;
|
||||
|
||||
case KEY_UP:
|
||||
current_channel-=channels_per_line;
|
||||
if(current_channel<0)
|
||||
current_channel=0;
|
||||
if(current_channel < first_channel)
|
||||
{
|
||||
first_channel-=channels_per_line;
|
||||
if(first_channel<0)
|
||||
first_channel=0;
|
||||
mask();
|
||||
}
|
||||
break;
|
||||
|
||||
case KEY_IC:
|
||||
undoprep();
|
||||
for(n=MAXCHANNELS-1; n>current_channel && n>0; n--)
|
||||
dmx[n]=dmx[n-1];
|
||||
setall();
|
||||
break;
|
||||
|
||||
case KEY_DC:
|
||||
undoprep();
|
||||
for(n=current_channel; n<MAXCHANNELS-1; n++)
|
||||
dmx[n]=dmx[n+1];
|
||||
setall();
|
||||
break;
|
||||
|
||||
case 'B':
|
||||
case 'b':
|
||||
undoprep();
|
||||
memset(dmx, 0, MAXCHANNELS);
|
||||
setall();
|
||||
break;
|
||||
|
||||
case 'F':
|
||||
case 'f':
|
||||
undoprep();
|
||||
memset(dmx, 0xff, MAXCHANNELS);
|
||||
setall();
|
||||
break;
|
||||
|
||||
case 'M':
|
||||
case 'm':
|
||||
if(++display_mode>=DISP_MODE_MAX)
|
||||
display_mode=0;
|
||||
mask();
|
||||
break;
|
||||
|
||||
case 'N':
|
||||
case 'n':
|
||||
if(++channels_offset>1)
|
||||
channels_offset=0;
|
||||
mask();
|
||||
break;
|
||||
|
||||
case 'P':
|
||||
case 'p':
|
||||
changepalette(++palette_number);
|
||||
break;
|
||||
|
||||
case 'S':
|
||||
case 's':
|
||||
savecue();
|
||||
save(f);
|
||||
break;
|
||||
|
||||
case 'U':
|
||||
case 'u':
|
||||
undo();
|
||||
break;
|
||||
|
||||
default:
|
||||
if(c>=KEY_F(1) && c<=KEY_F(MAXFKEY))
|
||||
crossfade(c-KEY_F(1));
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
if (FD_ISSET(an_sd, &rd_fds))
|
||||
artnet_read(node,0);
|
||||
|
||||
|
||||
values();
|
||||
refresh();
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
|
@ -0,0 +1,529 @@
|
|||
/*
|
||||
* Copyright (C) 2001 Dirk Jagdmann <doj@cubic.org>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Modified by Simon Newton (nomis52<AT>westnet.com.au)
|
||||
* to use artnet
|
||||
*
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
|
||||
#include <curses.h>
|
||||
#include <errno.h>
|
||||
#include <fcntl.h>
|
||||
#include <getopt.h>
|
||||
#ifdef HAVE_MALLOC_H
|
||||
#include <malloc.h>
|
||||
#endif
|
||||
#include <signal.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <sys/time.h>
|
||||
#include <termios.h>
|
||||
#include <time.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/timeb.h>
|
||||
|
||||
#include <artnet/artnet.h>
|
||||
|
||||
/* color names used */
|
||||
enum {
|
||||
CHANNEL = 1,
|
||||
ZERO,
|
||||
NORM,
|
||||
FULL,
|
||||
HEADLINE,
|
||||
HEADEMPH,
|
||||
HEADERROR,
|
||||
|
||||
MAXCOLOR
|
||||
};
|
||||
|
||||
/* display modes */
|
||||
enum {
|
||||
DISP_MODE_DMX = 0,
|
||||
DISP_MODE_HEX,
|
||||
DISP_MODE_DEC,
|
||||
DISP_MODE_MAX,
|
||||
};
|
||||
|
||||
int MAXCHANNELS=512;
|
||||
|
||||
typedef unsigned char dmx_t ;
|
||||
|
||||
static dmx_t *dmx;
|
||||
|
||||
static int display_mode = DISP_MODE_DMX;
|
||||
static int current_channel = 0; /* channel cursor is positioned on */
|
||||
static int first_channel = 0; /* channel in upper left corner */
|
||||
static int channels_per_line=80/4;
|
||||
static int channels_per_screen=80/4*24/2;
|
||||
static int palette_number=0;
|
||||
static int palette[MAXCOLOR];
|
||||
static char *errorstr=NULL;
|
||||
static int channels_offset=1;
|
||||
|
||||
WINDOW *w=NULL;
|
||||
static artnet_node node ;
|
||||
|
||||
|
||||
/* display the channels numbers */
|
||||
void mask() {
|
||||
int i=0,x,y,z=first_channel;
|
||||
|
||||
erase();
|
||||
|
||||
/* clear headline */
|
||||
attrset(palette[HEADLINE]);
|
||||
move(0,0);
|
||||
for(x=0; x<COLS; x++)
|
||||
addch(' ');
|
||||
|
||||
/* write channel numbers */
|
||||
attrset(palette[CHANNEL]);
|
||||
for(y=1; y<LINES && z<MAXCHANNELS && i<channels_per_screen; y+=2) {
|
||||
move(y,0);
|
||||
for(x=0; x<channels_per_line && z<MAXCHANNELS && i<channels_per_screen; x++, i++, z++)
|
||||
switch(display_mode) {
|
||||
case DISP_MODE_DMX:
|
||||
case DISP_MODE_DEC:
|
||||
default:
|
||||
printw("%03d ",z+channels_offset); break;
|
||||
|
||||
case DISP_MODE_HEX:
|
||||
printw("%03X ",z+channels_offset); break;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/* update the screen */
|
||||
void values() {
|
||||
int i=0,x,y,z=first_channel;
|
||||
|
||||
/* headline */
|
||||
if(COLS>24)
|
||||
{
|
||||
time_t t=time(NULL);
|
||||
struct tm *tt=localtime(&t);
|
||||
char *s=asctime(tt);
|
||||
s[strlen(s)-1]=0; /* strip newline at end of string */
|
||||
|
||||
attrset(palette[HEADLINE]);
|
||||
mvprintw(0,1,"%s", s);
|
||||
}
|
||||
|
||||
/* values */
|
||||
for(y=2; y<LINES && z<MAXCHANNELS && i<channels_per_screen; y+=2)
|
||||
{
|
||||
move(y,0);
|
||||
for(x=0; x<channels_per_line && z<MAXCHANNELS && i<channels_per_screen; x++, z++, i++)
|
||||
{
|
||||
const int d=dmx[z];
|
||||
switch(d)
|
||||
{
|
||||
case 0: attrset(palette[ZERO]); break;
|
||||
case 255: attrset(palette[FULL]); break;
|
||||
default: attrset(palette[NORM]);
|
||||
}
|
||||
if(z==current_channel)
|
||||
attron(A_REVERSE);
|
||||
switch(display_mode)
|
||||
{
|
||||
case DISP_MODE_HEX:
|
||||
if(d==0)
|
||||
addstr(" ");
|
||||
else
|
||||
printw(" %02x ", d);
|
||||
break;
|
||||
case DISP_MODE_DEC:
|
||||
if(d==0)
|
||||
addstr(" ");
|
||||
else if(d<100)
|
||||
printw(" %02d ", d);
|
||||
else
|
||||
printw("%03d ", d);
|
||||
break;
|
||||
case DISP_MODE_DMX:
|
||||
default:
|
||||
switch(d)
|
||||
{
|
||||
case 0: addstr(" "); break;
|
||||
case 255: addstr(" FL "); break;
|
||||
default: printw(" %02d ", (d*100)/255);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* change palette to "p". If p is invalid new palette is number "0". */
|
||||
void changepalette(int p)
|
||||
{
|
||||
/* COLOR_BLACK
|
||||
COLOR_RED
|
||||
COLOR_GREEN
|
||||
COLOR_YELLOW
|
||||
COLOR_BLUE
|
||||
COLOR_MAGENTA
|
||||
COLOR_CYAN
|
||||
COLOR_WHITE
|
||||
|
||||
A_NORMAL
|
||||
A_ATTRIBUTES
|
||||
A_CHARTEXT
|
||||
A_COLOR
|
||||
A_STANDOUT
|
||||
A_UNDERLINE
|
||||
A_REVERSE
|
||||
A_BLINK
|
||||
A_DIM
|
||||
A_BOLD
|
||||
A_ALTCHARSET
|
||||
A_INVIS
|
||||
*/
|
||||
switch(p)
|
||||
{
|
||||
default:
|
||||
palette_number=0;
|
||||
case 0:
|
||||
init_pair(CHANNEL, COLOR_BLACK, COLOR_CYAN);
|
||||
init_pair(ZERO, COLOR_BLACK, COLOR_WHITE);
|
||||
init_pair(NORM, COLOR_BLUE, COLOR_WHITE);
|
||||
init_pair(FULL, COLOR_RED, COLOR_WHITE);
|
||||
init_pair(HEADLINE, COLOR_WHITE, COLOR_BLUE);
|
||||
init_pair(HEADEMPH, COLOR_YELLOW, COLOR_BLUE);
|
||||
init_pair(HEADERROR, COLOR_RED, COLOR_BLUE);
|
||||
goto color;
|
||||
|
||||
case 2:
|
||||
init_pair(CHANNEL, COLOR_BLACK, COLOR_WHITE);
|
||||
init_pair(ZERO, COLOR_BLUE, COLOR_BLACK);
|
||||
init_pair(NORM, COLOR_GREEN, COLOR_BLACK);
|
||||
init_pair(FULL, COLOR_RED, COLOR_BLACK);
|
||||
init_pair(HEADLINE, COLOR_WHITE, COLOR_BLACK);
|
||||
init_pair(HEADEMPH, COLOR_CYAN, COLOR_BLACK);
|
||||
init_pair(HEADERROR, COLOR_RED, COLOR_BLACK);
|
||||
goto color;
|
||||
|
||||
color:
|
||||
palette[CHANNEL]=COLOR_PAIR(CHANNEL);
|
||||
palette[ZERO]=COLOR_PAIR(ZERO);
|
||||
palette[NORM]=COLOR_PAIR(NORM);
|
||||
palette[FULL]=COLOR_PAIR(FULL);
|
||||
palette[HEADLINE]=COLOR_PAIR(HEADLINE);
|
||||
palette[HEADEMPH]=COLOR_PAIR(HEADEMPH);
|
||||
palette[HEADERROR]=COLOR_PAIR(HEADERROR);
|
||||
break;
|
||||
|
||||
case 1:
|
||||
palette[CHANNEL]=A_REVERSE;
|
||||
palette[ZERO]=A_NORMAL;
|
||||
palette[NORM]=A_NORMAL;
|
||||
palette[FULL]=A_BOLD;
|
||||
palette[HEADLINE]=A_NORMAL;
|
||||
palette[HEADEMPH]=A_NORMAL;
|
||||
palette[HEADERROR]=A_BOLD;
|
||||
break;
|
||||
}
|
||||
|
||||
mask();
|
||||
}
|
||||
|
||||
void CHECK(void *p)
|
||||
{
|
||||
if(p==NULL)
|
||||
{
|
||||
fprintf(stderr, "could not alloc\n");
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
/* signal handler for crashes. Program is aborted */
|
||||
void crash(int sig) {
|
||||
exit(1);
|
||||
}
|
||||
|
||||
|
||||
/* calculate channels_per_line and channels_per_screen from LINES and COLS */
|
||||
void calcscreengeometry() {
|
||||
int c=LINES;
|
||||
if(c<3) {
|
||||
errorstr="screen to small, we need at least 3 lines";
|
||||
exit(1);
|
||||
}
|
||||
c--; /* one line for headline */
|
||||
if(c%2==1)
|
||||
c--;
|
||||
channels_per_line=COLS/4;
|
||||
channels_per_screen=channels_per_line*c/2;
|
||||
}
|
||||
|
||||
|
||||
/* signal handler for SIGWINCH */
|
||||
void terminalresize(int sig) {
|
||||
struct winsize size;
|
||||
if(ioctl(0, TIOCGWINSZ, &size) < 0)
|
||||
return;
|
||||
|
||||
resizeterm(size.ws_row, size.ws_col);
|
||||
calcscreengeometry();
|
||||
mask();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/* cleanup handler for program exit. */
|
||||
void cleanup() {
|
||||
if(w) {
|
||||
resetty();
|
||||
endwin();
|
||||
}
|
||||
|
||||
|
||||
artnet_stop(node) ;
|
||||
artnet_destroy(node) ;
|
||||
|
||||
}
|
||||
|
||||
int dmx_handler(artnet_node n, int prt , void *d ) {
|
||||
int len ;
|
||||
uint8_t *data ;
|
||||
|
||||
|
||||
|
||||
if( prt == 0 ) {
|
||||
data = artnet_read_dmx(n, prt, &len) ;
|
||||
memcpy(dmx, data,len) ;
|
||||
values();
|
||||
refresh();
|
||||
}
|
||||
|
||||
return 0 ;
|
||||
}
|
||||
|
||||
|
||||
int main (int argc, char *argv[]) {
|
||||
int c=0;
|
||||
int optc , subnet_addr = 0 , port_addr = 0 ;
|
||||
int artnet_sd ;
|
||||
char *ip_addr = NULL ;
|
||||
|
||||
atexit(cleanup);
|
||||
|
||||
dmx = malloc(MAXCHANNELS) ;
|
||||
|
||||
if(!dmx) {
|
||||
printf("malloc failed\n") ;
|
||||
return 1 ;
|
||||
}
|
||||
|
||||
memset(dmx, 0x00, MAXCHANNELS) ;
|
||||
|
||||
// parse options
|
||||
while ((optc = getopt (argc, argv, "s:p:a:")) != EOF) {
|
||||
switch (optc) {
|
||||
case 'a':
|
||||
ip_addr = (char *) strdup(optarg) ;
|
||||
break;
|
||||
case 's':
|
||||
subnet_addr = atoi(optarg) ;
|
||||
|
||||
if(subnet_addr < 0 && subnet_addr > 15) {
|
||||
printf("Subnet address must be between 0 and 15\n") ;
|
||||
exit(1) ;
|
||||
}
|
||||
break ;
|
||||
case 'p':
|
||||
port_addr = atoi(optarg) ;
|
||||
|
||||
if(port_addr < 0 && port_addr > 15) {
|
||||
printf("Port address must be between 0 and 15\n") ;
|
||||
exit(1) ;
|
||||
}
|
||||
break ;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/* set up artnet connection */
|
||||
node = artnet_new(ip_addr, 0 ) ; ;
|
||||
|
||||
if(node == NULL) {
|
||||
printf("Unable to connect\n") ;
|
||||
return 1 ;
|
||||
}
|
||||
|
||||
if(artnet_set_dmx_handler(node, dmx_handler, NULL) ) {
|
||||
printf("Failed to install handler\n") ;
|
||||
return 1 ;
|
||||
}
|
||||
|
||||
artnet_set_subnet_addr(node, subnet_addr) ;
|
||||
|
||||
artnet_set_port_type(node, 0, ARTNET_ENABLE_OUTPUT, ARTNET_PORT_DMX) ;
|
||||
artnet_set_port_addr(node, 0, ARTNET_OUTPUT_PORT, port_addr);
|
||||
|
||||
artnet_start(node) ;
|
||||
|
||||
// store the sds
|
||||
artnet_sd = artnet_get_sd(node) ;
|
||||
|
||||
/* init curses */
|
||||
w = initscr();
|
||||
if (!w) {
|
||||
printf ("unable to open main-screen\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
savetty();
|
||||
start_color();
|
||||
noecho();
|
||||
raw();
|
||||
keypad(w, TRUE);
|
||||
|
||||
calcscreengeometry();
|
||||
changepalette(palette_number);
|
||||
|
||||
/* main loop */
|
||||
c=0;
|
||||
while (c!='q') {
|
||||
int n, max;
|
||||
fd_set rd_fds;
|
||||
struct timeval tv;
|
||||
|
||||
FD_ZERO(&rd_fds);
|
||||
FD_SET(0, &rd_fds);
|
||||
FD_SET(artnet_sd, &rd_fds) ;
|
||||
|
||||
max = artnet_sd ;
|
||||
|
||||
tv.tv_sec = 1;
|
||||
tv.tv_usec = 0;
|
||||
|
||||
n = select(max+1, &rd_fds, NULL, NULL, &tv);
|
||||
if(n>0) {
|
||||
if(FD_ISSET(0, &rd_fds)) {
|
||||
c=wgetch(w);
|
||||
switch (c) {
|
||||
case KEY_HOME:
|
||||
current_channel=0;
|
||||
first_channel=0;
|
||||
mask();
|
||||
break;
|
||||
case KEY_RIGHT:
|
||||
if(current_channel < MAXCHANNELS-1) {
|
||||
current_channel++;
|
||||
if(current_channel >= first_channel+channels_per_screen) {
|
||||
first_channel+=channels_per_line;
|
||||
mask();
|
||||
}
|
||||
}
|
||||
break;
|
||||
case KEY_LEFT:
|
||||
if(current_channel > 0) {
|
||||
current_channel--;
|
||||
if(current_channel < first_channel) {
|
||||
first_channel-=channels_per_line;
|
||||
if(first_channel<0)
|
||||
first_channel=0;
|
||||
mask();
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case KEY_DOWN:
|
||||
current_channel+=channels_per_line;
|
||||
if(current_channel>=MAXCHANNELS)
|
||||
current_channel=MAXCHANNELS-1;
|
||||
if(current_channel >= first_channel+channels_per_screen)
|
||||
{
|
||||
first_channel+=channels_per_line;
|
||||
mask();
|
||||
}
|
||||
break;
|
||||
|
||||
case KEY_UP:
|
||||
current_channel-=channels_per_line;
|
||||
if(current_channel<0)
|
||||
current_channel=0;
|
||||
if(current_channel < first_channel)
|
||||
{
|
||||
first_channel-=channels_per_line;
|
||||
if(first_channel<0)
|
||||
first_channel=0;
|
||||
mask();
|
||||
}
|
||||
break;
|
||||
|
||||
case KEY_IC:
|
||||
for(n=MAXCHANNELS-1; n>current_channel && n>0; n--)
|
||||
dmx[n]=dmx[n-1];
|
||||
break;
|
||||
|
||||
case KEY_DC:
|
||||
for(n=current_channel; n<MAXCHANNELS-1; n++)
|
||||
dmx[n]=dmx[n+1];
|
||||
break;
|
||||
|
||||
|
||||
case 'M':
|
||||
case 'm':
|
||||
if(++display_mode>=DISP_MODE_MAX)
|
||||
display_mode=0;
|
||||
mask();
|
||||
break;
|
||||
|
||||
case 'N':
|
||||
case 'n':
|
||||
if(++channels_offset>1)
|
||||
channels_offset=0;
|
||||
mask();
|
||||
break;
|
||||
|
||||
case 'P':
|
||||
case 'p':
|
||||
changepalette(++palette_number);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
if (FD_ISSET(artnet_sd , &rd_fds) )
|
||||
artnet_read(node,0);
|
||||
}
|
||||
|
||||
values();
|
||||
refresh();
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
|
@ -0,0 +1,95 @@
|
|||
/*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include <string.h>
|
||||
#include <time.h>
|
||||
|
||||
#include <artnet/artnet.h>
|
||||
|
||||
int verbose = 0 ;
|
||||
int nodes_found = 0;
|
||||
|
||||
|
||||
int firmware_handler(artnet_node n, int ubea, uint16_t *data, int length, void *d) {
|
||||
|
||||
FILE *file=fopen("test", "wb");
|
||||
printf("in firmware hanlder got %d words\n", length) ;
|
||||
if(file==NULL)
|
||||
printf("could not open savefile\n");
|
||||
else {
|
||||
if(fwrite(data, sizeof(uint16_t), length, file) != length)
|
||||
printf("could not write complete savefile\n");
|
||||
if(fclose(file) < 0)
|
||||
printf("could not close savefile");
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
artnet_node node ;
|
||||
char *ip_addr = NULL ;
|
||||
int optc, timeout = 2;
|
||||
time_t start ;
|
||||
|
||||
// parse options
|
||||
while ((optc = getopt (argc, argv, "va:t:")) != EOF) {
|
||||
switch (optc) {
|
||||
case 'a':
|
||||
ip_addr = (char *) strdup(optarg) ;
|
||||
break;
|
||||
case 't':
|
||||
timeout = atoi(optarg) ;
|
||||
break;
|
||||
case 'v':
|
||||
verbose = 1 ;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
node = artnet_new(ip_addr, verbose) ; ;
|
||||
|
||||
|
||||
artnet_set_short_name(node, "artnet-firmware") ;
|
||||
artnet_set_long_name(node, "ArtNet Firmware Test Node") ;
|
||||
artnet_set_node_type(node, ARTNET_NODE) ;
|
||||
|
||||
// set poll reply handler
|
||||
artnet_set_firmware_handler(node, firmware_handler, NULL) ;
|
||||
|
||||
artnet_start(node) ;
|
||||
|
||||
start = time(NULL) ;
|
||||
|
||||
// wait for timeout seconds before quitting
|
||||
// got an issue here if the upload starts towards the end of the time
|
||||
// we'll exit while the upload is in progress
|
||||
while(time(NULL) - start < timeout) {
|
||||
artnet_read(node,1) ;
|
||||
}
|
||||
|
||||
return 0 ;
|
||||
}
|
|
@ -0,0 +1,314 @@
|
|||
/*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/types.h>
|
||||
#include <string.h>
|
||||
#include <time.h>
|
||||
#include <fcntl.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
#include <artnet/artnet.h>
|
||||
|
||||
#define START_SIZE 1048576
|
||||
#define GROW_SIZE 1048576
|
||||
#define LINE 80
|
||||
|
||||
//#define START_SIZE 1024
|
||||
//#define GROW_SIZE 1024
|
||||
|
||||
typedef struct {
|
||||
char *ip_addr;
|
||||
char *firmware;
|
||||
int timeout;
|
||||
int verbose;
|
||||
int ubea;
|
||||
int size;
|
||||
uint16_t *buffer;
|
||||
int uploading;
|
||||
} options_t;
|
||||
|
||||
void *Malloc(int len) {
|
||||
void *ptr = malloc(len);
|
||||
|
||||
if(ptr == NULL) {
|
||||
fprintf(stderr,"malloc failed\n");
|
||||
exit(1);
|
||||
}
|
||||
return ptr;
|
||||
}
|
||||
|
||||
void *Realloc(void *ptr, int len) {
|
||||
ptr = realloc(ptr, len);
|
||||
|
||||
if(ptr == NULL) {
|
||||
fprintf(stderr,"realloc failed\n");
|
||||
exit(1);
|
||||
}
|
||||
return ptr;
|
||||
}
|
||||
|
||||
/*
|
||||
* Parse command lines opts
|
||||
*/
|
||||
void parse_options(int argc, char *argv[], options_t *options ) {
|
||||
int optc;
|
||||
|
||||
options->ip_addr = NULL;
|
||||
options->firmware = NULL;
|
||||
options->timeout = 2;
|
||||
options->verbose = 0;
|
||||
options->ubea = 0;
|
||||
options->uploading = 0;
|
||||
|
||||
// parse options
|
||||
while ((optc = getopt (argc, argv, "uva:t:f:")) != EOF) {
|
||||
switch (optc) {
|
||||
case 'a':
|
||||
options->ip_addr = (char *) strdup(optarg);
|
||||
break;
|
||||
case 'f':
|
||||
options->firmware = (char *) strdup(optarg);
|
||||
break;
|
||||
case 't':
|
||||
options->timeout = atoi(optarg);
|
||||
break;
|
||||
case 'v':
|
||||
options->verbose = 1;
|
||||
break;
|
||||
case 'u':
|
||||
options->ubea = 1;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Print the node list
|
||||
*/
|
||||
void print_node_list(artnet_node n) {
|
||||
artnet_node_list nl = artnet_get_nl(n);
|
||||
artnet_node_entry ent = artnet_nl_first(nl);
|
||||
int i = 1;
|
||||
|
||||
printf("------------------------------\n");
|
||||
for( ent = artnet_nl_first(nl); ent != NULL; ent = artnet_nl_next(nl)) {
|
||||
printf("%i : %s\n", i++, ent->shortname);
|
||||
}
|
||||
printf("------------------------------\n");
|
||||
|
||||
printf("Select a number, r to re-scan or q to quit\n");
|
||||
}
|
||||
|
||||
/*
|
||||
* Reads the firmware file into memory and returns a point
|
||||
* this must be freed once you're done
|
||||
*/
|
||||
void read_firmware(char *firmware, options_t *options ) {
|
||||
int fd, len, size;
|
||||
uint16_t *buf;
|
||||
char *buf2;
|
||||
|
||||
struct stat f_stat;
|
||||
|
||||
// check if filename is specified
|
||||
// should fix this up
|
||||
if(firmware == NULL) {
|
||||
printf("Use -f to specify firmware file\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
// open file
|
||||
fd = open(firmware, O_RDONLY);
|
||||
|
||||
if ( fstat(fd, &f_stat) ) {
|
||||
printf("Firmware file %s does not exist\n", firmware);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
if( ! fd) {
|
||||
printf("Could not open firmware file %s\n", firmware);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
len = START_SIZE;
|
||||
|
||||
// read file
|
||||
for (;;) {
|
||||
buf = Malloc(len);
|
||||
size = read(fd, (void*) buf, len);
|
||||
|
||||
if( size < len) {
|
||||
break;
|
||||
} else {
|
||||
len += GROW_SIZE;
|
||||
free(buf);
|
||||
lseek(fd,0,SEEK_SET);
|
||||
}
|
||||
}
|
||||
|
||||
options->buffer = buf;
|
||||
options->size = size;
|
||||
|
||||
buf2 = (char *) buf;
|
||||
|
||||
if(buf2[size-1] == '\n') {
|
||||
printf("got char\n");
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Scan for nodes on the network
|
||||
*
|
||||
*/
|
||||
void scan_for_nodes(artnet_node n) {
|
||||
#define WAIT_TIME 2
|
||||
time_t start;
|
||||
|
||||
start = time(NULL);
|
||||
|
||||
printf("Searching for nodes... (wait %i seconds)\n", WAIT_TIME);
|
||||
// wait for WAIT_TIME seconds before quitting
|
||||
while(time(NULL) - start < WAIT_TIME) {
|
||||
artnet_read(n,1);
|
||||
}
|
||||
|
||||
print_node_list(n);
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
* This is called when a upload completes
|
||||
*/
|
||||
int firmware_complete_callback( artnet_node n, artnet_firmware_status_code code, void *data) {
|
||||
options_t *options = (options_t*) data;
|
||||
|
||||
printf("Upload Complete\n");
|
||||
options->uploading = 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* Read
|
||||
*/
|
||||
int server_handle_input(artnet_node n, options_t *options) {
|
||||
char line[LINE];
|
||||
artnet_node_entry ent;
|
||||
artnet_node_list nl = artnet_get_nl(n);
|
||||
int i = 0;
|
||||
int index;
|
||||
|
||||
if (fgets(line, LINE, stdin) == NULL) {
|
||||
printf("Unable to read from stdin\n");
|
||||
return 0;
|
||||
}
|
||||
index = atoi(line);
|
||||
|
||||
if(0 == strcmp( line ,"q\n") ) {
|
||||
return 1;
|
||||
} else if ( 0 == strcmp(line, "r\n") ) {
|
||||
scan_for_nodes( n);
|
||||
} else if ( index > 0 && index <= artnet_nl_get_length(artnet_get_nl(n)) ) {
|
||||
// do upload
|
||||
printf("Starting upload...\n");
|
||||
|
||||
for(ent = artnet_nl_first(nl); ent != NULL; ent = artnet_nl_next(nl) ) {
|
||||
if(++i == index)
|
||||
break;
|
||||
}
|
||||
|
||||
if(ent != NULL)
|
||||
artnet_send_firmware(n, ent, options->ubea, options->buffer, options->size / sizeof(uint16_t), firmware_complete_callback, (void *) options);
|
||||
|
||||
} else {
|
||||
printf("Invalid Command\n");
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
*
|
||||
*
|
||||
*/
|
||||
void wait_for_input(artnet_node n, options_t *options) {
|
||||
int sd, maxsd;
|
||||
fd_set rset;
|
||||
struct timeval tv;
|
||||
|
||||
sd = artnet_get_sd(n);
|
||||
maxsd = sd;
|
||||
|
||||
while(1) {
|
||||
FD_ZERO(&rset);
|
||||
FD_SET(STDIN_FILENO, &rset);
|
||||
FD_SET(sd, &rset);
|
||||
|
||||
tv.tv_usec = 0;
|
||||
tv.tv_sec = 1;
|
||||
|
||||
switch (select( maxsd, &rset, NULL, NULL, &tv ) ) {
|
||||
case 0:
|
||||
// timeout
|
||||
break;
|
||||
case -1:
|
||||
printf("select error\n");
|
||||
break;
|
||||
default:
|
||||
if(FD_ISSET(STDIN_FILENO, &rset) && ! options->uploading) {
|
||||
if ( server_handle_input(n,options) )
|
||||
return;
|
||||
|
||||
} else {
|
||||
artnet_read(n,0);
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
artnet_node node;
|
||||
options_t options;
|
||||
|
||||
parse_options(argc, argv, &options);
|
||||
|
||||
read_firmware(options.firmware, &options);
|
||||
|
||||
node = artnet_new(options.ip_addr, options.verbose); ;
|
||||
|
||||
artnet_set_short_name(node, "artnet-firmware");
|
||||
artnet_set_long_name(node, "ArtNet Firmware Test Server");
|
||||
artnet_set_node_type(node, ARTNET_SRV);
|
||||
artnet_start(node);
|
||||
artnet_send_poll(node, NULL, ARTNET_TTM_DEFAULT);
|
||||
|
||||
scan_for_nodes(node);
|
||||
|
||||
wait_for_input(node, &options);
|
||||
|
||||
return 0;
|
||||
}
|
|
@ -0,0 +1,127 @@
|
|||
/*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include <time.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <artnet/artnet.h>
|
||||
#include <artnet/packets.h>
|
||||
|
||||
int length ;
|
||||
int verbose = 0;
|
||||
|
||||
int dmx_callback(artnet_node n, void *p, void *d) {
|
||||
static time_t last = 0 ;
|
||||
static int counter = 0 ;
|
||||
time_t now ;
|
||||
static int last_seq = 0;
|
||||
|
||||
artnet_packet pack = (artnet_packet) p ;
|
||||
|
||||
// printf("seq %d\n", pack->data.admx.sequence ) ;
|
||||
|
||||
// first time
|
||||
if(last ==0) {
|
||||
time(&last) ;
|
||||
last_seq = pack->data.admx.sequence ;
|
||||
}
|
||||
|
||||
time(&now) ;
|
||||
|
||||
if(pack->data.admx.sequence - last_seq > 1) {
|
||||
printf("lost %d packets %d %d \n", pack->data.admx.sequence - last_seq, pack->data.admx.sequence , last_seq ) ;
|
||||
}
|
||||
|
||||
if(last == now)
|
||||
counter++ ;
|
||||
else {
|
||||
printf("Got %d packets last second\n", counter) ;
|
||||
counter = 0;
|
||||
last = now ;
|
||||
}
|
||||
last_seq = pack->data.admx.sequence ;
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
artnet_node node ;
|
||||
char *ip_addr = NULL ;
|
||||
int optc, subnet_addr = 0, port_addr = 0 ;
|
||||
|
||||
// parse options
|
||||
while ((optc = getopt (argc, argv, "s:p:d:a:v")) != EOF) {
|
||||
switch (optc) {
|
||||
case 'a':
|
||||
ip_addr = (char *) strdup(optarg) ;
|
||||
break;
|
||||
case 'v':
|
||||
verbose = 1 ;
|
||||
break;
|
||||
case 's':
|
||||
subnet_addr = atoi(optarg) ;
|
||||
|
||||
if(subnet_addr < 0 && subnet_addr > 15) {
|
||||
printf("Subnet address must be between 0 and 15\n") ;
|
||||
exit(1) ;
|
||||
}
|
||||
break ;
|
||||
case 'p':
|
||||
port_addr = atoi(optarg) ;
|
||||
|
||||
if(port_addr < 0 && port_addr > 15) {
|
||||
printf("Port address must be between 0 and 15\n") ;
|
||||
exit(1) ;
|
||||
}
|
||||
break ;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
node = artnet_new(ip_addr, verbose) ;
|
||||
|
||||
artnet_set_short_name(node, "Artnet -> DMX ") ;
|
||||
artnet_set_long_name(node, "ArtNet Flood RX") ;
|
||||
artnet_set_node_type(node, ARTNET_NODE) ;
|
||||
|
||||
artnet_set_handler(node, ARTNET_DMX_HANDLER, dmx_callback, NULL) ;
|
||||
|
||||
// set the first port to output dmx data
|
||||
artnet_set_port_type(node, 0, ARTNET_ENABLE_OUTPUT, ARTNET_PORT_DMX) ;
|
||||
artnet_set_subnet_addr(node, subnet_addr) ;
|
||||
|
||||
// set the universe address of the first port
|
||||
artnet_set_port_addr(node, 0, ARTNET_OUTPUT_PORT, port_addr) ;
|
||||
artnet_start(node) ;
|
||||
|
||||
while(1) {
|
||||
artnet_read(node, 1) ;
|
||||
}
|
||||
|
||||
return 0 ;
|
||||
}
|
|
@ -0,0 +1,147 @@
|
|||
/*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include <string.h>
|
||||
#include <time.h>
|
||||
#include <sched.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <artnet/artnet.h>
|
||||
|
||||
int verbose = 0;
|
||||
int use_select = 0 ;
|
||||
|
||||
int delay = 25000;
|
||||
|
||||
|
||||
#include <sys/select.h>
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
artnet_node node ;
|
||||
char *ip_addr = NULL ;
|
||||
int optc, subnet_addr = 0, port_addr = 0 ;
|
||||
uint8_t data[ARTNET_DMX_LENGTH] ;
|
||||
struct timeval tv;
|
||||
int sd, maxsd ;
|
||||
fd_set rset;
|
||||
struct timespec ts;
|
||||
|
||||
// parse options
|
||||
while ((optc = getopt (argc, argv, "s:p:d:a:ve")) != EOF) {
|
||||
switch (optc) {
|
||||
case 'a':
|
||||
ip_addr = (char *) strdup(optarg) ;
|
||||
break;
|
||||
case 'v':
|
||||
verbose = 1 ;
|
||||
break;
|
||||
case 'e':
|
||||
use_select = 1 ;
|
||||
break;
|
||||
case 's':
|
||||
subnet_addr = atoi(optarg) ;
|
||||
|
||||
if(subnet_addr < 0 && subnet_addr > 15) {
|
||||
printf("Subnet address must be between 0 and 15\n") ;
|
||||
exit(1) ;
|
||||
}
|
||||
break ;
|
||||
case 'd':
|
||||
delay = atoi(optarg) ;
|
||||
break ;
|
||||
case 'p':
|
||||
port_addr = atoi(optarg) ;
|
||||
|
||||
if(port_addr < 0 && port_addr > 15) {
|
||||
printf("Port address must be between 0 and 15\n") ;
|
||||
exit(1) ;
|
||||
}
|
||||
break ;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
node = artnet_new(ip_addr, verbose) ; ;
|
||||
|
||||
artnet_set_short_name(node, "Artnet -> DMX ") ;
|
||||
artnet_set_long_name(node, "ArtNet Flood RX") ;
|
||||
artnet_set_node_type(node, ARTNET_NODE) ;
|
||||
|
||||
// set the first port to input dmx data
|
||||
artnet_set_port_type(node, 0, ARTNET_ENABLE_INPUT, ARTNET_PORT_DMX) ;
|
||||
artnet_set_subnet_addr(node, subnet_addr) ;
|
||||
|
||||
// set the universe address of the first port
|
||||
artnet_set_port_addr(node, 0, ARTNET_INPUT_PORT, port_addr) ;
|
||||
artnet_start(node) ;
|
||||
|
||||
sd = artnet_get_sd(node) ;
|
||||
|
||||
if(use_select) {
|
||||
while(1) {
|
||||
FD_ZERO(&rset) ;
|
||||
FD_SET(sd, &rset) ;
|
||||
|
||||
tv.tv_usec = delay ;
|
||||
tv.tv_sec = 0 ;
|
||||
|
||||
maxsd = sd ;
|
||||
|
||||
switch ( select( maxsd+1, &rset, NULL, NULL, &tv ) ) {
|
||||
case 0:
|
||||
artnet_send_dmx(node,0, ARTNET_DMX_LENGTH, data) ;
|
||||
artnet_send_dmx(node,0, ARTNET_DMX_LENGTH, data) ;
|
||||
artnet_send_dmx(node,0, ARTNET_DMX_LENGTH, data) ;
|
||||
artnet_send_dmx(node,0, ARTNET_DMX_LENGTH, data) ;
|
||||
|
||||
break ;
|
||||
case -1:
|
||||
printf("select error\n") ;
|
||||
break ;
|
||||
default:
|
||||
artnet_read(node,0) ;
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
||||
// sched_setscheduler(0, )
|
||||
|
||||
while(1) {
|
||||
ts.tv_nsec = delay ;
|
||||
ts.tv_sec = 0 ;
|
||||
artnet_send_dmx(node,0, ARTNET_DMX_LENGTH, data) ;
|
||||
|
||||
artnet_read(node,0) ;
|
||||
artnet_send_dmx(node,0, ARTNET_DMX_LENGTH, data) ;
|
||||
|
||||
nanosleep(&ts, NULL) ;
|
||||
artnet_send_dmx(node,0, ARTNET_DMX_LENGTH, data) ;
|
||||
artnet_send_dmx(node,0, ARTNET_DMX_LENGTH, data) ;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
return 0 ;
|
||||
}
|
|
@ -0,0 +1,148 @@
|
|||
/*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include <string.h>
|
||||
#include <fcntl.h>
|
||||
|
||||
#include <artnet/artnet.h>
|
||||
#include <artnet/packets.h>
|
||||
|
||||
|
||||
int8_t buff[ARTNET_DMX_LENGTH +1];
|
||||
int length;
|
||||
int verbose = 0;
|
||||
|
||||
|
||||
int dmx_callback(artnet_node n, int port, void *d) {
|
||||
uint8_t *data;
|
||||
|
||||
data = artnet_read_dmx(n, port, &length);
|
||||
memset(buff, 0x00, ARTNET_DMX_LENGTH+1);
|
||||
memcpy(&buff[1], data, length);
|
||||
|
||||
printf("got dmx on port %i\n", artnet_get_universe_addr(n, port, ARTNET_OUTPUT_PORT) );
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
artnet_node node1, node2;
|
||||
char *ip_addr = NULL;
|
||||
int i, optc, subnet_addr = 0, port_addr = 0;
|
||||
int sd, maxsd;
|
||||
fd_set rset;
|
||||
struct timeval tv;
|
||||
|
||||
// parse options
|
||||
while ((optc = getopt (argc, argv, "s:p:a:v")) != EOF) {
|
||||
switch (optc) {
|
||||
case 'a':
|
||||
ip_addr = (char *) strdup(optarg);
|
||||
break;
|
||||
case 'v':
|
||||
verbose = 1;
|
||||
break;
|
||||
case 's':
|
||||
subnet_addr = atoi(optarg);
|
||||
|
||||
if(subnet_addr < 0 && subnet_addr > 15) {
|
||||
printf("Subnet address must be between 0 and 15\n");
|
||||
exit(1);
|
||||
}
|
||||
break;
|
||||
case 'p':
|
||||
port_addr = atoi(optarg);
|
||||
|
||||
if(port_addr < 0 && port_addr > 15) {
|
||||
printf("Port address must be between 0 and 15\n");
|
||||
exit(1);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
node1 = artnet_new(ip_addr, verbose);;
|
||||
node2 = artnet_new("192.168.0.100", verbose);;
|
||||
// node2 = artnet_new("192.168.0.101", verbose);;
|
||||
|
||||
artnet_join(node1, node2);
|
||||
|
||||
artnet_set_short_name(node1, "Artnet -> DMX (1)");
|
||||
artnet_set_long_name(node1, "ArtNet to DMX convertor");
|
||||
artnet_set_node_type(node1, ARTNET_NODE);
|
||||
artnet_set_dmx_handler(node1, dmx_callback, NULL);
|
||||
|
||||
artnet_set_short_name(node2, "Artnet -> DMX (2)");
|
||||
artnet_set_long_name(node2, "ArtNet to DMX convertor");
|
||||
artnet_set_node_type(node2, ARTNET_NODE);
|
||||
artnet_set_dmx_handler(node2, dmx_callback, NULL);
|
||||
|
||||
// set the first port to output dmx data
|
||||
for(i=0; i< 9; i++) {
|
||||
if(i < 5) {
|
||||
artnet_set_port_addr(node1, i%4, ARTNET_OUTPUT_PORT, i);
|
||||
artnet_set_subnet_addr(node1, subnet_addr);
|
||||
} else {
|
||||
artnet_set_subnet_addr(node2, subnet_addr);
|
||||
artnet_set_port_addr(node2, i%4, ARTNET_OUTPUT_PORT, i);
|
||||
}
|
||||
}
|
||||
|
||||
// we need to share sd[1] to node2 here
|
||||
artnet_start(node1);
|
||||
artnet_start(node2);
|
||||
|
||||
sd = artnet_get_sd(node1);
|
||||
maxsd = sd;
|
||||
|
||||
while(1) {
|
||||
FD_ZERO(&rset);
|
||||
FD_SET(sd, &rset);
|
||||
|
||||
tv.tv_usec = 0;
|
||||
tv.tv_sec = 1;
|
||||
|
||||
switch (select( maxsd+1, &rset, NULL, NULL, &tv ) ) {
|
||||
case 0:
|
||||
// timeout
|
||||
break;
|
||||
case -1:
|
||||
printf("select error\n");
|
||||
break;
|
||||
default:
|
||||
|
||||
// these are the same descriptors anyway
|
||||
if(FD_ISSET(sd, &rset) ) {
|
||||
artnet_read(node1, 0);
|
||||
} else {
|
||||
printf("random!!!\n");
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
return 0;
|
||||
}
|
|
@ -0,0 +1,96 @@
|
|||
/*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include <string.h>
|
||||
#include <fcntl.h>
|
||||
|
||||
#include <artnet/artnet.h>
|
||||
|
||||
|
||||
int verbose = 0;
|
||||
|
||||
int dmx_callback(artnet_node n, int port, void *d) {
|
||||
|
||||
if(verbose)
|
||||
printf("got data\n") ;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
artnet_node node ;
|
||||
char *ip_addr = NULL ;
|
||||
int optc, subnet_addr = 0, port_addr = 0 ;
|
||||
|
||||
// parse options
|
||||
while ((optc = getopt (argc, argv, "s:p:a:v")) != EOF) {
|
||||
switch (optc) {
|
||||
case 'a':
|
||||
ip_addr = (char *) strdup(optarg) ;
|
||||
break;
|
||||
case 'v':
|
||||
verbose = 1 ;
|
||||
break;
|
||||
case 's':
|
||||
subnet_addr = atoi(optarg) ;
|
||||
|
||||
if(subnet_addr < 0 && subnet_addr > 15) {
|
||||
printf("Subnet address must be between 0 and 15\n") ;
|
||||
exit(1) ;
|
||||
}
|
||||
break ;
|
||||
case 'p':
|
||||
port_addr = atoi(optarg) ;
|
||||
|
||||
if(port_addr < 0 && port_addr > 15) {
|
||||
printf("Port address must be between 0 and 15\n") ;
|
||||
exit(1) ;
|
||||
}
|
||||
break ;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
node = artnet_new(ip_addr, verbose) ; ;
|
||||
|
||||
artnet_set_short_name(node, "Artnet -> DMX ") ;
|
||||
artnet_set_long_name(node, "ArtNet to DMX convertor") ;
|
||||
artnet_set_node_type(node, ARTNET_NODE) ;
|
||||
artnet_set_dmx_handler(node, dmx_callback, NULL) ;
|
||||
|
||||
// set the first port to output dmx data
|
||||
artnet_set_port_type(node, 0, ARTNET_ENABLE_OUTPUT, ARTNET_PORT_DMX) ;
|
||||
artnet_set_subnet_addr(node, subnet_addr) ;
|
||||
|
||||
// set the universe address of the first port
|
||||
artnet_set_port_addr(node, 0, ARTNET_OUTPUT_PORT, port_addr) ;
|
||||
artnet_start(node) ;
|
||||
|
||||
while(1) {
|
||||
artnet_read(node, 1) ;
|
||||
}
|
||||
|
||||
return 0 ;
|
||||
}
|
|
@ -0,0 +1,122 @@
|
|||
/*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include <string.h>
|
||||
#include <time.h>
|
||||
#include <sched.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <artnet/artnet.h>
|
||||
|
||||
int verbose = 0;
|
||||
|
||||
int delay = 25000;
|
||||
|
||||
|
||||
#include <sys/select.h>
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
artnet_node node ;
|
||||
char *ip_addr = NULL ;
|
||||
int optc, subnet_addr = 0, port_numb= 0, i ;
|
||||
uint8_t data[ARTNET_DMX_LENGTH] ;
|
||||
struct timeval tv;
|
||||
int sd, maxsd ;
|
||||
fd_set rset;
|
||||
|
||||
// parse options
|
||||
while ((optc = getopt (argc, argv, "s:p:d:a:ve")) != EOF) {
|
||||
switch (optc) {
|
||||
case 'a':
|
||||
ip_addr = (char *) strdup(optarg) ;
|
||||
break;
|
||||
case 'v':
|
||||
verbose = 1 ;
|
||||
break;
|
||||
case 's':
|
||||
subnet_addr = atoi(optarg) ;
|
||||
|
||||
if(subnet_addr < 0 && subnet_addr > 15) {
|
||||
printf("Subnet address must be between 0 and 15\n") ;
|
||||
exit(1) ;
|
||||
}
|
||||
break ;
|
||||
case 'd':
|
||||
delay = atoi(optarg) ;
|
||||
break ;
|
||||
case 'p':
|
||||
port_numb = atoi(optarg) ;
|
||||
|
||||
if(port_numb < 0 && port_numb > 255) {
|
||||
printf("Port address must be between 0 and 255\n") ;
|
||||
exit(1) ;
|
||||
}
|
||||
break ;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
node = artnet_new(ip_addr, verbose) ; ;
|
||||
|
||||
artnet_set_short_name(node, "Artnet Tester") ;
|
||||
artnet_set_long_name(node, "ArtNet Test TX") ;
|
||||
artnet_set_node_type(node, ARTNET_RAW) ;
|
||||
|
||||
// set the first port to input dmx data
|
||||
artnet_set_port_type(node, 0, ARTNET_ENABLE_INPUT, ARTNET_PORT_DMX) ;
|
||||
artnet_set_subnet_addr(node, subnet_addr) ;
|
||||
|
||||
// set the universe address of the first port
|
||||
artnet_start(node) ;
|
||||
|
||||
artnet_send_poll(node, NULL, ARTNET_TTM_DEFAULT) ;
|
||||
|
||||
sd = artnet_get_sd(node) ;
|
||||
|
||||
while(1) {
|
||||
FD_ZERO(&rset) ;
|
||||
FD_SET(sd, &rset) ;
|
||||
|
||||
tv.tv_usec = delay ;
|
||||
tv.tv_sec = 0 ;
|
||||
|
||||
maxsd = sd ;
|
||||
|
||||
switch ( select( maxsd+1, &rset, NULL, NULL, &tv ) ) {
|
||||
case 0:
|
||||
for(i=0 ; i < port_numb; i++) {
|
||||
// printf("sending dmx %i\n", i) ;
|
||||
artnet_raw_send_dmx(node,i, ARTNET_DMX_LENGTH, data) ;
|
||||
}
|
||||
break ;
|
||||
case -1:
|
||||
printf("select error\n") ;
|
||||
break ;
|
||||
default:
|
||||
artnet_read(node,0) ;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return 0 ;
|
||||
}
|
|
@ -0,0 +1,155 @@
|
|||
/*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include <string.h>
|
||||
#include <time.h>
|
||||
|
||||
#include <stdint.h>
|
||||
#include <artnet/artnet.h>
|
||||
|
||||
#define UID_WIDTH 6
|
||||
|
||||
#define UID_COUNT 198
|
||||
int verbose = 0 ;
|
||||
|
||||
|
||||
uint8_t *generate_rdm_tod(int count, int iteration) {
|
||||
uint8_t *ptr = malloc(count * UID_WIDTH) ;
|
||||
int i ;
|
||||
|
||||
if(ptr == NULL) {
|
||||
printf("malloc failed\n") ;
|
||||
exit(1) ;
|
||||
}
|
||||
|
||||
memset(ptr, 0x00, UID_WIDTH * count ) ;
|
||||
for(i = 0 ; i < count; i++) {
|
||||
ptr[i * UID_WIDTH +5] = i ;
|
||||
ptr[i * UID_WIDTH +4] = iteration ;
|
||||
}
|
||||
|
||||
return ptr;
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
* this is hell dodgy, i can't find the rdm spec so I don't know much about the packet structure
|
||||
* looking at AL's header files it looks like a RDM packet it 278 bytes. 512 bytes have been allocated
|
||||
*
|
||||
* In summary: it's up to you to decode the rdm packet and deal with it.
|
||||
*
|
||||
* TODO: helper library for rdm (grab the spec from ...?)
|
||||
*
|
||||
*/
|
||||
int rdm_handler(artnet_node n, int address, uint8_t *rdm, int length, void *d) {
|
||||
|
||||
printf("got rdm data for address %d, of length %d\n", address, length) ;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int rdm_initiate(artnet_node n, int port, void *d) {
|
||||
uint8_t *tod ;
|
||||
int *count = (int*) d ;
|
||||
uint8_t uid[UID_WIDTH] ;
|
||||
|
||||
memset(uid, 0x00, UID_WIDTH) ;
|
||||
|
||||
tod = generate_rdm_tod(UID_COUNT, *count) ;
|
||||
artnet_add_rdm_devices(n, 0, tod, UID_COUNT) ;
|
||||
free(tod) ;
|
||||
|
||||
uid[5] = 0xFF ;
|
||||
uid[4] = *count ;
|
||||
artnet_add_rdm_device(n,0, uid) ;
|
||||
|
||||
uid[5] = 0x03 ;
|
||||
artnet_remove_rdm_device(n,0, uid) ;
|
||||
|
||||
uid[5] = 0x06 ;
|
||||
artnet_remove_rdm_device(n,0, uid) ;
|
||||
|
||||
(*count)++ ;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
artnet_node node ;
|
||||
char *ip_addr = NULL ;
|
||||
int optc ;
|
||||
uint8_t *tod ;
|
||||
int tod_refreshes = 0 ;
|
||||
|
||||
// parse options
|
||||
while ((optc = getopt (argc, argv, "va:")) != EOF) {
|
||||
switch (optc) {
|
||||
case 'a':
|
||||
ip_addr = (char *) strdup(optarg) ;
|
||||
break;
|
||||
case 'v':
|
||||
verbose = 1 ;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
node = artnet_new(ip_addr, verbose) ; ;
|
||||
|
||||
artnet_set_short_name(node, "artnet-rdm") ;
|
||||
artnet_set_long_name(node, "ArtNet RDM Test, Output Node") ;
|
||||
artnet_set_node_type(node, ARTNET_NODE) ;
|
||||
|
||||
// set the first port to output dmx data
|
||||
artnet_set_port_type(node, 0, ARTNET_ENABLE_OUTPUT, ARTNET_PORT_DMX) ;
|
||||
artnet_set_subnet_addr(node, 0x00) ;
|
||||
|
||||
// set the universe address of the first port
|
||||
artnet_set_port_addr(node, 0, ARTNET_OUTPUT_PORT, 0x00) ;
|
||||
|
||||
// set poll reply handler
|
||||
// artnet_set_handler(node, ARTNET_REPLY_HANDLER, reply_handler, NULL)
|
||||
artnet_set_rdm_initiate_handler(node, rdm_initiate , &tod_refreshes ) ;
|
||||
artnet_set_rdm_handler(node, rdm_handler, NULL ) ;
|
||||
|
||||
|
||||
tod = generate_rdm_tod(UID_COUNT, tod_refreshes++) ;
|
||||
artnet_add_rdm_devices(node, 0, tod, UID_COUNT) ;
|
||||
|
||||
|
||||
artnet_start(node) ;
|
||||
|
||||
artnet_send_tod_control(node, 0x10, ARTNET_TOD_FLUSH) ;
|
||||
artnet_send_rdm(node, 0x00 , tod, UID_COUNT* UID_WIDTH) ;
|
||||
free(tod) ;
|
||||
// loop until control C
|
||||
while(1) {
|
||||
artnet_read(node, 1) ;
|
||||
}
|
||||
// never reached
|
||||
artnet_destroy(node) ;
|
||||
|
||||
return 0 ;
|
||||
}
|
|
@ -0,0 +1,262 @@
|
|||
/*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
* Copyright 2004-2006 Simon Newton
|
||||
* nomis52@westnet.com.au
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include <string.h>
|
||||
#include <fcntl.h>
|
||||
#include <sys/wait.h>
|
||||
#include <sys/time.h>
|
||||
#include <time.h>
|
||||
#include <getopt.h>
|
||||
#include <errno.h>
|
||||
#include <artnet/artnet.h>
|
||||
|
||||
char SHORT_NAME[] = "ArtNet Node";
|
||||
char LONG_NAME[] = "libartnet setdmx example";
|
||||
|
||||
|
||||
typedef struct {
|
||||
int verbose;
|
||||
int help;
|
||||
char *ip_addr;
|
||||
int port_addr;
|
||||
int channel;
|
||||
int value;
|
||||
float fade_time;
|
||||
} opts_t;
|
||||
|
||||
|
||||
/*
|
||||
* Set our default options, command line args will overide this
|
||||
*/
|
||||
void init_ops(opts_t *ops) {
|
||||
ops->verbose = 0;
|
||||
ops->help = 0;
|
||||
ops->ip_addr = NULL;
|
||||
ops->port_addr = 0;
|
||||
ops->channel = 1;
|
||||
ops->value = 0;
|
||||
ops->fade_time = 0.0;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Parse command lines options and save in opts_s struct
|
||||
*
|
||||
*/
|
||||
void parse_args(opts_t *ops, int argc, char *argv[]) {
|
||||
|
||||
static struct option long_options[] = {
|
||||
{"address", required_argument, 0, 'a'},
|
||||
{"port", required_argument, 0, 'p'},
|
||||
{"channel", required_argument, 0, 'c'},
|
||||
{"dmx", required_argument, 0, 'd'},
|
||||
{"fade", required_argument, 0, 'f'},
|
||||
{"help", no_argument, 0, 'h'},
|
||||
{"verbose", no_argument, 0, 'v'},
|
||||
|
||||
{0, 0, 0, 0}
|
||||
};
|
||||
|
||||
int c;
|
||||
int option_index = 0;
|
||||
|
||||
while (1) {
|
||||
|
||||
c = getopt_long(argc, argv, "a:p:c:d:f:vh", long_options, &option_index);
|
||||
|
||||
if (c == -1)
|
||||
break;
|
||||
|
||||
switch (c) {
|
||||
case 0:
|
||||
break;
|
||||
case 'a':
|
||||
ops->ip_addr = (char *) strdup(optarg);
|
||||
break;
|
||||
case 'd':
|
||||
ops->value = atoi(optarg);
|
||||
break;
|
||||
case 'c':
|
||||
ops->channel = atoi(optarg);
|
||||
break;
|
||||
case 'p':
|
||||
ops->port_addr = atoi(optarg);
|
||||
break;
|
||||
case 'f':
|
||||
ops->fade_time = atof(optarg);
|
||||
break;
|
||||
case 'h':
|
||||
ops->help = 1;
|
||||
break;
|
||||
case 'v':
|
||||
ops->verbose = 1;
|
||||
break;
|
||||
|
||||
case '?':
|
||||
break;
|
||||
|
||||
default:
|
||||
;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
*
|
||||
*
|
||||
*/
|
||||
void display_help_and_exit(opts_t *ops, char *argv[]) {
|
||||
printf(
|
||||
"Usage: %s --address <ip_address> --port <port_no> --channel <channel> --dmx <dmx_value> --fade <fade_time> \n"
|
||||
"\n"
|
||||
"Control lla port <-> universe mappings.\n"
|
||||
"\n"
|
||||
" -a, --address <ip_address> Address to send from.\n"
|
||||
" -c, --channel <channel> Channel to set (starts from 0).\n"
|
||||
" -d, --dmx <value> Value to set the channel to.\n"
|
||||
" -h, --help Display this help message and exit.\n"
|
||||
" -f, --fade <fade_time> Total time of fade.\n"
|
||||
" -p, --port <port_no> Universe (port) address.\n"
|
||||
" -v, --verbose Be verbose.\n"
|
||||
"\n",
|
||||
argv[0] );
|
||||
exit(0);
|
||||
}
|
||||
|
||||
void msleep(long time) {
|
||||
struct timespec ts;
|
||||
ts.tv_sec = 0;
|
||||
ts.tv_nsec = 1000000*time;
|
||||
nanosleep(&ts, NULL);
|
||||
}
|
||||
|
||||
// returns the time in milliseconds
|
||||
unsigned long timeGetTime() {
|
||||
struct timeval tv;
|
||||
gettimeofday(&tv, NULL);
|
||||
return (unsigned long)tv.tv_sec*1000UL+ (unsigned long)tv.tv_usec/1000;
|
||||
}
|
||||
|
||||
/*
|
||||
*
|
||||
*
|
||||
*/
|
||||
int do_fade(artnet_node node, opts_t *ops) {
|
||||
int chan = ops->channel;
|
||||
float fadetime = ops->fade_time;
|
||||
int val = ops->value;
|
||||
uint8_t dmx[chan];
|
||||
float p;
|
||||
|
||||
memset(dmx, 0x00, chan);
|
||||
|
||||
chan--;
|
||||
|
||||
artnet_send_dmx(node, 0, chan, dmx);
|
||||
msleep(40);
|
||||
|
||||
const unsigned long tstart=timeGetTime();
|
||||
const unsigned long tend=tstart+(int)(fadetime*1000.0);
|
||||
unsigned long t=tstart;
|
||||
|
||||
while (t<=tend) {
|
||||
t=timeGetTime();
|
||||
|
||||
if (fadetime)
|
||||
p = (float)(t-tstart)/1000.0f/fadetime;
|
||||
else
|
||||
p = 1.0;
|
||||
|
||||
dmx[chan]=(int)(float)val*p;
|
||||
|
||||
msleep(40);
|
||||
// printf("%f %i %i %f %li\n", p, chan, dmx[chan] , fadetime, t-tstart);
|
||||
|
||||
// we have to call raw_send here as it sends a sequence number of 0
|
||||
// otherwise each execution of artnet_setdmx starts the sequence from 0
|
||||
// which confuses some devices
|
||||
if (artnet_raw_send_dmx(node, ops->port_addr , chan+1, dmx)) {
|
||||
printf("failed to send: %s\n", artnet_strerror() );
|
||||
}
|
||||
|
||||
t=timeGetTime(); // get current time, because the last time is too old (due to the sleep)
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
opts_t ops;
|
||||
artnet_node node;
|
||||
|
||||
// init and parse the args
|
||||
init_ops(&ops);
|
||||
parse_args(&ops, argc, argv);
|
||||
|
||||
// do some checks
|
||||
if (ops.help)
|
||||
display_help_and_exit(&ops, argv);
|
||||
|
||||
if (ops.channel < 1 || ops.channel > 512)
|
||||
display_help_and_exit(&ops, argv);
|
||||
|
||||
if (ops.value < 0 || ops.value > 255)
|
||||
display_help_and_exit(&ops, argv);
|
||||
|
||||
if (ops.port_addr < 0 || ops.port_addr > 4)
|
||||
display_help_and_exit(&ops, argv);
|
||||
|
||||
// create new artnet node, and set config values
|
||||
node = artnet_new(ops.ip_addr, ops.verbose);;
|
||||
|
||||
artnet_set_short_name(node, SHORT_NAME);
|
||||
artnet_set_long_name(node, LONG_NAME);
|
||||
artnet_set_node_type(node, ARTNET_RAW);
|
||||
|
||||
artnet_set_port_type(node, 0, ARTNET_ENABLE_INPUT, ARTNET_PORT_DMX);
|
||||
artnet_set_port_addr(node, 0, ARTNET_INPUT_PORT, ops.port_addr);
|
||||
|
||||
if (artnet_start(node) != ARTNET_EOK) {
|
||||
printf("Failed to start: %s\n", artnet_strerror() );
|
||||
goto error_destroy;
|
||||
}
|
||||
|
||||
printf("channel is %i\n", ops.channel);
|
||||
do_fade(node, &ops);
|
||||
|
||||
return 0;
|
||||
|
||||
error_destroy :
|
||||
artnet_destroy(node);
|
||||
|
||||
free(ops.ip_addr);
|
||||
exit(1);
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,419 @@
|
|||
/*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
* Copyright 2004-2005 Simon Newton
|
||||
* nomis52@westnet.com.au
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include <string.h>
|
||||
#include <fcntl.h>
|
||||
#include <sys/wait.h>
|
||||
#include <sys/time.h>
|
||||
#include <time.h>
|
||||
#include <pthread.h>
|
||||
#include <errno.h>
|
||||
#include <artnet/artnet.h>
|
||||
|
||||
#define DEFAULT_DEVICE "/dev/dmx0"
|
||||
#define DEFAULT_DEVICE2 "/dev/dmx1"
|
||||
#define DEFAULT_DEVICE3 "/dev/dmx2"
|
||||
#define DEFAULT_DEVICE4 "/dev/dmx3"
|
||||
|
||||
#define UNCONNECTED -1
|
||||
#define SHORT_NAME "NWAN"
|
||||
#define LONG_NAME "Netgear Wireless Artnet Node"
|
||||
|
||||
|
||||
typedef struct {
|
||||
int verbose ;
|
||||
char *dev[ARTNET_MAX_PORTS];
|
||||
char *ip_addr ;
|
||||
int subnet_addr ;
|
||||
int port_addr ;
|
||||
int persist ;
|
||||
int num_ports;
|
||||
int fd[ARTNET_MAX_PORTS] ;
|
||||
uint8_t dmx[ARTNET_MAX_PORTS][ARTNET_DMX_LENGTH +1] ;
|
||||
char *short_name ;
|
||||
char *long_name ;
|
||||
char *config_file ;
|
||||
} opts_t;
|
||||
|
||||
typedef struct {
|
||||
opts_t *ops ;
|
||||
int port_id ;
|
||||
} thread_args_t ;
|
||||
|
||||
|
||||
pthread_mutex_t mem_mutex = PTHREAD_MUTEX_INITIALIZER ;
|
||||
|
||||
int do_write(opts_t *ops, int pid, uint8_t *buf, int length) {
|
||||
int res ;
|
||||
|
||||
res = write(ops->fd[pid], buf, length);
|
||||
|
||||
if (res < 0){
|
||||
/* if you unplug devices from the dongle
|
||||
*/
|
||||
if(ops->verbose)
|
||||
perror("Error writing to device");
|
||||
|
||||
res = close(ops->fd[pid]) ;
|
||||
if(res < 0)
|
||||
perror("close ") ;
|
||||
else
|
||||
ops->fd[pid] = UNCONNECTED ;
|
||||
|
||||
return -1 ;
|
||||
}
|
||||
|
||||
if(res > 0 && ops->verbose)
|
||||
printf("p%d: 0x%02hhx, 0x%02hhx, 0x%02hhx, 0x%02hhx length %d\n", pid, buf[1], buf[2], buf[3], buf[4] , length) ;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
void *thread_run(void *arg) {
|
||||
thread_args_t *args = (thread_args_t*) arg ;
|
||||
uint8_t buf[ARTNET_DMX_LENGTH+1] ;
|
||||
int *pid = &args->port_id ;
|
||||
|
||||
// int len ;
|
||||
|
||||
args->ops->fd[*pid] = open(args->ops->dev[*pid],O_WRONLY) ;
|
||||
|
||||
while(1) {
|
||||
|
||||
if(args->ops->fd[*pid] == UNCONNECTED) {
|
||||
sleep(1) ;
|
||||
|
||||
args->ops->fd[*pid] = open(args->ops->dev[*pid],O_WRONLY) ;
|
||||
|
||||
if(args->ops->fd[*pid] == -1 && args->ops->verbose)
|
||||
printf("open %s: %s\n",args->ops->dev[*pid], strerror(errno) ) ;
|
||||
|
||||
} else {
|
||||
pthread_mutex_lock(&mem_mutex) ;
|
||||
memcpy(buf, args->ops->dmx[*pid], ARTNET_DMX_LENGTH+1) ;
|
||||
pthread_mutex_unlock(&mem_mutex) ;
|
||||
|
||||
do_write(args->ops, *pid, buf, ARTNET_DMX_LENGTH+1) ;
|
||||
// sleep(1) ;
|
||||
}
|
||||
}
|
||||
|
||||
/* for(i = 513; i >=0; i--) {
|
||||
if(buff[i] != buf[i])
|
||||
break ;
|
||||
}
|
||||
|
||||
if(i>0) {
|
||||
*/
|
||||
return NULL ;
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
* Called when we have dmx data pending
|
||||
*/
|
||||
int dmx_handler(artnet_node n, int port, void *d) {
|
||||
uint8_t *data ;
|
||||
opts_t *ops = (opts_t *) d ;
|
||||
int len ;
|
||||
|
||||
if(port < ops->num_ports) {
|
||||
data = artnet_read_dmx(n, port, &len) ;
|
||||
pthread_mutex_lock(&mem_mutex) ;
|
||||
memcpy(&ops->dmx[port][1], data, len) ;
|
||||
pthread_mutex_unlock(&mem_mutex) ;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* saves the settings to the config file
|
||||
*/
|
||||
int save_config(opts_t *ops) {
|
||||
FILE *fh ;
|
||||
printf("in save config\n") ;
|
||||
if ((fh = fopen(ops->config_file, "w")) == NULL ) {
|
||||
perror("fopen") ;
|
||||
return -1 ;
|
||||
}
|
||||
|
||||
fprintf(fh, "# artnet_usb config file\n") ;
|
||||
fprintf(fh, "Shortname=%s\n", ops->short_name) ;
|
||||
fprintf(fh, "Longname=%s\n", ops->long_name) ;
|
||||
fprintf(fh, "Subnet=%i\n", ops->subnet_addr) ;
|
||||
fprintf(fh, "Port=%i\n", ops->port_addr);
|
||||
|
||||
fclose(fh) ;
|
||||
|
||||
return 0 ;
|
||||
}
|
||||
|
||||
/*
|
||||
* Load the settings from config file
|
||||
*/
|
||||
int load_config(opts_t *ops) {
|
||||
#define BUF_SIZE 1024
|
||||
FILE *fh ;
|
||||
char buf[1024], *c ;
|
||||
char *key, *data ;
|
||||
|
||||
if(ops->config_file == NULL)
|
||||
return -1;
|
||||
|
||||
if ((fh = fopen(ops->config_file, "r")) == NULL ) {
|
||||
perror("fopen") ;
|
||||
return -1 ;
|
||||
}
|
||||
|
||||
while ( fgets(buf, 1024, fh) != NULL) {
|
||||
if(*buf == '#')
|
||||
continue ;
|
||||
|
||||
// strip \n
|
||||
for(c = buf ; *c != '\n' ; c++) ;
|
||||
*c = '\0' ;
|
||||
|
||||
key = strtok(buf, "=") ;
|
||||
data = strtok(NULL, "=") ;
|
||||
|
||||
if(key == NULL || data == NULL)
|
||||
continue ;
|
||||
|
||||
if(strcmp(key, "Shortname") == 0) {
|
||||
free(ops->short_name) ;
|
||||
ops->short_name = strdup(data) ;
|
||||
} else if(strcmp(key, "Longname") == 0) {
|
||||
free(ops->long_name) ;
|
||||
ops->long_name = strdup(data) ;
|
||||
} else if(strcmp(key, "Subnet") == 0) {
|
||||
ops->subnet_addr = atoi(data) ;
|
||||
} else if(strcmp(key, "Port") == 0 ) {
|
||||
ops->port_addr = atoi(data) ;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
fclose(fh) ;
|
||||
return 0 ;
|
||||
}
|
||||
|
||||
/*
|
||||
* called when to node configuration changes,
|
||||
* we need to save the configuration to a file
|
||||
*/
|
||||
int program_handler(artnet_node n, void *d) {
|
||||
opts_t *ops = (opts_t*) d ;
|
||||
artnet_node_config_t config ;
|
||||
|
||||
artnet_get_config(n, &config) ;
|
||||
|
||||
free(ops->short_name) ;
|
||||
free(ops->long_name) ;
|
||||
|
||||
ops->short_name = strdup(config.short_name) ;
|
||||
ops->long_name = strdup(config.long_name) ;
|
||||
ops->subnet_addr = config.subnet ;
|
||||
ops->port_addr = config.out_ports[0] ;
|
||||
|
||||
save_config(ops) ;
|
||||
return 0 ;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Main function
|
||||
*
|
||||
*/
|
||||
int run(opts_t *ops) {
|
||||
artnet_node node ;
|
||||
pthread_t tid[ARTNET_MAX_PORTS] ;
|
||||
thread_args_t targ[ARTNET_MAX_PORTS] ;
|
||||
int i ;
|
||||
|
||||
load_config(ops) ;
|
||||
|
||||
// create new artnet node, and set config values
|
||||
node = artnet_new(ops->ip_addr, ops->verbose) ; ;
|
||||
|
||||
artnet_set_short_name(node, ops->short_name) ;
|
||||
artnet_set_long_name(node, ops->long_name) ;
|
||||
artnet_set_node_type(node, ARTNET_NODE) ;
|
||||
|
||||
artnet_set_subnet_addr(node, ops->subnet_addr) ;
|
||||
|
||||
// we want to be notified when the node config changes
|
||||
artnet_set_program_handler(node, program_handler, (void*) ops) ;
|
||||
artnet_set_dmx_handler(node, dmx_handler, (void*) ops) ;
|
||||
|
||||
for(i=0; i < ops->num_ports ; i++) {
|
||||
// set the first port to output dmx data
|
||||
artnet_set_port_type(node, i, ARTNET_ENABLE_OUTPUT, ARTNET_PORT_DMX) ;
|
||||
|
||||
// set the universe address of the first port
|
||||
artnet_set_port_addr(node, i, ARTNET_OUTPUT_PORT, ops->port_addr+i) ;
|
||||
|
||||
targ[i].ops = ops ;
|
||||
targ[i].port_id = i ;
|
||||
|
||||
if( pthread_create(&tid[i], NULL, &thread_run, (void*) &targ[i]) ) {
|
||||
printf("pthread failed\n") ;
|
||||
}
|
||||
}
|
||||
|
||||
artnet_start(node) ;
|
||||
|
||||
while(1) {
|
||||
// set a 1 second timeout on the read
|
||||
// this way we send a DMX frame every second
|
||||
// even if we don't get any ArtNet packets
|
||||
artnet_read(node, 1) ;
|
||||
|
||||
}
|
||||
|
||||
return 0 ;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Set our default options, command line args will overide this
|
||||
*/
|
||||
void init_ops(opts_t *ops) {
|
||||
int i ;
|
||||
|
||||
ops->verbose = 0;
|
||||
|
||||
ops->ip_addr = NULL ;
|
||||
ops->subnet_addr = 0 ;
|
||||
ops->port_addr = 0 ;
|
||||
ops->persist = 0;
|
||||
ops->num_ports = 1;
|
||||
|
||||
for(i=0; i < ARTNET_MAX_PORTS; i++) {
|
||||
ops->fd[i] = UNCONNECTED ;
|
||||
memset(ops->dmx[i], 0x00, ARTNET_DMX_LENGTH+1) ;
|
||||
}
|
||||
// dodgy but saves using vasprintf
|
||||
ops->dev[0] = strdup(DEFAULT_DEVICE) ;
|
||||
ops->dev[1] = strdup(DEFAULT_DEVICE2) ;
|
||||
ops->dev[2] = strdup(DEFAULT_DEVICE3) ;
|
||||
ops->dev[3] = strdup(DEFAULT_DEVICE4) ;
|
||||
|
||||
ops->short_name = strdup(SHORT_NAME) ;
|
||||
ops->long_name = strdup(LONG_NAME) ;
|
||||
ops->config_file = NULL ;
|
||||
}
|
||||
|
||||
/*
|
||||
* Parse command lines options and save in opts_s struct
|
||||
*
|
||||
*/
|
||||
void parse_args(opts_t *ops, int argc, char *argv[]) {
|
||||
// parse args
|
||||
int optc, port_addr, subnet_addr, num_ports ;
|
||||
|
||||
// parse options
|
||||
while ((optc = getopt (argc, argv, "c:s:p:d:a:vn:z")) != EOF) {
|
||||
switch (optc) {
|
||||
case 'a':
|
||||
free(ops->ip_addr) ;
|
||||
ops->ip_addr = (char *) strdup(optarg) ;
|
||||
break;
|
||||
case 'c':
|
||||
free(ops->config_file) ;
|
||||
ops->config_file = (char *) strdup(optarg) ;
|
||||
break;
|
||||
case 'v':
|
||||
ops->verbose = 1 ;
|
||||
break;
|
||||
case 'd':
|
||||
free(ops->dev) ;
|
||||
ops->dev[0] = (char *) strdup(optarg) ;
|
||||
break;
|
||||
case 's':
|
||||
subnet_addr = atoi(optarg) ;
|
||||
|
||||
if(subnet_addr < 0 && subnet_addr > 15)
|
||||
printf("Subnet address must be between 0 and 15\n") ;
|
||||
else
|
||||
ops->subnet_addr = subnet_addr ;
|
||||
break ;
|
||||
case 'n':
|
||||
num_ports = atoi(optarg) ;
|
||||
|
||||
if(num_ports < 1 || num_ports > ARTNET_MAX_PORTS) {
|
||||
printf("number of ports must be between 1 and %d\n", ARTNET_MAX_PORTS) ;
|
||||
} else
|
||||
ops->num_ports = num_ports ;
|
||||
break ;
|
||||
case 'p':
|
||||
port_addr = atoi(optarg) ;
|
||||
|
||||
if(port_addr < 0 && port_addr > 15)
|
||||
printf("Port address must be between 0 and 15\n") ;
|
||||
else
|
||||
ops->port_addr = port_addr ;
|
||||
break ;
|
||||
case 'z':
|
||||
ops->persist = 1 ;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
int statloc, pid ;
|
||||
opts_t ops ;
|
||||
|
||||
init_ops(&ops) ;
|
||||
parse_args(&ops, argc, argv) ;
|
||||
|
||||
// we don't load ops here
|
||||
// else if we restart and the options have been remote
|
||||
// programed we'll have to old ones
|
||||
|
||||
if(ops.persist) {
|
||||
while(1) {
|
||||
if( (pid = fork() ) == 0) {
|
||||
// child ;
|
||||
run(&ops) ;
|
||||
exit(1) ;
|
||||
} else {
|
||||
// parent
|
||||
pid = wait(&statloc) ;
|
||||
printf("Child %i terminated, restarting\n", pid) ;
|
||||
}
|
||||
}
|
||||
} else
|
||||
run(&ops) ;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
|
||||
Author:
|
||||
|
||||
Simon Newton <nomis52@westnet.com.au>
|
||||
|
||||
Bug Reports & Patches:
|
||||
|
||||
Samuli Valo
|
||||
Justin Cormack
|
||||
nico <sl1200mk2@gmail.com> (Win32 port)
|
|
@ -0,0 +1,504 @@
|
|||
GNU LESSER GENERAL PUBLIC LICENSE
|
||||
Version 2.1, February 1999
|
||||
|
||||
Copyright (C) 1991, 1999 Free Software Foundation, Inc.
|
||||
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
[This is the first released version of the Lesser GPL. It also counts
|
||||
as the successor of the GNU Library Public License, version 2, hence
|
||||
the version number 2.1.]
|
||||
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your
|
||||
freedom to share and change it. By contrast, the GNU General Public
|
||||
Licenses are intended to guarantee your freedom to share and change
|
||||
free software--to make sure the software is free for all its users.
|
||||
|
||||
This license, the Lesser General Public License, applies to some
|
||||
specially designated software packages--typically libraries--of the
|
||||
Free Software Foundation and other authors who decide to use it. You
|
||||
can use it too, but we suggest you first think carefully about whether
|
||||
this license or the ordinary General Public License is the better
|
||||
strategy to use in any particular case, based on the explanations below.
|
||||
|
||||
When we speak of free software, we are referring to freedom of use,
|
||||
not price. Our General Public Licenses are designed to make sure that
|
||||
you have the freedom to distribute copies of free software (and charge
|
||||
for this service if you wish); that you receive source code or can get
|
||||
it if you want it; that you can change the software and use pieces of
|
||||
it in new free programs; and that you are informed that you can do
|
||||
these things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid
|
||||
distributors to deny you these rights or to ask you to surrender these
|
||||
rights. These restrictions translate to certain responsibilities for
|
||||
you if you distribute copies of the library or if you modify it.
|
||||
|
||||
For example, if you distribute copies of the library, whether gratis
|
||||
or for a fee, you must give the recipients all the rights that we gave
|
||||
you. You must make sure that they, too, receive or can get the source
|
||||
code. If you link other code with the library, you must provide
|
||||
complete object files to the recipients, so that they can relink them
|
||||
with the library after making changes to the library and recompiling
|
||||
it. And you must show them these terms so they know their rights.
|
||||
|
||||
We protect your rights with a two-step method: (1) we copyright the
|
||||
library, and (2) we offer you this license, which gives you legal
|
||||
permission to copy, distribute and/or modify the library.
|
||||
|
||||
To protect each distributor, we want to make it very clear that
|
||||
there is no warranty for the free library. Also, if the library is
|
||||
modified by someone else and passed on, the recipients should know
|
||||
that what they have is not the original version, so that the original
|
||||
author's reputation will not be affected by problems that might be
|
||||
introduced by others.
|
||||
|
||||
Finally, software patents pose a constant threat to the existence of
|
||||
any free program. We wish to make sure that a company cannot
|
||||
effectively restrict the users of a free program by obtaining a
|
||||
restrictive license from a patent holder. Therefore, we insist that
|
||||
any patent license obtained for a version of the library must be
|
||||
consistent with the full freedom of use specified in this license.
|
||||
|
||||
Most GNU software, including some libraries, is covered by the
|
||||
ordinary GNU General Public License. This license, the GNU Lesser
|
||||
General Public License, applies to certain designated libraries, and
|
||||
is quite different from the ordinary General Public License. We use
|
||||
this license for certain libraries in order to permit linking those
|
||||
libraries into non-free programs.
|
||||
|
||||
When a program is linked with a library, whether statically or using
|
||||
a shared library, the combination of the two is legally speaking a
|
||||
combined work, a derivative of the original library. The ordinary
|
||||
General Public License therefore permits such linking only if the
|
||||
entire combination fits its criteria of freedom. The Lesser General
|
||||
Public License permits more lax criteria for linking other code with
|
||||
the library.
|
||||
|
||||
We call this license the "Lesser" General Public License because it
|
||||
does Less to protect the user's freedom than the ordinary General
|
||||
Public License. It also provides other free software developers Less
|
||||
of an advantage over competing non-free programs. These disadvantages
|
||||
are the reason we use the ordinary General Public License for many
|
||||
libraries. However, the Lesser license provides advantages in certain
|
||||
special circumstances.
|
||||
|
||||
For example, on rare occasions, there may be a special need to
|
||||
encourage the widest possible use of a certain library, so that it becomes
|
||||
a de-facto standard. To achieve this, non-free programs must be
|
||||
allowed to use the library. A more frequent case is that a free
|
||||
library does the same job as widely used non-free libraries. In this
|
||||
case, there is little to gain by limiting the free library to free
|
||||
software only, so we use the Lesser General Public License.
|
||||
|
||||
In other cases, permission to use a particular library in non-free
|
||||
programs enables a greater number of people to use a large body of
|
||||
free software. For example, permission to use the GNU C Library in
|
||||
non-free programs enables many more people to use the whole GNU
|
||||
operating system, as well as its variant, the GNU/Linux operating
|
||||
system.
|
||||
|
||||
Although the Lesser General Public License is Less protective of the
|
||||
users' freedom, it does ensure that the user of a program that is
|
||||
linked with the Library has the freedom and the wherewithal to run
|
||||
that program using a modified version of the Library.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow. Pay close attention to the difference between a
|
||||
"work based on the library" and a "work that uses the library". The
|
||||
former contains code derived from the library, whereas the latter must
|
||||
be combined with the library in order to run.
|
||||
|
||||
GNU LESSER GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License Agreement applies to any software library or other
|
||||
program which contains a notice placed by the copyright holder or
|
||||
other authorized party saying it may be distributed under the terms of
|
||||
this Lesser General Public License (also called "this License").
|
||||
Each licensee is addressed as "you".
|
||||
|
||||
A "library" means a collection of software functions and/or data
|
||||
prepared so as to be conveniently linked with application programs
|
||||
(which use some of those functions and data) to form executables.
|
||||
|
||||
The "Library", below, refers to any such software library or work
|
||||
which has been distributed under these terms. A "work based on the
|
||||
Library" means either the Library or any derivative work under
|
||||
copyright law: that is to say, a work containing the Library or a
|
||||
portion of it, either verbatim or with modifications and/or translated
|
||||
straightforwardly into another language. (Hereinafter, translation is
|
||||
included without limitation in the term "modification".)
|
||||
|
||||
"Source code" for a work means the preferred form of the work for
|
||||
making modifications to it. For a library, complete source code means
|
||||
all the source code for all modules it contains, plus any associated
|
||||
interface definition files, plus the scripts used to control compilation
|
||||
and installation of the library.
|
||||
|
||||
Activities other than copying, distribution and modification are not
|
||||
covered by this License; they are outside its scope. The act of
|
||||
running a program using the Library is not restricted, and output from
|
||||
such a program is covered only if its contents constitute a work based
|
||||
on the Library (independent of the use of the Library in a tool for
|
||||
writing it). Whether that is true depends on what the Library does
|
||||
and what the program that uses the Library does.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Library's
|
||||
complete source code as you receive it, in any medium, provided that
|
||||
you conspicuously and appropriately publish on each copy an
|
||||
appropriate copyright notice and disclaimer of warranty; keep intact
|
||||
all the notices that refer to this License and to the absence of any
|
||||
warranty; and distribute a copy of this License along with the
|
||||
Library.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy,
|
||||
and you may at your option offer warranty protection in exchange for a
|
||||
fee.
|
||||
|
||||
2. You may modify your copy or copies of the Library or any portion
|
||||
of it, thus forming a work based on the Library, and copy and
|
||||
distribute such modifications or work under the terms of Section 1
|
||||
above, provided that you also meet all of these conditions:
|
||||
|
||||
a) The modified work must itself be a software library.
|
||||
|
||||
b) You must cause the files modified to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
|
||||
c) You must cause the whole of the work to be licensed at no
|
||||
charge to all third parties under the terms of this License.
|
||||
|
||||
d) If a facility in the modified Library refers to a function or a
|
||||
table of data to be supplied by an application program that uses
|
||||
the facility, other than as an argument passed when the facility
|
||||
is invoked, then you must make a good faith effort to ensure that,
|
||||
in the event an application does not supply such function or
|
||||
table, the facility still operates, and performs whatever part of
|
||||
its purpose remains meaningful.
|
||||
|
||||
(For example, a function in a library to compute square roots has
|
||||
a purpose that is entirely well-defined independent of the
|
||||
application. Therefore, Subsection 2d requires that any
|
||||
application-supplied function or table used by this function must
|
||||
be optional: if the application does not supply it, the square
|
||||
root function must still compute square roots.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If
|
||||
identifiable sections of that work are not derived from the Library,
|
||||
and can be reasonably considered independent and separate works in
|
||||
themselves, then this License, and its terms, do not apply to those
|
||||
sections when you distribute them as separate works. But when you
|
||||
distribute the same sections as part of a whole which is a work based
|
||||
on the Library, the distribution of the whole must be on the terms of
|
||||
this License, whose permissions for other licensees extend to the
|
||||
entire whole, and thus to each and every part regardless of who wrote
|
||||
it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest
|
||||
your rights to work written entirely by you; rather, the intent is to
|
||||
exercise the right to control the distribution of derivative or
|
||||
collective works based on the Library.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Library
|
||||
with the Library (or with a work based on the Library) on a volume of
|
||||
a storage or distribution medium does not bring the other work under
|
||||
the scope of this License.
|
||||
|
||||
3. You may opt to apply the terms of the ordinary GNU General Public
|
||||
License instead of this License to a given copy of the Library. To do
|
||||
this, you must alter all the notices that refer to this License, so
|
||||
that they refer to the ordinary GNU General Public License, version 2,
|
||||
instead of to this License. (If a newer version than version 2 of the
|
||||
ordinary GNU General Public License has appeared, then you can specify
|
||||
that version instead if you wish.) Do not make any other change in
|
||||
these notices.
|
||||
|
||||
Once this change is made in a given copy, it is irreversible for
|
||||
that copy, so the ordinary GNU General Public License applies to all
|
||||
subsequent copies and derivative works made from that copy.
|
||||
|
||||
This option is useful when you wish to copy part of the code of
|
||||
the Library into a program that is not a library.
|
||||
|
||||
4. You may copy and distribute the Library (or a portion or
|
||||
derivative of it, under Section 2) in object code or executable form
|
||||
under the terms of Sections 1 and 2 above provided that you accompany
|
||||
it with the complete corresponding machine-readable source code, which
|
||||
must be distributed under the terms of Sections 1 and 2 above on a
|
||||
medium customarily used for software interchange.
|
||||
|
||||
If distribution of object code is made by offering access to copy
|
||||
from a designated place, then offering equivalent access to copy the
|
||||
source code from the same place satisfies the requirement to
|
||||
distribute the source code, even though third parties are not
|
||||
compelled to copy the source along with the object code.
|
||||
|
||||
5. A program that contains no derivative of any portion of the
|
||||
Library, but is designed to work with the Library by being compiled or
|
||||
linked with it, is called a "work that uses the Library". Such a
|
||||
work, in isolation, is not a derivative work of the Library, and
|
||||
therefore falls outside the scope of this License.
|
||||
|
||||
However, linking a "work that uses the Library" with the Library
|
||||
creates an executable that is a derivative of the Library (because it
|
||||
contains portions of the Library), rather than a "work that uses the
|
||||
library". The executable is therefore covered by this License.
|
||||
Section 6 states terms for distribution of such executables.
|
||||
|
||||
When a "work that uses the Library" uses material from a header file
|
||||
that is part of the Library, the object code for the work may be a
|
||||
derivative work of the Library even though the source code is not.
|
||||
Whether this is true is especially significant if the work can be
|
||||
linked without the Library, or if the work is itself a library. The
|
||||
threshold for this to be true is not precisely defined by law.
|
||||
|
||||
If such an object file uses only numerical parameters, data
|
||||
structure layouts and accessors, and small macros and small inline
|
||||
functions (ten lines or less in length), then the use of the object
|
||||
file is unrestricted, regardless of whether it is legally a derivative
|
||||
work. (Executables containing this object code plus portions of the
|
||||
Library will still fall under Section 6.)
|
||||
|
||||
Otherwise, if the work is a derivative of the Library, you may
|
||||
distribute the object code for the work under the terms of Section 6.
|
||||
Any executables containing that work also fall under Section 6,
|
||||
whether or not they are linked directly with the Library itself.
|
||||
|
||||
6. As an exception to the Sections above, you may also combine or
|
||||
link a "work that uses the Library" with the Library to produce a
|
||||
work containing portions of the Library, and distribute that work
|
||||
under terms of your choice, provided that the terms permit
|
||||
modification of the work for the customer's own use and reverse
|
||||
engineering for debugging such modifications.
|
||||
|
||||
You must give prominent notice with each copy of the work that the
|
||||
Library is used in it and that the Library and its use are covered by
|
||||
this License. You must supply a copy of this License. If the work
|
||||
during execution displays copyright notices, you must include the
|
||||
copyright notice for the Library among them, as well as a reference
|
||||
directing the user to the copy of this License. Also, you must do one
|
||||
of these things:
|
||||
|
||||
a) Accompany the work with the complete corresponding
|
||||
machine-readable source code for the Library including whatever
|
||||
changes were used in the work (which must be distributed under
|
||||
Sections 1 and 2 above); and, if the work is an executable linked
|
||||
with the Library, with the complete machine-readable "work that
|
||||
uses the Library", as object code and/or source code, so that the
|
||||
user can modify the Library and then relink to produce a modified
|
||||
executable containing the modified Library. (It is understood
|
||||
that the user who changes the contents of definitions files in the
|
||||
Library will not necessarily be able to recompile the application
|
||||
to use the modified definitions.)
|
||||
|
||||
b) Use a suitable shared library mechanism for linking with the
|
||||
Library. A suitable mechanism is one that (1) uses at run time a
|
||||
copy of the library already present on the user's computer system,
|
||||
rather than copying library functions into the executable, and (2)
|
||||
will operate properly with a modified version of the library, if
|
||||
the user installs one, as long as the modified version is
|
||||
interface-compatible with the version that the work was made with.
|
||||
|
||||
c) Accompany the work with a written offer, valid for at
|
||||
least three years, to give the same user the materials
|
||||
specified in Subsection 6a, above, for a charge no more
|
||||
than the cost of performing this distribution.
|
||||
|
||||
d) If distribution of the work is made by offering access to copy
|
||||
from a designated place, offer equivalent access to copy the above
|
||||
specified materials from the same place.
|
||||
|
||||
e) Verify that the user has already received a copy of these
|
||||
materials or that you have already sent this user a copy.
|
||||
|
||||
For an executable, the required form of the "work that uses the
|
||||
Library" must include any data and utility programs needed for
|
||||
reproducing the executable from it. However, as a special exception,
|
||||
the materials to be distributed need not include anything that is
|
||||
normally distributed (in either source or binary form) with the major
|
||||
components (compiler, kernel, and so on) of the operating system on
|
||||
which the executable runs, unless that component itself accompanies
|
||||
the executable.
|
||||
|
||||
It may happen that this requirement contradicts the license
|
||||
restrictions of other proprietary libraries that do not normally
|
||||
accompany the operating system. Such a contradiction means you cannot
|
||||
use both them and the Library together in an executable that you
|
||||
distribute.
|
||||
|
||||
7. You may place library facilities that are a work based on the
|
||||
Library side-by-side in a single library together with other library
|
||||
facilities not covered by this License, and distribute such a combined
|
||||
library, provided that the separate distribution of the work based on
|
||||
the Library and of the other library facilities is otherwise
|
||||
permitted, and provided that you do these two things:
|
||||
|
||||
a) Accompany the combined library with a copy of the same work
|
||||
based on the Library, uncombined with any other library
|
||||
facilities. This must be distributed under the terms of the
|
||||
Sections above.
|
||||
|
||||
b) Give prominent notice with the combined library of the fact
|
||||
that part of it is a work based on the Library, and explaining
|
||||
where to find the accompanying uncombined form of the same work.
|
||||
|
||||
8. You may not copy, modify, sublicense, link with, or distribute
|
||||
the Library except as expressly provided under this License. Any
|
||||
attempt otherwise to copy, modify, sublicense, link with, or
|
||||
distribute the Library is void, and will automatically terminate your
|
||||
rights under this License. However, parties who have received copies,
|
||||
or rights, from you under this License will not have their licenses
|
||||
terminated so long as such parties remain in full compliance.
|
||||
|
||||
9. You are not required to accept this License, since you have not
|
||||
signed it. However, nothing else grants you permission to modify or
|
||||
distribute the Library or its derivative works. These actions are
|
||||
prohibited by law if you do not accept this License. Therefore, by
|
||||
modifying or distributing the Library (or any work based on the
|
||||
Library), you indicate your acceptance of this License to do so, and
|
||||
all its terms and conditions for copying, distributing or modifying
|
||||
the Library or works based on it.
|
||||
|
||||
10. Each time you redistribute the Library (or any work based on the
|
||||
Library), the recipient automatically receives a license from the
|
||||
original licensor to copy, distribute, link with or modify the Library
|
||||
subject to these terms and conditions. You may not impose any further
|
||||
restrictions on the recipients' exercise of the rights granted herein.
|
||||
You are not responsible for enforcing compliance by third parties with
|
||||
this License.
|
||||
|
||||
11. If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent issues),
|
||||
conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot
|
||||
distribute so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you
|
||||
may not distribute the Library at all. For example, if a patent
|
||||
license would not permit royalty-free redistribution of the Library by
|
||||
all those who receive copies directly or indirectly through you, then
|
||||
the only way you could satisfy both it and this License would be to
|
||||
refrain entirely from distribution of the Library.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under any
|
||||
particular circumstance, the balance of the section is intended to apply,
|
||||
and the section as a whole is intended to apply in other circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any
|
||||
patents or other property right claims or to contest validity of any
|
||||
such claims; this section has the sole purpose of protecting the
|
||||
integrity of the free software distribution system which is
|
||||
implemented by public license practices. Many people have made
|
||||
generous contributions to the wide range of software distributed
|
||||
through that system in reliance on consistent application of that
|
||||
system; it is up to the author/donor to decide if he or she is willing
|
||||
to distribute software through any other system and a licensee cannot
|
||||
impose that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to
|
||||
be a consequence of the rest of this License.
|
||||
|
||||
12. If the distribution and/or use of the Library is restricted in
|
||||
certain countries either by patents or by copyrighted interfaces, the
|
||||
original copyright holder who places the Library under this License may add
|
||||
an explicit geographical distribution limitation excluding those countries,
|
||||
so that distribution is permitted only in or among countries not thus
|
||||
excluded. In such case, this License incorporates the limitation as if
|
||||
written in the body of this License.
|
||||
|
||||
13. The Free Software Foundation may publish revised and/or new
|
||||
versions of the Lesser General Public License from time to time.
|
||||
Such new versions will be similar in spirit to the present version,
|
||||
but may differ in detail to address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Library
|
||||
specifies a version number of this License which applies to it and
|
||||
"any later version", you have the option of following the terms and
|
||||
conditions either of that version or of any later version published by
|
||||
the Free Software Foundation. If the Library does not specify a
|
||||
license version number, you may choose any version ever published by
|
||||
the Free Software Foundation.
|
||||
|
||||
14. If you wish to incorporate parts of the Library into other free
|
||||
programs whose distribution conditions are incompatible with these,
|
||||
write to the author to ask for permission. For software which is
|
||||
copyrighted by the Free Software Foundation, write to the Free
|
||||
Software Foundation; we sometimes make exceptions for this. Our
|
||||
decision will be guided by the two goals of preserving the free status
|
||||
of all derivatives of our free software and of promoting the sharing
|
||||
and reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
|
||||
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
|
||||
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
|
||||
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
|
||||
OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
|
||||
KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
|
||||
LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
|
||||
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
|
||||
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
|
||||
AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
|
||||
FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
|
||||
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
|
||||
LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
|
||||
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
|
||||
FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
|
||||
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
|
||||
DAMAGES.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Libraries
|
||||
|
||||
If you develop a new library, and you want it to be of the greatest
|
||||
possible use to the public, we recommend making it free software that
|
||||
everyone can redistribute and change. You can do so by permitting
|
||||
redistribution under these terms (or, alternatively, under the terms of the
|
||||
ordinary General Public License).
|
||||
|
||||
To apply these terms, attach the following notices to the library. It is
|
||||
safest to attach them to the start of each source file to most effectively
|
||||
convey the exclusion of warranty; and each file should have at least the
|
||||
"copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the library's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or your
|
||||
school, if any, to sign a "copyright disclaimer" for the library, if
|
||||
necessary. Here is a sample; alter the names:
|
||||
|
||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the
|
||||
library `Frob' (a library for tweaking knobs) written by James Random Hacker.
|
||||
|
||||
<signature of Ty Coon>, 1 April 1990
|
||||
Ty Coon, President of Vice
|
||||
|
||||
That's all there is to it!
|
||||
|
||||
|
|
@ -0,0 +1,116 @@
|
|||
4/11/2007 Simon Newton <<nomis52@westnet.com.au>
|
||||
* Removed artnet_init
|
||||
* cleaned up code style
|
||||
* removed #defines
|
||||
* implemented Artnet II
|
||||
|
||||
25/12/2006 Simon Newton <<nomis52@westnet.com.au>
|
||||
|
||||
* minor code cleanup, removed a bunch of magic numbers
|
||||
|
||||
24/12/2006 Simon Newton <<nomis52@westnet.com.au>
|
||||
|
||||
* bug fix for OS X
|
||||
|
||||
12/6/2006 Simon Newton <<nomis52@westnet.com.au>
|
||||
|
||||
* applied patches to network.c from Justin Cormack to skip interfaces
|
||||
without addresses
|
||||
|
||||
12/6/2006 Simon Newton <<nomis52@westnet.com.au>
|
||||
|
||||
* added functions to set the oem and esta codes
|
||||
|
||||
9/5/2006 Simon Newton <<nomis52@westnet.com.au>
|
||||
|
||||
* changed to using a single descriptor bound to *.6454
|
||||
|
||||
18/4/2006 Simon Newton <<nomis52@westnet.com.au>
|
||||
|
||||
* Received ESTA Manufacturer ID
|
||||
|
||||
17/4/2006 Simon Newton <<nomis52@westnet.com.au>
|
||||
|
||||
* Fixed ArtPollReply length bug
|
||||
|
||||
16/9/2005 Simon Newton <<nomis52@westnet.com.au>
|
||||
|
||||
* Fixed compile issues on OS X
|
||||
|
||||
28/8/2005 Simon Newton <nomis52@westnet.com.au>
|
||||
|
||||
* Fixed error handling in net_start
|
||||
|
||||
26/8/2005 Simon Newton <nomis52@westnet.com.au>
|
||||
|
||||
* Fixed get_ifaces to return hw addrs correctly for aliased ifaces
|
||||
|
||||
12/8/2005 Simon Newton <nomis52@westnet.com.au>
|
||||
|
||||
* Changed to a new error reporting scheme
|
||||
* Applied patch from Samuli Valo to fix get_ifaces on x86-64
|
||||
|
||||
7/05/2005 Simon Newton <nomis52@westnet.com.au>
|
||||
|
||||
* fixed bug in number of ports reported
|
||||
* included tod.h and misc.h :)
|
||||
* fixed typo with IPV6
|
||||
* removed static path for pkgconfig data
|
||||
|
||||
30/04/2005 Simon Newton <nomis52@westnet.com.au>
|
||||
|
||||
* minor cleanup, now reports numb of ports correctly
|
||||
|
||||
30/04/2005 Simon Newton <nomis52@westnet.com.au>
|
||||
|
||||
* started adding RDM support
|
||||
|
||||
25/04/2005 Simon Newton <nomis52@westnet.com.au>
|
||||
|
||||
* fixed the inet_aton bug
|
||||
|
||||
18/04/2005 Simon Newton <nomis52@westnet.com.au>
|
||||
|
||||
* Added the endian conversion functions
|
||||
|
||||
12/04/2005 Simon Newton <nomis52@westnet.com.au>
|
||||
|
||||
* More OSX fixes
|
||||
|
||||
9/04/2005 Simon Newton <nomis52@westnet.com.au>
|
||||
|
||||
* Fixed the seg fault if no network interfaces are present
|
||||
|
||||
18/3/2005 Simon Newton <nomis52@westnet.com.au>
|
||||
|
||||
* added artnet_destroy
|
||||
|
||||
17/3/2005 Simon Newton <nomis52@westnet.com.au>
|
||||
|
||||
* added c++ linking support
|
||||
|
||||
16/3/2005 Simon Newton <nomis52@westnet.net>
|
||||
|
||||
* merged bugfixes from multicast branch to trunk
|
||||
|
||||
27/2/2005 Simon Newton <nomis52@westnet.net>
|
||||
|
||||
* split examples from the library
|
||||
* depricated artnet_init
|
||||
|
||||
23/2/2005 Simon Newton <nomis52@westnet.net>
|
||||
|
||||
* added basic node joining support
|
||||
|
||||
12/2/2005 Simon Newton <nomis52@westnet.net>
|
||||
|
||||
* Fixed compiler warnings
|
||||
* Fixed minor problems relating to a node's ip address
|
||||
|
||||
11/2/2005 Simon Newton <nomis52@westnet.net>
|
||||
|
||||
* Changed the licence to the LGPL
|
||||
* Added new "debug" parameter to artnet_init()
|
||||
* Fixed LTP bug (L = latest not lowest as I orginally thought)
|
||||
* Added firmware receive support - new example program artnet_firmware_node
|
||||
* Added firmware send support - new example program artnet_firmware_server
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,82 @@
|
|||
|
||||
|
||||
NOTE: By default everything will be installed with the prefix /usr/local .
|
||||
If you want to build against these libraries you will need to add
|
||||
"/usr/local/lib" to /etc/ld.so.conf and run ldconfig. Otherwise, run configure
|
||||
with --prefix=/usr and the libraries will be installed to /usr/lib
|
||||
|
||||
|
||||
Contents
|
||||
========
|
||||
|
||||
A. Basic Installation
|
||||
B. For Developers
|
||||
C. Installation Paths
|
||||
|
||||
|
||||
A. Basic Installation
|
||||
==================
|
||||
|
||||
1. Extract the archive
|
||||
|
||||
tar -zxf artnet-0.x.y.tar.gz
|
||||
|
||||
2. Enter the directory
|
||||
|
||||
cd artnet-0.x.y.tar.gz
|
||||
|
||||
3. Run the configure script. If you're using `csh' on an old version of
|
||||
System V, you might need to type `sh ./configure' instead to prevent
|
||||
`csh' from trying to execute `configure' itself.
|
||||
|
||||
./configure
|
||||
|
||||
4. Build the source files.
|
||||
|
||||
make
|
||||
|
||||
5. Become root
|
||||
|
||||
su
|
||||
(enter root password)
|
||||
|
||||
6. Install the libraries
|
||||
|
||||
make install
|
||||
|
||||
7. See the instructions at the top of this file.
|
||||
|
||||
|
||||
B. For Developers
|
||||
=================
|
||||
|
||||
libartnet uses pkgconfig. libartnet.pc is installed in /usr/lib/pkgconfig
|
||||
This is only important if you intend on writing applications that use libartnet.
|
||||
|
||||
libartnet is documented using doxygen. Run doxygen from the extracted
|
||||
directory to generate the latex and html documentation in the doc subdirectory
|
||||
|
||||
|
||||
C. Installation Paths
|
||||
=====================
|
||||
|
||||
By default, `make install' will install the package's files in
|
||||
`/usr/local/bin', `/usr/local/man', etc. You can specify an
|
||||
installation prefix other than `/usr/local' by giving `configure' the
|
||||
option `--prefix=PATH'.
|
||||
|
||||
You can specify separate installation prefixes for
|
||||
architecture-specific files and architecture-independent files. If you
|
||||
give `configure' the option `--exec-prefix=PATH', the package will use
|
||||
PATH as the prefix for installing programs and libraries.
|
||||
Documentation and other data files will still use the regular prefix.
|
||||
|
||||
In addition, if you use an unusual directory layout you can give
|
||||
options like `--bindir=PATH' to specify different values for particular
|
||||
kinds of files. Run `configure --help' for a list of the directories
|
||||
you can set and what kinds of files go in them.
|
||||
|
||||
If the package supports it, you can cause programs to be installed
|
||||
with an extra prefix or suffix on their names by giving `configure' the
|
||||
option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
|
||||
auxdir = @ac_aux_dir@
|
||||
AUX_DIST = $(auxdir)/install-sh $(auxdir)/missing \
|
||||
$(auxdir)/mkinstalldirs
|
||||
|
||||
SUBDIRS = artnet
|
||||
|
||||
EXTRA_DIST = libartnet.pc.in Doxyfile
|
||||
|
||||
pkgconfigdir = $(libdir)/pkgconfig
|
||||
pkgconfig_DATA = libartnet.pc
|
||||
|
||||
ACLOCAL = aclocal -I $(auxdir)
|
|
@ -0,0 +1,668 @@
|
|||
# Makefile.in generated by automake 1.10 from Makefile.am.
|
||||
# @configure_input@
|
||||
|
||||
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
|
||||
# 2003, 2004, 2005, 2006 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@
|
||||
pkglibdir = $(libdir)/@PACKAGE@
|
||||
pkgincludedir = $(includedir)/@PACKAGE@
|
||||
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
|
||||
install_sh_DATA = $(install_sh) -c -m 644
|
||||
install_sh_PROGRAM = $(install_sh) -c
|
||||
install_sh_SCRIPT = $(install_sh) -c
|
||||
INSTALL_HEADER = $(INSTALL_DATA)
|
||||
transform = $(program_transform_name)
|
||||
NORMAL_INSTALL = :
|
||||
PRE_INSTALL = :
|
||||
POST_INSTALL = :
|
||||
NORMAL_UNINSTALL = :
|
||||
PRE_UNINSTALL = :
|
||||
POST_UNINSTALL = :
|
||||
build_triplet = @build@
|
||||
host_triplet = @host@
|
||||
subdir = .
|
||||
DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \
|
||||
$(srcdir)/Makefile.in $(srcdir)/config.h.in \
|
||||
$(srcdir)/libartnet.pc.in $(top_srcdir)/configure AUTHORS \
|
||||
COPYING ChangeLog INSTALL NEWS TODO config.guess config.sub \
|
||||
depcomp install-sh ltmain.sh missing
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
am__aclocal_m4_deps = $(top_srcdir)/configure.in
|
||||
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 = libartnet.pc
|
||||
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
|
||||
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
|
||||
am__vpath_adj = case $$p in \
|
||||
$(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
|
||||
*) f=$$p;; \
|
||||
esac;
|
||||
am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
|
||||
am__installdirs = "$(DESTDIR)$(pkgconfigdir)"
|
||||
pkgconfigDATA_INSTALL = $(INSTALL_DATA)
|
||||
DATA = $(pkgconfig_DATA)
|
||||
RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
|
||||
distclean-recursive maintainer-clean-recursive
|
||||
ETAGS = etags
|
||||
CTAGS = ctags
|
||||
DIST_SUBDIRS = $(SUBDIRS)
|
||||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
||||
distdir = $(PACKAGE)-$(VERSION)
|
||||
top_distdir = $(distdir)
|
||||
am__remove_distdir = \
|
||||
{ test ! -d $(distdir) \
|
||||
|| { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \
|
||||
&& rm -fr $(distdir); }; }
|
||||
DIST_ARCHIVES = $(distdir).tar.gz
|
||||
GZIP_ENV = --best
|
||||
distuninstallcheck_listfiles = find . -type f -print
|
||||
distcleancheck_listfiles = find . -type f -print
|
||||
ACLOCAL = aclocal -I $(auxdir)
|
||||
AMTAR = @AMTAR@
|
||||
AR = @AR@
|
||||
AS = @AS@
|
||||
AUTOCONF = @AUTOCONF@
|
||||
AUTOHEADER = @AUTOHEADER@
|
||||
AUTOMAKE = @AUTOMAKE@
|
||||
AWK = @AWK@
|
||||
CC = @CC@
|
||||
CCDEPMODE = @CCDEPMODE@
|
||||
CFLAGS = @CFLAGS@
|
||||
CPP = @CPP@
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
CXX = @CXX@
|
||||
CXXCPP = @CXXCPP@
|
||||
CXXDEPMODE = @CXXDEPMODE@
|
||||
CXXFLAGS = @CXXFLAGS@
|
||||
CYGPATH_W = @CYGPATH_W@
|
||||
DEFS = @DEFS@
|
||||
DEPDIR = @DEPDIR@
|
||||
DLLTOOL = @DLLTOOL@
|
||||
ECHO = @ECHO@
|
||||
ECHO_C = @ECHO_C@
|
||||
ECHO_N = @ECHO_N@
|
||||
ECHO_T = @ECHO_T@
|
||||
EGREP = @EGREP@
|
||||
EXEEXT = @EXEEXT@
|
||||
F77 = @F77@
|
||||
FFLAGS = @FFLAGS@
|
||||
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@
|
||||
LIBTOOL = @LIBTOOL@
|
||||
LN_S = @LN_S@
|
||||
LTLIBOBJS = @LTLIBOBJS@
|
||||
MAKEINFO = @MAKEINFO@
|
||||
MKDIR_P = @MKDIR_P@
|
||||
OBJDUMP = @OBJDUMP@
|
||||
OBJEXT = @OBJEXT@
|
||||
PACKAGE = @PACKAGE@
|
||||
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
|
||||
PACKAGE_NAME = @PACKAGE_NAME@
|
||||
PACKAGE_STRING = @PACKAGE_STRING@
|
||||
PACKAGE_TARNAME = @PACKAGE_TARNAME@
|
||||
PACKAGE_VERSION = @PACKAGE_VERSION@
|
||||
PATH_SEPARATOR = @PATH_SEPARATOR@
|
||||
RANLIB = @RANLIB@
|
||||
SET_MAKE = @SET_MAKE@
|
||||
SHELL = @SHELL@
|
||||
STRIP = @STRIP@
|
||||
VERSION = @VERSION@
|
||||
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@
|
||||
ac_ct_F77 = @ac_ct_F77@
|
||||
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_alias = @target_alias@
|
||||
top_builddir = @top_builddir@
|
||||
top_srcdir = @top_srcdir@
|
||||
auxdir = @ac_aux_dir@
|
||||
AUX_DIST = $(auxdir)/install-sh $(auxdir)/missing \
|
||||
$(auxdir)/mkinstalldirs
|
||||
|
||||
SUBDIRS = artnet
|
||||
EXTRA_DIST = libartnet.pc.in Doxyfile
|
||||
pkgconfigdir = $(libdir)/pkgconfig
|
||||
pkgconfig_DATA = libartnet.pc
|
||||
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 '; \
|
||||
cd $(srcdir) && $(AUTOMAKE) --gnu \
|
||||
&& exit 0; \
|
||||
exit 1;; \
|
||||
esac; \
|
||||
done; \
|
||||
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \
|
||||
cd $(top_srcdir) && \
|
||||
$(AUTOMAKE) --gnu Makefile
|
||||
.PRECIOUS: Makefile
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||
@case '$?' in \
|
||||
*config.status*) \
|
||||
echo ' $(SHELL) ./config.status'; \
|
||||
$(SHELL) ./config.status;; \
|
||||
*) \
|
||||
echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \
|
||||
esac;
|
||||
|
||||
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
|
||||
$(SHELL) ./config.status --recheck
|
||||
|
||||
$(top_srcdir)/configure: $(am__configure_deps)
|
||||
cd $(srcdir) && $(AUTOCONF)
|
||||
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
|
||||
cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
|
||||
|
||||
config.h: stamp-h1
|
||||
@if test ! -f $@; then \
|
||||
rm -f stamp-h1; \
|
||||
$(MAKE) $(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)
|
||||
cd $(top_srcdir) && $(AUTOHEADER)
|
||||
rm -f stamp-h1
|
||||
touch $@
|
||||
|
||||
distclean-hdr:
|
||||
-rm -f config.h stamp-h1
|
||||
libartnet.pc: $(top_builddir)/config.status $(srcdir)/libartnet.pc.in
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $@
|
||||
|
||||
mostlyclean-libtool:
|
||||
-rm -f *.lo
|
||||
|
||||
clean-libtool:
|
||||
-rm -rf .libs _libs
|
||||
|
||||
distclean-libtool:
|
||||
-rm -f libtool
|
||||
install-pkgconfigDATA: $(pkgconfig_DATA)
|
||||
@$(NORMAL_INSTALL)
|
||||
test -z "$(pkgconfigdir)" || $(MKDIR_P) "$(DESTDIR)$(pkgconfigdir)"
|
||||
@list='$(pkgconfig_DATA)'; for p in $$list; do \
|
||||
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
|
||||
f=$(am__strip_dir) \
|
||||
echo " $(pkgconfigDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(pkgconfigdir)/$$f'"; \
|
||||
$(pkgconfigDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(pkgconfigdir)/$$f"; \
|
||||
done
|
||||
|
||||
uninstall-pkgconfigDATA:
|
||||
@$(NORMAL_UNINSTALL)
|
||||
@list='$(pkgconfig_DATA)'; for p in $$list; do \
|
||||
f=$(am__strip_dir) \
|
||||
echo " rm -f '$(DESTDIR)$(pkgconfigdir)/$$f'"; \
|
||||
rm -f "$(DESTDIR)$(pkgconfigdir)/$$f"; \
|
||||
done
|
||||
|
||||
# This directory's subdirectories are mostly independent; you can cd
|
||||
# into them and run `make' without going through this Makefile.
|
||||
# To change the values of `make' variables: instead of editing Makefiles,
|
||||
# (1) if the variable is set in `config.status', edit `config.status'
|
||||
# (which will cause the Makefiles to be regenerated when you run `make');
|
||||
# (2) otherwise, pass the desired values on the `make' command line.
|
||||
$(RECURSIVE_TARGETS):
|
||||
@failcom='exit 1'; \
|
||||
for f in x $$MAKEFLAGS; do \
|
||||
case $$f in \
|
||||
*=* | --[!k]*);; \
|
||||
*k*) failcom='fail=yes';; \
|
||||
esac; \
|
||||
done; \
|
||||
dot_seen=no; \
|
||||
target=`echo $@ | sed s/-recursive//`; \
|
||||
list='$(SUBDIRS)'; for subdir in $$list; do \
|
||||
echo "Making $$target in $$subdir"; \
|
||||
if test "$$subdir" = "."; then \
|
||||
dot_seen=yes; \
|
||||
local_target="$$target-am"; \
|
||||
else \
|
||||
local_target="$$target"; \
|
||||
fi; \
|
||||
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|
||||
|| eval $$failcom; \
|
||||
done; \
|
||||
if test "$$dot_seen" = "no"; then \
|
||||
$(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
|
||||
fi; test -z "$$fail"
|
||||
|
||||
$(RECURSIVE_CLEAN_TARGETS):
|
||||
@failcom='exit 1'; \
|
||||
for f in x $$MAKEFLAGS; do \
|
||||
case $$f in \
|
||||
*=* | --[!k]*);; \
|
||||
*k*) failcom='fail=yes';; \
|
||||
esac; \
|
||||
done; \
|
||||
dot_seen=no; \
|
||||
case "$@" in \
|
||||
distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
|
||||
*) list='$(SUBDIRS)' ;; \
|
||||
esac; \
|
||||
rev=''; for subdir in $$list; do \
|
||||
if test "$$subdir" = "."; then :; else \
|
||||
rev="$$subdir $$rev"; \
|
||||
fi; \
|
||||
done; \
|
||||
rev="$$rev ."; \
|
||||
target=`echo $@ | sed s/-recursive//`; \
|
||||
for subdir in $$rev; do \
|
||||
echo "Making $$target in $$subdir"; \
|
||||
if test "$$subdir" = "."; then \
|
||||
local_target="$$target-am"; \
|
||||
else \
|
||||
local_target="$$target"; \
|
||||
fi; \
|
||||
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|
||||
|| eval $$failcom; \
|
||||
done && test -z "$$fail"
|
||||
tags-recursive:
|
||||
list='$(SUBDIRS)'; for subdir in $$list; do \
|
||||
test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
|
||||
done
|
||||
ctags-recursive:
|
||||
list='$(SUBDIRS)'; for subdir in $$list; do \
|
||||
test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
|
||||
done
|
||||
|
||||
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) ' { files[$$0] = 1; } \
|
||||
END { for (i in files) print i; }'`; \
|
||||
mkid -fID $$unique
|
||||
tags: TAGS
|
||||
|
||||
TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
|
||||
$(TAGS_FILES) $(LISP)
|
||||
tags=; \
|
||||
here=`pwd`; \
|
||||
if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
|
||||
include_option=--etags-include; \
|
||||
empty_fix=.; \
|
||||
else \
|
||||
include_option=--include; \
|
||||
empty_fix=; \
|
||||
fi; \
|
||||
list='$(SUBDIRS)'; for subdir in $$list; do \
|
||||
if test "$$subdir" = .; then :; else \
|
||||
test ! -f $$subdir/TAGS || \
|
||||
tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
|
||||
fi; \
|
||||
done; \
|
||||
list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) ' { files[$$0] = 1; } \
|
||||
END { for (i in files) print i; }'`; \
|
||||
if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
|
||||
test -n "$$unique" || unique=$$empty_fix; \
|
||||
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
|
||||
$$tags $$unique; \
|
||||
fi
|
||||
ctags: CTAGS
|
||||
CTAGS: ctags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
|
||||
$(TAGS_FILES) $(LISP)
|
||||
tags=; \
|
||||
here=`pwd`; \
|
||||
list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) ' { files[$$0] = 1; } \
|
||||
END { for (i in files) print i; }'`; \
|
||||
test -z "$(CTAGS_ARGS)$$tags$$unique" \
|
||||
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
|
||||
$$tags $$unique
|
||||
|
||||
GTAGS:
|
||||
here=`$(am__cd) $(top_builddir) && pwd` \
|
||||
&& cd $(top_srcdir) \
|
||||
&& gtags -i $(GTAGS_ARGS) $$here
|
||||
|
||||
distclean-tags:
|
||||
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
|
||||
|
||||
distdir: $(DISTFILES)
|
||||
$(am__remove_distdir)
|
||||
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 $(srcdir)/$$file && test $$d != $(srcdir); then \
|
||||
cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
|
||||
fi; \
|
||||
cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
|
||||
else \
|
||||
test -f $(distdir)/$$file \
|
||||
|| cp -p $$d/$$file $(distdir)/$$file \
|
||||
|| exit 1; \
|
||||
fi; \
|
||||
done
|
||||
list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
|
||||
if test "$$subdir" = .; then :; else \
|
||||
test -d "$(distdir)/$$subdir" \
|
||||
|| $(MKDIR_P) "$(distdir)/$$subdir" \
|
||||
|| exit 1; \
|
||||
distdir=`$(am__cd) $(distdir) && pwd`; \
|
||||
top_distdir=`$(am__cd) $(top_distdir) && pwd`; \
|
||||
(cd $$subdir && \
|
||||
$(MAKE) $(AM_MAKEFLAGS) \
|
||||
top_distdir="$$top_distdir" \
|
||||
distdir="$$distdir/$$subdir" \
|
||||
am__remove_distdir=: \
|
||||
am__skip_length_check=: \
|
||||
distdir) \
|
||||
|| exit 1; \
|
||||
fi; \
|
||||
done
|
||||
-find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \
|
||||
! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
|
||||
! -type d ! -perm -400 -exec chmod a+r {} \; -o \
|
||||
! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \
|
||||
|| chmod -R a+r $(distdir)
|
||||
dist-gzip: distdir
|
||||
tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
|
||||
$(am__remove_distdir)
|
||||
|
||||
dist-bzip2: distdir
|
||||
tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2
|
||||
$(am__remove_distdir)
|
||||
|
||||
dist-tarZ: distdir
|
||||
tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
|
||||
$(am__remove_distdir)
|
||||
|
||||
dist-shar: distdir
|
||||
shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
|
||||
$(am__remove_distdir)
|
||||
|
||||
dist-zip: distdir
|
||||
-rm -f $(distdir).zip
|
||||
zip -rq $(distdir).zip $(distdir)
|
||||
$(am__remove_distdir)
|
||||
|
||||
dist dist-all: distdir
|
||||
tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
|
||||
$(am__remove_distdir)
|
||||
|
||||
# This target untars the dist file and tries a VPATH configuration. Then
|
||||
# it guarantees that the distribution is self-contained by making another
|
||||
# tarfile.
|
||||
distcheck: dist
|
||||
case '$(DIST_ARCHIVES)' in \
|
||||
*.tar.gz*) \
|
||||
GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(am__untar) ;;\
|
||||
*.tar.bz2*) \
|
||||
bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\
|
||||
*.tar.Z*) \
|
||||
uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
|
||||
*.shar.gz*) \
|
||||
GZIP=$(GZIP_ENV) gunzip -c $(distdir).shar.gz | unshar ;;\
|
||||
*.zip*) \
|
||||
unzip $(distdir).zip ;;\
|
||||
esac
|
||||
chmod -R a-w $(distdir); chmod a+w $(distdir)
|
||||
mkdir $(distdir)/_build
|
||||
mkdir $(distdir)/_inst
|
||||
chmod a-w $(distdir)
|
||||
dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
|
||||
&& dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
|
||||
&& cd $(distdir)/_build \
|
||||
&& ../configure --srcdir=.. --prefix="$$dc_install_base" \
|
||||
$(DISTCHECK_CONFIGURE_FLAGS) \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) dvi \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) check \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) install \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) installcheck \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) uninstall \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \
|
||||
distuninstallcheck \
|
||||
&& chmod -R a-w "$$dc_install_base" \
|
||||
&& ({ \
|
||||
(cd ../.. && umask 077 && mkdir "$$dc_destdir") \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \
|
||||
distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \
|
||||
} || { rm -rf "$$dc_destdir"; exit 1; }) \
|
||||
&& rm -rf "$$dc_destdir" \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) dist \
|
||||
&& rm -rf $(DIST_ARCHIVES) \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) distcleancheck
|
||||
$(am__remove_distdir)
|
||||
@(echo "$(distdir) archives ready for distribution: "; \
|
||||
list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \
|
||||
sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x'
|
||||
distuninstallcheck:
|
||||
@cd $(distuninstallcheck_dir) \
|
||||
&& test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \
|
||||
|| { echo "ERROR: files left after uninstall:" ; \
|
||||
if test -n "$(DESTDIR)"; then \
|
||||
echo " (check DESTDIR support)"; \
|
||||
fi ; \
|
||||
$(distuninstallcheck_listfiles) ; \
|
||||
exit 1; } >&2
|
||||
distcleancheck: distclean
|
||||
@if test '$(srcdir)' = . ; then \
|
||||
echo "ERROR: distcleancheck can only run from a VPATH build" ; \
|
||||
exit 1 ; \
|
||||
fi
|
||||
@test `$(distcleancheck_listfiles) | wc -l` -eq 0 \
|
||||
|| { echo "ERROR: files left in build directory after distclean:" ; \
|
||||
$(distcleancheck_listfiles) ; \
|
||||
exit 1; } >&2
|
||||
check-am: all-am
|
||||
check: check-recursive
|
||||
all-am: Makefile $(DATA) config.h
|
||||
installdirs: installdirs-recursive
|
||||
installdirs-am:
|
||||
for dir in "$(DESTDIR)$(pkgconfigdir)"; do \
|
||||
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
|
||||
done
|
||||
install: install-recursive
|
||||
install-exec: install-exec-recursive
|
||||
install-data: install-data-recursive
|
||||
uninstall: uninstall-recursive
|
||||
|
||||
install-am: all-am
|
||||
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
|
||||
|
||||
installcheck: installcheck-recursive
|
||||
install-strip:
|
||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
||||
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
|
||||
`test -z '$(STRIP)' || \
|
||||
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
|
||||
mostlyclean-generic:
|
||||
|
||||
clean-generic:
|
||||
|
||||
distclean-generic:
|
||||
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
|
||||
|
||||
maintainer-clean-generic:
|
||||
@echo "This command is intended for maintainers to use"
|
||||
@echo "it deletes files that may require special tools to rebuild."
|
||||
clean: clean-recursive
|
||||
|
||||
clean-am: clean-generic clean-libtool mostlyclean-am
|
||||
|
||||
distclean: distclean-recursive
|
||||
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
|
||||
-rm -f Makefile
|
||||
distclean-am: clean-am distclean-generic distclean-hdr \
|
||||
distclean-libtool distclean-tags
|
||||
|
||||
dvi: dvi-recursive
|
||||
|
||||
dvi-am:
|
||||
|
||||
html: html-recursive
|
||||
|
||||
info: info-recursive
|
||||
|
||||
info-am:
|
||||
|
||||
install-data-am: install-pkgconfigDATA
|
||||
|
||||
install-dvi: install-dvi-recursive
|
||||
|
||||
install-exec-am:
|
||||
|
||||
install-html: install-html-recursive
|
||||
|
||||
install-info: install-info-recursive
|
||||
|
||||
install-man:
|
||||
|
||||
install-pdf: install-pdf-recursive
|
||||
|
||||
install-ps: install-ps-recursive
|
||||
|
||||
installcheck-am:
|
||||
|
||||
maintainer-clean: maintainer-clean-recursive
|
||||
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
|
||||
-rm -rf $(top_srcdir)/autom4te.cache
|
||||
-rm -f Makefile
|
||||
maintainer-clean-am: distclean-am maintainer-clean-generic
|
||||
|
||||
mostlyclean: mostlyclean-recursive
|
||||
|
||||
mostlyclean-am: mostlyclean-generic mostlyclean-libtool
|
||||
|
||||
pdf: pdf-recursive
|
||||
|
||||
pdf-am:
|
||||
|
||||
ps: ps-recursive
|
||||
|
||||
ps-am:
|
||||
|
||||
uninstall-am: uninstall-pkgconfigDATA
|
||||
|
||||
.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) install-am \
|
||||
install-strip
|
||||
|
||||
.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
|
||||
all all-am am--refresh check check-am clean clean-generic \
|
||||
clean-libtool ctags ctags-recursive dist dist-all dist-bzip2 \
|
||||
dist-gzip dist-shar dist-tarZ dist-zip distcheck distclean \
|
||||
distclean-generic distclean-hdr distclean-libtool \
|
||||
distclean-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-pkgconfigDATA install-ps install-ps-am \
|
||||
install-strip installcheck installcheck-am installdirs \
|
||||
installdirs-am maintainer-clean maintainer-clean-generic \
|
||||
mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \
|
||||
ps ps-am tags tags-recursive uninstall uninstall-am \
|
||||
uninstall-pkgconfigDATA
|
||||
|
||||
# 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:
|
|
@ -0,0 +1,116 @@
|
|||
21/07/2009 libartnet-1.1.0
|
||||
|
||||
Added win32 support
|
||||
|
||||
13/12/2008 libartnet-1.0.7
|
||||
|
||||
Subnet programming fix
|
||||
|
||||
03/11/2006 libartnet-1.0.6
|
||||
|
||||
ArtNet II support
|
||||
|
||||
24/12/2006 libartnet-1.0.4
|
||||
|
||||
Fixed the compile time error for OS X
|
||||
|
||||
12/6/2006 libartnet-1.0.3
|
||||
|
||||
Fixed the segfault caused by interfaces without addresses
|
||||
|
||||
12/6/2006 libartnet-1.0.3
|
||||
|
||||
Added esta and oem functions
|
||||
|
||||
17/4/2006 libartnet-1.0.2
|
||||
|
||||
Introduced compatability mode for devices like the Martin Ether2DMX which
|
||||
send to 255.255.255.255
|
||||
|
||||
17/4/2006 libartnet-1.0.1
|
||||
|
||||
Fixed the ArtPollReply length bug
|
||||
|
||||
30/3/2006 libartnet-1.0.0
|
||||
|
||||
Version 1.0 release
|
||||
|
||||
16/9/2005 libartnet-0.1.14-rc4
|
||||
|
||||
Now compiles on OS X (again)
|
||||
|
||||
28/8/2005 libartnet-0.1.14-rc3
|
||||
|
||||
Bug fixes to net_start
|
||||
|
||||
23/8/2005 libartnet-0.1.14-rc2
|
||||
|
||||
Bug fixes to get_ifaces
|
||||
|
||||
23/8/2005 libartnet-0.1.14-rc1
|
||||
|
||||
A new error reporting system is in use. Calls to most artnet functions
|
||||
return a true value on error. The error string can be accessed with
|
||||
artnet_strerror()
|
||||
|
||||
Applied patch from Samuli Valo to use getifaddrs. (Should now work
|
||||
on x86-64) (prob broken on OS X)
|
||||
|
||||
7/04/2005 libartnet-0.1.13
|
||||
|
||||
Fixed the fact that 0.1.12 wouldn't compile :)
|
||||
|
||||
3/04/2005 libartnet-0.1.12
|
||||
|
||||
Minor cleanups
|
||||
The number of ports are now reported correctly
|
||||
|
||||
3/04/2005 libartnet-0.1.11
|
||||
|
||||
Added basic RDM support, see the artnet_rdm_output (in the artnet-examples)
|
||||
package for details.
|
||||
|
||||
Issues:
|
||||
* Not sure about the ArtTodData implementation, it doesn't work with
|
||||
ArtNetView with more than 200 uids.
|
||||
|
||||
25/04/2005 libartnet-0.1.10
|
||||
|
||||
Fixed the inet_aton bug
|
||||
|
||||
18/04/2005 libartnet-0.1.9
|
||||
|
||||
Mac OS X basic support working (can send/receive dmx data)
|
||||
|
||||
12/04/2005 libartnet-0.1.8
|
||||
|
||||
Mac OS X fixes merged in
|
||||
|
||||
18/03/2005 libartnet-0.1.7
|
||||
|
||||
Added artnet_destroy function
|
||||
|
||||
17/03/2005 libartnet-0.1.6
|
||||
|
||||
Added support for C++ linking (needed for Q Light)
|
||||
|
||||
16/03/2005 libartnet-0.1.5
|
||||
|
||||
Merged bugfixes from multicast branch to trunk
|
||||
|
||||
12/03/2005 libartnet-0.1.4
|
||||
|
||||
Split examples from library
|
||||
Fixed header install path
|
||||
Added node join support
|
||||
Depricated artnet_init in favour of artnet_new
|
||||
|
||||
12/2/2005 libartnet-0.1.3
|
||||
|
||||
Fixed compiler warnings
|
||||
Fixed minor problems relating to a node's ip address
|
||||
|
||||
11/02/2005 libartnet-0.1.2
|
||||
|
||||
Now includes support for Firmware send/receive.
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
|
||||
Libartnet is an implementation of the ArtNet protocol. ArtNet allows the
|
||||
transmission of DMX and related data over IP networks.
|
||||
|
||||
For installation notes see the INSTALL file.
|
|
@ -0,0 +1,6 @@
|
|||
|
||||
|
||||
to get reply working:
|
||||
fix video.remote
|
||||
fix stop / start procedure
|
||||
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,18 @@
|
|||
|
||||
INCLUDES = -I$(top_builddir) -I$(top_srcdir)
|
||||
AM_CFLAGS = -Wall -Werror -Wformat -W
|
||||
|
||||
lib_LTLIBRARIES = libartnet.la
|
||||
libartnet_la_SOURCES = artnet.c private.h misc.c network.c receive.c \
|
||||
transmit.c tod.c
|
||||
libartnet_la_LDFLAGS = -version-info 1:0:0
|
||||
|
||||
if USING_WIN32
|
||||
libartnet_la_LDFLAGS += -no-undefined -liphlpapi -lnetapi32 -lcap -lws2_32 \
|
||||
-ldpnet
|
||||
endif
|
||||
|
||||
EXTRA_DIST = tod.h misc.h
|
||||
|
||||
pkginclude_HEADERS = artnet.h packets.h common.h
|
||||
pkgincludedir = $(includedir)/artnet
|
|
@ -0,0 +1,504 @@
|
|||
# Makefile.in generated by automake 1.10 from Makefile.am.
|
||||
# @configure_input@
|
||||
|
||||
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
|
||||
# 2003, 2004, 2005, 2006 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@
|
||||
pkglibdir = $(libdir)/@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@
|
||||
@USING_WIN32_TRUE@am__append_1 = -no-undefined -liphlpapi -lnetapi32 -lcap -lws2_32 \
|
||||
@USING_WIN32_TRUE@ -ldpnet
|
||||
|
||||
subdir = artnet
|
||||
DIST_COMMON = $(pkginclude_HEADERS) $(srcdir)/Makefile.am \
|
||||
$(srcdir)/Makefile.in
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
am__aclocal_m4_deps = $(top_srcdir)/configure.in
|
||||
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
|
||||
$(ACLOCAL_M4)
|
||||
mkinstalldirs = $(install_sh) -d
|
||||
CONFIG_HEADER = $(top_builddir)/config.h
|
||||
CONFIG_CLEAN_FILES =
|
||||
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
|
||||
am__vpath_adj = case $$p in \
|
||||
$(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
|
||||
*) f=$$p;; \
|
||||
esac;
|
||||
am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
|
||||
am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(pkgincludedir)"
|
||||
libLTLIBRARIES_INSTALL = $(INSTALL)
|
||||
LTLIBRARIES = $(lib_LTLIBRARIES)
|
||||
libartnet_la_LIBADD =
|
||||
am_libartnet_la_OBJECTS = artnet.lo misc.lo network.lo receive.lo \
|
||||
transmit.lo tod.lo
|
||||
libartnet_la_OBJECTS = $(am_libartnet_la_OBJECTS)
|
||||
libartnet_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
|
||||
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
|
||||
$(libartnet_la_LDFLAGS) $(LDFLAGS) -o $@
|
||||
DEFAULT_INCLUDES = -I. -I$(top_builddir)@am__isrc@
|
||||
depcomp = $(SHELL) $(top_srcdir)/depcomp
|
||||
am__depfiles_maybe = depfiles
|
||||
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
|
||||
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
|
||||
LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
|
||||
--mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
|
||||
$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
|
||||
CCLD = $(CC)
|
||||
LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
|
||||
--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
|
||||
$(LDFLAGS) -o $@
|
||||
SOURCES = $(libartnet_la_SOURCES)
|
||||
DIST_SOURCES = $(libartnet_la_SOURCES)
|
||||
pkgincludeHEADERS_INSTALL = $(INSTALL_HEADER)
|
||||
HEADERS = $(pkginclude_HEADERS)
|
||||
ETAGS = etags
|
||||
CTAGS = ctags
|
||||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
||||
pkgincludedir = $(includedir)/artnet
|
||||
ACLOCAL = @ACLOCAL@
|
||||
AMTAR = @AMTAR@
|
||||
AR = @AR@
|
||||
AS = @AS@
|
||||
AUTOCONF = @AUTOCONF@
|
||||
AUTOHEADER = @AUTOHEADER@
|
||||
AUTOMAKE = @AUTOMAKE@
|
||||
AWK = @AWK@
|
||||
CC = @CC@
|
||||
CCDEPMODE = @CCDEPMODE@
|
||||
CFLAGS = @CFLAGS@
|
||||
CPP = @CPP@
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
CXX = @CXX@
|
||||
CXXCPP = @CXXCPP@
|
||||
CXXDEPMODE = @CXXDEPMODE@
|
||||
CXXFLAGS = @CXXFLAGS@
|
||||
CYGPATH_W = @CYGPATH_W@
|
||||
DEFS = @DEFS@
|
||||
DEPDIR = @DEPDIR@
|
||||
DLLTOOL = @DLLTOOL@
|
||||
ECHO = @ECHO@
|
||||
ECHO_C = @ECHO_C@
|
||||
ECHO_N = @ECHO_N@
|
||||
ECHO_T = @ECHO_T@
|
||||
EGREP = @EGREP@
|
||||
EXEEXT = @EXEEXT@
|
||||
F77 = @F77@
|
||||
FFLAGS = @FFLAGS@
|
||||
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@
|
||||
LIBTOOL = @LIBTOOL@
|
||||
LN_S = @LN_S@
|
||||
LTLIBOBJS = @LTLIBOBJS@
|
||||
MAKEINFO = @MAKEINFO@
|
||||
MKDIR_P = @MKDIR_P@
|
||||
OBJDUMP = @OBJDUMP@
|
||||
OBJEXT = @OBJEXT@
|
||||
PACKAGE = @PACKAGE@
|
||||
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
|
||||
PACKAGE_NAME = @PACKAGE_NAME@
|
||||
PACKAGE_STRING = @PACKAGE_STRING@
|
||||
PACKAGE_TARNAME = @PACKAGE_TARNAME@
|
||||
PACKAGE_VERSION = @PACKAGE_VERSION@
|
||||
PATH_SEPARATOR = @PATH_SEPARATOR@
|
||||
RANLIB = @RANLIB@
|
||||
SET_MAKE = @SET_MAKE@
|
||||
SHELL = @SHELL@
|
||||
STRIP = @STRIP@
|
||||
VERSION = @VERSION@
|
||||
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@
|
||||
ac_ct_F77 = @ac_ct_F77@
|
||||
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_alias = @target_alias@
|
||||
top_builddir = @top_builddir@
|
||||
top_srcdir = @top_srcdir@
|
||||
INCLUDES = -I$(top_builddir) -I$(top_srcdir)
|
||||
AM_CFLAGS = -Wall -Werror -Wformat -W
|
||||
lib_LTLIBRARIES = libartnet.la
|
||||
libartnet_la_SOURCES = artnet.c private.h misc.c network.c receive.c \
|
||||
transmit.c tod.c
|
||||
|
||||
libartnet_la_LDFLAGS = -version-info 1:0:0 $(am__append_1)
|
||||
EXTRA_DIST = tod.h misc.h
|
||||
pkginclude_HEADERS = artnet.h packets.h common.h
|
||||
all: all-am
|
||||
|
||||
.SUFFIXES:
|
||||
.SUFFIXES: .c .lo .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 \
|
||||
&& exit 0; \
|
||||
exit 1;; \
|
||||
esac; \
|
||||
done; \
|
||||
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu artnet/Makefile'; \
|
||||
cd $(top_srcdir) && \
|
||||
$(AUTOMAKE) --gnu artnet/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
|
||||
install-libLTLIBRARIES: $(lib_LTLIBRARIES)
|
||||
@$(NORMAL_INSTALL)
|
||||
test -z "$(libdir)" || $(MKDIR_P) "$(DESTDIR)$(libdir)"
|
||||
@list='$(lib_LTLIBRARIES)'; for p in $$list; do \
|
||||
if test -f $$p; then \
|
||||
f=$(am__strip_dir) \
|
||||
echo " $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(libdir)/$$f'"; \
|
||||
$(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(libdir)/$$f"; \
|
||||
else :; fi; \
|
||||
done
|
||||
|
||||
uninstall-libLTLIBRARIES:
|
||||
@$(NORMAL_UNINSTALL)
|
||||
@list='$(lib_LTLIBRARIES)'; for p in $$list; do \
|
||||
p=$(am__strip_dir) \
|
||||
echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$p'"; \
|
||||
$(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$p"; \
|
||||
done
|
||||
|
||||
clean-libLTLIBRARIES:
|
||||
-test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES)
|
||||
@list='$(lib_LTLIBRARIES)'; for p in $$list; do \
|
||||
dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
|
||||
test "$$dir" != "$$p" || dir=.; \
|
||||
echo "rm -f \"$${dir}/so_locations\""; \
|
||||
rm -f "$${dir}/so_locations"; \
|
||||
done
|
||||
libartnet.la: $(libartnet_la_OBJECTS) $(libartnet_la_DEPENDENCIES)
|
||||
$(libartnet_la_LINK) -rpath $(libdir) $(libartnet_la_OBJECTS) $(libartnet_la_LIBADD) $(LIBS)
|
||||
|
||||
mostlyclean-compile:
|
||||
-rm -f *.$(OBJEXT)
|
||||
|
||||
distclean-compile:
|
||||
-rm -f *.tab.c
|
||||
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/artnet.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/misc.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/network.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/receive.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tod.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/transmit.Plo@am__quote@
|
||||
|
||||
.c.o:
|
||||
@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
|
||||
@am__fastdepCC_TRUE@ mv -f $(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@ mv -f $(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) '$<'`
|
||||
|
||||
.c.lo:
|
||||
@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
|
||||
@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $<
|
||||
|
||||
mostlyclean-libtool:
|
||||
-rm -f *.lo
|
||||
|
||||
clean-libtool:
|
||||
-rm -rf .libs _libs
|
||||
install-pkgincludeHEADERS: $(pkginclude_HEADERS)
|
||||
@$(NORMAL_INSTALL)
|
||||
test -z "$(pkgincludedir)" || $(MKDIR_P) "$(DESTDIR)$(pkgincludedir)"
|
||||
@list='$(pkginclude_HEADERS)'; for p in $$list; do \
|
||||
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
|
||||
f=$(am__strip_dir) \
|
||||
echo " $(pkgincludeHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(pkgincludedir)/$$f'"; \
|
||||
$(pkgincludeHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(pkgincludedir)/$$f"; \
|
||||
done
|
||||
|
||||
uninstall-pkgincludeHEADERS:
|
||||
@$(NORMAL_UNINSTALL)
|
||||
@list='$(pkginclude_HEADERS)'; for p in $$list; do \
|
||||
f=$(am__strip_dir) \
|
||||
echo " rm -f '$(DESTDIR)$(pkgincludedir)/$$f'"; \
|
||||
rm -f "$(DESTDIR)$(pkgincludedir)/$$f"; \
|
||||
done
|
||||
|
||||
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) ' { files[$$0] = 1; } \
|
||||
END { for (i in files) print i; }'`; \
|
||||
mkid -fID $$unique
|
||||
tags: TAGS
|
||||
|
||||
TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
|
||||
$(TAGS_FILES) $(LISP)
|
||||
tags=; \
|
||||
here=`pwd`; \
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) ' { files[$$0] = 1; } \
|
||||
END { for (i in files) print i; }'`; \
|
||||
if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
|
||||
test -n "$$unique" || unique=$$empty_fix; \
|
||||
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
|
||||
$$tags $$unique; \
|
||||
fi
|
||||
ctags: CTAGS
|
||||
CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
|
||||
$(TAGS_FILES) $(LISP)
|
||||
tags=; \
|
||||
here=`pwd`; \
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) ' { files[$$0] = 1; } \
|
||||
END { for (i in files) print i; }'`; \
|
||||
test -z "$(CTAGS_ARGS)$$tags$$unique" \
|
||||
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
|
||||
$$tags $$unique
|
||||
|
||||
GTAGS:
|
||||
here=`$(am__cd) $(top_builddir) && pwd` \
|
||||
&& cd $(top_srcdir) \
|
||||
&& gtags -i $(GTAGS_ARGS) $$here
|
||||
|
||||
distclean-tags:
|
||||
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
|
||||
|
||||
distdir: $(DISTFILES)
|
||||
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
||||
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
||||
list='$(DISTFILES)'; \
|
||||
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 $(srcdir)/$$file && test $$d != $(srcdir); then \
|
||||
cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
|
||||
fi; \
|
||||
cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
|
||||
else \
|
||||
test -f $(distdir)/$$file \
|
||||
|| cp -p $$d/$$file $(distdir)/$$file \
|
||||
|| exit 1; \
|
||||
fi; \
|
||||
done
|
||||
check-am: all-am
|
||||
check: check-am
|
||||
all-am: Makefile $(LTLIBRARIES) $(HEADERS)
|
||||
installdirs:
|
||||
for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(pkgincludedir)"; do \
|
||||
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
|
||||
done
|
||||
install: install-am
|
||||
install-exec: install-exec-am
|
||||
install-data: install-data-am
|
||||
uninstall: uninstall-am
|
||||
|
||||
install-am: all-am
|
||||
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
|
||||
|
||||
installcheck: installcheck-am
|
||||
install-strip:
|
||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
||||
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
|
||||
`test -z '$(STRIP)' || \
|
||||
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
|
||||
mostlyclean-generic:
|
||||
|
||||
clean-generic:
|
||||
|
||||
distclean-generic:
|
||||
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
|
||||
|
||||
maintainer-clean-generic:
|
||||
@echo "This command is intended for maintainers to use"
|
||||
@echo "it deletes files that may require special tools to rebuild."
|
||||
clean: clean-am
|
||||
|
||||
clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \
|
||||
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
|
||||
|
||||
info: info-am
|
||||
|
||||
info-am:
|
||||
|
||||
install-data-am: install-pkgincludeHEADERS
|
||||
|
||||
install-dvi: install-dvi-am
|
||||
|
||||
install-exec-am: install-libLTLIBRARIES
|
||||
|
||||
install-html: install-html-am
|
||||
|
||||
install-info: install-info-am
|
||||
|
||||
install-man:
|
||||
|
||||
install-pdf: install-pdf-am
|
||||
|
||||
install-ps: 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 \
|
||||
mostlyclean-libtool
|
||||
|
||||
pdf: pdf-am
|
||||
|
||||
pdf-am:
|
||||
|
||||
ps: ps-am
|
||||
|
||||
ps-am:
|
||||
|
||||
uninstall-am: uninstall-libLTLIBRARIES uninstall-pkgincludeHEADERS
|
||||
|
||||
.MAKE: install-am install-strip
|
||||
|
||||
.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
|
||||
clean-libLTLIBRARIES clean-libtool ctags distclean \
|
||||
distclean-compile distclean-generic distclean-libtool \
|
||||
distclean-tags distdir dvi dvi-am html html-am info info-am \
|
||||
install install-am install-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-libLTLIBRARIES install-man install-pdf install-pdf-am \
|
||||
install-pkgincludeHEADERS install-ps install-ps-am \
|
||||
install-strip installcheck installcheck-am installdirs \
|
||||
maintainer-clean maintainer-clean-generic mostlyclean \
|
||||
mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
|
||||
pdf pdf-am ps ps-am tags uninstall uninstall-am \
|
||||
uninstall-libLTLIBRARIES uninstall-pkgincludeHEADERS
|
||||
|
||||
# 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:
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,346 @@
|
|||
/*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*
|
||||
* artnet.h
|
||||
* Interface to libartnet
|
||||
* Copyright (C) 2004-2007 Simon Newton
|
||||
*/
|
||||
|
||||
#ifndef ARTNET_HEADER_H
|
||||
#define ARTNET_HEADER_H
|
||||
|
||||
#include <stdint.h>
|
||||
// order is important here for osx
|
||||
#include <sys/types.h>
|
||||
|
||||
#ifndef WIN32
|
||||
#include <sys/select.h>
|
||||
#else
|
||||
#include <Winsock2.h>
|
||||
typedef unsigned long in_addr_t;
|
||||
#endif
|
||||
|
||||
#include <artnet/common.h>
|
||||
|
||||
/* the external storage class is "extern" in UNIX; in MSW it's ugly. */
|
||||
#ifndef EXTERN
|
||||
#ifdef MSW
|
||||
#define EXTERN __declspec(dllexport) extern
|
||||
#else
|
||||
#define EXTERN extern
|
||||
#endif /* MSW */
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
EXTERN int ARTNET_ADDRESS_NO_CHANGE;
|
||||
|
||||
/**
|
||||
* An enum for setting the behaviour of a port.
|
||||
* Ports can either input data (DMX -> ArtNet) or
|
||||
* output (ArtNet -> DMX) data.
|
||||
*/
|
||||
typedef enum {
|
||||
ARTNET_ENABLE_INPUT = 0x40, /**< Enables the input for this port */
|
||||
ARTNET_ENABLE_OUTPUT = 0x80 /**< Enables the output for this port */
|
||||
} artnet_port_settings_t;
|
||||
|
||||
|
||||
typedef enum {
|
||||
ARTNET_PC_NONE = 0x00,
|
||||
ARTNET_PC_CANCEL = 0x01,
|
||||
ARTNET_PC_LED_NORMAL = 0x02,
|
||||
ARTNET_PC_LED_MUTE = 0x03,
|
||||
ARTNET_PC_LED_LOCATE = 0x04,
|
||||
ARTNET_PC_RESET = 0x05,
|
||||
ARTNET_PC_MERGE_LTP_O = 0x10,
|
||||
ARTNET_PC_MERGE_LTP_1 = 0x11,
|
||||
ARTNET_PC_MERGE_LTP_2 = 0x12,
|
||||
ARTNET_PC_MERGE_LTP_3 = 0x13,
|
||||
ARTNET_PC_MERGE_HTP_0 = 0x50,
|
||||
ARTNET_PC_MERGE_HTP_1 = 0x51,
|
||||
ARTNET_PC_MERGE_HTP_2 = 0x52,
|
||||
ARTNET_PC_MERGE_HTP_3 = 0x53,
|
||||
ARTNET_PC_CLR_0 = 0x93,
|
||||
ARTNET_PC_CLR_1 = 0x93,
|
||||
ARTNET_PC_CLR_2 = 0x93,
|
||||
ARTNET_PC_CLR_3 = 0x93,
|
||||
} artnet_port_command_t;
|
||||
|
||||
|
||||
/*
|
||||
* An enum for the type of data transmitted on a port.
|
||||
* As far as I know, only DMX-512 is supported
|
||||
*/
|
||||
typedef enum {
|
||||
ARTNET_PORT_DMX = 0x00, /**< Data is DMX-512 */
|
||||
ARTNET_PORT_MIDI = 0x01, /**< Data is MIDI */
|
||||
ARTNET_PORT_AVAB = 0x02, /**< Data is Avab */
|
||||
ARTNET_PORT_CMX = 0x03, /**< Data is Colortran CMX */
|
||||
ARTNET_PORT_ADB = 0x04, /**< Data is ABD 62.5 */
|
||||
ARTNET_PORT_ARTNET = 0x05 /**< Data is ArtNet */
|
||||
} artnet_port_data_code;
|
||||
|
||||
|
||||
// defines the status of the firmware transfer
|
||||
typedef enum {
|
||||
ARTNET_FIRMWARE_BLOCKGOOD = 0x00,
|
||||
ARTNET_FIRMWARE_ALLGOOD = 0x01,
|
||||
ARTNET_FIRMWARE_FAIL = 0xff,
|
||||
} artnet_firmware_status_code;
|
||||
|
||||
// tod actions
|
||||
typedef enum {
|
||||
ARTNET_TOD_FULL = 0x00,
|
||||
ARTNET_TOD_FLUSH = 0x01,
|
||||
} artnet_tod_command_code;
|
||||
|
||||
|
||||
/**
|
||||
* An enum for refering to a particular input or output port.
|
||||
*/
|
||||
typedef enum {
|
||||
ARTNET_INPUT_PORT = 1, /**< The input port */
|
||||
ARTNET_OUTPUT_PORT, /**< The output port */
|
||||
} artnet_port_dir_t;
|
||||
|
||||
|
||||
/*
|
||||
* Enum describing the type of node
|
||||
*/
|
||||
typedef enum {
|
||||
ARTNET_SRV, /**< An ArtNet server (transmitts DMX data) */
|
||||
ARTNET_NODE, /**< An ArtNet node (dmx reciever) */
|
||||
ARTNET_MSRV, /**< A Media Server */
|
||||
ARTNET_ROUTE, /**< No Effect currently */
|
||||
ARTNET_BACKUP, /**< No Effect currently */
|
||||
ARTNET_RAW /**< Raw Node - used for diagnostics */
|
||||
} artnet_node_type;
|
||||
|
||||
|
||||
/*
|
||||
* Enum for the talk-to-me value
|
||||
* These values can be &'ed togeather, so for example to set private replies
|
||||
* and auto replying use :
|
||||
* (ARTNET_TTM_PRIVATE & ARTNET_TTM_AUTO)
|
||||
*/
|
||||
typedef enum {
|
||||
ARTNET_TTM_DEFAULT = 0xFF, /**< default, ArtPollReplies are broadcast, and nodes won't send a ArtPollReply when conditions change */
|
||||
ARTNET_TTM_PRIVATE = 0xFE, /**< ArtPollReplies aren't broadcast */
|
||||
ARTNET_TTM_AUTO = 0xFD /**< ArtPollReplies are send when node conditions chang */
|
||||
} artnet_ttm_value_t;
|
||||
|
||||
/**
|
||||
* Enums for the application defined handlers
|
||||
*/
|
||||
typedef enum {
|
||||
ARTNET_RECV_HANDLER, /**< Called on reciept of any ArtNet packet */
|
||||
ARTNET_SEND_HANDLER, /**< Called on transmission of any ArtNet packet */
|
||||
ARTNET_POLL_HANDLER, /**< Called on reciept of an ArtPoll packet */
|
||||
ARTNET_REPLY_HANDLER, /**< Called on reciept of an ArtPollReply packet */
|
||||
ARTNET_DMX_HANDLER, /**< Called on reciept of an ArtDMX packet */
|
||||
ARTNET_ADDRESS_HANDLER, /**< Called on reciept of an ArtAddress packet */
|
||||
ARTNET_INPUT_HANDLER, /**< Called on reciept of an ArtInput packet */
|
||||
ARTNET_TOD_REQUEST_HANDLER, /**< Called on reciept of an ArtTodRequest packet */
|
||||
ARTNET_TOD_DATA_HANDLER, /**< Called on reciept of an ArtTodData packet */
|
||||
ARTNET_TOD_CONTROL_HANDLER, /**< Called on reciept of an ArtTodControl packet */
|
||||
ARTNET_RDM_HANDLER, /**< Called on reciept of an ArtRdm packet */
|
||||
ARTNET_IPPROG_HANDLER, /**< Called on reciept of an ArtIPProg packet */
|
||||
ARTNET_FIRMWARE_HANDLER, /**< Called on reciept of an ArtFirmware packet */
|
||||
ARTNET_FIRMWARE_REPLY_HANDLER, /**< Called on reciept of an ArtFirmwareReply packet */
|
||||
} artnet_handler_name_t;
|
||||
|
||||
|
||||
/*
|
||||
* Describes a remote ArtNet node that has been discovered
|
||||
*/
|
||||
typedef struct artnet_node_entry_s {
|
||||
uint8_t ip[ARTNET_IP_SIZE]; /**< The IP address, Network byte ordered*/
|
||||
int16_t ver; /**< The firmware version */
|
||||
int16_t sub; /**< The subnet address */
|
||||
int16_t oem; /**< The OEM value */
|
||||
uint8_t ubea; /**< The UBEA version */
|
||||
uint8_t status;
|
||||
uint8_t etsaman[ARTNET_ESTA_SIZE]; /**< The ESTA Manufacturer code */
|
||||
uint8_t shortname[ARTNET_SHORT_NAME_LENGTH]; /**< The short node name */
|
||||
uint8_t longname[ARTNET_LONG_NAME_LENGTH]; /**< The long node name */
|
||||
uint8_t nodereport[ARTNET_REPORT_LENGTH]; /**< The node report */
|
||||
int16_t numbports; /**< The number of ports */
|
||||
uint8_t porttypes[ARTNET_MAX_PORTS]; /**< The type of ports */
|
||||
uint8_t goodinput[ARTNET_MAX_PORTS];
|
||||
uint8_t goodoutput[ARTNET_MAX_PORTS];
|
||||
uint8_t swin[ARTNET_MAX_PORTS];
|
||||
uint8_t swout[ARTNET_MAX_PORTS];
|
||||
uint8_t swvideo;
|
||||
uint8_t swmacro;
|
||||
uint8_t swremote;
|
||||
uint8_t style;
|
||||
uint8_t mac[ARTNET_MAC_SIZE]; /**< The MAC address of the node */
|
||||
} artnet_node_entry_t;
|
||||
|
||||
/** A pointer to an artnet_node_entry_t */
|
||||
typedef artnet_node_entry_t *artnet_node_entry;
|
||||
|
||||
typedef struct {
|
||||
char short_name[ARTNET_SHORT_NAME_LENGTH];
|
||||
char long_name[ARTNET_LONG_NAME_LENGTH];
|
||||
uint8_t subnet;
|
||||
uint8_t in_ports[ARTNET_MAX_PORTS];
|
||||
uint8_t out_ports[ARTNET_MAX_PORTS];
|
||||
} artnet_node_config_t;
|
||||
|
||||
|
||||
/** The local ArtNet node */
|
||||
typedef void *artnet_node;
|
||||
|
||||
/** A list of remote ArtNet nodes */
|
||||
typedef void *artnet_node_list;
|
||||
|
||||
// node control functions
|
||||
EXTERN artnet_node artnet_new(const char *ip, int verbose);
|
||||
EXTERN int artnet_setoem(artnet_node vn, uint8_t hi, uint8_t lo);
|
||||
EXTERN int artnet_setesta(artnet_node vn, char hi, char lo);
|
||||
EXTERN int artnet_set_bcast_limit(artnet_node vn, int limit);
|
||||
EXTERN int artnet_start(artnet_node n);
|
||||
EXTERN int artnet_read(artnet_node n, int timeout);
|
||||
EXTERN int artnet_stop(artnet_node n);
|
||||
EXTERN int artnet_destroy(artnet_node n);
|
||||
|
||||
int artnet_join(artnet_node vn1, artnet_node vn2);
|
||||
|
||||
// handler functions
|
||||
// these need to be cleaned up into a generic interface
|
||||
EXTERN int artnet_set_handler(artnet_node vn,
|
||||
artnet_handler_name_t handler,
|
||||
int (*fh)(artnet_node n, void *pp, void *d),
|
||||
void* data);
|
||||
EXTERN int artnet_set_dmx_handler(artnet_node vn,
|
||||
int (*fh)(artnet_node n, int port, void *d),
|
||||
void *data);
|
||||
EXTERN int artnet_set_program_handler(artnet_node vn,
|
||||
int (*fh)(artnet_node n, void *d),
|
||||
void *data);
|
||||
EXTERN int artnet_set_firmware_handler(artnet_node vn,
|
||||
int (*fh)(artnet_node n, int ubea, uint16_t *data, int length, void *d),
|
||||
void *data);
|
||||
EXTERN int artnet_set_rdm_handler(artnet_node vn,
|
||||
int (*fh)(artnet_node n, int address, uint8_t *rdm, int length, void *d),
|
||||
void *data);
|
||||
EXTERN int artnet_set_rdm_initiate_handler(artnet_node vn,
|
||||
int (*fh)(artnet_node n, int port, void *d),
|
||||
void *data);
|
||||
EXTERN int artnet_set_rdm_tod_handler(artnet_node vn,
|
||||
int (*fh)(artnet_node n, int port, void *d),
|
||||
void *data);
|
||||
|
||||
// send functions
|
||||
EXTERN int artnet_send_poll(artnet_node n,
|
||||
const char *ip,
|
||||
artnet_ttm_value_t talk_to_me);
|
||||
EXTERN int artnet_send_poll_reply(artnet_node n);
|
||||
EXTERN int artnet_send_dmx(artnet_node n,
|
||||
int port_id,
|
||||
int16_t length,
|
||||
const uint8_t *data);
|
||||
EXTERN int artnet_raw_send_dmx(artnet_node vn,
|
||||
uint8_t uni,
|
||||
int16_t length,
|
||||
const uint8_t *data);
|
||||
EXTERN int artnet_send_address(artnet_node n,
|
||||
artnet_node_entry e,
|
||||
const char *shortName,
|
||||
const char *longName,
|
||||
uint8_t inAddr[ARTNET_MAX_PORTS],
|
||||
uint8_t outAddr[ARTNET_MAX_PORTS],
|
||||
uint8_t subAddr,
|
||||
artnet_port_command_t cmd);
|
||||
EXTERN int artnet_send_input(artnet_node n,
|
||||
artnet_node_entry e,
|
||||
uint8_t settings[ARTNET_MAX_PORTS]);
|
||||
EXTERN int artnet_send_firmware(artnet_node vn,
|
||||
artnet_node_entry e,
|
||||
int ubea,
|
||||
uint16_t *data,
|
||||
int length,
|
||||
int (*fh)(artnet_node n, artnet_firmware_status_code code, void *d),
|
||||
void *user_data);
|
||||
EXTERN int artnet_send_firmware_reply(artnet_node vn,
|
||||
artnet_node_entry e,
|
||||
artnet_firmware_status_code code);
|
||||
|
||||
// rdm functions
|
||||
EXTERN int artnet_send_tod_request(artnet_node vn);
|
||||
EXTERN int artnet_send_tod_control(artnet_node vn,
|
||||
uint8_t address,
|
||||
artnet_tod_command_code action);
|
||||
EXTERN int artnet_send_tod_data(artnet_node vn, int port);
|
||||
EXTERN int artnet_send_rdm(artnet_node vn,
|
||||
uint8_t address,
|
||||
uint8_t *data,
|
||||
int length);
|
||||
EXTERN int artnet_add_rdm_device(artnet_node vn,
|
||||
int port,
|
||||
uint8_t uid[ARTNET_RDM_UID_WIDTH]);
|
||||
EXTERN int artnet_add_rdm_devices(artnet_node vn,
|
||||
int port,
|
||||
uint8_t *uid,
|
||||
int count);
|
||||
EXTERN int artnet_remove_rdm_device(artnet_node vn,
|
||||
int port,
|
||||
uint8_t uid[ARTNET_RDM_UID_WIDTH]);
|
||||
|
||||
// recv functions
|
||||
EXTERN uint8_t *artnet_read_dmx(artnet_node n, int port_id, int *length);
|
||||
|
||||
// state changing functions
|
||||
EXTERN int artnet_set_node_type(artnet_node n, artnet_node_type type);
|
||||
EXTERN int artnet_set_short_name(artnet_node vn, const char *name);
|
||||
EXTERN int artnet_set_long_name(artnet_node n, const char *name);
|
||||
|
||||
//port manipulation functions
|
||||
EXTERN int artnet_set_port_type(artnet_node n,
|
||||
int id,
|
||||
artnet_port_settings_t settings,
|
||||
artnet_port_data_code data);
|
||||
EXTERN int artnet_set_port_addr(artnet_node n,
|
||||
int id,
|
||||
artnet_port_dir_t dir,
|
||||
uint8_t addr);
|
||||
EXTERN int artnet_set_subnet_addr(artnet_node n, uint8_t subnet);
|
||||
EXTERN int artnet_get_universe_addr(artnet_node n,
|
||||
int id,
|
||||
artnet_port_dir_t dir);
|
||||
|
||||
//node list functions
|
||||
EXTERN artnet_node_list artnet_get_nl(artnet_node n);
|
||||
EXTERN artnet_node_entry artnet_nl_first(artnet_node_list nl);
|
||||
EXTERN artnet_node_entry artnet_nl_next(artnet_node_list nl);
|
||||
EXTERN int artnet_nl_get_length(artnet_node_list nl);
|
||||
|
||||
// misc
|
||||
EXTERN int artnet_dump_config(artnet_node n);
|
||||
EXTERN int artnet_get_config(artnet_node n, artnet_node_config_t *config);
|
||||
EXTERN int artnet_get_sd(artnet_node n);
|
||||
EXTERN int artnet_set_fdset(artnet_node vn, fd_set *fdset);
|
||||
|
||||
char *artnet_strerror();
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
|
@ -0,0 +1,83 @@
|
|||
/*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*
|
||||
* common.c
|
||||
* Constants required for both internally and externally
|
||||
* Copyright (C) 2004-2006 Simon Newton
|
||||
*/
|
||||
|
||||
#ifndef ARTNET_COMMON_H
|
||||
#define ARTNET_COMMON_H
|
||||
|
||||
/*
|
||||
* libartnet error codes
|
||||
*/
|
||||
enum {
|
||||
ARTNET_EOK = 0,
|
||||
ARTNET_ENET = -1, // network error
|
||||
ARTNET_EMEM = -2, // memory error
|
||||
ARTNET_EARG = -3, // argument error
|
||||
ARTNET_ESTATE = -4, // state error
|
||||
ARTNET_EACTION = -5, // invalid action
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
* The maximum ports per node built into the ArtNet protocol.
|
||||
* This is always 4. Don't change it unless you really know what your doing
|
||||
*/
|
||||
enum { ARTNET_MAX_PORTS = 4 };
|
||||
|
||||
/**
|
||||
* The length of the short name field. Always 18
|
||||
*/
|
||||
enum { ARTNET_SHORT_NAME_LENGTH = 18 };
|
||||
|
||||
/**
|
||||
* The length of the long name field. Always 64
|
||||
*/
|
||||
enum { ARTNET_LONG_NAME_LENGTH = 64 };
|
||||
|
||||
/**
|
||||
* The length of the report field. Always 64
|
||||
*/
|
||||
enum { ARTNET_REPORT_LENGTH = 64 };
|
||||
|
||||
/**
|
||||
* The length of the DMX field. Always 512
|
||||
*/
|
||||
enum { ARTNET_DMX_LENGTH = 512 };
|
||||
|
||||
/*
|
||||
* Number of bytes in a RDM UID
|
||||
*/
|
||||
enum { ARTNET_RDM_UID_WIDTH = 6 };
|
||||
|
||||
/*
|
||||
* Length of the hardware address
|
||||
*/
|
||||
enum { ARTNET_MAC_SIZE = 6 };
|
||||
|
||||
/*
|
||||
* Length of the ESTA field
|
||||
*/
|
||||
enum { ARTNET_ESTA_SIZE = 2 };
|
||||
|
||||
/*
|
||||
* Length of the IP field
|
||||
*/
|
||||
enum { ARTNET_IP_SIZE = 4 };
|
||||
|
||||
#endif
|
|
@ -0,0 +1,56 @@
|
|||
/*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*
|
||||
* misc.c
|
||||
* Misc code for libartnet (almost nothing these days)
|
||||
* Copyright (C) 2004-2005 Simon Newton
|
||||
*/
|
||||
|
||||
#include <stdarg.h>
|
||||
#include <stdio.h>
|
||||
#include "private.h"
|
||||
|
||||
// static buffer for the error strings
|
||||
char artnet_errstr[256];
|
||||
|
||||
/*
|
||||
* Libartnet error function
|
||||
* This writes the error string to artnet_errstr, which can be accessed
|
||||
* using artnet_strerror();
|
||||
*/
|
||||
void artnet_error(const char *fmt, ...) {
|
||||
va_list ap;
|
||||
va_start(ap, fmt);
|
||||
vsnprintf(artnet_errstr, sizeof(artnet_errstr), fmt, ap);
|
||||
va_end(ap);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Converts 4 bytes in big endian order to a 32 bit int
|
||||
*/
|
||||
int32_t artnet_misc_nbytes_to_32(uint8_t bytes[4]) {
|
||||
return (bytes[0] << 24) | (bytes[1] << 16) | (bytes[2] << 8) | bytes[3];
|
||||
}
|
||||
|
||||
/*
|
||||
* Converts an int to an arrany of 4 bytes in big endian format
|
||||
*/
|
||||
void artnet_misc_int_to_bytes(int data, uint8_t *bytes) {
|
||||
bytes[3] = (data & 0x000000FF);
|
||||
bytes[2] = (data & 0x0000FF00) >> 8;
|
||||
bytes[1] = (data & 0x00FF0000) >> 16;
|
||||
bytes[0] = (data & 0xFF000000) >> 24;
|
||||
}
|
|
@ -0,0 +1,42 @@
|
|||
/*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*
|
||||
* misc.h
|
||||
* Header file for misc.c
|
||||
* Copyright (C) 2004-2005 Simon Newton
|
||||
*/
|
||||
|
||||
#ifndef ARTNET_MISC_H
|
||||
#define ARTNET_MISC_H
|
||||
|
||||
#include <errno.h>
|
||||
#include <string.h>
|
||||
|
||||
extern char artnet_errstr[256];
|
||||
void artnet_error(const char *fmt, ...);
|
||||
int32_t artnet_misc_nbytes_to_32(uint8_t bytes[4]);
|
||||
void artnet_misc_int_to_bytes(int data, uint8_t *bytes);
|
||||
|
||||
// check if the node is null and return an error
|
||||
#define check_nullnode(node) if (node == NULL) { \
|
||||
artnet_error("%s : argument 1 (artnet_node) was null" , __FUNCTION__ ); \
|
||||
return ARTNET_EARG; \
|
||||
}
|
||||
|
||||
#define artnet_error_malloc() artnet_error("%s : malloc error %s" , __FUNCTION__, strerror(errno) )
|
||||
#define artnet_error_realloc() artnet_error("%s : realloc error %s" , __FUNCTION__, strerror(errno) )
|
||||
#define artnet_error_nullnode() artnet_error("%s : argument 1 (artnet_node) was null" , __FUNCTION__ )
|
||||
|
||||
#endif
|
|
@ -0,0 +1,742 @@
|
|||
/*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*
|
||||
* network.c
|
||||
* Network code for libartnet
|
||||
* Copyright (C) 2004-2007 Simon Newton
|
||||
*
|
||||
*/
|
||||
|
||||
#include <errno.h>
|
||||
|
||||
#ifndef WIN32
|
||||
#include <sys/socket.h> // socket before net/if.h for mac
|
||||
#include <net/if.h>
|
||||
#include <sys/ioctl.h>
|
||||
#else
|
||||
typedef int socklen_t;
|
||||
#include <winsock2.h>
|
||||
#include <Lm.h>
|
||||
#include <iphlpapi.h>
|
||||
#endif
|
||||
|
||||
#include <unistd.h>
|
||||
|
||||
#include "private.h"
|
||||
|
||||
#ifdef HAVE_GETIFADDRS
|
||||
#ifdef HAVE_LINUX_IF_PACKET_H
|
||||
#define USE_GETIFADDRS
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef USE_GETIFADDRS
|
||||
#include <ifaddrs.h>
|
||||
#include <linux/types.h> // required by if_packet
|
||||
#include <linux/if_packet.h>
|
||||
#endif
|
||||
|
||||
|
||||
enum { INITIAL_IFACE_COUNT = 10 };
|
||||
enum { IFACE_COUNT_INC = 5 };
|
||||
enum { IFNAME_SIZE = 32 }; // 32 sounds a reasonable size
|
||||
|
||||
typedef struct iface_s {
|
||||
struct sockaddr_in ip_addr;
|
||||
struct sockaddr_in bcast_addr;
|
||||
int8_t hw_addr[ARTNET_MAC_SIZE];
|
||||
char if_name[IFNAME_SIZE];
|
||||
struct iface_s *next;
|
||||
} iface_t;
|
||||
|
||||
unsigned long LOOPBACK_IP = 0x7F000001;
|
||||
|
||||
|
||||
/*
|
||||
* Free memory used by the iface's list
|
||||
* @param head a pointer to the head of the list
|
||||
*/
|
||||
static void free_ifaces(iface_t *head) {
|
||||
iface_t *ift, *ift_next;
|
||||
|
||||
for (ift = head; ift != NULL; ift = ift_next) {
|
||||
ift_next = ift->next;
|
||||
free(ift);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Add a new interface to an interface list
|
||||
* @param head pointer to the head of the list
|
||||
* @param tail pointer to the end of the list
|
||||
* @return a new iface_t or void
|
||||
*/
|
||||
static iface_t *new_iface(iface_t **head, iface_t **tail) {
|
||||
iface_t *iface = (iface_t*) calloc(1, sizeof(iface_t));
|
||||
|
||||
if (!iface) {
|
||||
artnet_error("%s: calloc error %s" , __FUNCTION__, strerror(errno));
|
||||
return NULL;
|
||||
}
|
||||
memset(iface, 0, sizeof(iface_t));
|
||||
|
||||
if (!*head) {
|
||||
*head = *tail = iface;
|
||||
} else {
|
||||
(*tail)->next = iface;
|
||||
*tail = iface;
|
||||
}
|
||||
return iface;
|
||||
}
|
||||
|
||||
|
||||
#ifdef WIN32
|
||||
|
||||
/*
|
||||
* Set if_head to point to a list of iface_t structures which represent the
|
||||
* interfaces on this machine
|
||||
* @param ift_head the address of the pointer to the head of the list
|
||||
*/
|
||||
static int get_ifaces(iface_t **if_head) {
|
||||
iface_t *if_tail, *iface;
|
||||
PIP_ADAPTER_INFO pAdapter = NULL;
|
||||
PIP_ADAPTER_INFO pAdapterInfo;
|
||||
IP_ADDR_STRING *ipAddress;
|
||||
ULONG ulOutBufLen = sizeof(IP_ADAPTER_INFO);
|
||||
unsigned long net, mask;
|
||||
if_tail = NULL;
|
||||
|
||||
while (1) {
|
||||
pAdapterInfo = (IP_ADAPTER_INFO*) malloc(ulOutBufLen);
|
||||
if (!pAdapterInfo) {
|
||||
artnet_error("Error allocating memory needed for GetAdaptersinfo");
|
||||
return ARTNET_EMEM;
|
||||
}
|
||||
|
||||
DWORD status = GetAdaptersInfo(pAdapterInfo, &ulOutBufLen);
|
||||
if (status == NO_ERROR)
|
||||
break;
|
||||
|
||||
free(pAdapterInfo);
|
||||
if (status != ERROR_BUFFER_OVERFLOW) {
|
||||
printf("GetAdaptersInfo failed with error: %d\n", (int) status);
|
||||
return ARTNET_ENET;
|
||||
}
|
||||
}
|
||||
|
||||
for (pAdapter = pAdapterInfo;
|
||||
pAdapter && pAdapter < pAdapterInfo + ulOutBufLen;
|
||||
pAdapter = pAdapter->Next) {
|
||||
|
||||
if(pAdapter->Type != MIB_IF_TYPE_ETHERNET)
|
||||
continue;
|
||||
|
||||
for (ipAddress = &pAdapter->IpAddressList; ipAddress;
|
||||
ipAddress = ipAddress->Next) {
|
||||
|
||||
net = inet_addr(ipAddress->IpAddress.String);
|
||||
if (net) {
|
||||
// Windows doesn't seem to have the notion of an interface being 'up'
|
||||
// so we check if this interface has an address assigned.
|
||||
iface = new_iface(if_head, &if_tail);
|
||||
if (!iface)
|
||||
continue;
|
||||
|
||||
mask = inet_addr(ipAddress->IpMask.String);
|
||||
strncpy(iface->if_name, pAdapter->AdapterName, IFNAME_SIZE);
|
||||
memcpy(iface->hw_addr, pAdapter->Address, ARTNET_MAC_SIZE);
|
||||
iface->ip_addr.sin_addr.s_addr = net;
|
||||
iface->bcast_addr.sin_addr.s_addr = (
|
||||
(net & mask) | (0xFFFFFFFF ^ mask));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
free(pAdapterInfo);
|
||||
return (ARTNET_EOK);
|
||||
}
|
||||
|
||||
# else // not WIN32
|
||||
|
||||
#ifdef USE_GETIFADDRS
|
||||
|
||||
/*
|
||||
* Check if we are interested in this interface
|
||||
* @param ifa a pointer to a ifaddr struct
|
||||
*/
|
||||
static void add_iface_if_needed(iface_t **head, iface_t **tail,
|
||||
struct ifaddrs *ifa) {
|
||||
|
||||
// skip down, loopback and non inet interfaces
|
||||
if (!ifa || !ifa->ifa_addr) return;
|
||||
if (!(ifa->ifa_flags & IFF_UP)) return;
|
||||
if (ifa->ifa_flags & IFF_LOOPBACK) return;
|
||||
if (ifa->ifa_addr->sa_family != AF_INET) return;
|
||||
|
||||
iface_t *iface = new_iface(head, tail);
|
||||
struct sockaddr_in *sin = (struct sockaddr_in*) ifa->ifa_addr;
|
||||
iface->ip_addr.sin_addr = sin->sin_addr;
|
||||
strncpy(iface->if_name, ifa->ifa_name, IFNAME_SIZE - 1);
|
||||
|
||||
if (ifa->ifa_flags & IFF_BROADCAST) {
|
||||
sin = (struct sockaddr_in *) ifa->ifa_broadaddr;
|
||||
iface->bcast_addr.sin_addr = sin->sin_addr;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Set if_head to point to a list of iface_t structures which represent the
|
||||
* interfaces on this machine
|
||||
* @param ift_head the address of the pointer to the head of the list
|
||||
*/
|
||||
static int get_ifaces(iface_t **if_head) {
|
||||
struct ifaddrs *ifa_list, *ifa_iter;
|
||||
iface_t *if_tail, *if_iter;
|
||||
struct sockaddr_ll *sll;
|
||||
char *if_name, *cptr;
|
||||
*if_head = if_tail = NULL;
|
||||
|
||||
if (getifaddrs(&ifa_list) != 0) {
|
||||
artnet_error("Error getting interfaces: %s", strerror(errno));
|
||||
return ARTNET_ENET;
|
||||
}
|
||||
|
||||
for (ifa_iter = ifa_list; ifa_iter; ifa_iter = ifa_iter->ifa_next)
|
||||
add_iface_if_needed(if_head, &if_tail, ifa_iter);
|
||||
|
||||
// Match up the interfaces with the corrosponding AF_PACKET interface
|
||||
// to fetch the hw addresses
|
||||
//
|
||||
// TODO: Will probably not work on OS X, it should
|
||||
// return AF_LINK -type sockaddr
|
||||
for (if_iter = *if_head; if_iter; if_iter = if_iter->next) {
|
||||
if_name = strdup(if_iter->if_name);
|
||||
|
||||
// if this is an alias, get mac of real interface
|
||||
if ((cptr = strchr(if_name, ':')))
|
||||
*cptr = 0;
|
||||
|
||||
// Find corresponding iface_t structure
|
||||
for (ifa_iter = ifa_list; ifa_iter; ifa_iter = ifa_iter->ifa_next) {
|
||||
if ((!ifa_iter->ifa_addr) || ifa_iter->ifa_addr->sa_family != AF_PACKET)
|
||||
continue;
|
||||
|
||||
if (strncmp(if_name, ifa_iter->ifa_name, IFNAME_SIZE) == 0) {
|
||||
// Found matching hw-address
|
||||
sll = (struct sockaddr_ll*) ifa_iter->ifa_addr;
|
||||
memcpy(if_iter->hw_addr, sll->sll_addr, ARTNET_MAC_SIZE);
|
||||
break;
|
||||
}
|
||||
}
|
||||
free(if_name);
|
||||
}
|
||||
freeifaddrs(ifa_list);
|
||||
return 0;
|
||||
}
|
||||
|
||||
#else // no GETIFADDRS
|
||||
|
||||
/*
|
||||
* Set if_head to point to a list of iface_t structures which represent the
|
||||
* interfaces on this machine
|
||||
* @param ift_head the address of the pointer to the head of the list
|
||||
*/
|
||||
static int get_ifaces(iface_t **if_head) {
|
||||
struct ifconf ifc;
|
||||
struct ifreq *ifr, ifrcopy;
|
||||
struct sockaddr_in *sin;
|
||||
int len, lastlen, flags;
|
||||
char *buf, *ptr;
|
||||
iface_t *if_tail, *iface;
|
||||
int ret = ARTNET_EOK;
|
||||
int sd;
|
||||
|
||||
*if_head = if_tail = NULL;
|
||||
|
||||
// create socket to get iface config
|
||||
sd = socket(PF_INET, SOCK_DGRAM, 0);
|
||||
|
||||
if (sd < 0) {
|
||||
artnet_error("%s : Could not create socket %s", __FUNCTION__, strerror(errno));
|
||||
ret = ARTNET_ENET;
|
||||
goto e_return;
|
||||
}
|
||||
|
||||
// first use ioctl to get a listing of interfaces
|
||||
lastlen = 0;
|
||||
len = INITIAL_IFACE_COUNT * sizeof(struct ifreq);
|
||||
|
||||
for (;;) {
|
||||
buf = malloc(len);
|
||||
|
||||
if (buf == NULL) {
|
||||
artnet_error_malloc();
|
||||
ret = ARTNET_EMEM;
|
||||
goto e_free;
|
||||
}
|
||||
|
||||
ifc.ifc_len = len;
|
||||
ifc.ifc_buf = buf;
|
||||
if (ioctl(sd, SIOCGIFCONF, &ifc) < 0) {
|
||||
if (errno != EINVAL || lastlen != 0) {
|
||||
artnet_error("%s : ioctl error %s", __FUNCTION__, strerror(errno));
|
||||
ret = ARTNET_ENET;
|
||||
goto e_free;
|
||||
}
|
||||
} else {
|
||||
if (ifc.ifc_len == lastlen)
|
||||
break;
|
||||
lastlen = ifc.ifc_len;
|
||||
}
|
||||
len += IFACE_COUNT_INC * sizeof(struct ifreq);
|
||||
free(buf);
|
||||
}
|
||||
|
||||
// loop through each iface
|
||||
for (ptr = buf; ptr < buf + ifc.ifc_len;) {
|
||||
ifr = (struct ifreq*) ptr;
|
||||
|
||||
// work out length here
|
||||
#ifdef HAVE_SOCKADDR_SA_LEN
|
||||
len = max(sizeof(struct sockaddr), ifr->ifr_addr.sa_len);
|
||||
#else
|
||||
switch (ifr->ifr_addr.sa_family) {
|
||||
#ifdef IPV6
|
||||
case AF_INET6:
|
||||
len = sizeof(struct sockaddr_in6);
|
||||
break;
|
||||
#endif
|
||||
case AF_INET:
|
||||
default:
|
||||
len = sizeof(SA);
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
|
||||
ptr += sizeof(ifr->ifr_name) + len;
|
||||
|
||||
// look for AF_INET interfaces
|
||||
if (ifr->ifr_addr.sa_family == AF_INET) {
|
||||
ifrcopy = *ifr;
|
||||
if (ioctl(sd, SIOCGIFFLAGS, &ifrcopy) < 0) {
|
||||
artnet_error("%s : ioctl error %s" , __FUNCTION__, strerror(errno));
|
||||
ret = ARTNET_ENET;
|
||||
goto e_free_list;
|
||||
}
|
||||
|
||||
flags = ifrcopy.ifr_flags;
|
||||
if ((flags & IFF_UP) == 0)
|
||||
continue; //skip down interfaces
|
||||
|
||||
if ((flags & IFF_LOOPBACK))
|
||||
continue; //skip lookback
|
||||
|
||||
iface = new_iface(if_head, &if_tail);
|
||||
if (!iface)
|
||||
goto e_free_list;
|
||||
|
||||
sin = (struct sockaddr_in *) &ifr->ifr_addr;
|
||||
iface->ip_addr.sin_addr = sin->sin_addr;
|
||||
|
||||
// fetch bcast address
|
||||
#ifdef SIOCGIFBRDADDR
|
||||
if (flags & IFF_BROADCAST) {
|
||||
if (ioctl(sd, SIOCGIFBRDADDR, &ifrcopy) < 0) {
|
||||
artnet_error("%s : ioctl error %s" , __FUNCTION__, strerror(errno));
|
||||
ret = ARTNET_ENET;
|
||||
goto e_free_list;
|
||||
}
|
||||
|
||||
sin = (struct sockaddr_in *) &ifrcopy.ifr_broadaddr;
|
||||
iface->bcast_addr.sin_addr = sin->sin_addr;
|
||||
}
|
||||
#endif
|
||||
// fetch hardware address
|
||||
#ifdef SIOCGIFHWADDR
|
||||
if (flags & SIOCGIFHWADDR) {
|
||||
if (ioctl(sd, SIOCGIFHWADDR, &ifrcopy) < 0) {
|
||||
artnet_error("%s : ioctl error %s", __FUNCTION__, strerror(errno));
|
||||
ret = ARTNET_ENET;
|
||||
goto e_free_list;
|
||||
}
|
||||
memcpy(&iface->hw_addr, ifrcopy.ifr_hwaddr.sa_data, ARTNET_MAC_SIZE);
|
||||
}
|
||||
#endif
|
||||
|
||||
/* ok, if that all failed we should prob try and use sysctl to work out the bcast
|
||||
* and hware addresses
|
||||
* i'll leave that for another day
|
||||
*/
|
||||
}
|
||||
}
|
||||
free(buf);
|
||||
return ARTNET_EOK;
|
||||
|
||||
e_free_list:
|
||||
free_ifaces(*if_head);
|
||||
e_free:
|
||||
free(buf);
|
||||
close(sd);
|
||||
e_return:
|
||||
return ret;
|
||||
}
|
||||
|
||||
#endif // GETIFADDRS
|
||||
#endif // not WIN32
|
||||
|
||||
|
||||
/*
|
||||
* Scan for interfaces, and work out which one the user wanted to use.
|
||||
*/
|
||||
int artnet_net_init(node n, const char *preferred_ip) {
|
||||
iface_t *ift, *ift_head = NULL;
|
||||
struct in_addr wanted_ip;
|
||||
|
||||
int found = FALSE;
|
||||
int i;
|
||||
int ret = ARTNET_EOK;
|
||||
|
||||
if ((ret = get_ifaces(&ift_head)))
|
||||
goto e_return;
|
||||
|
||||
if (n->state.verbose) {
|
||||
printf("#### INTERFACES FOUND ####\n");
|
||||
for (ift = ift_head; ift != NULL; ift = ift->next) {
|
||||
printf("IP: %s\n", inet_ntoa(ift->ip_addr.sin_addr));
|
||||
printf(" bcast: %s\n" , inet_ntoa(ift->bcast_addr.sin_addr));
|
||||
printf(" hwaddr: ");
|
||||
for (i = 0; i < ARTNET_MAC_SIZE; i++) {
|
||||
if (i)
|
||||
printf(":");
|
||||
printf("%02x", (uint8_t) ift->hw_addr[i]);
|
||||
}
|
||||
printf("\n");
|
||||
}
|
||||
printf("#########################\n");
|
||||
}
|
||||
|
||||
if (preferred_ip) {
|
||||
// search through list of interfaces for one with the correct address
|
||||
ret = artnet_net_inet_aton(preferred_ip, &wanted_ip);
|
||||
if (ret)
|
||||
goto e_cleanup;
|
||||
|
||||
for (ift = ift_head; ift != NULL; ift = ift->next) {
|
||||
if (ift->ip_addr.sin_addr.s_addr == wanted_ip.s_addr) {
|
||||
found = TRUE;
|
||||
n->state.ip_addr = ift->ip_addr.sin_addr;
|
||||
n->state.bcast_addr = ift->bcast_addr.sin_addr;
|
||||
memcpy(&n->state.hw_addr, &ift->hw_addr, ARTNET_MAC_SIZE);
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!found) {
|
||||
artnet_error("Cannot find ip %s", preferred_ip);
|
||||
ret = ARTNET_ENET;
|
||||
goto e_cleanup;
|
||||
}
|
||||
} else {
|
||||
if (ift_head) {
|
||||
// pick first address
|
||||
// copy ip address, bcast address and hardware address
|
||||
n->state.ip_addr = ift_head->ip_addr.sin_addr;
|
||||
n->state.bcast_addr = ift_head->bcast_addr.sin_addr;
|
||||
memcpy(&n->state.hw_addr, &ift_head->hw_addr, ARTNET_MAC_SIZE);
|
||||
} else {
|
||||
artnet_error("No interfaces found!");
|
||||
ret = ARTNET_ENET;
|
||||
}
|
||||
}
|
||||
|
||||
e_cleanup:
|
||||
free_ifaces(ift_head);
|
||||
e_return :
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Start listening on the socket
|
||||
*/
|
||||
int artnet_net_start(node n) {
|
||||
int sock;
|
||||
struct sockaddr_in servAddr;
|
||||
int true_flag = TRUE;
|
||||
node tmp;
|
||||
|
||||
// only attempt to bind if we are the group master
|
||||
if (n->peering.master == TRUE) {
|
||||
|
||||
#ifdef WIN32
|
||||
// check winsock version
|
||||
WSADATA wsaData;
|
||||
WORD wVersionRequested = MAKEWORD(2, 2);
|
||||
if (WSAStartup(wVersionRequested, &wsaData) != 0)
|
||||
return (-1);
|
||||
if (wsaData.wVersion != wVersionRequested)
|
||||
return (-2);
|
||||
#endif
|
||||
|
||||
// create socket
|
||||
sock = socket(PF_INET, SOCK_DGRAM, 0);
|
||||
|
||||
if (sock < 0) {
|
||||
artnet_error("Could not create socket %s", artnet_net_last_error());
|
||||
return ARTNET_ENET;
|
||||
}
|
||||
|
||||
memset(&servAddr, 0x00, sizeof(servAddr));
|
||||
servAddr.sin_family = AF_INET;
|
||||
servAddr.sin_port = htons(ARTNET_PORT);
|
||||
servAddr.sin_addr.s_addr = htonl(INADDR_ANY);
|
||||
|
||||
if (n->state.verbose)
|
||||
printf("Binding to %s \n", inet_ntoa(servAddr.sin_addr));
|
||||
|
||||
// bind sockets
|
||||
if (bind(sock, (SA *) &servAddr, sizeof(servAddr)) == -1) {
|
||||
artnet_error("Failed to bind to socket %s", artnet_net_last_error());
|
||||
artnet_net_close(sock);
|
||||
return ARTNET_ENET;
|
||||
}
|
||||
|
||||
// allow bcasting
|
||||
if (setsockopt(sock,
|
||||
SOL_SOCKET,
|
||||
SO_BROADCAST,
|
||||
(char*) &true_flag, // char* for win32
|
||||
sizeof(int)) == -1) {
|
||||
artnet_error("Failed to bind to socket %s", artnet_net_last_error());
|
||||
artnet_net_close(sock);
|
||||
return ARTNET_ENET;
|
||||
}
|
||||
|
||||
#ifdef WIN32
|
||||
// ### LH - 22.08.2008
|
||||
// make it possible to reuse port, if SO_REUSEADDR
|
||||
// exists on operating system
|
||||
|
||||
// NEVER USE SO_EXCLUSIVEADDRUSE, as that freezes the application
|
||||
// on WinXP, if port is in use !
|
||||
if (setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, (char *) &true_flag,
|
||||
sizeof(true_flag)) < 0) {
|
||||
|
||||
artnet_error("Set reuse failed", artnet_net_last_error());
|
||||
artnet_net_close(sock);
|
||||
return ARTNET_ENET;
|
||||
}
|
||||
|
||||
u_long true = 1;
|
||||
if (SOCKET_ERROR == ioctlsocket(sock, FIONBIO, &true)) {
|
||||
|
||||
artnet_error("ioctlsocket", artnet_net_last_error());
|
||||
artnet_net_close(sock);
|
||||
return ARTNET_ENET;
|
||||
}
|
||||
#endif
|
||||
|
||||
n->sd = sock;
|
||||
// Propagate the socket to all our peers
|
||||
for (tmp = n->peering.peer; tmp && tmp != n; tmp = tmp->peering.peer)
|
||||
tmp->sd = sock;
|
||||
}
|
||||
return ARTNET_EOK;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Receive a packet.
|
||||
*/
|
||||
int artnet_net_recv(node n, artnet_packet p, int delay) {
|
||||
ssize_t len;
|
||||
struct sockaddr_in cliAddr;
|
||||
socklen_t cliLen = sizeof(cliAddr);
|
||||
fd_set rset;
|
||||
struct timeval tv;
|
||||
int maxfdp1 = n->sd + 1;
|
||||
|
||||
FD_ZERO(&rset);
|
||||
FD_SET((unsigned int) n->sd, &rset);
|
||||
|
||||
tv.tv_usec = 0;
|
||||
tv.tv_sec = delay;
|
||||
p->length = 0;
|
||||
|
||||
switch (select(maxfdp1, &rset, NULL, NULL, &tv)) {
|
||||
case 0:
|
||||
// timeout
|
||||
return RECV_NO_DATA;
|
||||
break;
|
||||
case -1:
|
||||
if ( errno != EINTR) {
|
||||
artnet_error("Select error %s", artnet_net_last_error());
|
||||
return ARTNET_ENET;
|
||||
}
|
||||
return ARTNET_EOK;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
// need a check here for the amount of data read
|
||||
// should prob allow an extra byte after data, and pass the size as sizeof(Data) +1
|
||||
// then check the size read and if equal to size(data)+1 we have an error
|
||||
len = recvfrom(n->sd,
|
||||
(char*) &(p->data), // char* for win32
|
||||
sizeof(p->data),
|
||||
0,
|
||||
(SA*) &cliAddr,
|
||||
&cliLen);
|
||||
if (len < 0) {
|
||||
artnet_error("Recvfrom error %s", artnet_net_last_error());
|
||||
return ARTNET_ENET;
|
||||
}
|
||||
|
||||
if (cliAddr.sin_addr.s_addr == n->state.ip_addr.s_addr ||
|
||||
ntohl(cliAddr.sin_addr.s_addr) == LOOPBACK_IP) {
|
||||
p->length = 0;
|
||||
return ARTNET_EOK;
|
||||
}
|
||||
|
||||
p->length = len;
|
||||
memcpy(&(p->from), &cliAddr.sin_addr, sizeof(struct in_addr));
|
||||
// should set to in here if we need it
|
||||
return ARTNET_EOK;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Send a packet.
|
||||
*/
|
||||
int artnet_net_send(node n, artnet_packet p) {
|
||||
struct sockaddr_in addr;
|
||||
int ret;
|
||||
|
||||
if (n->state.mode != ARTNET_ON)
|
||||
return ARTNET_EACTION;
|
||||
|
||||
addr.sin_family = AF_INET;
|
||||
addr.sin_port = htons(ARTNET_PORT);
|
||||
addr.sin_addr = p->to;
|
||||
p->from = n->state.ip_addr;
|
||||
|
||||
if (n->state.verbose)
|
||||
printf("sending to %s\n" , inet_ntoa(addr.sin_addr));
|
||||
|
||||
ret = sendto(n->sd,
|
||||
(char*) &p->data, // char* required for win32
|
||||
p->length,
|
||||
0,
|
||||
(SA*) &addr,
|
||||
sizeof(addr));
|
||||
if (ret == -1) {
|
||||
artnet_error("Sendto failed: %s", artnet_net_last_error());
|
||||
n->state.report_code = ARTNET_RCUDPFAIL;
|
||||
return ARTNET_ENET;
|
||||
|
||||
} else if (p->length != ret) {
|
||||
artnet_error("failed to send full datagram");
|
||||
n->state.report_code = ARTNET_RCSOCKETWR1;
|
||||
return ARTNET_ENET;
|
||||
}
|
||||
|
||||
if (n->callbacks.send.fh) {
|
||||
get_type(p);
|
||||
n->callbacks.send.fh(n, p, n->callbacks.send.data);
|
||||
}
|
||||
return ARTNET_EOK;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
int artnet_net_reprogram(node n) {
|
||||
iface_t *ift_head, *ift;
|
||||
int i;
|
||||
|
||||
ift_head = get_ifaces(n->sd[0]);
|
||||
|
||||
for (ift = ift_head;ift != NULL; ift = ift->next ) {
|
||||
printf("IP: %s\n", inet_ntoa(ift->ip_addr.sin_addr) );
|
||||
printf(" bcast: %s\n" , inet_ntoa(ift->bcast_addr.sin_addr) );
|
||||
printf(" hwaddr: ");
|
||||
for(i = 0; i < 6; i++ ) {
|
||||
printf("%hhx:", ift->hw_addr[i] );
|
||||
}
|
||||
printf("\n");
|
||||
}
|
||||
|
||||
free_ifaces(ift_head);
|
||||
|
||||
}*/
|
||||
|
||||
|
||||
int artnet_net_set_fdset(node n, fd_set *fdset) {
|
||||
FD_SET((unsigned int) n->sd, fdset);
|
||||
return ARTNET_EOK;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Close a socket
|
||||
*/
|
||||
int artnet_net_close(int sock) {
|
||||
#ifdef WIN32
|
||||
shutdown(sock, SD_BOTH);
|
||||
closesocket(sock);
|
||||
//WSACancelBlockingCall();
|
||||
WSACleanup();
|
||||
#else
|
||||
if (close(sock)) {
|
||||
artnet_error(artnet_net_last_error());
|
||||
return ARTNET_ENET;
|
||||
}
|
||||
#endif
|
||||
return ARTNET_EOK;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Convert a string to an in_addr
|
||||
*/
|
||||
int artnet_net_inet_aton(const char *ip_address, struct in_addr *address) {
|
||||
#ifdef HAVE_INET_ATON
|
||||
if (!inet_aton(ip_address, address)) {
|
||||
#else
|
||||
in_addr_t *addr = (in_addr_t*) address;
|
||||
if ((*addr = inet_addr(ip_address)) == INADDR_NONE) {
|
||||
#endif
|
||||
artnet_error("IP conversion from %s failed", ip_address);
|
||||
return ARTNET_EARG;
|
||||
}
|
||||
return ARTNET_EOK;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
*
|
||||
*/
|
||||
const char *artnet_net_last_error() {
|
||||
#ifdef WIN32
|
||||
static char error_str[10];
|
||||
int error = WSAGetLastError();
|
||||
snprintf(error_str, sizeof(error_str), "%d", error);
|
||||
return error_str;
|
||||
#else
|
||||
return strerror(errno);
|
||||
#endif
|
||||
}
|
||||
|
|
@ -0,0 +1,390 @@
|
|||
/*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*
|
||||
* packets.h
|
||||
* Datagram definitions for libartnet
|
||||
* Copyright (C) 2004-2005 Simon Newton
|
||||
*/
|
||||
|
||||
|
||||
#ifndef ARTNET_PACKETS_H
|
||||
#define ARTNET_PACKETS_H
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#ifndef WIN32
|
||||
#include <netinet/in.h>
|
||||
#endif
|
||||
|
||||
#include <artnet/common.h>
|
||||
|
||||
enum { ARTNET_MAX_RDM_ADCOUNT = 32 };
|
||||
|
||||
enum { ARTNET_MAX_UID_COUNT = 200 };
|
||||
|
||||
// according to the rdm spec, this should be 278 bytes
|
||||
// we'll set to 512 here, the firmware datagram is still bigger
|
||||
enum { ARTNET_MAX_RDM_DATA = 512 };
|
||||
|
||||
enum { ARTNET_FIRMWARE_SIZE = 512 };
|
||||
|
||||
enum artnet_packet_type_e {
|
||||
ARTNET_POLL = 0x2000,
|
||||
ARTNET_REPLY = 0x2100,
|
||||
ARTNET_DMX = 0x5000,
|
||||
ARTNET_ADDRESS = 0x6000,
|
||||
ARTNET_INPUT = 0x7000,
|
||||
ARTNET_TODREQUEST = 0x8000,
|
||||
ARTNET_TODDATA = 0x8100,
|
||||
ARTNET_TODCONTROL = 0x8200,
|
||||
ARTNET_RDM = 0x8300,
|
||||
ARTNET_VIDEOSTEUP = 0xa010,
|
||||
ARTNET_VIDEOPALETTE = 0xa020,
|
||||
ARTNET_VIDEODATA = 0xa040,
|
||||
ARTNET_MACMASTER = 0xf000,
|
||||
ARTNET_MACSLAVE = 0xf100,
|
||||
ARTNET_FIRMWAREMASTER = 0xf200,
|
||||
ARTNET_FIRMWAREREPLY = 0xf300,
|
||||
ARTNET_IPPROG = 0xf800,
|
||||
ARTNET_IPREPLY = 0xf900,
|
||||
ARTNET_MEDIA = 0x9000,
|
||||
ARTNET_MEDIAPATCH = 0x9200,
|
||||
ARTNET_MEDIACONTROLREPLY = 0x9300
|
||||
}__attribute__((packed));
|
||||
|
||||
typedef enum artnet_packet_type_e artnet_packet_type_t;
|
||||
|
||||
|
||||
struct artnet_poll_s {
|
||||
uint8_t id[8];
|
||||
uint16_t opCode;
|
||||
uint8_t verH;
|
||||
uint8_t ver;
|
||||
uint8_t ttm;
|
||||
uint8_t pad;
|
||||
} __attribute__((packed));
|
||||
|
||||
typedef struct artnet_poll_s artnet_poll_t;
|
||||
|
||||
struct artnet_reply_s {
|
||||
uint8_t id[8];
|
||||
uint16_t opCode;
|
||||
uint8_t ip[4];
|
||||
uint16_t port;
|
||||
uint8_t verH;
|
||||
uint8_t ver;
|
||||
uint8_t subH;
|
||||
uint8_t sub;
|
||||
uint8_t oemH;
|
||||
uint8_t oem;
|
||||
uint8_t ubea;
|
||||
uint8_t status;
|
||||
uint8_t etsaman[2];
|
||||
uint8_t shortname[ARTNET_SHORT_NAME_LENGTH];
|
||||
uint8_t longname[ARTNET_LONG_NAME_LENGTH];
|
||||
uint8_t nodereport[ARTNET_REPORT_LENGTH];
|
||||
uint8_t numbportsH;
|
||||
uint8_t numbports;
|
||||
uint8_t porttypes[ARTNET_MAX_PORTS];
|
||||
uint8_t goodinput[ARTNET_MAX_PORTS];
|
||||
uint8_t goodoutput[ARTNET_MAX_PORTS];
|
||||
uint8_t swin[ARTNET_MAX_PORTS];
|
||||
uint8_t swout[ARTNET_MAX_PORTS];
|
||||
uint8_t swvideo;
|
||||
uint8_t swmacro;
|
||||
uint8_t swremote;
|
||||
uint8_t sp1;
|
||||
uint8_t sp2;
|
||||
uint8_t sp3;
|
||||
uint8_t style;
|
||||
uint8_t mac[ARTNET_MAC_SIZE];
|
||||
uint8_t filler[32];
|
||||
} __attribute__((packed));
|
||||
|
||||
typedef struct artnet_reply_s artnet_reply_t;
|
||||
|
||||
struct artnet_ipprog_s {
|
||||
uint8_t id[8];
|
||||
uint16_t OpCode;
|
||||
uint8_t ProVerH;
|
||||
uint8_t ProVer;
|
||||
uint8_t Filler1;
|
||||
uint8_t Filler2;
|
||||
uint8_t Command;
|
||||
uint8_t Filler4;
|
||||
uint8_t ProgIpHi;
|
||||
uint8_t ProgIp2;
|
||||
uint8_t ProgIp1;
|
||||
uint8_t ProgIpLo;
|
||||
uint8_t ProgSmHi;
|
||||
uint8_t ProgSm2;
|
||||
uint8_t ProgSm1;
|
||||
uint8_t ProgSmLo;
|
||||
uint8_t ProgPortHi;
|
||||
uint8_t ProgPortLo;
|
||||
uint8_t Spare1;
|
||||
uint8_t Spare2;
|
||||
uint8_t Spare3;
|
||||
uint8_t Spare4;
|
||||
uint8_t Spare5;
|
||||
uint8_t Spare6;
|
||||
uint8_t Spare7;
|
||||
uint8_t Spare8;
|
||||
|
||||
} __attribute__((packed));
|
||||
|
||||
typedef struct artnet_ipprog_s artnet_ipprog_t;
|
||||
|
||||
struct artnet_ipprog_reply_s {
|
||||
uint8_t id[8];
|
||||
uint16_t OpCode;
|
||||
uint8_t ProVerH;
|
||||
uint8_t ProVer;
|
||||
uint8_t Filler1;
|
||||
uint8_t Filler2;
|
||||
uint8_t Filler3;
|
||||
uint8_t Filler4;
|
||||
uint8_t ProgIpHi;
|
||||
uint8_t ProgIp2;
|
||||
uint8_t ProgIp1;
|
||||
uint8_t ProgIpLo;
|
||||
uint8_t ProgSmHi;
|
||||
uint8_t ProgSm2;
|
||||
uint8_t ProgSm1;
|
||||
uint8_t ProgSmLo;
|
||||
uint8_t ProgPortHi;
|
||||
uint8_t ProgPortLo;
|
||||
uint8_t Spare1;
|
||||
uint8_t Spare2;
|
||||
uint8_t Spare3;
|
||||
uint8_t Spare4;
|
||||
uint8_t Spare5;
|
||||
uint8_t Spare6;
|
||||
uint8_t Spare7;
|
||||
uint8_t Spare8;
|
||||
} __attribute__((packed));
|
||||
|
||||
typedef struct artnet_ipprog_reply_s artnet_ipprog_reply_t;
|
||||
|
||||
|
||||
struct artnet_address_s {
|
||||
uint8_t id[8];
|
||||
uint16_t opCode;
|
||||
uint8_t verH;
|
||||
uint8_t ver;
|
||||
uint8_t filler1;
|
||||
uint8_t filler2;
|
||||
uint8_t shortname[ARTNET_SHORT_NAME_LENGTH];
|
||||
uint8_t longname[ARTNET_LONG_NAME_LENGTH];
|
||||
uint8_t swin[ARTNET_MAX_PORTS];
|
||||
uint8_t swout[ARTNET_MAX_PORTS];
|
||||
uint8_t subnet;
|
||||
uint8_t swvideo;
|
||||
uint8_t command;
|
||||
} __attribute__((packed));
|
||||
|
||||
typedef struct artnet_address_s artnet_address_t;
|
||||
|
||||
|
||||
struct artnet_dmx_s {
|
||||
uint8_t id[8];
|
||||
uint16_t opCode;
|
||||
uint8_t verH;
|
||||
uint8_t ver;
|
||||
uint8_t sequence;
|
||||
uint8_t physical;
|
||||
uint16_t universe;
|
||||
uint8_t lengthHi;
|
||||
uint8_t length;
|
||||
uint8_t data[ARTNET_DMX_LENGTH];
|
||||
} __attribute__((packed));
|
||||
|
||||
typedef struct artnet_dmx_s artnet_dmx_t;
|
||||
|
||||
|
||||
struct artnet_input_s {
|
||||
uint8_t id[8];
|
||||
uint16_t opCode;
|
||||
uint8_t verH;
|
||||
uint8_t ver;
|
||||
uint8_t filler1;
|
||||
uint8_t filler2;
|
||||
uint8_t numbportsH;
|
||||
uint8_t numbports;
|
||||
uint8_t input[ARTNET_MAX_PORTS];
|
||||
} __attribute__((packed));
|
||||
|
||||
typedef struct artnet_input_s artnet_input_t;
|
||||
|
||||
|
||||
struct artnet_todrequest_s {
|
||||
uint8_t id[8];
|
||||
uint16_t opCode;
|
||||
uint8_t verH;
|
||||
uint8_t ver;
|
||||
uint8_t filler1;
|
||||
uint8_t filler2;
|
||||
uint8_t spare1;
|
||||
uint8_t spare2;
|
||||
uint8_t spare3;
|
||||
uint8_t spare4;
|
||||
uint8_t spare5;
|
||||
uint8_t spare6;
|
||||
uint8_t spare7;
|
||||
uint8_t spare8;
|
||||
uint8_t command;
|
||||
uint8_t adCount;
|
||||
uint8_t address[ARTNET_MAX_RDM_ADCOUNT];
|
||||
} __attribute__((packed));
|
||||
|
||||
typedef struct artnet_todrequest_s artnet_todrequest_t;
|
||||
|
||||
|
||||
|
||||
struct artnet_toddata_s {
|
||||
uint8_t id[8];
|
||||
uint16_t opCode;
|
||||
uint8_t verH;
|
||||
uint8_t ver;
|
||||
uint8_t rdmVer;
|
||||
uint8_t port;
|
||||
uint8_t spare1;
|
||||
uint8_t spare2;
|
||||
uint8_t spare3;
|
||||
uint8_t spare4;
|
||||
uint8_t spare5;
|
||||
uint8_t spare6;
|
||||
uint8_t spare7;
|
||||
uint8_t spare8;
|
||||
uint8_t cmdRes;
|
||||
uint8_t address;
|
||||
uint8_t uidTotalHi;
|
||||
uint8_t uidTotal;
|
||||
uint8_t blockCount;
|
||||
uint8_t uidCount;
|
||||
uint8_t tod[ARTNET_MAX_UID_COUNT][ARTNET_RDM_UID_WIDTH];
|
||||
} __attribute__((packed));
|
||||
|
||||
typedef struct artnet_toddata_s artnet_toddata_t;
|
||||
|
||||
struct artnet_firmware_s {
|
||||
uint8_t id[8];
|
||||
uint16_t opCode;
|
||||
uint8_t verH;
|
||||
uint8_t ver;
|
||||
uint8_t filler1;
|
||||
uint8_t filler2;
|
||||
uint8_t type;
|
||||
uint8_t blockId;
|
||||
uint8_t length[4];
|
||||
uint8_t spare[20];
|
||||
uint16_t data[ARTNET_FIRMWARE_SIZE ];
|
||||
} __attribute__((packed));
|
||||
|
||||
typedef struct artnet_firmware_s artnet_firmware_t;
|
||||
|
||||
struct artnet_todcontrol_s {
|
||||
uint8_t id[8];
|
||||
uint16_t opCode;
|
||||
uint8_t verH;
|
||||
uint8_t ver;
|
||||
uint8_t filler1;
|
||||
uint8_t filler2;
|
||||
uint8_t spare1;
|
||||
uint8_t spare2;
|
||||
uint8_t spare3;
|
||||
uint8_t spare4;
|
||||
uint8_t spare5;
|
||||
uint8_t spare6;
|
||||
uint8_t spare7;
|
||||
uint8_t spare8;
|
||||
uint8_t cmd;
|
||||
uint8_t address;
|
||||
} __attribute__((packed));
|
||||
|
||||
|
||||
typedef struct artnet_todcontrol_s artnet_todcontrol_t;
|
||||
|
||||
|
||||
|
||||
struct artnet_rdm_s {
|
||||
uint8_t id[8];
|
||||
uint16_t opCode;
|
||||
uint8_t verH;
|
||||
uint8_t ver;
|
||||
uint8_t rdmVer;
|
||||
uint8_t filler2;
|
||||
uint8_t spare1;
|
||||
uint8_t spare2;
|
||||
uint8_t spare3;
|
||||
uint8_t spare4;
|
||||
uint8_t spare5;
|
||||
uint8_t spare6;
|
||||
uint8_t spare7;
|
||||
uint8_t spare8;
|
||||
uint8_t cmd;
|
||||
uint8_t address;
|
||||
uint8_t data[ARTNET_MAX_RDM_DATA];
|
||||
} __attribute__((packed));
|
||||
|
||||
|
||||
typedef struct artnet_rdm_s artnet_rdm_t;
|
||||
|
||||
|
||||
struct artnet_firmware_reply_s {
|
||||
uint8_t id[8];
|
||||
uint16_t opCode;
|
||||
uint8_t verH;
|
||||
uint8_t ver;
|
||||
uint8_t filler1;
|
||||
uint8_t filler2;
|
||||
uint8_t type;
|
||||
uint8_t spare[21];
|
||||
} __attribute__((packed));
|
||||
|
||||
typedef struct artnet_firmware_reply_s artnet_firmware_reply_t;
|
||||
|
||||
|
||||
|
||||
// union of all artnet packets
|
||||
typedef union {
|
||||
artnet_poll_t ap;
|
||||
artnet_reply_t ar;
|
||||
artnet_ipprog_t aip;
|
||||
artnet_address_t addr;
|
||||
artnet_dmx_t admx;
|
||||
artnet_input_t ainput;
|
||||
artnet_todrequest_t todreq;
|
||||
artnet_toddata_t toddata;
|
||||
artnet_firmware_t firmware;
|
||||
artnet_firmware_reply_t firmwarer;
|
||||
artnet_todcontrol_t todcontrol;
|
||||
artnet_rdm_t rdm;
|
||||
} artnet_packet_union_t;
|
||||
|
||||
|
||||
// a packet, containing data, length, type and a src/dst address
|
||||
typedef struct {
|
||||
int length;
|
||||
struct in_addr from;
|
||||
struct in_addr to;
|
||||
artnet_packet_type_t type;
|
||||
artnet_packet_union_t data;
|
||||
} artnet_packet_t;
|
||||
|
||||
typedef artnet_packet_t *artnet_packet;
|
||||
|
||||
#endif
|
|
@ -0,0 +1,504 @@
|
|||
/*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*
|
||||
* private.h
|
||||
* Private definitions, data structures, macros and functions for libartnet
|
||||
* Copyright (C) 2004-2007 Simon Newton
|
||||
*/
|
||||
|
||||
#if HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#ifndef WIN32
|
||||
#include <sys/socket.h>
|
||||
#include <netinet/in.h>
|
||||
#include <arpa/inet.h>
|
||||
#endif
|
||||
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <time.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include "artnet.h"
|
||||
#include "artnet/packets.h"
|
||||
#include "misc.h"
|
||||
#include "tod.h"
|
||||
|
||||
#ifndef ARTNET_PRIVATE_H
|
||||
#define ARTNET_PRIVATE_H
|
||||
|
||||
// these are defined in artnet.c
|
||||
extern int ARTNET_PORT;
|
||||
extern char ARTNET_STRING[];
|
||||
extern int ARTNET_STRING_SIZE;
|
||||
extern uint8_t ARTNET_VERSION;
|
||||
extern uint8_t OEM_HI;
|
||||
extern uint8_t OEM_LO;
|
||||
extern char ESTA_HI;
|
||||
extern char ESTA_LO;
|
||||
extern uint8_t TTM_BEHAVIOUR_MASK;
|
||||
extern uint8_t TTM_REPLY_MASK;
|
||||
extern uint8_t PROGRAM_NO_CHANGE;
|
||||
extern uint8_t PROGRAM_DEFAULTS;
|
||||
extern uint8_t PROGRAM_CHANGE_MASK;
|
||||
extern uint8_t HIGH_NIBBLE;
|
||||
extern uint8_t LOW_NIBBLE;
|
||||
extern uint8_t STATUS_PROG_AUTH_MASK;
|
||||
extern uint8_t PORT_STATUS_LPT_MODE;
|
||||
extern uint8_t PORT_STATUS_SHORT;
|
||||
extern uint8_t PORT_STATUS_ERROR;
|
||||
extern uint8_t PORT_STATUS_DISABLED_MASK;
|
||||
extern uint8_t ORT_STATUS_MERGE;
|
||||
extern uint8_t PORT_STATUS_DMX_TEXT;
|
||||
extern uint8_t PORT_STATUS_DMX_SIP;
|
||||
extern uint8_t PORT_STATUS_DMX_TEST;
|
||||
extern uint8_t PORT_STATUS_ACT_MASK;
|
||||
extern uint8_t PORT_DISABLE_MASK;
|
||||
extern uint8_t TOD_RESPONSE_FULL;
|
||||
extern uint8_t TOD_RESPONSE_NAK;
|
||||
extern uint8_t MIN_PACKET_SIZE;
|
||||
extern uint8_t MERGE_TIMEOUT_SECONDS;
|
||||
extern uint8_t FIRMWARE_TIMEOUT_SECONDS;
|
||||
extern uint8_t RECV_NO_DATA;
|
||||
|
||||
#ifndef TRUE
|
||||
extern int TRUE;
|
||||
extern int FALSE;
|
||||
#endif
|
||||
|
||||
extern uint16_t LOW_BYTE;
|
||||
extern uint16_t HIGH_BYTE;
|
||||
|
||||
// non artnet specific
|
||||
#define SA struct sockaddr
|
||||
#define SI struct in_addr
|
||||
|
||||
#ifndef min
|
||||
#define min(a, b) ((a) < (b) ? (a) : (b))
|
||||
#endif
|
||||
|
||||
#ifndef max
|
||||
#define max(a, b) ((a) > (b) ? (a) : (b))
|
||||
#endif
|
||||
|
||||
#ifndef INVALID_SOCKET
|
||||
#define INVALID_SOCKET -1
|
||||
#endif
|
||||
|
||||
// byte ordering macros
|
||||
#define bswap_16(x) ((((x) >> 8) & 0xff) | (((x) & 0xff) << 8))
|
||||
|
||||
// htols : convert short from host to little endian order
|
||||
#ifdef WIN32
|
||||
# define htols(x) (x)
|
||||
#else
|
||||
# ifdef HAVE_ENDIAN_H
|
||||
# if BYTE_ORDER == __BIG_ENDIAN
|
||||
# define htols(x) bswap_16 (x)
|
||||
# else
|
||||
# define htols(x) (x)
|
||||
# endif
|
||||
# else
|
||||
# if BYTE_ORDER == BIG_ENDIAN
|
||||
# define htols(x) bswap_16 (x)
|
||||
# else
|
||||
# define htols(x) (x)
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
|
||||
// convert from shorts to bytes and back again
|
||||
#define short_get_high_byte(x) ((HIGH_BYTE & x) >> 8)
|
||||
#define short_get_low_byte(x) (LOW_BYTE & x)
|
||||
|
||||
#define bytes_to_short(h,l) ( ((h << 8) & 0xff00) | (l & 0x00FF) );
|
||||
|
||||
/*
|
||||
* These are enums for fields in packets
|
||||
* Ordered by packets they appear in. Some of these appear in the public header file
|
||||
* artnet.h if they have to be used by the user.
|
||||
*
|
||||
* They are all in the form artnet_xxx_code in case they have to be made public some day
|
||||
*
|
||||
*/
|
||||
|
||||
// ArtPollReply
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
// the node report codes
|
||||
typedef enum {
|
||||
ARTNET_RCDEBUG,
|
||||
ARTNET_RCPOWEROK,
|
||||
ARTNET_RCPOWERFAIL,
|
||||
ARTNET_RCSOCKETWR1,
|
||||
ARTNET_RCPARSEFAIL,
|
||||
ARTNET_RCUDPFAIL,
|
||||
ARTNET_RCSHNAMEOK,
|
||||
ARTNET_RCLONAMEOK,
|
||||
ARTNET_RCDMXERROR,
|
||||
ARTNET_RCDMXUDPFULL,
|
||||
ARTNET_RCDMXRXFULL,
|
||||
ARTNET_RCSWITCHERR,
|
||||
ARTNET_RCCONFIGERR,
|
||||
ARTNET_RCDMXSHORT,
|
||||
ARTNET_RCFIRMWAREFAIL,
|
||||
ARTNET_RCUSERFAIL
|
||||
} artnet_node_report_code;
|
||||
|
||||
// these define the types of node that can exist
|
||||
// note it's different from artnet_node_type
|
||||
typedef enum {
|
||||
STNODE = 0x00,
|
||||
STSERVER = 0x01,
|
||||
STMEDIA = 0x02,
|
||||
STROUTE = 0x03,
|
||||
STBACKUP = 0x04,
|
||||
STCONFIG = 0x05
|
||||
} artnet_node_style_code;
|
||||
|
||||
// artnet_port_data in artnet.h
|
||||
|
||||
// ArtAddress
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
// artnet_port_command_code in artnet.h
|
||||
|
||||
// ArtFirmwareMaster
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
// defines contents of the firmware packet
|
||||
typedef enum {
|
||||
ARTNET_FIRMWARE_FIRMFIRST = 0x00,
|
||||
ARTNET_FIRMWARE_FIRMCONT = 0x01,
|
||||
ARTNET_FIRMWARE_FIRMLAST = 0x02,
|
||||
ARTNET_FIRMWARE_UBEAFIRST = 0x03,
|
||||
ARTNET_FIRMWARE_UBEACONT = 0x04,
|
||||
ARTNET_FIRMWARE_UBEALAST = 0x05,
|
||||
} artnet_firmware_type_code;
|
||||
|
||||
// ArtFirmwareReply
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
// artnet_firmware_status_code in artnet.h
|
||||
|
||||
|
||||
|
||||
// End packet enums
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
|
||||
/*
|
||||
* Data structures to manage callbacks
|
||||
*/
|
||||
|
||||
// packet callbacks have a function and some user data
|
||||
typedef struct {
|
||||
int (*fh)(artnet_node n, void *p, void *data);
|
||||
void *data;
|
||||
} callback_t;
|
||||
|
||||
/*
|
||||
* the dmx callback is triggered when a dmx packet arrives
|
||||
*/
|
||||
typedef struct {
|
||||
int (*fh)(artnet_node n, int portid, void *data);
|
||||
void *data;
|
||||
} dmx_callback_t;
|
||||
|
||||
/*
|
||||
* firmware callback is triggered when a firmware recieve has been completed sucessfully
|
||||
*/
|
||||
typedef struct {
|
||||
int (*fh)(artnet_node n, int ubea, uint16_t *data, int length, void *d);
|
||||
void *data;
|
||||
} firmware_callback_t;
|
||||
|
||||
/*
|
||||
* called when a node is remote programmed
|
||||
*/
|
||||
typedef struct {
|
||||
int (*fh)(artnet_node n, void *d);
|
||||
void *data;
|
||||
} program_callback_t;
|
||||
|
||||
/*
|
||||
* called when a node receives rdm data
|
||||
*/
|
||||
typedef struct {
|
||||
int (*fh)(artnet_node n, int address, uint8_t *rdm, int length, void *d);
|
||||
void *data;
|
||||
} rdm_callback_t;
|
||||
|
||||
|
||||
// struct to store callbacks
|
||||
typedef struct {
|
||||
callback_t recv;
|
||||
callback_t send;
|
||||
callback_t poll;
|
||||
callback_t reply;
|
||||
callback_t dmx;
|
||||
callback_t address;
|
||||
callback_t input;
|
||||
callback_t todrequest;
|
||||
callback_t toddata;
|
||||
callback_t todcontrol;
|
||||
callback_t rdm;
|
||||
callback_t ipprog;
|
||||
callback_t firmware;
|
||||
callback_t firmware_reply;
|
||||
dmx_callback_t dmx_c;
|
||||
firmware_callback_t firmware_c;
|
||||
program_callback_t program_c;
|
||||
rdm_callback_t rdm_c;
|
||||
dmx_callback_t rdm_init_c;
|
||||
dmx_callback_t rdm_tod_c;
|
||||
} node_callbacks_t;
|
||||
|
||||
|
||||
// End callback structures
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
/*
|
||||
* Begin port structures
|
||||
*/
|
||||
|
||||
|
||||
|
||||
// first a generic port
|
||||
typedef struct {
|
||||
uint8_t addr; // the port address
|
||||
uint8_t default_addr; // the address set by the hardware
|
||||
uint8_t net_ctl; // if the port address is under network control
|
||||
uint8_t status; // status of the port
|
||||
uint8_t enabled; // true if the port has had it's address set, this is internal only,
|
||||
// it's not used by the ArtNet protocol, otherwise the node keeps
|
||||
// picking up packets for the 0x00 port
|
||||
tod_t tod;
|
||||
} g_port_t;
|
||||
|
||||
/**
|
||||
* struct to represent an input port
|
||||
* input ports need to keep track of sequence numbers
|
||||
* (this doesn't seem to be used though)
|
||||
*/
|
||||
typedef struct {
|
||||
g_port_t port;
|
||||
uint8_t seq;
|
||||
} input_port_t;
|
||||
|
||||
|
||||
/**
|
||||
* For output ports we need to track if they merge in HTP or LTP modes
|
||||
*/
|
||||
typedef enum {
|
||||
ARTNET_MERGE_HTP,
|
||||
ARTNET_MERGE_LTP
|
||||
} merge_t;
|
||||
|
||||
/**
|
||||
* struct to represent an output port
|
||||
*
|
||||
* output ports can merge data from two sources in either HTP
|
||||
* (highest takes precedence) or LPT (lowest takes precedence) mode
|
||||
*
|
||||
* we need to store:
|
||||
* o The data from each source
|
||||
* o The ip of the source
|
||||
* o The time the data was recv'ed
|
||||
* o the tod table, length and max length
|
||||
*/
|
||||
typedef struct {
|
||||
g_port_t port;
|
||||
int length; // the length of the data THAT HAS CHANGED since the last dmx packet
|
||||
uint8_t enabled; // true if the port has had it's address set, this is internal only,
|
||||
// it's not used by the ArtNet protocol, otherwise the node keeps
|
||||
// picking up packets for the 0x00 port
|
||||
uint8_t data[ARTNET_DMX_LENGTH]; // output data
|
||||
merge_t merge_mode; // for merging
|
||||
uint8_t dataA[ARTNET_DMX_LENGTH];
|
||||
uint8_t dataB[ARTNET_DMX_LENGTH];
|
||||
time_t timeA;
|
||||
time_t timeB;
|
||||
SI ipA;
|
||||
SI ipB;
|
||||
} output_port_t;
|
||||
|
||||
// use defines to hide the inner structures
|
||||
#define port_addr port.addr
|
||||
#define port_default_addr port.default_addr
|
||||
#define port_net_ctl port.net_ctl
|
||||
#define port_status port.status
|
||||
#define port_enabled port.enabled
|
||||
#define port_tod port.tod
|
||||
|
||||
// End port structures
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
|
||||
/*
|
||||
* We use a linked list to keep track of nodes on the network
|
||||
* Here be the structures
|
||||
*/
|
||||
|
||||
/* firstly we have the potential to do a firmware transfer to any node,
|
||||
* this struct keeps the information such as how much data has been transfered
|
||||
* and the address of the peer. It's also used for receiving firmware
|
||||
*/
|
||||
typedef struct {
|
||||
uint16_t *data;
|
||||
int bytes_current;
|
||||
int bytes_total;
|
||||
struct in_addr peer;
|
||||
int ubea;
|
||||
time_t last_time;
|
||||
int expected_block;
|
||||
int (*callback)(artnet_node n, artnet_firmware_status_code code, void *d);
|
||||
void *user_data;
|
||||
} firmware_transfer_t;
|
||||
|
||||
/*
|
||||
* The node entry in the LL. It contains the public entry, as well as some stuff
|
||||
* we don't want public like firmware
|
||||
*/
|
||||
typedef struct node_entry_private_s {
|
||||
artnet_node_entry_t pub;
|
||||
struct node_entry_private_s *next;
|
||||
firmware_transfer_t firmware;
|
||||
SI ip; // don't rely on the ip address that the node
|
||||
// sends, they could be faking it. This is the ip that
|
||||
// the pollreply was sent from
|
||||
} node_entry_private_t;
|
||||
|
||||
/**
|
||||
* The node list stores a pointer to the first, last and current
|
||||
* entries.
|
||||
*/
|
||||
typedef struct {
|
||||
node_entry_private_t *first;
|
||||
node_entry_private_t *current;
|
||||
node_entry_private_t *last;
|
||||
int length;
|
||||
} node_list_t;
|
||||
|
||||
|
||||
// End node list structures
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
|
||||
// the status of the node
|
||||
typedef enum {
|
||||
ARTNET_OFF,
|
||||
ARTNET_STANDBY,
|
||||
ARTNET_ON
|
||||
} node_status_t;
|
||||
|
||||
|
||||
// struct to hold the state of the node
|
||||
typedef struct {
|
||||
artnet_node_type node_type;
|
||||
node_status_t mode;
|
||||
SI reply_addr;
|
||||
SI ip_addr;
|
||||
SI bcast_addr;
|
||||
uint8_t hw_addr[ARTNET_MAC_SIZE];
|
||||
uint8_t default_subnet;
|
||||
uint8_t subnet_net_ctl;
|
||||
int send_apr_on_change;
|
||||
int ar_count;
|
||||
int verbose;
|
||||
char short_name[ARTNET_SHORT_NAME_LENGTH];
|
||||
char long_name[ARTNET_LONG_NAME_LENGTH];
|
||||
char report[ARTNET_REPORT_LENGTH];
|
||||
uint8_t subnet;
|
||||
uint8_t oem_hi;
|
||||
uint8_t oem_lo;
|
||||
uint8_t esta_hi;
|
||||
uint8_t esta_lo;
|
||||
int bcast_limit; // the number of nodes after which we change to bcast
|
||||
artnet_node_report_code report_code;
|
||||
} node_state_t;
|
||||
|
||||
|
||||
typedef struct {
|
||||
struct artnet_node_s *peer; // peer if we've joined a group
|
||||
int master;
|
||||
} node_peering_t;
|
||||
|
||||
|
||||
/**
|
||||
* The main node structure
|
||||
*/
|
||||
typedef struct artnet_node_s{
|
||||
int sd; // the two sockets
|
||||
node_state_t state; // the state struct
|
||||
node_callbacks_t callbacks; // the callbacks struct
|
||||
struct ports_s {
|
||||
uint8_t types[ARTNET_MAX_PORTS]; // type of port
|
||||
input_port_t in[ARTNET_MAX_PORTS]; // input ports
|
||||
output_port_t out[ARTNET_MAX_PORTS]; // output ports
|
||||
} ports;
|
||||
artnet_reply_t ar_temp; // buffered artpoll reply packet
|
||||
node_list_t node_list; // node list
|
||||
firmware_transfer_t firmware; // firmware details
|
||||
node_peering_t peering; // peer if we've joined a group
|
||||
} artnet_node_t;
|
||||
|
||||
|
||||
typedef artnet_node_t *node;
|
||||
|
||||
/*
|
||||
* Function definitions follow
|
||||
*/
|
||||
|
||||
// exported from artnet.c
|
||||
node_entry_private_t *find_private_entry( node n, artnet_node_entry e);
|
||||
void check_timeouts(node n);
|
||||
node_entry_private_t *find_entry_from_ip(node_list_t *nl, SI ip);
|
||||
int artnet_nl_update(node_list_t *nl, artnet_packet reply);
|
||||
|
||||
|
||||
// exported from receive.c
|
||||
int handle(node n, artnet_packet p);
|
||||
int16_t get_type(artnet_packet p);
|
||||
void reset_firmware_upload(node n);
|
||||
|
||||
|
||||
// exported from transmit.c
|
||||
int artnet_tx_poll(node n, const char *ip, artnet_ttm_value_t ttm);
|
||||
int artnet_tx_poll_reply(node n, int reply);
|
||||
int artnet_tx_tod_data(node n, int id);
|
||||
int artnet_tx_firmware_reply(node n, in_addr_t ip, artnet_firmware_status_code code);
|
||||
int artnet_tx_firmware_packet(node n, firmware_transfer_t *firm );
|
||||
int artnet_tx_tod_request(node n);
|
||||
int artnet_tx_tod_control(node n, uint8_t address, artnet_tod_command_code action);
|
||||
int artnet_tx_rdm(node n, uint8_t address, uint8_t *data, int length);
|
||||
int artnet_tx_build_art_poll_reply(node n);
|
||||
|
||||
|
||||
// exported from network.c
|
||||
int artnet_net_recv(node n, artnet_packet p, int block);
|
||||
int artnet_net_send(node n, artnet_packet p);
|
||||
int artnet_net_set_non_block(node n);
|
||||
int artnet_net_init(node n, const char *ip);
|
||||
int artnet_net_start(node n);
|
||||
int artnet_net_close(int sock);
|
||||
int artnet_net_join(node n1, node n2);
|
||||
int artnet_net_set_fdset(node n, fd_set *fdset);
|
||||
int artnet_net_inet_aton(const char *ip_address, struct in_addr *address);
|
||||
const char *artnet_net_last_error();
|
||||
|
||||
#endif
|
|
@ -0,0 +1,912 @@
|
|||
/*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*
|
||||
* receive.c
|
||||
* Handles the receiving of datagrams
|
||||
* Copyright (C) 2004-2007 Simon Newton
|
||||
*/
|
||||
|
||||
#include "private.h"
|
||||
|
||||
uint8_t _make_addr(uint8_t subnet, uint8_t addr);
|
||||
void check_merge_timeouts(node n, int port);
|
||||
void merge(node n, int port, int length, uint8_t *latest);
|
||||
|
||||
/*
|
||||
* Checks if the callback is defined, if so call it passing the packet and
|
||||
* the user supplied data.
|
||||
* If the callbacks return a non-zero result, further processing is canceled.
|
||||
*/
|
||||
int check_callback(node n, artnet_packet p, callback_t callback) {
|
||||
if (callback.fh != NULL)
|
||||
return callback.fh(n, p, callback.data);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Handle an artpoll packet
|
||||
*/
|
||||
int handle_poll(node n, artnet_packet p) {
|
||||
// run callback if defined
|
||||
if (check_callback(n, p, n->callbacks.poll))
|
||||
return ARTNET_EOK;
|
||||
|
||||
if (n->state.node_type != ARTNET_RAW) {
|
||||
//if we're told to unicast further replies
|
||||
if (p->data.ap.ttm & TTM_REPLY_MASK) {
|
||||
n->state.reply_addr = p->from;
|
||||
} else {
|
||||
n->state.reply_addr.s_addr = n->state.bcast_addr.s_addr;
|
||||
}
|
||||
|
||||
// if we are told to send updates when node conditions change
|
||||
if (p->data.ap.ttm & TTM_BEHAVIOUR_MASK) {
|
||||
n->state.send_apr_on_change = TRUE;
|
||||
} else {
|
||||
n->state.send_apr_on_change = FALSE;
|
||||
}
|
||||
|
||||
return artnet_tx_poll_reply(n, TRUE);
|
||||
|
||||
}
|
||||
return ARTNET_EOK;
|
||||
}
|
||||
|
||||
/*
|
||||
* handle an art poll reply
|
||||
*/
|
||||
void handle_reply(node n, artnet_packet p) {
|
||||
// update the node list
|
||||
artnet_nl_update(&n->node_list, p);
|
||||
|
||||
// run callback if defined
|
||||
if (check_callback(n, p, n->callbacks.reply))
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* handle a art dmx packet
|
||||
*/
|
||||
void handle_dmx(node n, artnet_packet p) {
|
||||
int i, data_length;
|
||||
output_port_t *port;
|
||||
in_addr_t ipA, ipB;
|
||||
|
||||
// run callback if defined
|
||||
if (check_callback(n, p, n->callbacks.dmx))
|
||||
return;
|
||||
|
||||
data_length = (int) bytes_to_short(p->data.admx.lengthHi,
|
||||
p->data.admx.length);
|
||||
data_length = min(data_length, ARTNET_DMX_LENGTH);
|
||||
|
||||
// find matching output ports
|
||||
for (i = 0; i < ARTNET_MAX_PORTS; i++) {
|
||||
// if the addr matches and this port is enabled
|
||||
if (p->data.admx.universe == n->ports.out[i].port_addr &&
|
||||
n->ports.out[i].port_enabled) {
|
||||
|
||||
port = &n->ports.out[i];
|
||||
ipA = port->ipA.s_addr;
|
||||
ipB = port->ipB.s_addr;
|
||||
|
||||
// ok packet matches this port
|
||||
n->ports.out[i].port_status = n->ports.out[i].port_status | PORT_STATUS_ACT_MASK;
|
||||
|
||||
/**
|
||||
* 9 cases for merging depending on what the stored ips are.
|
||||
* here's the truth table
|
||||
*
|
||||
*
|
||||
* \ ipA # # # #
|
||||
* ------ # empty # # #
|
||||
* ipB \ # ( 0 ) # p.from # ! p.from #
|
||||
* ##################################################
|
||||
* # new node # continued # start #
|
||||
* empty # first # trans- # merge #
|
||||
* (0) # packet # mission # #
|
||||
* ##################################################
|
||||
* #continued # # cont #
|
||||
* p.from # trans- # invalid! # merge #
|
||||
* # mission # # #
|
||||
* ##################################################
|
||||
* # start # cont # #
|
||||
* ! p.from # merge # merge # discard #
|
||||
* # # # #
|
||||
* ##################################################
|
||||
*
|
||||
* The merge exits when:
|
||||
* o ACCancel command is received in an ArtAddress packet
|
||||
* (this is done in handle_address )
|
||||
* o no data is recv'ed from one source in 10 seconds
|
||||
*
|
||||
*/
|
||||
|
||||
check_merge_timeouts(n,i);
|
||||
|
||||
if (ipA == 0 && ipB == 0) {
|
||||
// first packet recv on this port
|
||||
port->ipA.s_addr = p->from.s_addr;
|
||||
port->timeA = time(NULL);
|
||||
|
||||
memcpy(&port->dataA, &p->data.admx.data, data_length);
|
||||
port->length = data_length;
|
||||
memcpy(&port->data, &p->data.admx.data, data_length);
|
||||
}
|
||||
else if (ipA == p->from.s_addr && ipB == 0) {
|
||||
//continued transmission from the same ip (source A)
|
||||
|
||||
port->timeA = time(NULL);
|
||||
memcpy(&port->dataA, &p->data.admx.data, data_length);
|
||||
port->length = data_length;
|
||||
memcpy(&port->data, &p->data.admx.data, data_length);
|
||||
}
|
||||
else if (ipA == 0 && ipB == p->from.s_addr) {
|
||||
//continued transmission from the same ip (source B)
|
||||
|
||||
port->timeB = time(NULL);
|
||||
memcpy(&port->dataB, &p->data.admx.data, data_length);
|
||||
port->length = data_length;
|
||||
memcpy(&port->data, &p->data.admx.data, data_length);
|
||||
}
|
||||
else if (ipA != p->from.s_addr && ipB == 0) {
|
||||
// new source, start the merge
|
||||
port->ipB.s_addr = p->from.s_addr;
|
||||
port->timeB = time(NULL);
|
||||
memcpy(&port->dataB, &p->data.admx.data,data_length);
|
||||
port->length = data_length;
|
||||
|
||||
// merge, newest data is port B
|
||||
merge(n,i,data_length, port->dataB);
|
||||
|
||||
// send reply if needed
|
||||
|
||||
}
|
||||
else if (ipA == 0 && ipB == p->from.s_addr) {
|
||||
// new source, start the merge
|
||||
port->ipA.s_addr = p->from.s_addr;
|
||||
port->timeB = time(NULL);
|
||||
memcpy(&port->dataB, &p->data.admx.data,data_length);
|
||||
port->length = data_length;
|
||||
|
||||
// merge, newest data is portA
|
||||
merge(n,i,data_length, port->dataA);
|
||||
|
||||
// send reply if needed
|
||||
}
|
||||
else if (ipA == p->from.s_addr && ipB != p->from.s_addr) {
|
||||
// continue merge
|
||||
port->timeA = time(NULL);
|
||||
memcpy(&port->dataA, &p->data.admx.data,data_length);
|
||||
port->length = data_length;
|
||||
|
||||
// merge, newest data is portA
|
||||
merge(n,i,data_length, port->dataA);
|
||||
|
||||
}
|
||||
else if (ipA != p->from.s_addr && ipB == p->from.s_addr) {
|
||||
// continue merge
|
||||
port->timeB = time(NULL);
|
||||
memcpy(&port->dataB, &p->data.admx.data,data_length);
|
||||
port->length = data_length;
|
||||
|
||||
// merge newest data is portB
|
||||
merge(n,i,data_length, port->dataB);
|
||||
|
||||
}
|
||||
else if (ipA == p->from.s_addr && ipB == p->from.s_addr) {
|
||||
// err_warn("In handle_dmx, source matches both buffers, this shouldn't be happening!\n");
|
||||
|
||||
}
|
||||
else if (ipA != p->from.s_addr && ipB != p->from.s_addr) {
|
||||
// err_warn("In handle_dmx, more than two sources, discarding data\n");
|
||||
|
||||
}
|
||||
else {
|
||||
// err_warn("In handle_dmx, no cases matched, this shouldn't happen!\n");
|
||||
|
||||
}
|
||||
|
||||
// do the dmx callback here
|
||||
if (n->callbacks.dmx_c.fh != NULL)
|
||||
n->callbacks.dmx_c.fh(n,i, n->callbacks.dmx_c.data);
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* handle art address packet.
|
||||
* This can reprogram certain nodes settings such as short/long name, port
|
||||
* addresses, subnet address etc.
|
||||
*
|
||||
*/
|
||||
int handle_address(node n, artnet_packet p) {
|
||||
int i, old_subnet;
|
||||
int addr[ARTNET_MAX_PORTS];
|
||||
int ret;
|
||||
|
||||
if (check_callback(n, p, n->callbacks.address))
|
||||
return ARTNET_EOK;
|
||||
|
||||
// servers (and raw nodes) don't respond to address packets
|
||||
if (n->state.node_type == ARTNET_SRV || n->state.node_type == ARTNET_RAW)
|
||||
return ARTNET_EOK;
|
||||
|
||||
// reprogram shortname if required
|
||||
if (p->data.addr.shortname[0] != PROGRAM_DEFAULTS &&
|
||||
p->data.addr.shortname[0] != PROGRAM_NO_CHANGE) {
|
||||
memcpy(&n->state.short_name, &p->data.addr.shortname, ARTNET_SHORT_NAME_LENGTH);
|
||||
n->state.report_code = ARTNET_RCSHNAMEOK;
|
||||
}
|
||||
// reprogram long name if required
|
||||
if (p->data.addr.longname[0] != PROGRAM_DEFAULTS &&
|
||||
p->data.addr.longname[0] != PROGRAM_NO_CHANGE) {
|
||||
memcpy(&n->state.long_name, &p->data.addr.longname, ARTNET_LONG_NAME_LENGTH);
|
||||
n->state.report_code = ARTNET_RCLONAMEOK;
|
||||
}
|
||||
|
||||
// first of all store existing port addresses
|
||||
// then we can work out if they change
|
||||
for (i=0; i< ARTNET_MAX_PORTS; i++) {
|
||||
addr[i] = n->ports.in[i].port_addr;
|
||||
}
|
||||
|
||||
// program subnet
|
||||
old_subnet = p->data.addr.subnet;
|
||||
if (p->data.addr.subnet == PROGRAM_DEFAULTS) {
|
||||
// reset to defaults
|
||||
n->state.subnet = n->state.default_subnet;
|
||||
n->state.subnet_net_ctl = FALSE;
|
||||
|
||||
} else if (p->data.addr.subnet & PROGRAM_CHANGE_MASK) {
|
||||
n->state.subnet = p->data.addr.subnet & ~PROGRAM_CHANGE_MASK;
|
||||
n->state.subnet_net_ctl = TRUE;
|
||||
}
|
||||
|
||||
// check if subnet has actually changed
|
||||
if (old_subnet != n->state.subnet) {
|
||||
// if it does we need to change all port addresses
|
||||
for(i=0; i< ARTNET_MAX_PORTS; i++) {
|
||||
n->ports.in[i].port_addr = _make_addr(n->state.subnet, n->ports.in[i].port_addr);
|
||||
n->ports.out[i].port_addr = _make_addr(n->state.subnet, n->ports.out[i].port_addr);
|
||||
}
|
||||
}
|
||||
|
||||
// program swins
|
||||
for (i =0; i < ARTNET_MAX_PORTS; i++) {
|
||||
if (p->data.addr.swin[i] == PROGRAM_NO_CHANGE) {
|
||||
continue;
|
||||
} else if (p->data.addr.swin[i] == PROGRAM_DEFAULTS) {
|
||||
// reset to defaults
|
||||
n->ports.in[i].port_addr = _make_addr(n->state.subnet, n->ports.in[i].port_default_addr);
|
||||
n->ports.in[i].port_net_ctl = FALSE;
|
||||
|
||||
} else if ( p->data.addr.swin[i] & PROGRAM_CHANGE_MASK) {
|
||||
n->ports.in[i].port_addr = _make_addr(n->state.subnet, p->data.addr.swin[i]);
|
||||
n->ports.in[i].port_net_ctl = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
// program swouts
|
||||
for (i =0; i < ARTNET_MAX_PORTS; i++) {
|
||||
if (p->data.addr.swout[i] == PROGRAM_NO_CHANGE) {
|
||||
continue;
|
||||
} else if (p->data.addr.swout[i] == PROGRAM_DEFAULTS) {
|
||||
// reset to defaults
|
||||
n->ports.out[i].port_addr = _make_addr(n->state.subnet, n->ports.out[i].port_default_addr);
|
||||
n->ports.out[i].port_net_ctl = FALSE;
|
||||
n->ports.out[i].port_enabled = TRUE;
|
||||
} else if ( p->data.addr.swout[i] & PROGRAM_CHANGE_MASK) {
|
||||
n->ports.out[i].port_addr = _make_addr(n->state.subnet, p->data.addr.swout[i]);
|
||||
n->ports.in[i].port_net_ctl = TRUE;
|
||||
n->ports.out[i].port_enabled = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
// reset sequence numbers if the addresses change
|
||||
for (i=0; i< ARTNET_MAX_PORTS; i++) {
|
||||
if (addr[i] != n->ports.in[i].port_addr)
|
||||
n->ports.in[i].seq = 0;
|
||||
}
|
||||
|
||||
// check command
|
||||
switch (p->data.addr.command) {
|
||||
case ARTNET_PC_CANCEL:
|
||||
// fix me
|
||||
break;
|
||||
case ARTNET_PC_RESET:
|
||||
n->ports.out[0].port_status = n->ports.out[0].port_status & ~PORT_STATUS_DMX_SIP & ~PORT_STATUS_DMX_TEST & ~PORT_STATUS_DMX_TEXT;
|
||||
// need to force a rerun of short tests here
|
||||
break;
|
||||
case ARTNET_PC_MERGE_LTP_O:
|
||||
n->ports.out[0].merge_mode = ARTNET_MERGE_LTP;
|
||||
n->ports.out[0].port_status = n->ports.out[0].port_status | PORT_STATUS_LPT_MODE;
|
||||
break;
|
||||
case ARTNET_PC_MERGE_LTP_1:
|
||||
n->ports.out[1].merge_mode = ARTNET_MERGE_LTP;
|
||||
n->ports.out[1].port_status = n->ports.out[1].port_status | PORT_STATUS_LPT_MODE;
|
||||
break;
|
||||
case ARTNET_PC_MERGE_LTP_2:
|
||||
n->ports.out[2].merge_mode = ARTNET_MERGE_LTP;
|
||||
n->ports.out[2].port_status = n->ports.out[2].port_status | PORT_STATUS_LPT_MODE;
|
||||
break;
|
||||
case ARTNET_PC_MERGE_LTP_3:
|
||||
n->ports.out[3].merge_mode = ARTNET_MERGE_LTP;
|
||||
n->ports.out[3].port_status = n->ports.out[3].port_status | PORT_STATUS_LPT_MODE;
|
||||
break;
|
||||
case ARTNET_PC_MERGE_HTP_0:
|
||||
n->ports.out[0].merge_mode = ARTNET_MERGE_HTP;
|
||||
n->ports.out[0].port_status = n->ports.out[0].port_status | PORT_STATUS_LPT_MODE;
|
||||
break;
|
||||
case ARTNET_PC_MERGE_HTP_1:
|
||||
n->ports.out[1].merge_mode = ARTNET_MERGE_HTP;
|
||||
n->ports.out[1].port_status = n->ports.out[1].port_status | PORT_STATUS_LPT_MODE;
|
||||
break;
|
||||
case ARTNET_PC_MERGE_HTP_2:
|
||||
n->ports.out[2].merge_mode = ARTNET_MERGE_HTP;
|
||||
n->ports.out[2].port_status = n->ports.out[2].port_status | PORT_STATUS_LPT_MODE;
|
||||
break;
|
||||
case ARTNET_PC_MERGE_HTP_3:
|
||||
n->ports.out[3].merge_mode = ARTNET_MERGE_HTP;
|
||||
n->ports.out[3].port_status = n->ports.out[3].port_status | PORT_STATUS_LPT_MODE;
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
if (n->callbacks.program_c.fh != NULL)
|
||||
n->callbacks.program_c.fh(n , n->callbacks.program_c.data);
|
||||
|
||||
if ((ret = artnet_tx_build_art_poll_reply(n)))
|
||||
return ret;
|
||||
|
||||
return artnet_tx_poll_reply(n, TRUE);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* handle art input.
|
||||
* ArtInput packets can disable input ports.
|
||||
*/
|
||||
int _artnet_handle_input(node n, artnet_packet p) {
|
||||
int i, ports, ret;
|
||||
|
||||
if (check_callback(n, p, n->callbacks.input))
|
||||
return ARTNET_EOK;
|
||||
|
||||
// servers (and raw nodes) don't respond to input packets
|
||||
if (n->state.node_type != ARTNET_NODE && n->state.node_type != ARTNET_MSRV)
|
||||
return ARTNET_EOK;
|
||||
|
||||
ports = min( p->data.ainput.numbports, ARTNET_MAX_PORTS);
|
||||
for (i =0; i < ports; i++) {
|
||||
if (p->data.ainput.input[i] & PORT_DISABLE_MASK) {
|
||||
// disable
|
||||
n->ports.in[i].port_status = n->ports.in[i].port_status | PORT_STATUS_DISABLED_MASK;
|
||||
} else {
|
||||
// enable
|
||||
n->ports.in[i].port_status = n->ports.in[i].port_status & ~PORT_STATUS_DISABLED_MASK;
|
||||
}
|
||||
}
|
||||
|
||||
if ((ret = artnet_tx_build_art_poll_reply(n)))
|
||||
return ret;
|
||||
|
||||
return artnet_tx_poll_reply(n, TRUE);
|
||||
}
|
||||
|
||||
|
||||
/***
|
||||
* handle tod request packet
|
||||
*/
|
||||
int handle_tod_request(node n, artnet_packet p) {
|
||||
int i, j, limit;
|
||||
int ret = ARTNET_EOK;
|
||||
|
||||
if (check_callback(n, p, n->callbacks.todrequest))
|
||||
return ARTNET_EOK;
|
||||
|
||||
if (n->state.node_type != ARTNET_NODE)
|
||||
return ARTNET_EOK;
|
||||
|
||||
// limit to 32
|
||||
limit = min(ARTNET_MAX_RDM_ADCOUNT, p->data.todreq.adCount);
|
||||
|
||||
// this should always be true
|
||||
if (p->data.todreq.command == 0x00) {
|
||||
for (i=0; i < limit; i++) {
|
||||
for (j=0; j < ARTNET_MAX_PORTS; j++) {
|
||||
if (n->ports.out[j].port_addr == p->data.todreq.address[i] &&
|
||||
n->ports.out[j].port_enabled) {
|
||||
// reply with tod
|
||||
ret = ret || artnet_tx_tod_data(n, j);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// err_warn("tod request received but command is 0x%02hhx rather than 0x00\n", p->data.todreq.command);
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* handle tod data packet
|
||||
*
|
||||
* we don't maintain a tod of whats out on the network,
|
||||
* the calling app can deal with this.
|
||||
*/
|
||||
void handle_tod_data(node n, artnet_packet p) {
|
||||
|
||||
if (check_callback(n, p, n->callbacks.toddata))
|
||||
return;
|
||||
|
||||
// pass data to app
|
||||
|
||||
// if (n->callbacks.rdm_tod_c.fh != NULL)
|
||||
// n->callbacks.rdm_tod_c.fh(n, i, n->callbacks.rdm_tod_c.data);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
|
||||
int handle_tod_control(node n, artnet_packet p) {
|
||||
int i;
|
||||
int ret = ARTNET_EOK;
|
||||
|
||||
if (check_callback(n, p, n->callbacks.todcontrol))
|
||||
return ARTNET_EOK;
|
||||
|
||||
for (i=0; i < ARTNET_MAX_PORTS; i++) {
|
||||
if (n->ports.out[i].port_addr == p->data.todcontrol.address &&
|
||||
n->ports.out[i].port_enabled) {
|
||||
|
||||
if (p->data.todcontrol.cmd == ARTNET_TOD_FLUSH) {
|
||||
// flush tod for this port
|
||||
flush_tod(&n->ports.out[i].port_tod);
|
||||
|
||||
//initiate full rdm discovery
|
||||
// do callback here
|
||||
if (n->callbacks.rdm_init_c.fh != NULL)
|
||||
n->callbacks.rdm_init_c.fh(n, i, n->callbacks.rdm_init_c.data);
|
||||
|
||||
// not really sure what to do here, the calling app should do a rdm
|
||||
// init and call artnet_add_rdm_devices() which will send a tod data
|
||||
// but do we really trust the caller ?
|
||||
// Instead we'll send an empty tod data and then another one a bit later
|
||||
// when our tod is populated
|
||||
}
|
||||
// reply with tod
|
||||
ret = ret || artnet_tx_tod_data(n, i);
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* handle rdm packet
|
||||
*
|
||||
*/
|
||||
void handle_rdm(node n, artnet_packet p) {
|
||||
|
||||
|
||||
if (check_callback(n, p, n->callbacks.rdm))
|
||||
return;
|
||||
|
||||
printf("rdm data\n");
|
||||
|
||||
// hell dodgy
|
||||
if (n->callbacks.rdm_c.fh != NULL)
|
||||
n->callbacks.rdm_c.fh(n, p->data.rdm.address, p->data.rdm.data, ARTNET_MAX_RDM_DATA, n->callbacks.rdm_c.data);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* handle a firmware master
|
||||
*/
|
||||
|
||||
// THIS NEEDS TO BE CHECKED FOR BUFFER OVERFLOWS
|
||||
// IMPORTANT!!!!
|
||||
int handle_firmware(node n, artnet_packet p) {
|
||||
int length, offset, block_length, total_blocks, block_id;
|
||||
artnet_firmware_status_code response_code = ARTNET_FIRMWARE_FAIL;
|
||||
|
||||
// run callback if defined
|
||||
if (check_callback(n, p, n->callbacks.firmware))
|
||||
return ARTNET_EOK;
|
||||
|
||||
/*
|
||||
* What happens if an upload is less than 512 bytes ?????
|
||||
*/
|
||||
|
||||
if ( p->data.firmware.type == ARTNET_FIRMWARE_FIRMFIRST ||
|
||||
p->data.firmware.type == ARTNET_FIRMWARE_UBEAFIRST) {
|
||||
// a new transfer is initiated
|
||||
|
||||
if (n->firmware.peer.s_addr == 0) {
|
||||
//new transfer
|
||||
// these are 2 byte words, so we get a total of 1k of data per packet
|
||||
length = artnet_misc_nbytes_to_32( p->data.firmware.length ) *
|
||||
sizeof(p->data.firmware.data[0]);
|
||||
|
||||
// set parameters
|
||||
n->firmware.peer.s_addr = p->from.s_addr;
|
||||
n->firmware.data = malloc(length);
|
||||
|
||||
if (n->firmware.data == NULL) {
|
||||
artnet_error_malloc();
|
||||
return ARTNET_EMEM;
|
||||
}
|
||||
n->firmware.bytes_total = length;
|
||||
n->firmware.last_time = time(NULL);
|
||||
n->firmware.expected_block = 1;
|
||||
|
||||
// check if this is a ubea upload or not
|
||||
if (p->data.firmware.type == ARTNET_FIRMWARE_FIRMFIRST)
|
||||
n->firmware.ubea = 0;
|
||||
else
|
||||
n->firmware.ubea = 1;
|
||||
|
||||
// take the minimum of the total length and the max packet size
|
||||
block_length = min((unsigned int) length, ARTNET_FIRMWARE_SIZE *
|
||||
sizeof(p->data.firmware.data[0]));
|
||||
|
||||
memcpy(n->firmware.data, p->data.firmware.data, block_length);
|
||||
n->firmware.bytes_current = block_length;
|
||||
|
||||
if (block_length == length) {
|
||||
// this is the first and last packet
|
||||
// upload was less than 1k bytes
|
||||
// this behaviour isn't in the spec, presumably no firmware will be less that 1k
|
||||
response_code = ARTNET_FIRMWARE_ALLGOOD;
|
||||
|
||||
// do the callback here
|
||||
if (n->callbacks.firmware_c.fh != NULL)
|
||||
n->callbacks.firmware_c.fh(n,
|
||||
n->firmware.ubea,
|
||||
n->firmware.data,
|
||||
n->firmware.bytes_total,
|
||||
n->callbacks.firmware_c.data);
|
||||
|
||||
} else {
|
||||
response_code = ARTNET_FIRMWARE_BLOCKGOOD;
|
||||
}
|
||||
|
||||
} else {
|
||||
// already in a transfer
|
||||
printf("First, but already for a packet\n");
|
||||
|
||||
// send a failure
|
||||
response_code = ARTNET_FIRMWARE_FAIL;
|
||||
}
|
||||
|
||||
} else if (p->data.firmware.type == ARTNET_FIRMWARE_FIRMCONT ||
|
||||
p->data.firmware.type == ARTNET_FIRMWARE_UBEACONT) {
|
||||
// continued transfer
|
||||
length = artnet_misc_nbytes_to_32(p->data.firmware.length) *
|
||||
sizeof(p->data.firmware.data[0]);
|
||||
total_blocks = length / ARTNET_FIRMWARE_SIZE / 2 + 1;
|
||||
block_length = ARTNET_FIRMWARE_SIZE * sizeof(uint16_t);
|
||||
block_id = p->data.firmware.blockId;
|
||||
|
||||
// ok the blockid field is only 1 byte, so it wraps back to 0x00 we
|
||||
// need to watch for this
|
||||
if (n->firmware.expected_block > UINT8_MAX &&
|
||||
(n->firmware.expected_block % (UINT8_MAX+1)) == p->data.firmware.blockId) {
|
||||
|
||||
block_id = n->firmware.expected_block;
|
||||
}
|
||||
offset = block_id * ARTNET_FIRMWARE_SIZE;
|
||||
|
||||
if (n->firmware.peer.s_addr == p->from.s_addr &&
|
||||
length == n->firmware.bytes_total &&
|
||||
block_id < total_blocks-1) {
|
||||
|
||||
memcpy(n->firmware.data + offset, p->data.firmware.data, block_length);
|
||||
n->firmware.bytes_current += block_length;
|
||||
n->firmware.expected_block++;
|
||||
|
||||
response_code = ARTNET_FIRMWARE_BLOCKGOOD;
|
||||
} else {
|
||||
printf("cont, ips don't match or length has changed or out of range block num\n" );
|
||||
|
||||
// in a transfer not from this ip
|
||||
response_code = ARTNET_FIRMWARE_FAIL;
|
||||
}
|
||||
|
||||
} else if (p->data.firmware.type == ARTNET_FIRMWARE_FIRMLAST ||
|
||||
p->data.firmware.type == ARTNET_FIRMWARE_UBEALAST) {
|
||||
length = artnet_misc_nbytes_to_32( p->data.firmware.length) *
|
||||
sizeof(p->data.firmware.data[0]);
|
||||
total_blocks = length / ARTNET_FIRMWARE_SIZE / 2 + 1;
|
||||
|
||||
// length should be the remaining data
|
||||
block_length = n->firmware.bytes_total % (ARTNET_FIRMWARE_SIZE * sizeof(uint16_t));
|
||||
block_id = p->data.firmware.blockId;
|
||||
|
||||
// ok the blockid field is only 1 byte, so it wraps back to 0x00 we
|
||||
// need to watch for this
|
||||
if (n->firmware.expected_block > UINT8_MAX &&
|
||||
(n->firmware.expected_block % (UINT8_MAX+1)) == p->data.firmware.blockId) {
|
||||
|
||||
block_id = n->firmware.expected_block;
|
||||
}
|
||||
offset = block_id * ARTNET_FIRMWARE_SIZE;
|
||||
|
||||
if (n->firmware.peer.s_addr == p->from.s_addr &&
|
||||
length == n->firmware.bytes_total &&
|
||||
block_id == total_blocks-1) {
|
||||
|
||||
// all the checks work out
|
||||
memcpy(n->firmware.data + offset, p->data.firmware.data, block_length);
|
||||
n->firmware.bytes_current += block_length;
|
||||
|
||||
// do the callback here
|
||||
if (n->callbacks.firmware_c.fh != NULL)
|
||||
n->callbacks.firmware_c.fh(n, n->firmware.ubea,
|
||||
n->firmware.data,
|
||||
n->firmware.bytes_total / sizeof(p->data.firmware.data[0]),
|
||||
n->callbacks.firmware_c.data);
|
||||
|
||||
// reset values and free
|
||||
reset_firmware_upload(n);
|
||||
|
||||
response_code = ARTNET_FIRMWARE_ALLGOOD;
|
||||
printf("Firmware upload complete\n");
|
||||
|
||||
} else if (n->firmware.peer.s_addr != p->from.s_addr) {
|
||||
// in a transfer not from this ip
|
||||
printf("last, ips don't match\n" );
|
||||
response_code = ARTNET_FIRMWARE_FAIL;
|
||||
} else if (length != n->firmware.bytes_total) {
|
||||
// they changed the length mid way thru a transfer
|
||||
printf("last, lengths have changed %d %d\n", length, n->firmware.bytes_total);
|
||||
response_code = ARTNET_FIRMWARE_FAIL;
|
||||
} else if (block_id != total_blocks -1) {
|
||||
// the blocks don't match up
|
||||
printf("This is the last block, but not according to the lengths %d %d\n", block_id, total_blocks -1);
|
||||
response_code = ARTNET_FIRMWARE_FAIL;
|
||||
}
|
||||
}
|
||||
|
||||
return artnet_tx_firmware_reply(n, p->from.s_addr, response_code);
|
||||
}
|
||||
|
||||
/**
|
||||
* handle an firmware reply
|
||||
*/
|
||||
int handle_firmware_reply(node n, artnet_packet p) {
|
||||
node_entry_private_t *ent;
|
||||
|
||||
// run callback if defined
|
||||
if (check_callback(n, p, n->callbacks.firmware_reply))
|
||||
return ARTNET_EOK;
|
||||
|
||||
ent = find_entry_from_ip(&n->node_list, p->from);
|
||||
|
||||
// node doesn't exist in our list, or we're not doing a transfer to this node
|
||||
if (ent== NULL || ent->firmware.bytes_total == 0)
|
||||
return ARTNET_EOK;
|
||||
|
||||
// three types of response, ALLGOOD, BLOCKGOOD and FIRMFAIL
|
||||
if (p->data.firmwarer.type == ARTNET_FIRMWARE_ALLGOOD) {
|
||||
|
||||
if (ent->firmware.bytes_total == ent->firmware.bytes_current) {
|
||||
// transfer complete
|
||||
|
||||
// do the callback
|
||||
if (ent->firmware.callback != NULL)
|
||||
ent->firmware.callback(n, ARTNET_FIRMWARE_ALLGOOD, ent->firmware.user_data);
|
||||
|
||||
memset(&ent->firmware, 0x0, sizeof(firmware_transfer_t));
|
||||
|
||||
} else {
|
||||
// random ALLGOOD received, don't let this abort the transfer
|
||||
printf("FIRMWARE_ALLGOOD received before transfer completed\n");
|
||||
}
|
||||
|
||||
} else if (p->data.firmwarer.type == ARTNET_FIRMWARE_FAIL) {
|
||||
|
||||
// do the callback
|
||||
if (ent->firmware.callback != NULL)
|
||||
ent->firmware.callback(n, ARTNET_FIRMWARE_FAIL, ent->firmware.user_data);
|
||||
|
||||
// cancel transfer
|
||||
memset(&ent->firmware, 0x0, sizeof(firmware_transfer_t));
|
||||
|
||||
} else if (p->data.firmwarer.type == ARTNET_FIRMWARE_BLOCKGOOD) {
|
||||
// send the next block (only if we're not done yet)
|
||||
if (ent->firmware.bytes_total != ent->firmware.bytes_current) {
|
||||
return artnet_tx_firmware_packet(n, &ent->firmware);
|
||||
}
|
||||
}
|
||||
return ARTNET_EOK;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* have to sort this one out.
|
||||
*/
|
||||
void handle_ipprog(node n, artnet_packet p) {
|
||||
|
||||
if (check_callback(n, p, n->callbacks.ipprog))
|
||||
return;
|
||||
|
||||
printf("in ipprog\n");
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* The main handler for an artnet packet. calls
|
||||
* the appropriate handler function
|
||||
*/
|
||||
int handle(node n, artnet_packet p) {
|
||||
|
||||
if (check_callback(n, p, n->callbacks.recv))
|
||||
return 0;
|
||||
|
||||
switch (p->type) {
|
||||
case ARTNET_POLL:
|
||||
handle_poll(n, p);
|
||||
break;
|
||||
case ARTNET_REPLY:
|
||||
handle_reply(n,p);
|
||||
break;
|
||||
case ARTNET_DMX:
|
||||
handle_dmx(n, p);
|
||||
break;
|
||||
case ARTNET_ADDRESS:
|
||||
handle_address(n, p);
|
||||
break;
|
||||
case ARTNET_INPUT:
|
||||
_artnet_handle_input(n, p);
|
||||
break;
|
||||
case ARTNET_TODREQUEST:
|
||||
handle_tod_request(n, p);
|
||||
break;
|
||||
case ARTNET_TODDATA:
|
||||
handle_tod_data(n, p);
|
||||
break;
|
||||
case ARTNET_TODCONTROL:
|
||||
handle_tod_control(n, p);
|
||||
break;
|
||||
case ARTNET_RDM:
|
||||
handle_rdm(n, p);
|
||||
break;
|
||||
case ARTNET_VIDEOSTEUP:
|
||||
printf("vid setup\n");
|
||||
break;
|
||||
case ARTNET_VIDEOPALETTE:
|
||||
printf("video palette\n");
|
||||
break;
|
||||
case ARTNET_VIDEODATA:
|
||||
printf("video data\n");
|
||||
break;
|
||||
case ARTNET_MACMASTER:
|
||||
printf("mac master\n");
|
||||
break;
|
||||
case ARTNET_MACSLAVE:
|
||||
printf("mac slave\n");
|
||||
break;
|
||||
case ARTNET_FIRMWAREMASTER:
|
||||
handle_firmware(n, p);
|
||||
break;
|
||||
case ARTNET_FIRMWAREREPLY:
|
||||
handle_firmware_reply(n, p);
|
||||
break;
|
||||
case ARTNET_IPPROG :
|
||||
handle_ipprog(n, p);
|
||||
break;
|
||||
case ARTNET_IPREPLY:
|
||||
printf("ip reply\n");
|
||||
break;
|
||||
case ARTNET_MEDIA:
|
||||
printf("media \n");
|
||||
break;
|
||||
case ARTNET_MEDIAPATCH:
|
||||
printf("media patch\n");
|
||||
break;
|
||||
case ARTNET_MEDIACONTROLREPLY:
|
||||
printf("media control reply\n");
|
||||
break;
|
||||
default:
|
||||
n->state.report_code = ARTNET_RCPARSEFAIL;
|
||||
printf("artnet but not yet implemented!, op was %hx\n", p->type);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* this gets the opcode from a packet
|
||||
*/
|
||||
int16_t get_type(artnet_packet p) {
|
||||
uint8_t *data;
|
||||
|
||||
if (p->length < 10)
|
||||
return 0;
|
||||
if (!memcmp(&p->data, "Art-Net\0", 8)) {
|
||||
// not the best here, this needs to be tested on different arch
|
||||
data = (uint8_t *) &p->data;
|
||||
|
||||
p->type = (data[9] << 8) + data[8];
|
||||
return p->type;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* takes a subnet and an address and creates the universe address
|
||||
*/
|
||||
uint8_t _make_addr(uint8_t subnet, uint8_t addr) {
|
||||
return ((subnet & LOW_NIBBLE) << 4) | (addr & LOW_NIBBLE);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
*
|
||||
*/
|
||||
void check_merge_timeouts(node n, int port_id) {
|
||||
output_port_t *port;
|
||||
time_t now;
|
||||
time_t timeoutA, timeoutB;
|
||||
port = &n->ports.out[port_id];
|
||||
time(&now);
|
||||
timeoutA = now - port->timeA;
|
||||
timeoutB = now - port->timeB;
|
||||
|
||||
if (timeoutA > MERGE_TIMEOUT_SECONDS) {
|
||||
// A is old, stop the merge
|
||||
port->ipA.s_addr = 0;
|
||||
}
|
||||
|
||||
if (timeoutB > MERGE_TIMEOUT_SECONDS) {
|
||||
// B is old, stop the merge
|
||||
port->ipB.s_addr = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* merge the data from two sources
|
||||
*/
|
||||
void merge(node n, int port_id, int length, uint8_t *latest) {
|
||||
int i;
|
||||
output_port_t *port;
|
||||
port = &n->ports.out[port_id];
|
||||
|
||||
if (port->merge_mode == ARTNET_MERGE_HTP) {
|
||||
for (i=0; i< length; i++)
|
||||
port->data[i] = max(port->dataA[i], port->dataB[i]);
|
||||
} else {
|
||||
memcpy(port->data, latest, length);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void reset_firmware_upload(node n) {
|
||||
n->firmware.bytes_current = 0;
|
||||
n->firmware.bytes_total = 0;
|
||||
n->firmware.peer.s_addr = 0;
|
||||
n->firmware.ubea = 0;
|
||||
n->firmware.last_time = 0;
|
||||
free(n->firmware.data);
|
||||
}
|
|
@ -0,0 +1,128 @@
|
|||
/*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*
|
||||
* tod.c
|
||||
* Functions to manipulate the TOD
|
||||
* Copyright (C) 2004-2005 Simon Newton
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "tod.h"
|
||||
#include "misc.h"
|
||||
|
||||
/*
|
||||
* adds a uid to the table of devices
|
||||
*/
|
||||
int add_tod_uid(tod_t *tod, uint8_t uid[ARTNET_RDM_UID_WIDTH]) {
|
||||
uint8_t *addr;
|
||||
int size;
|
||||
|
||||
if (tod == NULL)
|
||||
return -1;
|
||||
|
||||
if (tod->data == NULL) {
|
||||
// malloc
|
||||
tod->data = malloc(ARTNET_RDM_UID_WIDTH * ARTNET_TOD_INITIAL_SIZE);
|
||||
|
||||
if (tod->data == NULL) {
|
||||
artnet_error_malloc();
|
||||
return ARTNET_EMEM;
|
||||
}
|
||||
tod->length = 1;
|
||||
tod->max_length = ARTNET_TOD_INITIAL_SIZE;
|
||||
|
||||
} else if (tod->length == tod->max_length) {
|
||||
// realloc
|
||||
size = (tod->max_length + ARTNET_TOD_INCREMENT);
|
||||
tod->data = realloc(tod->data, size * ARTNET_RDM_UID_WIDTH);
|
||||
|
||||
if (tod->data == NULL) {
|
||||
artnet_error_realloc();
|
||||
return ARTNET_EMEM;
|
||||
}
|
||||
|
||||
tod->max_length = size;
|
||||
tod->length++;
|
||||
|
||||
} else {
|
||||
tod->length++;
|
||||
}
|
||||
|
||||
addr = tod->data + (tod->length-1) * ARTNET_RDM_UID_WIDTH;
|
||||
memcpy(addr, uid, ARTNET_RDM_UID_WIDTH);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* remove a uid from the table of devices
|
||||
*
|
||||
*/
|
||||
int remove_tod_uid(tod_t *tod, uint8_t uid[ARTNET_RDM_UID_WIDTH]) {
|
||||
int i;
|
||||
int offset = 0;
|
||||
uint8_t *last;
|
||||
|
||||
if (tod == NULL)
|
||||
return -1;
|
||||
|
||||
if (tod->data == NULL)
|
||||
return -1;
|
||||
|
||||
for (i=0; i < tod->length; i++) {
|
||||
offset += ARTNET_RDM_UID_WIDTH;
|
||||
if (memcmp(tod->data + offset, uid, ARTNET_RDM_UID_WIDTH) == 0)
|
||||
break;
|
||||
}
|
||||
|
||||
if (i == tod->length) {
|
||||
return -1;
|
||||
} else {
|
||||
|
||||
last = tod->data + (tod->length-1) * ARTNET_RDM_UID_WIDTH;
|
||||
// copy the last entry over this one
|
||||
memcpy(tod->data + offset, last ,ARTNET_RDM_UID_WIDTH);
|
||||
|
||||
tod->length--;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* clear the table of devices
|
||||
*/
|
||||
int flush_tod(tod_t *tod) {
|
||||
if (tod == NULL)
|
||||
return -1;
|
||||
|
||||
free(tod->data);
|
||||
tod->data = NULL;
|
||||
tod->length = 0;
|
||||
tod->max_length = 0;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
int reset_tod(tod_t *tod) {
|
||||
if (tod == NULL)
|
||||
return -1;
|
||||
|
||||
tod->data = NULL;
|
||||
tod->length = 0;
|
||||
tod->max_length = 0;
|
||||
return 0;
|
||||
}
|
|
@ -0,0 +1,45 @@
|
|||
/*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*
|
||||
* tod.h
|
||||
* Header file for tod.h
|
||||
* Copyright (C) 2004-2005 Simon Newton
|
||||
*/
|
||||
|
||||
#ifndef ARTNET_TOD_H
|
||||
#define ARTNET_TOD_H
|
||||
|
||||
#include <stdint.h>
|
||||
#include "common.h"
|
||||
|
||||
enum { ARTNET_TOD_INITIAL_SIZE = 100 };
|
||||
enum { ARTNET_TOD_INCREMENT = 50 };
|
||||
|
||||
/*
|
||||
* table of devices
|
||||
*/
|
||||
typedef struct {
|
||||
uint8_t *data;
|
||||
int length;
|
||||
int max_length;
|
||||
} tod_t;
|
||||
|
||||
|
||||
extern int add_tod_uid(tod_t *tod, uint8_t uid[ARTNET_RDM_UID_WIDTH]);
|
||||
extern int remove_tod_uid(tod_t *tod, uint8_t uid[ARTNET_RDM_UID_WIDTH]);
|
||||
extern int flush_tod(tod_t *tod);
|
||||
extern int reset_tod(tod_t *tod);
|
||||
|
||||
#endif
|
|
@ -0,0 +1,445 @@
|
|||
/*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*
|
||||
* transmit.c
|
||||
* Functions to handle sending datagrams
|
||||
* Copyright (C) 2004-2005 Simon Newton
|
||||
*/
|
||||
|
||||
#include "private.h"
|
||||
|
||||
/*
|
||||
* Send an art poll
|
||||
*
|
||||
* @param ip the ip address to send to
|
||||
* @param ttm the talk to me value, either ARTNET_TTM_DEFAULT,
|
||||
* ARTNET_TTM_PRIVATE or ARTNET_TTM_AUTO
|
||||
*/
|
||||
int artnet_tx_poll(node n, const char *ip, artnet_ttm_value_t ttm) {
|
||||
artnet_packet_t p;
|
||||
int ret;
|
||||
|
||||
if (n->state.mode != ARTNET_ON)
|
||||
return ARTNET_EACTION;
|
||||
|
||||
if (n->state.node_type == ARTNET_SRV || n->state.node_type == ARTNET_RAW) {
|
||||
if (ip) {
|
||||
ret = artnet_net_inet_aton(ip, &p.to);
|
||||
if (ret)
|
||||
return ret;
|
||||
} else {
|
||||
p.to.s_addr = n->state.bcast_addr.s_addr;
|
||||
}
|
||||
|
||||
memcpy(&p.data.ap.id, ARTNET_STRING, ARTNET_STRING_SIZE);
|
||||
p.data.ap.opCode = htols(ARTNET_POLL);
|
||||
p.data.ap.verH = 0;
|
||||
p.data.ap.ver = ARTNET_VERSION;
|
||||
p.data.ap.ttm = ~ttm;
|
||||
p.data.ap.pad = 0;
|
||||
|
||||
p.length = sizeof(artnet_poll_t);
|
||||
return artnet_net_send(n, &p);
|
||||
|
||||
} else {
|
||||
artnet_error("Not sending poll, not a server or raw device");
|
||||
return ARTNET_EACTION;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Send an ArtPollReply
|
||||
* @param n the node
|
||||
* @param response true if this reply is in response to a network packet
|
||||
* false if this reply is due to the node changing it's conditions
|
||||
*/
|
||||
int artnet_tx_poll_reply(node n, int response) {
|
||||
artnet_packet_t reply;
|
||||
int i;
|
||||
|
||||
if (!response && n->state.mode == ARTNET_ON) {
|
||||
n->state.ar_count++;
|
||||
}
|
||||
|
||||
reply.to = n->state.reply_addr;
|
||||
reply.type = ARTNET_REPLY;
|
||||
reply.length = sizeof(artnet_reply_t);
|
||||
|
||||
// copy from a poll reply template
|
||||
memcpy(&reply.data, &n->ar_temp, sizeof(artnet_reply_t));
|
||||
|
||||
for (i=0; i< ARTNET_MAX_PORTS; i++) {
|
||||
reply.data.ar.goodinput[i] = n->ports.in[i].port_status;
|
||||
reply.data.ar.goodoutput[i] = n->ports.out[i].port_status;
|
||||
}
|
||||
|
||||
snprintf((char *) &reply.data.ar.nodereport,
|
||||
sizeof(reply.data.ar.nodereport),
|
||||
"%04hx [%04i] libartnet",
|
||||
n->state.report_code,
|
||||
n->state.ar_count);
|
||||
|
||||
return artnet_net_send(n, &reply);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Send a tod request
|
||||
*/
|
||||
int artnet_tx_tod_request(node n) {
|
||||
int i;
|
||||
artnet_packet_t todreq;
|
||||
|
||||
todreq.to = n->state.bcast_addr;
|
||||
todreq.type = ARTNET_TODREQUEST;
|
||||
todreq.length = sizeof(artnet_todrequest_t);
|
||||
memset(&todreq.data,0x00, todreq.length);
|
||||
|
||||
// set up the data
|
||||
memcpy(&todreq.data.todreq.id, ARTNET_STRING, ARTNET_STRING_SIZE);
|
||||
todreq.data.todreq.opCode = htols(ARTNET_TODREQUEST);
|
||||
todreq.data.todreq.verH = 0;
|
||||
todreq.data.todreq.ver = ARTNET_VERSION;
|
||||
todreq.data.todreq.command = ARTNET_TOD_FULL; // todfull
|
||||
todreq.data.todreq.adCount = 0;
|
||||
|
||||
// include all enabled ports
|
||||
for (i=0; i < ARTNET_MAX_PORTS; i++) {
|
||||
if (n->ports.out[i].port_enabled) {
|
||||
todreq.data.todreq.address[todreq.data.todreq.adCount++] = n->ports.out[i].port_addr;
|
||||
}
|
||||
}
|
||||
|
||||
return artnet_net_send(n, &todreq);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Send a tod data for port number id
|
||||
* @param id the number of the port to send data for
|
||||
*/
|
||||
int artnet_tx_tod_data(node n, int id) {
|
||||
artnet_packet_t tod;
|
||||
int lim, remaining, bloc, offset;
|
||||
int ret = ARTNET_EOK;
|
||||
|
||||
// ok we need to check how many uid's we have,
|
||||
// may need to send more than one datagram
|
||||
|
||||
tod.to = n->state.bcast_addr;
|
||||
tod.type = ARTNET_TODDATA;
|
||||
tod.length = sizeof(artnet_toddata_t);
|
||||
|
||||
memset(&tod.data,0x00, tod.length);
|
||||
|
||||
// set up the data
|
||||
memcpy(&tod.data.toddata.id, ARTNET_STRING, ARTNET_STRING_SIZE);
|
||||
tod.data.toddata.opCode = htols(ARTNET_TODDATA);
|
||||
tod.data.toddata.verH = 0;
|
||||
tod.data.toddata.ver = ARTNET_VERSION;
|
||||
tod.data.toddata.port = id;
|
||||
|
||||
// this is interesting, the spec mentions TOD_ADD and TOD_SUBTRACT, but the
|
||||
// codes aren't given. The windows drivers don't have these either....
|
||||
tod.data.toddata.cmdRes = ARTNET_TOD_FULL;
|
||||
|
||||
tod.data.toddata.address = n->ports.out[id].port_addr;
|
||||
tod.data.toddata.uidTotalHi = short_get_high_byte(n->ports.out[id].port_tod.length);
|
||||
tod.data.toddata.uidTotal = short_get_low_byte(n->ports.out[id].port_tod.length);
|
||||
|
||||
remaining = n->ports.out[id].port_tod.length;
|
||||
bloc = 0;
|
||||
|
||||
while (remaining > 0) {
|
||||
memset(&tod.data.toddata.tod,0x00, ARTNET_MAX_UID_COUNT);
|
||||
lim = min(ARTNET_MAX_UID_COUNT, remaining);
|
||||
tod.data.toddata.blockCount = bloc++;
|
||||
tod.data.toddata.uidCount = lim;
|
||||
|
||||
offset = (n->ports.out[id].port_tod.length - remaining) * ARTNET_RDM_UID_WIDTH;
|
||||
if (n->ports.out[id].port_tod.data != NULL)
|
||||
memcpy(tod.data.toddata.tod,
|
||||
n->ports.out[id].port_tod.data + offset,
|
||||
lim * ARTNET_RDM_UID_WIDTH);
|
||||
|
||||
ret = ret || artnet_net_send(n, &tod);
|
||||
remaining = remaining - lim;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Send a tod data for port number id
|
||||
* @param id the number of the port to send data for
|
||||
*/
|
||||
int artnet_tx_tod_control(node n,
|
||||
uint8_t address,
|
||||
artnet_tod_command_code action) {
|
||||
artnet_packet_t tod;
|
||||
|
||||
tod.to = n->state.bcast_addr;
|
||||
tod.type = ARTNET_TODCONTROL;
|
||||
tod.length = sizeof(artnet_todcontrol_t);
|
||||
|
||||
memset(&tod.data,0x00, tod.length);
|
||||
|
||||
// set up the data
|
||||
memcpy(&tod.data.todcontrol.id, ARTNET_STRING, ARTNET_STRING_SIZE);
|
||||
tod.data.todcontrol.opCode = htols(ARTNET_TODCONTROL);
|
||||
tod.data.todcontrol.verH = 0;
|
||||
tod.data.todcontrol.ver = ARTNET_VERSION;
|
||||
tod.data.todcontrol.cmd = action;
|
||||
tod.data.todcontrol.address = address;
|
||||
|
||||
return artnet_net_send(n, &tod);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Send a RDM message
|
||||
* @param address the universe to address this datagram to
|
||||
* @param action the action to perform. Either ARTNET_TOD_FULL or
|
||||
* ARTNET_TOD_FLUSH
|
||||
*/
|
||||
int artnet_tx_rdm(node n, uint8_t address, uint8_t *data, int length) {
|
||||
artnet_packet_t rdm;
|
||||
int len;
|
||||
|
||||
rdm.to = n->state.bcast_addr;
|
||||
rdm.type = ARTNET_RDM;
|
||||
rdm.length = sizeof(artnet_rdm_t);
|
||||
|
||||
memset(&rdm.data,0x00, rdm.length);
|
||||
|
||||
// set up the data
|
||||
memcpy(&rdm.data.todcontrol.id, ARTNET_STRING, ARTNET_STRING_SIZE);
|
||||
rdm.data.rdm.opCode = htols(ARTNET_RDM);
|
||||
rdm.data.rdm.verH = 0;
|
||||
rdm.data.rdm.ver = ARTNET_VERSION;
|
||||
rdm.data.rdm.cmd = 0x00;
|
||||
rdm.data.rdm.address = address;
|
||||
|
||||
len = min(length, ARTNET_MAX_RDM_DATA);
|
||||
memcpy(&rdm.data.rdm.data, data, len);
|
||||
return artnet_net_send(n, &rdm);
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Send a firmware reply
|
||||
* @param ip the ip address to send to
|
||||
* @param code the response code
|
||||
*/
|
||||
int artnet_tx_firmware_reply(node n, in_addr_t ip,
|
||||
artnet_firmware_status_code code) {
|
||||
artnet_packet_t p;
|
||||
memset(&p, 0x0, sizeof(p));
|
||||
|
||||
p.to.s_addr = ip;
|
||||
p.length = sizeof(artnet_firmware_t);
|
||||
p.type = ARTNET_FIRMWAREREPLY;
|
||||
|
||||
// now build packet
|
||||
memcpy(&p.data.firmware.id, ARTNET_STRING, ARTNET_STRING_SIZE);
|
||||
p.data.firmware.opCode = htols(ARTNET_FIRMWAREREPLY);
|
||||
p.data.firmware.verH = 0;
|
||||
p.data.firmware.ver = ARTNET_VERSION;
|
||||
p.data.firmware.type = code;
|
||||
|
||||
return artnet_net_send(n, &p);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Send an firmware data datagram
|
||||
*
|
||||
* @param firm a pointer to the firmware structure for this transfer
|
||||
*/
|
||||
int artnet_tx_firmware_packet(node n, firmware_transfer_t *firm) {
|
||||
artnet_packet_t p;
|
||||
uint8_t type = 0;
|
||||
int data_len, max_len, ret;
|
||||
|
||||
memset(&p, 0x0, sizeof(p));
|
||||
|
||||
// max value of data_len is 1024;
|
||||
max_len = ARTNET_FIRMWARE_SIZE * sizeof(p.data.firmware.data[0]);
|
||||
|
||||
// calculate length
|
||||
data_len = firm->bytes_total - firm->bytes_current;
|
||||
data_len = min(data_len, max_len);
|
||||
|
||||
// work out type - 6 cases
|
||||
if(firm->ubea) {
|
||||
// ubea upload
|
||||
if (firm->bytes_current == 0) {
|
||||
// first
|
||||
type = ARTNET_FIRMWARE_UBEAFIRST;
|
||||
} else if (data_len == max_len) {
|
||||
// cont
|
||||
type = ARTNET_FIRMWARE_UBEACONT;
|
||||
} else if (data_len < max_len) {
|
||||
// last
|
||||
type = ARTNET_FIRMWARE_UBEALAST;
|
||||
} else {
|
||||
// this should never happen, something has gone wrong
|
||||
artnet_error("Attempting to send %d when the max is %d, very very bad...\n", data_len, max_len);
|
||||
}
|
||||
} else {
|
||||
// firmware upload
|
||||
if (firm->bytes_current == 0) {
|
||||
// first
|
||||
type = ARTNET_FIRMWARE_FIRMFIRST;
|
||||
} else if (data_len == max_len) {
|
||||
// cont
|
||||
type = ARTNET_FIRMWARE_FIRMCONT;
|
||||
} else if (data_len < max_len) {
|
||||
// last
|
||||
type = ARTNET_FIRMWARE_FIRMLAST;
|
||||
} else {
|
||||
// this should never happen, something has gone wrong
|
||||
artnet_error("Attempting to send %d when the max is %d, very very bad...\n", data_len, max_len);
|
||||
}
|
||||
}
|
||||
|
||||
// set packet properties
|
||||
p.to.s_addr = firm->peer.s_addr;
|
||||
p.length = sizeof(artnet_firmware_t);
|
||||
p.type = ARTNET_FIRMWAREMASTER;
|
||||
|
||||
// now build packet
|
||||
memcpy(&p.data.firmware.id, ARTNET_STRING, ARTNET_STRING_SIZE);
|
||||
p.data.firmware.opCode = htols(ARTNET_FIRMWAREMASTER);
|
||||
p.data.firmware.verH = 0;
|
||||
p.data.firmware.ver = ARTNET_VERSION;
|
||||
p.data.firmware.type = type;
|
||||
p.data.firmware.blockId = firm->expected_block;
|
||||
|
||||
artnet_misc_int_to_bytes(firm->bytes_total / sizeof(uint16_t),
|
||||
p.data.firmware.length);
|
||||
|
||||
memcpy(&p.data.firmware.data,
|
||||
firm->data + (firm->bytes_current / sizeof(uint16_t)),
|
||||
data_len);
|
||||
|
||||
if ((ret = artnet_net_send(n, &p))) {
|
||||
// send failed
|
||||
return ret;
|
||||
} else {
|
||||
// update stats
|
||||
firm->bytes_current = firm->bytes_current + data_len;
|
||||
firm->last_time = time(NULL);
|
||||
firm->expected_block++;
|
||||
// limit between 0 and 255 (only 8 bits wide)
|
||||
// we dont' actually need this cause it will be shorted when assigned above
|
||||
firm->expected_block %= UINT8_MAX;
|
||||
}
|
||||
return ARTNET_EOK;
|
||||
}
|
||||
|
||||
|
||||
// this is called when the node's state changes to rebuild the
|
||||
// artpollreply packet
|
||||
int artnet_tx_build_art_poll_reply(node n) {
|
||||
int i;
|
||||
|
||||
// shorten the amount we have to type
|
||||
artnet_reply_t *ar = &n->ar_temp;
|
||||
|
||||
memset(ar, 0x00, sizeof(artnet_reply_t));
|
||||
|
||||
memcpy(&ar->id, ARTNET_STRING, ARTNET_STRING_SIZE);
|
||||
ar->opCode = htols(ARTNET_REPLY);
|
||||
memcpy(&ar->ip, &n->state.ip_addr.s_addr, 4);
|
||||
ar->port = htols(ARTNET_PORT);
|
||||
ar->verH = 0;
|
||||
ar->ver = 0;
|
||||
ar->subH = 0;
|
||||
ar->sub = n->state.subnet;
|
||||
ar->oemH = n->state.oem_hi;
|
||||
ar->oem = n->state.oem_lo;
|
||||
ar->ubea = 0;
|
||||
// ar->status
|
||||
|
||||
// if(n->state
|
||||
|
||||
// status need to be recalc everytime
|
||||
//ar->status
|
||||
|
||||
// ESTA Manufacturer ID
|
||||
// Assigned 18/4/2006
|
||||
ar->etsaman[0] = n->state.esta_hi;
|
||||
ar->etsaman[1] = n->state.esta_lo;
|
||||
|
||||
memcpy(&ar->shortname, &n->state.short_name, sizeof(n->state.short_name));
|
||||
memcpy(&ar->longname, &n->state.long_name, sizeof(n->state.long_name));
|
||||
|
||||
// the report is generated on every send
|
||||
|
||||
// port stuff here
|
||||
ar->numbportsH = 0;
|
||||
|
||||
for (i = ARTNET_MAX_PORTS; i > 0; i--) {
|
||||
if (n->ports.out[i-1].port_enabled || n->ports.in[i-1].port_enabled)
|
||||
break;
|
||||
}
|
||||
|
||||
ar->numbports = i;
|
||||
|
||||
for (i=0; i< ARTNET_MAX_PORTS; i++) {
|
||||
ar->porttypes[i] = n->ports.types[i];
|
||||
ar->goodinput[i] = n->ports.in[i].port_status;
|
||||
ar->goodoutput[i] = n->ports.out[i].port_status;
|
||||
ar->swin[i] = n->ports.in[i].port_addr;
|
||||
ar->swout[i] = n->ports.out[i].port_addr;
|
||||
}
|
||||
|
||||
ar->swvideo = 0;
|
||||
ar->swmacro = 0;
|
||||
ar->swremote = 0;
|
||||
|
||||
// spares
|
||||
ar->sp1 = 0;
|
||||
ar->sp2 = 0;
|
||||
ar->sp3 = 0;
|
||||
|
||||
// hw address
|
||||
memcpy(&ar->mac, &n->state.hw_addr, ARTNET_MAC_SIZE);
|
||||
|
||||
// set style
|
||||
switch (n->state.node_type) {
|
||||
case ARTNET_SRV:
|
||||
ar->style = STSERVER;
|
||||
break;
|
||||
case ARTNET_NODE:
|
||||
ar->style = STNODE;
|
||||
break;
|
||||
case ARTNET_MSRV:
|
||||
ar->style = STMEDIA;
|
||||
break;
|
||||
// we should fix this, it'll do for now
|
||||
case ARTNET_RAW:
|
||||
ar->style = STNODE;
|
||||
break;
|
||||
default:
|
||||
artnet_error("Node type not recognised!");
|
||||
ar->style = STNODE;
|
||||
return ARTNET_ESTATE;
|
||||
}
|
||||
|
||||
return ARTNET_EOK;
|
||||
}
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,162 @@
|
|||
/* config.h.in. Generated from configure.in 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 <dlfcn.h> header file. */
|
||||
#undef HAVE_DLFCN_H
|
||||
|
||||
/* Define to 1 if you don't have `vprintf' but do have `_doprnt.' */
|
||||
#undef HAVE_DOPRNT
|
||||
|
||||
/* Define to 1 if you have the <endian.h> header file. */
|
||||
#undef HAVE_ENDIAN_H
|
||||
|
||||
/* Define to 1 if you have the `getifaddrs' function. */
|
||||
#undef HAVE_GETIFADDRS
|
||||
|
||||
/* Define to 1 if you have the `inet_aton' function. */
|
||||
#undef HAVE_INET_ATON
|
||||
|
||||
/* Define to 1 if you have the `inet_ntoa' function. */
|
||||
#undef HAVE_INET_NTOA
|
||||
|
||||
/* Define to 1 if you have the <inttypes.h> header file. */
|
||||
#undef HAVE_INTTYPES_H
|
||||
|
||||
/* Define to 1 if you have the <linux/if_packet.h> header file. */
|
||||
#undef HAVE_LINUX_IF_PACKET_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 <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 <netinet/in.h> header file. */
|
||||
#undef HAVE_NETINET_IN_H
|
||||
|
||||
/* Define to 1 if you have the <ppc/endian.h> header file. */
|
||||
#undef HAVE_PPC_ENDIAN_H
|
||||
|
||||
/* 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 `select' function. */
|
||||
#undef HAVE_SELECT
|
||||
|
||||
/* define if socket address structures have length fields */
|
||||
#undef HAVE_SOCKADDR_SA_LEN
|
||||
|
||||
/* 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 <sys/ioctl.h> header file. */
|
||||
#undef HAVE_SYS_IOCTL_H
|
||||
|
||||
/* Define to 1 if you have the <sys/select.h> header file. */
|
||||
#undef HAVE_SYS_SELECT_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/types.h> header file. */
|
||||
#undef HAVE_SYS_TYPES_H
|
||||
|
||||
/* Define to 1 if you have the <unistd.h> header file. */
|
||||
#undef HAVE_UNISTD_H
|
||||
|
||||
/* Define to 1 if you have the <unistd.hi> header file. */
|
||||
#undef HAVE_UNISTD_HI
|
||||
|
||||
/* 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 the system supports IPv6 */
|
||||
#undef IPV6
|
||||
|
||||
/* Name of package */
|
||||
#undef PACKAGE
|
||||
|
||||
/* Define to the address where bug reports for this package should be sent. */
|
||||
#undef PACKAGE_BUGREPORT
|
||||
|
||||
/* Define to the full name of this package. */
|
||||
#undef PACKAGE_NAME
|
||||
|
||||
/* Define to the full name and version of this package. */
|
||||
#undef PACKAGE_STRING
|
||||
|
||||
/* Define to the one symbol short name of this package. */
|
||||
#undef PACKAGE_TARNAME
|
||||
|
||||
/* Define to the version of this package. */
|
||||
#undef PACKAGE_VERSION
|
||||
|
||||
/* Define to the type of arg 1 for `select'. */
|
||||
#undef SELECT_TYPE_ARG1
|
||||
|
||||
/* Define to the type of args 2, 3 and 4 for `select'. */
|
||||
#undef SELECT_TYPE_ARG234
|
||||
|
||||
/* Define to the type of arg 5 for `select'. */
|
||||
#undef SELECT_TYPE_ARG5
|
||||
|
||||
/* 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
|
||||
|
||||
/* Version number of package */
|
||||
#undef VERSION
|
||||
|
||||
/* 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
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,78 @@
|
|||
# -*- Autoconf -*-
|
||||
# Process this file with autoconf to produce a configure script.
|
||||
|
||||
AC_PREREQ(2.57)
|
||||
AC_INIT(configure.in)
|
||||
AM_CONFIG_HEADER(config.h)
|
||||
AM_INIT_AUTOMAKE(libartnet, 1.1.0)
|
||||
|
||||
# Checks for programs.
|
||||
AC_PROG_CC
|
||||
AC_PROG_INSTALL
|
||||
AC_PROG_LN_S
|
||||
AC_PROG_MAKE_SET
|
||||
AC_LIBTOOL_WIN32_DLL
|
||||
AC_PROG_LIBTOOL
|
||||
|
||||
# Checks for header files.
|
||||
AC_HEADER_STDC
|
||||
AC_CHECK_HEADERS([endian.h ppc/endian.h arpa/inet.h netinet/in.h stddef.h \
|
||||
stdint.h stdlib.h string.h sys/ioctl.h sys/socket.h \
|
||||
unistd.hi linux/if_packet.h])
|
||||
|
||||
# Checks for typedefs, structures, and compiler characteristics.
|
||||
AC_C_CONST
|
||||
AC_TYPE_SIZE_T
|
||||
AC_HEADER_TIME
|
||||
AC_HEADER_STDBOOL
|
||||
|
||||
# Checks for library functions.
|
||||
AC_PROG_GCC_TRADITIONAL
|
||||
AC_FUNC_MALLOC
|
||||
AC_FUNC_MEMCMP
|
||||
AC_FUNC_REALLOC
|
||||
AC_FUNC_SELECT_ARGTYPES
|
||||
AC_FUNC_VPRINTF
|
||||
AC_CHECK_FUNCS([inet_ntoa inet_aton memset select socket strchr strdup \
|
||||
strerror getifaddrs])
|
||||
|
||||
# check for ipv6 support - taken from unp
|
||||
AC_MSG_CHECKING(for IPv6 support)
|
||||
AC_CACHE_VAL(ac_cv_ipv6,
|
||||
AC_TRY_RUN([
|
||||
# include <sys/types.h>
|
||||
# include <sys/socket.h>
|
||||
# include <netinet/in.h>
|
||||
/* Make sure the definitions for AF_INET6 and struct sockaddr_in6
|
||||
* are defined, and that we can actually create an IPv6 TCP socket.
|
||||
*/
|
||||
main()
|
||||
{
|
||||
int fd;
|
||||
struct sockaddr_in6 foo;
|
||||
fd = socket(AF_INET6, SOCK_STREAM, 0);
|
||||
exit(fd >= 0 ? 0 : 1);
|
||||
}],
|
||||
ac_cv_ipv6=yes,
|
||||
ac_cv_ipv6=no,
|
||||
ac_cv_ipv6=no))
|
||||
AC_MSG_RESULT($ac_cv_ipv6)
|
||||
if test $ac_cv_ipv6 = yes ; then
|
||||
AC_DEFINE(IPV6, 1, Define to 1 if the system supports IPv6)
|
||||
fi
|
||||
|
||||
|
||||
# Check if sockaddr{} has sa_len member.
|
||||
AC_CHECK_MEMBER([struct sockaddr.sa_len],
|
||||
AC_DEFINE(HAVE_SOCKADDR_SA_LEN, 1,
|
||||
define if socket address structures have length fields),,
|
||||
[
|
||||
#include <sys/types.h>
|
||||
#include <sys/socket.h>])
|
||||
|
||||
# check for win32
|
||||
AM_CONDITIONAL(USING_WIN32, test "$host_os" = 'mingw32')
|
||||
|
||||
AC_OUTPUT(Makefile \
|
||||
artnet/Makefile \
|
||||
libartnet.pc)
|
|
@ -0,0 +1,584 @@
|
|||
#! /bin/sh
|
||||
# depcomp - compile a program generating dependencies as side-effects
|
||||
|
||||
scriptversion=2006-10-15.18
|
||||
|
||||
# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006 Free Software
|
||||
# Foundation, Inc.
|
||||
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2, or (at your option)
|
||||
# any later version.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
# 02110-1301, USA.
|
||||
|
||||
# As a special exception to the GNU General Public License, if you
|
||||
# distribute this file as part of a program that contains a
|
||||
# configuration script generated by Autoconf, you may include it under
|
||||
# the same distribution terms that you use for the rest of that program.
|
||||
|
||||
# Originally written by Alexandre Oliva <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
|
||||
|
||||
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.
|
||||
stripped=`echo "$object" | sed 's/\(.*\)\..*$/\1/'`
|
||||
tmpdepfile="$stripped.u"
|
||||
if test "$libtool" = yes; then
|
||||
"$@" -Wc,-M
|
||||
else
|
||||
"$@" -M
|
||||
fi
|
||||
stat=$?
|
||||
|
||||
if test -f "$tmpdepfile"; then :
|
||||
else
|
||||
stripped=`echo "$stripped" | sed 's,^.*/,,'`
|
||||
tmpdepfile="$stripped.u"
|
||||
fi
|
||||
|
||||
if test $stat -eq 0; then :
|
||||
else
|
||||
rm -f "$tmpdepfile"
|
||||
exit $stat
|
||||
fi
|
||||
|
||||
if test -f "$tmpdepfile"; then
|
||||
outname="$stripped.o"
|
||||
# Each line is of the form `foo.o: dependent.h'.
|
||||
# Do two passes, one to just change these to
|
||||
# `$object: dependent.h' and one to simply `dependent.h:'.
|
||||
sed -e "s,^$outname:,$object :," < "$tmpdepfile" > "$depfile"
|
||||
sed -e "s,^$outname: \(.*\)$,\1:," < "$tmpdepfile" >> "$depfile"
|
||||
else
|
||||
# The sourcefile does not contain any dependencies, so just
|
||||
# store a dummy comment line, to avoid errors with the Makefile
|
||||
# "include basename.Plo" scheme.
|
||||
echo "#dummy" > "$depfile"
|
||||
fi
|
||||
rm -f "$tmpdepfile"
|
||||
;;
|
||||
|
||||
icc)
|
||||
# Intel's C compiler understands `-MD -MF file'. However on
|
||||
# icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c
|
||||
# ICC 7.0 will fill foo.d with something like
|
||||
# foo.o: sub/foo.c
|
||||
# foo.o: sub/foo.h
|
||||
# which is wrong. We want:
|
||||
# sub/foo.o: sub/foo.c
|
||||
# sub/foo.o: sub/foo.h
|
||||
# sub/foo.c:
|
||||
# sub/foo.h:
|
||||
# ICC 7.1 will output
|
||||
# foo.o: sub/foo.c sub/foo.h
|
||||
# and will wrap long lines using \ :
|
||||
# foo.o: sub/foo.c ... \
|
||||
# sub/foo.h ... \
|
||||
# ...
|
||||
|
||||
"$@" -MD -MF "$tmpdepfile"
|
||||
stat=$?
|
||||
if test $stat -eq 0; then :
|
||||
else
|
||||
rm -f "$tmpdepfile"
|
||||
exit $stat
|
||||
fi
|
||||
rm -f "$depfile"
|
||||
# Each line is of the form `foo.o: dependent.h',
|
||||
# or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'.
|
||||
# Do two passes, one to just change these to
|
||||
# `$object: dependent.h' and one to simply `dependent.h:'.
|
||||
sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile"
|
||||
# Some versions of the HPUX 10.20 sed can't process this invocation
|
||||
# correctly. Breaking it into two sed invocations is a workaround.
|
||||
sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" |
|
||||
sed -e 's/$/ :/' >> "$depfile"
|
||||
rm -f "$tmpdepfile"
|
||||
;;
|
||||
|
||||
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 $1 != '--mode=compile'; do
|
||||
shift
|
||||
done
|
||||
shift
|
||||
fi
|
||||
|
||||
# Remove `-o $object'.
|
||||
IFS=" "
|
||||
for arg
|
||||
do
|
||||
case $arg in
|
||||
-o)
|
||||
shift
|
||||
;;
|
||||
$object)
|
||||
shift
|
||||
;;
|
||||
*)
|
||||
set fnord "$@" "$arg"
|
||||
shift # fnord
|
||||
shift # $arg
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
test -z "$dashmflag" && dashmflag=-M
|
||||
# Require at least two characters before searching for `:'
|
||||
# in the target name. This is to cope with DOS-style filenames:
|
||||
# a dependency such as `c:/foo/bar' could be seen as target `c' otherwise.
|
||||
"$@" $dashmflag |
|
||||
sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile"
|
||||
rm -f "$depfile"
|
||||
cat < "$tmpdepfile" > "$depfile"
|
||||
tr ' ' '
|
||||
' < "$tmpdepfile" | \
|
||||
## Some versions of the HPUX 10.20 sed can't process this invocation
|
||||
## correctly. Breaking it into two sed invocations is a workaround.
|
||||
sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
|
||||
rm -f "$tmpdepfile"
|
||||
;;
|
||||
|
||||
dashXmstdout)
|
||||
# This case only exists to satisfy depend.m4. It is never actually
|
||||
# run, as this mode is specially recognized in the preamble.
|
||||
exit 1
|
||||
;;
|
||||
|
||||
makedepend)
|
||||
"$@" || exit $?
|
||||
# Remove any Libtool call
|
||||
if test "$libtool" = yes; then
|
||||
while test $1 != '--mode=compile'; do
|
||||
shift
|
||||
done
|
||||
shift
|
||||
fi
|
||||
# X makedepend
|
||||
shift
|
||||
cleared=no
|
||||
for arg in "$@"; do
|
||||
case $cleared in
|
||||
no)
|
||||
set ""; shift
|
||||
cleared=yes ;;
|
||||
esac
|
||||
case "$arg" in
|
||||
-D*|-I*)
|
||||
set fnord "$@" "$arg"; shift ;;
|
||||
# Strip any option that makedepend may not understand. Remove
|
||||
# the object too, otherwise makedepend will parse it as a source file.
|
||||
-*|$object)
|
||||
;;
|
||||
*)
|
||||
set fnord "$@" "$arg"; shift ;;
|
||||
esac
|
||||
done
|
||||
obj_suffix="`echo $object | sed 's/^.*\././'`"
|
||||
touch "$tmpdepfile"
|
||||
${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@"
|
||||
rm -f "$depfile"
|
||||
cat < "$tmpdepfile" > "$depfile"
|
||||
sed '1,2d' "$tmpdepfile" | tr ' ' '
|
||||
' | \
|
||||
## Some versions of the HPUX 10.20 sed can't process this invocation
|
||||
## correctly. Breaking it into two sed invocations is a workaround.
|
||||
sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
|
||||
rm -f "$tmpdepfile" "$tmpdepfile".bak
|
||||
;;
|
||||
|
||||
cpp)
|
||||
# Important note: in order to support this mode, a compiler *must*
|
||||
# always write the preprocessed file to stdout.
|
||||
"$@" || exit $?
|
||||
|
||||
# Remove the call to Libtool.
|
||||
if test "$libtool" = yes; then
|
||||
while test $1 != '--mode=compile'; do
|
||||
shift
|
||||
done
|
||||
shift
|
||||
fi
|
||||
|
||||
# Remove `-o $object'.
|
||||
IFS=" "
|
||||
for arg
|
||||
do
|
||||
case $arg in
|
||||
-o)
|
||||
shift
|
||||
;;
|
||||
$object)
|
||||
shift
|
||||
;;
|
||||
*)
|
||||
set fnord "$@" "$arg"
|
||||
shift # fnord
|
||||
shift # $arg
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
"$@" -E |
|
||||
sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
|
||||
-e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' |
|
||||
sed '$ s: \\$::' > "$tmpdepfile"
|
||||
rm -f "$depfile"
|
||||
echo "$object : \\" > "$depfile"
|
||||
cat < "$tmpdepfile" >> "$depfile"
|
||||
sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile"
|
||||
rm -f "$tmpdepfile"
|
||||
;;
|
||||
|
||||
msvisualcpp)
|
||||
# Important note: in order to support this mode, a compiler *must*
|
||||
# always write the preprocessed file to stdout, regardless of -o,
|
||||
# because we must use -o when running libtool.
|
||||
"$@" || exit $?
|
||||
IFS=" "
|
||||
for arg
|
||||
do
|
||||
case "$arg" in
|
||||
"-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
|
||||
set fnord "$@"
|
||||
shift
|
||||
shift
|
||||
;;
|
||||
*)
|
||||
set fnord "$@" "$arg"
|
||||
shift
|
||||
shift
|
||||
;;
|
||||
esac
|
||||
done
|
||||
"$@" -E |
|
||||
sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile"
|
||||
rm -f "$depfile"
|
||||
echo "$object : \\" > "$depfile"
|
||||
. "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile"
|
||||
echo " " >> "$depfile"
|
||||
. "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile"
|
||||
rm -f "$tmpdepfile"
|
||||
;;
|
||||
|
||||
none)
|
||||
exec "$@"
|
||||
;;
|
||||
|
||||
*)
|
||||
echo "Unknown depmode $depmode" 1>&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
exit 0
|
||||
|
||||
# Local Variables:
|
||||
# mode: shell-script
|
||||
# sh-indentation: 2
|
||||
# eval: (add-hook 'write-file-hooks 'time-stamp)
|
||||
# time-stamp-start: "scriptversion="
|
||||
# time-stamp-format: "%:y-%02m-%02d.%02H"
|
||||
# time-stamp-end: "$"
|
||||
# End:
|
|
@ -0,0 +1,507 @@
|
|||
#!/bin/sh
|
||||
# install - install a program, script, or datafile
|
||||
|
||||
scriptversion=2006-10-14.15
|
||||
|
||||
# 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.
|
||||
|
||||
mvprog="${MVPROG-mv}"
|
||||
cpprog="${CPPROG-cp}"
|
||||
chmodprog="${CHMODPROG-chmod}"
|
||||
chownprog="${CHOWNPROG-chown}"
|
||||
chgrpprog="${CHGRPPROG-chgrp}"
|
||||
stripprog="${STRIPPROG-strip}"
|
||||
rmprog="${RMPROG-rm}"
|
||||
mkdirprog="${MKDIRPROG-mkdir}"
|
||||
|
||||
posix_glob=
|
||||
posix_mkdir=
|
||||
|
||||
# Desired mode of installed file.
|
||||
mode=0755
|
||||
|
||||
chmodcmd=$chmodprog
|
||||
chowncmd=
|
||||
chgrpcmd=
|
||||
stripcmd=
|
||||
rmcmd="$rmprog -f"
|
||||
mvcmd="$mvprog"
|
||||
src=
|
||||
dst=
|
||||
dir_arg=
|
||||
dstarg=
|
||||
no_target_directory=
|
||||
|
||||
usage="Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
|
||||
or: $0 [OPTION]... SRCFILES... DIRECTORY
|
||||
or: $0 [OPTION]... -t DIRECTORY SRCFILES...
|
||||
or: $0 [OPTION]... -d DIRECTORIES...
|
||||
|
||||
In the 1st form, copy SRCFILE to DSTFILE.
|
||||
In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
|
||||
In the 4th, create DIRECTORIES.
|
||||
|
||||
Options:
|
||||
-c (ignored)
|
||||
-d create directories instead of installing files.
|
||||
-g GROUP $chgrpprog installed files to GROUP.
|
||||
-m MODE $chmodprog installed files to MODE.
|
||||
-o USER $chownprog installed files to USER.
|
||||
-s $stripprog installed files.
|
||||
-t DIRECTORY install into DIRECTORY.
|
||||
-T report an error if DSTFILE is a directory.
|
||||
--help display this help and exit.
|
||||
--version display version info and exit.
|
||||
|
||||
Environment variables override the default commands:
|
||||
CHGRPPROG CHMODPROG CHOWNPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG
|
||||
"
|
||||
|
||||
while test $# -ne 0; do
|
||||
case $1 in
|
||||
-c) shift
|
||||
continue;;
|
||||
|
||||
-d) dir_arg=true
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-g) chgrpcmd="$chgrpprog $2"
|
||||
shift
|
||||
shift
|
||||
continue;;
|
||||
|
||||
--help) echo "$usage"; exit $?;;
|
||||
|
||||
-m) mode=$2
|
||||
shift
|
||||
shift
|
||||
case $mode in
|
||||
*' '* | *' '* | *'
|
||||
'* | *'*'* | *'?'* | *'['*)
|
||||
echo "$0: invalid mode: $mode" >&2
|
||||
exit 1;;
|
||||
esac
|
||||
continue;;
|
||||
|
||||
-o) chowncmd="$chownprog $2"
|
||||
shift
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-s) stripcmd=$stripprog
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-t) dstarg=$2
|
||||
shift
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-T) no_target_directory=true
|
||||
shift
|
||||
continue;;
|
||||
|
||||
--version) echo "$0 $scriptversion"; exit $?;;
|
||||
|
||||
--) shift
|
||||
break;;
|
||||
|
||||
-*) echo "$0: invalid option: $1" >&2
|
||||
exit 1;;
|
||||
|
||||
*) break;;
|
||||
esac
|
||||
done
|
||||
|
||||
if test $# -ne 0 && test -z "$dir_arg$dstarg"; 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 "$dstarg"; then
|
||||
# $@ is not empty: it contains at least $arg.
|
||||
set fnord "$@" "$dstarg"
|
||||
shift # fnord
|
||||
fi
|
||||
shift # arg
|
||||
dstarg=$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 "$dstarg"; then
|
||||
echo "$0: no destination specified." >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
dst=$dstarg
|
||||
# Protect names starting with `-'.
|
||||
case $dst in
|
||||
-*) dst=./$dst ;;
|
||||
esac
|
||||
|
||||
# If destination is a directory, append the input filename; won't work
|
||||
# if double slashes aren't ignored.
|
||||
if test -d "$dst"; then
|
||||
if test -n "$no_target_directory"; then
|
||||
echo "$0: $dstarg: Is a directory" >&2
|
||||
exit 1
|
||||
fi
|
||||
dstdir=$dst
|
||||
dst=$dstdir/`basename "$src"`
|
||||
dstdir_status=0
|
||||
else
|
||||
# Prefer dirname, but fall back on a substitute if dirname fails.
|
||||
dstdir=`
|
||||
(dirname "$dst") 2>/dev/null ||
|
||||
expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
|
||||
X"$dst" : 'X\(//\)[^/]' \| \
|
||||
X"$dst" : 'X\(//\)$' \| \
|
||||
X"$dst" : 'X\(/\)' \| . 2>/dev/null ||
|
||||
echo X"$dst" |
|
||||
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
|
||||
s//\1/
|
||||
q
|
||||
}
|
||||
/^X\(\/\/\)[^/].*/{
|
||||
s//\1/
|
||||
q
|
||||
}
|
||||
/^X\(\/\/\)$/{
|
||||
s//\1/
|
||||
q
|
||||
}
|
||||
/^X\(\/\).*/{
|
||||
s//\1/
|
||||
q
|
||||
}
|
||||
s/.*/./; q'
|
||||
`
|
||||
|
||||
test -d "$dstdir"
|
||||
dstdir_status=$?
|
||||
fi
|
||||
fi
|
||||
|
||||
obsolete_mkdir_used=false
|
||||
|
||||
if test $dstdir_status != 0; then
|
||||
case $posix_mkdir in
|
||||
'')
|
||||
# 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
|
||||
|
||||
case $posix_glob in
|
||||
'')
|
||||
if (set -f) 2>/dev/null; then
|
||||
posix_glob=true
|
||||
else
|
||||
posix_glob=false
|
||||
fi ;;
|
||||
esac
|
||||
|
||||
oIFS=$IFS
|
||||
IFS=/
|
||||
$posix_glob && set -f
|
||||
set fnord $dstdir
|
||||
shift
|
||||
$posix_glob && set +f
|
||||
IFS=$oIFS
|
||||
|
||||
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"; } &&
|
||||
|
||||
# Now rename the file to the real destination.
|
||||
{ $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null \
|
||||
|| {
|
||||
# The rename failed, perhaps because mv can't rename something else
|
||||
# to itself, or perhaps because mv is so ancient that it does not
|
||||
# support -f.
|
||||
|
||||
# Now remove or move aside any old file at destination location.
|
||||
# We try this two ways since rm can't unlink itself on some
|
||||
# systems and the destination file might be busy for other
|
||||
# reasons. In this case, the final cleanup might fail but the new
|
||||
# file should still install successfully.
|
||||
{
|
||||
if test -f "$dst"; then
|
||||
$doit $rmcmd -f "$dst" 2>/dev/null \
|
||||
|| { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null \
|
||||
&& { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }; }\
|
||||
|| {
|
||||
echo "$0: cannot unlink or rename $dst" >&2
|
||||
(exit 1); exit 1
|
||||
}
|
||||
else
|
||||
:
|
||||
fi
|
||||
} &&
|
||||
|
||||
# Now rename the file to the real destination.
|
||||
$doit $mvcmd "$dsttmp" "$dst"
|
||||
}
|
||||
} || exit 1
|
||||
|
||||
trap '' 0
|
||||
fi
|
||||
done
|
||||
|
||||
# Local variables:
|
||||
# eval: (add-hook 'write-file-hooks 'time-stamp)
|
||||
# time-stamp-start: "scriptversion="
|
||||
# time-stamp-format: "%:y-%02m-%02d.%02H"
|
||||
# time-stamp-end: "$"
|
||||
# End:
|
|
@ -0,0 +1,12 @@
|
|||
prefix=@prefix@
|
||||
exec_prefix=@exec_prefix@
|
||||
libdir=@libdir@
|
||||
includedir=@includedir@
|
||||
|
||||
|
||||
Name: libartnet
|
||||
Version: @VERSION@
|
||||
Description: libartnet
|
||||
Requires:
|
||||
Libs: -L${libdir} -lartnet
|
||||
Cflags: -I${includedir}/libartnet
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,367 @@
|
|||
#! /bin/sh
|
||||
# Common stub for a few missing GNU programs while installing.
|
||||
|
||||
scriptversion=2006-05-10.23
|
||||
|
||||
# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006
|
||||
# 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, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
# 02110-1301, USA.
|
||||
|
||||
# As a special exception to the GNU General Public License, if you
|
||||
# distribute this file as part of a program that contains a
|
||||
# configuration script generated by Autoconf, you may include it under
|
||||
# the same distribution terms that you use for the rest of that program.
|
||||
|
||||
if test $# -eq 0; then
|
||||
echo 1>&2 "Try \`$0 --help' for more information"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
run=:
|
||||
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]
|
||||
|
||||
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
|
||||
|
||||
# Now exit if we have it, but it failed. Also exit now if we
|
||||
# don't have it and --version was passed (most likely to detect
|
||||
# the program).
|
||||
case $1 in
|
||||
lex|yacc)
|
||||
# Not GNU programs, they don't have --version.
|
||||
;;
|
||||
|
||||
tar)
|
||||
if test -n "$run"; then
|
||||
echo 1>&2 "ERROR: \`tar' requires --run"
|
||||
exit 1
|
||||
elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
|
||||
exit 1
|
||||
fi
|
||||
;;
|
||||
|
||||
*)
|
||||
if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
|
||||
# We have it, but it failed.
|
||||
exit 1
|
||||
elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
|
||||
# Could not run --version or --help. This is probably someone
|
||||
# running `$TOOL --version' or `$TOOL --help' to check whether
|
||||
# $TOOL exists and not knowing $TOOL uses missing.
|
||||
exit 1
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
# If it does not exist, or fails to run (possibly an outdated version),
|
||||
# try to emulate it.
|
||||
case $1 in
|
||||
aclocal*)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is $msg. You should only need it if
|
||||
you modified \`acinclude.m4' or \`${configure_ac}'. You might want
|
||||
to install the \`Automake' and \`Perl' packages. Grab them from
|
||||
any GNU archive site."
|
||||
touch aclocal.m4
|
||||
;;
|
||||
|
||||
autoconf)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is $msg. You should only need it if
|
||||
you modified \`${configure_ac}'. You might want to install the
|
||||
\`Autoconf' and \`GNU m4' packages. Grab them from any GNU
|
||||
archive site."
|
||||
touch configure
|
||||
;;
|
||||
|
||||
autoheader)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is $msg. You should only need it if
|
||||
you modified \`acconfig.h' or \`${configure_ac}'. You might want
|
||||
to install the \`Autoconf' and \`GNU m4' packages. Grab them
|
||||
from any GNU archive site."
|
||||
files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}`
|
||||
test -z "$files" && files="config.h"
|
||||
touch_files=
|
||||
for f in $files; do
|
||||
case $f in
|
||||
*:*) touch_files="$touch_files "`echo "$f" |
|
||||
sed -e 's/^[^:]*://' -e 's/:.*//'`;;
|
||||
*) touch_files="$touch_files $f.in";;
|
||||
esac
|
||||
done
|
||||
touch $touch_files
|
||||
;;
|
||||
|
||||
automake*)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is $msg. You should only need it if
|
||||
you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'.
|
||||
You might want to install the \`Automake' and \`Perl' packages.
|
||||
Grab them from any GNU archive site."
|
||||
find . -type f -name Makefile.am -print |
|
||||
sed 's/\.am$/.in/' |
|
||||
while read f; do touch "$f"; done
|
||||
;;
|
||||
|
||||
autom4te)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is needed, but is $msg.
|
||||
You might have modified some files without having the
|
||||
proper tools for further handling them.
|
||||
You can get \`$1' as part of \`Autoconf' from any GNU
|
||||
archive site."
|
||||
|
||||
file=`echo "$*" | sed -n "$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 1
|
||||
fi
|
||||
;;
|
||||
|
||||
makeinfo)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is $msg. You should only need it if
|
||||
you modified a \`.texi' or \`.texinfo' file, or any other file
|
||||
indirectly affecting the aspect of the manual. The spurious
|
||||
call might also be the consequence of using a buggy \`make' (AIX,
|
||||
DU, IRIX). You might want to install the \`Texinfo' package or
|
||||
the \`GNU make' package. Grab either from any GNU archive site."
|
||||
# The file to touch is that specified with -o ...
|
||||
file=`echo "$*" | sed -n "$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-end: "$"
|
||||
# End:
|
|
@ -0,0 +1,9 @@
|
|||
Please do not email the author directly, instead use
|
||||
open-lighting@googlegroups.com
|
||||
|
||||
|
||||
Primary author:
|
||||
Simon Newton (nomis52@gmail.com)
|
||||
|
||||
Contributors:
|
||||
Bastien Andrès (dmx4linux plugin)
|
|
@ -0,0 +1,504 @@
|
|||
GNU LESSER GENERAL PUBLIC LICENSE
|
||||
Version 2.1, February 1999
|
||||
|
||||
Copyright (C) 1991, 1999 Free Software Foundation, Inc.
|
||||
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
[This is the first released version of the Lesser GPL. It also counts
|
||||
as the successor of the GNU Library Public License, version 2, hence
|
||||
the version number 2.1.]
|
||||
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your
|
||||
freedom to share and change it. By contrast, the GNU General Public
|
||||
Licenses are intended to guarantee your freedom to share and change
|
||||
free software--to make sure the software is free for all its users.
|
||||
|
||||
This license, the Lesser General Public License, applies to some
|
||||
specially designated software packages--typically libraries--of the
|
||||
Free Software Foundation and other authors who decide to use it. You
|
||||
can use it too, but we suggest you first think carefully about whether
|
||||
this license or the ordinary General Public License is the better
|
||||
strategy to use in any particular case, based on the explanations below.
|
||||
|
||||
When we speak of free software, we are referring to freedom of use,
|
||||
not price. Our General Public Licenses are designed to make sure that
|
||||
you have the freedom to distribute copies of free software (and charge
|
||||
for this service if you wish); that you receive source code or can get
|
||||
it if you want it; that you can change the software and use pieces of
|
||||
it in new free programs; and that you are informed that you can do
|
||||
these things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid
|
||||
distributors to deny you these rights or to ask you to surrender these
|
||||
rights. These restrictions translate to certain responsibilities for
|
||||
you if you distribute copies of the library or if you modify it.
|
||||
|
||||
For example, if you distribute copies of the library, whether gratis
|
||||
or for a fee, you must give the recipients all the rights that we gave
|
||||
you. You must make sure that they, too, receive or can get the source
|
||||
code. If you link other code with the library, you must provide
|
||||
complete object files to the recipients, so that they can relink them
|
||||
with the library after making changes to the library and recompiling
|
||||
it. And you must show them these terms so they know their rights.
|
||||
|
||||
We protect your rights with a two-step method: (1) we copyright the
|
||||
library, and (2) we offer you this license, which gives you legal
|
||||
permission to copy, distribute and/or modify the library.
|
||||
|
||||
To protect each distributor, we want to make it very clear that
|
||||
there is no warranty for the free library. Also, if the library is
|
||||
modified by someone else and passed on, the recipients should know
|
||||
that what they have is not the original version, so that the original
|
||||
author's reputation will not be affected by problems that might be
|
||||
introduced by others.
|
||||
|
||||
Finally, software patents pose a constant threat to the existence of
|
||||
any free program. We wish to make sure that a company cannot
|
||||
effectively restrict the users of a free program by obtaining a
|
||||
restrictive license from a patent holder. Therefore, we insist that
|
||||
any patent license obtained for a version of the library must be
|
||||
consistent with the full freedom of use specified in this license.
|
||||
|
||||
Most GNU software, including some libraries, is covered by the
|
||||
ordinary GNU General Public License. This license, the GNU Lesser
|
||||
General Public License, applies to certain designated libraries, and
|
||||
is quite different from the ordinary General Public License. We use
|
||||
this license for certain libraries in order to permit linking those
|
||||
libraries into non-free programs.
|
||||
|
||||
When a program is linked with a library, whether statically or using
|
||||
a shared library, the combination of the two is legally speaking a
|
||||
combined work, a derivative of the original library. The ordinary
|
||||
General Public License therefore permits such linking only if the
|
||||
entire combination fits its criteria of freedom. The Lesser General
|
||||
Public License permits more lax criteria for linking other code with
|
||||
the library.
|
||||
|
||||
We call this license the "Lesser" General Public License because it
|
||||
does Less to protect the user's freedom than the ordinary General
|
||||
Public License. It also provides other free software developers Less
|
||||
of an advantage over competing non-free programs. These disadvantages
|
||||
are the reason we use the ordinary General Public License for many
|
||||
libraries. However, the Lesser license provides advantages in certain
|
||||
special circumstances.
|
||||
|
||||
For example, on rare occasions, there may be a special need to
|
||||
encourage the widest possible use of a certain library, so that it becomes
|
||||
a de-facto standard. To achieve this, non-free programs must be
|
||||
allowed to use the library. A more frequent case is that a free
|
||||
library does the same job as widely used non-free libraries. In this
|
||||
case, there is little to gain by limiting the free library to free
|
||||
software only, so we use the Lesser General Public License.
|
||||
|
||||
In other cases, permission to use a particular library in non-free
|
||||
programs enables a greater number of people to use a large body of
|
||||
free software. For example, permission to use the GNU C Library in
|
||||
non-free programs enables many more people to use the whole GNU
|
||||
operating system, as well as its variant, the GNU/Linux operating
|
||||
system.
|
||||
|
||||
Although the Lesser General Public License is Less protective of the
|
||||
users' freedom, it does ensure that the user of a program that is
|
||||
linked with the Library has the freedom and the wherewithal to run
|
||||
that program using a modified version of the Library.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow. Pay close attention to the difference between a
|
||||
"work based on the library" and a "work that uses the library". The
|
||||
former contains code derived from the library, whereas the latter must
|
||||
be combined with the library in order to run.
|
||||
|
||||
GNU LESSER GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License Agreement applies to any software library or other
|
||||
program which contains a notice placed by the copyright holder or
|
||||
other authorized party saying it may be distributed under the terms of
|
||||
this Lesser General Public License (also called "this License").
|
||||
Each licensee is addressed as "you".
|
||||
|
||||
A "library" means a collection of software functions and/or data
|
||||
prepared so as to be conveniently linked with application programs
|
||||
(which use some of those functions and data) to form executables.
|
||||
|
||||
The "Library", below, refers to any such software library or work
|
||||
which has been distributed under these terms. A "work based on the
|
||||
Library" means either the Library or any derivative work under
|
||||
copyright law: that is to say, a work containing the Library or a
|
||||
portion of it, either verbatim or with modifications and/or translated
|
||||
straightforwardly into another language. (Hereinafter, translation is
|
||||
included without limitation in the term "modification".)
|
||||
|
||||
"Source code" for a work means the preferred form of the work for
|
||||
making modifications to it. For a library, complete source code means
|
||||
all the source code for all modules it contains, plus any associated
|
||||
interface definition files, plus the scripts used to control compilation
|
||||
and installation of the library.
|
||||
|
||||
Activities other than copying, distribution and modification are not
|
||||
covered by this License; they are outside its scope. The act of
|
||||
running a program using the Library is not restricted, and output from
|
||||
such a program is covered only if its contents constitute a work based
|
||||
on the Library (independent of the use of the Library in a tool for
|
||||
writing it). Whether that is true depends on what the Library does
|
||||
and what the program that uses the Library does.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Library's
|
||||
complete source code as you receive it, in any medium, provided that
|
||||
you conspicuously and appropriately publish on each copy an
|
||||
appropriate copyright notice and disclaimer of warranty; keep intact
|
||||
all the notices that refer to this License and to the absence of any
|
||||
warranty; and distribute a copy of this License along with the
|
||||
Library.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy,
|
||||
and you may at your option offer warranty protection in exchange for a
|
||||
fee.
|
||||
|
||||
2. You may modify your copy or copies of the Library or any portion
|
||||
of it, thus forming a work based on the Library, and copy and
|
||||
distribute such modifications or work under the terms of Section 1
|
||||
above, provided that you also meet all of these conditions:
|
||||
|
||||
a) The modified work must itself be a software library.
|
||||
|
||||
b) You must cause the files modified to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
|
||||
c) You must cause the whole of the work to be licensed at no
|
||||
charge to all third parties under the terms of this License.
|
||||
|
||||
d) If a facility in the modified Library refers to a function or a
|
||||
table of data to be supplied by an application program that uses
|
||||
the facility, other than as an argument passed when the facility
|
||||
is invoked, then you must make a good faith effort to ensure that,
|
||||
in the event an application does not supply such function or
|
||||
table, the facility still operates, and performs whatever part of
|
||||
its purpose remains meaningful.
|
||||
|
||||
(For example, a function in a library to compute square roots has
|
||||
a purpose that is entirely well-defined independent of the
|
||||
application. Therefore, Subsection 2d requires that any
|
||||
application-supplied function or table used by this function must
|
||||
be optional: if the application does not supply it, the square
|
||||
root function must still compute square roots.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If
|
||||
identifiable sections of that work are not derived from the Library,
|
||||
and can be reasonably considered independent and separate works in
|
||||
themselves, then this License, and its terms, do not apply to those
|
||||
sections when you distribute them as separate works. But when you
|
||||
distribute the same sections as part of a whole which is a work based
|
||||
on the Library, the distribution of the whole must be on the terms of
|
||||
this License, whose permissions for other licensees extend to the
|
||||
entire whole, and thus to each and every part regardless of who wrote
|
||||
it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest
|
||||
your rights to work written entirely by you; rather, the intent is to
|
||||
exercise the right to control the distribution of derivative or
|
||||
collective works based on the Library.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Library
|
||||
with the Library (or with a work based on the Library) on a volume of
|
||||
a storage or distribution medium does not bring the other work under
|
||||
the scope of this License.
|
||||
|
||||
3. You may opt to apply the terms of the ordinary GNU General Public
|
||||
License instead of this License to a given copy of the Library. To do
|
||||
this, you must alter all the notices that refer to this License, so
|
||||
that they refer to the ordinary GNU General Public License, version 2,
|
||||
instead of to this License. (If a newer version than version 2 of the
|
||||
ordinary GNU General Public License has appeared, then you can specify
|
||||
that version instead if you wish.) Do not make any other change in
|
||||
these notices.
|
||||
|
||||
Once this change is made in a given copy, it is irreversible for
|
||||
that copy, so the ordinary GNU General Public License applies to all
|
||||
subsequent copies and derivative works made from that copy.
|
||||
|
||||
This option is useful when you wish to copy part of the code of
|
||||
the Library into a program that is not a library.
|
||||
|
||||
4. You may copy and distribute the Library (or a portion or
|
||||
derivative of it, under Section 2) in object code or executable form
|
||||
under the terms of Sections 1 and 2 above provided that you accompany
|
||||
it with the complete corresponding machine-readable source code, which
|
||||
must be distributed under the terms of Sections 1 and 2 above on a
|
||||
medium customarily used for software interchange.
|
||||
|
||||
If distribution of object code is made by offering access to copy
|
||||
from a designated place, then offering equivalent access to copy the
|
||||
source code from the same place satisfies the requirement to
|
||||
distribute the source code, even though third parties are not
|
||||
compelled to copy the source along with the object code.
|
||||
|
||||
5. A program that contains no derivative of any portion of the
|
||||
Library, but is designed to work with the Library by being compiled or
|
||||
linked with it, is called a "work that uses the Library". Such a
|
||||
work, in isolation, is not a derivative work of the Library, and
|
||||
therefore falls outside the scope of this License.
|
||||
|
||||
However, linking a "work that uses the Library" with the Library
|
||||
creates an executable that is a derivative of the Library (because it
|
||||
contains portions of the Library), rather than a "work that uses the
|
||||
library". The executable is therefore covered by this License.
|
||||
Section 6 states terms for distribution of such executables.
|
||||
|
||||
When a "work that uses the Library" uses material from a header file
|
||||
that is part of the Library, the object code for the work may be a
|
||||
derivative work of the Library even though the source code is not.
|
||||
Whether this is true is especially significant if the work can be
|
||||
linked without the Library, or if the work is itself a library. The
|
||||
threshold for this to be true is not precisely defined by law.
|
||||
|
||||
If such an object file uses only numerical parameters, data
|
||||
structure layouts and accessors, and small macros and small inline
|
||||
functions (ten lines or less in length), then the use of the object
|
||||
file is unrestricted, regardless of whether it is legally a derivative
|
||||
work. (Executables containing this object code plus portions of the
|
||||
Library will still fall under Section 6.)
|
||||
|
||||
Otherwise, if the work is a derivative of the Library, you may
|
||||
distribute the object code for the work under the terms of Section 6.
|
||||
Any executables containing that work also fall under Section 6,
|
||||
whether or not they are linked directly with the Library itself.
|
||||
|
||||
6. As an exception to the Sections above, you may also combine or
|
||||
link a "work that uses the Library" with the Library to produce a
|
||||
work containing portions of the Library, and distribute that work
|
||||
under terms of your choice, provided that the terms permit
|
||||
modification of the work for the customer's own use and reverse
|
||||
engineering for debugging such modifications.
|
||||
|
||||
You must give prominent notice with each copy of the work that the
|
||||
Library is used in it and that the Library and its use are covered by
|
||||
this License. You must supply a copy of this License. If the work
|
||||
during execution displays copyright notices, you must include the
|
||||
copyright notice for the Library among them, as well as a reference
|
||||
directing the user to the copy of this License. Also, you must do one
|
||||
of these things:
|
||||
|
||||
a) Accompany the work with the complete corresponding
|
||||
machine-readable source code for the Library including whatever
|
||||
changes were used in the work (which must be distributed under
|
||||
Sections 1 and 2 above); and, if the work is an executable linked
|
||||
with the Library, with the complete machine-readable "work that
|
||||
uses the Library", as object code and/or source code, so that the
|
||||
user can modify the Library and then relink to produce a modified
|
||||
executable containing the modified Library. (It is understood
|
||||
that the user who changes the contents of definitions files in the
|
||||
Library will not necessarily be able to recompile the application
|
||||
to use the modified definitions.)
|
||||
|
||||
b) Use a suitable shared library mechanism for linking with the
|
||||
Library. A suitable mechanism is one that (1) uses at run time a
|
||||
copy of the library already present on the user's computer system,
|
||||
rather than copying library functions into the executable, and (2)
|
||||
will operate properly with a modified version of the library, if
|
||||
the user installs one, as long as the modified version is
|
||||
interface-compatible with the version that the work was made with.
|
||||
|
||||
c) Accompany the work with a written offer, valid for at
|
||||
least three years, to give the same user the materials
|
||||
specified in Subsection 6a, above, for a charge no more
|
||||
than the cost of performing this distribution.
|
||||
|
||||
d) If distribution of the work is made by offering access to copy
|
||||
from a designated place, offer equivalent access to copy the above
|
||||
specified materials from the same place.
|
||||
|
||||
e) Verify that the user has already received a copy of these
|
||||
materials or that you have already sent this user a copy.
|
||||
|
||||
For an executable, the required form of the "work that uses the
|
||||
Library" must include any data and utility programs needed for
|
||||
reproducing the executable from it. However, as a special exception,
|
||||
the materials to be distributed need not include anything that is
|
||||
normally distributed (in either source or binary form) with the major
|
||||
components (compiler, kernel, and so on) of the operating system on
|
||||
which the executable runs, unless that component itself accompanies
|
||||
the executable.
|
||||
|
||||
It may happen that this requirement contradicts the license
|
||||
restrictions of other proprietary libraries that do not normally
|
||||
accompany the operating system. Such a contradiction means you cannot
|
||||
use both them and the Library together in an executable that you
|
||||
distribute.
|
||||
|
||||
7. You may place library facilities that are a work based on the
|
||||
Library side-by-side in a single library together with other library
|
||||
facilities not covered by this License, and distribute such a combined
|
||||
library, provided that the separate distribution of the work based on
|
||||
the Library and of the other library facilities is otherwise
|
||||
permitted, and provided that you do these two things:
|
||||
|
||||
a) Accompany the combined library with a copy of the same work
|
||||
based on the Library, uncombined with any other library
|
||||
facilities. This must be distributed under the terms of the
|
||||
Sections above.
|
||||
|
||||
b) Give prominent notice with the combined library of the fact
|
||||
that part of it is a work based on the Library, and explaining
|
||||
where to find the accompanying uncombined form of the same work.
|
||||
|
||||
8. You may not copy, modify, sublicense, link with, or distribute
|
||||
the Library except as expressly provided under this License. Any
|
||||
attempt otherwise to copy, modify, sublicense, link with, or
|
||||
distribute the Library is void, and will automatically terminate your
|
||||
rights under this License. However, parties who have received copies,
|
||||
or rights, from you under this License will not have their licenses
|
||||
terminated so long as such parties remain in full compliance.
|
||||
|
||||
9. You are not required to accept this License, since you have not
|
||||
signed it. However, nothing else grants you permission to modify or
|
||||
distribute the Library or its derivative works. These actions are
|
||||
prohibited by law if you do not accept this License. Therefore, by
|
||||
modifying or distributing the Library (or any work based on the
|
||||
Library), you indicate your acceptance of this License to do so, and
|
||||
all its terms and conditions for copying, distributing or modifying
|
||||
the Library or works based on it.
|
||||
|
||||
10. Each time you redistribute the Library (or any work based on the
|
||||
Library), the recipient automatically receives a license from the
|
||||
original licensor to copy, distribute, link with or modify the Library
|
||||
subject to these terms and conditions. You may not impose any further
|
||||
restrictions on the recipients' exercise of the rights granted herein.
|
||||
You are not responsible for enforcing compliance by third parties with
|
||||
this License.
|
||||
|
||||
11. If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent issues),
|
||||
conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot
|
||||
distribute so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you
|
||||
may not distribute the Library at all. For example, if a patent
|
||||
license would not permit royalty-free redistribution of the Library by
|
||||
all those who receive copies directly or indirectly through you, then
|
||||
the only way you could satisfy both it and this License would be to
|
||||
refrain entirely from distribution of the Library.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under any
|
||||
particular circumstance, the balance of the section is intended to apply,
|
||||
and the section as a whole is intended to apply in other circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any
|
||||
patents or other property right claims or to contest validity of any
|
||||
such claims; this section has the sole purpose of protecting the
|
||||
integrity of the free software distribution system which is
|
||||
implemented by public license practices. Many people have made
|
||||
generous contributions to the wide range of software distributed
|
||||
through that system in reliance on consistent application of that
|
||||
system; it is up to the author/donor to decide if he or she is willing
|
||||
to distribute software through any other system and a licensee cannot
|
||||
impose that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to
|
||||
be a consequence of the rest of this License.
|
||||
|
||||
12. If the distribution and/or use of the Library is restricted in
|
||||
certain countries either by patents or by copyrighted interfaces, the
|
||||
original copyright holder who places the Library under this License may add
|
||||
an explicit geographical distribution limitation excluding those countries,
|
||||
so that distribution is permitted only in or among countries not thus
|
||||
excluded. In such case, this License incorporates the limitation as if
|
||||
written in the body of this License.
|
||||
|
||||
13. The Free Software Foundation may publish revised and/or new
|
||||
versions of the Lesser General Public License from time to time.
|
||||
Such new versions will be similar in spirit to the present version,
|
||||
but may differ in detail to address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Library
|
||||
specifies a version number of this License which applies to it and
|
||||
"any later version", you have the option of following the terms and
|
||||
conditions either of that version or of any later version published by
|
||||
the Free Software Foundation. If the Library does not specify a
|
||||
license version number, you may choose any version ever published by
|
||||
the Free Software Foundation.
|
||||
|
||||
14. If you wish to incorporate parts of the Library into other free
|
||||
programs whose distribution conditions are incompatible with these,
|
||||
write to the author to ask for permission. For software which is
|
||||
copyrighted by the Free Software Foundation, write to the Free
|
||||
Software Foundation; we sometimes make exceptions for this. Our
|
||||
decision will be guided by the two goals of preserving the free status
|
||||
of all derivatives of our free software and of promoting the sharing
|
||||
and reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
|
||||
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
|
||||
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
|
||||
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
|
||||
OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
|
||||
KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
|
||||
LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
|
||||
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
|
||||
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
|
||||
AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
|
||||
FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
|
||||
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
|
||||
LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
|
||||
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
|
||||
FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
|
||||
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
|
||||
DAMAGES.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Libraries
|
||||
|
||||
If you develop a new library, and you want it to be of the greatest
|
||||
possible use to the public, we recommend making it free software that
|
||||
everyone can redistribute and change. You can do so by permitting
|
||||
redistribution under these terms (or, alternatively, under the terms of the
|
||||
ordinary General Public License).
|
||||
|
||||
To apply these terms, attach the following notices to the library. It is
|
||||
safest to attach them to the start of each source file to most effectively
|
||||
convey the exclusion of warranty; and each file should have at least the
|
||||
"copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the library's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or your
|
||||
school, if any, to sign a "copyright disclaimer" for the library, if
|
||||
necessary. Here is a sample; alter the names:
|
||||
|
||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the
|
||||
library `Frob' (a library for tweaking knobs) written by James Random Hacker.
|
||||
|
||||
<signature of Ty Coon>, 1 April 1990
|
||||
Ty Coon, President of Vice
|
||||
|
||||
That's all there is to it!
|
||||
|
||||
|
|
@ -0,0 +1,79 @@
|
|||
11/21/2009 Simon Newton <nomis52@gmail.com>
|
||||
* OLA v0.5.0
|
||||
|
||||
10/18/2009 Simon Newton <nomis52@gmail.com>
|
||||
* OLA v0.4.0
|
||||
|
||||
8/26/2009 Simon Newton <nomis52@gmail.com>
|
||||
* OLA v0.3.1
|
||||
|
||||
8/8/2009 Simon Newton <nomis52@gmail.com>
|
||||
* OLA v0.3
|
||||
|
||||
14/10/2007 Simon Newton <<nomis52@westnet.com.au>
|
||||
* refactored the plugins and cleaned up all the plugin code
|
||||
* added 'enable' and 'debug' parameters for the plugins
|
||||
* bugfixes to the python buildfiles
|
||||
|
||||
15/9/2007 Simon Newton <<nomis52@westnet.com.au>
|
||||
* fixed a memory leak
|
||||
* fixed a bug in calling upload_plugins multiple times
|
||||
* added the dmx4linux plugin
|
||||
* fixed the bug that triggered on usb pro removal
|
||||
|
||||
15/9/2007 Simon Newton <<nomis52@westnet.com.au>
|
||||
* stageprofi plugin
|
||||
* fixed the bug with the DMX USB Pro
|
||||
|
||||
3/3/2007 Simon Newton <<nomis52@westnet.com.au>
|
||||
* initial thread support in the client libraries
|
||||
|
||||
26/2/2007 Simon Newton <<nomis52@westnet.com.au>
|
||||
* Integrated the python libs into autotools
|
||||
* Minor bugfix
|
||||
* Wrote port patching regression tests
|
||||
|
||||
16/2/2007 Simon Newton <<nomis52@westnet.com.au>
|
||||
* reduced memory usage in plugins
|
||||
* started on test framework
|
||||
|
||||
14/1/2007 Simon Newton <<nomis52@westnet.com.au>
|
||||
* Pathport plugin added
|
||||
|
||||
13/1/2007 Simon Newton <<nomis52@westnet.com.au>
|
||||
* Added a plugin for the Stage Profi USB Device
|
||||
|
||||
1/1/2007 Simon Newton <<nomis52@westnet.com.au>
|
||||
* fixed the problem on the USB Pro when changing modes
|
||||
|
||||
30/12/2006 Simon Newton <<nomis52@westnet.com.au>
|
||||
* Fixed the Usb Pro last-channel-corrupt bug
|
||||
|
||||
30/12/2006 Simon Newton <<nomis52@westnet.com.au>
|
||||
* Fixed problems so that it would acutally compile again
|
||||
|
||||
25/12/2006 Simon Newton <<nomis52@westnet.com.au>
|
||||
* universes now save names and merge mode
|
||||
* fixed a bunch of memory leaks
|
||||
|
||||
24/12/2006 Simon Newton <<nomis52@westnet.com.au>
|
||||
* Got device config messages working
|
||||
* Add configuration commands to the Pro Device
|
||||
* Added universe merge capability
|
||||
* Improved the tool to autogen protocol messages
|
||||
* Added merge mode for universes with device sources (no client support yet)
|
||||
|
||||
28/11/2006 Simon Newton <<nomis52@westnet.com.au>
|
||||
* Started on a general RPC framework
|
||||
* Changed the client to C++, events are now handled asynchronously
|
||||
|
||||
27/4/2006 Simon Newton <<nomis52@westnet.com.au>
|
||||
* Art-Net plugin bug fix
|
||||
|
||||
17/4/2006 Simon Newton <<nomis52@westnet.com.au>
|
||||
* Added support for multiple preference values per key
|
||||
* Pro Plugin now supports multiple devices
|
||||
|
||||
16/4/2006 Simon Newton <<nomis52@westnet.com.au>
|
||||
* USR1 signals now used to change logging levels
|
||||
|
|
@ -0,0 +1,365 @@
|
|||
Installation Instructions
|
||||
*************************
|
||||
|
||||
Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005,
|
||||
2006, 2007, 2008, 2009 Free Software Foundation, Inc.
|
||||
|
||||
Copying and distribution of this file, with or without modification,
|
||||
are permitted in any medium without royalty provided the copyright
|
||||
notice and this notice are preserved. This file is offered as-is,
|
||||
without warranty of any kind.
|
||||
|
||||
Basic Installation
|
||||
==================
|
||||
|
||||
Briefly, the shell commands `./configure; make; make install' should
|
||||
configure, build, and install this package. The following
|
||||
more-detailed instructions are generic; see the `README' file for
|
||||
instructions specific to this package. Some packages provide this
|
||||
`INSTALL' file but do not implement all of the features documented
|
||||
below. The lack of an optional feature in a given package is not
|
||||
necessarily a bug. More recommendations for GNU packages can be found
|
||||
in *note Makefile Conventions: (standards)Makefile Conventions.
|
||||
|
||||
The `configure' shell script attempts to guess correct values for
|
||||
various system-dependent variables used during compilation. It uses
|
||||
those values to create a `Makefile' in each directory of the package.
|
||||
It may also create one or more `.h' files containing system-dependent
|
||||
definitions. Finally, it creates a shell script `config.status' that
|
||||
you can run in the future to recreate the current configuration, and a
|
||||
file `config.log' containing compiler output (useful mainly for
|
||||
debugging `configure').
|
||||
|
||||
It can also use an optional file (typically called `config.cache'
|
||||
and enabled with `--cache-file=config.cache' or simply `-C') that saves
|
||||
the results of its tests to speed up reconfiguring. Caching is
|
||||
disabled by default to prevent problems with accidental use of stale
|
||||
cache files.
|
||||
|
||||
If you need to do unusual things to compile the package, please try
|
||||
to figure out how `configure' could check whether to do them, and mail
|
||||
diffs or instructions to the address given in the `README' so they can
|
||||
be considered for the next release. If you are using the cache, and at
|
||||
some point `config.cache' contains results you don't want to keep, you
|
||||
may remove or edit it.
|
||||
|
||||
The file `configure.ac' (or `configure.in') is used to create
|
||||
`configure' by a program called `autoconf'. You need `configure.ac' if
|
||||
you want to change it or regenerate `configure' using a newer version
|
||||
of `autoconf'.
|
||||
|
||||
The simplest way to compile this package is:
|
||||
|
||||
1. `cd' to the directory containing the package's source code and type
|
||||
`./configure' to configure the package for your system.
|
||||
|
||||
Running `configure' might take a while. While running, it prints
|
||||
some messages telling which features it is checking for.
|
||||
|
||||
2. Type `make' to compile the package.
|
||||
|
||||
3. Optionally, type `make check' to run any self-tests that come with
|
||||
the package, generally using the just-built uninstalled binaries.
|
||||
|
||||
4. Type `make install' to install the programs and any data files and
|
||||
documentation. When installing into a prefix owned by root, it is
|
||||
recommended that the package be configured and built as a regular
|
||||
user, and only the `make install' phase executed with root
|
||||
privileges.
|
||||
|
||||
5. Optionally, type `make installcheck' to repeat any self-tests, but
|
||||
this time using the binaries in their final installed location.
|
||||
This target does not install anything. Running this target as a
|
||||
regular user, particularly if the prior `make install' required
|
||||
root privileges, verifies that the installation completed
|
||||
correctly.
|
||||
|
||||
6. You can remove the program binaries and object files from the
|
||||
source code directory by typing `make clean'. To also remove the
|
||||
files that `configure' created (so you can compile the package for
|
||||
a different kind of computer), type `make distclean'. There is
|
||||
also a `make maintainer-clean' target, but that is intended mainly
|
||||
for the package's developers. If you use it, you may have to get
|
||||
all sorts of other programs in order to regenerate files that came
|
||||
with the distribution.
|
||||
|
||||
7. Often, you can also type `make uninstall' to remove the installed
|
||||
files again. In practice, not all packages have tested that
|
||||
uninstallation works correctly, even though it is required by the
|
||||
GNU Coding Standards.
|
||||
|
||||
8. Some packages, particularly those that use Automake, provide `make
|
||||
distcheck', which can by used by developers to test that all other
|
||||
targets like `make install' and `make uninstall' work correctly.
|
||||
This target is generally not run by end users.
|
||||
|
||||
Compilers and Options
|
||||
=====================
|
||||
|
||||
Some systems require unusual options for compilation or linking that
|
||||
the `configure' script does not know about. Run `./configure --help'
|
||||
for details on some of the pertinent environment variables.
|
||||
|
||||
You can give `configure' initial values for configuration parameters
|
||||
by setting variables in the command line or in the environment. Here
|
||||
is an example:
|
||||
|
||||
./configure CC=c99 CFLAGS=-g LIBS=-lposix
|
||||
|
||||
*Note Defining Variables::, for more details.
|
||||
|
||||
Compiling For Multiple Architectures
|
||||
====================================
|
||||
|
||||
You can compile the package for more than one kind of computer at the
|
||||
same time, by placing the object files for each architecture in their
|
||||
own directory. To do this, you can use GNU `make'. `cd' to the
|
||||
directory where you want the object files and executables to go and run
|
||||
the `configure' script. `configure' automatically checks for the
|
||||
source code in the directory that `configure' is in and in `..'. This
|
||||
is known as a "VPATH" build.
|
||||
|
||||
With a non-GNU `make', it is safer to compile the package for one
|
||||
architecture at a time in the source code directory. After you have
|
||||
installed the package for one architecture, use `make distclean' before
|
||||
reconfiguring for another architecture.
|
||||
|
||||
On MacOS X 10.5 and later systems, you can create libraries and
|
||||
executables that work on multiple system types--known as "fat" or
|
||||
"universal" binaries--by specifying multiple `-arch' options to the
|
||||
compiler but only a single `-arch' option to the preprocessor. Like
|
||||
this:
|
||||
|
||||
./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \
|
||||
CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \
|
||||
CPP="gcc -E" CXXCPP="g++ -E"
|
||||
|
||||
This is not guaranteed to produce working output in all cases, you
|
||||
may have to build one architecture at a time and combine the results
|
||||
using the `lipo' tool if you have problems.
|
||||
|
||||
Installation Names
|
||||
==================
|
||||
|
||||
By default, `make install' installs the package's commands under
|
||||
`/usr/local/bin', include files under `/usr/local/include', etc. You
|
||||
can specify an installation prefix other than `/usr/local' by giving
|
||||
`configure' the option `--prefix=PREFIX', where PREFIX must be an
|
||||
absolute file name.
|
||||
|
||||
You can specify separate installation prefixes for
|
||||
architecture-specific files and architecture-independent files. If you
|
||||
pass the option `--exec-prefix=PREFIX' to `configure', the package uses
|
||||
PREFIX as the prefix for installing programs and libraries.
|
||||
Documentation and other data files still use the regular prefix.
|
||||
|
||||
In addition, if you use an unusual directory layout you can give
|
||||
options like `--bindir=DIR' to specify different values for particular
|
||||
kinds of files. Run `configure --help' for a list of the directories
|
||||
you can set and what kinds of files go in them. In general, the
|
||||
default for these options is expressed in terms of `${prefix}', so that
|
||||
specifying just `--prefix' will affect all of the other directory
|
||||
specifications that were not explicitly provided.
|
||||
|
||||
The most portable way to affect installation locations is to pass the
|
||||
correct locations to `configure'; however, many packages provide one or
|
||||
both of the following shortcuts of passing variable assignments to the
|
||||
`make install' command line to change installation locations without
|
||||
having to reconfigure or recompile.
|
||||
|
||||
The first method involves providing an override variable for each
|
||||
affected directory. For example, `make install
|
||||
prefix=/alternate/directory' will choose an alternate location for all
|
||||
directory configuration variables that were expressed in terms of
|
||||
`${prefix}'. Any directories that were specified during `configure',
|
||||
but not in terms of `${prefix}', must each be overridden at install
|
||||
time for the entire installation to be relocated. The approach of
|
||||
makefile variable overrides for each directory variable is required by
|
||||
the GNU Coding Standards, and ideally causes no recompilation.
|
||||
However, some platforms have known limitations with the semantics of
|
||||
shared libraries that end up requiring recompilation when using this
|
||||
method, particularly noticeable in packages that use GNU Libtool.
|
||||
|
||||
The second method involves providing the `DESTDIR' variable. For
|
||||
example, `make install DESTDIR=/alternate/directory' will prepend
|
||||
`/alternate/directory' before all installation names. The approach of
|
||||
`DESTDIR' overrides is not required by the GNU Coding Standards, and
|
||||
does not work on platforms that have drive letters. On the other hand,
|
||||
it does better at avoiding recompilation issues, and works well even
|
||||
when some directory options were not specified in terms of `${prefix}'
|
||||
at `configure' time.
|
||||
|
||||
Optional Features
|
||||
=================
|
||||
|
||||
If the package supports it, you can cause programs to be installed
|
||||
with an extra prefix or suffix on their names by giving `configure' the
|
||||
option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
|
||||
|
||||
Some packages pay attention to `--enable-FEATURE' options to
|
||||
`configure', where FEATURE indicates an optional part of the package.
|
||||
They may also pay attention to `--with-PACKAGE' options, where PACKAGE
|
||||
is something like `gnu-as' or `x' (for the X Window System). The
|
||||
`README' should mention any `--enable-' and `--with-' options that the
|
||||
package recognizes.
|
||||
|
||||
For packages that use the X Window System, `configure' can usually
|
||||
find the X include and library files automatically, but if it doesn't,
|
||||
you can use the `configure' options `--x-includes=DIR' and
|
||||
`--x-libraries=DIR' to specify their locations.
|
||||
|
||||
Some packages offer the ability to configure how verbose the
|
||||
execution of `make' will be. For these packages, running `./configure
|
||||
--enable-silent-rules' sets the default to minimal output, which can be
|
||||
overridden with `make V=1'; while running `./configure
|
||||
--disable-silent-rules' sets the default to verbose, which can be
|
||||
overridden with `make V=0'.
|
||||
|
||||
Particular systems
|
||||
==================
|
||||
|
||||
On HP-UX, the default C compiler is not ANSI C compatible. If GNU
|
||||
CC is not installed, it is recommended to use the following options in
|
||||
order to use an ANSI C compiler:
|
||||
|
||||
./configure CC="cc -Ae -D_XOPEN_SOURCE=500"
|
||||
|
||||
and if that doesn't work, install pre-built binaries of GCC for HP-UX.
|
||||
|
||||
On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot
|
||||
parse its `<wchar.h>' header file. The option `-nodtk' can be used as
|
||||
a workaround. If GNU CC is not installed, it is therefore recommended
|
||||
to try
|
||||
|
||||
./configure CC="cc"
|
||||
|
||||
and if that doesn't work, try
|
||||
|
||||
./configure CC="cc -nodtk"
|
||||
|
||||
On Solaris, don't put `/usr/ucb' early in your `PATH'. This
|
||||
directory contains several dysfunctional programs; working variants of
|
||||
these programs are available in `/usr/bin'. So, if you need `/usr/ucb'
|
||||
in your `PATH', put it _after_ `/usr/bin'.
|
||||
|
||||
On Haiku, software installed for all users goes in `/boot/common',
|
||||
not `/usr/local'. It is recommended to use the following options:
|
||||
|
||||
./configure --prefix=/boot/common
|
||||
|
||||
Specifying the System Type
|
||||
==========================
|
||||
|
||||
There may be some features `configure' cannot figure out
|
||||
automatically, but needs to determine by the type of machine the package
|
||||
will run on. Usually, assuming the package is built to be run on the
|
||||
_same_ architectures, `configure' can figure that out, but if it prints
|
||||
a message saying it cannot guess the machine type, give it the
|
||||
`--build=TYPE' option. TYPE can either be a short name for the system
|
||||
type, such as `sun4', or a canonical name which has the form:
|
||||
|
||||
CPU-COMPANY-SYSTEM
|
||||
|
||||
where SYSTEM can have one of these forms:
|
||||
|
||||
OS
|
||||
KERNEL-OS
|
||||
|
||||
See the file `config.sub' for the possible values of each field. If
|
||||
`config.sub' isn't included in this package, then this package doesn't
|
||||
need to know the machine type.
|
||||
|
||||
If you are _building_ compiler tools for cross-compiling, you should
|
||||
use the option `--target=TYPE' to select the type of system they will
|
||||
produce code for.
|
||||
|
||||
If you want to _use_ a cross compiler, that generates code for a
|
||||
platform different from the build platform, you should specify the
|
||||
"host" platform (i.e., that on which the generated programs will
|
||||
eventually be run) with `--host=TYPE'.
|
||||
|
||||
Sharing Defaults
|
||||
================
|
||||
|
||||
If you want to set default values for `configure' scripts to share,
|
||||
you can create a site shell script called `config.site' that gives
|
||||
default values for variables like `CC', `cache_file', and `prefix'.
|
||||
`configure' looks for `PREFIX/share/config.site' if it exists, then
|
||||
`PREFIX/etc/config.site' if it exists. Or, you can set the
|
||||
`CONFIG_SITE' environment variable to the location of the site script.
|
||||
A warning: not all `configure' scripts look for a site script.
|
||||
|
||||
Defining Variables
|
||||
==================
|
||||
|
||||
Variables not defined in a site shell script can be set in the
|
||||
environment passed to `configure'. However, some packages may run
|
||||
configure again during the build, and the customized values of these
|
||||
variables may be lost. In order to avoid this problem, you should set
|
||||
them in the `configure' command line, using `VAR=value'. For example:
|
||||
|
||||
./configure CC=/usr/local2/bin/gcc
|
||||
|
||||
causes the specified `gcc' to be used as the C compiler (unless it is
|
||||
overridden in the site shell script).
|
||||
|
||||
Unfortunately, this technique does not work for `CONFIG_SHELL' due to
|
||||
an Autoconf bug. Until the bug is fixed you can use this workaround:
|
||||
|
||||
CONFIG_SHELL=/bin/bash /bin/bash ./configure CONFIG_SHELL=/bin/bash
|
||||
|
||||
`configure' Invocation
|
||||
======================
|
||||
|
||||
`configure' recognizes the following options to control how it
|
||||
operates.
|
||||
|
||||
`--help'
|
||||
`-h'
|
||||
Print a summary of all of the options to `configure', and exit.
|
||||
|
||||
`--help=short'
|
||||
`--help=recursive'
|
||||
Print a summary of the options unique to this package's
|
||||
`configure', and exit. The `short' variant lists options used
|
||||
only in the top level, while the `recursive' variant lists options
|
||||
also present in any nested packages.
|
||||
|
||||
`--version'
|
||||
`-V'
|
||||
Print the version of Autoconf used to generate the `configure'
|
||||
script, and exit.
|
||||
|
||||
`--cache-file=FILE'
|
||||
Enable the cache: use and save the results of the tests in FILE,
|
||||
traditionally `config.cache'. FILE defaults to `/dev/null' to
|
||||
disable caching.
|
||||
|
||||
`--config-cache'
|
||||
`-C'
|
||||
Alias for `--cache-file=config.cache'.
|
||||
|
||||
`--quiet'
|
||||
`--silent'
|
||||
`-q'
|
||||
Do not print messages saying which checks are being made. To
|
||||
suppress all normal output, redirect it to `/dev/null' (any error
|
||||
messages will still be shown).
|
||||
|
||||
`--srcdir=DIR'
|
||||
Look for the package's source code in directory DIR. Usually
|
||||
`configure' can determine that directory automatically.
|
||||
|
||||
`--prefix=DIR'
|
||||
Use DIR as the installation prefix. *note Installation Names::
|
||||
for more details, including other options available for fine-tuning
|
||||
the installation locations.
|
||||
|
||||
`--no-create'
|
||||
`-n'
|
||||
Run the configure checks, but stop before creating any output
|
||||
files.
|
||||
|
||||
`configure' also accepts some other, not widely useful, options. Run
|
||||
`configure --help' for more details.
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
auxdir = @ac_aux_dir@
|
||||
AUX_DIST = $(auxdir)/install-sh $(auxdir)/missing \
|
||||
$(auxdir)/mkinstalldirs
|
||||
|
||||
SUBDIRS = include common ola plugins olad python tools debian
|
||||
|
||||
EXTRA_DIST = README.rpm ola.spec
|
||||
|
||||
pkgconfigdir = $(libdir)/pkgconfig
|
||||
pkgconfig_DATA = libola.pc libolaserver.pc
|
||||
|
||||
ACLOCAL = aclocal -I $(auxdir)
|
||||
ACLOCAL_AMFLAGS = -I config
|
|
@ -0,0 +1,699 @@
|
|||
# Makefile.in generated by automake 1.10 from Makefile.am.
|
||||
# @configure_input@
|
||||
|
||||
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
|
||||
# 2003, 2004, 2005, 2006 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@
|
||||
pkglibdir = $(libdir)/@PACKAGE@
|
||||
pkgincludedir = $(includedir)/@PACKAGE@
|
||||
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
|
||||
install_sh_DATA = $(install_sh) -c -m 644
|
||||
install_sh_PROGRAM = $(install_sh) -c
|
||||
install_sh_SCRIPT = $(install_sh) -c
|
||||
INSTALL_HEADER = $(INSTALL_DATA)
|
||||
transform = $(program_transform_name)
|
||||
NORMAL_INSTALL = :
|
||||
PRE_INSTALL = :
|
||||
POST_INSTALL = :
|
||||
NORMAL_UNINSTALL = :
|
||||
PRE_UNINSTALL = :
|
||||
POST_UNINSTALL = :
|
||||
build_triplet = @build@
|
||||
host_triplet = @host@
|
||||
subdir = .
|
||||
DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \
|
||||
$(srcdir)/Makefile.in $(srcdir)/config.h.in \
|
||||
$(srcdir)/libola.pc.in $(srcdir)/libolaserver.pc.in \
|
||||
$(top_srcdir)/configure AUTHORS COPYING ChangeLog INSTALL NEWS \
|
||||
TODO config/config.guess config/config.sub config/depcomp \
|
||||
config/install-sh config/ltmain.sh config/missing \
|
||||
config/py-compile
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
am__aclocal_m4_deps = $(top_srcdir)/config/cppunit.m4 \
|
||||
$(top_srcdir)/config/ola.m4 $(top_srcdir)/config/pkg.m4 \
|
||||
$(top_srcdir)/configure.ac
|
||||
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
|
||||
$(ACLOCAL_M4)
|
||||
am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
|
||||
configure.lineno config.status.lineno
|
||||
mkinstalldirs = $(install_sh) -d
|
||||
CONFIG_HEADER = config.h
|
||||
CONFIG_CLEAN_FILES = libola.pc libolaserver.pc
|
||||
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
|
||||
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
|
||||
am__vpath_adj = case $$p in \
|
||||
$(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
|
||||
*) f=$$p;; \
|
||||
esac;
|
||||
am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
|
||||
am__installdirs = "$(DESTDIR)$(pkgconfigdir)"
|
||||
pkgconfigDATA_INSTALL = $(INSTALL_DATA)
|
||||
DATA = $(pkgconfig_DATA)
|
||||
RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
|
||||
distclean-recursive maintainer-clean-recursive
|
||||
ETAGS = etags
|
||||
CTAGS = ctags
|
||||
DIST_SUBDIRS = $(SUBDIRS)
|
||||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
||||
distdir = $(PACKAGE)-$(VERSION)
|
||||
top_distdir = $(distdir)
|
||||
am__remove_distdir = \
|
||||
{ test ! -d $(distdir) \
|
||||
|| { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \
|
||||
&& rm -fr $(distdir); }; }
|
||||
DIST_ARCHIVES = $(distdir).tar.gz
|
||||
GZIP_ENV = --best
|
||||
distuninstallcheck_listfiles = find . -type f -print
|
||||
distcleancheck_listfiles = find . -type f -print
|
||||
ACLOCAL = aclocal -I $(auxdir)
|
||||
AMTAR = @AMTAR@
|
||||
AR = @AR@
|
||||
AUTOCONF = @AUTOCONF@
|
||||
AUTOHEADER = @AUTOHEADER@
|
||||
AUTOMAKE = @AUTOMAKE@
|
||||
AWK = @AWK@
|
||||
CC = @CC@
|
||||
CCDEPMODE = @CCDEPMODE@
|
||||
CFLAGS = @CFLAGS@
|
||||
CPP = @CPP@
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@
|
||||
CPPUNIT_CONFIG = @CPPUNIT_CONFIG@
|
||||
CPPUNIT_LIBS = @CPPUNIT_LIBS@
|
||||
CXX = @CXX@
|
||||
CXXCPP = @CXXCPP@
|
||||
CXXDEPMODE = @CXXDEPMODE@
|
||||
CXXFLAGS = @CXXFLAGS@
|
||||
CYGPATH_W = @CYGPATH_W@
|
||||
DEFS = @DEFS@
|
||||
DEPDIR = @DEPDIR@
|
||||
ECHO = @ECHO@
|
||||
ECHO_C = @ECHO_C@
|
||||
ECHO_N = @ECHO_N@
|
||||
ECHO_T = @ECHO_T@
|
||||
EGREP = @EGREP@
|
||||
EXEEXT = @EXEEXT@
|
||||
F77 = @F77@
|
||||
FFLAGS = @FFLAGS@
|
||||
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@
|
||||
LIBTOOL = @LIBTOOL@
|
||||
LN_S = @LN_S@
|
||||
LTLIBOBJS = @LTLIBOBJS@
|
||||
MAKEINFO = @MAKEINFO@
|
||||
MICROHTTPD_LIBS = @MICROHTTPD_LIBS@
|
||||
MKDIR_P = @MKDIR_P@
|
||||
OBJEXT = @OBJEXT@
|
||||
OLAD_DEFINES = @OLAD_DEFINES@
|
||||
OLA_SERVER_LIBS = @OLA_SERVER_LIBS@
|
||||
OSSP_UUID_CFLAGS = @OSSP_UUID_CFLAGS@
|
||||
OSSP_UUID_LIBS = @OSSP_UUID_LIBS@
|
||||
PACKAGE = @PACKAGE@
|
||||
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
|
||||
PACKAGE_NAME = @PACKAGE_NAME@
|
||||
PACKAGE_STRING = @PACKAGE_STRING@
|
||||
PACKAGE_TARNAME = @PACKAGE_TARNAME@
|
||||
PACKAGE_VERSION = @PACKAGE_VERSION@
|
||||
PATH_SEPARATOR = @PATH_SEPARATOR@
|
||||
PKG_CONFIG = @PKG_CONFIG@
|
||||
PLUGIN_LIBS = @PLUGIN_LIBS@
|
||||
PROTOC = @PROTOC@
|
||||
PYTHON = @PYTHON@
|
||||
PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
|
||||
PYTHON_PLATFORM = @PYTHON_PLATFORM@
|
||||
PYTHON_PREFIX = @PYTHON_PREFIX@
|
||||
PYTHON_VERSION = @PYTHON_VERSION@
|
||||
RANLIB = @RANLIB@
|
||||
SET_MAKE = @SET_MAKE@
|
||||
SHELL = @SHELL@
|
||||
STRIP = @STRIP@
|
||||
UUID_CFLAGS = @UUID_CFLAGS@
|
||||
UUID_LIBS = @UUID_LIBS@
|
||||
VERSION = @VERSION@
|
||||
abs_builddir = @abs_builddir@
|
||||
abs_srcdir = @abs_srcdir@
|
||||
abs_top_builddir = @abs_top_builddir@
|
||||
abs_top_srcdir = @abs_top_srcdir@
|
||||
ac_aux_dir = @ac_aux_dir@
|
||||
ac_ct_CC = @ac_ct_CC@
|
||||
ac_ct_CXX = @ac_ct_CXX@
|
||||
ac_ct_F77 = @ac_ct_F77@
|
||||
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@
|
||||
libusb_CFLAGS = @libusb_CFLAGS@
|
||||
libusb_LIBS = @libusb_LIBS@
|
||||
localedir = @localedir@
|
||||
localstatedir = @localstatedir@
|
||||
mandir = @mandir@
|
||||
mkdir_p = @mkdir_p@
|
||||
oldincludedir = @oldincludedir@
|
||||
pdfdir = @pdfdir@
|
||||
pkgpyexecdir = @pkgpyexecdir@
|
||||
pkgpythondir = @pkgpythondir@
|
||||
plugindir = @plugindir@
|
||||
prefix = @prefix@
|
||||
program_transform_name = @program_transform_name@
|
||||
psdir = @psdir@
|
||||
pyexecdir = @pyexecdir@
|
||||
pythondir = @pythondir@
|
||||
sbindir = @sbindir@
|
||||
sharedstatedir = @sharedstatedir@
|
||||
srcdir = @srcdir@
|
||||
sysconfdir = @sysconfdir@
|
||||
target_alias = @target_alias@
|
||||
top_builddir = @top_builddir@
|
||||
top_srcdir = @top_srcdir@
|
||||
www_datadir = @www_datadir@
|
||||
auxdir = @ac_aux_dir@
|
||||
AUX_DIST = $(auxdir)/install-sh $(auxdir)/missing \
|
||||
$(auxdir)/mkinstalldirs
|
||||
|
||||
SUBDIRS = include common ola plugins olad python tools debian
|
||||
EXTRA_DIST = README.rpm ola.spec
|
||||
pkgconfigdir = $(libdir)/pkgconfig
|
||||
pkgconfig_DATA = libola.pc libolaserver.pc
|
||||
ACLOCAL_AMFLAGS = -I config
|
||||
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 '; \
|
||||
cd $(srcdir) && $(AUTOMAKE) --gnu \
|
||||
&& exit 0; \
|
||||
exit 1;; \
|
||||
esac; \
|
||||
done; \
|
||||
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \
|
||||
cd $(top_srcdir) && \
|
||||
$(AUTOMAKE) --gnu Makefile
|
||||
.PRECIOUS: Makefile
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||
@case '$?' in \
|
||||
*config.status*) \
|
||||
echo ' $(SHELL) ./config.status'; \
|
||||
$(SHELL) ./config.status;; \
|
||||
*) \
|
||||
echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \
|
||||
esac;
|
||||
|
||||
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
|
||||
$(SHELL) ./config.status --recheck
|
||||
|
||||
$(top_srcdir)/configure: $(am__configure_deps)
|
||||
cd $(srcdir) && $(AUTOCONF)
|
||||
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
|
||||
cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
|
||||
|
||||
config.h: stamp-h1
|
||||
@if test ! -f $@; then \
|
||||
rm -f stamp-h1; \
|
||||
$(MAKE) $(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)
|
||||
cd $(top_srcdir) && $(AUTOHEADER)
|
||||
rm -f stamp-h1
|
||||
touch $@
|
||||
|
||||
distclean-hdr:
|
||||
-rm -f config.h stamp-h1
|
||||
libola.pc: $(top_builddir)/config.status $(srcdir)/libola.pc.in
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $@
|
||||
libolaserver.pc: $(top_builddir)/config.status $(srcdir)/libolaserver.pc.in
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $@
|
||||
|
||||
mostlyclean-libtool:
|
||||
-rm -f *.lo
|
||||
|
||||
clean-libtool:
|
||||
-rm -rf .libs _libs
|
||||
|
||||
distclean-libtool:
|
||||
-rm -f libtool
|
||||
install-pkgconfigDATA: $(pkgconfig_DATA)
|
||||
@$(NORMAL_INSTALL)
|
||||
test -z "$(pkgconfigdir)" || $(MKDIR_P) "$(DESTDIR)$(pkgconfigdir)"
|
||||
@list='$(pkgconfig_DATA)'; for p in $$list; do \
|
||||
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
|
||||
f=$(am__strip_dir) \
|
||||
echo " $(pkgconfigDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(pkgconfigdir)/$$f'"; \
|
||||
$(pkgconfigDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(pkgconfigdir)/$$f"; \
|
||||
done
|
||||
|
||||
uninstall-pkgconfigDATA:
|
||||
@$(NORMAL_UNINSTALL)
|
||||
@list='$(pkgconfig_DATA)'; for p in $$list; do \
|
||||
f=$(am__strip_dir) \
|
||||
echo " rm -f '$(DESTDIR)$(pkgconfigdir)/$$f'"; \
|
||||
rm -f "$(DESTDIR)$(pkgconfigdir)/$$f"; \
|
||||
done
|
||||
|
||||
# This directory's subdirectories are mostly independent; you can cd
|
||||
# into them and run `make' without going through this Makefile.
|
||||
# To change the values of `make' variables: instead of editing Makefiles,
|
||||
# (1) if the variable is set in `config.status', edit `config.status'
|
||||
# (which will cause the Makefiles to be regenerated when you run `make');
|
||||
# (2) otherwise, pass the desired values on the `make' command line.
|
||||
$(RECURSIVE_TARGETS):
|
||||
@failcom='exit 1'; \
|
||||
for f in x $$MAKEFLAGS; do \
|
||||
case $$f in \
|
||||
*=* | --[!k]*);; \
|
||||
*k*) failcom='fail=yes';; \
|
||||
esac; \
|
||||
done; \
|
||||
dot_seen=no; \
|
||||
target=`echo $@ | sed s/-recursive//`; \
|
||||
list='$(SUBDIRS)'; for subdir in $$list; do \
|
||||
echo "Making $$target in $$subdir"; \
|
||||
if test "$$subdir" = "."; then \
|
||||
dot_seen=yes; \
|
||||
local_target="$$target-am"; \
|
||||
else \
|
||||
local_target="$$target"; \
|
||||
fi; \
|
||||
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|
||||
|| eval $$failcom; \
|
||||
done; \
|
||||
if test "$$dot_seen" = "no"; then \
|
||||
$(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
|
||||
fi; test -z "$$fail"
|
||||
|
||||
$(RECURSIVE_CLEAN_TARGETS):
|
||||
@failcom='exit 1'; \
|
||||
for f in x $$MAKEFLAGS; do \
|
||||
case $$f in \
|
||||
*=* | --[!k]*);; \
|
||||
*k*) failcom='fail=yes';; \
|
||||
esac; \
|
||||
done; \
|
||||
dot_seen=no; \
|
||||
case "$@" in \
|
||||
distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
|
||||
*) list='$(SUBDIRS)' ;; \
|
||||
esac; \
|
||||
rev=''; for subdir in $$list; do \
|
||||
if test "$$subdir" = "."; then :; else \
|
||||
rev="$$subdir $$rev"; \
|
||||
fi; \
|
||||
done; \
|
||||
rev="$$rev ."; \
|
||||
target=`echo $@ | sed s/-recursive//`; \
|
||||
for subdir in $$rev; do \
|
||||
echo "Making $$target in $$subdir"; \
|
||||
if test "$$subdir" = "."; then \
|
||||
local_target="$$target-am"; \
|
||||
else \
|
||||
local_target="$$target"; \
|
||||
fi; \
|
||||
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|
||||
|| eval $$failcom; \
|
||||
done && test -z "$$fail"
|
||||
tags-recursive:
|
||||
list='$(SUBDIRS)'; for subdir in $$list; do \
|
||||
test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
|
||||
done
|
||||
ctags-recursive:
|
||||
list='$(SUBDIRS)'; for subdir in $$list; do \
|
||||
test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
|
||||
done
|
||||
|
||||
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) ' { files[$$0] = 1; } \
|
||||
END { for (i in files) print i; }'`; \
|
||||
mkid -fID $$unique
|
||||
tags: TAGS
|
||||
|
||||
TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
|
||||
$(TAGS_FILES) $(LISP)
|
||||
tags=; \
|
||||
here=`pwd`; \
|
||||
if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
|
||||
include_option=--etags-include; \
|
||||
empty_fix=.; \
|
||||
else \
|
||||
include_option=--include; \
|
||||
empty_fix=; \
|
||||
fi; \
|
||||
list='$(SUBDIRS)'; for subdir in $$list; do \
|
||||
if test "$$subdir" = .; then :; else \
|
||||
test ! -f $$subdir/TAGS || \
|
||||
tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
|
||||
fi; \
|
||||
done; \
|
||||
list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) ' { files[$$0] = 1; } \
|
||||
END { for (i in files) print i; }'`; \
|
||||
if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
|
||||
test -n "$$unique" || unique=$$empty_fix; \
|
||||
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
|
||||
$$tags $$unique; \
|
||||
fi
|
||||
ctags: CTAGS
|
||||
CTAGS: ctags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
|
||||
$(TAGS_FILES) $(LISP)
|
||||
tags=; \
|
||||
here=`pwd`; \
|
||||
list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) ' { files[$$0] = 1; } \
|
||||
END { for (i in files) print i; }'`; \
|
||||
test -z "$(CTAGS_ARGS)$$tags$$unique" \
|
||||
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
|
||||
$$tags $$unique
|
||||
|
||||
GTAGS:
|
||||
here=`$(am__cd) $(top_builddir) && pwd` \
|
||||
&& cd $(top_srcdir) \
|
||||
&& gtags -i $(GTAGS_ARGS) $$here
|
||||
|
||||
distclean-tags:
|
||||
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
|
||||
|
||||
distdir: $(DISTFILES)
|
||||
$(am__remove_distdir)
|
||||
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 $(srcdir)/$$file && test $$d != $(srcdir); then \
|
||||
cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
|
||||
fi; \
|
||||
cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
|
||||
else \
|
||||
test -f $(distdir)/$$file \
|
||||
|| cp -p $$d/$$file $(distdir)/$$file \
|
||||
|| exit 1; \
|
||||
fi; \
|
||||
done
|
||||
list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
|
||||
if test "$$subdir" = .; then :; else \
|
||||
test -d "$(distdir)/$$subdir" \
|
||||
|| $(MKDIR_P) "$(distdir)/$$subdir" \
|
||||
|| exit 1; \
|
||||
distdir=`$(am__cd) $(distdir) && pwd`; \
|
||||
top_distdir=`$(am__cd) $(top_distdir) && pwd`; \
|
||||
(cd $$subdir && \
|
||||
$(MAKE) $(AM_MAKEFLAGS) \
|
||||
top_distdir="$$top_distdir" \
|
||||
distdir="$$distdir/$$subdir" \
|
||||
am__remove_distdir=: \
|
||||
am__skip_length_check=: \
|
||||
distdir) \
|
||||
|| exit 1; \
|
||||
fi; \
|
||||
done
|
||||
-find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \
|
||||
! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
|
||||
! -type d ! -perm -400 -exec chmod a+r {} \; -o \
|
||||
! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \
|
||||
|| chmod -R a+r $(distdir)
|
||||
dist-gzip: distdir
|
||||
tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
|
||||
$(am__remove_distdir)
|
||||
|
||||
dist-bzip2: distdir
|
||||
tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2
|
||||
$(am__remove_distdir)
|
||||
|
||||
dist-tarZ: distdir
|
||||
tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
|
||||
$(am__remove_distdir)
|
||||
|
||||
dist-shar: distdir
|
||||
shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
|
||||
$(am__remove_distdir)
|
||||
|
||||
dist-zip: distdir
|
||||
-rm -f $(distdir).zip
|
||||
zip -rq $(distdir).zip $(distdir)
|
||||
$(am__remove_distdir)
|
||||
|
||||
dist dist-all: distdir
|
||||
tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
|
||||
$(am__remove_distdir)
|
||||
|
||||
# This target untars the dist file and tries a VPATH configuration. Then
|
||||
# it guarantees that the distribution is self-contained by making another
|
||||
# tarfile.
|
||||
distcheck: dist
|
||||
case '$(DIST_ARCHIVES)' in \
|
||||
*.tar.gz*) \
|
||||
GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(am__untar) ;;\
|
||||
*.tar.bz2*) \
|
||||
bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\
|
||||
*.tar.Z*) \
|
||||
uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
|
||||
*.shar.gz*) \
|
||||
GZIP=$(GZIP_ENV) gunzip -c $(distdir).shar.gz | unshar ;;\
|
||||
*.zip*) \
|
||||
unzip $(distdir).zip ;;\
|
||||
esac
|
||||
chmod -R a-w $(distdir); chmod a+w $(distdir)
|
||||
mkdir $(distdir)/_build
|
||||
mkdir $(distdir)/_inst
|
||||
chmod a-w $(distdir)
|
||||
dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
|
||||
&& dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
|
||||
&& cd $(distdir)/_build \
|
||||
&& ../configure --srcdir=.. --prefix="$$dc_install_base" \
|
||||
$(DISTCHECK_CONFIGURE_FLAGS) \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) dvi \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) check \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) install \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) installcheck \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) uninstall \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \
|
||||
distuninstallcheck \
|
||||
&& chmod -R a-w "$$dc_install_base" \
|
||||
&& ({ \
|
||||
(cd ../.. && umask 077 && mkdir "$$dc_destdir") \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \
|
||||
distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \
|
||||
} || { rm -rf "$$dc_destdir"; exit 1; }) \
|
||||
&& rm -rf "$$dc_destdir" \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) dist \
|
||||
&& rm -rf $(DIST_ARCHIVES) \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) distcleancheck
|
||||
$(am__remove_distdir)
|
||||
@(echo "$(distdir) archives ready for distribution: "; \
|
||||
list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \
|
||||
sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x'
|
||||
distuninstallcheck:
|
||||
@cd $(distuninstallcheck_dir) \
|
||||
&& test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \
|
||||
|| { echo "ERROR: files left after uninstall:" ; \
|
||||
if test -n "$(DESTDIR)"; then \
|
||||
echo " (check DESTDIR support)"; \
|
||||
fi ; \
|
||||
$(distuninstallcheck_listfiles) ; \
|
||||
exit 1; } >&2
|
||||
distcleancheck: distclean
|
||||
@if test '$(srcdir)' = . ; then \
|
||||
echo "ERROR: distcleancheck can only run from a VPATH build" ; \
|
||||
exit 1 ; \
|
||||
fi
|
||||
@test `$(distcleancheck_listfiles) | wc -l` -eq 0 \
|
||||
|| { echo "ERROR: files left in build directory after distclean:" ; \
|
||||
$(distcleancheck_listfiles) ; \
|
||||
exit 1; } >&2
|
||||
check-am: all-am
|
||||
check: check-recursive
|
||||
all-am: Makefile $(DATA) config.h
|
||||
installdirs: installdirs-recursive
|
||||
installdirs-am:
|
||||
for dir in "$(DESTDIR)$(pkgconfigdir)"; do \
|
||||
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
|
||||
done
|
||||
install: install-recursive
|
||||
install-exec: install-exec-recursive
|
||||
install-data: install-data-recursive
|
||||
uninstall: uninstall-recursive
|
||||
|
||||
install-am: all-am
|
||||
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
|
||||
|
||||
installcheck: installcheck-recursive
|
||||
install-strip:
|
||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
||||
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
|
||||
`test -z '$(STRIP)' || \
|
||||
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
|
||||
mostlyclean-generic:
|
||||
|
||||
clean-generic:
|
||||
|
||||
distclean-generic:
|
||||
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
|
||||
|
||||
maintainer-clean-generic:
|
||||
@echo "This command is intended for maintainers to use"
|
||||
@echo "it deletes files that may require special tools to rebuild."
|
||||
clean: clean-recursive
|
||||
|
||||
clean-am: clean-generic clean-libtool mostlyclean-am
|
||||
|
||||
distclean: distclean-recursive
|
||||
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
|
||||
-rm -f Makefile
|
||||
distclean-am: clean-am distclean-generic distclean-hdr \
|
||||
distclean-libtool distclean-tags
|
||||
|
||||
dvi: dvi-recursive
|
||||
|
||||
dvi-am:
|
||||
|
||||
html: html-recursive
|
||||
|
||||
info: info-recursive
|
||||
|
||||
info-am:
|
||||
|
||||
install-data-am: install-pkgconfigDATA
|
||||
|
||||
install-dvi: install-dvi-recursive
|
||||
|
||||
install-exec-am:
|
||||
|
||||
install-html: install-html-recursive
|
||||
|
||||
install-info: install-info-recursive
|
||||
|
||||
install-man:
|
||||
|
||||
install-pdf: install-pdf-recursive
|
||||
|
||||
install-ps: install-ps-recursive
|
||||
|
||||
installcheck-am:
|
||||
|
||||
maintainer-clean: maintainer-clean-recursive
|
||||
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
|
||||
-rm -rf $(top_srcdir)/autom4te.cache
|
||||
-rm -f Makefile
|
||||
maintainer-clean-am: distclean-am maintainer-clean-generic
|
||||
|
||||
mostlyclean: mostlyclean-recursive
|
||||
|
||||
mostlyclean-am: mostlyclean-generic mostlyclean-libtool
|
||||
|
||||
pdf: pdf-recursive
|
||||
|
||||
pdf-am:
|
||||
|
||||
ps: ps-recursive
|
||||
|
||||
ps-am:
|
||||
|
||||
uninstall-am: uninstall-pkgconfigDATA
|
||||
|
||||
.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) install-am \
|
||||
install-strip
|
||||
|
||||
.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
|
||||
all all-am am--refresh check check-am clean clean-generic \
|
||||
clean-libtool ctags ctags-recursive dist dist-all dist-bzip2 \
|
||||
dist-gzip dist-shar dist-tarZ dist-zip distcheck distclean \
|
||||
distclean-generic distclean-hdr distclean-libtool \
|
||||
distclean-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-pkgconfigDATA install-ps install-ps-am \
|
||||
install-strip installcheck installcheck-am installdirs \
|
||||
installdirs-am maintainer-clean maintainer-clean-generic \
|
||||
mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \
|
||||
ps ps-am tags tags-recursive uninstall uninstall-am \
|
||||
uninstall-pkgconfigDATA
|
||||
|
||||
# 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:
|
|
@ -0,0 +1,130 @@
|
|||
19/10/2010 ola-0.8.4
|
||||
Add the RDM web UI
|
||||
Work around an ArtNet RDM bug
|
||||
Handle ACK overflow in the DMX-TRI
|
||||
|
||||
23/9/2010 ola-0.8.3
|
||||
Add Manufacturer / Device name resolution to the web UI for RDM devices.
|
||||
Fix a couple of compile bugs.
|
||||
For each DMX-over-IP plugin, display the bound IP address in the device name.
|
||||
Change the DMX console to send a packet every second even if nothing changes.
|
||||
Fix a memory leak in the RDM controller
|
||||
|
||||
19/9/2010 ola-0.8.2
|
||||
Moved the DMX Console to the new UI
|
||||
Removed the old web UI, no more requirements for ctemplate
|
||||
Added ACK_OVERFLOW support for RDM over ArtNet
|
||||
Added Support for the last remaining E1.20 PIDS
|
||||
Re-factored the Ola Client code to fix the problem of de-multiplexing
|
||||
responses.
|
||||
Add the OlaCallbackClient as the recommended C++ API
|
||||
Moved the HTTP Server to using the OlaCallbackClient directly.
|
||||
|
||||
2/9/2010 ola-0.8.1
|
||||
New web UI
|
||||
Fixed some bugs in the device shutdown code
|
||||
Fixed some compiler warnings with gcc 4.4
|
||||
|
||||
7/8/2010 ola-0.8.0
|
||||
Initial RDM support for the ArtNet, Dummy & DMX-TRI devices
|
||||
New ArtNet stack to support RDM - no more dependency on libartnet
|
||||
Support for packetheads DMX dongle
|
||||
Make the FPS limit for USB Pro devices configurable
|
||||
|
||||
20/5/2010 ola-0.7.4
|
||||
Fixed the python API
|
||||
Fixed the client deadlock issue
|
||||
Fixed the USBDMX2 firmware loading
|
||||
Fixed ARM alignment bug in E1.31
|
||||
Fixed ambiguous errors when plugins were disabled
|
||||
Added the /reload handler the reload plugins
|
||||
Turn off SIGPIPEs
|
||||
Clean up the streaming client API
|
||||
Use the serial number to identify uDMX devices
|
||||
|
||||
18/4/2010 ola-0.7.2 / 0.7.3
|
||||
Added support for the Velleman 8062
|
||||
Added support for the uDMX
|
||||
Added support for the USBDMX2
|
||||
Added support for the DMXKing
|
||||
Fixed a crash if olad was started while another instance was running
|
||||
Random build fixes
|
||||
|
||||
27/3/2010 ola-0.7.1
|
||||
Implemented the Usb Protocol Extensions
|
||||
Added output rate throttling for the Usb Pro devices
|
||||
Added the streaming DMX client
|
||||
Fixed some uuid detection issues
|
||||
Made the server more resistant to bad clients
|
||||
./configure script fixes
|
||||
|
||||
28/2/2010 ola-0.7.0
|
||||
Added E1.31 merging & sequencing support
|
||||
Improved USB Pro handling
|
||||
Added port priorities & multi source merging
|
||||
TX support for the DMX-TRI
|
||||
Support for the Ardiuno RGB Mixer
|
||||
DSCP for E1.31
|
||||
Support for using the OSSP uuid library
|
||||
Removal of run-time loadable plugins.
|
||||
|
||||
10/1/2010 ola-0.6.0
|
||||
Added Pathport support
|
||||
Added support for the final version of the E1.31 Standard
|
||||
Changed to link time plugins rather than run time (required for win32 port)
|
||||
Cleanup of the dmx4linux plugin (thanks to Bastien)
|
||||
Linted almost everything
|
||||
Many more export map variables
|
||||
Restructure of the Port class internals
|
||||
|
||||
21/11/2009 ola-0.5.0
|
||||
Added Sandnet Support
|
||||
Added automatic USB Pro device detection
|
||||
Fixed a HTP merging bug
|
||||
|
||||
18/10/2009 ola-0.4.0
|
||||
Added E1.13 Support
|
||||
|
||||
26/8/2009 ola-0.3.1
|
||||
Fixed the open dmx usb off by one bug
|
||||
Minor build tool fixes
|
||||
|
||||
8/8/2009 ola-0.3.0
|
||||
Changed the name of the project to Open Lighting Architecture
|
||||
Major rewrite
|
||||
- added export_map
|
||||
- added http server & web interface
|
||||
- added web dmx console
|
||||
- now works on mac
|
||||
- converted to using protocol buffers
|
||||
- supports embedding
|
||||
- port patches persist across restarts
|
||||
- plenty of unittests (more required)
|
||||
|
||||
14/10/2007 lla-0.2.3
|
||||
Plugins can now be disabled from the config files
|
||||
|
||||
14/9/2007 lla-0.2.2
|
||||
Fixed a bug with the DMX USB Pro
|
||||
Refinements to the StageProfi plugin
|
||||
|
||||
1/1/2007 lla-0.2.1
|
||||
Added support for the Stage Profi widget
|
||||
Added Pathport support
|
||||
|
||||
1/1/2007 lla-0.2.0
|
||||
Added Sandnet Support
|
||||
Added Open DMX USB Support
|
||||
Re-write of the client library
|
||||
Added universe merge modes
|
||||
Added persistent universe names and merge modes
|
||||
Added device config messages
|
||||
|
||||
27/4/2006 lla-0.1.3
|
||||
Bugfixes
|
||||
|
||||
17/4/2006 lla-0.1.2
|
||||
Support for multiple Enttec Pro devices
|
||||
Logging levels can be changed with -USR1 signals
|
||||
|
||||
|
|
@ -0,0 +1,51 @@
|
|||
Open Lighting Architecture - OLA
|
||||
===============================================================================
|
||||
|
||||
OLA consists of three parts, the daemon olad, the olad plugins and the client
|
||||
library, libola.
|
||||
|
||||
For documentation on OLA, including examples on how to get started please see
|
||||
http://www.opendmx.net/index.php/OLA
|
||||
|
||||
|
||||
Plugins
|
||||
------------------------------------------------------------------------------
|
||||
|
||||
Are located in ./plugins. To create a new plugin you'll need to subclass the
|
||||
Plugin, Device and Port classes. See any of the current plugins for an example.
|
||||
|
||||
|
||||
C++ Library
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
Is located in ./ola . You'll want to create a new OlaClient and call start().
|
||||
To do anything useful you'll need to subclass OlaClientObserver and implement
|
||||
some of the methods.
|
||||
|
||||
If you have pthreads installed this library *should* be thread safe (currently
|
||||
implemented with one big lock).
|
||||
|
||||
|
||||
Libraries in Other Languages (Python)
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
There are experimental Python libraries you can build by running configure with
|
||||
--enable-python-libs. For examples see the tests directory.
|
||||
|
||||
The python library seems to be working well. Perl isn't supported as the
|
||||
current version of SWIG doesn't support Perl directors.
|
||||
|
||||
|
||||
Credits
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
Thanks to the following people/organisations:
|
||||
|
||||
- Wayne and Simon from Artistic Licence for providing a Net-Lynx
|
||||
- Nic from Enttec who provided a DMX USB Pro for testing.
|
||||
- West Australian Academy of Performing Arts (WAAPA) for access to a Strand
|
||||
console.
|
||||
- Shaun Jackman from Pathway, for answering my questions about the Pathport
|
||||
protocol
|
||||
- Florian from eventa.ag who donated a StageProfi and a USBDMX2
|
||||
- Hamish Dumbreck for jese.co.uk who donated a DMX-TRI
|
|
@ -0,0 +1,34 @@
|
|||
Instructions on how to build a RPM for Mandriva, this may work with other RPM
|
||||
based distros.
|
||||
|
||||
1. Install RPM build tools:
|
||||
$ urpmi rpm-build libtool spec-helper
|
||||
|
||||
2. Create the build environment:
|
||||
$ mkdir -p ~/rpm/{BUILD,RPMS/{i586,noarch,x86_64},SOURCES,SRPMS,SPECS,tmp}
|
||||
|
||||
3. Either download the latest tarball, or if you want to build a RPM from the
|
||||
git repo:
|
||||
$ cd /tmp
|
||||
$ urpmi git
|
||||
$ git clone http://www.nomis52.net/git/lla
|
||||
$ cd lla
|
||||
$ autoreconf -i -f && ./configure && make dist
|
||||
$ cp ola-X.Y.Z.tar.gz ~/rpm/SOURCES/
|
||||
|
||||
4. Add Kev's repository to get latest libmicrohttpd and protobuf
|
||||
(here for 64bits Mandriva 2009.1):
|
||||
$ urpmi.addmedia --update kev-rpms \
|
||||
http://kev.coolcavemen.com/static/repository/mandriva/2009.1/x86_64
|
||||
|
||||
For more details, see http://kev.coolcavemen.com/mandriva-rpm-repository/
|
||||
|
||||
5. Install requires build dependencies of ola:
|
||||
$ urpmi libmicrohttpd-devel libcppunit-devel protobuf-devel
|
||||
|
||||
6. Build ola from the spec file:
|
||||
$ cd ~/rpm/SPECS/
|
||||
$ cp /tmp/lla/ola/spec ./
|
||||
$ rpmbuild -ba ./ola.spec
|
||||
|
||||
7. Et voila ! Your RPM is in ~/rpm/SPECS/<my_arch>/ !
|
|
@ -0,0 +1,20 @@
|
|||
|
||||
See http://code.google.com/p/linux-lighting/issues/list
|
||||
|
||||
--URGENT--
|
||||
resend DMX on idle (artnet every 4s)
|
||||
|
||||
--REQUIRED--
|
||||
|
||||
* allow for finer grained channel control (set_block, set_channel)
|
||||
* regression tests for plugins
|
||||
|
||||
--WISH LIST--
|
||||
|
||||
* consider using filters:
|
||||
o split dmx to different universes OUT = SPLIT(1,0,255)
|
||||
o invert channels OUT = INV(1)
|
||||
o different merge modes OUT = HTP(1,2)
|
||||
o change offset / map OUT = OFFSET(1, +50)
|
||||
o scaler (OUT = SCALE(1, %40) )
|
||||
o clip (OUT = CLIP(1,%80) )
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1 @@
|
|||
AM_CPPFLAGS = -I$(top_builddir)/include -Wall -Wformat -W -Werror -Wno-deprecated
|
|
@ -0,0 +1,11 @@
|
|||
lib_LTLIBRARIES = libolacommon.la
|
||||
libolacommon_la_SOURCES =
|
||||
libolacommon_la_LIBADD = export_map/libolaexportmap.la \
|
||||
logging/liblogging.la \
|
||||
protocol/libolaproto.la \
|
||||
rdm/libolardm.la \
|
||||
rpc/libstreamrpcchannel.la \
|
||||
network/libolanetwork.la \
|
||||
utils/libolautils.la
|
||||
|
||||
SUBDIRS = export_map logging protocol rdm rpc network utils web
|
|
@ -0,0 +1,587 @@
|
|||
# Makefile.in generated by automake 1.10 from Makefile.am.
|
||||
# @configure_input@
|
||||
|
||||
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
|
||||
# 2003, 2004, 2005, 2006 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@
|
||||
pkglibdir = $(libdir)/@PACKAGE@
|
||||
pkgincludedir = $(includedir)/@PACKAGE@
|
||||
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
|
||||
install_sh_DATA = $(install_sh) -c -m 644
|
||||
install_sh_PROGRAM = $(install_sh) -c
|
||||
install_sh_SCRIPT = $(install_sh) -c
|
||||
INSTALL_HEADER = $(INSTALL_DATA)
|
||||
transform = $(program_transform_name)
|
||||
NORMAL_INSTALL = :
|
||||
PRE_INSTALL = :
|
||||
POST_INSTALL = :
|
||||
NORMAL_UNINSTALL = :
|
||||
PRE_UNINSTALL = :
|
||||
POST_UNINSTALL = :
|
||||
build_triplet = @build@
|
||||
host_triplet = @host@
|
||||
subdir = common
|
||||
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
am__aclocal_m4_deps = $(top_srcdir)/config/cppunit.m4 \
|
||||
$(top_srcdir)/config/ola.m4 $(top_srcdir)/config/pkg.m4 \
|
||||
$(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 =
|
||||
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
|
||||
am__vpath_adj = case $$p in \
|
||||
$(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
|
||||
*) f=$$p;; \
|
||||
esac;
|
||||
am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
|
||||
am__installdirs = "$(DESTDIR)$(libdir)"
|
||||
libLTLIBRARIES_INSTALL = $(INSTALL)
|
||||
LTLIBRARIES = $(lib_LTLIBRARIES)
|
||||
libolacommon_la_DEPENDENCIES = export_map/libolaexportmap.la \
|
||||
logging/liblogging.la protocol/libolaproto.la rdm/libolardm.la \
|
||||
rpc/libstreamrpcchannel.la network/libolanetwork.la \
|
||||
utils/libolautils.la
|
||||
am_libolacommon_la_OBJECTS =
|
||||
libolacommon_la_OBJECTS = $(am_libolacommon_la_OBJECTS)
|
||||
DEFAULT_INCLUDES = -I. -I$(top_builddir)@am__isrc@
|
||||
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
|
||||
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
|
||||
LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
|
||||
--mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
|
||||
$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
|
||||
CCLD = $(CC)
|
||||
LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
|
||||
--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
|
||||
$(LDFLAGS) -o $@
|
||||
SOURCES = $(libolacommon_la_SOURCES)
|
||||
DIST_SOURCES = $(libolacommon_la_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
|
||||
ETAGS = etags
|
||||
CTAGS = ctags
|
||||
DIST_SUBDIRS = $(SUBDIRS)
|
||||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
||||
ACLOCAL = @ACLOCAL@
|
||||
AMTAR = @AMTAR@
|
||||
AR = @AR@
|
||||
AUTOCONF = @AUTOCONF@
|
||||
AUTOHEADER = @AUTOHEADER@
|
||||
AUTOMAKE = @AUTOMAKE@
|
||||
AWK = @AWK@
|
||||
CC = @CC@
|
||||
CCDEPMODE = @CCDEPMODE@
|
||||
CFLAGS = @CFLAGS@
|
||||
CPP = @CPP@
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@
|
||||
CPPUNIT_CONFIG = @CPPUNIT_CONFIG@
|
||||
CPPUNIT_LIBS = @CPPUNIT_LIBS@
|
||||
CXX = @CXX@
|
||||
CXXCPP = @CXXCPP@
|
||||
CXXDEPMODE = @CXXDEPMODE@
|
||||
CXXFLAGS = @CXXFLAGS@
|
||||
CYGPATH_W = @CYGPATH_W@
|
||||
DEFS = @DEFS@
|
||||
DEPDIR = @DEPDIR@
|
||||
ECHO = @ECHO@
|
||||
ECHO_C = @ECHO_C@
|
||||
ECHO_N = @ECHO_N@
|
||||
ECHO_T = @ECHO_T@
|
||||
EGREP = @EGREP@
|
||||
EXEEXT = @EXEEXT@
|
||||
F77 = @F77@
|
||||
FFLAGS = @FFLAGS@
|
||||
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@
|
||||
LIBTOOL = @LIBTOOL@
|
||||
LN_S = @LN_S@
|
||||
LTLIBOBJS = @LTLIBOBJS@
|
||||
MAKEINFO = @MAKEINFO@
|
||||
MICROHTTPD_LIBS = @MICROHTTPD_LIBS@
|
||||
MKDIR_P = @MKDIR_P@
|
||||
OBJEXT = @OBJEXT@
|
||||
OLAD_DEFINES = @OLAD_DEFINES@
|
||||
OLA_SERVER_LIBS = @OLA_SERVER_LIBS@
|
||||
OSSP_UUID_CFLAGS = @OSSP_UUID_CFLAGS@
|
||||
OSSP_UUID_LIBS = @OSSP_UUID_LIBS@
|
||||
PACKAGE = @PACKAGE@
|
||||
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
|
||||
PACKAGE_NAME = @PACKAGE_NAME@
|
||||
PACKAGE_STRING = @PACKAGE_STRING@
|
||||
PACKAGE_TARNAME = @PACKAGE_TARNAME@
|
||||
PACKAGE_VERSION = @PACKAGE_VERSION@
|
||||
PATH_SEPARATOR = @PATH_SEPARATOR@
|
||||
PKG_CONFIG = @PKG_CONFIG@
|
||||
PLUGIN_LIBS = @PLUGIN_LIBS@
|
||||
PROTOC = @PROTOC@
|
||||
PYTHON = @PYTHON@
|
||||
PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
|
||||
PYTHON_PLATFORM = @PYTHON_PLATFORM@
|
||||
PYTHON_PREFIX = @PYTHON_PREFIX@
|
||||
PYTHON_VERSION = @PYTHON_VERSION@
|
||||
RANLIB = @RANLIB@
|
||||
SET_MAKE = @SET_MAKE@
|
||||
SHELL = @SHELL@
|
||||
STRIP = @STRIP@
|
||||
UUID_CFLAGS = @UUID_CFLAGS@
|
||||
UUID_LIBS = @UUID_LIBS@
|
||||
VERSION = @VERSION@
|
||||
abs_builddir = @abs_builddir@
|
||||
abs_srcdir = @abs_srcdir@
|
||||
abs_top_builddir = @abs_top_builddir@
|
||||
abs_top_srcdir = @abs_top_srcdir@
|
||||
ac_aux_dir = @ac_aux_dir@
|
||||
ac_ct_CC = @ac_ct_CC@
|
||||
ac_ct_CXX = @ac_ct_CXX@
|
||||
ac_ct_F77 = @ac_ct_F77@
|
||||
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@
|
||||
libusb_CFLAGS = @libusb_CFLAGS@
|
||||
libusb_LIBS = @libusb_LIBS@
|
||||
localedir = @localedir@
|
||||
localstatedir = @localstatedir@
|
||||
mandir = @mandir@
|
||||
mkdir_p = @mkdir_p@
|
||||
oldincludedir = @oldincludedir@
|
||||
pdfdir = @pdfdir@
|
||||
pkgpyexecdir = @pkgpyexecdir@
|
||||
pkgpythondir = @pkgpythondir@
|
||||
plugindir = @plugindir@
|
||||
prefix = @prefix@
|
||||
program_transform_name = @program_transform_name@
|
||||
psdir = @psdir@
|
||||
pyexecdir = @pyexecdir@
|
||||
pythondir = @pythondir@
|
||||
sbindir = @sbindir@
|
||||
sharedstatedir = @sharedstatedir@
|
||||
srcdir = @srcdir@
|
||||
sysconfdir = @sysconfdir@
|
||||
target_alias = @target_alias@
|
||||
top_builddir = @top_builddir@
|
||||
top_srcdir = @top_srcdir@
|
||||
www_datadir = @www_datadir@
|
||||
lib_LTLIBRARIES = libolacommon.la
|
||||
libolacommon_la_SOURCES =
|
||||
libolacommon_la_LIBADD = export_map/libolaexportmap.la \
|
||||
logging/liblogging.la \
|
||||
protocol/libolaproto.la \
|
||||
rdm/libolardm.la \
|
||||
rpc/libstreamrpcchannel.la \
|
||||
network/libolanetwork.la \
|
||||
utils/libolautils.la
|
||||
|
||||
SUBDIRS = export_map logging protocol rdm rpc network utils web
|
||||
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 \
|
||||
&& exit 0; \
|
||||
exit 1;; \
|
||||
esac; \
|
||||
done; \
|
||||
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu common/Makefile'; \
|
||||
cd $(top_srcdir) && \
|
||||
$(AUTOMAKE) --gnu common/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
|
||||
install-libLTLIBRARIES: $(lib_LTLIBRARIES)
|
||||
@$(NORMAL_INSTALL)
|
||||
test -z "$(libdir)" || $(MKDIR_P) "$(DESTDIR)$(libdir)"
|
||||
@list='$(lib_LTLIBRARIES)'; for p in $$list; do \
|
||||
if test -f $$p; then \
|
||||
f=$(am__strip_dir) \
|
||||
echo " $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(libdir)/$$f'"; \
|
||||
$(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(libdir)/$$f"; \
|
||||
else :; fi; \
|
||||
done
|
||||
|
||||
uninstall-libLTLIBRARIES:
|
||||
@$(NORMAL_UNINSTALL)
|
||||
@list='$(lib_LTLIBRARIES)'; for p in $$list; do \
|
||||
p=$(am__strip_dir) \
|
||||
echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$p'"; \
|
||||
$(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$p"; \
|
||||
done
|
||||
|
||||
clean-libLTLIBRARIES:
|
||||
-test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES)
|
||||
@list='$(lib_LTLIBRARIES)'; for p in $$list; do \
|
||||
dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
|
||||
test "$$dir" != "$$p" || dir=.; \
|
||||
echo "rm -f \"$${dir}/so_locations\""; \
|
||||
rm -f "$${dir}/so_locations"; \
|
||||
done
|
||||
libolacommon.la: $(libolacommon_la_OBJECTS) $(libolacommon_la_DEPENDENCIES)
|
||||
$(LINK) -rpath $(libdir) $(libolacommon_la_OBJECTS) $(libolacommon_la_LIBADD) $(LIBS)
|
||||
|
||||
mostlyclean-compile:
|
||||
-rm -f *.$(OBJEXT)
|
||||
|
||||
distclean-compile:
|
||||
-rm -f *.tab.c
|
||||
|
||||
mostlyclean-libtool:
|
||||
-rm -f *.lo
|
||||
|
||||
clean-libtool:
|
||||
-rm -rf .libs _libs
|
||||
|
||||
# This directory's subdirectories are mostly independent; you can cd
|
||||
# into them and run `make' without going through this Makefile.
|
||||
# To change the values of `make' variables: instead of editing Makefiles,
|
||||
# (1) if the variable is set in `config.status', edit `config.status'
|
||||
# (which will cause the Makefiles to be regenerated when you run `make');
|
||||
# (2) otherwise, pass the desired values on the `make' command line.
|
||||
$(RECURSIVE_TARGETS):
|
||||
@failcom='exit 1'; \
|
||||
for f in x $$MAKEFLAGS; do \
|
||||
case $$f in \
|
||||
*=* | --[!k]*);; \
|
||||
*k*) failcom='fail=yes';; \
|
||||
esac; \
|
||||
done; \
|
||||
dot_seen=no; \
|
||||
target=`echo $@ | sed s/-recursive//`; \
|
||||
list='$(SUBDIRS)'; for subdir in $$list; do \
|
||||
echo "Making $$target in $$subdir"; \
|
||||
if test "$$subdir" = "."; then \
|
||||
dot_seen=yes; \
|
||||
local_target="$$target-am"; \
|
||||
else \
|
||||
local_target="$$target"; \
|
||||
fi; \
|
||||
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|
||||
|| eval $$failcom; \
|
||||
done; \
|
||||
if test "$$dot_seen" = "no"; then \
|
||||
$(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
|
||||
fi; test -z "$$fail"
|
||||
|
||||
$(RECURSIVE_CLEAN_TARGETS):
|
||||
@failcom='exit 1'; \
|
||||
for f in x $$MAKEFLAGS; do \
|
||||
case $$f in \
|
||||
*=* | --[!k]*);; \
|
||||
*k*) failcom='fail=yes';; \
|
||||
esac; \
|
||||
done; \
|
||||
dot_seen=no; \
|
||||
case "$@" in \
|
||||
distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
|
||||
*) list='$(SUBDIRS)' ;; \
|
||||
esac; \
|
||||
rev=''; for subdir in $$list; do \
|
||||
if test "$$subdir" = "."; then :; else \
|
||||
rev="$$subdir $$rev"; \
|
||||
fi; \
|
||||
done; \
|
||||
rev="$$rev ."; \
|
||||
target=`echo $@ | sed s/-recursive//`; \
|
||||
for subdir in $$rev; do \
|
||||
echo "Making $$target in $$subdir"; \
|
||||
if test "$$subdir" = "."; then \
|
||||
local_target="$$target-am"; \
|
||||
else \
|
||||
local_target="$$target"; \
|
||||
fi; \
|
||||
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|
||||
|| eval $$failcom; \
|
||||
done && test -z "$$fail"
|
||||
tags-recursive:
|
||||
list='$(SUBDIRS)'; for subdir in $$list; do \
|
||||
test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
|
||||
done
|
||||
ctags-recursive:
|
||||
list='$(SUBDIRS)'; for subdir in $$list; do \
|
||||
test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
|
||||
done
|
||||
|
||||
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) ' { files[$$0] = 1; } \
|
||||
END { for (i in files) print i; }'`; \
|
||||
mkid -fID $$unique
|
||||
tags: TAGS
|
||||
|
||||
TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
|
||||
$(TAGS_FILES) $(LISP)
|
||||
tags=; \
|
||||
here=`pwd`; \
|
||||
if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
|
||||
include_option=--etags-include; \
|
||||
empty_fix=.; \
|
||||
else \
|
||||
include_option=--include; \
|
||||
empty_fix=; \
|
||||
fi; \
|
||||
list='$(SUBDIRS)'; for subdir in $$list; do \
|
||||
if test "$$subdir" = .; then :; else \
|
||||
test ! -f $$subdir/TAGS || \
|
||||
tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
|
||||
fi; \
|
||||
done; \
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) ' { files[$$0] = 1; } \
|
||||
END { for (i in files) print i; }'`; \
|
||||
if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
|
||||
test -n "$$unique" || unique=$$empty_fix; \
|
||||
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
|
||||
$$tags $$unique; \
|
||||
fi
|
||||
ctags: CTAGS
|
||||
CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
|
||||
$(TAGS_FILES) $(LISP)
|
||||
tags=; \
|
||||
here=`pwd`; \
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) ' { files[$$0] = 1; } \
|
||||
END { for (i in files) print i; }'`; \
|
||||
test -z "$(CTAGS_ARGS)$$tags$$unique" \
|
||||
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
|
||||
$$tags $$unique
|
||||
|
||||
GTAGS:
|
||||
here=`$(am__cd) $(top_builddir) && pwd` \
|
||||
&& cd $(top_srcdir) \
|
||||
&& gtags -i $(GTAGS_ARGS) $$here
|
||||
|
||||
distclean-tags:
|
||||
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
|
||||
|
||||
distdir: $(DISTFILES)
|
||||
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
||||
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
||||
list='$(DISTFILES)'; \
|
||||
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 $(srcdir)/$$file && test $$d != $(srcdir); then \
|
||||
cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
|
||||
fi; \
|
||||
cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
|
||||
else \
|
||||
test -f $(distdir)/$$file \
|
||||
|| cp -p $$d/$$file $(distdir)/$$file \
|
||||
|| exit 1; \
|
||||
fi; \
|
||||
done
|
||||
list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
|
||||
if test "$$subdir" = .; then :; else \
|
||||
test -d "$(distdir)/$$subdir" \
|
||||
|| $(MKDIR_P) "$(distdir)/$$subdir" \
|
||||
|| exit 1; \
|
||||
distdir=`$(am__cd) $(distdir) && pwd`; \
|
||||
top_distdir=`$(am__cd) $(top_distdir) && pwd`; \
|
||||
(cd $$subdir && \
|
||||
$(MAKE) $(AM_MAKEFLAGS) \
|
||||
top_distdir="$$top_distdir" \
|
||||
distdir="$$distdir/$$subdir" \
|
||||
am__remove_distdir=: \
|
||||
am__skip_length_check=: \
|
||||
distdir) \
|
||||
|| exit 1; \
|
||||
fi; \
|
||||
done
|
||||
check-am: all-am
|
||||
check: check-recursive
|
||||
all-am: Makefile $(LTLIBRARIES)
|
||||
installdirs: installdirs-recursive
|
||||
installdirs-am:
|
||||
for dir in "$(DESTDIR)$(libdir)"; do \
|
||||
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
|
||||
done
|
||||
install: install-recursive
|
||||
install-exec: install-exec-recursive
|
||||
install-data: install-data-recursive
|
||||
uninstall: uninstall-recursive
|
||||
|
||||
install-am: all-am
|
||||
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
|
||||
|
||||
installcheck: installcheck-recursive
|
||||
install-strip:
|
||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
||||
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
|
||||
`test -z '$(STRIP)' || \
|
||||
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
|
||||
mostlyclean-generic:
|
||||
|
||||
clean-generic:
|
||||
|
||||
distclean-generic:
|
||||
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
|
||||
|
||||
maintainer-clean-generic:
|
||||
@echo "This command is intended for maintainers to use"
|
||||
@echo "it deletes files that may require special tools to rebuild."
|
||||
clean: clean-recursive
|
||||
|
||||
clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \
|
||||
mostlyclean-am
|
||||
|
||||
distclean: distclean-recursive
|
||||
-rm -f Makefile
|
||||
distclean-am: clean-am distclean-compile distclean-generic \
|
||||
distclean-tags
|
||||
|
||||
dvi: dvi-recursive
|
||||
|
||||
dvi-am:
|
||||
|
||||
html: html-recursive
|
||||
|
||||
info: info-recursive
|
||||
|
||||
info-am:
|
||||
|
||||
install-data-am:
|
||||
|
||||
install-dvi: install-dvi-recursive
|
||||
|
||||
install-exec-am: install-libLTLIBRARIES
|
||||
|
||||
install-html: install-html-recursive
|
||||
|
||||
install-info: install-info-recursive
|
||||
|
||||
install-man:
|
||||
|
||||
install-pdf: install-pdf-recursive
|
||||
|
||||
install-ps: install-ps-recursive
|
||||
|
||||
installcheck-am:
|
||||
|
||||
maintainer-clean: maintainer-clean-recursive
|
||||
-rm -f Makefile
|
||||
maintainer-clean-am: distclean-am maintainer-clean-generic
|
||||
|
||||
mostlyclean: mostlyclean-recursive
|
||||
|
||||
mostlyclean-am: mostlyclean-compile mostlyclean-generic \
|
||||
mostlyclean-libtool
|
||||
|
||||
pdf: pdf-recursive
|
||||
|
||||
pdf-am:
|
||||
|
||||
ps: ps-recursive
|
||||
|
||||
ps-am:
|
||||
|
||||
uninstall-am: uninstall-libLTLIBRARIES
|
||||
|
||||
.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) install-am \
|
||||
install-strip
|
||||
|
||||
.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
|
||||
all all-am check check-am clean clean-generic \
|
||||
clean-libLTLIBRARIES clean-libtool ctags ctags-recursive \
|
||||
distclean distclean-compile distclean-generic \
|
||||
distclean-libtool distclean-tags distdir dvi dvi-am html \
|
||||
html-am info info-am install install-am install-data \
|
||||
install-data-am install-dvi install-dvi-am install-exec \
|
||||
install-exec-am install-html install-html-am install-info \
|
||||
install-info-am install-libLTLIBRARIES 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-compile mostlyclean-generic mostlyclean-libtool \
|
||||
pdf pdf-am ps ps-am tags tags-recursive uninstall uninstall-am \
|
||||
uninstall-libLTLIBRARIES
|
||||
|
||||
# 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:
|
|
@ -0,0 +1,205 @@
|
|||
/*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
* ExportMap.cpp
|
||||
* Exported Variables
|
||||
* Copyright (C) 2005-2008 Simon Newton
|
||||
*/
|
||||
|
||||
#include <algorithm>
|
||||
#include <string>
|
||||
#include <map>
|
||||
#include <vector>
|
||||
#include <iostream>
|
||||
#include "ola/ExportMap.h"
|
||||
#include "ola/StringUtils.h"
|
||||
|
||||
namespace ola {
|
||||
|
||||
using std::string;
|
||||
using std::stringstream;
|
||||
|
||||
|
||||
/*
|
||||
* Return the string representation of this map variable.
|
||||
* The form is:
|
||||
* var_name map:label_name key1:value1 key2:value2
|
||||
* @return the string representation of the variable.
|
||||
*/
|
||||
template<typename Type>
|
||||
const string MapVariable<Type>::Value() const {
|
||||
stringstream value;
|
||||
value << "map:" << m_label;
|
||||
typename map<string, Type>::const_iterator iter;
|
||||
for (iter = m_variables.begin(); iter != m_variables.end(); ++iter)
|
||||
value << " " << iter->first << ":" << iter->second;
|
||||
return value.str();
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Strings need to be quoted
|
||||
*/
|
||||
template<>
|
||||
const string MapVariable<string>::Value() const {
|
||||
stringstream value;
|
||||
value << "map:" << m_label;
|
||||
map<string, string>::const_iterator iter;
|
||||
for (iter = m_variables.begin(); iter != m_variables.end(); ++iter) {
|
||||
std::string var = iter->second;
|
||||
Escape(&var);
|
||||
value << " " << iter->first << ":\"" << var << "\"";
|
||||
}
|
||||
return value.str();
|
||||
}
|
||||
|
||||
|
||||
ExportMap::~ExportMap() {
|
||||
DeleteVariables(&m_int_variables);
|
||||
DeleteVariables(&m_counter_variables);
|
||||
DeleteVariables(&m_string_variables);
|
||||
DeleteVariables(&m_str_map_variables);
|
||||
DeleteVariables(&m_uint_map_variables);
|
||||
DeleteVariables(&m_int_map_variables);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Lookup or create an integer variable.
|
||||
* @param name the name of this variable.
|
||||
* @return an IntergerVariable
|
||||
*/
|
||||
IntegerVariable *ExportMap::GetIntegerVar(const string &name) {
|
||||
return GetVar(&m_int_variables, name);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Lookup or create a counter variable.
|
||||
* @param name the name of the variable.
|
||||
* @return a CounterVariable.
|
||||
*/
|
||||
CounterVariable *ExportMap::GetCounterVar(const string &name) {
|
||||
return GetVar(&m_counter_variables, name);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Lookup or create a string variable.
|
||||
* @param name the name of the variable.
|
||||
* @return a StringVariable.
|
||||
*/
|
||||
StringVariable *ExportMap::GetStringVar(const string &name) {
|
||||
return GetVar(&m_string_variables, name);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Lookup or create a string map variable
|
||||
* @param name the name of the variable
|
||||
* @param label the label to use for the map (optional)
|
||||
* @return a MapVariable
|
||||
*/
|
||||
StringMap *ExportMap::GetStringMapVar(const string &name, const string &label) {
|
||||
return GetMapVar(&m_str_map_variables, name, label);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Lookup or create an int map variable
|
||||
* @param name the name of the variable
|
||||
* @param label the label to use for the map (optional)
|
||||
* @return a MapVariable
|
||||
*/
|
||||
IntMap *ExportMap::GetIntMapVar(const string &name, const string &label) {
|
||||
return GetMapVar(&m_int_map_variables, name, label);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Lookup or create an unsigned int map variable
|
||||
* @param name the name of the variable
|
||||
* @param label the label to use for the map (optional)
|
||||
* @return a MapVariable
|
||||
*/
|
||||
UIntMap *ExportMap::GetUIntMapVar(const string &name, const string &label) {
|
||||
return GetMapVar(&m_uint_map_variables, name, label);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Return a list of all variables.
|
||||
* @return a vector of all variables.
|
||||
*/
|
||||
vector<BaseVariable*> ExportMap::AllVariables() const {
|
||||
vector<BaseVariable*> variables;
|
||||
AddVariablesToVector(&variables, m_int_variables);
|
||||
AddVariablesToVector(&variables, m_counter_variables);
|
||||
AddVariablesToVector(&variables, m_string_variables);
|
||||
AddVariablesToVector(&variables, m_str_map_variables);
|
||||
AddVariablesToVector(&variables, m_int_map_variables);
|
||||
AddVariablesToVector(&variables, m_uint_map_variables);
|
||||
|
||||
sort(variables.begin(), variables.end(), VariableLessThan());
|
||||
return variables;
|
||||
}
|
||||
|
||||
|
||||
template<typename Type>
|
||||
Type *ExportMap::GetVar(map<string, Type*> *var_map, const string &name) {
|
||||
typename map<string, Type*>::iterator iter;
|
||||
iter = var_map->find(name);
|
||||
|
||||
if (iter == var_map->end()) {
|
||||
Type *var = new Type(name);
|
||||
(*var_map)[name] = var;
|
||||
return var;
|
||||
}
|
||||
return iter->second;
|
||||
}
|
||||
|
||||
|
||||
template<typename Type>
|
||||
Type *ExportMap::GetMapVar(map<string, Type*> *var_map,
|
||||
const string &name,
|
||||
const string &label) {
|
||||
typename map<string, Type*>::iterator iter;
|
||||
iter = var_map->find(name);
|
||||
|
||||
if (iter == var_map->end()) {
|
||||
Type *var = new Type(name, label);
|
||||
(*var_map)[name] = var;
|
||||
return var;
|
||||
}
|
||||
return iter->second;
|
||||
}
|
||||
|
||||
template<typename Type>
|
||||
void ExportMap::AddVariablesToVector(vector<BaseVariable*> *variables,
|
||||
const Type &var_map) const {
|
||||
typename Type::const_iterator iter;
|
||||
for (iter = var_map.begin(); iter != var_map.end(); ++iter)
|
||||
variables->push_back(iter->second);
|
||||
}
|
||||
|
||||
|
||||
template<typename Type>
|
||||
void ExportMap::DeleteVariables(Type *var_map) const {
|
||||
typename Type::const_iterator iter;
|
||||
for (iter = var_map->begin(); iter != var_map->end(); iter++)
|
||||
delete iter->second;
|
||||
var_map->clear();
|
||||
}
|
||||
} // ola
|
|
@ -0,0 +1,216 @@
|
|||
/*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
* ExportMap.cpp
|
||||
* Test fixture for the ExportMap and Variable classes
|
||||
* Copyright (C) 2005-2008 Simon Newton
|
||||
*/
|
||||
|
||||
#include <cppunit/extensions/HelperMacros.h>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "ola/ExportMap.h"
|
||||
|
||||
using ola::BaseVariable;
|
||||
using ola::CounterVariable;
|
||||
using ola::ExportMap;
|
||||
using ola::IntMap;
|
||||
using ola::IntegerVariable;
|
||||
using ola::StringMap;
|
||||
using ola::StringVariable;
|
||||
using std::string;
|
||||
using std::vector;
|
||||
|
||||
|
||||
class ExportMapTest: public CppUnit::TestFixture {
|
||||
CPPUNIT_TEST_SUITE(ExportMapTest);
|
||||
CPPUNIT_TEST(testIntegerVariable);
|
||||
CPPUNIT_TEST(testCounterVariable);
|
||||
CPPUNIT_TEST(testStringVariable);
|
||||
CPPUNIT_TEST(testStringMapVariable);
|
||||
CPPUNIT_TEST(testIntMapVariable);
|
||||
CPPUNIT_TEST(testExportMap);
|
||||
CPPUNIT_TEST_SUITE_END();
|
||||
|
||||
public:
|
||||
void testIntegerVariable();
|
||||
void testCounterVariable();
|
||||
void testStringVariable();
|
||||
void testStringMapVariable();
|
||||
void testIntMapVariable();
|
||||
void testExportMap();
|
||||
};
|
||||
|
||||
|
||||
CPPUNIT_TEST_SUITE_REGISTRATION(ExportMapTest);
|
||||
|
||||
|
||||
/*
|
||||
* Check that the IntegerVariable works correctly.
|
||||
*/
|
||||
void ExportMapTest::testIntegerVariable() {
|
||||
string name = "foo";
|
||||
IntegerVariable var(name);
|
||||
|
||||
CPPUNIT_ASSERT_EQUAL(var.Name(), name);
|
||||
CPPUNIT_ASSERT_EQUAL(var.Value(), string("0"));
|
||||
CPPUNIT_ASSERT_EQUAL(var.Get(), 0);
|
||||
var++;
|
||||
CPPUNIT_ASSERT_EQUAL(var.Get(), 1);
|
||||
CPPUNIT_ASSERT_EQUAL(var.Value(), string("1"));
|
||||
var--;
|
||||
CPPUNIT_ASSERT_EQUAL(var.Get(), 0);
|
||||
CPPUNIT_ASSERT_EQUAL(var.Value(), string("0"));
|
||||
var.Set(100);
|
||||
CPPUNIT_ASSERT_EQUAL(var.Get(), 100);
|
||||
CPPUNIT_ASSERT_EQUAL(var.Value(), string("100"));
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Check that the CounterVariable works correctly.
|
||||
*/
|
||||
void ExportMapTest::testCounterVariable() {
|
||||
string name = "foo";
|
||||
CounterVariable var(name);
|
||||
|
||||
CPPUNIT_ASSERT_EQUAL(var.Name(), name);
|
||||
CPPUNIT_ASSERT_EQUAL(var.Value(), string("0"));
|
||||
CPPUNIT_ASSERT_EQUAL((unsigned int) 0, var.Get());
|
||||
var++;
|
||||
CPPUNIT_ASSERT_EQUAL((unsigned int) 1, var.Get());
|
||||
CPPUNIT_ASSERT_EQUAL(var.Value(), string("1"));
|
||||
var += 10;
|
||||
CPPUNIT_ASSERT_EQUAL((unsigned int) 11, var.Get());
|
||||
CPPUNIT_ASSERT_EQUAL(var.Value(), string("11"));
|
||||
var += 100;
|
||||
CPPUNIT_ASSERT_EQUAL((unsigned int) 111, var.Get());
|
||||
CPPUNIT_ASSERT_EQUAL(var.Value(), string("111"));
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Check that the StringVariable works correctly.
|
||||
*/
|
||||
void ExportMapTest::testStringVariable() {
|
||||
string name = "foo";
|
||||
StringVariable var(name);
|
||||
|
||||
CPPUNIT_ASSERT_EQUAL(var.Name(), name);
|
||||
CPPUNIT_ASSERT_EQUAL(var.Value(), string(""));
|
||||
CPPUNIT_ASSERT_EQUAL(var.Get(), string(""));
|
||||
var.Set("bar");
|
||||
CPPUNIT_ASSERT_EQUAL(var.Value(), string("bar"));
|
||||
CPPUNIT_ASSERT_EQUAL(var.Get(), string("bar"));
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Check that the StringMap works correctly.
|
||||
*/
|
||||
void ExportMapTest::testStringMapVariable() {
|
||||
string name = "foo";
|
||||
string label = "count";
|
||||
StringMap var(name, label);
|
||||
|
||||
CPPUNIT_ASSERT_EQUAL(var.Name(), name);
|
||||
CPPUNIT_ASSERT_EQUAL(var.Label(), label);
|
||||
CPPUNIT_ASSERT_EQUAL(var.Value(), string("map:count"));
|
||||
|
||||
string key1 = "key1";
|
||||
string value1 = "value1";
|
||||
var[key1] = value1;
|
||||
CPPUNIT_ASSERT_EQUAL(value1, var[key1]);
|
||||
CPPUNIT_ASSERT_EQUAL(var.Value(), string("map:count key1:\"value1\""));
|
||||
|
||||
string key2 = "key2";
|
||||
string value2 = "value 2";
|
||||
var[key2] = value2;
|
||||
CPPUNIT_ASSERT_EQUAL(value2, var[key2]);
|
||||
CPPUNIT_ASSERT_EQUAL(var.Value(),
|
||||
string("map:count key1:\"value1\" key2:\"value 2\""));
|
||||
|
||||
var.Remove(key1);
|
||||
CPPUNIT_ASSERT_EQUAL(string(""), var[key1]);
|
||||
var.Remove(key1);
|
||||
CPPUNIT_ASSERT_EQUAL(var.Value(), string("map:count key2:\"value 2\""));
|
||||
var[key2] = "foo\"";
|
||||
CPPUNIT_ASSERT_EQUAL(var.Value(), string("map:count key2:\"foo\\\"\""));
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Check that the IntMap works correctly.
|
||||
*/
|
||||
void ExportMapTest::testIntMapVariable() {
|
||||
string name = "foo";
|
||||
string label = "count";
|
||||
IntMap var(name, label);
|
||||
|
||||
CPPUNIT_ASSERT_EQUAL(var.Name(), name);
|
||||
CPPUNIT_ASSERT_EQUAL(var.Label(), label);
|
||||
CPPUNIT_ASSERT_EQUAL(var.Value(), string("map:count"));
|
||||
|
||||
string key1 = "key1";
|
||||
var[key1] = 100;
|
||||
CPPUNIT_ASSERT_EQUAL(100, var[key1]);
|
||||
CPPUNIT_ASSERT_EQUAL(var.Value(), string("map:count key1:100"));
|
||||
|
||||
string key2 = "key2";
|
||||
var[key2] = 99;
|
||||
CPPUNIT_ASSERT_EQUAL(99, var[key2]);
|
||||
CPPUNIT_ASSERT_EQUAL(var.Value(), string("map:count key1:100 key2:99"));
|
||||
|
||||
var.Remove(key1);
|
||||
CPPUNIT_ASSERT_EQUAL(0, var[key1]);
|
||||
var.Remove(key1);
|
||||
CPPUNIT_ASSERT_EQUAL(var.Value(), string("map:count key2:99"));
|
||||
var.Remove(key2);
|
||||
|
||||
// check references work
|
||||
string key3 = "key3";
|
||||
int &var1 = var[key3];
|
||||
CPPUNIT_ASSERT_EQUAL(0, var1);
|
||||
var1++;
|
||||
CPPUNIT_ASSERT_EQUAL(1, var[key3]);
|
||||
CPPUNIT_ASSERT_EQUAL(var.Value(), string("map:count key3:1"));
|
||||
}
|
||||
|
||||
/*
|
||||
* Check the export map works correctly.
|
||||
*/
|
||||
void ExportMapTest::testExportMap() {
|
||||
ExportMap map;
|
||||
string int_var_name = "int_var";
|
||||
string str_var_name = "str_var";
|
||||
string map_var_name = "map_var";
|
||||
string map_var_label = "label";
|
||||
IntegerVariable *int_var = map.GetIntegerVar(int_var_name);
|
||||
StringVariable *str_var = map.GetStringVar(str_var_name);
|
||||
StringMap *map_var = map.GetStringMapVar(map_var_name, map_var_label);
|
||||
|
||||
CPPUNIT_ASSERT_EQUAL(int_var->Name(), int_var_name);
|
||||
CPPUNIT_ASSERT_EQUAL(str_var->Name(), str_var_name);
|
||||
CPPUNIT_ASSERT_EQUAL(map_var->Name(), map_var_name);
|
||||
CPPUNIT_ASSERT_EQUAL(map_var->Label(), map_var_label);
|
||||
|
||||
map_var = map.GetStringMapVar(map_var_name);
|
||||
CPPUNIT_ASSERT_EQUAL(map_var->Name(), map_var_name);
|
||||
CPPUNIT_ASSERT_EQUAL(map_var->Label(), map_var_label);
|
||||
|
||||
vector<BaseVariable*> variables = map.AllVariables();
|
||||
CPPUNIT_ASSERT_EQUAL(variables.size(), (size_t) 3);
|
||||
}
|
|
@ -0,0 +1,35 @@
|
|||
/*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
* ExportMapTester.h
|
||||
* Runs all the export map tests
|
||||
* Copyright (C) 2005-2008 Simon Newton
|
||||
*/
|
||||
|
||||
#include <cppunit/CompilerOutputter.h>
|
||||
#include <cppunit/extensions/TestFactoryRegistry.h>
|
||||
#include <cppunit/ui/text/TestRunner.h>
|
||||
|
||||
int main(int argc, char* argv[]) {
|
||||
CppUnit::Test *suite = CppUnit::TestFactoryRegistry::getRegistry().makeTest();
|
||||
CppUnit::TextUi::TestRunner runner;
|
||||
runner.addTest(suite);
|
||||
runner.setOutputter(
|
||||
new CppUnit::CompilerOutputter(&runner.result(), std::cerr));
|
||||
bool wasSucessful = runner.run();
|
||||
return wasSucessful ? 0 : 1;
|
||||
(void) argc;
|
||||
(void) argv;
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
include $(top_srcdir)/common.mk
|
||||
|
||||
noinst_LTLIBRARIES = libolaexportmap.la
|
||||
libolaexportmap_la_SOURCES = ExportMap.cpp
|
||||
|
||||
TESTS = ExportMapTester
|
||||
check_PROGRAMS = $(TESTS)
|
||||
ExportMapTester_SOURCES = ExportMapTester.cpp ExportMapTest.cpp
|
||||
ExportMapTester_CXXFLAGS = $(CPPUNIT_CFLAGS)
|
||||
ExportMapTester_LDFLAGS = $(CPPUNIT_LIBS)
|
||||
ExportMapTester_LDADD = ./libolaexportmap.la ../utils/libolautils.la
|
|
@ -0,0 +1,595 @@
|
|||
# Makefile.in generated by automake 1.10 from Makefile.am.
|
||||
# @configure_input@
|
||||
|
||||
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
|
||||
# 2003, 2004, 2005, 2006 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@
|
||||
pkglibdir = $(libdir)/@PACKAGE@
|
||||
pkgincludedir = $(includedir)/@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@
|
||||
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
|
||||
$(top_srcdir)/common.mk
|
||||
TESTS = ExportMapTester$(EXEEXT)
|
||||
check_PROGRAMS = $(am__EXEEXT_1)
|
||||
subdir = common/export_map
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
am__aclocal_m4_deps = $(top_srcdir)/config/cppunit.m4 \
|
||||
$(top_srcdir)/config/ola.m4 $(top_srcdir)/config/pkg.m4 \
|
||||
$(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 =
|
||||
LTLIBRARIES = $(noinst_LTLIBRARIES)
|
||||
libolaexportmap_la_LIBADD =
|
||||
am_libolaexportmap_la_OBJECTS = ExportMap.lo
|
||||
libolaexportmap_la_OBJECTS = $(am_libolaexportmap_la_OBJECTS)
|
||||
am__EXEEXT_1 = ExportMapTester$(EXEEXT)
|
||||
am_ExportMapTester_OBJECTS = \
|
||||
ExportMapTester-ExportMapTester.$(OBJEXT) \
|
||||
ExportMapTester-ExportMapTest.$(OBJEXT)
|
||||
ExportMapTester_OBJECTS = $(am_ExportMapTester_OBJECTS)
|
||||
ExportMapTester_DEPENDENCIES = ./libolaexportmap.la \
|
||||
../utils/libolautils.la
|
||||
ExportMapTester_LINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) \
|
||||
$(LIBTOOLFLAGS) --mode=link $(CXXLD) \
|
||||
$(ExportMapTester_CXXFLAGS) $(CXXFLAGS) \
|
||||
$(ExportMapTester_LDFLAGS) $(LDFLAGS) -o $@
|
||||
DEFAULT_INCLUDES = -I. -I$(top_builddir)@am__isrc@
|
||||
depcomp = $(SHELL) $(top_srcdir)/config/depcomp
|
||||
am__depfiles_maybe = depfiles
|
||||
CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
|
||||
$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
|
||||
LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
|
||||
--mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
|
||||
$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
|
||||
CXXLD = $(CXX)
|
||||
CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
|
||||
--mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \
|
||||
$(LDFLAGS) -o $@
|
||||
SOURCES = $(libolaexportmap_la_SOURCES) $(ExportMapTester_SOURCES)
|
||||
DIST_SOURCES = $(libolaexportmap_la_SOURCES) \
|
||||
$(ExportMapTester_SOURCES)
|
||||
ETAGS = etags
|
||||
CTAGS = ctags
|
||||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
||||
ACLOCAL = @ACLOCAL@
|
||||
AMTAR = @AMTAR@
|
||||
AR = @AR@
|
||||
AUTOCONF = @AUTOCONF@
|
||||
AUTOHEADER = @AUTOHEADER@
|
||||
AUTOMAKE = @AUTOMAKE@
|
||||
AWK = @AWK@
|
||||
CC = @CC@
|
||||
CCDEPMODE = @CCDEPMODE@
|
||||
CFLAGS = @CFLAGS@
|
||||
CPP = @CPP@
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@
|
||||
CPPUNIT_CONFIG = @CPPUNIT_CONFIG@
|
||||
CPPUNIT_LIBS = @CPPUNIT_LIBS@
|
||||
CXX = @CXX@
|
||||
CXXCPP = @CXXCPP@
|
||||
CXXDEPMODE = @CXXDEPMODE@
|
||||
CXXFLAGS = @CXXFLAGS@
|
||||
CYGPATH_W = @CYGPATH_W@
|
||||
DEFS = @DEFS@
|
||||
DEPDIR = @DEPDIR@
|
||||
ECHO = @ECHO@
|
||||
ECHO_C = @ECHO_C@
|
||||
ECHO_N = @ECHO_N@
|
||||
ECHO_T = @ECHO_T@
|
||||
EGREP = @EGREP@
|
||||
EXEEXT = @EXEEXT@
|
||||
F77 = @F77@
|
||||
FFLAGS = @FFLAGS@
|
||||
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@
|
||||
LIBTOOL = @LIBTOOL@
|
||||
LN_S = @LN_S@
|
||||
LTLIBOBJS = @LTLIBOBJS@
|
||||
MAKEINFO = @MAKEINFO@
|
||||
MICROHTTPD_LIBS = @MICROHTTPD_LIBS@
|
||||
MKDIR_P = @MKDIR_P@
|
||||
OBJEXT = @OBJEXT@
|
||||
OLAD_DEFINES = @OLAD_DEFINES@
|
||||
OLA_SERVER_LIBS = @OLA_SERVER_LIBS@
|
||||
OSSP_UUID_CFLAGS = @OSSP_UUID_CFLAGS@
|
||||
OSSP_UUID_LIBS = @OSSP_UUID_LIBS@
|
||||
PACKAGE = @PACKAGE@
|
||||
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
|
||||
PACKAGE_NAME = @PACKAGE_NAME@
|
||||
PACKAGE_STRING = @PACKAGE_STRING@
|
||||
PACKAGE_TARNAME = @PACKAGE_TARNAME@
|
||||
PACKAGE_VERSION = @PACKAGE_VERSION@
|
||||
PATH_SEPARATOR = @PATH_SEPARATOR@
|
||||
PKG_CONFIG = @PKG_CONFIG@
|
||||
PLUGIN_LIBS = @PLUGIN_LIBS@
|
||||
PROTOC = @PROTOC@
|
||||
PYTHON = @PYTHON@
|
||||
PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
|
||||
PYTHON_PLATFORM = @PYTHON_PLATFORM@
|
||||
PYTHON_PREFIX = @PYTHON_PREFIX@
|
||||
PYTHON_VERSION = @PYTHON_VERSION@
|
||||
RANLIB = @RANLIB@
|
||||
SET_MAKE = @SET_MAKE@
|
||||
SHELL = @SHELL@
|
||||
STRIP = @STRIP@
|
||||
UUID_CFLAGS = @UUID_CFLAGS@
|
||||
UUID_LIBS = @UUID_LIBS@
|
||||
VERSION = @VERSION@
|
||||
abs_builddir = @abs_builddir@
|
||||
abs_srcdir = @abs_srcdir@
|
||||
abs_top_builddir = @abs_top_builddir@
|
||||
abs_top_srcdir = @abs_top_srcdir@
|
||||
ac_aux_dir = @ac_aux_dir@
|
||||
ac_ct_CC = @ac_ct_CC@
|
||||
ac_ct_CXX = @ac_ct_CXX@
|
||||
ac_ct_F77 = @ac_ct_F77@
|
||||
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@
|
||||
libusb_CFLAGS = @libusb_CFLAGS@
|
||||
libusb_LIBS = @libusb_LIBS@
|
||||
localedir = @localedir@
|
||||
localstatedir = @localstatedir@
|
||||
mandir = @mandir@
|
||||
mkdir_p = @mkdir_p@
|
||||
oldincludedir = @oldincludedir@
|
||||
pdfdir = @pdfdir@
|
||||
pkgpyexecdir = @pkgpyexecdir@
|
||||
pkgpythondir = @pkgpythondir@
|
||||
plugindir = @plugindir@
|
||||
prefix = @prefix@
|
||||
program_transform_name = @program_transform_name@
|
||||
psdir = @psdir@
|
||||
pyexecdir = @pyexecdir@
|
||||
pythondir = @pythondir@
|
||||
sbindir = @sbindir@
|
||||
sharedstatedir = @sharedstatedir@
|
||||
srcdir = @srcdir@
|
||||
sysconfdir = @sysconfdir@
|
||||
target_alias = @target_alias@
|
||||
top_builddir = @top_builddir@
|
||||
top_srcdir = @top_srcdir@
|
||||
www_datadir = @www_datadir@
|
||||
AM_CPPFLAGS = -I$(top_builddir)/include -Wall -Wformat -W -Werror -Wno-deprecated
|
||||
noinst_LTLIBRARIES = libolaexportmap.la
|
||||
libolaexportmap_la_SOURCES = ExportMap.cpp
|
||||
ExportMapTester_SOURCES = ExportMapTester.cpp ExportMapTest.cpp
|
||||
ExportMapTester_CXXFLAGS = $(CPPUNIT_CFLAGS)
|
||||
ExportMapTester_LDFLAGS = $(CPPUNIT_LIBS)
|
||||
ExportMapTester_LDADD = ./libolaexportmap.la ../utils/libolautils.la
|
||||
all: all-am
|
||||
|
||||
.SUFFIXES:
|
||||
.SUFFIXES: .cpp .lo .o .obj
|
||||
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/common.mk $(am__configure_deps)
|
||||
@for dep in $?; do \
|
||||
case '$(am__configure_deps)' in \
|
||||
*$$dep*) \
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
|
||||
&& exit 0; \
|
||||
exit 1;; \
|
||||
esac; \
|
||||
done; \
|
||||
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu common/export_map/Makefile'; \
|
||||
cd $(top_srcdir) && \
|
||||
$(AUTOMAKE) --gnu common/export_map/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
|
||||
|
||||
clean-noinstLTLIBRARIES:
|
||||
-test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES)
|
||||
@list='$(noinst_LTLIBRARIES)'; for p in $$list; do \
|
||||
dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
|
||||
test "$$dir" != "$$p" || dir=.; \
|
||||
echo "rm -f \"$${dir}/so_locations\""; \
|
||||
rm -f "$${dir}/so_locations"; \
|
||||
done
|
||||
libolaexportmap.la: $(libolaexportmap_la_OBJECTS) $(libolaexportmap_la_DEPENDENCIES)
|
||||
$(CXXLINK) $(libolaexportmap_la_OBJECTS) $(libolaexportmap_la_LIBADD) $(LIBS)
|
||||
|
||||
clean-checkPROGRAMS:
|
||||
@list='$(check_PROGRAMS)'; for p in $$list; do \
|
||||
f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
|
||||
echo " rm -f $$p $$f"; \
|
||||
rm -f $$p $$f ; \
|
||||
done
|
||||
ExportMapTester$(EXEEXT): $(ExportMapTester_OBJECTS) $(ExportMapTester_DEPENDENCIES)
|
||||
@rm -f ExportMapTester$(EXEEXT)
|
||||
$(ExportMapTester_LINK) $(ExportMapTester_OBJECTS) $(ExportMapTester_LDADD) $(LIBS)
|
||||
|
||||
mostlyclean-compile:
|
||||
-rm -f *.$(OBJEXT)
|
||||
|
||||
distclean-compile:
|
||||
-rm -f *.tab.c
|
||||
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ExportMap.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ExportMapTester-ExportMapTest.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ExportMapTester-ExportMapTester.Po@am__quote@
|
||||
|
||||
.cpp.o:
|
||||
@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
|
||||
@am__fastdepCXX_TRUE@ mv -f $(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@ mv -f $(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) '$<'`
|
||||
|
||||
.cpp.lo:
|
||||
@am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
|
||||
@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
|
||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $<
|
||||
|
||||
ExportMapTester-ExportMapTester.o: ExportMapTester.cpp
|
||||
@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ExportMapTester_CXXFLAGS) $(CXXFLAGS) -MT ExportMapTester-ExportMapTester.o -MD -MP -MF $(DEPDIR)/ExportMapTester-ExportMapTester.Tpo -c -o ExportMapTester-ExportMapTester.o `test -f 'ExportMapTester.cpp' || echo '$(srcdir)/'`ExportMapTester.cpp
|
||||
@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/ExportMapTester-ExportMapTester.Tpo $(DEPDIR)/ExportMapTester-ExportMapTester.Po
|
||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='ExportMapTester.cpp' object='ExportMapTester-ExportMapTester.o' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ExportMapTester_CXXFLAGS) $(CXXFLAGS) -c -o ExportMapTester-ExportMapTester.o `test -f 'ExportMapTester.cpp' || echo '$(srcdir)/'`ExportMapTester.cpp
|
||||
|
||||
ExportMapTester-ExportMapTester.obj: ExportMapTester.cpp
|
||||
@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ExportMapTester_CXXFLAGS) $(CXXFLAGS) -MT ExportMapTester-ExportMapTester.obj -MD -MP -MF $(DEPDIR)/ExportMapTester-ExportMapTester.Tpo -c -o ExportMapTester-ExportMapTester.obj `if test -f 'ExportMapTester.cpp'; then $(CYGPATH_W) 'ExportMapTester.cpp'; else $(CYGPATH_W) '$(srcdir)/ExportMapTester.cpp'; fi`
|
||||
@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/ExportMapTester-ExportMapTester.Tpo $(DEPDIR)/ExportMapTester-ExportMapTester.Po
|
||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='ExportMapTester.cpp' object='ExportMapTester-ExportMapTester.obj' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ExportMapTester_CXXFLAGS) $(CXXFLAGS) -c -o ExportMapTester-ExportMapTester.obj `if test -f 'ExportMapTester.cpp'; then $(CYGPATH_W) 'ExportMapTester.cpp'; else $(CYGPATH_W) '$(srcdir)/ExportMapTester.cpp'; fi`
|
||||
|
||||
ExportMapTester-ExportMapTest.o: ExportMapTest.cpp
|
||||
@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ExportMapTester_CXXFLAGS) $(CXXFLAGS) -MT ExportMapTester-ExportMapTest.o -MD -MP -MF $(DEPDIR)/ExportMapTester-ExportMapTest.Tpo -c -o ExportMapTester-ExportMapTest.o `test -f 'ExportMapTest.cpp' || echo '$(srcdir)/'`ExportMapTest.cpp
|
||||
@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/ExportMapTester-ExportMapTest.Tpo $(DEPDIR)/ExportMapTester-ExportMapTest.Po
|
||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='ExportMapTest.cpp' object='ExportMapTester-ExportMapTest.o' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ExportMapTester_CXXFLAGS) $(CXXFLAGS) -c -o ExportMapTester-ExportMapTest.o `test -f 'ExportMapTest.cpp' || echo '$(srcdir)/'`ExportMapTest.cpp
|
||||
|
||||
ExportMapTester-ExportMapTest.obj: ExportMapTest.cpp
|
||||
@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ExportMapTester_CXXFLAGS) $(CXXFLAGS) -MT ExportMapTester-ExportMapTest.obj -MD -MP -MF $(DEPDIR)/ExportMapTester-ExportMapTest.Tpo -c -o ExportMapTester-ExportMapTest.obj `if test -f 'ExportMapTest.cpp'; then $(CYGPATH_W) 'ExportMapTest.cpp'; else $(CYGPATH_W) '$(srcdir)/ExportMapTest.cpp'; fi`
|
||||
@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/ExportMapTester-ExportMapTest.Tpo $(DEPDIR)/ExportMapTester-ExportMapTest.Po
|
||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='ExportMapTest.cpp' object='ExportMapTester-ExportMapTest.obj' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ExportMapTester_CXXFLAGS) $(CXXFLAGS) -c -o ExportMapTester-ExportMapTest.obj `if test -f 'ExportMapTest.cpp'; then $(CYGPATH_W) 'ExportMapTest.cpp'; else $(CYGPATH_W) '$(srcdir)/ExportMapTest.cpp'; fi`
|
||||
|
||||
mostlyclean-libtool:
|
||||
-rm -f *.lo
|
||||
|
||||
clean-libtool:
|
||||
-rm -rf .libs _libs
|
||||
|
||||
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) ' { files[$$0] = 1; } \
|
||||
END { for (i in files) print i; }'`; \
|
||||
mkid -fID $$unique
|
||||
tags: TAGS
|
||||
|
||||
TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
|
||||
$(TAGS_FILES) $(LISP)
|
||||
tags=; \
|
||||
here=`pwd`; \
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) ' { files[$$0] = 1; } \
|
||||
END { for (i in files) print i; }'`; \
|
||||
if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
|
||||
test -n "$$unique" || unique=$$empty_fix; \
|
||||
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
|
||||
$$tags $$unique; \
|
||||
fi
|
||||
ctags: CTAGS
|
||||
CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
|
||||
$(TAGS_FILES) $(LISP)
|
||||
tags=; \
|
||||
here=`pwd`; \
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) ' { files[$$0] = 1; } \
|
||||
END { for (i in files) print i; }'`; \
|
||||
test -z "$(CTAGS_ARGS)$$tags$$unique" \
|
||||
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
|
||||
$$tags $$unique
|
||||
|
||||
GTAGS:
|
||||
here=`$(am__cd) $(top_builddir) && pwd` \
|
||||
&& cd $(top_srcdir) \
|
||||
&& gtags -i $(GTAGS_ARGS) $$here
|
||||
|
||||
distclean-tags:
|
||||
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
|
||||
|
||||
check-TESTS: $(TESTS)
|
||||
@failed=0; all=0; xfail=0; xpass=0; skip=0; ws='[ ]'; \
|
||||
srcdir=$(srcdir); export srcdir; \
|
||||
list=' $(TESTS) '; \
|
||||
if test -n "$$list"; then \
|
||||
for tst in $$list; do \
|
||||
if test -f ./$$tst; then dir=./; \
|
||||
elif test -f $$tst; then dir=; \
|
||||
else dir="$(srcdir)/"; fi; \
|
||||
if $(TESTS_ENVIRONMENT) $${dir}$$tst; then \
|
||||
all=`expr $$all + 1`; \
|
||||
case " $(XFAIL_TESTS) " in \
|
||||
*$$ws$$tst$$ws*) \
|
||||
xpass=`expr $$xpass + 1`; \
|
||||
failed=`expr $$failed + 1`; \
|
||||
echo "XPASS: $$tst"; \
|
||||
;; \
|
||||
*) \
|
||||
echo "PASS: $$tst"; \
|
||||
;; \
|
||||
esac; \
|
||||
elif test $$? -ne 77; then \
|
||||
all=`expr $$all + 1`; \
|
||||
case " $(XFAIL_TESTS) " in \
|
||||
*$$ws$$tst$$ws*) \
|
||||
xfail=`expr $$xfail + 1`; \
|
||||
echo "XFAIL: $$tst"; \
|
||||
;; \
|
||||
*) \
|
||||
failed=`expr $$failed + 1`; \
|
||||
echo "FAIL: $$tst"; \
|
||||
;; \
|
||||
esac; \
|
||||
else \
|
||||
skip=`expr $$skip + 1`; \
|
||||
echo "SKIP: $$tst"; \
|
||||
fi; \
|
||||
done; \
|
||||
if test "$$failed" -eq 0; then \
|
||||
if test "$$xfail" -eq 0; then \
|
||||
banner="All $$all tests passed"; \
|
||||
else \
|
||||
banner="All $$all tests behaved as expected ($$xfail expected failures)"; \
|
||||
fi; \
|
||||
else \
|
||||
if test "$$xpass" -eq 0; then \
|
||||
banner="$$failed of $$all tests failed"; \
|
||||
else \
|
||||
banner="$$failed of $$all tests did not behave as expected ($$xpass unexpected passes)"; \
|
||||
fi; \
|
||||
fi; \
|
||||
dashes="$$banner"; \
|
||||
skipped=""; \
|
||||
if test "$$skip" -ne 0; then \
|
||||
skipped="($$skip tests were not run)"; \
|
||||
test `echo "$$skipped" | wc -c` -le `echo "$$banner" | wc -c` || \
|
||||
dashes="$$skipped"; \
|
||||
fi; \
|
||||
report=""; \
|
||||
if test "$$failed" -ne 0 && test -n "$(PACKAGE_BUGREPORT)"; then \
|
||||
report="Please report to $(PACKAGE_BUGREPORT)"; \
|
||||
test `echo "$$report" | wc -c` -le `echo "$$banner" | wc -c` || \
|
||||
dashes="$$report"; \
|
||||
fi; \
|
||||
dashes=`echo "$$dashes" | sed s/./=/g`; \
|
||||
echo "$$dashes"; \
|
||||
echo "$$banner"; \
|
||||
test -z "$$skipped" || echo "$$skipped"; \
|
||||
test -z "$$report" || echo "$$report"; \
|
||||
echo "$$dashes"; \
|
||||
test "$$failed" -eq 0; \
|
||||
else :; fi
|
||||
|
||||
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 $(srcdir)/$$file && test $$d != $(srcdir); then \
|
||||
cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
|
||||
fi; \
|
||||
cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
|
||||
else \
|
||||
test -f $(distdir)/$$file \
|
||||
|| cp -p $$d/$$file $(distdir)/$$file \
|
||||
|| exit 1; \
|
||||
fi; \
|
||||
done
|
||||
check-am: all-am
|
||||
$(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS)
|
||||
$(MAKE) $(AM_MAKEFLAGS) check-TESTS
|
||||
check: check-am
|
||||
all-am: Makefile $(LTLIBRARIES)
|
||||
installdirs:
|
||||
install: install-am
|
||||
install-exec: install-exec-am
|
||||
install-data: install-data-am
|
||||
uninstall: uninstall-am
|
||||
|
||||
install-am: all-am
|
||||
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
|
||||
|
||||
installcheck: installcheck-am
|
||||
install-strip:
|
||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
||||
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
|
||||
`test -z '$(STRIP)' || \
|
||||
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
|
||||
mostlyclean-generic:
|
||||
|
||||
clean-generic:
|
||||
|
||||
distclean-generic:
|
||||
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
|
||||
|
||||
maintainer-clean-generic:
|
||||
@echo "This command is intended for maintainers to use"
|
||||
@echo "it deletes files that may require special tools to rebuild."
|
||||
clean: clean-am
|
||||
|
||||
clean-am: clean-checkPROGRAMS clean-generic clean-libtool \
|
||||
clean-noinstLTLIBRARIES mostlyclean-am
|
||||
|
||||
distclean: distclean-am
|
||||
-rm -rf ./$(DEPDIR)
|
||||
-rm -f Makefile
|
||||
distclean-am: clean-am distclean-compile distclean-generic \
|
||||
distclean-tags
|
||||
|
||||
dvi: dvi-am
|
||||
|
||||
dvi-am:
|
||||
|
||||
html: html-am
|
||||
|
||||
info: info-am
|
||||
|
||||
info-am:
|
||||
|
||||
install-data-am:
|
||||
|
||||
install-dvi: install-dvi-am
|
||||
|
||||
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
|
||||
|
||||
installcheck-am:
|
||||
|
||||
maintainer-clean: maintainer-clean-am
|
||||
-rm -rf ./$(DEPDIR)
|
||||
-rm -f Makefile
|
||||
maintainer-clean-am: distclean-am maintainer-clean-generic
|
||||
|
||||
mostlyclean: mostlyclean-am
|
||||
|
||||
mostlyclean-am: mostlyclean-compile mostlyclean-generic \
|
||||
mostlyclean-libtool
|
||||
|
||||
pdf: pdf-am
|
||||
|
||||
pdf-am:
|
||||
|
||||
ps: ps-am
|
||||
|
||||
ps-am:
|
||||
|
||||
uninstall-am:
|
||||
|
||||
.MAKE: install-am install-strip
|
||||
|
||||
.PHONY: CTAGS GTAGS all all-am check check-TESTS check-am clean \
|
||||
clean-checkPROGRAMS clean-generic clean-libtool \
|
||||
clean-noinstLTLIBRARIES ctags distclean distclean-compile \
|
||||
distclean-generic distclean-libtool distclean-tags distdir dvi \
|
||||
dvi-am html html-am info info-am install install-am \
|
||||
install-data install-data-am install-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 mostlyclean-libtool pdf pdf-am ps ps-am \
|
||||
tags 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:
|
|
@ -0,0 +1,197 @@
|
|||
/*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
* Logging.cpp
|
||||
* The logging functions. See include/ola/Logging.h for details on how to use
|
||||
* these.
|
||||
* Copyright (C) 2005-2009 Simon Newton
|
||||
*/
|
||||
|
||||
#ifdef WIN32
|
||||
#include <windows.h>
|
||||
#else
|
||||
#include <syslog.h>
|
||||
#endif
|
||||
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
#include "ola/Logging.h"
|
||||
|
||||
namespace ola {
|
||||
|
||||
using std::string;
|
||||
using std::ostringstream;
|
||||
|
||||
LogDestination *log_target = NULL;
|
||||
log_level logging_level = OLA_LOG_WARN;
|
||||
|
||||
/*
|
||||
* Set the log level.
|
||||
* @param level the new log level
|
||||
*/
|
||||
void SetLogLevel(log_level level) {
|
||||
logging_level = level;
|
||||
}
|
||||
|
||||
/*
|
||||
* Increment the log level, We reset to OLA_LOG_FATAL when we wrap.
|
||||
*/
|
||||
void IncrementLogLevel() {
|
||||
logging_level = (log_level) (logging_level + 1);
|
||||
if (logging_level == OLA_LOG_MAX)
|
||||
logging_level = OLA_LOG_NONE;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Init the logging system.
|
||||
* @param level the log level
|
||||
* @param output the log output
|
||||
*/
|
||||
bool InitLogging(log_level level, log_output output) {
|
||||
LogDestination *destination;
|
||||
if (output == OLA_LOG_SYSLOG) {
|
||||
SyslogDestination *syslog_dest = new SyslogDestination();
|
||||
if (!syslog_dest->Init()) {
|
||||
delete syslog_dest;
|
||||
return false;
|
||||
}
|
||||
destination = syslog_dest;
|
||||
} else if (output == OLA_LOG_STDERR) {
|
||||
destination = new StdErrorLogDestination();
|
||||
} else {
|
||||
destination = NULL;
|
||||
}
|
||||
InitLogging(level, destination);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Init the logging system.
|
||||
* @param level the log level
|
||||
* @param destination A LogDestination object
|
||||
*/
|
||||
void InitLogging(log_level level, LogDestination *destination) {
|
||||
SetLogLevel(level);
|
||||
log_target = destination;
|
||||
}
|
||||
|
||||
|
||||
LogLine::LogLine(const char *file,
|
||||
int line,
|
||||
log_level level):
|
||||
m_level(level),
|
||||
m_stream(ostringstream::out) {
|
||||
m_stream << file << ":" << line << ": ";
|
||||
m_prefix_length = m_stream.str().length();
|
||||
}
|
||||
|
||||
LogLine::~LogLine() {
|
||||
Write();
|
||||
}
|
||||
|
||||
void LogLine::Write() {
|
||||
if (m_stream.str().length() == m_prefix_length)
|
||||
return;
|
||||
|
||||
if (m_level > logging_level)
|
||||
return;
|
||||
|
||||
string line = m_stream.str();
|
||||
|
||||
if (line.at(line.length() - 1) != '\n')
|
||||
line.append("\n");
|
||||
|
||||
if (log_target)
|
||||
log_target->Write(m_level, line);
|
||||
}
|
||||
|
||||
void StdErrorLogDestination::Write(log_level level, const string &log_line) {
|
||||
std::cerr << log_line;
|
||||
(void) level;
|
||||
}
|
||||
|
||||
|
||||
bool SyslogDestination::Init() {
|
||||
#ifdef WIN32
|
||||
m_eventlog = RegisterEventSourceA(NULL, "OLA");
|
||||
if (!m_eventlog) {
|
||||
printf("Failed to initialize event logging\n");
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Write a line to the system logger. This is syslog on *nix or the event log
|
||||
* on widnows
|
||||
*/
|
||||
void SyslogDestination::Write(log_level level, const string &log_line) {
|
||||
#ifdef WIN32
|
||||
WORD pri;
|
||||
const char* strings[1];
|
||||
strings[0] = log_line.data();
|
||||
|
||||
switch (level) {
|
||||
case OLA_LOG_FATAL:
|
||||
pri = EVENTLOG_ERROR_TYPE;
|
||||
break;
|
||||
case OLA_LOG_WARN:
|
||||
pri = EVENTLOG_WARNING_TYPE;
|
||||
break;
|
||||
case OLA_LOG_INFO:
|
||||
pri = EVENTLOG_INFORMATION_TYPE;
|
||||
break;
|
||||
case OLA_LOG_DEBUG:
|
||||
pri = EVENTLOG_INFORMATION_TYPE;
|
||||
break;
|
||||
default:
|
||||
pri = EVENTLOG_INFORMATION_TYPE;
|
||||
}
|
||||
ReportEventA(m_eventlog,
|
||||
pri,
|
||||
(WORD) NULL,
|
||||
(DWORD) NULL,
|
||||
NULL,
|
||||
1,
|
||||
0,
|
||||
strings,
|
||||
NULL);
|
||||
#else
|
||||
int pri;
|
||||
switch (level) {
|
||||
case OLA_LOG_FATAL:
|
||||
pri = LOG_CRIT;
|
||||
break;
|
||||
case OLA_LOG_WARN:
|
||||
pri = LOG_WARNING;
|
||||
break;
|
||||
case OLA_LOG_INFO:
|
||||
pri = LOG_INFO;
|
||||
break;
|
||||
case OLA_LOG_DEBUG:
|
||||
pri = LOG_DEBUG;
|
||||
break;
|
||||
default :
|
||||
pri = LOG_INFO;
|
||||
}
|
||||
syslog(pri, "%s", log_line.data());
|
||||
#endif
|
||||
}
|
||||
} // ola
|
|
@ -0,0 +1,124 @@
|
|||
/*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
* LoggingTest.cpp
|
||||
* Test fixture for the Logging framework
|
||||
* Copyright (C) 2005-2009 Simon Newton
|
||||
*/
|
||||
|
||||
#include <cppunit/extensions/HelperMacros.h>
|
||||
#include <deque>
|
||||
#include <string>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
#include "ola/Logging.h"
|
||||
#include "ola/StringUtils.h"
|
||||
|
||||
using std::deque;
|
||||
using std::vector;
|
||||
using std::string;
|
||||
using ola::IncrementLogLevel;
|
||||
using ola::log_level;
|
||||
|
||||
|
||||
class LoggingTest: public CppUnit::TestFixture {
|
||||
CPPUNIT_TEST_SUITE(LoggingTest);
|
||||
CPPUNIT_TEST(testLogging);
|
||||
CPPUNIT_TEST_SUITE_END();
|
||||
|
||||
public:
|
||||
void testLogging();
|
||||
};
|
||||
|
||||
|
||||
class MockLogDestination: public ola::LogDestination {
|
||||
public:
|
||||
void AddExpected(log_level level, string log_line);
|
||||
void Write(log_level level, const string &log_line);
|
||||
int LinesRemaining() const { return m_log_lines.size(); }
|
||||
private:
|
||||
deque<std::pair<log_level, string> > m_log_lines;
|
||||
};
|
||||
|
||||
|
||||
CPPUNIT_TEST_SUITE_REGISTRATION(LoggingTest);
|
||||
|
||||
|
||||
void MockLogDestination::AddExpected(log_level level, string log_line) {
|
||||
std::pair<log_level, string> expected_result(level, log_line);
|
||||
m_log_lines.push_back(expected_result);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Check that what gets written is what we expected
|
||||
*/
|
||||
void MockLogDestination::Write(log_level level, const string &log_line) {
|
||||
vector<string> tokens;
|
||||
ola::StringSplit(log_line, tokens, ":");
|
||||
vector<string>::iterator iter;
|
||||
CPPUNIT_ASSERT_EQUAL(tokens.size() , (size_t) 3);
|
||||
CPPUNIT_ASSERT(m_log_lines.size() > 0);
|
||||
std::pair<log_level, string> expected_result = m_log_lines.at(0);
|
||||
m_log_lines.pop_front();
|
||||
CPPUNIT_ASSERT_EQUAL(expected_result.first, level);
|
||||
CPPUNIT_ASSERT_EQUAL(expected_result.second, tokens.at(2));
|
||||
}
|
||||
|
||||
/*
|
||||
* Check that logging works correctly.
|
||||
*/
|
||||
void LoggingTest::testLogging() {
|
||||
MockLogDestination *destination = new MockLogDestination();
|
||||
InitLogging(ola::OLA_LOG_DEBUG, destination);
|
||||
destination->AddExpected(ola::OLA_LOG_DEBUG, " debug\n");
|
||||
OLA_DEBUG << "debug";
|
||||
destination->AddExpected(ola::OLA_LOG_INFO, " info\n");
|
||||
OLA_INFO << "info";
|
||||
destination->AddExpected(ola::OLA_LOG_WARN, " warn\n");
|
||||
OLA_WARN << "warn";
|
||||
destination->AddExpected(ola::OLA_LOG_FATAL, " fatal\n");
|
||||
OLA_FATAL << "fatal";
|
||||
|
||||
// Now make sure nothing below WARN is logged
|
||||
ola::SetLogLevel(ola::OLA_LOG_WARN);
|
||||
OLA_DEBUG << "debug";
|
||||
OLA_INFO << "info";
|
||||
destination->AddExpected(ola::OLA_LOG_WARN, " warn\n");
|
||||
OLA_WARN << "warn";
|
||||
destination->AddExpected(ola::OLA_LOG_FATAL, " fatal\n");
|
||||
OLA_FATAL << "fatal";
|
||||
CPPUNIT_ASSERT_EQUAL(destination->LinesRemaining(), 0);
|
||||
|
||||
// set the log level to INFO
|
||||
IncrementLogLevel();
|
||||
OLA_DEBUG << "debug";
|
||||
destination->AddExpected(ola::OLA_LOG_INFO, " info\n");
|
||||
OLA_INFO << "info";
|
||||
destination->AddExpected(ola::OLA_LOG_WARN, " warn\n");
|
||||
OLA_WARN << "warn";
|
||||
destination->AddExpected(ola::OLA_LOG_FATAL, " fatal\n");
|
||||
OLA_FATAL << "fatal";
|
||||
CPPUNIT_ASSERT_EQUAL(destination->LinesRemaining(), 0);
|
||||
|
||||
IncrementLogLevel();
|
||||
// this should wrap to NONE
|
||||
IncrementLogLevel();
|
||||
OLA_DEBUG << "debug";
|
||||
OLA_INFO << "info";
|
||||
OLA_WARN << "warn";
|
||||
OLA_FATAL << "fatal";
|
||||
CPPUNIT_ASSERT_EQUAL(destination->LinesRemaining(), 0);
|
||||
}
|
|
@ -0,0 +1,35 @@
|
|||
/*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
* LoggingTester.h
|
||||
* Runs all the Logging tests
|
||||
* Copyright (C) 2005-2009 Simon Newton
|
||||
*/
|
||||
|
||||
#include <cppunit/CompilerOutputter.h>
|
||||
#include <cppunit/extensions/TestFactoryRegistry.h>
|
||||
#include <cppunit/ui/text/TestRunner.h>
|
||||
|
||||
int main(int argc, char* argv[]) {
|
||||
CppUnit::Test *suite = CppUnit::TestFactoryRegistry::getRegistry().makeTest();
|
||||
CppUnit::TextUi::TestRunner runner;
|
||||
runner.addTest(suite);
|
||||
runner.setOutputter(new CppUnit::CompilerOutputter(&runner.result(),
|
||||
std::cerr));
|
||||
bool wasSucessful = runner.run();
|
||||
return wasSucessful ? 0 : 1;
|
||||
(void) argc;
|
||||
(void) argv;
|
||||
}
|
|
@ -0,0 +1,12 @@
|
|||
include $(top_srcdir)/common.mk
|
||||
|
||||
noinst_LTLIBRARIES = liblogging.la
|
||||
liblogging_la_SOURCES = Logging.cpp
|
||||
|
||||
TESTS = LoggingTester
|
||||
check_PROGRAMS = $(TESTS)
|
||||
|
||||
LoggingTester_SOURCES = LoggingTester.cpp LoggingTest.cpp
|
||||
LoggingTester_CXXFLAGS = $(CPPUNIT_CFLAGS)
|
||||
LoggingTester_LDFLAGS = $(CPPUNIT_LIBS)
|
||||
LoggingTester_LDADD = ./liblogging.la ../utils/libolautils.la
|
|
@ -0,0 +1,591 @@
|
|||
# Makefile.in generated by automake 1.10 from Makefile.am.
|
||||
# @configure_input@
|
||||
|
||||
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
|
||||
# 2003, 2004, 2005, 2006 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@
|
||||
pkglibdir = $(libdir)/@PACKAGE@
|
||||
pkgincludedir = $(includedir)/@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@
|
||||
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
|
||||
$(top_srcdir)/common.mk
|
||||
TESTS = LoggingTester$(EXEEXT)
|
||||
check_PROGRAMS = $(am__EXEEXT_1)
|
||||
subdir = common/logging
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
am__aclocal_m4_deps = $(top_srcdir)/config/cppunit.m4 \
|
||||
$(top_srcdir)/config/ola.m4 $(top_srcdir)/config/pkg.m4 \
|
||||
$(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 =
|
||||
LTLIBRARIES = $(noinst_LTLIBRARIES)
|
||||
liblogging_la_LIBADD =
|
||||
am_liblogging_la_OBJECTS = Logging.lo
|
||||
liblogging_la_OBJECTS = $(am_liblogging_la_OBJECTS)
|
||||
am__EXEEXT_1 = LoggingTester$(EXEEXT)
|
||||
am_LoggingTester_OBJECTS = LoggingTester-LoggingTester.$(OBJEXT) \
|
||||
LoggingTester-LoggingTest.$(OBJEXT)
|
||||
LoggingTester_OBJECTS = $(am_LoggingTester_OBJECTS)
|
||||
LoggingTester_DEPENDENCIES = ./liblogging.la ../utils/libolautils.la
|
||||
LoggingTester_LINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) \
|
||||
$(LIBTOOLFLAGS) --mode=link $(CXXLD) $(LoggingTester_CXXFLAGS) \
|
||||
$(CXXFLAGS) $(LoggingTester_LDFLAGS) $(LDFLAGS) -o $@
|
||||
DEFAULT_INCLUDES = -I. -I$(top_builddir)@am__isrc@
|
||||
depcomp = $(SHELL) $(top_srcdir)/config/depcomp
|
||||
am__depfiles_maybe = depfiles
|
||||
CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
|
||||
$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
|
||||
LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
|
||||
--mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
|
||||
$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
|
||||
CXXLD = $(CXX)
|
||||
CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
|
||||
--mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \
|
||||
$(LDFLAGS) -o $@
|
||||
SOURCES = $(liblogging_la_SOURCES) $(LoggingTester_SOURCES)
|
||||
DIST_SOURCES = $(liblogging_la_SOURCES) $(LoggingTester_SOURCES)
|
||||
ETAGS = etags
|
||||
CTAGS = ctags
|
||||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
||||
ACLOCAL = @ACLOCAL@
|
||||
AMTAR = @AMTAR@
|
||||
AR = @AR@
|
||||
AUTOCONF = @AUTOCONF@
|
||||
AUTOHEADER = @AUTOHEADER@
|
||||
AUTOMAKE = @AUTOMAKE@
|
||||
AWK = @AWK@
|
||||
CC = @CC@
|
||||
CCDEPMODE = @CCDEPMODE@
|
||||
CFLAGS = @CFLAGS@
|
||||
CPP = @CPP@
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@
|
||||
CPPUNIT_CONFIG = @CPPUNIT_CONFIG@
|
||||
CPPUNIT_LIBS = @CPPUNIT_LIBS@
|
||||
CXX = @CXX@
|
||||
CXXCPP = @CXXCPP@
|
||||
CXXDEPMODE = @CXXDEPMODE@
|
||||
CXXFLAGS = @CXXFLAGS@
|
||||
CYGPATH_W = @CYGPATH_W@
|
||||
DEFS = @DEFS@
|
||||
DEPDIR = @DEPDIR@
|
||||
ECHO = @ECHO@
|
||||
ECHO_C = @ECHO_C@
|
||||
ECHO_N = @ECHO_N@
|
||||
ECHO_T = @ECHO_T@
|
||||
EGREP = @EGREP@
|
||||
EXEEXT = @EXEEXT@
|
||||
F77 = @F77@
|
||||
FFLAGS = @FFLAGS@
|
||||
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@
|
||||
LIBTOOL = @LIBTOOL@
|
||||
LN_S = @LN_S@
|
||||
LTLIBOBJS = @LTLIBOBJS@
|
||||
MAKEINFO = @MAKEINFO@
|
||||
MICROHTTPD_LIBS = @MICROHTTPD_LIBS@
|
||||
MKDIR_P = @MKDIR_P@
|
||||
OBJEXT = @OBJEXT@
|
||||
OLAD_DEFINES = @OLAD_DEFINES@
|
||||
OLA_SERVER_LIBS = @OLA_SERVER_LIBS@
|
||||
OSSP_UUID_CFLAGS = @OSSP_UUID_CFLAGS@
|
||||
OSSP_UUID_LIBS = @OSSP_UUID_LIBS@
|
||||
PACKAGE = @PACKAGE@
|
||||
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
|
||||
PACKAGE_NAME = @PACKAGE_NAME@
|
||||
PACKAGE_STRING = @PACKAGE_STRING@
|
||||
PACKAGE_TARNAME = @PACKAGE_TARNAME@
|
||||
PACKAGE_VERSION = @PACKAGE_VERSION@
|
||||
PATH_SEPARATOR = @PATH_SEPARATOR@
|
||||
PKG_CONFIG = @PKG_CONFIG@
|
||||
PLUGIN_LIBS = @PLUGIN_LIBS@
|
||||
PROTOC = @PROTOC@
|
||||
PYTHON = @PYTHON@
|
||||
PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
|
||||
PYTHON_PLATFORM = @PYTHON_PLATFORM@
|
||||
PYTHON_PREFIX = @PYTHON_PREFIX@
|
||||
PYTHON_VERSION = @PYTHON_VERSION@
|
||||
RANLIB = @RANLIB@
|
||||
SET_MAKE = @SET_MAKE@
|
||||
SHELL = @SHELL@
|
||||
STRIP = @STRIP@
|
||||
UUID_CFLAGS = @UUID_CFLAGS@
|
||||
UUID_LIBS = @UUID_LIBS@
|
||||
VERSION = @VERSION@
|
||||
abs_builddir = @abs_builddir@
|
||||
abs_srcdir = @abs_srcdir@
|
||||
abs_top_builddir = @abs_top_builddir@
|
||||
abs_top_srcdir = @abs_top_srcdir@
|
||||
ac_aux_dir = @ac_aux_dir@
|
||||
ac_ct_CC = @ac_ct_CC@
|
||||
ac_ct_CXX = @ac_ct_CXX@
|
||||
ac_ct_F77 = @ac_ct_F77@
|
||||
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@
|
||||
libusb_CFLAGS = @libusb_CFLAGS@
|
||||
libusb_LIBS = @libusb_LIBS@
|
||||
localedir = @localedir@
|
||||
localstatedir = @localstatedir@
|
||||
mandir = @mandir@
|
||||
mkdir_p = @mkdir_p@
|
||||
oldincludedir = @oldincludedir@
|
||||
pdfdir = @pdfdir@
|
||||
pkgpyexecdir = @pkgpyexecdir@
|
||||
pkgpythondir = @pkgpythondir@
|
||||
plugindir = @plugindir@
|
||||
prefix = @prefix@
|
||||
program_transform_name = @program_transform_name@
|
||||
psdir = @psdir@
|
||||
pyexecdir = @pyexecdir@
|
||||
pythondir = @pythondir@
|
||||
sbindir = @sbindir@
|
||||
sharedstatedir = @sharedstatedir@
|
||||
srcdir = @srcdir@
|
||||
sysconfdir = @sysconfdir@
|
||||
target_alias = @target_alias@
|
||||
top_builddir = @top_builddir@
|
||||
top_srcdir = @top_srcdir@
|
||||
www_datadir = @www_datadir@
|
||||
AM_CPPFLAGS = -I$(top_builddir)/include -Wall -Wformat -W -Werror -Wno-deprecated
|
||||
noinst_LTLIBRARIES = liblogging.la
|
||||
liblogging_la_SOURCES = Logging.cpp
|
||||
LoggingTester_SOURCES = LoggingTester.cpp LoggingTest.cpp
|
||||
LoggingTester_CXXFLAGS = $(CPPUNIT_CFLAGS)
|
||||
LoggingTester_LDFLAGS = $(CPPUNIT_LIBS)
|
||||
LoggingTester_LDADD = ./liblogging.la ../utils/libolautils.la
|
||||
all: all-am
|
||||
|
||||
.SUFFIXES:
|
||||
.SUFFIXES: .cpp .lo .o .obj
|
||||
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/common.mk $(am__configure_deps)
|
||||
@for dep in $?; do \
|
||||
case '$(am__configure_deps)' in \
|
||||
*$$dep*) \
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
|
||||
&& exit 0; \
|
||||
exit 1;; \
|
||||
esac; \
|
||||
done; \
|
||||
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu common/logging/Makefile'; \
|
||||
cd $(top_srcdir) && \
|
||||
$(AUTOMAKE) --gnu common/logging/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
|
||||
|
||||
clean-noinstLTLIBRARIES:
|
||||
-test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES)
|
||||
@list='$(noinst_LTLIBRARIES)'; for p in $$list; do \
|
||||
dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
|
||||
test "$$dir" != "$$p" || dir=.; \
|
||||
echo "rm -f \"$${dir}/so_locations\""; \
|
||||
rm -f "$${dir}/so_locations"; \
|
||||
done
|
||||
liblogging.la: $(liblogging_la_OBJECTS) $(liblogging_la_DEPENDENCIES)
|
||||
$(CXXLINK) $(liblogging_la_OBJECTS) $(liblogging_la_LIBADD) $(LIBS)
|
||||
|
||||
clean-checkPROGRAMS:
|
||||
@list='$(check_PROGRAMS)'; for p in $$list; do \
|
||||
f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
|
||||
echo " rm -f $$p $$f"; \
|
||||
rm -f $$p $$f ; \
|
||||
done
|
||||
LoggingTester$(EXEEXT): $(LoggingTester_OBJECTS) $(LoggingTester_DEPENDENCIES)
|
||||
@rm -f LoggingTester$(EXEEXT)
|
||||
$(LoggingTester_LINK) $(LoggingTester_OBJECTS) $(LoggingTester_LDADD) $(LIBS)
|
||||
|
||||
mostlyclean-compile:
|
||||
-rm -f *.$(OBJEXT)
|
||||
|
||||
distclean-compile:
|
||||
-rm -f *.tab.c
|
||||
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Logging.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/LoggingTester-LoggingTest.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/LoggingTester-LoggingTester.Po@am__quote@
|
||||
|
||||
.cpp.o:
|
||||
@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
|
||||
@am__fastdepCXX_TRUE@ mv -f $(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@ mv -f $(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) '$<'`
|
||||
|
||||
.cpp.lo:
|
||||
@am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
|
||||
@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
|
||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $<
|
||||
|
||||
LoggingTester-LoggingTester.o: LoggingTester.cpp
|
||||
@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(LoggingTester_CXXFLAGS) $(CXXFLAGS) -MT LoggingTester-LoggingTester.o -MD -MP -MF $(DEPDIR)/LoggingTester-LoggingTester.Tpo -c -o LoggingTester-LoggingTester.o `test -f 'LoggingTester.cpp' || echo '$(srcdir)/'`LoggingTester.cpp
|
||||
@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/LoggingTester-LoggingTester.Tpo $(DEPDIR)/LoggingTester-LoggingTester.Po
|
||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='LoggingTester.cpp' object='LoggingTester-LoggingTester.o' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(LoggingTester_CXXFLAGS) $(CXXFLAGS) -c -o LoggingTester-LoggingTester.o `test -f 'LoggingTester.cpp' || echo '$(srcdir)/'`LoggingTester.cpp
|
||||
|
||||
LoggingTester-LoggingTester.obj: LoggingTester.cpp
|
||||
@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(LoggingTester_CXXFLAGS) $(CXXFLAGS) -MT LoggingTester-LoggingTester.obj -MD -MP -MF $(DEPDIR)/LoggingTester-LoggingTester.Tpo -c -o LoggingTester-LoggingTester.obj `if test -f 'LoggingTester.cpp'; then $(CYGPATH_W) 'LoggingTester.cpp'; else $(CYGPATH_W) '$(srcdir)/LoggingTester.cpp'; fi`
|
||||
@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/LoggingTester-LoggingTester.Tpo $(DEPDIR)/LoggingTester-LoggingTester.Po
|
||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='LoggingTester.cpp' object='LoggingTester-LoggingTester.obj' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(LoggingTester_CXXFLAGS) $(CXXFLAGS) -c -o LoggingTester-LoggingTester.obj `if test -f 'LoggingTester.cpp'; then $(CYGPATH_W) 'LoggingTester.cpp'; else $(CYGPATH_W) '$(srcdir)/LoggingTester.cpp'; fi`
|
||||
|
||||
LoggingTester-LoggingTest.o: LoggingTest.cpp
|
||||
@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(LoggingTester_CXXFLAGS) $(CXXFLAGS) -MT LoggingTester-LoggingTest.o -MD -MP -MF $(DEPDIR)/LoggingTester-LoggingTest.Tpo -c -o LoggingTester-LoggingTest.o `test -f 'LoggingTest.cpp' || echo '$(srcdir)/'`LoggingTest.cpp
|
||||
@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/LoggingTester-LoggingTest.Tpo $(DEPDIR)/LoggingTester-LoggingTest.Po
|
||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='LoggingTest.cpp' object='LoggingTester-LoggingTest.o' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(LoggingTester_CXXFLAGS) $(CXXFLAGS) -c -o LoggingTester-LoggingTest.o `test -f 'LoggingTest.cpp' || echo '$(srcdir)/'`LoggingTest.cpp
|
||||
|
||||
LoggingTester-LoggingTest.obj: LoggingTest.cpp
|
||||
@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(LoggingTester_CXXFLAGS) $(CXXFLAGS) -MT LoggingTester-LoggingTest.obj -MD -MP -MF $(DEPDIR)/LoggingTester-LoggingTest.Tpo -c -o LoggingTester-LoggingTest.obj `if test -f 'LoggingTest.cpp'; then $(CYGPATH_W) 'LoggingTest.cpp'; else $(CYGPATH_W) '$(srcdir)/LoggingTest.cpp'; fi`
|
||||
@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/LoggingTester-LoggingTest.Tpo $(DEPDIR)/LoggingTester-LoggingTest.Po
|
||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='LoggingTest.cpp' object='LoggingTester-LoggingTest.obj' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(LoggingTester_CXXFLAGS) $(CXXFLAGS) -c -o LoggingTester-LoggingTest.obj `if test -f 'LoggingTest.cpp'; then $(CYGPATH_W) 'LoggingTest.cpp'; else $(CYGPATH_W) '$(srcdir)/LoggingTest.cpp'; fi`
|
||||
|
||||
mostlyclean-libtool:
|
||||
-rm -f *.lo
|
||||
|
||||
clean-libtool:
|
||||
-rm -rf .libs _libs
|
||||
|
||||
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) ' { files[$$0] = 1; } \
|
||||
END { for (i in files) print i; }'`; \
|
||||
mkid -fID $$unique
|
||||
tags: TAGS
|
||||
|
||||
TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
|
||||
$(TAGS_FILES) $(LISP)
|
||||
tags=; \
|
||||
here=`pwd`; \
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) ' { files[$$0] = 1; } \
|
||||
END { for (i in files) print i; }'`; \
|
||||
if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
|
||||
test -n "$$unique" || unique=$$empty_fix; \
|
||||
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
|
||||
$$tags $$unique; \
|
||||
fi
|
||||
ctags: CTAGS
|
||||
CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
|
||||
$(TAGS_FILES) $(LISP)
|
||||
tags=; \
|
||||
here=`pwd`; \
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) ' { files[$$0] = 1; } \
|
||||
END { for (i in files) print i; }'`; \
|
||||
test -z "$(CTAGS_ARGS)$$tags$$unique" \
|
||||
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
|
||||
$$tags $$unique
|
||||
|
||||
GTAGS:
|
||||
here=`$(am__cd) $(top_builddir) && pwd` \
|
||||
&& cd $(top_srcdir) \
|
||||
&& gtags -i $(GTAGS_ARGS) $$here
|
||||
|
||||
distclean-tags:
|
||||
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
|
||||
|
||||
check-TESTS: $(TESTS)
|
||||
@failed=0; all=0; xfail=0; xpass=0; skip=0; ws='[ ]'; \
|
||||
srcdir=$(srcdir); export srcdir; \
|
||||
list=' $(TESTS) '; \
|
||||
if test -n "$$list"; then \
|
||||
for tst in $$list; do \
|
||||
if test -f ./$$tst; then dir=./; \
|
||||
elif test -f $$tst; then dir=; \
|
||||
else dir="$(srcdir)/"; fi; \
|
||||
if $(TESTS_ENVIRONMENT) $${dir}$$tst; then \
|
||||
all=`expr $$all + 1`; \
|
||||
case " $(XFAIL_TESTS) " in \
|
||||
*$$ws$$tst$$ws*) \
|
||||
xpass=`expr $$xpass + 1`; \
|
||||
failed=`expr $$failed + 1`; \
|
||||
echo "XPASS: $$tst"; \
|
||||
;; \
|
||||
*) \
|
||||
echo "PASS: $$tst"; \
|
||||
;; \
|
||||
esac; \
|
||||
elif test $$? -ne 77; then \
|
||||
all=`expr $$all + 1`; \
|
||||
case " $(XFAIL_TESTS) " in \
|
||||
*$$ws$$tst$$ws*) \
|
||||
xfail=`expr $$xfail + 1`; \
|
||||
echo "XFAIL: $$tst"; \
|
||||
;; \
|
||||
*) \
|
||||
failed=`expr $$failed + 1`; \
|
||||
echo "FAIL: $$tst"; \
|
||||
;; \
|
||||
esac; \
|
||||
else \
|
||||
skip=`expr $$skip + 1`; \
|
||||
echo "SKIP: $$tst"; \
|
||||
fi; \
|
||||
done; \
|
||||
if test "$$failed" -eq 0; then \
|
||||
if test "$$xfail" -eq 0; then \
|
||||
banner="All $$all tests passed"; \
|
||||
else \
|
||||
banner="All $$all tests behaved as expected ($$xfail expected failures)"; \
|
||||
fi; \
|
||||
else \
|
||||
if test "$$xpass" -eq 0; then \
|
||||
banner="$$failed of $$all tests failed"; \
|
||||
else \
|
||||
banner="$$failed of $$all tests did not behave as expected ($$xpass unexpected passes)"; \
|
||||
fi; \
|
||||
fi; \
|
||||
dashes="$$banner"; \
|
||||
skipped=""; \
|
||||
if test "$$skip" -ne 0; then \
|
||||
skipped="($$skip tests were not run)"; \
|
||||
test `echo "$$skipped" | wc -c` -le `echo "$$banner" | wc -c` || \
|
||||
dashes="$$skipped"; \
|
||||
fi; \
|
||||
report=""; \
|
||||
if test "$$failed" -ne 0 && test -n "$(PACKAGE_BUGREPORT)"; then \
|
||||
report="Please report to $(PACKAGE_BUGREPORT)"; \
|
||||
test `echo "$$report" | wc -c` -le `echo "$$banner" | wc -c` || \
|
||||
dashes="$$report"; \
|
||||
fi; \
|
||||
dashes=`echo "$$dashes" | sed s/./=/g`; \
|
||||
echo "$$dashes"; \
|
||||
echo "$$banner"; \
|
||||
test -z "$$skipped" || echo "$$skipped"; \
|
||||
test -z "$$report" || echo "$$report"; \
|
||||
echo "$$dashes"; \
|
||||
test "$$failed" -eq 0; \
|
||||
else :; fi
|
||||
|
||||
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 $(srcdir)/$$file && test $$d != $(srcdir); then \
|
||||
cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
|
||||
fi; \
|
||||
cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
|
||||
else \
|
||||
test -f $(distdir)/$$file \
|
||||
|| cp -p $$d/$$file $(distdir)/$$file \
|
||||
|| exit 1; \
|
||||
fi; \
|
||||
done
|
||||
check-am: all-am
|
||||
$(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS)
|
||||
$(MAKE) $(AM_MAKEFLAGS) check-TESTS
|
||||
check: check-am
|
||||
all-am: Makefile $(LTLIBRARIES)
|
||||
installdirs:
|
||||
install: install-am
|
||||
install-exec: install-exec-am
|
||||
install-data: install-data-am
|
||||
uninstall: uninstall-am
|
||||
|
||||
install-am: all-am
|
||||
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
|
||||
|
||||
installcheck: installcheck-am
|
||||
install-strip:
|
||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
||||
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
|
||||
`test -z '$(STRIP)' || \
|
||||
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
|
||||
mostlyclean-generic:
|
||||
|
||||
clean-generic:
|
||||
|
||||
distclean-generic:
|
||||
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
|
||||
|
||||
maintainer-clean-generic:
|
||||
@echo "This command is intended for maintainers to use"
|
||||
@echo "it deletes files that may require special tools to rebuild."
|
||||
clean: clean-am
|
||||
|
||||
clean-am: clean-checkPROGRAMS clean-generic clean-libtool \
|
||||
clean-noinstLTLIBRARIES mostlyclean-am
|
||||
|
||||
distclean: distclean-am
|
||||
-rm -rf ./$(DEPDIR)
|
||||
-rm -f Makefile
|
||||
distclean-am: clean-am distclean-compile distclean-generic \
|
||||
distclean-tags
|
||||
|
||||
dvi: dvi-am
|
||||
|
||||
dvi-am:
|
||||
|
||||
html: html-am
|
||||
|
||||
info: info-am
|
||||
|
||||
info-am:
|
||||
|
||||
install-data-am:
|
||||
|
||||
install-dvi: install-dvi-am
|
||||
|
||||
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
|
||||
|
||||
installcheck-am:
|
||||
|
||||
maintainer-clean: maintainer-clean-am
|
||||
-rm -rf ./$(DEPDIR)
|
||||
-rm -f Makefile
|
||||
maintainer-clean-am: distclean-am maintainer-clean-generic
|
||||
|
||||
mostlyclean: mostlyclean-am
|
||||
|
||||
mostlyclean-am: mostlyclean-compile mostlyclean-generic \
|
||||
mostlyclean-libtool
|
||||
|
||||
pdf: pdf-am
|
||||
|
||||
pdf-am:
|
||||
|
||||
ps: ps-am
|
||||
|
||||
ps-am:
|
||||
|
||||
uninstall-am:
|
||||
|
||||
.MAKE: install-am install-strip
|
||||
|
||||
.PHONY: CTAGS GTAGS all all-am check check-TESTS check-am clean \
|
||||
clean-checkPROGRAMS clean-generic clean-libtool \
|
||||
clean-noinstLTLIBRARIES ctags distclean distclean-compile \
|
||||
distclean-generic distclean-libtool distclean-tags distdir dvi \
|
||||
dvi-am html html-am info info-am install install-am \
|
||||
install-data install-data-am install-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 mostlyclean-libtool pdf pdf-am ps ps-am \
|
||||
tags 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:
|
|
@ -0,0 +1,125 @@
|
|||
/*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
* InterfacePicker.cpp
|
||||
* Chooses an interface to listen on
|
||||
* Copyright (C) 2005-2009 Simon Newton
|
||||
*/
|
||||
|
||||
#include <string.h>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "ola/Logging.h"
|
||||
#include "ola/network/InterfacePicker.h"
|
||||
#include "ola/network/NetworkUtils.h"
|
||||
|
||||
#ifdef WIN32
|
||||
#include "common/network/WindowsInterfacePicker.h"
|
||||
#else
|
||||
#include "common/network/PosixInterfacePicker.h"
|
||||
#endif
|
||||
|
||||
namespace ola {
|
||||
namespace network {
|
||||
|
||||
using std::string;
|
||||
using std::vector;
|
||||
|
||||
|
||||
Interface::Interface() {
|
||||
ip_address.s_addr = 0;
|
||||
bcast_address.s_addr = 0;
|
||||
subnet_address.s_addr = 0;
|
||||
memset(hw_address, 0, MAC_LENGTH);
|
||||
}
|
||||
|
||||
|
||||
Interface::Interface(const Interface &other) {
|
||||
name = other.name;
|
||||
ip_address = other.ip_address;
|
||||
bcast_address = other.bcast_address;
|
||||
subnet_address = other.subnet_address;
|
||||
memcpy(hw_address, other.hw_address, MAC_LENGTH);
|
||||
}
|
||||
|
||||
|
||||
Interface& Interface::operator=(const Interface &other) {
|
||||
if (this != &other) {
|
||||
name = other.name;
|
||||
ip_address = other.ip_address;
|
||||
bcast_address = other.bcast_address;
|
||||
subnet_address = other.subnet_address;
|
||||
memcpy(hw_address, other.hw_address, MAC_LENGTH);
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
bool Interface::operator==(const Interface &other) {
|
||||
return (name == other.name &&
|
||||
ip_address.s_addr == other.ip_address.s_addr &&
|
||||
subnet_address.s_addr == other.subnet_address.s_addr);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Select an interface to use
|
||||
* @param interface, the interface to populate
|
||||
* @param preferred_ip the ip address of the local interface we'd prefer to use
|
||||
* @return true if we found an interface, false otherwise
|
||||
*/
|
||||
bool InterfacePicker::ChooseInterface(Interface *iface,
|
||||
const string &preferred_ip) const {
|
||||
struct in_addr wanted_ip;
|
||||
bool use_preferred = false;
|
||||
vector<Interface> interfaces = GetInterfaces();
|
||||
|
||||
if (!interfaces.size()) {
|
||||
OLA_INFO << "No interfaces found";
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!preferred_ip.empty()) {
|
||||
if (StringToAddress(preferred_ip, wanted_ip))
|
||||
use_preferred = true;
|
||||
}
|
||||
|
||||
if (use_preferred) {
|
||||
vector<Interface>::const_iterator iter;
|
||||
for (iter = interfaces.begin(); iter != interfaces.end(); ++iter) {
|
||||
if ((*iter).ip_address.s_addr == wanted_ip.s_addr) {
|
||||
*iface = *iter;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
*iface = interfaces[0];
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Create the appropriate picker
|
||||
*/
|
||||
InterfacePicker *InterfacePicker::NewPicker() {
|
||||
#ifdef WIN32
|
||||
return new WindowsInterfacePicker();
|
||||
#else
|
||||
return new PosixInterfacePicker();
|
||||
#endif
|
||||
}
|
||||
} // network
|
||||
} // ola
|
|
@ -0,0 +1,116 @@
|
|||
/*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
* InterfacePickerTest.cpp
|
||||
* Test fixture for the InterfacePicker class
|
||||
* Copyright (C) 2005-2009 Simon Newton
|
||||
*/
|
||||
|
||||
#include <arpa/inet.h>
|
||||
#include <cppunit/extensions/HelperMacros.h>
|
||||
#include <iomanip>
|
||||
#include <iostream>
|
||||
#include <vector>
|
||||
|
||||
#include "ola/network/InterfacePicker.h"
|
||||
#include "ola/network/NetworkUtils.h"
|
||||
#include "ola/Logging.h"
|
||||
|
||||
using ola::network::InterfacePicker;
|
||||
using ola::network::Interface;
|
||||
using ola::network::StringToAddress;
|
||||
using std::vector;
|
||||
using std::cout;
|
||||
using std::endl;
|
||||
|
||||
class InterfacePickerTest: public CppUnit::TestFixture {
|
||||
CPPUNIT_TEST_SUITE(InterfacePickerTest);
|
||||
CPPUNIT_TEST(testGetInterfaces);
|
||||
CPPUNIT_TEST(testChooseInterface);
|
||||
CPPUNIT_TEST_SUITE_END();
|
||||
|
||||
public:
|
||||
void testGetInterfaces();
|
||||
void testChooseInterface();
|
||||
};
|
||||
|
||||
class MockPicker: public InterfacePicker {
|
||||
public:
|
||||
explicit MockPicker(const vector<Interface> &interfaces)
|
||||
: InterfacePicker(),
|
||||
m_interfaces(interfaces) {}
|
||||
std::vector<Interface> GetInterfaces() const { return m_interfaces; }
|
||||
private:
|
||||
const vector<Interface> &m_interfaces;
|
||||
};
|
||||
|
||||
CPPUNIT_TEST_SUITE_REGISTRATION(InterfacePickerTest);
|
||||
|
||||
|
||||
/*
|
||||
* Check that we find at least one candidate interface.
|
||||
*/
|
||||
void InterfacePickerTest::testGetInterfaces() {
|
||||
InterfacePicker *picker = InterfacePicker::NewPicker();
|
||||
vector<Interface> interfaces = picker->GetInterfaces();
|
||||
CPPUNIT_ASSERT(interfaces.size() > 0);
|
||||
|
||||
vector<Interface>::iterator iter;
|
||||
cout << endl;
|
||||
for (iter = interfaces.begin(); iter != interfaces.end(); ++iter) {
|
||||
cout << iter->name << endl;
|
||||
cout << " ip: " << inet_ntoa(iter->ip_address) << endl;
|
||||
cout << " bcast: " << inet_ntoa(iter->bcast_address) << endl;
|
||||
cout << " subnet: " << inet_ntoa(iter->subnet_address) << endl;
|
||||
cout << " hw_addr: ";
|
||||
for (unsigned int i = 0; i < ola::network::MAC_LENGTH; i++) {
|
||||
if (i)
|
||||
cout << ':';
|
||||
cout << std::setw(2) << std::setfill('0') << std::hex <<
|
||||
0 + (uint8_t) iter->hw_address[i];
|
||||
}
|
||||
cout << endl;
|
||||
cout << "---------------" << endl;
|
||||
}
|
||||
delete picker;
|
||||
}
|
||||
|
||||
|
||||
void InterfacePickerTest::testChooseInterface() {
|
||||
vector<Interface> interfaces;
|
||||
MockPicker picker(interfaces);
|
||||
|
||||
// no interfaces
|
||||
Interface interface;
|
||||
CPPUNIT_ASSERT(!picker.ChooseInterface(&interface, ""));
|
||||
|
||||
// now with one interface that doesn't match
|
||||
Interface iface1;
|
||||
StringToAddress("10.0.0.1", iface1.ip_address);
|
||||
interfaces.push_back(iface1);
|
||||
CPPUNIT_ASSERT(picker.ChooseInterface(&interface, "192.168.1.1"));
|
||||
CPPUNIT_ASSERT(iface1 == interface);
|
||||
|
||||
// check that preferred works
|
||||
Interface iface2;
|
||||
StringToAddress("192.168.1.1", iface2.ip_address);
|
||||
interfaces.push_back(iface2);
|
||||
CPPUNIT_ASSERT(picker.ChooseInterface(&interface, "192.168.1.1"));
|
||||
CPPUNIT_ASSERT(iface2 == interface);
|
||||
|
||||
// a invalid address should return the first one
|
||||
CPPUNIT_ASSERT(picker.ChooseInterface(&interface, "foo"));
|
||||
CPPUNIT_ASSERT(iface1 == interface);
|
||||
}
|
|
@ -0,0 +1,25 @@
|
|||
include $(top_srcdir)/common.mk
|
||||
|
||||
noinst_LTLIBRARIES = libolanetwork.la
|
||||
libolanetwork_la_SOURCES = InterfacePicker.cpp NetworkUtils.cpp \
|
||||
SelectServer.cpp Socket.cpp
|
||||
|
||||
if USING_WIN32
|
||||
libolanetwork_la_SOURCES += WindowsInterfacePicker.cpp
|
||||
else
|
||||
libolanetwork_la_SOURCES += PosixInterfacePicker.cpp
|
||||
endif
|
||||
|
||||
EXTRA_DIST = PosixInterfacePicker.h WindowsInterfacePicker.h
|
||||
|
||||
TESTS = NetworkTester
|
||||
check_PROGRAMS = $(TESTS)
|
||||
NetworkTester_SOURCES = SelectServerTester.cpp SocketTest.cpp \
|
||||
NetworkTest.cpp NetworkUtilsTest.cpp \
|
||||
InterfacePickerTest.cpp
|
||||
NetworkTester_CXXFLAGS = $(CPPUNIT_CFLAGS)
|
||||
NetworkTester_LDFLAGS = $(CPPUNIT_LIBS)
|
||||
NetworkTester_LDADD = ./libolanetwork.la \
|
||||
../export_map/libolaexportmap.la \
|
||||
../logging/liblogging.la \
|
||||
../utils/libolautils.la
|
|
@ -0,0 +1,664 @@
|
|||
# Makefile.in generated by automake 1.10 from Makefile.am.
|
||||
# @configure_input@
|
||||
|
||||
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
|
||||
# 2003, 2004, 2005, 2006 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@
|
||||
pkglibdir = $(libdir)/@PACKAGE@
|
||||
pkgincludedir = $(includedir)/@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@
|
||||
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
|
||||
$(top_srcdir)/common.mk
|
||||
@USING_WIN32_TRUE@am__append_1 = WindowsInterfacePicker.cpp
|
||||
@USING_WIN32_FALSE@am__append_2 = PosixInterfacePicker.cpp
|
||||
TESTS = NetworkTester$(EXEEXT)
|
||||
check_PROGRAMS = $(am__EXEEXT_1)
|
||||
subdir = common/network
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
am__aclocal_m4_deps = $(top_srcdir)/config/cppunit.m4 \
|
||||
$(top_srcdir)/config/ola.m4 $(top_srcdir)/config/pkg.m4 \
|
||||
$(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 =
|
||||
LTLIBRARIES = $(noinst_LTLIBRARIES)
|
||||
libolanetwork_la_LIBADD =
|
||||
am__libolanetwork_la_SOURCES_DIST = InterfacePicker.cpp \
|
||||
NetworkUtils.cpp SelectServer.cpp Socket.cpp \
|
||||
WindowsInterfacePicker.cpp PosixInterfacePicker.cpp
|
||||
@USING_WIN32_TRUE@am__objects_1 = WindowsInterfacePicker.lo
|
||||
@USING_WIN32_FALSE@am__objects_2 = PosixInterfacePicker.lo
|
||||
am_libolanetwork_la_OBJECTS = InterfacePicker.lo NetworkUtils.lo \
|
||||
SelectServer.lo Socket.lo $(am__objects_1) $(am__objects_2)
|
||||
libolanetwork_la_OBJECTS = $(am_libolanetwork_la_OBJECTS)
|
||||
am__EXEEXT_1 = NetworkTester$(EXEEXT)
|
||||
am_NetworkTester_OBJECTS = NetworkTester-SelectServerTester.$(OBJEXT) \
|
||||
NetworkTester-SocketTest.$(OBJEXT) \
|
||||
NetworkTester-NetworkTest.$(OBJEXT) \
|
||||
NetworkTester-NetworkUtilsTest.$(OBJEXT) \
|
||||
NetworkTester-InterfacePickerTest.$(OBJEXT)
|
||||
NetworkTester_OBJECTS = $(am_NetworkTester_OBJECTS)
|
||||
NetworkTester_DEPENDENCIES = ./libolanetwork.la \
|
||||
../export_map/libolaexportmap.la ../logging/liblogging.la \
|
||||
../utils/libolautils.la
|
||||
NetworkTester_LINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) \
|
||||
$(LIBTOOLFLAGS) --mode=link $(CXXLD) $(NetworkTester_CXXFLAGS) \
|
||||
$(CXXFLAGS) $(NetworkTester_LDFLAGS) $(LDFLAGS) -o $@
|
||||
DEFAULT_INCLUDES = -I. -I$(top_builddir)@am__isrc@
|
||||
depcomp = $(SHELL) $(top_srcdir)/config/depcomp
|
||||
am__depfiles_maybe = depfiles
|
||||
CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
|
||||
$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
|
||||
LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
|
||||
--mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
|
||||
$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
|
||||
CXXLD = $(CXX)
|
||||
CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
|
||||
--mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \
|
||||
$(LDFLAGS) -o $@
|
||||
SOURCES = $(libolanetwork_la_SOURCES) $(NetworkTester_SOURCES)
|
||||
DIST_SOURCES = $(am__libolanetwork_la_SOURCES_DIST) \
|
||||
$(NetworkTester_SOURCES)
|
||||
ETAGS = etags
|
||||
CTAGS = ctags
|
||||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
||||
ACLOCAL = @ACLOCAL@
|
||||
AMTAR = @AMTAR@
|
||||
AR = @AR@
|
||||
AUTOCONF = @AUTOCONF@
|
||||
AUTOHEADER = @AUTOHEADER@
|
||||
AUTOMAKE = @AUTOMAKE@
|
||||
AWK = @AWK@
|
||||
CC = @CC@
|
||||
CCDEPMODE = @CCDEPMODE@
|
||||
CFLAGS = @CFLAGS@
|
||||
CPP = @CPP@
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@
|
||||
CPPUNIT_CONFIG = @CPPUNIT_CONFIG@
|
||||
CPPUNIT_LIBS = @CPPUNIT_LIBS@
|
||||
CXX = @CXX@
|
||||
CXXCPP = @CXXCPP@
|
||||
CXXDEPMODE = @CXXDEPMODE@
|
||||
CXXFLAGS = @CXXFLAGS@
|
||||
CYGPATH_W = @CYGPATH_W@
|
||||
DEFS = @DEFS@
|
||||
DEPDIR = @DEPDIR@
|
||||
ECHO = @ECHO@
|
||||
ECHO_C = @ECHO_C@
|
||||
ECHO_N = @ECHO_N@
|
||||
ECHO_T = @ECHO_T@
|
||||
EGREP = @EGREP@
|
||||
EXEEXT = @EXEEXT@
|
||||
F77 = @F77@
|
||||
FFLAGS = @FFLAGS@
|
||||
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@
|
||||
LIBTOOL = @LIBTOOL@
|
||||
LN_S = @LN_S@
|
||||
LTLIBOBJS = @LTLIBOBJS@
|
||||
MAKEINFO = @MAKEINFO@
|
||||
MICROHTTPD_LIBS = @MICROHTTPD_LIBS@
|
||||
MKDIR_P = @MKDIR_P@
|
||||
OBJEXT = @OBJEXT@
|
||||
OLAD_DEFINES = @OLAD_DEFINES@
|
||||
OLA_SERVER_LIBS = @OLA_SERVER_LIBS@
|
||||
OSSP_UUID_CFLAGS = @OSSP_UUID_CFLAGS@
|
||||
OSSP_UUID_LIBS = @OSSP_UUID_LIBS@
|
||||
PACKAGE = @PACKAGE@
|
||||
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
|
||||
PACKAGE_NAME = @PACKAGE_NAME@
|
||||
PACKAGE_STRING = @PACKAGE_STRING@
|
||||
PACKAGE_TARNAME = @PACKAGE_TARNAME@
|
||||
PACKAGE_VERSION = @PACKAGE_VERSION@
|
||||
PATH_SEPARATOR = @PATH_SEPARATOR@
|
||||
PKG_CONFIG = @PKG_CONFIG@
|
||||
PLUGIN_LIBS = @PLUGIN_LIBS@
|
||||
PROTOC = @PROTOC@
|
||||
PYTHON = @PYTHON@
|
||||
PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
|
||||
PYTHON_PLATFORM = @PYTHON_PLATFORM@
|
||||
PYTHON_PREFIX = @PYTHON_PREFIX@
|
||||
PYTHON_VERSION = @PYTHON_VERSION@
|
||||
RANLIB = @RANLIB@
|
||||
SET_MAKE = @SET_MAKE@
|
||||
SHELL = @SHELL@
|
||||
STRIP = @STRIP@
|
||||
UUID_CFLAGS = @UUID_CFLAGS@
|
||||
UUID_LIBS = @UUID_LIBS@
|
||||
VERSION = @VERSION@
|
||||
abs_builddir = @abs_builddir@
|
||||
abs_srcdir = @abs_srcdir@
|
||||
abs_top_builddir = @abs_top_builddir@
|
||||
abs_top_srcdir = @abs_top_srcdir@
|
||||
ac_aux_dir = @ac_aux_dir@
|
||||
ac_ct_CC = @ac_ct_CC@
|
||||
ac_ct_CXX = @ac_ct_CXX@
|
||||
ac_ct_F77 = @ac_ct_F77@
|
||||
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@
|
||||
libusb_CFLAGS = @libusb_CFLAGS@
|
||||
libusb_LIBS = @libusb_LIBS@
|
||||
localedir = @localedir@
|
||||
localstatedir = @localstatedir@
|
||||
mandir = @mandir@
|
||||
mkdir_p = @mkdir_p@
|
||||
oldincludedir = @oldincludedir@
|
||||
pdfdir = @pdfdir@
|
||||
pkgpyexecdir = @pkgpyexecdir@
|
||||
pkgpythondir = @pkgpythondir@
|
||||
plugindir = @plugindir@
|
||||
prefix = @prefix@
|
||||
program_transform_name = @program_transform_name@
|
||||
psdir = @psdir@
|
||||
pyexecdir = @pyexecdir@
|
||||
pythondir = @pythondir@
|
||||
sbindir = @sbindir@
|
||||
sharedstatedir = @sharedstatedir@
|
||||
srcdir = @srcdir@
|
||||
sysconfdir = @sysconfdir@
|
||||
target_alias = @target_alias@
|
||||
top_builddir = @top_builddir@
|
||||
top_srcdir = @top_srcdir@
|
||||
www_datadir = @www_datadir@
|
||||
AM_CPPFLAGS = -I$(top_builddir)/include -Wall -Wformat -W -Werror -Wno-deprecated
|
||||
noinst_LTLIBRARIES = libolanetwork.la
|
||||
libolanetwork_la_SOURCES = InterfacePicker.cpp NetworkUtils.cpp \
|
||||
SelectServer.cpp Socket.cpp $(am__append_1) $(am__append_2)
|
||||
EXTRA_DIST = PosixInterfacePicker.h WindowsInterfacePicker.h
|
||||
NetworkTester_SOURCES = SelectServerTester.cpp SocketTest.cpp \
|
||||
NetworkTest.cpp NetworkUtilsTest.cpp \
|
||||
InterfacePickerTest.cpp
|
||||
|
||||
NetworkTester_CXXFLAGS = $(CPPUNIT_CFLAGS)
|
||||
NetworkTester_LDFLAGS = $(CPPUNIT_LIBS)
|
||||
NetworkTester_LDADD = ./libolanetwork.la \
|
||||
../export_map/libolaexportmap.la \
|
||||
../logging/liblogging.la \
|
||||
../utils/libolautils.la
|
||||
|
||||
all: all-am
|
||||
|
||||
.SUFFIXES:
|
||||
.SUFFIXES: .cpp .lo .o .obj
|
||||
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/common.mk $(am__configure_deps)
|
||||
@for dep in $?; do \
|
||||
case '$(am__configure_deps)' in \
|
||||
*$$dep*) \
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
|
||||
&& exit 0; \
|
||||
exit 1;; \
|
||||
esac; \
|
||||
done; \
|
||||
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu common/network/Makefile'; \
|
||||
cd $(top_srcdir) && \
|
||||
$(AUTOMAKE) --gnu common/network/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
|
||||
|
||||
clean-noinstLTLIBRARIES:
|
||||
-test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES)
|
||||
@list='$(noinst_LTLIBRARIES)'; for p in $$list; do \
|
||||
dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
|
||||
test "$$dir" != "$$p" || dir=.; \
|
||||
echo "rm -f \"$${dir}/so_locations\""; \
|
||||
rm -f "$${dir}/so_locations"; \
|
||||
done
|
||||
libolanetwork.la: $(libolanetwork_la_OBJECTS) $(libolanetwork_la_DEPENDENCIES)
|
||||
$(CXXLINK) $(libolanetwork_la_OBJECTS) $(libolanetwork_la_LIBADD) $(LIBS)
|
||||
|
||||
clean-checkPROGRAMS:
|
||||
@list='$(check_PROGRAMS)'; for p in $$list; do \
|
||||
f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
|
||||
echo " rm -f $$p $$f"; \
|
||||
rm -f $$p $$f ; \
|
||||
done
|
||||
NetworkTester$(EXEEXT): $(NetworkTester_OBJECTS) $(NetworkTester_DEPENDENCIES)
|
||||
@rm -f NetworkTester$(EXEEXT)
|
||||
$(NetworkTester_LINK) $(NetworkTester_OBJECTS) $(NetworkTester_LDADD) $(LIBS)
|
||||
|
||||
mostlyclean-compile:
|
||||
-rm -f *.$(OBJEXT)
|
||||
|
||||
distclean-compile:
|
||||
-rm -f *.tab.c
|
||||
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/InterfacePicker.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/NetworkTester-InterfacePickerTest.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/NetworkTester-NetworkTest.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/NetworkTester-NetworkUtilsTest.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/NetworkTester-SelectServerTester.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/NetworkTester-SocketTest.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/NetworkUtils.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/PosixInterfacePicker.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SelectServer.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Socket.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/WindowsInterfacePicker.Plo@am__quote@
|
||||
|
||||
.cpp.o:
|
||||
@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
|
||||
@am__fastdepCXX_TRUE@ mv -f $(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@ mv -f $(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) '$<'`
|
||||
|
||||
.cpp.lo:
|
||||
@am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
|
||||
@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
|
||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $<
|
||||
|
||||
NetworkTester-SelectServerTester.o: SelectServerTester.cpp
|
||||
@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(NetworkTester_CXXFLAGS) $(CXXFLAGS) -MT NetworkTester-SelectServerTester.o -MD -MP -MF $(DEPDIR)/NetworkTester-SelectServerTester.Tpo -c -o NetworkTester-SelectServerTester.o `test -f 'SelectServerTester.cpp' || echo '$(srcdir)/'`SelectServerTester.cpp
|
||||
@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/NetworkTester-SelectServerTester.Tpo $(DEPDIR)/NetworkTester-SelectServerTester.Po
|
||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='SelectServerTester.cpp' object='NetworkTester-SelectServerTester.o' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(NetworkTester_CXXFLAGS) $(CXXFLAGS) -c -o NetworkTester-SelectServerTester.o `test -f 'SelectServerTester.cpp' || echo '$(srcdir)/'`SelectServerTester.cpp
|
||||
|
||||
NetworkTester-SelectServerTester.obj: SelectServerTester.cpp
|
||||
@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(NetworkTester_CXXFLAGS) $(CXXFLAGS) -MT NetworkTester-SelectServerTester.obj -MD -MP -MF $(DEPDIR)/NetworkTester-SelectServerTester.Tpo -c -o NetworkTester-SelectServerTester.obj `if test -f 'SelectServerTester.cpp'; then $(CYGPATH_W) 'SelectServerTester.cpp'; else $(CYGPATH_W) '$(srcdir)/SelectServerTester.cpp'; fi`
|
||||
@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/NetworkTester-SelectServerTester.Tpo $(DEPDIR)/NetworkTester-SelectServerTester.Po
|
||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='SelectServerTester.cpp' object='NetworkTester-SelectServerTester.obj' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(NetworkTester_CXXFLAGS) $(CXXFLAGS) -c -o NetworkTester-SelectServerTester.obj `if test -f 'SelectServerTester.cpp'; then $(CYGPATH_W) 'SelectServerTester.cpp'; else $(CYGPATH_W) '$(srcdir)/SelectServerTester.cpp'; fi`
|
||||
|
||||
NetworkTester-SocketTest.o: SocketTest.cpp
|
||||
@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(NetworkTester_CXXFLAGS) $(CXXFLAGS) -MT NetworkTester-SocketTest.o -MD -MP -MF $(DEPDIR)/NetworkTester-SocketTest.Tpo -c -o NetworkTester-SocketTest.o `test -f 'SocketTest.cpp' || echo '$(srcdir)/'`SocketTest.cpp
|
||||
@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/NetworkTester-SocketTest.Tpo $(DEPDIR)/NetworkTester-SocketTest.Po
|
||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='SocketTest.cpp' object='NetworkTester-SocketTest.o' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(NetworkTester_CXXFLAGS) $(CXXFLAGS) -c -o NetworkTester-SocketTest.o `test -f 'SocketTest.cpp' || echo '$(srcdir)/'`SocketTest.cpp
|
||||
|
||||
NetworkTester-SocketTest.obj: SocketTest.cpp
|
||||
@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(NetworkTester_CXXFLAGS) $(CXXFLAGS) -MT NetworkTester-SocketTest.obj -MD -MP -MF $(DEPDIR)/NetworkTester-SocketTest.Tpo -c -o NetworkTester-SocketTest.obj `if test -f 'SocketTest.cpp'; then $(CYGPATH_W) 'SocketTest.cpp'; else $(CYGPATH_W) '$(srcdir)/SocketTest.cpp'; fi`
|
||||
@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/NetworkTester-SocketTest.Tpo $(DEPDIR)/NetworkTester-SocketTest.Po
|
||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='SocketTest.cpp' object='NetworkTester-SocketTest.obj' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(NetworkTester_CXXFLAGS) $(CXXFLAGS) -c -o NetworkTester-SocketTest.obj `if test -f 'SocketTest.cpp'; then $(CYGPATH_W) 'SocketTest.cpp'; else $(CYGPATH_W) '$(srcdir)/SocketTest.cpp'; fi`
|
||||
|
||||
NetworkTester-NetworkTest.o: NetworkTest.cpp
|
||||
@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(NetworkTester_CXXFLAGS) $(CXXFLAGS) -MT NetworkTester-NetworkTest.o -MD -MP -MF $(DEPDIR)/NetworkTester-NetworkTest.Tpo -c -o NetworkTester-NetworkTest.o `test -f 'NetworkTest.cpp' || echo '$(srcdir)/'`NetworkTest.cpp
|
||||
@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/NetworkTester-NetworkTest.Tpo $(DEPDIR)/NetworkTester-NetworkTest.Po
|
||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='NetworkTest.cpp' object='NetworkTester-NetworkTest.o' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(NetworkTester_CXXFLAGS) $(CXXFLAGS) -c -o NetworkTester-NetworkTest.o `test -f 'NetworkTest.cpp' || echo '$(srcdir)/'`NetworkTest.cpp
|
||||
|
||||
NetworkTester-NetworkTest.obj: NetworkTest.cpp
|
||||
@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(NetworkTester_CXXFLAGS) $(CXXFLAGS) -MT NetworkTester-NetworkTest.obj -MD -MP -MF $(DEPDIR)/NetworkTester-NetworkTest.Tpo -c -o NetworkTester-NetworkTest.obj `if test -f 'NetworkTest.cpp'; then $(CYGPATH_W) 'NetworkTest.cpp'; else $(CYGPATH_W) '$(srcdir)/NetworkTest.cpp'; fi`
|
||||
@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/NetworkTester-NetworkTest.Tpo $(DEPDIR)/NetworkTester-NetworkTest.Po
|
||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='NetworkTest.cpp' object='NetworkTester-NetworkTest.obj' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(NetworkTester_CXXFLAGS) $(CXXFLAGS) -c -o NetworkTester-NetworkTest.obj `if test -f 'NetworkTest.cpp'; then $(CYGPATH_W) 'NetworkTest.cpp'; else $(CYGPATH_W) '$(srcdir)/NetworkTest.cpp'; fi`
|
||||
|
||||
NetworkTester-NetworkUtilsTest.o: NetworkUtilsTest.cpp
|
||||
@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(NetworkTester_CXXFLAGS) $(CXXFLAGS) -MT NetworkTester-NetworkUtilsTest.o -MD -MP -MF $(DEPDIR)/NetworkTester-NetworkUtilsTest.Tpo -c -o NetworkTester-NetworkUtilsTest.o `test -f 'NetworkUtilsTest.cpp' || echo '$(srcdir)/'`NetworkUtilsTest.cpp
|
||||
@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/NetworkTester-NetworkUtilsTest.Tpo $(DEPDIR)/NetworkTester-NetworkUtilsTest.Po
|
||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='NetworkUtilsTest.cpp' object='NetworkTester-NetworkUtilsTest.o' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(NetworkTester_CXXFLAGS) $(CXXFLAGS) -c -o NetworkTester-NetworkUtilsTest.o `test -f 'NetworkUtilsTest.cpp' || echo '$(srcdir)/'`NetworkUtilsTest.cpp
|
||||
|
||||
NetworkTester-NetworkUtilsTest.obj: NetworkUtilsTest.cpp
|
||||
@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(NetworkTester_CXXFLAGS) $(CXXFLAGS) -MT NetworkTester-NetworkUtilsTest.obj -MD -MP -MF $(DEPDIR)/NetworkTester-NetworkUtilsTest.Tpo -c -o NetworkTester-NetworkUtilsTest.obj `if test -f 'NetworkUtilsTest.cpp'; then $(CYGPATH_W) 'NetworkUtilsTest.cpp'; else $(CYGPATH_W) '$(srcdir)/NetworkUtilsTest.cpp'; fi`
|
||||
@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/NetworkTester-NetworkUtilsTest.Tpo $(DEPDIR)/NetworkTester-NetworkUtilsTest.Po
|
||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='NetworkUtilsTest.cpp' object='NetworkTester-NetworkUtilsTest.obj' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(NetworkTester_CXXFLAGS) $(CXXFLAGS) -c -o NetworkTester-NetworkUtilsTest.obj `if test -f 'NetworkUtilsTest.cpp'; then $(CYGPATH_W) 'NetworkUtilsTest.cpp'; else $(CYGPATH_W) '$(srcdir)/NetworkUtilsTest.cpp'; fi`
|
||||
|
||||
NetworkTester-InterfacePickerTest.o: InterfacePickerTest.cpp
|
||||
@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(NetworkTester_CXXFLAGS) $(CXXFLAGS) -MT NetworkTester-InterfacePickerTest.o -MD -MP -MF $(DEPDIR)/NetworkTester-InterfacePickerTest.Tpo -c -o NetworkTester-InterfacePickerTest.o `test -f 'InterfacePickerTest.cpp' || echo '$(srcdir)/'`InterfacePickerTest.cpp
|
||||
@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/NetworkTester-InterfacePickerTest.Tpo $(DEPDIR)/NetworkTester-InterfacePickerTest.Po
|
||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='InterfacePickerTest.cpp' object='NetworkTester-InterfacePickerTest.o' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(NetworkTester_CXXFLAGS) $(CXXFLAGS) -c -o NetworkTester-InterfacePickerTest.o `test -f 'InterfacePickerTest.cpp' || echo '$(srcdir)/'`InterfacePickerTest.cpp
|
||||
|
||||
NetworkTester-InterfacePickerTest.obj: InterfacePickerTest.cpp
|
||||
@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(NetworkTester_CXXFLAGS) $(CXXFLAGS) -MT NetworkTester-InterfacePickerTest.obj -MD -MP -MF $(DEPDIR)/NetworkTester-InterfacePickerTest.Tpo -c -o NetworkTester-InterfacePickerTest.obj `if test -f 'InterfacePickerTest.cpp'; then $(CYGPATH_W) 'InterfacePickerTest.cpp'; else $(CYGPATH_W) '$(srcdir)/InterfacePickerTest.cpp'; fi`
|
||||
@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/NetworkTester-InterfacePickerTest.Tpo $(DEPDIR)/NetworkTester-InterfacePickerTest.Po
|
||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='InterfacePickerTest.cpp' object='NetworkTester-InterfacePickerTest.obj' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(NetworkTester_CXXFLAGS) $(CXXFLAGS) -c -o NetworkTester-InterfacePickerTest.obj `if test -f 'InterfacePickerTest.cpp'; then $(CYGPATH_W) 'InterfacePickerTest.cpp'; else $(CYGPATH_W) '$(srcdir)/InterfacePickerTest.cpp'; fi`
|
||||
|
||||
mostlyclean-libtool:
|
||||
-rm -f *.lo
|
||||
|
||||
clean-libtool:
|
||||
-rm -rf .libs _libs
|
||||
|
||||
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) ' { files[$$0] = 1; } \
|
||||
END { for (i in files) print i; }'`; \
|
||||
mkid -fID $$unique
|
||||
tags: TAGS
|
||||
|
||||
TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
|
||||
$(TAGS_FILES) $(LISP)
|
||||
tags=; \
|
||||
here=`pwd`; \
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) ' { files[$$0] = 1; } \
|
||||
END { for (i in files) print i; }'`; \
|
||||
if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
|
||||
test -n "$$unique" || unique=$$empty_fix; \
|
||||
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
|
||||
$$tags $$unique; \
|
||||
fi
|
||||
ctags: CTAGS
|
||||
CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
|
||||
$(TAGS_FILES) $(LISP)
|
||||
tags=; \
|
||||
here=`pwd`; \
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) ' { files[$$0] = 1; } \
|
||||
END { for (i in files) print i; }'`; \
|
||||
test -z "$(CTAGS_ARGS)$$tags$$unique" \
|
||||
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
|
||||
$$tags $$unique
|
||||
|
||||
GTAGS:
|
||||
here=`$(am__cd) $(top_builddir) && pwd` \
|
||||
&& cd $(top_srcdir) \
|
||||
&& gtags -i $(GTAGS_ARGS) $$here
|
||||
|
||||
distclean-tags:
|
||||
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
|
||||
|
||||
check-TESTS: $(TESTS)
|
||||
@failed=0; all=0; xfail=0; xpass=0; skip=0; ws='[ ]'; \
|
||||
srcdir=$(srcdir); export srcdir; \
|
||||
list=' $(TESTS) '; \
|
||||
if test -n "$$list"; then \
|
||||
for tst in $$list; do \
|
||||
if test -f ./$$tst; then dir=./; \
|
||||
elif test -f $$tst; then dir=; \
|
||||
else dir="$(srcdir)/"; fi; \
|
||||
if $(TESTS_ENVIRONMENT) $${dir}$$tst; then \
|
||||
all=`expr $$all + 1`; \
|
||||
case " $(XFAIL_TESTS) " in \
|
||||
*$$ws$$tst$$ws*) \
|
||||
xpass=`expr $$xpass + 1`; \
|
||||
failed=`expr $$failed + 1`; \
|
||||
echo "XPASS: $$tst"; \
|
||||
;; \
|
||||
*) \
|
||||
echo "PASS: $$tst"; \
|
||||
;; \
|
||||
esac; \
|
||||
elif test $$? -ne 77; then \
|
||||
all=`expr $$all + 1`; \
|
||||
case " $(XFAIL_TESTS) " in \
|
||||
*$$ws$$tst$$ws*) \
|
||||
xfail=`expr $$xfail + 1`; \
|
||||
echo "XFAIL: $$tst"; \
|
||||
;; \
|
||||
*) \
|
||||
failed=`expr $$failed + 1`; \
|
||||
echo "FAIL: $$tst"; \
|
||||
;; \
|
||||
esac; \
|
||||
else \
|
||||
skip=`expr $$skip + 1`; \
|
||||
echo "SKIP: $$tst"; \
|
||||
fi; \
|
||||
done; \
|
||||
if test "$$failed" -eq 0; then \
|
||||
if test "$$xfail" -eq 0; then \
|
||||
banner="All $$all tests passed"; \
|
||||
else \
|
||||
banner="All $$all tests behaved as expected ($$xfail expected failures)"; \
|
||||
fi; \
|
||||
else \
|
||||
if test "$$xpass" -eq 0; then \
|
||||
banner="$$failed of $$all tests failed"; \
|
||||
else \
|
||||
banner="$$failed of $$all tests did not behave as expected ($$xpass unexpected passes)"; \
|
||||
fi; \
|
||||
fi; \
|
||||
dashes="$$banner"; \
|
||||
skipped=""; \
|
||||
if test "$$skip" -ne 0; then \
|
||||
skipped="($$skip tests were not run)"; \
|
||||
test `echo "$$skipped" | wc -c` -le `echo "$$banner" | wc -c` || \
|
||||
dashes="$$skipped"; \
|
||||
fi; \
|
||||
report=""; \
|
||||
if test "$$failed" -ne 0 && test -n "$(PACKAGE_BUGREPORT)"; then \
|
||||
report="Please report to $(PACKAGE_BUGREPORT)"; \
|
||||
test `echo "$$report" | wc -c` -le `echo "$$banner" | wc -c` || \
|
||||
dashes="$$report"; \
|
||||
fi; \
|
||||
dashes=`echo "$$dashes" | sed s/./=/g`; \
|
||||
echo "$$dashes"; \
|
||||
echo "$$banner"; \
|
||||
test -z "$$skipped" || echo "$$skipped"; \
|
||||
test -z "$$report" || echo "$$report"; \
|
||||
echo "$$dashes"; \
|
||||
test "$$failed" -eq 0; \
|
||||
else :; fi
|
||||
|
||||
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 $(srcdir)/$$file && test $$d != $(srcdir); then \
|
||||
cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
|
||||
fi; \
|
||||
cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
|
||||
else \
|
||||
test -f $(distdir)/$$file \
|
||||
|| cp -p $$d/$$file $(distdir)/$$file \
|
||||
|| exit 1; \
|
||||
fi; \
|
||||
done
|
||||
check-am: all-am
|
||||
$(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS)
|
||||
$(MAKE) $(AM_MAKEFLAGS) check-TESTS
|
||||
check: check-am
|
||||
all-am: Makefile $(LTLIBRARIES)
|
||||
installdirs:
|
||||
install: install-am
|
||||
install-exec: install-exec-am
|
||||
install-data: install-data-am
|
||||
uninstall: uninstall-am
|
||||
|
||||
install-am: all-am
|
||||
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
|
||||
|
||||
installcheck: installcheck-am
|
||||
install-strip:
|
||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
||||
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
|
||||
`test -z '$(STRIP)' || \
|
||||
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
|
||||
mostlyclean-generic:
|
||||
|
||||
clean-generic:
|
||||
|
||||
distclean-generic:
|
||||
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
|
||||
|
||||
maintainer-clean-generic:
|
||||
@echo "This command is intended for maintainers to use"
|
||||
@echo "it deletes files that may require special tools to rebuild."
|
||||
clean: clean-am
|
||||
|
||||
clean-am: clean-checkPROGRAMS clean-generic clean-libtool \
|
||||
clean-noinstLTLIBRARIES mostlyclean-am
|
||||
|
||||
distclean: distclean-am
|
||||
-rm -rf ./$(DEPDIR)
|
||||
-rm -f Makefile
|
||||
distclean-am: clean-am distclean-compile distclean-generic \
|
||||
distclean-tags
|
||||
|
||||
dvi: dvi-am
|
||||
|
||||
dvi-am:
|
||||
|
||||
html: html-am
|
||||
|
||||
info: info-am
|
||||
|
||||
info-am:
|
||||
|
||||
install-data-am:
|
||||
|
||||
install-dvi: install-dvi-am
|
||||
|
||||
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
|
||||
|
||||
installcheck-am:
|
||||
|
||||
maintainer-clean: maintainer-clean-am
|
||||
-rm -rf ./$(DEPDIR)
|
||||
-rm -f Makefile
|
||||
maintainer-clean-am: distclean-am maintainer-clean-generic
|
||||
|
||||
mostlyclean: mostlyclean-am
|
||||
|
||||
mostlyclean-am: mostlyclean-compile mostlyclean-generic \
|
||||
mostlyclean-libtool
|
||||
|
||||
pdf: pdf-am
|
||||
|
||||
pdf-am:
|
||||
|
||||
ps: ps-am
|
||||
|
||||
ps-am:
|
||||
|
||||
uninstall-am:
|
||||
|
||||
.MAKE: install-am install-strip
|
||||
|
||||
.PHONY: CTAGS GTAGS all all-am check check-TESTS check-am clean \
|
||||
clean-checkPROGRAMS clean-generic clean-libtool \
|
||||
clean-noinstLTLIBRARIES ctags distclean distclean-compile \
|
||||
distclean-generic distclean-libtool distclean-tags distdir dvi \
|
||||
dvi-am html html-am info info-am install install-am \
|
||||
install-data install-data-am install-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 mostlyclean-libtool pdf pdf-am ps ps-am \
|
||||
tags 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:
|
|
@ -0,0 +1,191 @@
|
|||
/*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
* SelectServerTest.cpp
|
||||
* Test fixture for the Socket classes
|
||||
* Copyright (C) 2005-2008 Simon Newton
|
||||
*/
|
||||
|
||||
#include <cppunit/extensions/HelperMacros.h>
|
||||
|
||||
#include "ola/Clock.h"
|
||||
#include "ola/ExportMap.h"
|
||||
#include "ola/Closure.h"
|
||||
#include "ola/network/SelectServer.h"
|
||||
#include "ola/network/Socket.h"
|
||||
|
||||
using ola::ExportMap;
|
||||
using ola::IntegerVariable;
|
||||
using ola::network::LoopbackSocket;
|
||||
using ola::network::SelectServer;
|
||||
using ola::network::UdpSocket;
|
||||
|
||||
class SelectServerTest: public CppUnit::TestFixture {
|
||||
CPPUNIT_TEST_SUITE(SelectServerTest);
|
||||
CPPUNIT_TEST(testAddRemoveSocket);
|
||||
CPPUNIT_TEST(testTimeout);
|
||||
CPPUNIT_TEST(testLoopClosures);
|
||||
CPPUNIT_TEST_SUITE_END();
|
||||
|
||||
public:
|
||||
void setUp();
|
||||
void tearDown();
|
||||
void testAddRemoveSocket();
|
||||
void testTimeout();
|
||||
void testLoopClosures();
|
||||
|
||||
void FatalTimeout() {
|
||||
CPPUNIT_ASSERT(false);
|
||||
}
|
||||
|
||||
void TerminateTimeout() {
|
||||
if (m_ss) { m_ss->Terminate(); }
|
||||
}
|
||||
|
||||
void SingleIncrementTimeout() { m_timeout_counter++; }
|
||||
|
||||
bool IncrementTimeout() {
|
||||
m_timeout_counter++;
|
||||
return true;
|
||||
}
|
||||
|
||||
void IncrementLoopCounter() { m_loop_counter++; }
|
||||
|
||||
private:
|
||||
unsigned int m_timeout_counter;
|
||||
unsigned int m_loop_counter;
|
||||
ExportMap *m_map;
|
||||
SelectServer *m_ss;
|
||||
};
|
||||
|
||||
|
||||
CPPUNIT_TEST_SUITE_REGISTRATION(SelectServerTest);
|
||||
|
||||
|
||||
void SelectServerTest::setUp() {
|
||||
m_map = new ExportMap();
|
||||
m_ss = new SelectServer(m_map);
|
||||
m_timeout_counter = 0;
|
||||
m_loop_counter = 0;
|
||||
}
|
||||
|
||||
|
||||
void SelectServerTest::tearDown() {
|
||||
delete m_ss;
|
||||
delete m_map;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Check AddSocket/RemoveSocket works correctly and that the export map is
|
||||
* updated.
|
||||
*/
|
||||
void SelectServerTest::testAddRemoveSocket() {
|
||||
LoopbackSocket bad_socket;
|
||||
IntegerVariable *connected_socket_count =
|
||||
m_map->GetIntegerVar(SelectServer::K_CONNECTED_SOCKET_VAR);
|
||||
IntegerVariable *socket_count =
|
||||
m_map->GetIntegerVar(SelectServer::K_SOCKET_VAR);
|
||||
CPPUNIT_ASSERT_EQUAL(0, connected_socket_count->Get());
|
||||
CPPUNIT_ASSERT_EQUAL(0, socket_count->Get());
|
||||
// adding and removin a non-connected socket should fail
|
||||
CPPUNIT_ASSERT(!m_ss->AddSocket(&bad_socket));
|
||||
CPPUNIT_ASSERT(!m_ss->RemoveSocket(&bad_socket));
|
||||
|
||||
LoopbackSocket loopback_socket;
|
||||
loopback_socket.Init();
|
||||
CPPUNIT_ASSERT_EQUAL(0, connected_socket_count->Get());
|
||||
CPPUNIT_ASSERT_EQUAL(0, socket_count->Get());
|
||||
CPPUNIT_ASSERT(m_ss->AddSocket(&loopback_socket));
|
||||
// Adding a second time should fail
|
||||
CPPUNIT_ASSERT(!m_ss->AddSocket(&loopback_socket));
|
||||
CPPUNIT_ASSERT_EQUAL(1, connected_socket_count->Get());
|
||||
CPPUNIT_ASSERT_EQUAL(0, socket_count->Get());
|
||||
|
||||
// Add a udp socket
|
||||
UdpSocket udp_socket;
|
||||
CPPUNIT_ASSERT(udp_socket.Init());
|
||||
CPPUNIT_ASSERT(m_ss->AddSocket(&udp_socket));
|
||||
CPPUNIT_ASSERT(!m_ss->AddSocket(&udp_socket));
|
||||
CPPUNIT_ASSERT_EQUAL(1, connected_socket_count->Get());
|
||||
CPPUNIT_ASSERT_EQUAL(1, socket_count->Get());
|
||||
|
||||
// Check remove works
|
||||
CPPUNIT_ASSERT(m_ss->RemoveSocket(&loopback_socket));
|
||||
CPPUNIT_ASSERT_EQUAL(0, connected_socket_count->Get());
|
||||
CPPUNIT_ASSERT_EQUAL(1, socket_count->Get());
|
||||
CPPUNIT_ASSERT(m_ss->RemoveSocket(&udp_socket));
|
||||
CPPUNIT_ASSERT_EQUAL(0, connected_socket_count->Get());
|
||||
CPPUNIT_ASSERT_EQUAL(0, socket_count->Get());
|
||||
|
||||
// Remove again should fail
|
||||
CPPUNIT_ASSERT(!m_ss->RemoveSocket(&loopback_socket));
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Timeout tests
|
||||
*/
|
||||
void SelectServerTest::testTimeout() {
|
||||
// check a single timeout
|
||||
m_ss->RegisterSingleTimeout(
|
||||
10,
|
||||
ola::NewSingleClosure(this, &SelectServerTest::SingleIncrementTimeout));
|
||||
m_ss->RegisterSingleTimeout(
|
||||
20,
|
||||
ola::NewSingleClosure(this, &SelectServerTest::TerminateTimeout));
|
||||
m_ss->Run();
|
||||
CPPUNIT_ASSERT_EQUAL((unsigned int) 1, m_timeout_counter);
|
||||
|
||||
// check repeating timeouts
|
||||
m_timeout_counter = 0;
|
||||
m_ss->RegisterRepeatingTimeout(
|
||||
10,
|
||||
ola::NewClosure(this, &SelectServerTest::IncrementTimeout));
|
||||
m_ss->RegisterSingleTimeout(
|
||||
98,
|
||||
ola::NewSingleClosure(this, &SelectServerTest::TerminateTimeout));
|
||||
m_ss->Restart();
|
||||
m_ss->Run();
|
||||
// Some systems have bad timing and only do 8 ticks here
|
||||
CPPUNIT_ASSERT(m_timeout_counter == 8 || m_timeout_counter == 9);
|
||||
|
||||
// check timeouts are removed correctly
|
||||
ola::network::timeout_id timeout1 = m_ss->RegisterSingleTimeout(
|
||||
10,
|
||||
ola::NewSingleClosure(this, &SelectServerTest::FatalTimeout));
|
||||
m_ss->RegisterSingleTimeout(
|
||||
20,
|
||||
ola::NewSingleClosure(this, &SelectServerTest::TerminateTimeout));
|
||||
m_ss->RemoveTimeout(timeout1);
|
||||
m_ss->Restart();
|
||||
m_ss->Run();
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Check that the loop closures are called
|
||||
*/
|
||||
void SelectServerTest::testLoopClosures() {
|
||||
m_ss->SetDefaultInterval(ola::TimeInterval(0, 100000)); // poll every 100ms
|
||||
m_ss->RunInLoop(ola::NewClosure(this,
|
||||
&SelectServerTest::IncrementLoopCounter));
|
||||
m_ss->RegisterSingleTimeout(
|
||||
500,
|
||||
ola::NewSingleClosure(this, &SelectServerTest::TerminateTimeout));
|
||||
m_ss->Run();
|
||||
// we should have at least 5 calls to IncrementLoopCounter
|
||||
CPPUNIT_ASSERT(m_loop_counter >= 5);
|
||||
}
|
|
@ -0,0 +1,222 @@
|
|||
/*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
* NetworkUtils.h
|
||||
* Abstract various network functions.
|
||||
* Copyright (C) 2005-2009 Simon Newton
|
||||
*/
|
||||
|
||||
#if HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#ifdef WIN32
|
||||
#include <winsock2.h>
|
||||
typedef unsigned long in_addr_t;
|
||||
#else
|
||||
#include <arpa/inet.h>
|
||||
#endif
|
||||
|
||||
#include <errno.h>
|
||||
#include <limits.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include <iomanip>
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include "ola/Logging.h"
|
||||
#include "ola/StringUtils.h"
|
||||
#include "ola/network/Interface.h"
|
||||
|
||||
|
||||
namespace ola {
|
||||
namespace network {
|
||||
|
||||
|
||||
/*
|
||||
* Convert a string to a struct in_addr
|
||||
*/
|
||||
bool StringToAddress(const string &address, struct in_addr &addr) {
|
||||
#ifdef HAVE_INET_ATON
|
||||
if (!inet_aton(address.data(), &addr)) {
|
||||
#else
|
||||
in_addr_t *ip_addr4 = reinterpret_cast<in_addr_t*>(&addr);
|
||||
if ((*ip_addr4 = inet_addr(address.data())) == INADDR_NONE) {
|
||||
#endif
|
||||
OLA_WARN << "Could not convert address " << address;
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
string AddressToString(const struct in_addr &addr) {
|
||||
return inet_ntoa(addr);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Convert a mac address to a human readable string
|
||||
* @param hw_address the mac address.
|
||||
* @return a string
|
||||
*/
|
||||
std::string HardwareAddressToString(uint8_t hw_address[MAC_LENGTH]) {
|
||||
std::stringstream str;
|
||||
for (unsigned int i = 0 ; i < ola::network::MAC_LENGTH; i++) {
|
||||
if (i != 0)
|
||||
str << ":";
|
||||
str << std::hex << std::setfill('0') << std::setw(2) <<
|
||||
static_cast<int>(hw_address[i]);
|
||||
}
|
||||
return str.str();
|
||||
}
|
||||
|
||||
|
||||
uint8_t NetworkToHost(uint8_t value) {
|
||||
return value;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Convert a uint16_t from network to host byte order
|
||||
*/
|
||||
uint16_t NetworkToHost(uint16_t value) {
|
||||
return ntohs(value);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Convert a uint32_t from network to host byte order
|
||||
*/
|
||||
uint32_t NetworkToHost(uint32_t value) {
|
||||
return ntohl(value);
|
||||
}
|
||||
|
||||
|
||||
int8_t NetworkToHost(int8_t value) {
|
||||
return value;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Convert a int16_t from network to host byte order
|
||||
*/
|
||||
int16_t NetworkToHost(int16_t value) {
|
||||
return ntohs(value);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Convert a int32_t from network to host byte order
|
||||
*/
|
||||
int32_t NetworkToHost(int32_t value) {
|
||||
return ntohl(value);
|
||||
}
|
||||
|
||||
uint8_t HostToNetwork(uint8_t value) {
|
||||
return value;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Convert a uint16_t from network to host byte order
|
||||
*/
|
||||
uint16_t HostToNetwork(uint16_t value) {
|
||||
return htons(value);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Convert a uint32_t from host to network byte order
|
||||
*/
|
||||
uint32_t HostToNetwork(uint32_t value) {
|
||||
return htonl(value);
|
||||
}
|
||||
|
||||
|
||||
uint8_t HostToLittleEndian(uint8_t value) {
|
||||
return value;
|
||||
}
|
||||
|
||||
|
||||
uint16_t HostToLittleEndian(uint16_t value) {
|
||||
#ifdef HAVE_ENDIAN_H
|
||||
# if BYTE_ORDER == __BIG_ENDIAN
|
||||
return ((value & 0xff) << 8) | (value >> 8);
|
||||
# else
|
||||
return value;
|
||||
# endif
|
||||
#else
|
||||
# if BYTE_ORDER == BIG_ENDIAN
|
||||
return ((value & 0xff) << 8) | (value >> 8);
|
||||
# else
|
||||
return value;
|
||||
# endif
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
uint8_t LittleEndianToHost(uint8_t value) {
|
||||
return value;
|
||||
}
|
||||
|
||||
|
||||
uint16_t LittleEndianToHost(uint16_t value) {
|
||||
#ifdef HAVE_ENDIAN_H
|
||||
# if BYTE_ORDER == __BIG_ENDIAN
|
||||
return (value >> 8) | ((value & 0xff) << 8);
|
||||
# else
|
||||
return value;
|
||||
# endif
|
||||
#else
|
||||
# if BYTE_ORDER == BIG_ENDIAN
|
||||
return (value >> 8) | ((value & 0xff) << 8);
|
||||
# else
|
||||
return value;
|
||||
# endif
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
* Return the full hostname
|
||||
*/
|
||||
string FullHostname() {
|
||||
#ifdef _POSIX_HOST_NAME_MAX
|
||||
char hostname[_POSIX_HOST_NAME_MAX];
|
||||
#else
|
||||
char hostname[256];
|
||||
#endif
|
||||
int ret = gethostname(hostname, sizeof(hostname));
|
||||
|
||||
if (ret) {
|
||||
OLA_WARN << "gethostname failed: " << strerror(errno);
|
||||
return "";
|
||||
}
|
||||
return hostname;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Return the hostname as a string.
|
||||
*/
|
||||
string Hostname() {
|
||||
string hostname = FullHostname();
|
||||
std::vector<string> tokens;
|
||||
StringSplit(hostname, tokens, ".");
|
||||
return string(tokens[0]);
|
||||
}
|
||||
} // network
|
||||
} // ola
|
|
@ -0,0 +1,85 @@
|
|||
/*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
* NetworkUtilsTest.cpp
|
||||
* Test fixture for the NetworkUtils class
|
||||
* Copyright (C) 2005-2009 Simon Newton
|
||||
*/
|
||||
|
||||
#include <cppunit/extensions/HelperMacros.h>
|
||||
|
||||
#include "ola/network/NetworkUtils.h"
|
||||
#include "ola/Logging.h"
|
||||
|
||||
using ola::network::HardwareAddressToString;
|
||||
using ola::network::HostToLittleEndian;
|
||||
using ola::network::HostToNetwork;
|
||||
using ola::network::LittleEndianToHost;
|
||||
using ola::network::NetworkToHost;
|
||||
|
||||
class NetworkUtilsTest: public CppUnit::TestFixture {
|
||||
CPPUNIT_TEST_SUITE(NetworkUtilsTest);
|
||||
CPPUNIT_TEST(testHardwareAddressToString);
|
||||
CPPUNIT_TEST(testToFromNetwork);
|
||||
CPPUNIT_TEST(testToFromLittleEndian);
|
||||
CPPUNIT_TEST_SUITE_END();
|
||||
|
||||
public:
|
||||
void testHardwareAddressToString();
|
||||
void testToFromNetwork();
|
||||
void testToFromLittleEndian();
|
||||
};
|
||||
|
||||
CPPUNIT_TEST_SUITE_REGISTRATION(NetworkUtilsTest);
|
||||
|
||||
|
||||
/*
|
||||
* Check that HardwareAddressToString works
|
||||
*/
|
||||
void NetworkUtilsTest::testHardwareAddressToString() {
|
||||
uint8_t hw_address[ola::network::MAC_LENGTH] = {
|
||||
0x0, 0xa, 0xff, 0x10, 0x25, 0x4};
|
||||
const std::string mac_address = HardwareAddressToString(hw_address);
|
||||
CPPUNIT_ASSERT_EQUAL(std::string("00:0a:ff:10:25:04"), mac_address);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Check that we can convert to/from network byte order
|
||||
*/
|
||||
void NetworkUtilsTest::testToFromNetwork() {
|
||||
uint8_t v1 = 10;
|
||||
CPPUNIT_ASSERT_EQUAL(v1, HostToNetwork(v1));
|
||||
CPPUNIT_ASSERT_EQUAL(v1, NetworkToHost(HostToNetwork(v1)));
|
||||
|
||||
uint16_t v2 = 0x0102;
|
||||
CPPUNIT_ASSERT_EQUAL(v2, NetworkToHost(HostToNetwork(v2)));
|
||||
|
||||
uint32_t v3 = 0x01020304;
|
||||
CPPUNIT_ASSERT_EQUAL(v3, NetworkToHost(HostToNetwork(v3)));
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Check that we can convert to/from little endian order
|
||||
*/
|
||||
void NetworkUtilsTest::testToFromLittleEndian() {
|
||||
uint8_t v1 = 10;
|
||||
CPPUNIT_ASSERT_EQUAL(v1, HostToLittleEndian(v1));
|
||||
CPPUNIT_ASSERT_EQUAL(v1, LittleEndianToHost(HostToLittleEndian(v1)));
|
||||
|
||||
uint16_t v2 = 0x0102;
|
||||
CPPUNIT_ASSERT_EQUAL(v2, LittleEndianToHost(HostToLittleEndian(v2)));
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue