From 5a372b5cce38d617380ed73f7c3e2af14a293282 Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Fri, 23 Dec 2022 09:14:33 +0100 Subject: [PATCH] initial checkin from gpon_dti_agent-2.0.7.tar.gz https://github.com/kbridgers/VOLTE4GFAX/raw/master/dl/gpon_dti_agent-2.0.7.tar.gz --- AUTHORS | 0 COPYING | 0 ChangeLog | 94 + LICENSE | 368 +++ Makefile.am | 48 + Makefile.in | 767 +++++ NEWS | 0 README | 0 TODO | 0 aclocal.m4 | 986 ++++++ compile | 143 + config.rpath | 666 ++++ configure | 6038 +++++++++++++++++++++++++++++++++++++ configure.in | 433 +++ depcomp | 630 ++++ doc/doxyconfig | 233 ++ doc/footer.html | 6 + doc/header.html | 5 + doc/logo.gif | Bin 0 -> 7689 bytes doc/stylesheet.css | 458 +++ install-sh | 520 ++++ missing | 376 +++ src/Makefile.am | 79 + src/Makefile.in | 613 ++++ src/dti_agent_cli.c | 64 + src/dti_agent_cli.h | 96 + src/dti_agent_config.h.in | 45 + src/dti_agent_main.c | 887 ++++++ src/dti_agent_main.h | 51 + src/dti_agent_ocal.c | 1574 ++++++++++ src/dti_agent_ocal.h | 64 + src/dti_agent_ocal_ctx.h | 88 + src/dti_agent_onu.c | 2127 +++++++++++++ src/dti_agent_onu.h | 69 + src/dti_agent_onu_ctx.h | 94 + src/dti_agent_optic.c | 2008 ++++++++++++ src/dti_agent_optic.h | 69 + src/dti_agent_optic_ctx.h | 93 + 38 files changed, 19792 insertions(+) create mode 100644 AUTHORS create mode 100644 COPYING create mode 100644 ChangeLog create mode 100644 LICENSE create mode 100644 Makefile.am create mode 100644 Makefile.in create mode 100644 NEWS create mode 100644 README create mode 100644 TODO create mode 100644 aclocal.m4 create mode 100755 compile create mode 100755 config.rpath create mode 100755 configure create mode 100644 configure.in create mode 100755 depcomp create mode 100644 doc/doxyconfig create mode 100644 doc/footer.html create mode 100644 doc/header.html create mode 100644 doc/logo.gif create mode 100644 doc/stylesheet.css create mode 100755 install-sh create mode 100755 missing create mode 100644 src/Makefile.am create mode 100644 src/Makefile.in create mode 100644 src/dti_agent_cli.c create mode 100644 src/dti_agent_cli.h create mode 100644 src/dti_agent_config.h.in create mode 100644 src/dti_agent_main.c create mode 100644 src/dti_agent_main.h create mode 100644 src/dti_agent_ocal.c create mode 100644 src/dti_agent_ocal.h create mode 100644 src/dti_agent_ocal_ctx.h create mode 100644 src/dti_agent_onu.c create mode 100644 src/dti_agent_onu.h create mode 100644 src/dti_agent_onu_ctx.h create mode 100644 src/dti_agent_optic.c create mode 100644 src/dti_agent_optic.h create mode 100644 src/dti_agent_optic_ctx.h diff --git a/AUTHORS b/AUTHORS new file mode 100644 index 0000000..e69de29 diff --git a/COPYING b/COPYING new file mode 100644 index 0000000..e69de29 diff --git a/ChangeLog b/ChangeLog new file mode 100644 index 0000000..67ce9c2 --- /dev/null +++ b/ChangeLog @@ -0,0 +1,94 @@ +NEXT VERSION + +v2.0.7 2012.02.29 +- fix warnings + +v2.0.6 2011.12.06 +- sync. with updated OCAL implementation (include math lib) + +v2.0.5 2011.11.12 + +v2.0.4 2011.10.21 +- correct error return and little endian fix for ocal commands + +v2.0.3 2011.10.16 +- minor compile, simulation and packaging improvements + +v2.0.2 2011.05.11 + +- moved OCAL implementation to separate OCAL-lib + +v2.0.1 2011.04.22 + +- OCAL interface implementation: + + fixed small issues + + added stub for ocal_clk_cfg_get() function + + updated ocal_mpd_bw_get() implementation + + updated ocal_mpd_get() implementation + + extended ocal_mpd_dark_get() output interface + + updated ocal_mpd_gain_get() implementation + + updated ocal_laser_thr_get() implementation + + extended ocal_laser_get() output interface + +v2.0.0 2011.03.23 + +- improved configure.in, Makefile.am (removed useless configure options) +- fixed warnings +- changd ifxos and dti lib link to other repo dir named lib +- OCAL interface implementation updated according to the updated UMPR: + + ocal_cfg_get() + + ocal_laser_thr_get() + + ocal_temp_ext_get() + + ocal_mpd_gain_get() + + ocal_laser_get() + + ocal_rssi_get() + + ocal_mpd_get() + + ocal_mpd_bw_get() + + ocal_mpd_dark_get() +- OCAL DTI-device implementation improved + +v0.6.0 2011.02.25 + +- don't link agent as static binary +- new file(s) added: + + dti_agent_ocal.c + + dti_agent_ocal.h + + dti_agent_ocal_ctx.h + + dti_agent_ocal_api.c + + dti_agent_ocal_api.h +- OCAL DTI-device implementation added: + + to enable device enable DEVICE_GPON_OCAL definition + + in the case of enabled STARTUP_WITH_REGISTERED_DEVICE definition + OCAL DTI-device number should be 3 + + in the case of foreground run use capital 'C' to add OCAL DTI-device + +v0.5.3 2010.11.30 +- source code re-factored + +V0.5.2 - 2010.10.28 +- 8 bit register access, supports DTI_DEVICE_INTERFACE_VERSION 0x00010200 + +V0.5.1 - 2010.06.24 +- fixed driver set for onu & optic driver + +V0.4.6 - 2010.03.26 +- driver update + +V0.4.5 - 2010.02.25 +- fixed cb8 project files +- fixed register handling + +V0.4.4 - 2009.11.02 +- adapted the event handler to new driver version + +V0.4.3 - 2009.06.26 +common: + - check for /dev/onu or /dev/onu[0-9] or /dev/onu/[0-9] + +V0.4.2 - 2009.06.26 +common: + - fixes for DTI simulation + +V0.1.y - 2009.xx.yy +common: + - added swaplib to Makefile.am diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..c5eea46 --- /dev/null +++ b/LICENSE @@ -0,0 +1,368 @@ +This source code is distributed under a dual license of GPL and BSD (2-clause). +Please choose the appropriate license for your intended usage. + +1. BSD license (2-clause BSD license) + +Copyright (c) 2009, Lantiq Deutschland GmbH +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE +GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT +OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +2. GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Lesser General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. diff --git a/Makefile.am b/Makefile.am new file mode 100644 index 0000000..2b13329 --- /dev/null +++ b/Makefile.am @@ -0,0 +1,48 @@ +## Process this file with automake to produce Makefile.in + +AUTOMAKE_OPTIONS = foreign 1.7 nostdinc + +SUBDIRS = src + +DISTCHECK_CONFIGURE_FLAGS=@CONFIGURE_OPTIONS@ + +gpon_dti_agent_docdir = ${prefix}/doc/gpon_dti_agent + +gpon_dti_agent_doc_DATA = \ + LICENSE \ + README \ + AUTHORS \ + ChangeLog \ + NEWS \ + TODO \ + doc/doxyconfig \ + doc/footer.html \ + doc/header.html \ + doc/logo.gif \ + doc/stylesheet.css + +EXTRA_DIST = $(gpon_dti_agent_doc_DATA) + +clean-local: + rm -Rf .built .built_check .version* .prepared* ipkg/ + +# Copy all the spec files. Of cource, only one is actually used. +dist-hook: + for specfile in *.spec; do \ + if test -f $$specfile; then \ + cp -p $$specfile $(distdir); \ + fi \ + done + +# Create self extracting linux distribution +distcheck-hook: + chmod a+w $(distdir) + echo "Checking line ends ..."; \ + find $(distdir) -type f -exec file {} \; | grep CRLF && exit -1; \ + echo "Create installation package ..."; \ + makeself.sh --gzip --notemp $(distdir) \ + gpon_dti_agent-$(PACKAGE_VERSION).sh "$(PACKAGE_NAME)" + +doc: @srcdir@/doc/doxyconfig + ( cd @srcdir@/doc; \ + doxygen doxyconfig; ) diff --git a/Makefile.in b/Makefile.in new file mode 100644 index 0000000..7d9ce52 --- /dev/null +++ b/Makefile.in @@ -0,0 +1,767 @@ +# Makefile.in generated by automake 1.11.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, +# Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +subdir = . +DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \ + $(srcdir)/Makefile.in $(top_srcdir)/configure AUTHORS COPYING \ + ChangeLog NEWS TODO compile config.rpath depcomp install-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 = $(top_builddir)/src/dti_agent_config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +SOURCES = +DIST_SOURCES = +RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ + html-recursive info-recursive install-data-recursive \ + install-dvi-recursive install-exec-recursive \ + install-html-recursive install-info-recursive \ + install-pdf-recursive install-ps-recursive install-recursive \ + installcheck-recursive installdirs-recursive pdf-recursive \ + ps-recursive uninstall-recursive +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__installdirs = "$(DESTDIR)$(gpon_dti_agent_docdir)" +DATA = $(gpon_dti_agent_doc_DATA) +RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ + distclean-recursive maintainer-clean-recursive +AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ + $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ + distdir dist dist-all distcheck +ETAGS = etags +CTAGS = ctags +DIST_SUBDIRS = $(SUBDIRS) +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +distdir = $(PACKAGE)-$(VERSION) +top_distdir = $(distdir) +am__remove_distdir = \ + { test ! -d "$(distdir)" \ + || { find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ + && rm -fr "$(distdir)"; }; } +am__relativize = \ + dir0=`pwd`; \ + sed_first='s,^\([^/]*\)/.*$$,\1,'; \ + sed_rest='s,^[^/]*/*,,'; \ + sed_last='s,^.*/\([^/]*\)$$,\1,'; \ + sed_butlast='s,/*[^/]*$$,,'; \ + while test -n "$$dir1"; do \ + first=`echo "$$dir1" | sed -e "$$sed_first"`; \ + if test "$$first" != "."; then \ + if test "$$first" = ".."; then \ + dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ + dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ + else \ + first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ + if test "$$first2" = "$$first"; then \ + dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ + else \ + dir2="../$$dir2"; \ + fi; \ + dir0="$$dir0"/"$$first"; \ + fi; \ + fi; \ + dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ + done; \ + reldir="$$dir2" +DIST_ARCHIVES = $(distdir).tar.gz +GZIP_ENV = --best +distuninstallcheck_listfiles = find . -type f -print +distcleancheck_listfiles = find . -type f -print +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CONFIGURE_OPTIONS = @CONFIGURE_OPTIONS@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DEVICE_GENERIC = @DEVICE_GENERIC@ +DEVICE_OCAL = @DEVICE_OCAL@ +DEVICE_ONU = @DEVICE_ONU@ +DEVICE_OPTIC = @DEVICE_OPTIC@ +DTI_INCLUDE_PATH = @DTI_INCLUDE_PATH@ +DTI_LIBRARY_PATH = @DTI_LIBRARY_PATH@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EXEEXT = @EXEEXT@ +IFXOS_INCLUDE_PATH = @IFXOS_INCLUDE_PATH@ +IFXOS_LIBRARY_PATH = @IFXOS_LIBRARY_PATH@ +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@ +OCAL_INCLUDE_PATH = @OCAL_INCLUDE_PATH@ +OCAL_LIBRARY_PATH = @OCAL_LIBRARY_PATH@ +ONU_INCLUDE_PATH = @ONU_INCLUDE_PATH@ +ONU_LIBRARY_PATH = @ONU_LIBRARY_PATH@ +ONU_SIMULATION = @ONU_SIMULATION@ +OPTIC_INCLUDE_PATH = @OPTIC_INCLUDE_PATH@ +OPTIC_LIBRARY_PATH = @OPTIC_LIBRARY_PATH@ +OPTIC_SIMULATION = @OPTIC_SIMULATION@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +RANLIB = @RANLIB@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STARTUP_REGISTERED = @STARTUP_REGISTERED@ +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@ +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_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +AUTOMAKE_OPTIONS = foreign 1.7 nostdinc +SUBDIRS = src +DISTCHECK_CONFIGURE_FLAGS = @CONFIGURE_OPTIONS@ +gpon_dti_agent_docdir = ${prefix}/doc/gpon_dti_agent +gpon_dti_agent_doc_DATA = \ + LICENSE \ + README \ + AUTHORS \ + ChangeLog \ + NEWS \ + TODO \ + doc/doxyconfig \ + doc/footer.html \ + doc/header.html \ + doc/logo.gif \ + doc/stylesheet.css + +EXTRA_DIST = $(gpon_dti_agent_doc_DATA) +all: 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) --foreign'; \ + $(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --foreign Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + echo ' $(SHELL) ./config.status'; \ + $(SHELL) ./config.status;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + $(SHELL) ./config.status --recheck + +$(top_srcdir)/configure: $(am__configure_deps) + $(am__cd) $(srcdir) && $(AUTOCONF) +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) +$(am__aclocal_m4_deps): +install-gpon_dti_agent_docDATA: $(gpon_dti_agent_doc_DATA) + @$(NORMAL_INSTALL) + test -z "$(gpon_dti_agent_docdir)" || $(MKDIR_P) "$(DESTDIR)$(gpon_dti_agent_docdir)" + @list='$(gpon_dti_agent_doc_DATA)'; test -n "$(gpon_dti_agent_docdir)" || list=; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(gpon_dti_agent_docdir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(gpon_dti_agent_docdir)" || exit $$?; \ + done + +uninstall-gpon_dti_agent_docDATA: + @$(NORMAL_UNINSTALL) + @list='$(gpon_dti_agent_doc_DATA)'; test -n "$(gpon_dti_agent_docdir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + test -n "$$files" || exit 0; \ + echo " ( cd '$(DESTDIR)$(gpon_dti_agent_docdir)' && rm -f" $$files ")"; \ + cd "$(DESTDIR)$(gpon_dti_agent_docdir)" && rm -f $$files + +# This directory's subdirectories are mostly independent; you can cd +# into them and run `make' without going through this Makefile. +# To change the values of `make' variables: instead of editing Makefiles, +# (1) if the variable is set in `config.status', edit `config.status' +# (which will cause the Makefiles to be regenerated when you run `make'); +# (2) otherwise, pass the desired values on the `make' command line. +$(RECURSIVE_TARGETS): + @fail= failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ + dot_seen=no; \ + target=`echo $@ | sed s/-recursive//`; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + dot_seen=yes; \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done; \ + if test "$$dot_seen" = "no"; then \ + $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ + fi; test -z "$$fail" + +$(RECURSIVE_CLEAN_TARGETS): + @fail= failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ + dot_seen=no; \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + rev=''; for subdir in $$list; do \ + if test "$$subdir" = "."; then :; else \ + rev="$$subdir $$rev"; \ + fi; \ + done; \ + rev="$$rev ."; \ + target=`echo $@ | sed s/-recursive//`; \ + for subdir in $$rev; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done && test -z "$$fail" +tags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ + done +ctags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ + done + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + set x; \ + here=`pwd`; \ + if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ + include_option=--etags-include; \ + empty_fix=.; \ + else \ + include_option=--include; \ + empty_fix=; \ + fi; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test ! -f $$subdir/TAGS || \ + set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ + fi; \ + done; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: CTAGS +CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + $(am__remove_distdir) + test -d "$(distdir)" || mkdir "$(distdir)" + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done + @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test -d "$(distdir)/$$subdir" \ + || $(MKDIR_P) "$(distdir)/$$subdir" \ + || exit 1; \ + fi; \ + done + @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ + $(am__relativize); \ + new_distdir=$$reldir; \ + dir1=$$subdir; dir2="$(top_distdir)"; \ + $(am__relativize); \ + new_top_distdir=$$reldir; \ + echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ + echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ + ($(am__cd) $$subdir && \ + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$$new_top_distdir" \ + distdir="$$new_distdir" \ + am__remove_distdir=: \ + am__skip_length_check=: \ + am__skip_mode_fix=: \ + distdir) \ + || exit 1; \ + fi; \ + done + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$(top_distdir)" distdir="$(distdir)" \ + dist-hook + -test -n "$(am__skip_mode_fix)" \ + || find "$(distdir)" -type d ! -perm -755 \ + -exec chmod u+rwx,go+rx {} \; -o \ + ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ + ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ + ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ + || chmod -R a+r "$(distdir)" +dist-gzip: distdir + tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz + $(am__remove_distdir) + +dist-bzip2: distdir + tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2 + $(am__remove_distdir) + +dist-lzma: distdir + tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma + $(am__remove_distdir) + +dist-xz: distdir + tardir=$(distdir) && $(am__tar) | xz -c >$(distdir).tar.xz + $(am__remove_distdir) + +dist-tarZ: distdir + tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z + $(am__remove_distdir) + +dist-shar: distdir + shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz + $(am__remove_distdir) + +dist-zip: distdir + -rm -f $(distdir).zip + zip -rq $(distdir).zip $(distdir) + $(am__remove_distdir) + +dist dist-all: distdir + tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz + $(am__remove_distdir) + +# This target untars the dist file and tries a VPATH configuration. Then +# it guarantees that the distribution is self-contained by making another +# tarfile. +distcheck: dist + case '$(DIST_ARCHIVES)' in \ + *.tar.gz*) \ + GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\ + *.tar.bz2*) \ + bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ + *.tar.lzma*) \ + lzma -dc $(distdir).tar.lzma | $(am__untar) ;;\ + *.tar.xz*) \ + xz -dc $(distdir).tar.xz | $(am__untar) ;;\ + *.tar.Z*) \ + uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ + *.shar.gz*) \ + GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\ + *.zip*) \ + unzip $(distdir).zip ;;\ + esac + chmod -R a-w $(distdir); chmod a+w $(distdir) + mkdir $(distdir)/_build + mkdir $(distdir)/_inst + chmod a-w $(distdir) + test -d $(distdir)/_build || exit 0; \ + dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ + && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ + && $(MAKE) $(AM_MAKEFLAGS) distcheck-hook \ + && am__cwd=`pwd` \ + && $(am__cd) $(distdir)/_build \ + && ../configure --srcdir=.. --prefix="$$dc_install_base" \ + $(DISTCHECK_CONFIGURE_FLAGS) \ + && $(MAKE) $(AM_MAKEFLAGS) \ + && $(MAKE) $(AM_MAKEFLAGS) dvi \ + && $(MAKE) $(AM_MAKEFLAGS) check \ + && $(MAKE) $(AM_MAKEFLAGS) install \ + && $(MAKE) $(AM_MAKEFLAGS) installcheck \ + && $(MAKE) $(AM_MAKEFLAGS) uninstall \ + && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ + distuninstallcheck \ + && chmod -R a-w "$$dc_install_base" \ + && ({ \ + (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ + distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ + } || { rm -rf "$$dc_destdir"; exit 1; }) \ + && rm -rf "$$dc_destdir" \ + && $(MAKE) $(AM_MAKEFLAGS) dist \ + && rm -rf $(DIST_ARCHIVES) \ + && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ + && cd "$$am__cwd" \ + || exit 1 + $(am__remove_distdir) + @(echo "$(distdir) archives ready for distribution: "; \ + list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ + sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' +distuninstallcheck: + @$(am__cd) '$(distuninstallcheck_dir)' \ + && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \ + || { echo "ERROR: files left after uninstall:" ; \ + if test -n "$(DESTDIR)"; then \ + echo " (check DESTDIR support)"; \ + fi ; \ + $(distuninstallcheck_listfiles) ; \ + exit 1; } >&2 +distcleancheck: distclean + @if test '$(srcdir)' = . ; then \ + echo "ERROR: distcleancheck can only run from a VPATH build" ; \ + exit 1 ; \ + fi + @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ + || { echo "ERROR: files left in build directory after distclean:" ; \ + $(distcleancheck_listfiles) ; \ + exit 1; } >&2 +check-am: all-am +check: check-recursive +all-am: Makefile $(DATA) +installdirs: installdirs-recursive +installdirs-am: + for dir in "$(DESTDIR)$(gpon_dti_agent_docdir)"; 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) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-recursive + +clean-am: clean-generic clean-local mostlyclean-am + +distclean: distclean-recursive + -rm -f $(am__CONFIG_DISTCLEAN_FILES) + -rm -f Makefile +distclean-am: clean-am distclean-generic distclean-tags + +dvi: dvi-recursive + +dvi-am: + +html: html-recursive + +html-am: + +info: info-recursive + +info-am: + +install-data-am: install-gpon_dti_agent_docDATA + +install-dvi: install-dvi-recursive + +install-dvi-am: + +install-exec-am: + +install-html: install-html-recursive + +install-html-am: + +install-info: install-info-recursive + +install-info-am: + +install-man: + +install-pdf: install-pdf-recursive + +install-pdf-am: + +install-ps: install-ps-recursive + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-recursive + -rm -f $(am__CONFIG_DISTCLEAN_FILES) + -rm -rf $(top_srcdir)/autom4te.cache + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-recursive + +mostlyclean-am: mostlyclean-generic + +pdf: pdf-recursive + +pdf-am: + +ps: ps-recursive + +ps-am: + +uninstall-am: uninstall-gpon_dti_agent_docDATA + +.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \ + install-am install-strip tags-recursive + +.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ + all all-am am--refresh check check-am clean clean-generic \ + clean-local ctags ctags-recursive dist dist-all dist-bzip2 \ + dist-gzip dist-hook dist-lzma dist-shar dist-tarZ dist-xz \ + dist-zip distcheck distclean distclean-generic 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-gpon_dti_agent_docDATA 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 \ + uninstall-gpon_dti_agent_docDATA + + +clean-local: + rm -Rf .built .built_check .version* .prepared* ipkg/ + +# Copy all the spec files. Of cource, only one is actually used. +dist-hook: + for specfile in *.spec; do \ + if test -f $$specfile; then \ + cp -p $$specfile $(distdir); \ + fi \ + done + +# Create self extracting linux distribution +distcheck-hook: + chmod a+w $(distdir) + echo "Checking line ends ..."; \ + find $(distdir) -type f -exec file {} \; | grep CRLF && exit -1; \ + echo "Create installation package ..."; \ + makeself.sh --gzip --notemp $(distdir) \ + gpon_dti_agent-$(PACKAGE_VERSION).sh "$(PACKAGE_NAME)" + +doc: @srcdir@/doc/doxyconfig + ( cd @srcdir@/doc; \ + doxygen doxyconfig; ) + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/NEWS b/NEWS new file mode 100644 index 0000000..e69de29 diff --git a/README b/README new file mode 100644 index 0000000..e69de29 diff --git a/TODO b/TODO new file mode 100644 index 0000000..e69de29 diff --git a/aclocal.m4 b/aclocal.m4 new file mode 100644 index 0000000..8bbfa6f --- /dev/null +++ b/aclocal.m4 @@ -0,0 +1,986 @@ +# generated automatically by aclocal 1.11.1 -*- Autoconf -*- + +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, +# 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +m4_ifndef([AC_AUTOCONF_VERSION], + [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl +m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.68],, +[m4_warning([this file was generated for autoconf 2.68. +You have another version of autoconf. It may work, but is not guaranteed to. +If you have problems, you may need to regenerate the build system entirely. +To do so, use the procedure documented by the package, typically `autoreconf'.])]) + +# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_AUTOMAKE_VERSION(VERSION) +# ---------------------------- +# Automake X.Y traces this macro to ensure aclocal.m4 has been +# generated from the m4 files accompanying Automake X.Y. +# (This private macro should not be called outside this file.) +AC_DEFUN([AM_AUTOMAKE_VERSION], +[am__api_version='1.11' +dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to +dnl require some minimum version. Point them to the right macro. +m4_if([$1], [1.11.1], [], + [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl +]) + +# _AM_AUTOCONF_VERSION(VERSION) +# ----------------------------- +# aclocal traces this macro to find the Autoconf version. +# This is a private macro too. Using m4_define simplifies +# the logic in aclocal, which can simply ignore this definition. +m4_define([_AM_AUTOCONF_VERSION], []) + +# AM_SET_CURRENT_AUTOMAKE_VERSION +# ------------------------------- +# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. +# This function is AC_REQUIREd by AM_INIT_AUTOMAKE. +AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], +[AM_AUTOMAKE_VERSION([1.11.1])dnl +m4_ifndef([AC_AUTOCONF_VERSION], + [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl +_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) + +# AM_AUX_DIR_EXPAND -*- Autoconf -*- + +# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets +# $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to +# `$srcdir', `$srcdir/..', or `$srcdir/../..'. +# +# Of course, Automake must honor this variable whenever it calls a +# tool from the auxiliary directory. The problem is that $srcdir (and +# therefore $ac_aux_dir as well) can be either absolute or relative, +# depending on how configure is run. This is pretty annoying, since +# it makes $ac_aux_dir quite unusable in subdirectories: in the top +# source directory, any form will work fine, but in subdirectories a +# relative path needs to be adjusted first. +# +# $ac_aux_dir/missing +# fails when called from a subdirectory if $ac_aux_dir is relative +# $top_srcdir/$ac_aux_dir/missing +# fails if $ac_aux_dir is absolute, +# fails when called from a subdirectory in a VPATH build with +# a relative $ac_aux_dir +# +# The reason of the latter failure is that $top_srcdir and $ac_aux_dir +# are both prefixed by $srcdir. In an in-source build this is usually +# harmless because $srcdir is `.', but things will broke when you +# start a VPATH build or use an absolute $srcdir. +# +# So we could use something similar to $top_srcdir/$ac_aux_dir/missing, +# iff we strip the leading $srcdir from $ac_aux_dir. That would be: +# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` +# and then we would define $MISSING as +# MISSING="\${SHELL} $am_aux_dir/missing" +# This will work as long as MISSING is not called from configure, because +# unfortunately $(top_srcdir) has no meaning in configure. +# However there are other variables, like CC, which are often used in +# configure, and could therefore not use this "fixed" $ac_aux_dir. +# +# Another solution, used here, is to always expand $ac_aux_dir to an +# absolute PATH. The drawback is that using absolute paths prevent a +# configured tree to be moved without reconfiguration. + +AC_DEFUN([AM_AUX_DIR_EXPAND], +[dnl Rely on autoconf to set up CDPATH properly. +AC_PREREQ([2.50])dnl +# expand $ac_aux_dir to an absolute path +am_aux_dir=`cd $ac_aux_dir && pwd` +]) + +# AM_CONDITIONAL -*- Autoconf -*- + +# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 9 + +# AM_CONDITIONAL(NAME, SHELL-CONDITION) +# ------------------------------------- +# Define a conditional. +AC_DEFUN([AM_CONDITIONAL], +[AC_PREREQ(2.52)dnl + ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], + [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl +AC_SUBST([$1_TRUE])dnl +AC_SUBST([$1_FALSE])dnl +_AM_SUBST_NOTMAKE([$1_TRUE])dnl +_AM_SUBST_NOTMAKE([$1_FALSE])dnl +m4_define([_AM_COND_VALUE_$1], [$2])dnl +if $2; then + $1_TRUE= + $1_FALSE='#' +else + $1_TRUE='#' + $1_FALSE= +fi +AC_CONFIG_COMMANDS_PRE( +[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then + AC_MSG_ERROR([[conditional "$1" was never defined. +Usually this means the macro was only invoked conditionally.]]) +fi])]) + +# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 10 + +# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be +# written in clear, in which case automake, when reading aclocal.m4, +# will think it sees a *use*, and therefore will trigger all it's +# C support machinery. Also note that it means that autoscan, seeing +# CC etc. in the Makefile, will ask for an AC_PROG_CC use... + + +# _AM_DEPENDENCIES(NAME) +# ---------------------- +# See how the compiler implements dependency checking. +# NAME is "CC", "CXX", "GCJ", or "OBJC". +# We try a few techniques and use that to set a single cache variable. +# +# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was +# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular +# dependency, and given that the user is not expected to run this macro, +# just rely on AC_PROG_CC. +AC_DEFUN([_AM_DEPENDENCIES], +[AC_REQUIRE([AM_SET_DEPDIR])dnl +AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl +AC_REQUIRE([AM_MAKE_INCLUDE])dnl +AC_REQUIRE([AM_DEP_TRACK])dnl + +ifelse([$1], CC, [depcc="$CC" am_compiler_list=], + [$1], CXX, [depcc="$CXX" am_compiler_list=], + [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'], + [$1], UPC, [depcc="$UPC" am_compiler_list=], + [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'], + [depcc="$$1" am_compiler_list=]) + +AC_CACHE_CHECK([dependency style of $depcc], + [am_cv_$1_dependencies_compiler_type], +[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named `D' -- because `-MD' means `put the output + # in D'. + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_$1_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` + fi + am__universal=false + m4_case([$1], [CC], + [case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac], + [CXX], + [case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac]) + + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with + # Solaris 8's {/usr,}/bin/sh. + touch sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + # We check with `-c' and `-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle `-M -o', and we need to detect this. Also, some Intel + # versions had trouble with output in subdirs + am__obj=sub/conftest.${OBJEXT-o} + am__minus_obj="-o $am__obj" + case $depmode in + gcc) + # This depmode causes a compiler race in universal mode. + test "$am__universal" = false || continue + ;; + nosideeffect) + # after this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + msvisualcpp | msvcmsys) + # This compiler won't grok `-c -o', but also, the minuso test has + # not run yet. These depmodes are late enough in the game, and + # so weak that their functioning should not be impacted. + am__obj=conftest.${OBJEXT-o} + am__minus_obj= + ;; + none) break ;; + esac + if depmode=$depmode \ + source=sub/conftest.c object=$am__obj \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep $am__obj sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_$1_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_$1_dependencies_compiler_type=none +fi +]) +AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) +AM_CONDITIONAL([am__fastdep$1], [ + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) +]) + + +# AM_SET_DEPDIR +# ------------- +# Choose a directory name for dependency files. +# This macro is AC_REQUIREd in _AM_DEPENDENCIES +AC_DEFUN([AM_SET_DEPDIR], +[AC_REQUIRE([AM_SET_LEADING_DOT])dnl +AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl +]) + + +# AM_DEP_TRACK +# ------------ +AC_DEFUN([AM_DEP_TRACK], +[AC_ARG_ENABLE(dependency-tracking, +[ --disable-dependency-tracking speeds up one-time build + --enable-dependency-tracking do not reject slow dependency extractors]) +if test "x$enable_dependency_tracking" != xno; then + am_depcomp="$ac_aux_dir/depcomp" + AMDEPBACKSLASH='\' +fi +AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) +AC_SUBST([AMDEPBACKSLASH])dnl +_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl +]) + +# Generate code to set up dependency tracking. -*- Autoconf -*- + +# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +#serial 5 + +# _AM_OUTPUT_DEPENDENCY_COMMANDS +# ------------------------------ +AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], +[{ + # Autoconf 2.62 quotes --file arguments for eval, but not when files + # are listed without --file. Let's play safe and only enable the eval + # if we detect the quoting. + case $CONFIG_FILES in + *\'*) eval set x "$CONFIG_FILES" ;; + *) set x $CONFIG_FILES ;; + esac + shift + for mf + do + # Strip MF so we end up with the name of the file. + mf=`echo "$mf" | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile or not. + # We used to match only the files named `Makefile.in', but + # some people rename them; so instead we look at the file content. + # Grep'ing the first line is not enough: some people post-process + # each Makefile.in and add a new line on top of each file to say so. + # Grep'ing the whole file is not good either: AIX grep has a line + # limit of 2048, but all sed's we know have understand at least 4000. + if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then + dirpart=`AS_DIRNAME("$mf")` + else + continue + fi + # Extract the definition of DEPDIR, am__include, and am__quote + # from the Makefile without running `make'. + DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` + test -z "$DEPDIR" && continue + am__include=`sed -n 's/^am__include = //p' < "$mf"` + test -z "am__include" && continue + am__quote=`sed -n 's/^am__quote = //p' < "$mf"` + # When using ansi2knr, U may be empty or an underscore; expand it + U=`sed -n 's/^U = //p' < "$mf"` + # Find all dependency output files, they are included files with + # $(DEPDIR) in their names. We invoke sed twice because it is the + # simplest approach to changing $(DEPDIR) to its actual value in the + # expansion. + for file in `sed -n " + s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ + sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do + # Make sure the directory exists. + test -f "$dirpart/$file" && continue + fdir=`AS_DIRNAME(["$file"])` + AS_MKDIR_P([$dirpart/$fdir]) + # echo "creating $dirpart/$file" + echo '# dummy' > "$dirpart/$file" + done + done +} +])# _AM_OUTPUT_DEPENDENCY_COMMANDS + + +# AM_OUTPUT_DEPENDENCY_COMMANDS +# ----------------------------- +# This macro should only be invoked once -- use via AC_REQUIRE. +# +# This code is only required when automatic dependency tracking +# is enabled. FIXME. This creates each `.P' file that we will +# need in order to bootstrap the dependency handling code. +AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], +[AC_CONFIG_COMMANDS([depfiles], + [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], + [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) +]) + +# Do all the work for Automake. -*- Autoconf -*- + +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, +# 2005, 2006, 2008, 2009 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 16 + +# This macro actually does too much. Some checks are only needed if +# your package does certain things. But this isn't really a big deal. + +# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) +# AM_INIT_AUTOMAKE([OPTIONS]) +# ----------------------------------------------- +# The call with PACKAGE and VERSION arguments is the old style +# call (pre autoconf-2.50), which is being phased out. PACKAGE +# and VERSION should now be passed to AC_INIT and removed from +# the call to AM_INIT_AUTOMAKE. +# We support both call styles for the transition. After +# the next Automake release, Autoconf can make the AC_INIT +# arguments mandatory, and then we can depend on a new Autoconf +# release and drop the old call support. +AC_DEFUN([AM_INIT_AUTOMAKE], +[AC_PREREQ([2.62])dnl +dnl Autoconf wants to disallow AM_ names. We explicitly allow +dnl the ones we care about. +m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl +AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl +AC_REQUIRE([AC_PROG_INSTALL])dnl +if test "`cd $srcdir && pwd`" != "`pwd`"; then + # Use -I$(srcdir) only when $(srcdir) != ., so that make's output + # is not polluted with repeated "-I." + AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl + # test to see if srcdir already configured + if test -f $srcdir/config.status; then + AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) + fi +fi + +# test whether we have cygpath +if test -z "$CYGPATH_W"; then + if (cygpath --version) >/dev/null 2>/dev/null; then + CYGPATH_W='cygpath -w' + else + CYGPATH_W=echo + fi +fi +AC_SUBST([CYGPATH_W]) + +# Define the identity of the package. +dnl Distinguish between old-style and new-style calls. +m4_ifval([$2], +[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl + AC_SUBST([PACKAGE], [$1])dnl + AC_SUBST([VERSION], [$2])], +[_AM_SET_OPTIONS([$1])dnl +dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. +m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,, + [m4_fatal([AC_INIT should be called with package and version arguments])])dnl + AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl + AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl + +_AM_IF_OPTION([no-define],, +[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) + AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl + +# Some tools Automake needs. +AC_REQUIRE([AM_SANITY_CHECK])dnl +AC_REQUIRE([AC_ARG_PROGRAM])dnl +AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}) +AM_MISSING_PROG(AUTOCONF, autoconf) +AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}) +AM_MISSING_PROG(AUTOHEADER, autoheader) +AM_MISSING_PROG(MAKEINFO, makeinfo) +AC_REQUIRE([AM_PROG_INSTALL_SH])dnl +AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl +AC_REQUIRE([AM_PROG_MKDIR_P])dnl +# We need awk for the "check" target. The system "awk" is bad on +# some platforms. +AC_REQUIRE([AC_PROG_AWK])dnl +AC_REQUIRE([AC_PROG_MAKE_SET])dnl +AC_REQUIRE([AM_SET_LEADING_DOT])dnl +_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], + [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], + [_AM_PROG_TAR([v7])])]) +_AM_IF_OPTION([no-dependencies],, +[AC_PROVIDE_IFELSE([AC_PROG_CC], + [_AM_DEPENDENCIES(CC)], + [define([AC_PROG_CC], + defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl +AC_PROVIDE_IFELSE([AC_PROG_CXX], + [_AM_DEPENDENCIES(CXX)], + [define([AC_PROG_CXX], + defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl +AC_PROVIDE_IFELSE([AC_PROG_OBJC], + [_AM_DEPENDENCIES(OBJC)], + [define([AC_PROG_OBJC], + defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl +]) +_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl +dnl The `parallel-tests' driver may need to know about EXEEXT, so add the +dnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This macro +dnl is hooked onto _AC_COMPILER_EXEEXT early, see below. +AC_CONFIG_COMMANDS_PRE(dnl +[m4_provide_if([_AM_COMPILER_EXEEXT], + [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl +]) + +dnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion. Do not +dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further +dnl mangled by Autoconf and run in a shell conditional statement. +m4_define([_AC_COMPILER_EXEEXT], +m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) + + +# When config.status generates a header, we must update the stamp-h file. +# This file resides in the same directory as the config header +# that is generated. The stamp files are numbered to have different names. + +# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the +# loop where config.status creates the headers, so we can generate +# our stamp files there. +AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], +[# Compute $1's index in $config_headers. +_am_arg=$1 +_am_stamp_count=1 +for _am_header in $config_headers :; do + case $_am_header in + $_am_arg | $_am_arg:* ) + break ;; + * ) + _am_stamp_count=`expr $_am_stamp_count + 1` ;; + esac +done +echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) + +# Copyright (C) 2001, 2003, 2005, 2008 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_PROG_INSTALL_SH +# ------------------ +# Define $install_sh. +AC_DEFUN([AM_PROG_INSTALL_SH], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +if test x"${install_sh}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; + *) + install_sh="\${SHELL} $am_aux_dir/install-sh" + esac +fi +AC_SUBST(install_sh)]) + +# Copyright (C) 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 2 + +# Check whether the underlying file-system supports filenames +# with a leading dot. For instance MS-DOS doesn't. +AC_DEFUN([AM_SET_LEADING_DOT], +[rm -rf .tst 2>/dev/null +mkdir .tst 2>/dev/null +if test -d .tst; then + am__leading_dot=. +else + am__leading_dot=_ +fi +rmdir .tst 2>/dev/null +AC_SUBST([am__leading_dot])]) + +# Check to see how 'make' treats includes. -*- Autoconf -*- + +# Copyright (C) 2001, 2002, 2003, 2005, 2009 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 4 + +# AM_MAKE_INCLUDE() +# ----------------- +# Check to see how make treats includes. +AC_DEFUN([AM_MAKE_INCLUDE], +[am_make=${MAKE-make} +cat > confinc << 'END' +am__doit: + @echo this is the am__doit target +.PHONY: am__doit +END +# If we don't find an include directive, just comment out the code. +AC_MSG_CHECKING([for style of include used by $am_make]) +am__include="#" +am__quote= +_am_result=none +# First try GNU make style include. +echo "include confinc" > confmf +# Ignore all kinds of additional output from `make'. +case `$am_make -s -f confmf 2> /dev/null` in #( +*the\ am__doit\ target*) + am__include=include + am__quote= + _am_result=GNU + ;; +esac +# Now try BSD make style include. +if test "$am__include" = "#"; then + echo '.include "confinc"' > confmf + case `$am_make -s -f confmf 2> /dev/null` in #( + *the\ am__doit\ target*) + am__include=.include + am__quote="\"" + _am_result=BSD + ;; + esac +fi +AC_SUBST([am__include]) +AC_SUBST([am__quote]) +AC_MSG_RESULT([$_am_result]) +rm -f confinc confmf +]) + +# Copyright (C) 1999, 2000, 2001, 2003, 2004, 2005, 2008 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 6 + +# AM_PROG_CC_C_O +# -------------- +# Like AC_PROG_CC_C_O, but changed for automake. +AC_DEFUN([AM_PROG_CC_C_O], +[AC_REQUIRE([AC_PROG_CC_C_O])dnl +AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +AC_REQUIRE_AUX_FILE([compile])dnl +# FIXME: we rely on the cache variable name because +# there is no other way. +set dummy $CC +am_cc=`echo $[2] | sed ['s/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/']` +eval am_t=\$ac_cv_prog_cc_${am_cc}_c_o +if test "$am_t" != yes; then + # Losing compiler, so override with the script. + # FIXME: It is wrong to rewrite CC. + # But if we don't then we get into trouble of one sort or another. + # A longer-term fix would be to have automake use am__CC in this case, + # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" + CC="$am_aux_dir/compile $CC" +fi +dnl Make sure AC_PROG_CC is never called again, or it will override our +dnl setting of CC. +m4_define([AC_PROG_CC], + [m4_fatal([AC_PROG_CC cannot be called after AM_PROG_CC_C_O])]) +]) + +# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- + +# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 6 + +# AM_MISSING_PROG(NAME, PROGRAM) +# ------------------------------ +AC_DEFUN([AM_MISSING_PROG], +[AC_REQUIRE([AM_MISSING_HAS_RUN]) +$1=${$1-"${am_missing_run}$2"} +AC_SUBST($1)]) + + +# AM_MISSING_HAS_RUN +# ------------------ +# Define MISSING if not defined so far and test if it supports --run. +# If it does, set am_missing_run to use it, otherwise, to nothing. +AC_DEFUN([AM_MISSING_HAS_RUN], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +AC_REQUIRE_AUX_FILE([missing])dnl +if test x"${MISSING+set}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; + *) + MISSING="\${SHELL} $am_aux_dir/missing" ;; + esac +fi +# Use eval to expand $SHELL +if eval "$MISSING --run true"; then + am_missing_run="$MISSING --run " +else + am_missing_run= + AC_MSG_WARN([`missing' script is too old or missing]) +fi +]) + +# Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_PROG_MKDIR_P +# --------------- +# Check for `mkdir -p'. +AC_DEFUN([AM_PROG_MKDIR_P], +[AC_PREREQ([2.60])dnl +AC_REQUIRE([AC_PROG_MKDIR_P])dnl +dnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P, +dnl while keeping a definition of mkdir_p for backward compatibility. +dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile. +dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of +dnl Makefile.ins that do not define MKDIR_P, so we do our own +dnl adjustment using top_builddir (which is defined more often than +dnl MKDIR_P). +AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl +case $mkdir_p in + [[\\/$]]* | ?:[[\\/]]*) ;; + */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; +esac +]) + +# Helper functions for option handling. -*- Autoconf -*- + +# Copyright (C) 2001, 2002, 2003, 2005, 2008 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 4 + +# _AM_MANGLE_OPTION(NAME) +# ----------------------- +AC_DEFUN([_AM_MANGLE_OPTION], +[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) + +# _AM_SET_OPTION(NAME) +# ------------------------------ +# Set option NAME. Presently that only means defining a flag for this option. +AC_DEFUN([_AM_SET_OPTION], +[m4_define(_AM_MANGLE_OPTION([$1]), 1)]) + +# _AM_SET_OPTIONS(OPTIONS) +# ---------------------------------- +# OPTIONS is a space-separated list of Automake options. +AC_DEFUN([_AM_SET_OPTIONS], +[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) + +# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) +# ------------------------------------------- +# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. +AC_DEFUN([_AM_IF_OPTION], +[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) + +# Check to make sure that the build environment is sane. -*- Autoconf -*- + +# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 5 + +# AM_SANITY_CHECK +# --------------- +AC_DEFUN([AM_SANITY_CHECK], +[AC_MSG_CHECKING([whether build environment is sane]) +# Just in case +sleep 1 +echo timestamp > conftest.file +# Reject unsafe characters in $srcdir or the absolute working directory +# name. Accept space and tab only in the latter. +am_lf=' +' +case `pwd` in + *[[\\\"\#\$\&\'\`$am_lf]]*) + AC_MSG_ERROR([unsafe absolute working directory name]);; +esac +case $srcdir in + *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) + AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);; +esac + +# Do `set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` + if test "$[*]" = "X"; then + # -L didn't work. + set X `ls -t "$srcdir/configure" conftest.file` + fi + rm -f conftest.file + if test "$[*]" != "X $srcdir/configure conftest.file" \ + && test "$[*]" != "X conftest.file $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken +alias in your environment]) + fi + + test "$[2]" = conftest.file + ) +then + # Ok. + : +else + AC_MSG_ERROR([newly created file is older than distributed files! +Check your system clock]) +fi +AC_MSG_RESULT(yes)]) + +# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_PROG_INSTALL_STRIP +# --------------------- +# One issue with vendor `install' (even GNU) is that you can't +# specify the program used to strip binaries. This is especially +# annoying in cross-compiling environments, where the build's strip +# is unlikely to handle the host's binaries. +# Fortunately install-sh will honor a STRIPPROG variable, so we +# always use install-sh in `make install-strip', and initialize +# STRIPPROG with the value of the STRIP variable (set by the user). +AC_DEFUN([AM_PROG_INSTALL_STRIP], +[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl +# Installed binaries are usually stripped using `strip' when the user +# run `make install-strip'. However `strip' might not be the right +# tool to use in cross-compilation environments, therefore Automake +# will honor the `STRIP' environment variable to overrule this program. +dnl Don't test for $cross_compiling = yes, because it might be `maybe'. +if test "$cross_compiling" != no; then + AC_CHECK_TOOL([STRIP], [strip], :) +fi +INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" +AC_SUBST([INSTALL_STRIP_PROGRAM])]) + +# Copyright (C) 2006, 2008 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 2 + +# _AM_SUBST_NOTMAKE(VARIABLE) +# --------------------------- +# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. +# This macro is traced by Automake. +AC_DEFUN([_AM_SUBST_NOTMAKE]) + +# AM_SUBST_NOTMAKE(VARIABLE) +# --------------------------- +# Public sister of _AM_SUBST_NOTMAKE. +AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) + +# Check how to create a tarball. -*- Autoconf -*- + +# Copyright (C) 2004, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 2 + +# _AM_PROG_TAR(FORMAT) +# -------------------- +# Check how to create a tarball in format FORMAT. +# FORMAT should be one of `v7', `ustar', or `pax'. +# +# Substitute a variable $(am__tar) that is a command +# writing to stdout a FORMAT-tarball containing the directory +# $tardir. +# tardir=directory && $(am__tar) > result.tar +# +# Substitute a variable $(am__untar) that extract such +# a tarball read from stdin. +# $(am__untar) < result.tar +AC_DEFUN([_AM_PROG_TAR], +[# Always define AMTAR for backward compatibility. +AM_MISSING_PROG([AMTAR], [tar]) +m4_if([$1], [v7], + [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'], + [m4_case([$1], [ustar],, [pax],, + [m4_fatal([Unknown tar format])]) +AC_MSG_CHECKING([how to create a $1 tar archive]) +# Loop over all known methods to create a tar archive until one works. +_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' +_am_tools=${am_cv_prog_tar_$1-$_am_tools} +# Do not fold the above two line into one, because Tru64 sh and +# Solaris sh will not grok spaces in the rhs of `-'. +for _am_tool in $_am_tools +do + case $_am_tool in + gnutar) + for _am_tar in tar gnutar gtar; + do + AM_RUN_LOG([$_am_tar --version]) && break + done + am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' + am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' + am__untar="$_am_tar -xf -" + ;; + plaintar) + # Must skip GNU tar: if it does not support --format= it doesn't create + # ustar tarball either. + (tar --version) >/dev/null 2>&1 && continue + am__tar='tar chf - "$$tardir"' + am__tar_='tar chf - "$tardir"' + am__untar='tar xf -' + ;; + pax) + am__tar='pax -L -x $1 -w "$$tardir"' + am__tar_='pax -L -x $1 -w "$tardir"' + am__untar='pax -r' + ;; + cpio) + am__tar='find "$$tardir" -print | cpio -o -H $1 -L' + am__tar_='find "$tardir" -print | cpio -o -H $1 -L' + am__untar='cpio -i -H $1 -d' + ;; + none) + am__tar=false + am__tar_=false + am__untar=false + ;; + esac + + # If the value was cached, stop now. We just wanted to have am__tar + # and am__untar set. + test -n "${am_cv_prog_tar_$1}" && break + + # tar/untar a dummy directory, and stop if the command works + rm -rf conftest.dir + mkdir conftest.dir + echo GrepMe > conftest.dir/file + AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) + rm -rf conftest.dir + if test -s conftest.tar; then + AM_RUN_LOG([$am__untar /dev/null 2>&1 && break + fi +done +rm -rf conftest.dir + +AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) +AC_MSG_RESULT([$am_cv_prog_tar_$1])]) +AC_SUBST([am__tar]) +AC_SUBST([am__untar]) +]) # _AM_PROG_TAR + diff --git a/compile b/compile new file mode 100755 index 0000000..c0096a7 --- /dev/null +++ b/compile @@ -0,0 +1,143 @@ +#! /bin/sh +# Wrapper for compilers which do not understand `-c -o'. + +scriptversion=2009-10-06.20; # UTC + +# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2009 Free Software +# Foundation, Inc. +# Written by Tom Tromey . +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# This file is maintained in Automake, please report +# bugs to or send patches to +# . + +case $1 in + '') + echo "$0: No command. Try \`$0 --help' for more information." 1>&2 + exit 1; + ;; + -h | --h*) + cat <<\EOF +Usage: compile [--help] [--version] PROGRAM [ARGS] + +Wrapper for compilers which do not understand `-c -o'. +Remove `-o dest.o' from ARGS, run PROGRAM with the remaining +arguments, and rename the output as expected. + +If you are trying to build a whole package this is not the +right script to run: please start by reading the file `INSTALL'. + +Report bugs to . +EOF + exit $? + ;; + -v | --v*) + echo "compile $scriptversion" + exit $? + ;; +esac + +ofile= +cfile= +eat= + +for arg +do + if test -n "$eat"; then + eat= + else + case $1 in + -o) + # configure might choose to run compile as `compile cc -o foo foo.c'. + # So we strip `-o arg' only if arg is an object. + eat=1 + case $2 in + *.o | *.obj) + ofile=$2 + ;; + *) + set x "$@" -o "$2" + shift + ;; + esac + ;; + *.c) + cfile=$1 + set x "$@" "$1" + shift + ;; + *) + set x "$@" "$1" + shift + ;; + esac + fi + shift +done + +if test -z "$ofile" || test -z "$cfile"; then + # If no `-o' option was seen then we might have been invoked from a + # pattern rule where we don't need one. That is ok -- this is a + # normal compilation that the losing compiler can handle. If no + # `.c' file was seen then we are probably linking. That is also + # ok. + exec "$@" +fi + +# Name of file we expect compiler to create. +cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'` + +# Create the lock directory. +# Note: use `[/\\:.-]' here to ensure that we don't use the same name +# that we are using for the .o file. Also, base the name on the expected +# object file name, since that is what matters with a parallel build. +lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d +while true; do + if mkdir "$lockdir" >/dev/null 2>&1; then + break + fi + sleep 1 +done +# FIXME: race condition here if user kills between mkdir and trap. +trap "rmdir '$lockdir'; exit 1" 1 2 15 + +# Run the compile. +"$@" +ret=$? + +if test -f "$cofile"; then + test "$cofile" = "$ofile" || mv "$cofile" "$ofile" +elif test -f "${cofile}bj"; then + test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile" +fi + +rmdir "$lockdir" +exit $ret + +# Local Variables: +# mode: shell-script +# sh-indentation: 2 +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-time-zone: "UTC" +# time-stamp-end: "; # UTC" +# End: diff --git a/config.rpath b/config.rpath new file mode 100755 index 0000000..c547c68 --- /dev/null +++ b/config.rpath @@ -0,0 +1,666 @@ +#! /bin/sh +# Output a system dependent set of variables, describing how to set the +# run time search path of shared libraries in an executable. +# +# Copyright 1996-2007 Free Software Foundation, Inc. +# Taken from GNU libtool, 2001 +# Originally by Gordon Matzigkeit , 1996 +# +# 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. +# +# The first argument passed to this file is the canonical host specification, +# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM +# or +# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM +# The environment variables CC, GCC, LDFLAGS, LD, with_gnu_ld +# should be set by the caller. +# +# The set of defined variables is at the end of this script. + +# Known limitations: +# - On IRIX 6.5 with CC="cc", the run time search patch must not be longer +# than 256 bytes, otherwise the compiler driver will dump core. The only +# known workaround is to choose shorter directory names for the build +# directory and/or the installation directory. + +# All known linkers require a `.a' archive for static linking (except MSVC, +# which needs '.lib'). +libext=a +shrext=.so + +host="$1" +host_cpu=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +host_vendor=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +host_os=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` + +# Code taken from libtool.m4's _LT_CC_BASENAME. + +for cc_temp in $CC""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`echo "$cc_temp" | sed -e 's%^.*/%%'` + +# Code taken from libtool.m4's AC_LIBTOOL_PROG_COMPILER_PIC. + +wl= +if test "$GCC" = yes; then + wl='-Wl,' +else + case "$host_os" in + aix*) + wl='-Wl,' + ;; + darwin*) + case $cc_basename in + xlc*) + wl='-Wl,' + ;; + esac + ;; + mingw* | cygwin* | pw32* | os2*) + ;; + hpux9* | hpux10* | hpux11*) + wl='-Wl,' + ;; + irix5* | irix6* | nonstopux*) + wl='-Wl,' + ;; + newsos6) + ;; + linux* | k*bsd*-gnu) + case $cc_basename in + icc* | ecc*) + wl='-Wl,' + ;; + pgcc | pgf77 | pgf90) + wl='-Wl,' + ;; + ccc*) + wl='-Wl,' + ;; + como) + wl='-lopt=' + ;; + *) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) + wl='-Wl,' + ;; + esac + ;; + esac + ;; + osf3* | osf4* | osf5*) + wl='-Wl,' + ;; + rdos*) + ;; + solaris*) + wl='-Wl,' + ;; + sunos4*) + wl='-Qoption ld ' + ;; + sysv4 | sysv4.2uw2* | sysv4.3*) + wl='-Wl,' + ;; + sysv4*MP*) + ;; + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + wl='-Wl,' + ;; + unicos*) + wl='-Wl,' + ;; + uts4*) + ;; + esac +fi + +# Code taken from libtool.m4's AC_LIBTOOL_PROG_LD_SHLIBS. + +hardcode_libdir_flag_spec= +hardcode_libdir_separator= +hardcode_direct=no +hardcode_minus_L=no + +case "$host_os" in + cygwin* | mingw* | pw32*) + # FIXME: the MSVC++ port hasn't been tested in a loooong time + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + if test "$GCC" != yes; then + with_gnu_ld=no + fi + ;; + interix*) + # we just hope/assume this is gcc and not c89 (= MSVC++) + with_gnu_ld=yes + ;; + openbsd*) + with_gnu_ld=no + ;; +esac + +ld_shlibs=yes +if test "$with_gnu_ld" = yes; then + # Set some defaults for GNU ld with shared library support. These + # are reset later if shared libraries are not supported. Putting them + # here allows them to be overridden if necessary. + # Unlike libtool, we use -rpath here, not --rpath, since the documented + # option of GNU ld is called -rpath, not --rpath. + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + case "$host_os" in + aix3* | aix4* | aix5*) + # On AIX/PPC, the GNU linker is very broken + if test "$host_cpu" != ia64; then + ld_shlibs=no + fi + ;; + amigaos*) + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + # Samuel A. Falvo II reports + # that the semantics of dynamic libraries on AmigaOS, at least up + # to version 4, is to share data among multiple programs linked + # with the same dynamic library. Since this doesn't match the + # behavior of shared libraries on other platforms, we cannot use + # them. + ld_shlibs=no + ;; + beos*) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + : + else + ld_shlibs=no + fi + ;; + cygwin* | mingw* | pw32*) + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + hardcode_libdir_flag_spec='-L$libdir' + if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then + : + else + ld_shlibs=no + fi + ;; + interix[3-9]*) + hardcode_direct=no + hardcode_libdir_flag_spec='${wl}-rpath,$libdir' + ;; + gnu* | linux* | k*bsd*-gnu) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + : + else + ld_shlibs=no + fi + ;; + netbsd*) + ;; + solaris*) + if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then + ld_shlibs=no + elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + : + else + ld_shlibs=no + fi + ;; + sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) + case `$LD -v 2>&1` in + *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) + ld_shlibs=no + ;; + *) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`' + else + ld_shlibs=no + fi + ;; + esac + ;; + sunos4*) + hardcode_direct=yes + ;; + *) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + : + else + ld_shlibs=no + fi + ;; + esac + if test "$ld_shlibs" = no; then + hardcode_libdir_flag_spec= + fi +else + case "$host_os" in + aix3*) + # Note: this linker hardcodes the directories in LIBPATH if there + # are no directories specified by -L. + hardcode_minus_L=yes + if test "$GCC" = yes; then + # Neither direct hardcoding nor static linking is supported with a + # broken collect2. + hardcode_direct=unsupported + fi + ;; + aix4* | aix5*) + if test "$host_cpu" = ia64; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + else + aix_use_runtimelinking=no + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # need to do runtime linking. + case $host_os in aix4.[23]|aix4.[23].*|aix5*) + for ld_flag in $LDFLAGS; do + if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then + aix_use_runtimelinking=yes + break + fi + done + ;; + esac + fi + hardcode_direct=yes + hardcode_libdir_separator=':' + if test "$GCC" = yes; then + case $host_os in aix4.[012]|aix4.[012].*) + collect2name=`${CC} -print-prog-name=collect2` + if test -f "$collect2name" && \ + strings "$collect2name" | grep resolve_lib_name >/dev/null + then + # We have reworked collect2 + : + else + # We have old collect2 + hardcode_direct=unsupported + hardcode_minus_L=yes + hardcode_libdir_flag_spec='-L$libdir' + hardcode_libdir_separator= + fi + ;; + esac + fi + # Begin _LT_AC_SYS_LIBPATH_AIX. + echo 'int main () { return 0; }' > conftest.c + ${CC} ${LDFLAGS} conftest.c -o conftest + aix_libpath=`dump -H conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'` + if test -z "$aix_libpath"; then + aix_libpath=`dump -HX64 conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'` + fi + if test -z "$aix_libpath"; then + aix_libpath="/usr/lib:/lib" + fi + rm -f conftest.c conftest + # End _LT_AC_SYS_LIBPATH_AIX. + if test "$aix_use_runtimelinking" = yes; then + hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" + else + if test "$host_cpu" = ia64; then + hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' + else + hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" + fi + fi + ;; + amigaos*) + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + # see comment about different semantics on the GNU ld section + ld_shlibs=no + ;; + bsdi[45]*) + ;; + cygwin* | mingw* | pw32*) + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + hardcode_libdir_flag_spec=' ' + libext=lib + ;; + darwin* | rhapsody*) + hardcode_direct=no + if test "$GCC" = yes ; then + : + else + case $cc_basename in + xlc*) + ;; + *) + ld_shlibs=no + ;; + esac + fi + ;; + dgux*) + hardcode_libdir_flag_spec='-L$libdir' + ;; + freebsd1*) + ld_shlibs=no + ;; + freebsd2.2*) + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + ;; + freebsd2*) + hardcode_direct=yes + hardcode_minus_L=yes + ;; + freebsd* | dragonfly*) + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + ;; + hpux9*) + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_separator=: + hardcode_direct=yes + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=yes + ;; + hpux10*) + if test "$with_gnu_ld" = no; then + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_separator=: + hardcode_direct=yes + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=yes + fi + ;; + hpux11*) + if test "$with_gnu_ld" = no; then + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_separator=: + case $host_cpu in + hppa*64*|ia64*) + hardcode_direct=no + ;; + *) + hardcode_direct=yes + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=yes + ;; + esac + fi + ;; + irix5* | irix6* | nonstopux*) + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator=: + ;; + netbsd*) + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + ;; + newsos6) + hardcode_direct=yes + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator=: + ;; + openbsd*) + if test -f /usr/libexec/ld.so; then + hardcode_direct=yes + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + hardcode_libdir_flag_spec='${wl}-rpath,$libdir' + else + case "$host_os" in + openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) + hardcode_libdir_flag_spec='-R$libdir' + ;; + *) + hardcode_libdir_flag_spec='${wl}-rpath,$libdir' + ;; + esac + fi + else + ld_shlibs=no + fi + ;; + os2*) + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + ;; + osf3*) + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator=: + ;; + osf4* | osf5*) + if test "$GCC" = yes; then + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + else + # Both cc and cxx compiler support -rpath directly + hardcode_libdir_flag_spec='-rpath $libdir' + fi + hardcode_libdir_separator=: + ;; + solaris*) + hardcode_libdir_flag_spec='-R$libdir' + ;; + sunos4*) + hardcode_libdir_flag_spec='-L$libdir' + hardcode_direct=yes + hardcode_minus_L=yes + ;; + sysv4) + case $host_vendor in + sni) + hardcode_direct=yes # is this really true??? + ;; + siemens) + hardcode_direct=no + ;; + motorola) + hardcode_direct=no #Motorola manual says yes, but my tests say they lie + ;; + esac + ;; + sysv4.3*) + ;; + sysv4*MP*) + if test -d /usr/nec; then + ld_shlibs=yes + fi + ;; + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) + ;; + sysv5* | sco3.2v5* | sco5v6*) + hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' + hardcode_libdir_separator=':' + ;; + uts4*) + hardcode_libdir_flag_spec='-L$libdir' + ;; + *) + ld_shlibs=no + ;; + esac +fi + +# Check dynamic linker characteristics +# Code taken from libtool.m4's AC_LIBTOOL_SYS_DYNAMIC_LINKER. +# Unlike libtool.m4, here we don't care about _all_ names of the library, but +# only about the one the linker finds when passed -lNAME. This is the last +# element of library_names_spec in libtool.m4, or possibly two of them if the +# linker has special search rules. +library_names_spec= # the last element of library_names_spec in libtool.m4 +libname_spec='lib$name' +case "$host_os" in + aix3*) + library_names_spec='$libname.a' + ;; + aix4* | aix5*) + library_names_spec='$libname$shrext' + ;; + amigaos*) + library_names_spec='$libname.a' + ;; + beos*) + library_names_spec='$libname$shrext' + ;; + bsdi[45]*) + library_names_spec='$libname$shrext' + ;; + cygwin* | mingw* | pw32*) + shrext=.dll + library_names_spec='$libname.dll.a $libname.lib' + ;; + darwin* | rhapsody*) + shrext=.dylib + library_names_spec='$libname$shrext' + ;; + dgux*) + library_names_spec='$libname$shrext' + ;; + freebsd1*) + ;; + freebsd* | dragonfly*) + case "$host_os" in + freebsd[123]*) + library_names_spec='$libname$shrext$versuffix' ;; + *) + library_names_spec='$libname$shrext' ;; + esac + ;; + gnu*) + library_names_spec='$libname$shrext' + ;; + hpux9* | hpux10* | hpux11*) + case $host_cpu in + ia64*) + shrext=.so + ;; + hppa*64*) + shrext=.sl + ;; + *) + shrext=.sl + ;; + esac + library_names_spec='$libname$shrext' + ;; + interix[3-9]*) + library_names_spec='$libname$shrext' + ;; + irix5* | irix6* | nonstopux*) + library_names_spec='$libname$shrext' + case "$host_os" in + irix5* | nonstopux*) + libsuff= shlibsuff= + ;; + *) + case $LD in + *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= ;; + *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 ;; + *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 ;; + *) libsuff= shlibsuff= ;; + esac + ;; + esac + ;; + linux*oldld* | linux*aout* | linux*coff*) + ;; + linux* | k*bsd*-gnu) + library_names_spec='$libname$shrext' + ;; + knetbsd*-gnu) + library_names_spec='$libname$shrext' + ;; + netbsd*) + library_names_spec='$libname$shrext' + ;; + newsos6) + library_names_spec='$libname$shrext' + ;; + nto-qnx*) + library_names_spec='$libname$shrext' + ;; + openbsd*) + library_names_spec='$libname$shrext$versuffix' + ;; + os2*) + libname_spec='$name' + shrext=.dll + library_names_spec='$libname.a' + ;; + osf3* | osf4* | osf5*) + library_names_spec='$libname$shrext' + ;; + rdos*) + ;; + solaris*) + library_names_spec='$libname$shrext' + ;; + sunos4*) + library_names_spec='$libname$shrext$versuffix' + ;; + sysv4 | sysv4.3*) + library_names_spec='$libname$shrext' + ;; + sysv4*MP*) + library_names_spec='$libname$shrext' + ;; + sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + library_names_spec='$libname$shrext' + ;; + uts4*) + library_names_spec='$libname$shrext' + ;; +esac + +sed_quote_subst='s/\(["`$\\]\)/\\\1/g' +escaped_wl=`echo "X$wl" | sed -e 's/^X//' -e "$sed_quote_subst"` +shlibext=`echo "$shrext" | sed -e 's,^\.,,'` +escaped_libname_spec=`echo "X$libname_spec" | sed -e 's/^X//' -e "$sed_quote_subst"` +escaped_library_names_spec=`echo "X$library_names_spec" | sed -e 's/^X//' -e "$sed_quote_subst"` +escaped_hardcode_libdir_flag_spec=`echo "X$hardcode_libdir_flag_spec" | sed -e 's/^X//' -e "$sed_quote_subst"` + +LC_ALL=C sed -e 's/^\([a-zA-Z0-9_]*\)=/acl_cv_\1=/' </dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi + + +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +# Prefer a ksh shell builtin over an external printf program on Solaris, +# but without wasting forks for bash or zsh. +if test -z "$BASH_VERSION$ZSH_VERSION" \ + && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='print -r --' + as_echo_n='print -rn --' +elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' + else + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in #( + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' + fi + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' +fi + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +as_myself= +case $0 in #(( + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 +fi + +# Unset variables that we do not need and which cause bugs (e.g. in +# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" +# suppresses any "Segmentation fault" message there. '((' could +# trigger a bug in pdksh 5.2.14. +for as_var in BASH_ENV ENV MAIL MAILPATH +do eval test x\${$as_var+set} = xset \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# CDPATH. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +if test "x$CONFIG_SHELL" = x; then + as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which + # is contrary to our usage. Disable this feature. + alias -g '\${1+\"\$@\"}'='\"\$@\"' + setopt NO_GLOB_SUBST +else + case \`(set -o) 2>/dev/null\` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi +" + as_required="as_fn_return () { (exit \$1); } +as_fn_success () { as_fn_return 0; } +as_fn_failure () { as_fn_return 1; } +as_fn_ret_success () { return 0; } +as_fn_ret_failure () { return 1; } + +exitcode=0 +as_fn_success || { exitcode=1; echo as_fn_success failed.; } +as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } +as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } +as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } +if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : + +else + exitcode=1; echo positional parameters were not saved. +fi +test x\$exitcode = x0 || exit 1" + as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO + as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO + eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && + test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1" + if (eval "$as_required") 2>/dev/null; then : + as_have_required=yes +else + as_have_required=no +fi + if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : + +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_found=false +for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + as_found=: + case $as_dir in #( + /*) + for as_base in sh bash ksh sh5; do + # Try only shells that exist, to save several forks. + as_shell=$as_dir/$as_base + if { test -f "$as_shell" || test -f "$as_shell.exe"; } && + { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : + CONFIG_SHELL=$as_shell as_have_required=yes + if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : + break 2 +fi +fi + done;; + esac + as_found=false +done +$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && + { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : + CONFIG_SHELL=$SHELL as_have_required=yes +fi; } +IFS=$as_save_IFS + + + if test "x$CONFIG_SHELL" != x; then : + # We cannot yet assume a decent shell, so we have to provide a + # neutralization value for shells without unset; and this also + # works around shells that cannot unset nonexistent variables. + # Preserve -v and -x to the replacement shell. + BASH_ENV=/dev/null + ENV=/dev/null + (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV + export CONFIG_SHELL + case $- in # (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; + esac + exec "$CONFIG_SHELL" $as_opts "$as_myself" ${1+"$@"} +fi + + if test x$as_have_required = xno; then : + $as_echo "$0: This script requires a shell more modern than all" + $as_echo "$0: the shells that I found on your system." + if test x${ZSH_VERSION+set} = xset ; then + $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" + $as_echo "$0: be upgraded to zsh 4.3.4 or later." + else + $as_echo "$0: Please tell bug-autoconf@gnu.org about your system, +$0: including any error possibly output before this +$0: message. Then install a modern shell, or manually run +$0: the script under such a shell if you do have one." + fi + exit 1 +fi +fi +fi +SHELL=${CONFIG_SHELL-/bin/sh} +export SHELL +# Unset more variables known to interfere with behavior of common tools. +CLICOLOR_FORCE= GREP_OPTIONS= +unset CLICOLOR_FORCE GREP_OPTIONS + +## --------------------- ## +## M4sh Shell Functions. ## +## --------------------- ## +# as_fn_unset VAR +# --------------- +# Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset + +# as_fn_set_status STATUS +# ----------------------- +# Set $? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} # as_fn_set_status + +# as_fn_exit STATUS +# ----------------- +# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} # as_fn_exit + +# as_fn_mkdir_p +# ------------- +# Create "$as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" + + +} # as_fn_mkdir_p +# as_fn_append VAR VALUE +# ---------------------- +# Append the text in VALUE to the end of the definition contained in VAR. Take +# advantage of any shell optimizations that allow amortized linear growth over +# repeated appends, instead of the typical quadratic growth present in naive +# implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append + +# as_fn_arith ARG... +# ------------------ +# Perform arithmetic evaluation on the ARGs, and store the result in the +# global $as_val. Take advantage of shells that can avoid forks. The arguments +# must be portable across $(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith + + +# as_fn_error STATUS ERROR [LINENO LOG_FD] +# ---------------------------------------- +# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are +# provided, also output the error to LOG_FD, referencing LINENO. Then exit the +# script with STATUS, using 1 if that was 0. +as_fn_error () +{ + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + fi + $as_echo "$as_me: error: $2" >&2 + as_fn_exit $as_status +} # as_fn_error + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + + + as_lineno_1=$LINENO as_lineno_1a=$LINENO + as_lineno_2=$LINENO as_lineno_2a=$LINENO + eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && + test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { + # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) + sed -n ' + p + /[$]LINENO/= + ' <$as_myself | + sed ' + s/[$]LINENO.*/&-/ + t lineno + b + :lineno + N + :loop + s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ + t loop + s/-\n.*// + ' >$as_me.lineno && + chmod +x "$as_me.lineno" || + { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } + + # Don't try to exec as it changes $[0], causing all sort of problems + # (the dirname of $[0] is not the place where we might find the + # original and so on. Autoconf is especially sensitive to this). + . "./$as_me.lineno" + # Exit status is that of the last command. + exit +} + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in #((((( +-n*) + case `echo 'xy\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; + esac;; +*) + ECHO_N='-n';; +esac + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -p'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -p' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -p' + fi +else + as_ln_s='cp -p' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + +if mkdir -p . 2>/dev/null; then + as_mkdir_p='mkdir -p "$as_dir"' +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +if test -x / >/dev/null 2>&1; then + as_test_x='test -x' +else + if ls -dL / >/dev/null 2>&1; then + as_ls_L_option=L + else + as_ls_L_option= + fi + as_test_x=' + eval sh -c '\'' + if test -d "$1"; then + test -d "$1/."; + else + case $1 in #( + -*)set "./$1";; + esac; + case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( + ???[sx]*):;;*)false;;esac;fi + '\'' sh + ' +fi +as_executable_p=$as_test_x + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + +test -n "$DJDIR" || exec 7<&0 &1 + +# Name of the host. +# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, +# so uname gets run too. +ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` + +# +# Initializations. +# +ac_default_prefix=/usr/local +ac_clean_files= +ac_config_libobj_dir=. +LIBOBJS= +cross_compiling=no +subdirs= +MFLAGS= +MAKEFLAGS= + +# Identity of this package. +PACKAGE_NAME='GPON DTI Agent' +PACKAGE_TARNAME='gpon_dti_agent' +PACKAGE_VERSION='2.0.7' +PACKAGE_STRING='GPON DTI Agent 2.0.7' +PACKAGE_BUGREPORT='' +PACKAGE_URL='' + +ac_unique_file="src/Makefile.am" +ac_subst_vars='am__EXEEXT_FALSE +am__EXEEXT_TRUE +LTLIBOBJS +LIBOBJS +OCAL_INCLUDE_PATH +OCAL_LIBRARY_PATH +DEVICE_OCAL +DEVICE_OCAL_FALSE +DEVICE_OCAL_TRUE +OPTIC_INCLUDE_PATH +OPTIC_LIBRARY_PATH +OPTIC_SIMULATION +OPTIC_SIMULATION_FALSE +OPTIC_SIMULATION_TRUE +DEVICE_OPTIC +DEVICE_OPTIC_FALSE +DEVICE_OPTIC_TRUE +ONU_INCLUDE_PATH +ONU_LIBRARY_PATH +ONU_SIMULATION +ONU_SIMULATION_FALSE +ONU_SIMULATION_TRUE +DEVICE_ONU +DEVICE_ONU_FALSE +DEVICE_ONU_TRUE +DEVICE_GENERIC +DEVICE_GENERIC_FALSE +DEVICE_GENERIC_TRUE +STARTUP_REGISTERED +STARTUP_REGISTERED_FALSE +STARTUP_REGISTERED_TRUE +DTI_INCLUDE_PATH +DTI_LIBRARY_PATH +IFXOS_INCLUDE_PATH +IFXOS_LIBRARY_PATH +CONFIGURE_OPTIONS +am__fastdepCC_FALSE +am__fastdepCC_TRUE +CCDEPMODE +AMDEPBACKSLASH +AMDEP_FALSE +AMDEP_TRUE +am__quote +am__include +DEPDIR +am__untar +am__tar +AMTAR +am__leading_dot +SET_MAKE +AWK +mkdir_p +MKDIR_P +INSTALL_STRIP_PROGRAM +STRIP +install_sh +MAKEINFO +AUTOHEADER +AUTOMAKE +AUTOCONF +ACLOCAL +VERSION +PACKAGE +CYGPATH_W +am__isrc +INSTALL_DATA +INSTALL_SCRIPT +INSTALL_PROGRAM +RANLIB +OBJEXT +EXEEXT +ac_ct_CC +CPPFLAGS +LDFLAGS +CFLAGS +CC +target_alias +host_alias +build_alias +LIBS +ECHO_T +ECHO_N +ECHO_C +DEFS +mandir +localedir +libdir +psdir +pdfdir +dvidir +htmldir +infodir +docdir +oldincludedir +includedir +localstatedir +sharedstatedir +sysconfdir +datadir +datarootdir +libexecdir +sbindir +bindir +program_transform_name +prefix +exec_prefix +PACKAGE_URL +PACKAGE_BUGREPORT +PACKAGE_STRING +PACKAGE_VERSION +PACKAGE_TARNAME +PACKAGE_NAME +PATH_SEPARATOR +SHELL' +ac_subst_files='' +ac_user_opts=' +enable_option_checking +enable_dependency_tracking +enable_ifxos_library +enable_ifxos_include +enable_dti_library +enable_dti_include +enable_start_devs +enable_dev_generic +enable_onu +with_onu_simulation +enable_onu_library +enable_onu_include +enable_optic +with_optic_simulation +enable_optic_library +enable_optic_include +enable_ocal +enable_ocal_library +enable_ocal_include +' + ac_precious_vars='build_alias +host_alias +target_alias +CC +CFLAGS +LDFLAGS +LIBS +CPPFLAGS' + + +# Initialize some variables set by options. +ac_init_help= +ac_init_version=false +ac_unrecognized_opts= +ac_unrecognized_sep= +# The variables have the same names as the options, with +# dashes changed to underlines. +cache_file=/dev/null +exec_prefix=NONE +no_create= +no_recursion= +prefix=NONE +program_prefix=NONE +program_suffix=NONE +program_transform_name=s,x,x, +silent= +site= +srcdir= +verbose= +x_includes=NONE +x_libraries=NONE + +# Installation directory options. +# These are left unexpanded so users can "make install exec_prefix=/foo" +# and all the variables that are supposed to be based on exec_prefix +# by default will actually change. +# Use braces instead of parens because sh, perl, etc. also accept them. +# (The list follows the same order as the GNU Coding Standards.) +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datarootdir='${prefix}/share' +datadir='${datarootdir}' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +includedir='${prefix}/include' +oldincludedir='/usr/include' +docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' +infodir='${datarootdir}/info' +htmldir='${docdir}' +dvidir='${docdir}' +pdfdir='${docdir}' +psdir='${docdir}' +libdir='${exec_prefix}/lib' +localedir='${datarootdir}/locale' +mandir='${datarootdir}/man' + +ac_prev= +ac_dashdash= +for ac_option +do + # If the previous option needs an argument, assign it. + if test -n "$ac_prev"; then + eval $ac_prev=\$ac_option + ac_prev= + continue + fi + + case $ac_option in + *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; + *=) ac_optarg= ;; + *) ac_optarg=yes ;; + esac + + # Accept the important Cygnus configure options, so we can diagnose typos. + + case $ac_dashdash$ac_option in + --) + ac_dashdash=yes ;; + + -bindir | --bindir | --bindi | --bind | --bin | --bi) + ac_prev=bindir ;; + -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) + bindir=$ac_optarg ;; + + -build | --build | --buil | --bui | --bu) + ac_prev=build_alias ;; + -build=* | --build=* | --buil=* | --bui=* | --bu=*) + build_alias=$ac_optarg ;; + + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) + cache_file=$ac_optarg ;; + + --config-cache | -C) + cache_file=config.cache ;; + + -datadir | --datadir | --datadi | --datad) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=*) + datadir=$ac_optarg ;; + + -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ + | --dataroo | --dataro | --datar) + ac_prev=datarootdir ;; + -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ + | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) + datarootdir=$ac_optarg ;; + + -disable-* | --disable-*) + ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid feature name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=no ;; + + -docdir | --docdir | --docdi | --doc | --do) + ac_prev=docdir ;; + -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) + docdir=$ac_optarg ;; + + -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) + ac_prev=dvidir ;; + -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) + dvidir=$ac_optarg ;; + + -enable-* | --enable-*) + ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid feature name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=\$ac_optarg ;; + + -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ + | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ + | --exec | --exe | --ex) + ac_prev=exec_prefix ;; + -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ + | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ + | --exec=* | --exe=* | --ex=*) + exec_prefix=$ac_optarg ;; + + -gas | --gas | --ga | --g) + # Obsolete; use --with-gas. + with_gas=yes ;; + + -help | --help | --hel | --he | -h) + ac_init_help=long ;; + -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) + ac_init_help=recursive ;; + -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) + ac_init_help=short ;; + + -host | --host | --hos | --ho) + ac_prev=host_alias ;; + -host=* | --host=* | --hos=* | --ho=*) + host_alias=$ac_optarg ;; + + -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) + ac_prev=htmldir ;; + -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ + | --ht=*) + htmldir=$ac_optarg ;; + + -includedir | --includedir | --includedi | --included | --include \ + | --includ | --inclu | --incl | --inc) + ac_prev=includedir ;; + -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ + | --includ=* | --inclu=* | --incl=* | --inc=*) + includedir=$ac_optarg ;; + + -infodir | --infodir | --infodi | --infod | --info | --inf) + ac_prev=infodir ;; + -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) + infodir=$ac_optarg ;; + + -libdir | --libdir | --libdi | --libd) + ac_prev=libdir ;; + -libdir=* | --libdir=* | --libdi=* | --libd=*) + libdir=$ac_optarg ;; + + -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ + | --libexe | --libex | --libe) + ac_prev=libexecdir ;; + -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ + | --libexe=* | --libex=* | --libe=*) + libexecdir=$ac_optarg ;; + + -localedir | --localedir | --localedi | --localed | --locale) + ac_prev=localedir ;; + -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) + localedir=$ac_optarg ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst | --locals) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) + localstatedir=$ac_optarg ;; + + -mandir | --mandir | --mandi | --mand | --man | --ma | --m) + ac_prev=mandir ;; + -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) + mandir=$ac_optarg ;; + + -nfp | --nfp | --nf) + # Obsolete; use --without-fp. + with_fp=no ;; + + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c | -n) + no_create=yes ;; + + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) + no_recursion=yes ;; + + -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ + | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ + | --oldin | --oldi | --old | --ol | --o) + ac_prev=oldincludedir ;; + -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ + | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ + | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) + oldincludedir=$ac_optarg ;; + + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) + ac_prev=prefix ;; + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) + prefix=$ac_optarg ;; + + -program-prefix | --program-prefix | --program-prefi | --program-pref \ + | --program-pre | --program-pr | --program-p) + ac_prev=program_prefix ;; + -program-prefix=* | --program-prefix=* | --program-prefi=* \ + | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) + program_prefix=$ac_optarg ;; + + -program-suffix | --program-suffix | --program-suffi | --program-suff \ + | --program-suf | --program-su | --program-s) + ac_prev=program_suffix ;; + -program-suffix=* | --program-suffix=* | --program-suffi=* \ + | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) + program_suffix=$ac_optarg ;; + + -program-transform-name | --program-transform-name \ + | --program-transform-nam | --program-transform-na \ + | --program-transform-n | --program-transform- \ + | --program-transform | --program-transfor \ + | --program-transfo | --program-transf \ + | --program-trans | --program-tran \ + | --progr-tra | --program-tr | --program-t) + ac_prev=program_transform_name ;; + -program-transform-name=* | --program-transform-name=* \ + | --program-transform-nam=* | --program-transform-na=* \ + | --program-transform-n=* | --program-transform-=* \ + | --program-transform=* | --program-transfor=* \ + | --program-transfo=* | --program-transf=* \ + | --program-trans=* | --program-tran=* \ + | --progr-tra=* | --program-tr=* | --program-t=*) + program_transform_name=$ac_optarg ;; + + -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) + ac_prev=pdfdir ;; + -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) + pdfdir=$ac_optarg ;; + + -psdir | --psdir | --psdi | --psd | --ps) + ac_prev=psdir ;; + -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) + psdir=$ac_optarg ;; + + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + silent=yes ;; + + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) + ac_prev=sbindir ;; + -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ + | --sbi=* | --sb=*) + sbindir=$ac_optarg ;; + + -sharedstatedir | --sharedstatedir | --sharedstatedi \ + | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ + | --sharedst | --shareds | --shared | --share | --shar \ + | --sha | --sh) + ac_prev=sharedstatedir ;; + -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ + | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ + | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ + | --sha=* | --sh=*) + sharedstatedir=$ac_optarg ;; + + -site | --site | --sit) + ac_prev=site ;; + -site=* | --site=* | --sit=*) + site=$ac_optarg ;; + + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + srcdir=$ac_optarg ;; + + -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ + | --syscon | --sysco | --sysc | --sys | --sy) + ac_prev=sysconfdir ;; + -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ + | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) + sysconfdir=$ac_optarg ;; + + -target | --target | --targe | --targ | --tar | --ta | --t) + ac_prev=target_alias ;; + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) + target_alias=$ac_optarg ;; + + -v | -verbose | --verbose | --verbos | --verbo | --verb) + verbose=yes ;; + + -version | --version | --versio | --versi | --vers | -V) + ac_init_version=: ;; + + -with-* | --with-*) + ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid package name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=\$ac_optarg ;; + + -without-* | --without-*) + ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid package name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=no ;; + + --x) + # Obsolete; use --with-x. + with_x=yes ;; + + -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ + | --x-incl | --x-inc | --x-in | --x-i) + ac_prev=x_includes ;; + -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ + | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) + x_includes=$ac_optarg ;; + + -x-libraries | --x-libraries | --x-librarie | --x-librari \ + | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) + ac_prev=x_libraries ;; + -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ + | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) + x_libraries=$ac_optarg ;; + + -*) as_fn_error $? "unrecognized option: \`$ac_option' +Try \`$0 --help' for more information" + ;; + + *=*) + ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` + # Reject names that are not valid shell variable names. + case $ac_envvar in #( + '' | [0-9]* | *[!_$as_cr_alnum]* ) + as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; + esac + eval $ac_envvar=\$ac_optarg + export $ac_envvar ;; + + *) + # FIXME: should be removed in autoconf 3.0. + $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 + expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && + $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 + : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" + ;; + + esac +done + +if test -n "$ac_prev"; then + ac_option=--`echo $ac_prev | sed 's/_/-/g'` + as_fn_error $? "missing argument to $ac_option" +fi + +if test -n "$ac_unrecognized_opts"; then + case $enable_option_checking in + no) ;; + fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; + *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; + esac +fi + +# Check all directory arguments for consistency. +for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ + datadir sysconfdir sharedstatedir localstatedir includedir \ + oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ + libdir localedir mandir +do + eval ac_val=\$$ac_var + # Remove trailing slashes. + case $ac_val in + */ ) + ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` + eval $ac_var=\$ac_val;; + esac + # Be sure to have absolute directory names. + case $ac_val in + [\\/$]* | ?:[\\/]* ) continue;; + NONE | '' ) case $ac_var in *prefix ) continue;; esac;; + esac + as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" +done + +# There might be people who depend on the old broken behavior: `$host' +# used to hold the argument of --host etc. +# FIXME: To remove some day. +build=$build_alias +host=$host_alias +target=$target_alias + +# FIXME: To remove some day. +if test "x$host_alias" != x; then + if test "x$build_alias" = x; then + cross_compiling=maybe + $as_echo "$as_me: WARNING: if you wanted to set the --build type, don't use --host. + If a cross compiler is detected then cross compile mode will be used" >&2 + elif test "x$build_alias" != "x$host_alias"; then + cross_compiling=yes + fi +fi + +ac_tool_prefix= +test -n "$host_alias" && ac_tool_prefix=$host_alias- + +test "$silent" = yes && exec 6>/dev/null + + +ac_pwd=`pwd` && test -n "$ac_pwd" && +ac_ls_di=`ls -di .` && +ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || + as_fn_error $? "working directory cannot be determined" +test "X$ac_ls_di" = "X$ac_pwd_ls_di" || + as_fn_error $? "pwd does not report name of working directory" + + +# Find the source files, if location was not specified. +if test -z "$srcdir"; then + ac_srcdir_defaulted=yes + # Try the directory containing this script, then the parent directory. + ac_confdir=`$as_dirname -- "$as_myself" || +$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_myself" : 'X\(//\)[^/]' \| \ + X"$as_myself" : 'X\(//\)$' \| \ + X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_myself" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + srcdir=$ac_confdir + if test ! -r "$srcdir/$ac_unique_file"; then + srcdir=.. + fi +else + ac_srcdir_defaulted=no +fi +if test ! -r "$srcdir/$ac_unique_file"; then + test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." + as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" +fi +ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" +ac_abs_confdir=`( + cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" + pwd)` +# When building in place, set srcdir=. +if test "$ac_abs_confdir" = "$ac_pwd"; then + srcdir=. +fi +# Remove unnecessary trailing slashes from srcdir. +# Double slashes in file names in object file debugging info +# mess up M-x gdb in Emacs. +case $srcdir in +*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; +esac +for ac_var in $ac_precious_vars; do + eval ac_env_${ac_var}_set=\${${ac_var}+set} + eval ac_env_${ac_var}_value=\$${ac_var} + eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} + eval ac_cv_env_${ac_var}_value=\$${ac_var} +done + +# +# Report the --help message. +# +if test "$ac_init_help" = "long"; then + # Omit some internal or obsolete options to make the list less imposing. + # This message is too long to be a string in the A/UX 3.1 sh. + cat <<_ACEOF +\`configure' configures GPON DTI Agent 2.0.7 to adapt to many kinds of systems. + +Usage: $0 [OPTION]... [VAR=VALUE]... + +To assign environment variables (e.g., CC, CFLAGS...), specify them as +VAR=VALUE. See below for descriptions of some of the useful variables. + +Defaults for the options are specified in brackets. + +Configuration: + -h, --help display this help and exit + --help=short display options specific to this package + --help=recursive display the short help of all the included packages + -V, --version display version information and exit + -q, --quiet, --silent do not print \`checking ...' messages + --cache-file=FILE cache test results in FILE [disabled] + -C, --config-cache alias for \`--cache-file=config.cache' + -n, --no-create do not create output files + --srcdir=DIR find the sources in DIR [configure dir or \`..'] + +Installation directories: + --prefix=PREFIX install architecture-independent files in PREFIX + [$ac_default_prefix] + --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX + [PREFIX] + +By default, \`make install' will install all the files in +\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify +an installation prefix other than \`$ac_default_prefix' using \`--prefix', +for instance \`--prefix=\$HOME'. + +For better control, use the options below. + +Fine tuning of the installation directories: + --bindir=DIR user executables [EPREFIX/bin] + --sbindir=DIR system admin executables [EPREFIX/sbin] + --libexecdir=DIR program executables [EPREFIX/libexec] + --sysconfdir=DIR read-only single-machine data [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] + --localstatedir=DIR modifiable single-machine data [PREFIX/var] + --libdir=DIR object code libraries [EPREFIX/lib] + --includedir=DIR C header files [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc [/usr/include] + --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] + --datadir=DIR read-only architecture-independent data [DATAROOTDIR] + --infodir=DIR info documentation [DATAROOTDIR/info] + --localedir=DIR locale-dependent data [DATAROOTDIR/locale] + --mandir=DIR man documentation [DATAROOTDIR/man] + --docdir=DIR documentation root [DATAROOTDIR/doc/gpon_dti_agent] + --htmldir=DIR html documentation [DOCDIR] + --dvidir=DIR dvi documentation [DOCDIR] + --pdfdir=DIR pdf documentation [DOCDIR] + --psdir=DIR ps documentation [DOCDIR] +_ACEOF + + cat <<\_ACEOF + +Program names: + --program-prefix=PREFIX prepend PREFIX to installed program names + --program-suffix=SUFFIX append SUFFIX to installed program names + --program-transform-name=PROGRAM run sed PROGRAM on installed program names +_ACEOF +fi + +if test -n "$ac_init_help"; then + case $ac_init_help in + short | recursive ) echo "Configuration of GPON DTI Agent 2.0.7:";; + esac + cat <<\_ACEOF + +Optional Features: + --disable-option-checking ignore unrecognized --enable/--with options + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --disable-dependency-tracking speeds up one-time build + --enable-dependency-tracking do not reject slow dependency extractors + --enable-ifxos-library=/path/to/your/lib_ifxos/src + Set the lib_ifxos library path. In this location the + libifxos.a should be found + --enable-ifxos-include=-I/path/to/your/lib_ifxos/src/include + Set the lib_ifxos include path. + --enable-dti-library=/path/to/your/lib_dti/src + Set the lib_dti library path. In this location the + libdti.a should be found + --enable-dti-include=-I/path/to/your/lib_dti/src/include + Set the lib_dti include path. + --enable-start-devs Register Devices at startup time. + --enable-dev-generic Add Generic support. + --enable-onu Add ONU support. + --enable-onu-library=/path/to/your/lib_onu/src + Set the lib_onu library path. In this location the + libonu.a should be found + --enable-dti-include=-I/path/to/your/lib_onu/src/include + Set the lib_onu include path. + --enable-optic Add OPTIC support. + --enable-optic-library=/path/to/your/lib_optic/src + Set the lib_optic library path. In this location the + liboptic.a should be found + --enable-dti-include=-I/path/to/your/lib_optic/src/include + Set the lib_optic include path. + --enable-ocal Add OCAL support. + --enable-ocal-library=/path/to/your/libocal/src + Set the libocal.a library path. In this location the + libocal.a should be found + --enable-ocal-include=-I/path/to/your/libocal/src/include + Set the libocal.a include path. + +Optional Packages: + --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --with-onu-simulation ONU simulation + --with-optic-simulation OPTIC simulation + +Some influential environment variables: + CC C compiler command + CFLAGS C compiler flags + LDFLAGS linker flags, e.g. -L if you have libraries in a + nonstandard directory + LIBS libraries to pass to the linker, e.g. -l + CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if + you have headers in a nonstandard directory + +Use these variables to override the choices made by `configure' or to help +it to find libraries and programs with nonstandard names/locations. + +Report bugs to the package provider. +_ACEOF +ac_status=$? +fi + +if test "$ac_init_help" = "recursive"; then + # If there are subdirs, report their specific --help. + for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue + test -d "$ac_dir" || + { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || + continue + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + cd "$ac_dir" || { ac_status=$?; continue; } + # Check for guested configure. + if test -f "$ac_srcdir/configure.gnu"; then + echo && + $SHELL "$ac_srcdir/configure.gnu" --help=recursive + elif test -f "$ac_srcdir/configure"; then + echo && + $SHELL "$ac_srcdir/configure" --help=recursive + else + $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 + fi || ac_status=$? + cd "$ac_pwd" || { ac_status=$?; break; } + done +fi + +test -n "$ac_init_help" && exit $ac_status +if $ac_init_version; then + cat <<\_ACEOF +GPON DTI Agent configure 2.0.7 +generated by GNU Autoconf 2.68 + +Copyright (C) 2010 Free Software Foundation, Inc. +This configure script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it. +_ACEOF + exit +fi + +## ------------------------ ## +## Autoconf initialization. ## +## ------------------------ ## + +# ac_fn_c_try_compile LINENO +# -------------------------- +# Try to compile conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext + if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_compile +cat >config.log <<_ACEOF +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. + +It was created by GPON DTI Agent $as_me 2.0.7, which was +generated by GNU Autoconf 2.68. Invocation command line was + + $ $0 $@ + +_ACEOF +exec 5>>config.log +{ +cat <<_ASUNAME +## --------- ## +## Platform. ## +## --------- ## + +hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` + +/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` +/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` +/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` +/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` + +_ASUNAME + +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + $as_echo "PATH: $as_dir" + done +IFS=$as_save_IFS + +} >&5 + +cat >&5 <<_ACEOF + + +## ----------- ## +## Core tests. ## +## ----------- ## + +_ACEOF + + +# Keep a trace of the command line. +# Strip out --no-create and --no-recursion so they do not pile up. +# Strip out --silent because we don't want to record it for future runs. +# Also quote any args containing shell meta-characters. +# Make two passes to allow for proper duplicate-argument suppression. +ac_configure_args= +ac_configure_args0= +ac_configure_args1= +ac_must_keep_next=false +for ac_pass in 1 2 +do + for ac_arg + do + case $ac_arg in + -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + continue ;; + *\'*) + ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + case $ac_pass in + 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; + 2) + as_fn_append ac_configure_args1 " '$ac_arg'" + if test $ac_must_keep_next = true; then + ac_must_keep_next=false # Got value, back to normal. + else + case $ac_arg in + *=* | --config-cache | -C | -disable-* | --disable-* \ + | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ + | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ + | -with-* | --with-* | -without-* | --without-* | --x) + case "$ac_configure_args0 " in + "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; + esac + ;; + -* ) ac_must_keep_next=true ;; + esac + fi + as_fn_append ac_configure_args " '$ac_arg'" + ;; + esac + done +done +{ ac_configure_args0=; unset ac_configure_args0;} +{ ac_configure_args1=; unset ac_configure_args1;} + +# When interrupted or exit'd, cleanup temporary files, and complete +# config.log. We remove comments because anyway the quotes in there +# would cause problems or look ugly. +# WARNING: Use '\'' to represent an apostrophe within the trap. +# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. +trap 'exit_status=$? + # Save into config.log some information that might help in debugging. + { + echo + + $as_echo "## ---------------- ## +## Cache variables. ## +## ---------------- ##" + echo + # The following way of writing the cache mishandles newlines in values, +( + for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) { eval $ac_var=; unset $ac_var;} ;; + esac ;; + esac + done + (set) 2>&1 | + case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + sed -n \ + "s/'\''/'\''\\\\'\'''\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" + ;; #( + *) + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) + echo + + $as_echo "## ----------------- ## +## Output variables. ## +## ----------------- ##" + echo + for ac_var in $ac_subst_vars + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + $as_echo "$ac_var='\''$ac_val'\''" + done | sort + echo + + if test -n "$ac_subst_files"; then + $as_echo "## ------------------- ## +## File substitutions. ## +## ------------------- ##" + echo + for ac_var in $ac_subst_files + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + $as_echo "$ac_var='\''$ac_val'\''" + done | sort + echo + fi + + if test -s confdefs.h; then + $as_echo "## ----------- ## +## confdefs.h. ## +## ----------- ##" + echo + cat confdefs.h + echo + fi + test "$ac_signal" != 0 && + $as_echo "$as_me: caught signal $ac_signal" + $as_echo "$as_me: exit $exit_status" + } >&5 + rm -f core *.core core.conftest.* && + rm -f -r conftest* confdefs* conf$$* $ac_clean_files && + exit $exit_status +' 0 +for ac_signal in 1 2 13 15; do + trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal +done +ac_signal=0 + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -f -r conftest* confdefs.h + +$as_echo "/* confdefs.h */" > confdefs.h + +# Predefined preprocessor variables. + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_NAME "$PACKAGE_NAME" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_TARNAME "$PACKAGE_TARNAME" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_VERSION "$PACKAGE_VERSION" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_STRING "$PACKAGE_STRING" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_URL "$PACKAGE_URL" +_ACEOF + + +# Let the site file select an alternate cache file if it wants to. +# Prefer an explicitly selected file to automatically selected ones. +ac_site_file1=NONE +ac_site_file2=NONE +if test -n "$CONFIG_SITE"; then + # We do not want a PATH search for config.site. + case $CONFIG_SITE in #(( + -*) ac_site_file1=./$CONFIG_SITE;; + */*) ac_site_file1=$CONFIG_SITE;; + *) ac_site_file1=./$CONFIG_SITE;; + esac +elif test "x$prefix" != xNONE; then + ac_site_file1=$prefix/share/config.site + ac_site_file2=$prefix/etc/config.site +else + ac_site_file1=$ac_default_prefix/share/config.site + ac_site_file2=$ac_default_prefix/etc/config.site +fi +for ac_site_file in "$ac_site_file1" "$ac_site_file2" +do + test "x$ac_site_file" = xNONE && continue + if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 +$as_echo "$as_me: loading site script $ac_site_file" >&6;} + sed 's/^/| /' "$ac_site_file" >&5 + . "$ac_site_file" \ + || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "failed to load site script $ac_site_file +See \`config.log' for more details" "$LINENO" 5; } + fi +done + +if test -r "$cache_file"; then + # Some versions of bash will fail to source /dev/null (special files + # actually), so we avoid doing that. DJGPP emulates it as a regular file. + if test /dev/null != "$cache_file" && test -f "$cache_file"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 +$as_echo "$as_me: loading cache $cache_file" >&6;} + case $cache_file in + [\\/]* | ?:[\\/]* ) . "$cache_file";; + *) . "./$cache_file";; + esac + fi +else + { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 +$as_echo "$as_me: creating cache $cache_file" >&6;} + >$cache_file +fi + +# Check that the precious variables saved in the cache have kept the same +# value. +ac_cache_corrupted=false +for ac_var in $ac_precious_vars; do + eval ac_old_set=\$ac_cv_env_${ac_var}_set + eval ac_new_set=\$ac_env_${ac_var}_set + eval ac_old_val=\$ac_cv_env_${ac_var}_value + eval ac_new_val=\$ac_env_${ac_var}_value + case $ac_old_set,$ac_new_set in + set,) + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 +$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,set) + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 +$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,);; + *) + if test "x$ac_old_val" != "x$ac_new_val"; then + # differences in whitespace do not lead to failure. + ac_old_val_w=`echo x $ac_old_val` + ac_new_val_w=`echo x $ac_new_val` + if test "$ac_old_val_w" != "$ac_new_val_w"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 +$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + ac_cache_corrupted=: + else + { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 +$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} + eval $ac_var=\$ac_old_val + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 +$as_echo "$as_me: former value: \`$ac_old_val'" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 +$as_echo "$as_me: current value: \`$ac_new_val'" >&2;} + fi;; + esac + # Pass precious variables to config.status. + if test "$ac_new_set" = set; then + case $ac_new_val in + *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; + *) ac_arg=$ac_var=$ac_new_val ;; + esac + case " $ac_configure_args " in + *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. + *) as_fn_append ac_configure_args " '$ac_arg'" ;; + esac + fi +done +if $ac_cache_corrupted; then + { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 +$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} + as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 +fi +## -------------------- ## +## Main body of script. ## +## -------------------- ## + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. +set dummy ${ac_tool_prefix}gcc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_CC="${ac_tool_prefix}gcc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_CC="gcc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +else + CC="$ac_cv_prog_CC" +fi + +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. +set dummy ${ac_tool_prefix}cc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_CC="${ac_tool_prefix}cc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + fi +fi +if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + ac_prog_rejected=no +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $# != 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" + fi +fi +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + for ac_prog in cl.exe + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_CC="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$CC" && break + done +fi +if test -z "$CC"; then + ac_ct_CC=$CC + for ac_prog in cl.exe +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_CC="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$ac_ct_CC" && break +done + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +fi + +fi + + +test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "no acceptable C compiler found in \$PATH +See \`config.log' for more details" "$LINENO" 5; } + +# Provide some information about the compiler. +$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 +set X $ac_compile +ac_compiler=$2 +for ac_option in --version -v -V -qversion; do + { { ac_try="$ac_compiler $ac_option >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compiler $ac_option >&5") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + sed '10a\ +... rest of stderr output deleted ... + 10q' conftest.err >conftest.er1 + cat conftest.er1 >&5 + fi + rm -f conftest.er1 conftest.err + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +done + +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" +# Try to create an executable without -o first, disregard a.out. +# It will help us diagnose broken compilers, and finding out an intuition +# of exeext. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 +$as_echo_n "checking whether the C compiler works... " >&6; } +ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` + +# The possible output files: +ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" + +ac_rmfiles= +for ac_file in $ac_files +do + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; + * ) ac_rmfiles="$ac_rmfiles $ac_file";; + esac +done +rm -f $ac_rmfiles + +if { { ac_try="$ac_link_default" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link_default") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. +# So ignore a value of `no', otherwise this would lead to `EXEEXT = no' +# in a Makefile. We should not override ac_cv_exeext if it was cached, +# so that the user can short-circuit this test for compilers unknown to +# Autoconf. +for ac_file in $ac_files '' +do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) + ;; + [ab].out ) + # We found the default executable, but exeext='' is most + # certainly right. + break;; + *.* ) + if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; + then :; else + ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + fi + # We set ac_cv_exeext here because the later test for it is not + # safe: cross compilers may not add the suffix if given an `-o' + # argument, so we may need to know it at that point already. + # Even if this section looks crufty: it has the advantage of + # actually working. + break;; + * ) + break;; + esac +done +test "$ac_cv_exeext" = no && ac_cv_exeext= + +else + ac_file='' +fi +if test -z "$ac_file"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +$as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "C compiler cannot create executables +See \`config.log' for more details" "$LINENO" 5; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 +$as_echo_n "checking for C compiler default output file name... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 +$as_echo "$ac_file" >&6; } +ac_exeext=$ac_cv_exeext + +rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out +ac_clean_files=$ac_clean_files_save +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 +$as_echo_n "checking for suffix of executables... " >&6; } +if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + # If both `conftest.exe' and `conftest' are `present' (well, observable) +# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will +# work properly (i.e., refer to `conftest.exe'), while it won't with +# `rm'. +for ac_file in conftest.exe conftest conftest.*; do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; + *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + break;; + * ) break;; + esac +done +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details" "$LINENO" 5; } +fi +rm -f conftest conftest$ac_cv_exeext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 +$as_echo "$ac_cv_exeext" >&6; } + +rm -f conftest.$ac_ext +EXEEXT=$ac_cv_exeext +ac_exeext=$EXEEXT +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ +FILE *f = fopen ("conftest.out", "w"); + return ferror (f) || fclose (f) != 0; + + ; + return 0; +} +_ACEOF +ac_clean_files="$ac_clean_files conftest.out" +# Check that the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 +$as_echo_n "checking whether we are cross compiling... " >&6; } +if test "$cross_compiling" != yes; then + { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + if { ac_try='./conftest$ac_cv_exeext' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then + cross_compiling=no + else + if test "$cross_compiling" = maybe; then + cross_compiling=yes + else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot run C compiled programs. +If you meant to cross compile, use \`--host'. +See \`config.log' for more details" "$LINENO" 5; } + fi + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 +$as_echo "$cross_compiling" >&6; } + +rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out +ac_clean_files=$ac_clean_files_save +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 +$as_echo_n "checking for suffix of object files... " >&6; } +if ${ac_cv_objext+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.o conftest.obj +if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + for ac_file in conftest.o conftest.obj conftest.*; do + test -f "$ac_file" || continue; + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; + *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` + break;; + esac +done +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot compute suffix of object files: cannot compile +See \`config.log' for more details" "$LINENO" 5; } +fi +rm -f conftest.$ac_cv_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 +$as_echo "$ac_cv_objext" >&6; } +OBJEXT=$ac_cv_objext +ac_objext=$OBJEXT +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 +$as_echo_n "checking whether we are using the GNU C compiler... " >&6; } +if ${ac_cv_c_compiler_gnu+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_compiler_gnu=yes +else + ac_compiler_gnu=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_c_compiler_gnu=$ac_compiler_gnu + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 +$as_echo "$ac_cv_c_compiler_gnu" >&6; } +if test $ac_compiler_gnu = yes; then + GCC=yes +else + GCC= +fi +ac_test_CFLAGS=${CFLAGS+set} +ac_save_CFLAGS=$CFLAGS +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 +$as_echo_n "checking whether $CC accepts -g... " >&6; } +if ${ac_cv_prog_cc_g+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_save_c_werror_flag=$ac_c_werror_flag + ac_c_werror_flag=yes + ac_cv_prog_cc_g=no + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_g=yes +else + CFLAGS="" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + +else + ac_c_werror_flag=$ac_save_c_werror_flag + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_g=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_c_werror_flag=$ac_save_c_werror_flag +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 +$as_echo "$ac_cv_prog_cc_g" >&6; } +if test "$ac_test_CFLAGS" = set; then + CFLAGS=$ac_save_CFLAGS +elif test $ac_cv_prog_cc_g = yes; then + if test "$GCC" = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-g" + fi +else + if test "$GCC" = yes; then + CFLAGS="-O2" + else + CFLAGS= + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 +$as_echo_n "checking for $CC option to accept ISO C89... " >&6; } +if ${ac_cv_prog_cc_c89+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_prog_cc_c89=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#include +#include +/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ +struct buf { int x; }; +FILE * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (p, i) + char **p; + int i; +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; +} + +/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has + function prototypes and stuff, but not '\xHH' hex character constants. + These don't provoke an error unfortunately, instead are silently treated + as 'x'. The following induces an error, until -std is added to get + proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an + array size at least. It's necessary to write '\x00'==0 to get something + that's true only with -std. */ +int osf4_cc_array ['\x00' == 0 ? 1 : -1]; + +/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters + inside strings and character constants. */ +#define FOO(x) 'x' +int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; + +int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); +int argc; +char **argv; +int +main () +{ +return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; + ; + return 0; +} +_ACEOF +for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ + -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_c89=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext + test "x$ac_cv_prog_cc_c89" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC + +fi +# AC_CACHE_VAL +case "x$ac_cv_prog_cc_c89" in + x) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +$as_echo "none needed" >&6; } ;; + xno) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +$as_echo "unsupported" >&6; } ;; + *) + CC="$CC $ac_cv_prog_cc_c89" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 +$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; +esac +if test "x$ac_cv_prog_cc_c89" != xno; then : + +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + case $ac_cv_prog_cc_stdc in #( + no) : + ac_cv_prog_cc_c99=no; ac_cv_prog_cc_c89=no ;; #( + *) : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C99" >&5 +$as_echo_n "checking for $CC option to accept ISO C99... " >&6; } +if ${ac_cv_prog_cc_c99+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_prog_cc_c99=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#include +#include +#include + +// Check varargs macros. These examples are taken from C99 6.10.3.5. +#define debug(...) fprintf (stderr, __VA_ARGS__) +#define showlist(...) puts (#__VA_ARGS__) +#define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__)) +static void +test_varargs_macros (void) +{ + int x = 1234; + int y = 5678; + debug ("Flag"); + debug ("X = %d\n", x); + showlist (The first, second, and third items.); + report (x>y, "x is %d but y is %d", x, y); +} + +// Check long long types. +#define BIG64 18446744073709551615ull +#define BIG32 4294967295ul +#define BIG_OK (BIG64 / BIG32 == 4294967297ull && BIG64 % BIG32 == 0) +#if !BIG_OK + your preprocessor is broken; +#endif +#if BIG_OK +#else + your preprocessor is broken; +#endif +static long long int bignum = -9223372036854775807LL; +static unsigned long long int ubignum = BIG64; + +struct incomplete_array +{ + int datasize; + double data[]; +}; + +struct named_init { + int number; + const wchar_t *name; + double average; +}; + +typedef const char *ccp; + +static inline int +test_restrict (ccp restrict text) +{ + // See if C++-style comments work. + // Iterate through items via the restricted pointer. + // Also check for declarations in for loops. + for (unsigned int i = 0; *(text+i) != '\0'; ++i) + continue; + return 0; +} + +// Check varargs and va_copy. +static void +test_varargs (const char *format, ...) +{ + va_list args; + va_start (args, format); + va_list args_copy; + va_copy (args_copy, args); + + const char *str; + int number; + float fnumber; + + while (*format) + { + switch (*format++) + { + case 's': // string + str = va_arg (args_copy, const char *); + break; + case 'd': // int + number = va_arg (args_copy, int); + break; + case 'f': // float + fnumber = va_arg (args_copy, double); + break; + default: + break; + } + } + va_end (args_copy); + va_end (args); +} + +int +main () +{ + + // Check bool. + _Bool success = false; + + // Check restrict. + if (test_restrict ("String literal") == 0) + success = true; + char *restrict newvar = "Another string"; + + // Check varargs. + test_varargs ("s, d' f .", "string", 65, 34.234); + test_varargs_macros (); + + // Check flexible array members. + struct incomplete_array *ia = + malloc (sizeof (struct incomplete_array) + (sizeof (double) * 10)); + ia->datasize = 10; + for (int i = 0; i < ia->datasize; ++i) + ia->data[i] = i * 1.234; + + // Check named initializers. + struct named_init ni = { + .number = 34, + .name = L"Test wide string", + .average = 543.34343, + }; + + ni.number = 58; + + int dynamic_array[ni.number]; + dynamic_array[ni.number - 1] = 543; + + // work around unused variable warnings + return (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == 'x' + || dynamic_array[ni.number - 1] != 543); + + ; + return 0; +} +_ACEOF +for ac_arg in '' -std=gnu99 -std=c99 -c99 -AC99 -xc99=all -qlanglvl=extc99 +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_c99=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext + test "x$ac_cv_prog_cc_c99" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC + +fi +# AC_CACHE_VAL +case "x$ac_cv_prog_cc_c99" in + x) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +$as_echo "none needed" >&6; } ;; + xno) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +$as_echo "unsupported" >&6; } ;; + *) + CC="$CC $ac_cv_prog_cc_c99" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5 +$as_echo "$ac_cv_prog_cc_c99" >&6; } ;; +esac +if test "x$ac_cv_prog_cc_c99" != xno; then : + ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c99 +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 +$as_echo_n "checking for $CC option to accept ISO C89... " >&6; } +if ${ac_cv_prog_cc_c89+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_prog_cc_c89=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#include +#include +/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ +struct buf { int x; }; +FILE * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (p, i) + char **p; + int i; +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; +} + +/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has + function prototypes and stuff, but not '\xHH' hex character constants. + These don't provoke an error unfortunately, instead are silently treated + as 'x'. The following induces an error, until -std is added to get + proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an + array size at least. It's necessary to write '\x00'==0 to get something + that's true only with -std. */ +int osf4_cc_array ['\x00' == 0 ? 1 : -1]; + +/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters + inside strings and character constants. */ +#define FOO(x) 'x' +int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; + +int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); +int argc; +char **argv; +int +main () +{ +return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; + ; + return 0; +} +_ACEOF +for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ + -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_c89=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext + test "x$ac_cv_prog_cc_c89" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC + +fi +# AC_CACHE_VAL +case "x$ac_cv_prog_cc_c89" in + x) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +$as_echo "none needed" >&6; } ;; + xno) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +$as_echo "unsupported" >&6; } ;; + *) + CC="$CC $ac_cv_prog_cc_c89" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 +$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; +esac +if test "x$ac_cv_prog_cc_c89" != xno; then : + ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c89 +else + ac_cv_prog_cc_stdc=no +fi + +fi + ;; +esac + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO Standard C" >&5 +$as_echo_n "checking for $CC option to accept ISO Standard C... " >&6; } + if ${ac_cv_prog_cc_stdc+:} false; then : + $as_echo_n "(cached) " >&6 +fi + + case $ac_cv_prog_cc_stdc in #( + no) : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +$as_echo "unsupported" >&6; } ;; #( + '') : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +$as_echo "none needed" >&6; } ;; #( + *) : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_stdc" >&5 +$as_echo "$ac_cv_prog_cc_stdc" >&6; } ;; +esac + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. +set dummy ${ac_tool_prefix}ranlib; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_RANLIB+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +RANLIB=$ac_cv_prog_RANLIB +if test -n "$RANLIB"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 +$as_echo "$RANLIB" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_RANLIB"; then + ac_ct_RANLIB=$RANLIB + # Extract the first word of "ranlib", so it can be a program name with args. +set dummy ranlib; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_RANLIB+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_RANLIB"; then + ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_RANLIB="ranlib" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB +if test -n "$ac_ct_RANLIB"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 +$as_echo "$ac_ct_RANLIB" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_RANLIB" = x; then + RANLIB=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + RANLIB=$ac_ct_RANLIB + fi +else + RANLIB="$ac_cv_prog_RANLIB" +fi + + + +ac_config_headers="$ac_config_headers src/dti_agent_config.h" + +am__api_version='1.11' + +ac_aux_dir= +for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do + if test -f "$ac_dir/install-sh"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install-sh -c" + break + elif test -f "$ac_dir/install.sh"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install.sh -c" + break + elif test -f "$ac_dir/shtool"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/shtool install -c" + break + fi +done +if test -z "$ac_aux_dir"; then + as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5 +fi + +# These three variables are undocumented and unsupported, +# and are intended to be withdrawn in a future Autoconf release. +# They can cause serious problems if a builder's source tree is in a directory +# whose full name contains unusual characters. +ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. +ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. +ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. + + +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AmigaOS /C/install, which installs bootblocks on floppy discs +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# OS/2's system install, which has a completely different semantic +# ./install, which can be erroneously created by make from ./install.sh. +# Reject install programs that cannot install multiple files. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 +$as_echo_n "checking for a BSD-compatible install... " >&6; } +if test -z "$INSTALL"; then +if ${ac_cv_path_install+:} false; then : + $as_echo_n "(cached) " >&6 +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + # Account for people who put trailing slashes in PATH elements. +case $as_dir/ in #(( + ./ | .// | /[cC]/* | \ + /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ + ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ + /usr/ucb/* ) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then + if test $ac_prog = install && + grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + elif test $ac_prog = install && + grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # program-specific install script used by HP pwplus--don't use. + : + else + rm -rf conftest.one conftest.two conftest.dir + echo one > conftest.one + echo two > conftest.two + mkdir conftest.dir + if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && + test -s conftest.one && test -s conftest.two && + test -s conftest.dir/conftest.one && + test -s conftest.dir/conftest.two + then + ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" + break 3 + fi + fi + fi + done + done + ;; +esac + + done +IFS=$as_save_IFS + +rm -rf conftest.one conftest.two conftest.dir + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL=$ac_cv_path_install + else + # As a last resort, use the slow shell script. Don't cache a + # value for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the value is a relative name. + INSTALL=$ac_install_sh + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 +$as_echo "$INSTALL" >&6; } + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 +$as_echo_n "checking whether build environment is sane... " >&6; } +# Just in case +sleep 1 +echo timestamp > conftest.file +# Reject unsafe characters in $srcdir or the absolute working directory +# name. Accept space and tab only in the latter. +am_lf=' +' +case `pwd` in + *[\\\"\#\$\&\'\`$am_lf]*) + as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;; +esac +case $srcdir in + *[\\\"\#\$\&\'\`$am_lf\ \ ]*) + as_fn_error $? "unsafe srcdir value: \`$srcdir'" "$LINENO" 5;; +esac + +# Do `set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` + if test "$*" = "X"; then + # -L didn't work. + set X `ls -t "$srcdir/configure" conftest.file` + fi + rm -f conftest.file + if test "$*" != "X $srcdir/configure conftest.file" \ + && test "$*" != "X conftest.file $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + as_fn_error $? "ls -t appears to fail. Make sure there is not a broken +alias in your environment" "$LINENO" 5 + fi + + test "$2" = conftest.file + ) +then + # Ok. + : +else + as_fn_error $? "newly created file is older than distributed files! +Check your system clock" "$LINENO" 5 +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +test "$program_prefix" != NONE && + program_transform_name="s&^&$program_prefix&;$program_transform_name" +# Use a double $ so make ignores it. +test "$program_suffix" != NONE && + program_transform_name="s&\$&$program_suffix&;$program_transform_name" +# Double any \ or $. +# By default was `s,x,x', remove it if useless. +ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' +program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` + +# expand $ac_aux_dir to an absolute path +am_aux_dir=`cd $ac_aux_dir && pwd` + +if test x"${MISSING+set}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; + *) + MISSING="\${SHELL} $am_aux_dir/missing" ;; + esac +fi +# Use eval to expand $SHELL +if eval "$MISSING --run true"; then + am_missing_run="$MISSING --run " +else + am_missing_run= + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`missing' script is too old or missing" >&5 +$as_echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} +fi + +if test x"${install_sh}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; + *) + install_sh="\${SHELL} $am_aux_dir/install-sh" + esac +fi + +# Installed binaries are usually stripped using `strip' when the user +# run `make install-strip'. However `strip' might not be the right +# tool to use in cross-compilation environments, therefore Automake +# will honor the `STRIP' environment variable to overrule this program. +if test "$cross_compiling" != no; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. +set dummy ${ac_tool_prefix}strip; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_STRIP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$STRIP"; then + ac_cv_prog_STRIP="$STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_STRIP="${ac_tool_prefix}strip" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +STRIP=$ac_cv_prog_STRIP +if test -n "$STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 +$as_echo "$STRIP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_STRIP"; then + ac_ct_STRIP=$STRIP + # Extract the first word of "strip", so it can be a program name with args. +set dummy strip; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_STRIP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_STRIP"; then + ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_STRIP="strip" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP +if test -n "$ac_ct_STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 +$as_echo "$ac_ct_STRIP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_STRIP" = x; then + STRIP=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + STRIP=$ac_ct_STRIP + fi +else + STRIP="$ac_cv_prog_STRIP" +fi + +fi +INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 +$as_echo_n "checking for a thread-safe mkdir -p... " >&6; } +if test -z "$MKDIR_P"; then + if ${ac_cv_path_mkdir+:} false; then : + $as_echo_n "(cached) " >&6 +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in mkdir gmkdir; do + for ac_exec_ext in '' $ac_executable_extensions; do + { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue + case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( + 'mkdir (GNU coreutils) '* | \ + 'mkdir (coreutils) '* | \ + 'mkdir (fileutils) '4.1*) + ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext + break 3;; + esac + done + done + done +IFS=$as_save_IFS + +fi + + test -d ./--version && rmdir ./--version + if test "${ac_cv_path_mkdir+set}" = set; then + MKDIR_P="$ac_cv_path_mkdir -p" + else + # As a last resort, use the slow shell script. Don't cache a + # value for MKDIR_P within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the value is a relative name. + MKDIR_P="$ac_install_sh -d" + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 +$as_echo "$MKDIR_P" >&6; } + +mkdir_p="$MKDIR_P" +case $mkdir_p in + [\\/$]* | ?:[\\/]*) ;; + */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; +esac + +for ac_prog in gawk mawk nawk awk +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_AWK+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$AWK"; then + ac_cv_prog_AWK="$AWK" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_AWK="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +AWK=$ac_cv_prog_AWK +if test -n "$AWK"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 +$as_echo "$AWK" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$AWK" && break +done + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } +set x ${MAKE-make} +ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` +if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat >conftest.make <<\_ACEOF +SHELL = /bin/sh +all: + @echo '@@@%%%=$(MAKE)=@@@%%%' +_ACEOF +# GNU make sometimes prints "make[1]: Entering ...", which would confuse us. +case `${MAKE-make} -f conftest.make 2>/dev/null` in + *@@@%%%=?*=@@@%%%*) + eval ac_cv_prog_make_${ac_make}_set=yes;; + *) + eval ac_cv_prog_make_${ac_make}_set=no;; +esac +rm -f conftest.make +fi +if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + SET_MAKE= +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + SET_MAKE="MAKE=${MAKE-make}" +fi + +rm -rf .tst 2>/dev/null +mkdir .tst 2>/dev/null +if test -d .tst; then + am__leading_dot=. +else + am__leading_dot=_ +fi +rmdir .tst 2>/dev/null + +DEPDIR="${am__leading_dot}deps" + +ac_config_commands="$ac_config_commands depfiles" + + +am_make=${MAKE-make} +cat > confinc << 'END' +am__doit: + @echo this is the am__doit target +.PHONY: am__doit +END +# If we don't find an include directive, just comment out the code. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5 +$as_echo_n "checking for style of include used by $am_make... " >&6; } +am__include="#" +am__quote= +_am_result=none +# First try GNU make style include. +echo "include confinc" > confmf +# Ignore all kinds of additional output from `make'. +case `$am_make -s -f confmf 2> /dev/null` in #( +*the\ am__doit\ target*) + am__include=include + am__quote= + _am_result=GNU + ;; +esac +# Now try BSD make style include. +if test "$am__include" = "#"; then + echo '.include "confinc"' > confmf + case `$am_make -s -f confmf 2> /dev/null` in #( + *the\ am__doit\ target*) + am__include=.include + am__quote="\"" + _am_result=BSD + ;; + esac +fi + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5 +$as_echo "$_am_result" >&6; } +rm -f confinc confmf + +# Check whether --enable-dependency-tracking was given. +if test "${enable_dependency_tracking+set}" = set; then : + enableval=$enable_dependency_tracking; +fi + +if test "x$enable_dependency_tracking" != xno; then + am_depcomp="$ac_aux_dir/depcomp" + AMDEPBACKSLASH='\' +fi + if test "x$enable_dependency_tracking" != xno; then + AMDEP_TRUE= + AMDEP_FALSE='#' +else + AMDEP_TRUE='#' + AMDEP_FALSE= +fi + + +if test "`cd $srcdir && pwd`" != "`pwd`"; then + # Use -I$(srcdir) only when $(srcdir) != ., so that make's output + # is not polluted with repeated "-I." + am__isrc=' -I$(srcdir)' + # test to see if srcdir already configured + if test -f $srcdir/config.status; then + as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 + fi +fi + +# test whether we have cygpath +if test -z "$CYGPATH_W"; then + if (cygpath --version) >/dev/null 2>/dev/null; then + CYGPATH_W='cygpath -w' + else + CYGPATH_W=echo + fi +fi + + +# Define the identity of the package. + PACKAGE='gpon_dti_agent' + VERSION='2.0.7' + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE "$PACKAGE" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define VERSION "$VERSION" +_ACEOF + +# Some tools Automake needs. + +ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} + + +AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} + + +AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} + + +AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} + + +MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} + +# We need awk for the "check" target. The system "awk" is bad on +# some platforms. +# Always define AMTAR for backward compatibility. + +AMTAR=${AMTAR-"${am_missing_run}tar"} + +am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -' + + + + +depcc="$CC" am_compiler_list= + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 +$as_echo_n "checking dependency style of $depcc... " >&6; } +if ${am_cv_CC_dependencies_compiler_type+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named `D' -- because `-MD' means `put the output + # in D'. + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_CC_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` + fi + am__universal=false + case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac + + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with + # Solaris 8's {/usr,}/bin/sh. + touch sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + # We check with `-c' and `-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle `-M -o', and we need to detect this. Also, some Intel + # versions had trouble with output in subdirs + am__obj=sub/conftest.${OBJEXT-o} + am__minus_obj="-o $am__obj" + case $depmode in + gcc) + # This depmode causes a compiler race in universal mode. + test "$am__universal" = false || continue + ;; + nosideeffect) + # after this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + msvisualcpp | msvcmsys) + # This compiler won't grok `-c -o', but also, the minuso test has + # not run yet. These depmodes are late enough in the game, and + # so weak that their functioning should not be impacted. + am__obj=conftest.${OBJEXT-o} + am__minus_obj= + ;; + none) break ;; + esac + if depmode=$depmode \ + source=sub/conftest.c object=$am__obj \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep $am__obj sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_CC_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_CC_dependencies_compiler_type=none +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 +$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } +CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type + + if + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then + am__fastdepCC_TRUE= + am__fastdepCC_FALSE='#' +else + am__fastdepCC_TRUE='#' + am__fastdepCC_FALSE= +fi + + + +if test "x$CC" != xcc; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC and cc understand -c and -o together" >&5 +$as_echo_n "checking whether $CC and cc understand -c and -o together... " >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether cc understands -c and -o together" >&5 +$as_echo_n "checking whether cc understands -c and -o together... " >&6; } +fi +set dummy $CC; ac_cc=`$as_echo "$2" | + sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'` +if eval \${ac_cv_prog_cc_${ac_cc}_c_o+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +# Make sure it works both with $CC and with simple cc. +# We do the test twice because some compilers refuse to overwrite an +# existing .o file with -o, though they will create one. +ac_try='$CC -c conftest.$ac_ext -o conftest2.$ac_objext >&5' +rm -f conftest2.* +if { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && + test -f conftest2.$ac_objext && { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; +then + eval ac_cv_prog_cc_${ac_cc}_c_o=yes + if test "x$CC" != xcc; then + # Test first that cc exists at all. + if { ac_try='cc -c conftest.$ac_ext >&5' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then + ac_try='cc -c conftest.$ac_ext -o conftest2.$ac_objext >&5' + rm -f conftest2.* + if { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && + test -f conftest2.$ac_objext && { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; + then + # cc works too. + : + else + # cc exists but doesn't like -o. + eval ac_cv_prog_cc_${ac_cc}_c_o=no + fi + fi + fi +else + eval ac_cv_prog_cc_${ac_cc}_c_o=no +fi +rm -f core conftest* + +fi +if eval test \$ac_cv_prog_cc_${ac_cc}_c_o = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + +$as_echo "#define NO_MINUS_C_MINUS_O 1" >>confdefs.h + +fi + +# FIXME: we rely on the cache variable name because +# there is no other way. +set dummy $CC +am_cc=`echo $2 | sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'` +eval am_t=\$ac_cv_prog_cc_${am_cc}_c_o +if test "$am_t" != yes; then + # Losing compiler, so override with the script. + # FIXME: It is wrong to rewrite CC. + # But if we don't then we get into trouble of one sort or another. + # A longer-term fix would be to have automake use am__CC in this case, + # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" + CC="$am_aux_dir/compile $CC" +fi + + + +# +# save the configure arguments +# +CONFIGURE_OPTIONS="$ac_configure_args" + + +DEFAULT_IFXOS_LIBRARY_PATH='.' +# Check whether --enable-ifxos-library was given. +if test "${enable_ifxos_library+set}" = set; then : + enableval=$enable_ifxos_library; + if test -n "$enableval"; then + echo Set the libifxos.a library path to $enableval + IFXOS_LIBRARY_PATH=$enableval + + else + echo Set the lib_board_config library path $DEFAULT_IFXOS_LIBRARY_PATH + IFXOS_LIBRARY_PATH=$DEFAULT_IFXOS_LIBRARY_PATH + + fi + +else + + echo Set the libifxos.a library path $DEFAULT_IFXOS_LIBRARY_PATH + IFXOS_LIBRARY_PATH=$DEFAULT_IFXOS_LIBRARY_PATH + + + +fi + + +DEFAULT_IFXOS_INCLUDE_PATH='-I.' +# Check whether --enable-ifxos-include was given. +if test "${enable_ifxos_include+set}" = set; then : + enableval=$enable_ifxos_include; + if test -n "$enableval"; then + echo Set the lib_ifxos include path $enableval + IFXOS_INCLUDE_PATH=$enableval + + else + echo -e Set the default lib_ifxos include path $DEFAULT_IFXOS_INCLUDE_PATH + IFXOS_INCLUDE_PATH=$DEFAULT_IFXOS_INCLUDE_PATH + + fi + +else + + echo -e Set the default lib_ifxos include path $DEFAULT_IFXOS_INCLUDE_PATH + IFXOS_INCLUDE_PATH=$DEFAULT_IFXOS_INCLUDE_PATH + + + +fi + + +DEFAULT_DTI_LIBRARY_PATH='.' +# Check whether --enable-dti-library was given. +if test "${enable_dti_library+set}" = set; then : + enableval=$enable_dti_library; + if test -n "$enableval"; then + echo Set the libdti.a library path to $enableval + DTI_LIBRARY_PATH=$enableval + + else + echo Set the lib_board_config library path $DEFAULT_DTI_LIBRARY_PATH + DTI_LIBRARY_PATH=$DEFAULT_DTI_LIBRARY_PATH + + fi + +else + + echo Set the libdti.a library path $DEFAULT_DTI_LIBRARY_PATH + DTI_LIBRARY_PATH=$DEFAULT_DTI_LIBRARY_PATH + + + +fi + + +DEFAULT_DTI_INCLUDE_PATH='-I.' +# Check whether --enable-dti-include was given. +if test "${enable_dti_include+set}" = set; then : + enableval=$enable_dti_include; + if test -n "$enableval"; then + echo Set the lib_dti include path $enableval + DTI_INCLUDE_PATH=$enableval + + else + echo -e Set the default lib_ifxos include path $DEFAULT_DTI_INCLUDE_PATH + DTI_INCLUDE_PATH=$DEFAULT_DTI_INCLUDE_PATH + + fi + +else + + echo -e Set the default lib_ifxos include path $DEFAULT_DTI_INCLUDE_PATH + DTI_INCLUDE_PATH=$DEFAULT_DTI_INCLUDE_PATH + + + +fi + + +# Check whether --enable-start-devs was given. +if test "${enable_start_devs+set}" = set; then : + enableval=$enable_start_devs; + if test "$enableval" = yes; then + if true; then + STARTUP_REGISTERED_TRUE= + STARTUP_REGISTERED_FALSE='#' +else + STARTUP_REGISTERED_TRUE='#' + STARTUP_REGISTERED_FALSE= +fi + + STARTUP_REGISTERED=yes + + else + if false; then + STARTUP_REGISTERED_TRUE= + STARTUP_REGISTERED_FALSE='#' +else + STARTUP_REGISTERED_TRUE='#' + STARTUP_REGISTERED_FALSE= +fi + + STARTUP_REGISTERED=no + + fi + +else + + if true; then + STARTUP_REGISTERED_TRUE= + STARTUP_REGISTERED_FALSE='#' +else + STARTUP_REGISTERED_TRUE='#' + STARTUP_REGISTERED_FALSE= +fi + + STARTUP_REGISTERED=yes + + + +fi + + +# Check whether --enable-dev-generic was given. +if test "${enable_dev_generic+set}" = set; then : + enableval=$enable_dev_generic; + if test "$enableval" = yes; then + if true; then + DEVICE_GENERIC_TRUE= + DEVICE_GENERIC_FALSE='#' +else + DEVICE_GENERIC_TRUE='#' + DEVICE_GENERIC_FALSE= +fi + + DEVICE_GENERIC=yes + + else + if false; then + DEVICE_GENERIC_TRUE= + DEVICE_GENERIC_FALSE='#' +else + DEVICE_GENERIC_TRUE='#' + DEVICE_GENERIC_FALSE= +fi + + DEVICE_GENERIC=no + + fi + +else + + if false; then + DEVICE_GENERIC_TRUE= + DEVICE_GENERIC_FALSE='#' +else + DEVICE_GENERIC_TRUE='#' + DEVICE_GENERIC_FALSE= +fi + + DEVICE_GENERIC=no + + + +fi + + +# Check whether --enable-onu was given. +if test "${enable_onu+set}" = set; then : + enableval=$enable_onu; + if test "$enableval" = yes; then + if true; then + DEVICE_ONU_TRUE= + DEVICE_ONU_FALSE='#' +else + DEVICE_ONU_TRUE='#' + DEVICE_ONU_FALSE= +fi + + DEVICE_ONU=yes + + else + if false; then + DEVICE_ONU_TRUE= + DEVICE_ONU_FALSE='#' +else + DEVICE_ONU_TRUE='#' + DEVICE_ONU_FALSE= +fi + + DEVICE_ONU=no + + fi + +else + + if false; then + DEVICE_ONU_TRUE= + DEVICE_ONU_FALSE='#' +else + DEVICE_ONU_TRUE='#' + DEVICE_ONU_FALSE= +fi + + DEVICE_ONU=no + + + +fi + + + if false; then + ONU_SIMULATION_TRUE= + ONU_SIMULATION_FALSE='#' +else + ONU_SIMULATION_TRUE='#' + ONU_SIMULATION_FALSE= +fi + + +# Check whether --with-onu-simulation was given. +if test "${with_onu_simulation+set}" = set; then : + withval=$with_onu_simulation; + echo ONU simulation = $withval + + case $withval in + 0|no) + if false; then + ONU_SIMULATION_TRUE= + ONU_SIMULATION_FALSE='#' +else + ONU_SIMULATION_TRUE='#' + ONU_SIMULATION_FALSE= +fi + + ONU_SIMULATION=no + + ;; + 1|yes) + if true; then + ONU_SIMULATION_TRUE= + ONU_SIMULATION_FALSE='#' +else + ONU_SIMULATION_TRUE='#' + ONU_SIMULATION_FALSE= +fi + + ONU_SIMULATION=yes + + ;; + *) as_fn_error $? " ONU simulation " "$LINENO" 5; + ;; + esac + +else + + echo ONU simulation disabled + + if false; then + ONU_SIMULATION_TRUE= + ONU_SIMULATION_FALSE='#' +else + ONU_SIMULATION_TRUE='#' + ONU_SIMULATION_FALSE= +fi + + ONU_SIMULATION=no + + + +fi + + +DEFAULT_ONU_LIBRARY_PATH='.' +# Check whether --enable-onu-library was given. +if test "${enable_onu_library+set}" = set; then : + enableval=$enable_onu_library; + if test -n "$enableval"; then + echo Set the libonu.a library path to $enableval + ONU_LIBRARY_PATH=$enableval + + else + echo Set the lib_board_config library path $DEFAULT_ONU_LIBRARY_PATH + ONU_LIBRARY_PATH=$DEFAULT_ONU_LIBRARY_PATH + + fi + +else + + echo Set the libonu.a library path $DEFAULT_ONU_LIBRARY_PATH + ONU_LIBRARY_PATH=$DEFAULT_ONU_LIBRARY_PATH + + + +fi + + +DEFAULT_ONU_INCLUDE_PATH='-I.' +# Check whether --enable-onu-include was given. +if test "${enable_onu_include+set}" = set; then : + enableval=$enable_onu_include; + if test -n "$enableval"; then + echo Set the lib_onu include path $enableval + ONU_INCLUDE_PATH=$enableval + + else + echo -e Set the default lib_onu include path $DEFAULT_ONU_INCLUDE_PATH + ONU_INCLUDE_PATH=$DEFAULT_ONU_INCLUDE_PATH + + fi + +else + + echo -e Set the default lib_onu include path $DEFAULT_ONU_INCLUDE_PATH + ONU_INCLUDE_PATH=$DEFAULT_ONU_INCLUDE_PATH + + + +fi + + +# Check whether --enable-optic was given. +if test "${enable_optic+set}" = set; then : + enableval=$enable_optic; + if test "$enableval" = yes; then + if true; then + DEVICE_OPTIC_TRUE= + DEVICE_OPTIC_FALSE='#' +else + DEVICE_OPTIC_TRUE='#' + DEVICE_OPTIC_FALSE= +fi + + DEVICE_OPTIC=yes + + else + if false; then + DEVICE_OPTIC_TRUE= + DEVICE_OPTIC_FALSE='#' +else + DEVICE_OPTIC_TRUE='#' + DEVICE_OPTIC_FALSE= +fi + + DEVICE_OPTIC=no + + fi + +else + + if false; then + DEVICE_OPTIC_TRUE= + DEVICE_OPTIC_FALSE='#' +else + DEVICE_OPTIC_TRUE='#' + DEVICE_OPTIC_FALSE= +fi + + DEVICE_OPTIC=no + + + +fi + + + if false; then + OPTIC_SIMULATION_TRUE= + OPTIC_SIMULATION_FALSE='#' +else + OPTIC_SIMULATION_TRUE='#' + OPTIC_SIMULATION_FALSE= +fi + + +# Check whether --with-optic-simulation was given. +if test "${with_optic_simulation+set}" = set; then : + withval=$with_optic_simulation; + echo OPTIC simulation = $withval + + case $withval in + 0|no) + if false; then + OPTIC_SIMULATION_TRUE= + OPTIC_SIMULATION_FALSE='#' +else + OPTIC_SIMULATION_TRUE='#' + OPTIC_SIMULATION_FALSE= +fi + + OPTIC_SIMULATION=no + + ;; + 1|yes) + if true; then + OPTIC_SIMULATION_TRUE= + OPTIC_SIMULATION_FALSE='#' +else + OPTIC_SIMULATION_TRUE='#' + OPTIC_SIMULATION_FALSE= +fi + + OPTIC_SIMULATION=yes + + ;; + *) as_fn_error $? " OPTIC simulation " "$LINENO" 5; + ;; + esac + +else + + echo OPTIC simulation disabled + + if false; then + OPTIC_SIMULATION_TRUE= + OPTIC_SIMULATION_FALSE='#' +else + OPTIC_SIMULATION_TRUE='#' + OPTIC_SIMULATION_FALSE= +fi + + OPTIC_SIMULATION=no + + + +fi + + +DEFAULT_OPTIC_LIBRARY_PATH='.' +# Check whether --enable-optic-library was given. +if test "${enable_optic_library+set}" = set; then : + enableval=$enable_optic_library; + if test -n "$enableval"; then + echo Set the liboptic.a library path to $enableval + OPTIC_LIBRARY_PATH=$enableval + + else + echo Set the lib_board_config library path $DEFAULT_OPTIC_LIBRARY_PATH + OPTIC_LIBRARY_PATH=$DEFAULT_OPTIC_LIBRARY_PATH + + fi + +else + + echo Set the liboptic.a library path $DEFAULT_OPTIC_LIBRARY_PATH + OPTIC_LIBRARY_PATH=$DEFAULT_OPTIC_LIBRARY_PATH + + + +fi + + +DEFAULT_OPTIC_INCLUDE_PATH='-I.' +# Check whether --enable-optic-include was given. +if test "${enable_optic_include+set}" = set; then : + enableval=$enable_optic_include; + if test -n "$enableval"; then + echo Set the lib_optic include path $enableval + OPTIC_INCLUDE_PATH=$enableval + + else + echo -e Set the default lib_optic include path $DEFAULT_OPTIC_INCLUDE_PATH + OPTIC_INCLUDE_PATH=$DEFAULT_OPTIC_INCLUDE_PATH + + fi + +else + + echo -e Set the default lib_optic include path $DEFAULT_OPTIC_INCLUDE_PATH + OPTIC_INCLUDE_PATH=$DEFAULT_OPTIC_INCLUDE_PATH + + + +fi + + +# Check whether --enable-ocal was given. +if test "${enable_ocal+set}" = set; then : + enableval=$enable_ocal; + if test "$enableval" = yes; then + if true; then + DEVICE_OCAL_TRUE= + DEVICE_OCAL_FALSE='#' +else + DEVICE_OCAL_TRUE='#' + DEVICE_OCAL_FALSE= +fi + + DEVICE_OCAL=yes + + else + if false; then + DEVICE_OCAL_TRUE= + DEVICE_OCAL_FALSE='#' +else + DEVICE_OCAL_TRUE='#' + DEVICE_OCAL_FALSE= +fi + + DEVICE_OCAL=no + + fi + +else + + if false; then + DEVICE_OCAL_TRUE= + DEVICE_OCAL_FALSE='#' +else + DEVICE_OCAL_TRUE='#' + DEVICE_OCAL_FALSE= +fi + + DEVICE_OCAL=no + + + +fi + + +DEFAULT_OCAL_LIBRARY_PATH='.' +# Check whether --enable-ocal-library was given. +if test "${enable_ocal_library+set}" = set; then : + enableval=$enable_ocal_library; + if test -n "$enableval"; then + echo Set the libocal.a library path to $enableval + OCAL_LIBRARY_PATH=$enableval + + else + echo Set the libocal.a library path $DEFAULT_OCAL_LIBRARY_PATH + OCAL_LIBRARY_PATH=$DEFAULT_OCAL_LIBRARY_PATH + + fi + +else + + echo Set the libocal.a library path $DEFAULT_OCAL_LIBRARY_PATH + OCAL_LIBRARY_PATH=$DEFAULT_OCAL_LIBRARY_PATH + + + +fi + + +DEFAULT_OCAL_INCLUDE_PATH='-I.' +# Check whether --enable-ocal-include was given. +if test "${enable_ocal_include+set}" = set; then : + enableval=$enable_ocal_include; + if test -n "$enableval"; then + echo Set the libocal.a include path $enableval + OCAL_INCLUDE_PATH=$enableval + + else + echo -e Set the default libocal.a include path $DEFAULT_OCAL_INCLUDE_PATH + OCAL_INCLUDE_PATH=$DEFAULT_OCAL_INCLUDE_PATH + + fi + +else + + echo -e Set the default libocal.a include path $DEFAULT_OCAL_INCLUDE_PATH + OCAL_INCLUDE_PATH=$DEFAULT_OCAL_INCLUDE_PATH + + + +fi + + + + + + + +echo \ +"------------------------------------------------------------------------ +Configuration: + + source code location: ${srcdir} + compiler: ${CC} + compiler flags: ${CFLAGS} + host system type: ${host} + install path: ${prefix} + project build: ${currentdir} ${packagebuilddir} + kernel include path: ${KERNEL_INCL_PATH} + kernel build path: ${KERNEL_BUILD_PATH} + kernel architecture: ${KERNEL_ARCH} + package source path: ${packagesrcdir} + ifxos library path: ${IFXOS_LIBRARY_PATH} + ifxos include path: ${IFXOS_INCLUDE_PATH} + DTI library path: ${DTI_LIBRARY_PATH} + DTI include path: ${DTI_INCLUDE_PATH} + Registering of Devices: ${STARTUP_REGISTERED} + Device GENERIC: ${DEVICE_GENERIC} + Device ONU: ${DEVICE_ONU} + Simulation ONU: ${ONU_SIMULATION} + ONU library path: ${ONU_LIBRARY_PATH} + ONU include path: ${ONU_INCLUDE_PATH} + Device OPTIC: ${DEVICE_OPTIC} + Simulation OPTIC: ${OPTIC_SIMULATION} + OPTIC library path: ${OPTIC_LIBRARY_PATH} + OPTIC include path: ${OPTIC_INCLUDE_PATH} + Add CLI: ${INCLUDE_CLI_SUPPORT} + IFXOS Object Support: ${HAVE_IFXOS_SYSOBJ_SUPPORT} + + target options: ${DTI_TARGET_OPTIONS} + +Settings: + configure options: ${CONFIGURE_OPTIONS} +------------------------------------------------------------------------" + +ac_config_files="$ac_config_files Makefile src/Makefile" + +cat >confcache <<\_ACEOF +# This file is a shell script that caches the results of configure +# tests run on this system so they can be shared between configure +# scripts and configure runs, see configure's option --config-cache. +# It is not useful on other systems. If it contains results you don't +# want to keep, you may remove or edit it. +# +# config.status only pays attention to the cache file if you give it +# the --recheck option to rerun configure. +# +# `ac_cv_env_foo' variables (set or unset) will be overridden when +# loading this file, other *unset* `ac_cv_foo' will be assigned the +# following values. + +_ACEOF + +# The following way of writing the cache mishandles newlines in values, +# but we know of no workaround that is simple, portable, and efficient. +# So, we kill variables containing newlines. +# Ultrix sh set writes to stderr and can't be redirected directly, +# and sets the high bit in the cache file unless we assign to the vars. +( + for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) { eval $ac_var=; unset $ac_var;} ;; + esac ;; + esac + done + + (set) 2>&1 | + case $as_nl`(ac_space=' '; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + # `set' does not quote correctly, so add quotes: double-quote + # substitution turns \\\\ into \\, and sed turns \\ into \. + sed -n \ + "s/'/'\\\\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" + ;; #( + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) | + sed ' + /^ac_cv_env_/b end + t clear + :clear + s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ + t end + s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ + :end' >>confcache +if diff "$cache_file" confcache >/dev/null 2>&1; then :; else + if test -w "$cache_file"; then + if test "x$cache_file" != "x/dev/null"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 +$as_echo "$as_me: updating cache $cache_file" >&6;} + if test ! -f "$cache_file" || test -h "$cache_file"; then + cat confcache >"$cache_file" + else + case $cache_file in #( + */* | ?:*) + mv -f confcache "$cache_file"$$ && + mv -f "$cache_file"$$ "$cache_file" ;; #( + *) + mv -f confcache "$cache_file" ;; + esac + fi + fi + else + { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 +$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} + fi +fi +rm -f confcache + +test "x$prefix" = xNONE && prefix=$ac_default_prefix +# Let make expand exec_prefix. +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + +DEFS=-DHAVE_CONFIG_H + +ac_libobjs= +ac_ltlibobjs= +U= +for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue + # 1. Remove the extension, and $U if already installed. + ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' + ac_i=`$as_echo "$ac_i" | sed "$ac_script"` + # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR + # will be set to the directory where LIBOBJS objects are built. + as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" + as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' +done +LIBOBJS=$ac_libobjs + +LTLIBOBJS=$ac_ltlibobjs + + +if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then + as_fn_error $? "conditional \"AMDEP\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then + as_fn_error $? "conditional \"am__fastdepCC\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi + if test -n "$EXEEXT"; then + am__EXEEXT_TRUE= + am__EXEEXT_FALSE='#' +else + am__EXEEXT_TRUE='#' + am__EXEEXT_FALSE= +fi + +if test -z "${STARTUP_REGISTERED_TRUE}" && test -z "${STARTUP_REGISTERED_FALSE}"; then + as_fn_error $? "conditional \"STARTUP_REGISTERED\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${STARTUP_REGISTERED_TRUE}" && test -z "${STARTUP_REGISTERED_FALSE}"; then + as_fn_error $? "conditional \"STARTUP_REGISTERED\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${STARTUP_REGISTERED_TRUE}" && test -z "${STARTUP_REGISTERED_FALSE}"; then + as_fn_error $? "conditional \"STARTUP_REGISTERED\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${DEVICE_GENERIC_TRUE}" && test -z "${DEVICE_GENERIC_FALSE}"; then + as_fn_error $? "conditional \"DEVICE_GENERIC\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${DEVICE_GENERIC_TRUE}" && test -z "${DEVICE_GENERIC_FALSE}"; then + as_fn_error $? "conditional \"DEVICE_GENERIC\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${DEVICE_GENERIC_TRUE}" && test -z "${DEVICE_GENERIC_FALSE}"; then + as_fn_error $? "conditional \"DEVICE_GENERIC\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${DEVICE_ONU_TRUE}" && test -z "${DEVICE_ONU_FALSE}"; then + as_fn_error $? "conditional \"DEVICE_ONU\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${DEVICE_ONU_TRUE}" && test -z "${DEVICE_ONU_FALSE}"; then + as_fn_error $? "conditional \"DEVICE_ONU\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${DEVICE_ONU_TRUE}" && test -z "${DEVICE_ONU_FALSE}"; then + as_fn_error $? "conditional \"DEVICE_ONU\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${ONU_SIMULATION_TRUE}" && test -z "${ONU_SIMULATION_FALSE}"; then + as_fn_error $? "conditional \"ONU_SIMULATION\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${ONU_SIMULATION_TRUE}" && test -z "${ONU_SIMULATION_FALSE}"; then + as_fn_error $? "conditional \"ONU_SIMULATION\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${ONU_SIMULATION_TRUE}" && test -z "${ONU_SIMULATION_FALSE}"; then + as_fn_error $? "conditional \"ONU_SIMULATION\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${ONU_SIMULATION_TRUE}" && test -z "${ONU_SIMULATION_FALSE}"; then + as_fn_error $? "conditional \"ONU_SIMULATION\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${DEVICE_OPTIC_TRUE}" && test -z "${DEVICE_OPTIC_FALSE}"; then + as_fn_error $? "conditional \"DEVICE_OPTIC\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${DEVICE_OPTIC_TRUE}" && test -z "${DEVICE_OPTIC_FALSE}"; then + as_fn_error $? "conditional \"DEVICE_OPTIC\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${DEVICE_OPTIC_TRUE}" && test -z "${DEVICE_OPTIC_FALSE}"; then + as_fn_error $? "conditional \"DEVICE_OPTIC\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${OPTIC_SIMULATION_TRUE}" && test -z "${OPTIC_SIMULATION_FALSE}"; then + as_fn_error $? "conditional \"OPTIC_SIMULATION\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${OPTIC_SIMULATION_TRUE}" && test -z "${OPTIC_SIMULATION_FALSE}"; then + as_fn_error $? "conditional \"OPTIC_SIMULATION\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${OPTIC_SIMULATION_TRUE}" && test -z "${OPTIC_SIMULATION_FALSE}"; then + as_fn_error $? "conditional \"OPTIC_SIMULATION\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${OPTIC_SIMULATION_TRUE}" && test -z "${OPTIC_SIMULATION_FALSE}"; then + as_fn_error $? "conditional \"OPTIC_SIMULATION\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${DEVICE_OCAL_TRUE}" && test -z "${DEVICE_OCAL_FALSE}"; then + as_fn_error $? "conditional \"DEVICE_OCAL\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${DEVICE_OCAL_TRUE}" && test -z "${DEVICE_OCAL_FALSE}"; then + as_fn_error $? "conditional \"DEVICE_OCAL\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${DEVICE_OCAL_TRUE}" && test -z "${DEVICE_OCAL_FALSE}"; then + as_fn_error $? "conditional \"DEVICE_OCAL\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi + +: "${CONFIG_STATUS=./config.status}" +ac_write_fail=0 +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files $CONFIG_STATUS" +{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 +$as_echo "$as_me: creating $CONFIG_STATUS" >&6;} +as_write_fail=0 +cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 +#! $SHELL +# Generated by $as_me. +# Run this file to recreate the current configuration. +# Compiler output produced by configure, useful for debugging +# configure, is in config.log if it exists. + +debug=false +ac_cs_recheck=false +ac_cs_silent=false + +SHELL=\${CONFIG_SHELL-$SHELL} +export SHELL +_ASEOF +cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi + + +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +# Prefer a ksh shell builtin over an external printf program on Solaris, +# but without wasting forks for bash or zsh. +if test -z "$BASH_VERSION$ZSH_VERSION" \ + && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='print -r --' + as_echo_n='print -rn --' +elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' + else + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in #( + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' + fi + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' +fi + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +as_myself= +case $0 in #(( + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 +fi + +# Unset variables that we do not need and which cause bugs (e.g. in +# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" +# suppresses any "Segmentation fault" message there. '((' could +# trigger a bug in pdksh 5.2.14. +for as_var in BASH_ENV ENV MAIL MAILPATH +do eval test x\${$as_var+set} = xset \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# CDPATH. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + + +# as_fn_error STATUS ERROR [LINENO LOG_FD] +# ---------------------------------------- +# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are +# provided, also output the error to LOG_FD, referencing LINENO. Then exit the +# script with STATUS, using 1 if that was 0. +as_fn_error () +{ + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + fi + $as_echo "$as_me: error: $2" >&2 + as_fn_exit $as_status +} # as_fn_error + + +# as_fn_set_status STATUS +# ----------------------- +# Set $? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} # as_fn_set_status + +# as_fn_exit STATUS +# ----------------- +# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} # as_fn_exit + +# as_fn_unset VAR +# --------------- +# Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset +# as_fn_append VAR VALUE +# ---------------------- +# Append the text in VALUE to the end of the definition contained in VAR. Take +# advantage of any shell optimizations that allow amortized linear growth over +# repeated appends, instead of the typical quadratic growth present in naive +# implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append + +# as_fn_arith ARG... +# ------------------ +# Perform arithmetic evaluation on the ARGs, and store the result in the +# global $as_val. Take advantage of shells that can avoid forks. The arguments +# must be portable across $(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith + + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in #((((( +-n*) + case `echo 'xy\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; + esac;; +*) + ECHO_N='-n';; +esac + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -p'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -p' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -p' + fi +else + as_ln_s='cp -p' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + + +# as_fn_mkdir_p +# ------------- +# Create "$as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" + + +} # as_fn_mkdir_p +if mkdir -p . 2>/dev/null; then + as_mkdir_p='mkdir -p "$as_dir"' +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +if test -x / >/dev/null 2>&1; then + as_test_x='test -x' +else + if ls -dL / >/dev/null 2>&1; then + as_ls_L_option=L + else + as_ls_L_option= + fi + as_test_x=' + eval sh -c '\'' + if test -d "$1"; then + test -d "$1/."; + else + case $1 in #( + -*)set "./$1";; + esac; + case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( + ???[sx]*):;;*)false;;esac;fi + '\'' sh + ' +fi +as_executable_p=$as_test_x + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + +exec 6>&1 +## ----------------------------------- ## +## Main body of $CONFIG_STATUS script. ## +## ----------------------------------- ## +_ASEOF +test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# Save the log message, to keep $0 and so on meaningful, and to +# report actual input values of CONFIG_FILES etc. instead of their +# values after options handling. +ac_log=" +This file was extended by GPON DTI Agent $as_me 2.0.7, which was +generated by GNU Autoconf 2.68. Invocation command line was + + CONFIG_FILES = $CONFIG_FILES + CONFIG_HEADERS = $CONFIG_HEADERS + CONFIG_LINKS = $CONFIG_LINKS + CONFIG_COMMANDS = $CONFIG_COMMANDS + $ $0 $@ + +on `(hostname || uname -n) 2>/dev/null | sed 1q` +" + +_ACEOF + +case $ac_config_files in *" +"*) set x $ac_config_files; shift; ac_config_files=$*;; +esac + +case $ac_config_headers in *" +"*) set x $ac_config_headers; shift; ac_config_headers=$*;; +esac + + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +# Files that config.status was made for. +config_files="$ac_config_files" +config_headers="$ac_config_headers" +config_commands="$ac_config_commands" + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +ac_cs_usage="\ +\`$as_me' instantiates files and other configuration actions +from templates according to the current configuration. Unless the files +and actions are specified as TAGs, all are instantiated by default. + +Usage: $0 [OPTION]... [TAG]... + + -h, --help print this help, then exit + -V, --version print version number and configuration settings, then exit + --config print configuration, then exit + -q, --quiet, --silent + do not print progress messages + -d, --debug don't remove temporary files + --recheck update $as_me by reconfiguring in the same conditions + --file=FILE[:TEMPLATE] + instantiate the configuration file FILE + --header=FILE[:TEMPLATE] + instantiate the configuration header FILE + +Configuration files: +$config_files + +Configuration headers: +$config_headers + +Configuration commands: +$config_commands + +Report bugs to the package provider." + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" +ac_cs_version="\\ +GPON DTI Agent config.status 2.0.7 +configured by $0, generated by GNU Autoconf 2.68, + with options \\"\$ac_cs_config\\" + +Copyright (C) 2010 Free Software Foundation, Inc. +This config.status script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it." + +ac_pwd='$ac_pwd' +srcdir='$srcdir' +INSTALL='$INSTALL' +MKDIR_P='$MKDIR_P' +AWK='$AWK' +test -n "\$AWK" || AWK=awk +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# The default lists apply if the user does not specify any file. +ac_need_defaults=: +while test $# != 0 +do + case $1 in + --*=?*) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` + ac_shift=: + ;; + --*=) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg= + ac_shift=: + ;; + *) + ac_option=$1 + ac_optarg=$2 + ac_shift=shift + ;; + esac + + case $ac_option in + # Handling of the options. + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + ac_cs_recheck=: ;; + --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) + $as_echo "$ac_cs_version"; exit ;; + --config | --confi | --conf | --con | --co | --c ) + $as_echo "$ac_cs_config"; exit ;; + --debug | --debu | --deb | --de | --d | -d ) + debug=: ;; + --file | --fil | --fi | --f ) + $ac_shift + case $ac_optarg in + *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + '') as_fn_error $? "missing file argument" ;; + esac + as_fn_append CONFIG_FILES " '$ac_optarg'" + ac_need_defaults=false;; + --header | --heade | --head | --hea ) + $ac_shift + case $ac_optarg in + *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + as_fn_append CONFIG_HEADERS " '$ac_optarg'" + ac_need_defaults=false;; + --he | --h) + # Conflict between --help and --header + as_fn_error $? "ambiguous option: \`$1' +Try \`$0 --help' for more information.";; + --help | --hel | -h ) + $as_echo "$ac_cs_usage"; exit ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil | --si | --s) + ac_cs_silent=: ;; + + # This is an error. + -*) as_fn_error $? "unrecognized option: \`$1' +Try \`$0 --help' for more information." ;; + + *) as_fn_append ac_config_targets " $1" + ac_need_defaults=false ;; + + esac + shift +done + +ac_configure_extra_args= + +if $ac_cs_silent; then + exec 6>/dev/null + ac_configure_extra_args="$ac_configure_extra_args --silent" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +if \$ac_cs_recheck; then + set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion + shift + \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 + CONFIG_SHELL='$SHELL' + export CONFIG_SHELL + exec "\$@" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +exec 5>>config.log +{ + echo + sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX +## Running $as_me. ## +_ASBOX + $as_echo "$ac_log" +} >&5 + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +# +# INIT-COMMANDS +# +AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 + +# Handling of arguments. +for ac_config_target in $ac_config_targets +do + case $ac_config_target in + "src/dti_agent_config.h") CONFIG_HEADERS="$CONFIG_HEADERS src/dti_agent_config.h" ;; + "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; + "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; + "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; + + *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; + esac +done + + +# If the user did not use the arguments to specify the items to instantiate, +# then the envvar interface is used. Set only those that are not. +# We use the long form for the default assignment because of an extremely +# bizarre bug on SunOS 4.1.3. +if $ac_need_defaults; then + test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files + test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers + test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands +fi + +# Have a temporary directory for convenience. Make it in the build tree +# simply because there is no reason against having it here, and in addition, +# creating and moving files from /tmp can sometimes cause problems. +# Hook for its removal unless debugging. +# Note that there is a small window in which the directory will not be cleaned: +# after its creation but before its name has been assigned to `$tmp'. +$debug || +{ + tmp= ac_tmp= + trap 'exit_status=$? + : "${ac_tmp:=$tmp}" + { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status +' 0 + trap 'as_fn_exit 1' 1 2 13 15 +} +# Create a (secure) tmp directory for tmp files. + +{ + tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && + test -d "$tmp" +} || +{ + tmp=./conf$$-$RANDOM + (umask 077 && mkdir "$tmp") +} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 +ac_tmp=$tmp + +# Set up the scripts for CONFIG_FILES section. +# No need to generate them if there are no CONFIG_FILES. +# This happens for instance with `./config.status config.h'. +if test -n "$CONFIG_FILES"; then + + +ac_cr=`echo X | tr X '\015'` +# On cygwin, bash can eat \r inside `` if the user requested igncr. +# But we know of no other shell where ac_cr would be empty at this +# point, so we can use a bashism as a fallback. +if test "x$ac_cr" = x; then + eval ac_cr=\$\'\\r\' +fi +ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` +if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then + ac_cs_awk_cr='\\r' +else + ac_cs_awk_cr=$ac_cr +fi + +echo 'BEGIN {' >"$ac_tmp/subs1.awk" && +_ACEOF + + +{ + echo "cat >conf$$subs.awk <<_ACEOF" && + echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && + echo "_ACEOF" +} >conf$$subs.sh || + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 +ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` +ac_delim='%!_!# ' +for ac_last_try in false false false false false :; do + . ./conf$$subs.sh || + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 + + ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` + if test $ac_delim_n = $ac_delim_num; then + break + elif $ac_last_try; then + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done +rm -f conf$$subs.sh + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && +_ACEOF +sed -n ' +h +s/^/S["/; s/!.*/"]=/ +p +g +s/^[^!]*!// +:repl +t repl +s/'"$ac_delim"'$// +t delim +:nl +h +s/\(.\{148\}\)..*/\1/ +t more1 +s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ +p +n +b repl +:more1 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t nl +:delim +h +s/\(.\{148\}\)..*/\1/ +t more2 +s/["\\]/\\&/g; s/^/"/; s/$/"/ +p +b +:more2 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t delim +' >$CONFIG_STATUS || ac_write_fail=1 +rm -f conf$$subs.awk +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +_ACAWK +cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && + for (key in S) S_is_set[key] = 1 + FS = "" + +} +{ + line = $ 0 + nfields = split(line, field, "@") + substed = 0 + len = length(field[1]) + for (i = 2; i < nfields; i++) { + key = field[i] + keylen = length(key) + if (S_is_set[key]) { + value = S[key] + line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) + len += length(value) + length(field[++i]) + substed = 1 + } else + len += 1 + keylen + } + + print line +} + +_ACAWK +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then + sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" +else + cat +fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ + || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 +_ACEOF + +# VPATH may cause trouble with some makes, so we remove sole $(srcdir), +# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and +# trailing colons and then remove the whole line if VPATH becomes empty +# (actually we leave an empty line to preserve line numbers). +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ +h +s/// +s/^/:/ +s/[ ]*$/:/ +s/:\$(srcdir):/:/g +s/:\${srcdir}:/:/g +s/:@srcdir@:/:/g +s/^:*// +s/:*$// +x +s/\(=[ ]*\).*/\1/ +G +s/\n// +s/^[^=]*=[ ]*$// +}' +fi + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +fi # test -n "$CONFIG_FILES" + +# Set up the scripts for CONFIG_HEADERS section. +# No need to generate them if there are no CONFIG_HEADERS. +# This happens for instance with `./config.status Makefile'. +if test -n "$CONFIG_HEADERS"; then +cat >"$ac_tmp/defines.awk" <<\_ACAWK || +BEGIN { +_ACEOF + +# Transform confdefs.h into an awk script `defines.awk', embedded as +# here-document in config.status, that substitutes the proper values into +# config.h.in to produce config.h. + +# Create a delimiter string that does not exist in confdefs.h, to ease +# handling of long lines. +ac_delim='%!_!# ' +for ac_last_try in false false :; do + ac_tt=`sed -n "/$ac_delim/p" confdefs.h` + if test -z "$ac_tt"; then + break + elif $ac_last_try; then + as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done + +# For the awk script, D is an array of macro values keyed by name, +# likewise P contains macro parameters if any. Preserve backslash +# newline sequences. + +ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* +sed -n ' +s/.\{148\}/&'"$ac_delim"'/g +t rset +:rset +s/^[ ]*#[ ]*define[ ][ ]*/ / +t def +d +:def +s/\\$// +t bsnl +s/["\\]/\\&/g +s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ +D["\1"]=" \3"/p +s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p +d +:bsnl +s/["\\]/\\&/g +s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ +D["\1"]=" \3\\\\\\n"\\/p +t cont +s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p +t cont +d +:cont +n +s/.\{148\}/&'"$ac_delim"'/g +t clear +:clear +s/\\$// +t bsnlc +s/["\\]/\\&/g; s/^/"/; s/$/"/p +d +:bsnlc +s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p +b cont +' >$CONFIG_STATUS || ac_write_fail=1 + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 + for (key in D) D_is_set[key] = 1 + FS = "" +} +/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { + line = \$ 0 + split(line, arg, " ") + if (arg[1] == "#") { + defundef = arg[2] + mac1 = arg[3] + } else { + defundef = substr(arg[1], 2) + mac1 = arg[2] + } + split(mac1, mac2, "(") #) + macro = mac2[1] + prefix = substr(line, 1, index(line, defundef) - 1) + if (D_is_set[macro]) { + # Preserve the white space surrounding the "#". + print prefix "define", macro P[macro] D[macro] + next + } else { + # Replace #undef with comments. This is necessary, for example, + # in the case of _POSIX_SOURCE, which is predefined and required + # on some systems where configure will not decide to define it. + if (defundef == "undef") { + print "/*", prefix defundef, macro, "*/" + next + } + } +} +{ print } +_ACAWK +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 + as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 +fi # test -n "$CONFIG_HEADERS" + + +eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS" +shift +for ac_tag +do + case $ac_tag in + :[FHLC]) ac_mode=$ac_tag; continue;; + esac + case $ac_mode$ac_tag in + :[FHL]*:*);; + :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; + :[FH]-) ac_tag=-:-;; + :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; + esac + ac_save_IFS=$IFS + IFS=: + set x $ac_tag + IFS=$ac_save_IFS + shift + ac_file=$1 + shift + + case $ac_mode in + :L) ac_source=$1;; + :[FH]) + ac_file_inputs= + for ac_f + do + case $ac_f in + -) ac_f="$ac_tmp/stdin";; + *) # Look for the file first in the build tree, then in the source tree + # (if the path is not absolute). The absolute path cannot be DOS-style, + # because $ac_f cannot contain `:'. + test -f "$ac_f" || + case $ac_f in + [\\/$]*) false;; + *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; + esac || + as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; + esac + case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac + as_fn_append ac_file_inputs " '$ac_f'" + done + + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated by config.status. */ + configure_input='Generated from '` + $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' + `' by configure.' + if test x"$ac_file" != x-; then + configure_input="$ac_file. $configure_input" + { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 +$as_echo "$as_me: creating $ac_file" >&6;} + fi + # Neutralize special characters interpreted by sed in replacement strings. + case $configure_input in #( + *\&* | *\|* | *\\* ) + ac_sed_conf_input=`$as_echo "$configure_input" | + sed 's/[\\\\&|]/\\\\&/g'`;; #( + *) ac_sed_conf_input=$configure_input;; + esac + + case $ac_tag in + *:-:* | *:-) cat >"$ac_tmp/stdin" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; + esac + ;; + esac + + ac_dir=`$as_dirname -- "$ac_file" || +$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + as_dir="$ac_dir"; as_fn_mkdir_p + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + + case $ac_mode in + :F) + # + # CONFIG_FILE + # + + case $INSTALL in + [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; + *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; + esac + ac_MKDIR_P=$MKDIR_P + case $MKDIR_P in + [\\/$]* | ?:[\\/]* ) ;; + */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; + esac +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# If the template does not know about datarootdir, expand it. +# FIXME: This hack should be removed a few years after 2.60. +ac_datarootdir_hack=; ac_datarootdir_seen= +ac_sed_dataroot=' +/datarootdir/ { + p + q +} +/@datadir@/p +/@docdir@/p +/@infodir@/p +/@localedir@/p +/@mandir@/p' +case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in +*datarootdir*) ac_datarootdir_seen=yes;; +*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 +$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 + ac_datarootdir_hack=' + s&@datadir@&$datadir&g + s&@docdir@&$docdir&g + s&@infodir@&$infodir&g + s&@localedir@&$localedir&g + s&@mandir@&$mandir&g + s&\\\${datarootdir}&$datarootdir&g' ;; +esac +_ACEOF + +# Neutralize VPATH when `$srcdir' = `.'. +# Shell code in configure.ac might set extrasub. +# FIXME: do we really want to maintain this feature? +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_sed_extra="$ac_vpsub +$extrasub +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +:t +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b +s|@configure_input@|$ac_sed_conf_input|;t t +s&@top_builddir@&$ac_top_builddir_sub&;t t +s&@top_build_prefix@&$ac_top_build_prefix&;t t +s&@srcdir@&$ac_srcdir&;t t +s&@abs_srcdir@&$ac_abs_srcdir&;t t +s&@top_srcdir@&$ac_top_srcdir&;t t +s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t +s&@builddir@&$ac_builddir&;t t +s&@abs_builddir@&$ac_abs_builddir&;t t +s&@abs_top_builddir@&$ac_abs_top_builddir&;t t +s&@INSTALL@&$ac_INSTALL&;t t +s&@MKDIR_P@&$ac_MKDIR_P&;t t +$ac_datarootdir_hack +" +eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ + >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + +test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && + { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && + { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ + "$ac_tmp/out"`; test -z "$ac_out"; } && + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined" >&5 +$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined" >&2;} + + rm -f "$ac_tmp/stdin" + case $ac_file in + -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; + *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; + esac \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + ;; + :H) + # + # CONFIG_HEADER + # + if test x"$ac_file" != x-; then + { + $as_echo "/* $configure_input */" \ + && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" + } >"$ac_tmp/config.h" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then + { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 +$as_echo "$as_me: $ac_file is unchanged" >&6;} + else + rm -f "$ac_file" + mv "$ac_tmp/config.h" "$ac_file" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + fi + else + $as_echo "/* $configure_input */" \ + && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ + || as_fn_error $? "could not create -" "$LINENO" 5 + fi +# Compute "$ac_file"'s index in $config_headers. +_am_arg="$ac_file" +_am_stamp_count=1 +for _am_header in $config_headers :; do + case $_am_header in + $_am_arg | $_am_arg:* ) + break ;; + * ) + _am_stamp_count=`expr $_am_stamp_count + 1` ;; + esac +done +echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" || +$as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$_am_arg" : 'X\(//\)[^/]' \| \ + X"$_am_arg" : 'X\(//\)$' \| \ + X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$_am_arg" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'`/stamp-h$_am_stamp_count + ;; + + :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 +$as_echo "$as_me: executing $ac_file commands" >&6;} + ;; + esac + + + case $ac_file$ac_mode in + "depfiles":C) test x"$AMDEP_TRUE" != x"" || { + # Autoconf 2.62 quotes --file arguments for eval, but not when files + # are listed without --file. Let's play safe and only enable the eval + # if we detect the quoting. + case $CONFIG_FILES in + *\'*) eval set x "$CONFIG_FILES" ;; + *) set x $CONFIG_FILES ;; + esac + shift + for mf + do + # Strip MF so we end up with the name of the file. + mf=`echo "$mf" | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile or not. + # We used to match only the files named `Makefile.in', but + # some people rename them; so instead we look at the file content. + # Grep'ing the first line is not enough: some people post-process + # each Makefile.in and add a new line on top of each file to say so. + # Grep'ing the whole file is not good either: AIX grep has a line + # limit of 2048, but all sed's we know have understand at least 4000. + if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then + dirpart=`$as_dirname -- "$mf" || +$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$mf" : 'X\(//\)[^/]' \| \ + X"$mf" : 'X\(//\)$' \| \ + X"$mf" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$mf" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + else + continue + fi + # Extract the definition of DEPDIR, am__include, and am__quote + # from the Makefile without running `make'. + DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` + test -z "$DEPDIR" && continue + am__include=`sed -n 's/^am__include = //p' < "$mf"` + test -z "am__include" && continue + am__quote=`sed -n 's/^am__quote = //p' < "$mf"` + # When using ansi2knr, U may be empty or an underscore; expand it + U=`sed -n 's/^U = //p' < "$mf"` + # Find all dependency output files, they are included files with + # $(DEPDIR) in their names. We invoke sed twice because it is the + # simplest approach to changing $(DEPDIR) to its actual value in the + # expansion. + for file in `sed -n " + s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ + sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do + # Make sure the directory exists. + test -f "$dirpart/$file" && continue + fdir=`$as_dirname -- "$file" || +$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$file" : 'X\(//\)[^/]' \| \ + X"$file" : 'X\(//\)$' \| \ + X"$file" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + as_dir=$dirpart/$fdir; as_fn_mkdir_p + # echo "creating $dirpart/$file" + echo '# dummy' > "$dirpart/$file" + done + done +} + ;; + + esac +done # for ac_tag + + +as_fn_exit 0 +_ACEOF +ac_clean_files=$ac_clean_files_save + +test $ac_write_fail = 0 || + as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 + + +# configure is writing to config.log, and then calls config.status. +# config.status does its own redirection, appending to config.log. +# Unfortunately, on DOS this fails, as config.log is still kept open +# by configure, so config.status won't be able to write to it; its +# output is simply discarded. So we exec the FD to /dev/null, +# effectively closing config.log, so it can be properly (re)opened and +# appended to by config.status. When coming back to configure, we +# need to make the FD available again. +if test "$no_create" != yes; then + ac_cs_success=: + ac_config_status_args= + test "$silent" = yes && + ac_config_status_args="$ac_config_status_args --quiet" + exec 5>/dev/null + $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false + exec 5>>config.log + # Use ||, not &&, to avoid exiting from the if with $? = 1, which + # would make configure fail if this is the last instruction. + $ac_cs_success || as_fn_exit 1 +fi +if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 +$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} +fi + diff --git a/configure.in b/configure.in new file mode 100644 index 0000000..9506b9e --- /dev/null +++ b/configure.in @@ -0,0 +1,433 @@ +dnl Process this file with autoconf to produce a configure script. + +AC_REVISION($Revision: 1.1.1.1 $) + +AC_INIT([GPON DTI Agent],[2.0.7],[],[gpon_dti_agent]) + +AC_PROG_CC +ifdef([AC_PROG_CC_STDC], [AC_PROG_CC_STDC]) +AC_LANG([C]) +AC_PROG_RANLIB + +AC_CONFIG_SRCDIR(src/Makefile.am) +AC_CONFIG_HEADERS(src/dti_agent_config.h) +AM_INIT_AUTOMAKE +AM_PROG_CC_C_O + +# +# save the configure arguments +# +CONFIGURE_OPTIONS="$ac_configure_args" +AC_SUBST(CONFIGURE_OPTIONS) + +dnl set libifxos.a library path +DEFAULT_IFXOS_LIBRARY_PATH='.' +AC_ARG_ENABLE(ifxos-library, + AS_HELP_STRING([--enable-ifxos-library=/path/to/your/lib_ifxos/src] , [Set the lib_ifxos library path. In this location the libifxos.a should be found]), + [ + if test -n "$enableval"; then + echo Set the libifxos.a library path to $enableval + AC_SUBST([IFXOS_LIBRARY_PATH],[$enableval]) + else + echo Set the lib_board_config library path $DEFAULT_IFXOS_LIBRARY_PATH + AC_SUBST([IFXOS_LIBRARY_PATH],[$DEFAULT_IFXOS_LIBRARY_PATH]) + fi + ], + [ + echo Set the libifxos.a library path $DEFAULT_IFXOS_LIBRARY_PATH + AC_SUBST([IFXOS_LIBRARY_PATH],[$DEFAULT_IFXOS_LIBRARY_PATH]) +] +) + +dnl set lib_ifxos include path +DEFAULT_IFXOS_INCLUDE_PATH='-I.' +AC_ARG_ENABLE(ifxos-include, + AS_HELP_STRING([--enable-ifxos-include=-I/path/to/your/lib_ifxos/src/include],[Set the lib_ifxos include path.]), + [ + if test -n "$enableval"; then + echo Set the lib_ifxos include path $enableval + AC_SUBST([IFXOS_INCLUDE_PATH],[$enableval]) + else + echo -e Set the default lib_ifxos include path $DEFAULT_IFXOS_INCLUDE_PATH + AC_SUBST([IFXOS_INCLUDE_PATH],[$DEFAULT_IFXOS_INCLUDE_PATH]) + fi + ], + [ + echo -e Set the default lib_ifxos include path $DEFAULT_IFXOS_INCLUDE_PATH + AC_SUBST([IFXOS_INCLUDE_PATH],[$DEFAULT_IFXOS_INCLUDE_PATH]) + ] +) + +dnl set libdti.a library path +DEFAULT_DTI_LIBRARY_PATH='.' +AC_ARG_ENABLE(dti-library, + AS_HELP_STRING([--enable-dti-library=/path/to/your/lib_dti/src] , [Set the lib_dti library path. In this location the libdti.a should be found]), + [ + if test -n "$enableval"; then + echo Set the libdti.a library path to $enableval + AC_SUBST([DTI_LIBRARY_PATH],[$enableval]) + else + echo Set the lib_board_config library path $DEFAULT_DTI_LIBRARY_PATH + AC_SUBST([DTI_LIBRARY_PATH],[$DEFAULT_DTI_LIBRARY_PATH]) + fi + ], + [ + echo Set the libdti.a library path $DEFAULT_DTI_LIBRARY_PATH + AC_SUBST([DTI_LIBRARY_PATH],[$DEFAULT_DTI_LIBRARY_PATH]) +] +) + +dnl set lib_dti include path +DEFAULT_DTI_INCLUDE_PATH='-I.' +AC_ARG_ENABLE(dti-include, + AS_HELP_STRING([--enable-dti-include=-I/path/to/your/lib_dti/src/include],[Set the lib_dti include path.]), + [ + if test -n "$enableval"; then + echo Set the lib_dti include path $enableval + AC_SUBST([DTI_INCLUDE_PATH],[$enableval]) + else + echo -e Set the default lib_ifxos include path $DEFAULT_DTI_INCLUDE_PATH + AC_SUBST([DTI_INCLUDE_PATH],[$DEFAULT_DTI_INCLUDE_PATH]) + fi + ], + [ + echo -e Set the default lib_ifxos include path $DEFAULT_DTI_INCLUDE_PATH + AC_SUBST([DTI_INCLUDE_PATH],[$DEFAULT_DTI_INCLUDE_PATH]) + ] +) + +dnl enable registering of devices at startup time +AC_ARG_ENABLE(start-devs, + AS_HELP_STRING( + [--enable-start-devs],[Register Devices at startup time.] + ), + [ + if test "$enableval" = yes; then + AM_CONDITIONAL(STARTUP_REGISTERED, true) + AC_SUBST([STARTUP_REGISTERED],[yes]) + else + AM_CONDITIONAL(STARTUP_REGISTERED, false) + AC_SUBST([STARTUP_REGISTERED],[no]) + fi + ], + [ + AM_CONDITIONAL(STARTUP_REGISTERED, true) + AC_SUBST([STARTUP_REGISTERED],[yes]) + ] +) + +dnl enable Generic device support +AC_ARG_ENABLE(dev-generic, + AS_HELP_STRING( + [--enable-dev-generic],[Add Generic support.] + ), + [ + if test "$enableval" = yes; then + AM_CONDITIONAL(DEVICE_GENERIC, true) + AC_SUBST([DEVICE_GENERIC],[yes]) + else + AM_CONDITIONAL(DEVICE_GENERIC, false) + AC_SUBST([DEVICE_GENERIC],[no]) + fi + ], + [ + AM_CONDITIONAL(DEVICE_GENERIC, false) + AC_SUBST([DEVICE_GENERIC],[no]) + ] +) + +dnl enable ONU support +AC_ARG_ENABLE(onu, + AS_HELP_STRING( + [--enable-onu],[Add ONU support.] + ), + [ + if test "$enableval" = yes; then + AM_CONDITIONAL(DEVICE_ONU, true) + AC_SUBST([DEVICE_ONU],[yes]) + else + AM_CONDITIONAL(DEVICE_ONU, false) + AC_SUBST([DEVICE_ONU],[no]) + fi + ], + [ + AM_CONDITIONAL(DEVICE_ONU, false) + AC_SUBST([DEVICE_ONU],[no]) + ] +) + +dnl Build onu simulation application +AM_CONDITIONAL(ONU_SIMULATION, false) +AC_ARG_WITH(onu-simulation, + AS_HELP_STRING( + [--with-onu-simulation], + [ONU simulation] + ), + [ + echo ONU simulation = $withval + + case $withval in + 0|no) + AM_CONDITIONAL(ONU_SIMULATION, false) + AC_SUBST([ONU_SIMULATION],[no]) + ;; + 1|yes) + AM_CONDITIONAL(ONU_SIMULATION, true) + AC_SUBST([ONU_SIMULATION],[yes]) + ;; + *) AC_MSG_ERROR([ ONU simulation ]); + ;; + esac + ], + [ + echo ONU simulation disabled + + AM_CONDITIONAL(ONU_SIMULATION, false) + AC_SUBST([ONU_SIMULATION],[no]) + ] +) + +dnl set onu library path +DEFAULT_ONU_LIBRARY_PATH='.' +AC_ARG_ENABLE(onu-library, + AS_HELP_STRING([--enable-onu-library=/path/to/your/lib_onu/src] , [Set the lib_onu library path. In this location the libonu.a should be found]), + [ + if test -n "$enableval"; then + echo Set the libonu.a library path to $enableval + AC_SUBST([ONU_LIBRARY_PATH],[$enableval]) + else + echo Set the lib_board_config library path $DEFAULT_ONU_LIBRARY_PATH + AC_SUBST([ONU_LIBRARY_PATH],[$DEFAULT_ONU_LIBRARY_PATH]) + fi + ], + [ + echo Set the libonu.a library path $DEFAULT_ONU_LIBRARY_PATH + AC_SUBST([ONU_LIBRARY_PATH],[$DEFAULT_ONU_LIBRARY_PATH]) +] +) + +dnl set lib_onu include path +DEFAULT_ONU_INCLUDE_PATH='-I.' +AC_ARG_ENABLE(onu-include, + AS_HELP_STRING([--enable-dti-include=-I/path/to/your/lib_onu/src/include],[Set the lib_onu include path.]), + [ + if test -n "$enableval"; then + echo Set the lib_onu include path $enableval + AC_SUBST([ONU_INCLUDE_PATH],[$enableval]) + else + echo -e Set the default lib_onu include path $DEFAULT_ONU_INCLUDE_PATH + AC_SUBST([ONU_INCLUDE_PATH],[$DEFAULT_ONU_INCLUDE_PATH]) + fi + ], + [ + echo -e Set the default lib_onu include path $DEFAULT_ONU_INCLUDE_PATH + AC_SUBST([ONU_INCLUDE_PATH],[$DEFAULT_ONU_INCLUDE_PATH]) + ] +) + +dnl enable OPTIC support +AC_ARG_ENABLE(optic, + AS_HELP_STRING( + [--enable-optic],[Add OPTIC support.] + ), + [ + if test "$enableval" = yes; then + AM_CONDITIONAL(DEVICE_OPTIC, true) + AC_SUBST([DEVICE_OPTIC],[yes]) + else + AM_CONDITIONAL(DEVICE_OPTIC, false) + AC_SUBST([DEVICE_OPTIC],[no]) + fi + ], + [ + AM_CONDITIONAL(DEVICE_OPTIC, false) + AC_SUBST([DEVICE_OPTIC],[no]) + ] +) + +dnl Build optic simulation application +AM_CONDITIONAL(OPTIC_SIMULATION, false) +AC_ARG_WITH(optic-simulation, + AS_HELP_STRING( + [--with-optic-simulation], + [OPTIC simulation] + ), + [ + echo OPTIC simulation = $withval + + case $withval in + 0|no) + AM_CONDITIONAL(OPTIC_SIMULATION, false) + AC_SUBST([OPTIC_SIMULATION],[no]) + ;; + 1|yes) + AM_CONDITIONAL(OPTIC_SIMULATION, true) + AC_SUBST([OPTIC_SIMULATION],[yes]) + ;; + *) AC_MSG_ERROR([ OPTIC simulation ]); + ;; + esac + ], + [ + echo OPTIC simulation disabled + + AM_CONDITIONAL(OPTIC_SIMULATION, false) + AC_SUBST([OPTIC_SIMULATION],[no]) + ] +) + +dnl set optic library path +DEFAULT_OPTIC_LIBRARY_PATH='.' +AC_ARG_ENABLE(optic-library, + AS_HELP_STRING([--enable-optic-library=/path/to/your/lib_optic/src] , [Set the lib_optic library path. In this location the liboptic.a should be found]), + [ + if test -n "$enableval"; then + echo Set the liboptic.a library path to $enableval + AC_SUBST([OPTIC_LIBRARY_PATH],[$enableval]) + else + echo Set the lib_board_config library path $DEFAULT_OPTIC_LIBRARY_PATH + AC_SUBST([OPTIC_LIBRARY_PATH],[$DEFAULT_OPTIC_LIBRARY_PATH]) + fi + ], + [ + echo Set the liboptic.a library path $DEFAULT_OPTIC_LIBRARY_PATH + AC_SUBST([OPTIC_LIBRARY_PATH],[$DEFAULT_OPTIC_LIBRARY_PATH]) +] +) + +dnl set lib_optic include path +DEFAULT_OPTIC_INCLUDE_PATH='-I.' +AC_ARG_ENABLE(optic-include, + AS_HELP_STRING([--enable-dti-include=-I/path/to/your/lib_optic/src/include],[Set the lib_optic include path.]), + [ + if test -n "$enableval"; then + echo Set the lib_optic include path $enableval + AC_SUBST([OPTIC_INCLUDE_PATH],[$enableval]) + else + echo -e Set the default lib_optic include path $DEFAULT_OPTIC_INCLUDE_PATH + AC_SUBST([OPTIC_INCLUDE_PATH],[$DEFAULT_OPTIC_INCLUDE_PATH]) + fi + ], + [ + echo -e Set the default lib_optic include path $DEFAULT_OPTIC_INCLUDE_PATH + AC_SUBST([OPTIC_INCLUDE_PATH],[$DEFAULT_OPTIC_INCLUDE_PATH]) + ] +) + +dnl enable OCAL support +AC_ARG_ENABLE(ocal, + AS_HELP_STRING( + [--enable-ocal],[Add OCAL support.] + ), + [ + if test "$enableval" = yes; then + AM_CONDITIONAL(DEVICE_OCAL, true) + AC_SUBST([DEVICE_OCAL],[yes]) + else + AM_CONDITIONAL(DEVICE_OCAL, false) + AC_SUBST([DEVICE_OCAL],[no]) + fi + ], + [ + AM_CONDITIONAL(DEVICE_OCAL, false) + AC_SUBST([DEVICE_OCAL],[no]) + ] +) + +dnl set ocal library path +DEFAULT_OCAL_LIBRARY_PATH='.' +AC_ARG_ENABLE(ocal-library, + AS_HELP_STRING([--enable-ocal-library=/path/to/your/libocal/src] , [Set the libocal.a library path. In this location the libocal.a should be found]), + [ + if test -n "$enableval"; then + echo Set the libocal.a library path to $enableval + AC_SUBST([OCAL_LIBRARY_PATH],[$enableval]) + else + echo Set the libocal.a library path $DEFAULT_OCAL_LIBRARY_PATH + AC_SUBST([OCAL_LIBRARY_PATH],[$DEFAULT_OCAL_LIBRARY_PATH]) + fi + ], + [ + echo Set the libocal.a library path $DEFAULT_OCAL_LIBRARY_PATH + AC_SUBST([OCAL_LIBRARY_PATH],[$DEFAULT_OCAL_LIBRARY_PATH]) + ] +) + +dnl set ocal include path +DEFAULT_OCAL_INCLUDE_PATH='-I.' +AC_ARG_ENABLE(ocal-include, + AS_HELP_STRING([--enable-ocal-include=-I/path/to/your/libocal/src/include],[Set the libocal.a include path.]), + [ + if test -n "$enableval"; then + echo Set the libocal.a include path $enableval + AC_SUBST([OCAL_INCLUDE_PATH],[$enableval]) + else + echo -e Set the default libocal.a include path $DEFAULT_OCAL_INCLUDE_PATH + AC_SUBST([OCAL_INCLUDE_PATH],[$DEFAULT_OCAL_INCLUDE_PATH]) + fi + ], + [ + echo -e Set the default libocal.a include path $DEFAULT_OCAL_INCLUDE_PATH + AC_SUBST([OCAL_INCLUDE_PATH],[$DEFAULT_OCAL_INCLUDE_PATH]) + ] +) + +AH_TOP( + [ +#ifndef _dti_agent_config_h +#define _dti_agent_config_h + +/** \defgroup GPON_DTI_AGENT_CONFIG Optical Network Unit - GPON DTI Agent Configuration + @{ +*/ + ] +) + +AH_BOTTOM( + [ +/** @} */ + +#endif + ] +) + + +echo \ +"------------------------------------------------------------------------ +Configuration: + + source code location: ${srcdir} + compiler: ${CC} + compiler flags: ${CFLAGS} + host system type: ${host} + install path: ${prefix} + project build: ${currentdir} ${packagebuilddir} + kernel include path: ${KERNEL_INCL_PATH} + kernel build path: ${KERNEL_BUILD_PATH} + kernel architecture: ${KERNEL_ARCH} + package source path: ${packagesrcdir} + ifxos library path: ${IFXOS_LIBRARY_PATH} + ifxos include path: ${IFXOS_INCLUDE_PATH} + DTI library path: ${DTI_LIBRARY_PATH} + DTI include path: ${DTI_INCLUDE_PATH} + Registering of Devices: ${STARTUP_REGISTERED} + Device GENERIC: ${DEVICE_GENERIC} + Device ONU: ${DEVICE_ONU} + Simulation ONU: ${ONU_SIMULATION} + ONU library path: ${ONU_LIBRARY_PATH} + ONU include path: ${ONU_INCLUDE_PATH} + Device OPTIC: ${DEVICE_OPTIC} + Simulation OPTIC: ${OPTIC_SIMULATION} + OPTIC library path: ${OPTIC_LIBRARY_PATH} + OPTIC include path: ${OPTIC_INCLUDE_PATH} + Add CLI: ${INCLUDE_CLI_SUPPORT} + IFXOS Object Support: ${HAVE_IFXOS_SYSOBJ_SUPPORT} + + target options: ${DTI_TARGET_OPTIONS} + +Settings: + configure options: ${CONFIGURE_OPTIONS} +------------------------------------------------------------------------" + +AC_CONFIG_FILES([Makefile src/Makefile]) +AC_OUTPUT diff --git a/depcomp b/depcomp new file mode 100755 index 0000000..df8eea7 --- /dev/null +++ b/depcomp @@ -0,0 +1,630 @@ +#! /bin/sh +# depcomp - compile a program generating dependencies as side-effects + +scriptversion=2009-04-28.21; # UTC + +# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2009 Free +# Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# 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 . + +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 . +EOF + exit $? + ;; + -v | --v*) + echo "depcomp $scriptversion" + exit $? + ;; +esac + +if test -z "$depmode" || test -z "$source" || test -z "$object"; then + echo "depcomp: Variables source, object and depmode must be set" 1>&2 + exit 1 +fi + +# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. +depfile=${depfile-`echo "$object" | + sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} +tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} + +rm -f "$tmpdepfile" + +# Some modes work just like other modes, but use different flags. We +# parameterize here, but still list the modes in the big case below, +# to make depend.m4 easier to write. Note that we *cannot* use a case +# here, because this file can only contain one case statement. +if test "$depmode" = hp; then + # HP compiler uses -M and no extra arg. + gccflag=-M + depmode=gcc +fi + +if test "$depmode" = dashXmstdout; then + # This is just like dashmstdout with a different argument. + dashmflag=-xM + depmode=dashmstdout +fi + +cygpath_u="cygpath -u -f -" +if test "$depmode" = msvcmsys; then + # This is just like msvisualcpp but w/o cygpath translation. + # Just convert the backslash-escaped backslashes to single forward + # slashes to satisfy depend.m4 + cygpath_u="sed s,\\\\\\\\,/,g" + depmode=msvisualcpp +fi + +case "$depmode" in +gcc3) +## gcc 3 implements dependency tracking that does exactly what +## we want. Yay! Note: for some reason libtool 1.4 doesn't like +## it if -MD -MP comes after the -MF stuff. Hmm. +## Unfortunately, FreeBSD c89 acceptance of flags depends upon +## the command line argument order; so add the flags where they +## appear in depend2.am. Note that the slowdown incurred here +## affects only configure: in makefiles, %FASTDEP% shortcuts this. + for arg + do + case $arg in + -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;; + *) set fnord "$@" "$arg" ;; + esac + shift # fnord + shift # $arg + done + "$@" + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + mv "$tmpdepfile" "$depfile" + ;; + +gcc) +## There are various ways to get dependency output from gcc. Here's +## why we pick this rather obscure method: +## - Don't want to use -MD because we'd like the dependencies to end +## up in a subdir. Having to rename by hand is ugly. +## (We might end up doing this anyway to support other compilers.) +## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like +## -MM, not -M (despite what the docs say). +## - Using -M directly means running the compiler twice (even worse +## than renaming). + if test -z "$gccflag"; then + gccflag=-MD, + fi + "$@" -Wp,"$gccflag$tmpdepfile" + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + echo "$object : \\" > "$depfile" + alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz +## The second -e expression handles DOS-style file names with drive letters. + sed -e 's/^[^:]*: / /' \ + -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" +## This next piece of magic avoids the `deleted header file' problem. +## The problem is that when a header file which appears in a .P file +## is deleted, the dependency causes make to die (because there is +## typically no way to rebuild the header). We avoid this by adding +## dummy dependencies for each header file. Too bad gcc doesn't do +## this for us directly. + tr ' ' ' +' < "$tmpdepfile" | +## Some versions of gcc put a space before the `:'. On the theory +## that the space means something, we add a space to the output as +## well. +## Some versions of the HPUX 10.20 sed can't process this invocation +## correctly. Breaking it into two sed invocations is a workaround. + sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +hp) + # This case exists only to let depend.m4 do its work. It works by + # looking at the text of this script. This case will never be run, + # since it is checked for above. + exit 1 + ;; + +sgi) + if test "$libtool" = yes; then + "$@" "-Wp,-MDupdate,$tmpdepfile" + else + "$@" -MDupdate "$tmpdepfile" + fi + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + + if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files + echo "$object : \\" > "$depfile" + + # Clip off the initial element (the dependent). Don't try to be + # clever and replace this with sed code, as IRIX sed won't handle + # lines with more than a fixed number of characters (4096 in + # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; + # the IRIX cc adds comments like `#:fec' to the end of the + # dependency line. + tr ' ' ' +' < "$tmpdepfile" \ + | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \ + tr ' +' ' ' >> "$depfile" + echo >> "$depfile" + + # The second pass generates a dummy entry for each header file. + tr ' ' ' +' < "$tmpdepfile" \ + | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ + >> "$depfile" + else + # The sourcefile does not contain any dependencies, so just + # store a dummy comment line, to avoid errors with the Makefile + # "include basename.Plo" scheme. + echo "#dummy" > "$depfile" + fi + rm -f "$tmpdepfile" + ;; + +aix) + # The C for AIX Compiler uses -M and outputs the dependencies + # in a .u file. In older versions, this file always lives in the + # current directory. Also, the AIX compiler puts `$object:' at the + # start of each line; $object doesn't have directory information. + # Version 6 uses the directory in both cases. + dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` + test "x$dir" = "x$object" && dir= + base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` + if test "$libtool" = yes; then + tmpdepfile1=$dir$base.u + tmpdepfile2=$base.u + tmpdepfile3=$dir.libs/$base.u + "$@" -Wc,-M + else + tmpdepfile1=$dir$base.u + tmpdepfile2=$dir$base.u + tmpdepfile3=$dir$base.u + "$@" -M + fi + stat=$? + + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" + exit $stat + fi + + for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" + do + test -f "$tmpdepfile" && break + done + if test -f "$tmpdepfile"; then + # Each line is of the form `foo.o: dependent.h'. + # Do two passes, one to just change these to + # `$object: dependent.h' and one to simply `dependent.h:'. + sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" + # That's a tab and a space in the []. + sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" + else + # The sourcefile does not contain any dependencies, so just + # store a dummy comment line, to avoid errors with the Makefile + # "include basename.Plo" scheme. + echo "#dummy" > "$depfile" + fi + rm -f "$tmpdepfile" + ;; + +icc) + # Intel's C compiler understands `-MD -MF file'. However on + # icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c + # ICC 7.0 will fill foo.d with something like + # foo.o: sub/foo.c + # foo.o: sub/foo.h + # which is wrong. We want: + # sub/foo.o: sub/foo.c + # sub/foo.o: sub/foo.h + # sub/foo.c: + # sub/foo.h: + # ICC 7.1 will output + # foo.o: sub/foo.c sub/foo.h + # and will wrap long lines using \ : + # foo.o: sub/foo.c ... \ + # sub/foo.h ... \ + # ... + + "$@" -MD -MF "$tmpdepfile" + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + # Each line is of the form `foo.o: dependent.h', + # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. + # Do two passes, one to just change these to + # `$object: dependent.h' and one to simply `dependent.h:'. + sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" + # Some versions of the HPUX 10.20 sed can't process this invocation + # correctly. Breaking it into two sed invocations is a workaround. + sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" | + sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +hp2) + # The "hp" stanza above does not work with aCC (C++) and HP's ia64 + # compilers, which have integrated preprocessors. The correct option + # to use with these is +Maked; it writes dependencies to a file named + # 'foo.d', which lands next to the object file, wherever that + # happens to be. + # Much of this is similar to the tru64 case; see comments there. + dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` + test "x$dir" = "x$object" && dir= + base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` + if test "$libtool" = yes; then + tmpdepfile1=$dir$base.d + tmpdepfile2=$dir.libs/$base.d + "$@" -Wc,+Maked + else + tmpdepfile1=$dir$base.d + tmpdepfile2=$dir$base.d + "$@" +Maked + fi + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile1" "$tmpdepfile2" + exit $stat + fi + + for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" + do + test -f "$tmpdepfile" && break + done + if test -f "$tmpdepfile"; then + sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile" + # Add `dependent.h:' lines. + sed -ne '2,${ + s/^ *// + s/ \\*$// + s/$/:/ + p + }' "$tmpdepfile" >> "$depfile" + else + echo "#dummy" > "$depfile" + fi + rm -f "$tmpdepfile" "$tmpdepfile2" + ;; + +tru64) + # The Tru64 compiler uses -MD to generate dependencies as a side + # effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'. + # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put + # dependencies in `foo.d' instead, so we check for that too. + # Subdirectories are respected. + dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` + test "x$dir" = "x$object" && dir= + base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` + + if test "$libtool" = yes; then + # With Tru64 cc, shared objects can also be used to make a + # static library. This mechanism is used in libtool 1.4 series to + # handle both shared and static libraries in a single compilation. + # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d. + # + # With libtool 1.5 this exception was removed, and libtool now + # generates 2 separate objects for the 2 libraries. These two + # compilations output dependencies in $dir.libs/$base.o.d and + # in $dir$base.o.d. We have to check for both files, because + # one of the two compilations can be disabled. We should prefer + # $dir$base.o.d over $dir.libs/$base.o.d because the latter is + # automatically cleaned when .libs/ is deleted, while ignoring + # the former would cause a distcleancheck panic. + tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4 + tmpdepfile2=$dir$base.o.d # libtool 1.5 + tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5 + tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504 + "$@" -Wc,-MD + else + tmpdepfile1=$dir$base.o.d + tmpdepfile2=$dir$base.d + tmpdepfile3=$dir$base.d + tmpdepfile4=$dir$base.d + "$@" -MD + fi + + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" + exit $stat + fi + + for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" + do + test -f "$tmpdepfile" && break + done + if test -f "$tmpdepfile"; then + sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" + # That's a tab and a space in the []. + sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" + else + echo "#dummy" > "$depfile" + fi + rm -f "$tmpdepfile" + ;; + +#nosideeffect) + # This comment above is used by automake to tell side-effect + # dependency tracking mechanisms from slower ones. + +dashmstdout) + # Important note: in order to support this mode, a compiler *must* + # always write the preprocessed file to stdout, regardless of -o. + "$@" || exit $? + + # Remove the call to Libtool. + if test "$libtool" = yes; then + while test "X$1" != 'X--mode=compile'; do + shift + done + shift + fi + + # Remove `-o $object'. + IFS=" " + for arg + do + case $arg in + -o) + shift + ;; + $object) + shift + ;; + *) + set fnord "$@" "$arg" + shift # fnord + shift # $arg + ;; + esac + done + + test -z "$dashmflag" && dashmflag=-M + # Require at least two characters before searching for `:' + # in the target name. This is to cope with DOS-style filenames: + # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise. + "$@" $dashmflag | + sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile" + rm -f "$depfile" + cat < "$tmpdepfile" > "$depfile" + tr ' ' ' +' < "$tmpdepfile" | \ +## Some versions of the HPUX 10.20 sed can't process this invocation +## correctly. Breaking it into two sed invocations is a workaround. + sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +dashXmstdout) + # This case only exists to satisfy depend.m4. It is never actually + # run, as this mode is specially recognized in the preamble. + exit 1 + ;; + +makedepend) + "$@" || exit $? + # Remove any Libtool call + if test "$libtool" = yes; then + while test "X$1" != 'X--mode=compile'; do + shift + done + shift + fi + # X makedepend + shift + cleared=no eat=no + for arg + do + case $cleared in + no) + set ""; shift + cleared=yes ;; + esac + if test $eat = yes; then + eat=no + continue + fi + case "$arg" in + -D*|-I*) + set fnord "$@" "$arg"; shift ;; + # Strip any option that makedepend may not understand. Remove + # the object too, otherwise makedepend will parse it as a source file. + -arch) + eat=yes ;; + -*|$object) + ;; + *) + set fnord "$@" "$arg"; shift ;; + esac + done + obj_suffix=`echo "$object" | sed 's/^.*\././'` + touch "$tmpdepfile" + ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" + rm -f "$depfile" + cat < "$tmpdepfile" > "$depfile" + sed '1,2d' "$tmpdepfile" | tr ' ' ' +' | \ +## Some versions of the HPUX 10.20 sed can't process this invocation +## correctly. Breaking it into two sed invocations is a workaround. + sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" "$tmpdepfile".bak + ;; + +cpp) + # Important note: in order to support this mode, a compiler *must* + # always write the preprocessed file to stdout. + "$@" || exit $? + + # Remove the call to Libtool. + if test "$libtool" = yes; then + while test "X$1" != 'X--mode=compile'; do + shift + done + shift + fi + + # Remove `-o $object'. + IFS=" " + for arg + do + case $arg in + -o) + shift + ;; + $object) + shift + ;; + *) + set fnord "$@" "$arg" + shift # fnord + shift # $arg + ;; + esac + done + + "$@" -E | + sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ + -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' | + sed '$ s: \\$::' > "$tmpdepfile" + rm -f "$depfile" + echo "$object : \\" > "$depfile" + cat < "$tmpdepfile" >> "$depfile" + sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +msvisualcpp) + # Important note: in order to support this mode, a compiler *must* + # always write the preprocessed file to stdout. + "$@" || exit $? + + # Remove the call to Libtool. + if test "$libtool" = yes; then + while test "X$1" != 'X--mode=compile'; do + shift + done + shift + fi + + IFS=" " + for arg + do + case "$arg" in + -o) + shift + ;; + $object) + shift + ;; + "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") + set fnord "$@" + shift + shift + ;; + *) + set fnord "$@" "$arg" + shift + shift + ;; + esac + done + "$@" -E 2>/dev/null | + sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile" + rm -f "$depfile" + echo "$object : \\" > "$depfile" + sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile" + echo " " >> "$depfile" + sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +msvcmsys) + # This case exists only to let depend.m4 do its work. It works by + # looking at the text of this script. This case will never be run, + # since it is checked for above. + exit 1 + ;; + +none) + exec "$@" + ;; + +*) + echo "Unknown depmode $depmode" 1>&2 + exit 1 + ;; +esac + +exit 0 + +# Local Variables: +# mode: shell-script +# sh-indentation: 2 +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-time-zone: "UTC" +# time-stamp-end: "; # UTC" +# End: diff --git a/doc/doxyconfig b/doc/doxyconfig new file mode 100644 index 0000000..599b9a9 --- /dev/null +++ b/doc/doxyconfig @@ -0,0 +1,233 @@ +# Doxyfile 1.5.2 + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- +DOXYFILE_ENCODING = UTF-8 +PROJECT_NAME = "GPON ONU DTI Agent" +PROJECT_NUMBER = 2.0.6 +OUTPUT_DIRECTORY = . +CREATE_SUBDIRS = NO +OUTPUT_LANGUAGE = English +BRIEF_MEMBER_DESC = YES +REPEAT_BRIEF = YES +ABBREVIATE_BRIEF = +ALWAYS_DETAILED_SEC = YES +INLINE_INHERITED_MEMB = NO +FULL_PATH_NAMES = NO +STRIP_FROM_PATH = +STRIP_FROM_INC_PATH = +SHORT_NAMES = NO +JAVADOC_AUTOBRIEF = YES +MULTILINE_CPP_IS_BRIEF = NO +#DETAILS_AT_TOP = NO +INHERIT_DOCS = YES +SEPARATE_MEMBER_PAGES = NO +TAB_SIZE = 3 +ALIASES = +OPTIMIZE_OUTPUT_FOR_C = YES +OPTIMIZE_OUTPUT_JAVA = NO +BUILTIN_STL_SUPPORT = NO +CPP_CLI_SUPPORT = NO +DISTRIBUTE_GROUP_DOC = YES +SUBGROUPING = YES +#--------------------------------------------------------------------------- +# Build related configuration options +#--------------------------------------------------------------------------- +EXTRACT_ALL = YES +EXTRACT_PRIVATE = NO +EXTRACT_STATIC = NO +EXTRACT_LOCAL_CLASSES = NO +EXTRACT_LOCAL_METHODS = NO +HIDE_UNDOC_MEMBERS = YES +HIDE_UNDOC_CLASSES = YES +HIDE_FRIEND_COMPOUNDS = YES +HIDE_IN_BODY_DOCS = YES +INTERNAL_DOCS = YES +CASE_SENSE_NAMES = YES +HIDE_SCOPE_NAMES = NO +SHOW_INCLUDE_FILES = YES +INLINE_INFO = YES +SORT_MEMBER_DOCS = YES +SORT_BRIEF_DOCS = NO +SORT_BY_SCOPE_NAME = YES +GENERATE_TODOLIST = YES +GENERATE_TESTLIST = YES +GENERATE_BUGLIST = YES +GENERATE_DEPRECATEDLIST= YES +ENABLED_SECTIONS = +MAX_INITIALIZER_LINES = 30 +SHOW_USED_FILES = NO +SHOW_DIRECTORIES = YES +FILE_VERSION_FILTER = +#--------------------------------------------------------------------------- +# configuration options related to warning and progress messages +#--------------------------------------------------------------------------- +QUIET = NO +WARNINGS = YES +WARN_IF_UNDOCUMENTED = YES +WARN_IF_DOC_ERROR = YES +WARN_NO_PARAMDOC = NO +WARN_FORMAT = "$file:$line: $text" +WARN_LOGFILE = +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- +INPUT = ../include/ \ + ../src/ +INPUT_ENCODING = UTF-8 +FILE_PATTERNS = *.c \ + *.h +RECURSIVE = NO +EXCLUDE = +EXCLUDE_SYMLINKS = NO +EXCLUDE_PATTERNS = +EXCLUDE_SYMBOLS = +EXAMPLE_PATH = +EXAMPLE_PATTERNS = +EXAMPLE_RECURSIVE = NO +IMAGE_PATH = +INPUT_FILTER = +FILTER_PATTERNS = +FILTER_SOURCE_FILES = NO +#--------------------------------------------------------------------------- +# configuration options related to source browsing +#--------------------------------------------------------------------------- +SOURCE_BROWSER = YES +INLINE_SOURCES = NO +STRIP_CODE_COMMENTS = YES +REFERENCED_BY_RELATION = YES +REFERENCES_RELATION = YES +REFERENCES_LINK_SOURCE = YES +USE_HTAGS = NO +VERBATIM_HEADERS = YES +#--------------------------------------------------------------------------- +# configuration options related to the alphabetical class index +#--------------------------------------------------------------------------- +ALPHABETICAL_INDEX = NO +COLS_IN_ALPHA_INDEX = 5 +IGNORE_PREFIX = +#--------------------------------------------------------------------------- +# configuration options related to the HTML output +#--------------------------------------------------------------------------- +GENERATE_HTML = YES +HTML_OUTPUT = ./html/ +HTML_FILE_EXTENSION = .html +HTML_HEADER = header.html +HTML_FOOTER = footer.html +HTML_STYLESHEET = stylesheet.css +HTML_ALIGN_MEMBERS = YES +GENERATE_HTMLHELP = YES +CHM_FILE = ifx_dti_agent.chm +HHC_LOCATION = "C:\Program Files\HTML Help Workshop\hhc.exe" +GENERATE_CHI = NO +BINARY_TOC = NO +TOC_EXPAND = YES +DISABLE_INDEX = NO +ENUM_VALUES_PER_LINE = 1 +GENERATE_TREEVIEW = YES +TREEVIEW_WIDTH = 250 +#--------------------------------------------------------------------------- +# configuration options related to the LaTeX output +#--------------------------------------------------------------------------- +GENERATE_LATEX = NO +LATEX_OUTPUT = latex +LATEX_CMD_NAME = latex +MAKEINDEX_CMD_NAME = makeindex +COMPACT_LATEX = NO +PAPER_TYPE = a4wide +EXTRA_PACKAGES = +LATEX_HEADER = +PDF_HYPERLINKS = YES +USE_PDFLATEX = YES +LATEX_BATCHMODE = NO +LATEX_HIDE_INDICES = NO +#--------------------------------------------------------------------------- +# configuration options related to the RTF output +#--------------------------------------------------------------------------- +GENERATE_RTF = NO +RTF_OUTPUT = rtf +COMPACT_RTF = NO +RTF_HYPERLINKS = NO +RTF_STYLESHEET_FILE = +RTF_EXTENSIONS_FILE = +#--------------------------------------------------------------------------- +# configuration options related to the man page output +#--------------------------------------------------------------------------- +GENERATE_MAN = NO +MAN_OUTPUT = man +MAN_EXTENSION = .3 +MAN_LINKS = NO +#--------------------------------------------------------------------------- +# configuration options related to the XML output +#--------------------------------------------------------------------------- +GENERATE_XML = YES +XML_OUTPUT = xml +XML_SCHEMA = +XML_DTD = +XML_PROGRAMLISTING = YES +#--------------------------------------------------------------------------- +# configuration options for the AutoGen Definitions output +#--------------------------------------------------------------------------- +GENERATE_AUTOGEN_DEF = NO +#--------------------------------------------------------------------------- +# configuration options related to the Perl module output +#--------------------------------------------------------------------------- +GENERATE_PERLMOD = NO +PERLMOD_LATEX = NO +PERLMOD_PRETTY = YES +PERLMOD_MAKEVAR_PREFIX = +#--------------------------------------------------------------------------- +# Configuration options related to the preprocessor +#--------------------------------------------------------------------------- +ENABLE_PREPROCESSING = YES +MACRO_EXPANSION = YES +EXPAND_ONLY_PREDEF = YES +SEARCH_INCLUDES = YES +INCLUDE_PATH = +INCLUDE_FILE_PATTERNS = +PREDEFINED = LINUX \ + __PACKED__= \ + INLINE= +EXPAND_AS_DEFINED = +SKIP_FUNCTION_MACROS = YES +#--------------------------------------------------------------------------- +# Configuration::additions related to external references +#--------------------------------------------------------------------------- +TAGFILES = +GENERATE_TAGFILE = +ALLEXTERNALS = NO +EXTERNAL_GROUPS = YES +PERL_PATH = /usr/bin/perl +#--------------------------------------------------------------------------- +# Configuration options related to the dot tool +#--------------------------------------------------------------------------- +CLASS_DIAGRAMS = NO +MSCGEN_PATH = +HIDE_UNDOC_RELATIONS = YES +HAVE_DOT = YES +CLASS_GRAPH = YES +COLLABORATION_GRAPH = YES +GROUP_GRAPHS = YES +UML_LOOK = YES +TEMPLATE_RELATIONS = NO +INCLUDE_GRAPH = YES +INCLUDED_BY_GRAPH = YES +# inefficient, enable if really necessary (or use \callgraph) +CALL_GRAPH = NO +# inefficient, enable if really necessary (or use \callergraph) +CALLER_GRAPH = NO +GRAPHICAL_HIERARCHY = YES +DIRECTORY_GRAPH = YES +DOT_IMAGE_FORMAT = png +DOT_PATH = "C:/Program Files/Graphviz2.22/bin" +DOTFILE_DIRS = +DOT_GRAPH_MAX_NODES = 50 +DOT_TRANSPARENT = NO +DOT_MULTI_TARGETS = NO +GENERATE_LEGEND = YES +DOT_CLEANUP = YES +#--------------------------------------------------------------------------- +# Configuration::additions related to the search engine +#--------------------------------------------------------------------------- +SEARCHENGINE = NO diff --git a/doc/footer.html b/doc/footer.html new file mode 100644 index 0000000..2906e64 --- /dev/null +++ b/doc/footer.html @@ -0,0 +1,6 @@ +
+ +
+Generated on $datetime for $projectname by doxygen $doxygenversion
+ + diff --git a/doc/header.html b/doc/header.html new file mode 100644 index 0000000..e61f461 --- /dev/null +++ b/doc/header.html @@ -0,0 +1,5 @@ + + +$title + + diff --git a/doc/logo.gif b/doc/logo.gif new file mode 100644 index 0000000000000000000000000000000000000000..a64ac23cae300d8dde2c7f58d3a98a3271d92960 GIT binary patch literal 7689 zcmW+)c|6qH`~S?$XXZ1unU8(QGLt=IEQN3z`_7=mgvL%(V=dt}wyc*C*;0+Nq;N-} zX!(vM30IS9T6EnZno5OIQ>yXP@0|DRectDJo`25sI?MAquI?^Y*5Pb`3WxvzyQdP2 zWPxFIFs&MhY{b$Uv5}1ctp%nv!jWZgWHlVwNT8JwXw_Tjr%AtEodB&Dh-?8OJAuee zaT`l(!O}XhkuBKBP40zhop59e9N9^rwWvk5u$?1Ew|h?MxQy;O^hn)l%G6_OH*G42 zF{@xbOK{+8Iq`LT_@@4R+fcqsB!3@6C~Yc)t%b0IkYGKhv0F&m4D%3fg5)qu@|ZR7 zm^Jp9HT9phrp>xW&+bphCbSX~FX|*V=rUS>gkCV=w(^l)t<+wVBj>DB8g?9QcR1Q& zlG$sW-))?I$D(A!@y~X@{7Vk`yU)88L;iJBk*9Cb8mAJ@4xP9>l5zD} z;f)uS{m)K~z8+33dXZG{q>Rn$7(6@lym4IEet-6#`}_;jtDXGi-sz>kpMAgiVySml zbnofM@mbN;*WYiyULSoc8eaR!d%HR%+?ZMxO^JT-g`yYBBL4Emi_bs!KQ?AXqFK?# z?8e42Y`P3vi(u0##qGgdtv>_7x zcK#kWjhlVbw;A-?@&7^pAG`6p83CK^_gMh2Vqil;&5gtUBU>!KKXVTn&JXH31A9B2 z$|c;#ON&htr*9hmx?4J68SYgp87*yQ%*<#Ee&K50`(_5A;4>|CU=#s|YN&e0t7pR^N9vEdG1X>MO8` zmjAOpE%c(KiJp$pv!pjCr559#e(VYrEem|b1OH6O^?#q1hWP(V^3y|kUjLRn?xNZp z`SAWu_Ka@l?rwVTW8@^W7c_Svk1)-rte3vk)Y65{MFgiGZX#b>{9fJvl0*M_T$$2SrJ}b{>*C&g9-%9L`#dF7x zjJ|F6N!e;Ko&M=@fbZ__?8~)PAL`^~jKo3y)5AE!OBAGpAxD7HYaiKKW--rs6xEUu zMw@fGnjPk6o`%v_%bX)ihx`V_v9z9RSx`T(*z5FJ5 za;K1kdfJTA?9+*ksp$PV_7JTcc0<bKjJNI-qU;e3cI6>az}C0e@_dWGdCSNv@5-i^TKNW764iVbza;EW6|b4Q%Ha|L1cY-kJxL(3Zz6Rrd&zgW zt!FKsyZXbYHmqX0zg@%6De2%*aU8h!Q26ZLGcIYjVN9!m%a2R-_}yVy9DC5&jhO@O zA3^3ybr8&P)i}j{`@0`|v?-li;c7i{&fW)+Vzk_MMxEJvGf+LI!yqkDkSk0xvj6eE zfamPj@Jhyxc8uyI3oF<=K|y;WrEh(7T0H(}ooD`dm!d{__&J{sC|^4_357ccto#&e z{ixy92Io-sb?(rgU*9Q;9Xnl1-FN-$$Qg$>l$3EScO@64P087+Mn|d(hHTl*H38me z+M^$mc0b7#86$Zbk3JQCd7VspYCo~E z>1;M9atntsDCtBkG1n#mV!{}JVKP9IwTnj&JHFgY$*m}8JgAYXKdjV8!B|eBv=kd5 zyO&>Cm-o7)OBDz93@KN^+efyAC;dfelao`{xaaUQ;-BnE(=sxL2$_%N;7jHTw6%!{ zNeWVVjZyK8nD4ETqv;qSU-9S4MQKku69um@wd)WiQ7aCrpI8;GA(vbgkP@o#dVky> zak0K!>ggUK=W?;^@R8z-nb4qsik}M{(8_9rbeNbcUp6e|SAD zsNNr+5f!OmCuS35q8LSLJ%IGfAhq4=E8baxR~izGO_4|$PcK-gOFD+U$vsezWDFbc68kGJ?&XY4EIvHgtIO;?$jt%AR z;%Y~kY@g70XXf8DKFO={zP%@HblVLU?afxxV#wRPGLNDVfw3eaq|8jEQWgyG0grQ) zcRg~h{@Ha@;UV;GodoI7=}1iq>dc*ajFA-`;jl8aYi-*8zLC5B7siYe8NBn}R=ZgF zxw!Ph>kFsvyv#pMxDXpcttZqNdz*Y0{1fKRo^V*JLN}8)7w>1c6B~}eaffW*y>c(+ zU957;>a<<&#^^A(0KN_-W8;Y5nP}gAj5qEar@y7FqqpZ%TtqClEp#km!LY5M!%dLW z^j^Q)ByoDe^fQ0|g!W^T>Mz(BTW#5rLh%;q+YLqSZ;1 zLC2?N%W|ifppKFK%)a;P>K(Vi?H%D#L2kKn&D;XZwfk1r&tYxFmrRjzMiH3)J%ds# z**)3B6p}a&g)Cwt3==0bqhJT5^a^N@#YJJUB6xsT*iny=Ag}@S_#{F*F-IeVHv|}w znPxoH{wO+t(h%h95fCV)AOLlWaxw#~(>Umsi!`Hvl5upvT|ciq+Y5StW200kba?9h ze2)!)a%Jbj1SV5LjfjT{n_ABA;O=FNu0;fR)CCq zh`mhoehTyjPIE6r+^OA>ymC~o0B|Fs-FOHEBEpdZ5$2!+9DqOv_AoJV6f|=4+9Li* z7{s`75mFo=n1|j=$xG)Raw~`=9<={4{sttzEG#LX~}TN$V_uJ0}eQmh=@lOt>P^mqVS z0eS;w+yfab<76I~?uL$M8yshW1U3Rk&z`J>f>^1yW9`Irs3r~YWn!MoLB8Z-oFM7n zogje$?BQXa`a}L)gpvUGlZQ{GqKEGxLMgF$XYa1Um^4?4>k9fO1%HBq_7ov*7TJ^x z27VAoZD%8GFM8ULC6{3TdlxM3yC78PDL)v@{RIebI#ix2{>wq3kmQ2T0?-fu&M8&~ zS7pBbhJF(V8DMh~R-iRDOHUYydldGvm3 zgd@yKWub?Uf**tI_p%XAE5OZfF5jkc?L1^T*SC<2wF9I+NBB(G6Am#EJ#pyP*Z6oM z8qGye=}@pERD;er$WS>Bpp}>iHv(PEf&w|21bW)>Zph8@Z~|91lY-6=0;wzbwH34) zHES;mlL$lcE1)_#JAsRjhrxgK&Rte$85KF=M<79O0B9KnSukp}Iyli_IbRdF`04N85GJ^6rpiccRrhgIRK}IMt zK)Il!7&^j>j*&3M$J8SRzBQ^ySm7VyF0xQ1Fsh7EYfP7#boRH+O>}QV1n?5`--b$Y zzzkw=GJu|IJ#%~xp9!GVn25Pc7u7GJYoif?`$!opc?1A`h#Z+IIPYNqnefrqin1hE zToH6Y4%ivS#UG@cCs5F8L8K#GkZ>G4Ok@qX*2geOBPkV*bf;E(pXc_HHf(GmJw$BD zMMiLOwGrw^o?w(HDLb$0#`8cmDnR8xV#c|emh&_E@|D4x=LaPB%lWyU7Y30Wtn>U~ z$j21#Rfq8W9udMp=&OK8ONJvCbR!@7LdOh0^*aWiPa}he^xBZ|X#2G$^@sQ%qEqI$ zZt1>+7vYlD4Ak8;lp%}}TPmn0E1HSUvKr38br9!GC_IMo>V`bw!ww8+sWP)cqS|<_ z-th&-eDHF{bs)r}L>)$`Q_u$l=sFinG-K~!I{qN<${sFe=`O~RReFS7wCHx>W;}kp z;iyhYWz?YDPQ=!B9?Fu58ZAI+GmujNKEBdG;$d0W(?sZ!*bl~5Aq|?>zt=UEG!s^U z_uDQn>SqV)ov+bBB-Oze@25+_kjYo{e?=wyHhUkXh*d5|lj!Ho#N*(8jdF2xa>8SN%O?Vv5OPNTRylUlfcZadQuX zne3ub)qxly{EJwsLI;)mkFBiYSKzX(9PL8gjQzV7O~&i zPzV{&&p;=wKuG{vliCVN49aGL#CM4&^=rZy1x1xqt!PKJVw4#Z%j97#*~r}j>C*_6 zuf&wp8F%OzIFCVRFlAGT*ZkpzslHq9jzj7WL z7dkqOiw-0o+fT-epS(H~p9lsE(EDI;{$xHspixCIyf)FR{bC?MS7Gq8gdxi_m+fi5 zMYeKGNBxx>^|Gx?8Y&MWFxfhX#aIrc-_;6ij8SmX#Oo?=qW%ya@M_ zc{Up>m;esq&l`Xv3{n74k_D~_6#SlE>5)9F#6^T~AxV4a;TeRc$Nx@_MdJ0I4?Vs2W3;EvN=!&=Sa29OeO~! zEWod`@aZcrT<*&D^g-ziD3flV=@*|4%(ylylLKddQMG@H)7rB)>w!I(Bo35XL!$Y` zA6h}vc<7v>n02Pz;u)x4Jw#&;GL3=0uN=xDp$s zC^7?Eu`*)JlAPz^EG%R-D)Er4_74VrP*GM7p^V=iEYg9UBee4$-TWWw53^P0pNhr{ zrBPmzzu14?WU*n7gk%4Sr?QFC=TpY}GSv>VEY@v345w--^V> zQh_-Od3^%eM3QSW@c(}89+u~xLx6Bj5tF_HnWyc=N_RAiK#NoXkThyA~ zAtSb?U$t4Ew>zD@Sqw(&j)oKmD9R1m(~{)#2mjOSR(}KFA_2?`I$p?8Tiyd}cmJW9 zBRkj|Im4FJWh1S~*fJQU@Y(z_UHUa!U31h+t!f|K{bn%Si1rl~_Pg_*D z0n4zFBK1^oA|(lyBF$~n-0e7c2Jz^Rshx{!VGcSM9dr@)5qoTejt-KfwTC$eFI)|~ ztsdfc0r!ZmBeg8^!(22!X|r$GY-f^enl64uAX&{Tu*t)k)3?7HlHl;9U)@o@Q-$A# zSK$nP?dsA%Zm1+zk^<*wTS4`QID6x6B^UoWzlXB-%?PKS=zSvMMmdrua?&?vwm6!p zQ~WG_s@8oYa6@Ft?P4~nKkCKJwN+cDL^~iYaTs4H4mb>SgD2fW;+ z`EXb20TO=JA*Jb$L7iZIS=kRP+*7)a9vSJqu{QJ2zz+p)fa1@h2O5JXen`GEkK>*H z-|>xwU!~B4Miam7PR&;NZ>Vg?oypZJvIn1-CBJ?7{PR8Pe|L(1;CyV4!KBG-E0Ijk zJu2J#JUaNJQ4lrUAs>HweWE|*fL%8J)!R}%-*a{uAI7ZD?AsZVPq7yrBlu7%NlPT5A5CQeXk(8E44!@f}WhQ-`e&KC|X`kqfCXD|KF8`!yvdpZw)TD$LP_~3wTtN8u% zsHLx+FXklni!FD~cj+F0*3&F9fG>5k&vMQ~aRG>iHV_&Edh8!{N`LNR%sZcpd(B&)_^k%R?bI47nHoDKWQ2kot!jZ1Ga7htS%Qytv zC7~B$d?o#v{k_JxKPwAPlVehv&>wn0Qdv-$gzH(2W%)RN@netAf#c;PPXe21S0&FL zD(jZ_-F%M`Xw?{cK1X5bQFx(}7hx`c^V7JXCZ^Bc_1@L@28LJ0y2d39Gw0)DcU+rZ z>`_l0dH%XCl@B&3A>>%3ruzieLYF1u_@&1gvY2hcgD81R%S{HRs zE#a8;B3gbe-|wWOf^`(jQ7xkqRCI!K(A6Jy%%Q!8tXfV7GM-1*9!P(?SQ{3{{~ptj zl2M=-DE65HtCX{D$W6$d^6`Qc{l}UP#JjFWpJ7b9LsyP5Cn|Oq-u$}GUs!l6JeRdC zxA1Jrh_y>?fKfc@fg;^&4&!>5J9ya1wj>;LGi}Ts;(GfWXADVchUBZHu?J<<=*{5| z)b<=Zj+P6IYdS?uwm;d(?^y3^GdKNtJasxYZQ1N(W0c+%{X_1YSzDb4;TRQZ>xHi> zSgF4sD4qFhRW!Th$gN;ChG0vfV~ML#cXNvj>NX>Fc-1=ER^r@7hN?-B!#1|)A$(>P#lwgTHUvqtX zwknIq356c2&Xwm>VrBtWcE@HZ?(e7DAl>- zM(i$6zh{58203rre$T?z)XlqZU+c|d46D)*@2DY>TXJwkNa>`aR#i&7l?s&C?>`X- z1Up~QZ`MEb3G&uYVfpkG7+*=92;E~1Yb$DRt&;NyVJ6Gd24lTD_W0=T?jPLs^^^W5 zaeHaUg(~eclZDo9?H2>IbE_|{X>B{06wMIK%hwa)w?>;SkSab+YzuQ~9B>%VAN#Hp zcCIRSve+Y~VZOSt(S`KEsX6&|@$EvVMOXQ#M+Sz$t!6n@B|!@RR%E$1?r2Z`<9kTC zjg9t$qT=a#aeOTLTCDvI;$62cuS(Ug;0 zaJ@zS?W|~>ze=85?2>3Z?S4wBzvfXNvHfzwuZvG52L`X#q=ol}B!qrAzVFuSy? h3 { margin-top: 0; } +.directory p { margin: 0px; white-space: nowrap; } +.directory div { display: none; margin: 0px; } +.directory img { vertical-align: -30%; } + +DIV.tabs +{ + float : left; + width : 100%; + background : url("tab_b.gif") repeat-x bottom; + margin-bottom : 4px; +} + +DIV.tabs UL +{ + margin : 0px; + padding-left : 10px; + list-style : none; +} + +DIV.tabs LI, DIV.tabs FORM +{ + display : inline; + margin : 0px; + padding : 0px; +} + +DIV.tabs FORM +{ + float : right; +} + +DIV.tabs A +{ + float : left; + background : url("tab_r.gif") no-repeat right top; + border-bottom : 1px solid #84B0C7; + font-size : x-small; + font-weight : bold; + text-decoration : none; +} + +DIV.tabs A:hover +{ + background-position: 100% -150px; +} + +DIV.tabs A:link, DIV.tabs A:visited, +DIV.tabs A:active, DIV.tabs A:hover +{ + color: #1A419D; +} + +DIV.tabs SPAN +{ + float : left; + display : block; + background : url("tab_l.gif") no-repeat left top; + padding : 5px 9px; + white-space : nowrap; +} + +DIV.tabs INPUT +{ + float : right; + display : inline; + font-size : 1em; +} + +DIV.tabs TD +{ + font-size : x-small; + font-weight : bold; + text-decoration : none; +} + + + +/* Commented Backslash Hack hides rule from IE5-Mac \*/ +DIV.tabs SPAN {float : none;} +/* End IE5-Mac hack */ + +DIV.tabs A:hover SPAN +{ + background-position: 0% -150px; +} + +DIV.tabs LI#current A +{ + background-position: 100% -150px; + border-width : 0px; +} + +DIV.tabs LI#current SPAN +{ + background-position: 0% -150px; + padding-bottom : 6px; +} + +DIV.nav +{ + background : none; + border : none; + border-bottom : 1px solid #84B0C7; +} diff --git a/install-sh b/install-sh new file mode 100755 index 0000000..6781b98 --- /dev/null +++ b/install-sh @@ -0,0 +1,520 @@ +#!/bin/sh +# install - install a program, script, or datafile + +scriptversion=2009-04-28.21; # UTC + +# This originates from X11R5 (mit/util/scripts/install.sh), which was +# later released in X11R6 (xc/config/util/install.sh) with the +# following copyright and license. +# +# Copyright (C) 1994 X Consortium +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- +# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# +# Except as contained in this notice, the name of the X Consortium shall not +# be used in advertising or otherwise to promote the sale, use or other deal- +# ings in this Software without prior written authorization from the X Consor- +# tium. +# +# +# FSF changes to this file are in the public domain. +# +# Calling this script install-sh is preferred over install.sh, to prevent +# `make' implicit rules from creating a file called install from it +# when there is no Makefile. +# +# This script is compatible with the BSD install script, but was written +# from scratch. + +nl=' +' +IFS=" "" $nl" + +# set DOITPROG to echo to test this script + +# Don't use :- since 4.3BSD and earlier shells don't like it. +doit=${DOITPROG-} +if test -z "$doit"; then + doit_exec=exec +else + doit_exec=$doit +fi + +# Put in absolute file names if you don't have them in your path; +# or use environment vars. + +chgrpprog=${CHGRPPROG-chgrp} +chmodprog=${CHMODPROG-chmod} +chownprog=${CHOWNPROG-chown} +cmpprog=${CMPPROG-cmp} +cpprog=${CPPROG-cp} +mkdirprog=${MKDIRPROG-mkdir} +mvprog=${MVPROG-mv} +rmprog=${RMPROG-rm} +stripprog=${STRIPPROG-strip} + +posix_glob='?' +initialize_posix_glob=' + test "$posix_glob" != "?" || { + if (set -f) 2>/dev/null; then + posix_glob= + else + posix_glob=: + fi + } +' + +posix_mkdir= + +# Desired mode of installed file. +mode=0755 + +chgrpcmd= +chmodcmd=$chmodprog +chowncmd= +mvcmd=$mvprog +rmcmd="$rmprog -f" +stripcmd= + +src= +dst= +dir_arg= +dst_arg= + +copy_on_change=false +no_target_directory= + +usage="\ +Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE + or: $0 [OPTION]... SRCFILES... DIRECTORY + or: $0 [OPTION]... -t DIRECTORY SRCFILES... + or: $0 [OPTION]... -d DIRECTORIES... + +In the 1st form, copy SRCFILE to DSTFILE. +In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. +In the 4th, create DIRECTORIES. + +Options: + --help display this help and exit. + --version display version info and exit. + + -c (ignored) + -C install only if different (preserve the last data modification time) + -d create directories instead of installing files. + -g GROUP $chgrpprog installed files to GROUP. + -m MODE $chmodprog installed files to MODE. + -o USER $chownprog installed files to USER. + -s $stripprog installed files. + -t DIRECTORY install into DIRECTORY. + -T report an error if DSTFILE is a directory. + +Environment variables override the default commands: + CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG + RMPROG STRIPPROG +" + +while test $# -ne 0; do + case $1 in + -c) ;; + + -C) copy_on_change=true;; + + -d) dir_arg=true;; + + -g) chgrpcmd="$chgrpprog $2" + shift;; + + --help) echo "$usage"; exit $?;; + + -m) mode=$2 + case $mode in + *' '* | *' '* | *' +'* | *'*'* | *'?'* | *'['*) + echo "$0: invalid mode: $mode" >&2 + exit 1;; + esac + shift;; + + -o) chowncmd="$chownprog $2" + shift;; + + -s) stripcmd=$stripprog;; + + -t) dst_arg=$2 + shift;; + + -T) no_target_directory=true;; + + --version) echo "$0 $scriptversion"; exit $?;; + + --) shift + break;; + + -*) echo "$0: invalid option: $1" >&2 + exit 1;; + + *) break;; + esac + shift +done + +if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then + # When -d is used, all remaining arguments are directories to create. + # When -t is used, the destination is already specified. + # Otherwise, the last argument is the destination. Remove it from $@. + for arg + do + if test -n "$dst_arg"; then + # $@ is not empty: it contains at least $arg. + set fnord "$@" "$dst_arg" + shift # fnord + fi + shift # arg + dst_arg=$arg + done +fi + +if test $# -eq 0; then + if test -z "$dir_arg"; then + echo "$0: no input file specified." >&2 + exit 1 + fi + # It's OK to call `install-sh -d' without argument. + # This can happen when creating conditional directories. + exit 0 +fi + +if test -z "$dir_arg"; then + trap '(exit $?); exit' 1 2 13 15 + + # Set umask so as not to create temps with too-generous modes. + # However, 'strip' requires both read and write access to temps. + case $mode in + # Optimize common cases. + *644) cp_umask=133;; + *755) cp_umask=22;; + + *[0-7]) + if test -z "$stripcmd"; then + u_plus_rw= + else + u_plus_rw='% 200' + fi + cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; + *) + if test -z "$stripcmd"; then + u_plus_rw= + else + u_plus_rw=,u+rw + fi + cp_umask=$mode$u_plus_rw;; + esac +fi + +for src +do + # Protect names starting with `-'. + case $src in + -*) src=./$src;; + esac + + if test -n "$dir_arg"; then + dst=$src + dstdir=$dst + test -d "$dstdir" + dstdir_status=$? + else + + # Waiting for this to be detected by the "$cpprog $src $dsttmp" command + # might cause directories to be created, which would be especially bad + # if $src (and thus $dsttmp) contains '*'. + if test ! -f "$src" && test ! -d "$src"; then + echo "$0: $src does not exist." >&2 + exit 1 + fi + + if test -z "$dst_arg"; then + echo "$0: no destination specified." >&2 + exit 1 + fi + + dst=$dst_arg + # Protect names starting with `-'. + case $dst in + -*) dst=./$dst;; + esac + + # If destination is a directory, append the input filename; won't work + # if double slashes aren't ignored. + if test -d "$dst"; then + if test -n "$no_target_directory"; then + echo "$0: $dst_arg: Is a directory" >&2 + exit 1 + fi + dstdir=$dst + dst=$dstdir/`basename "$src"` + dstdir_status=0 + else + # Prefer dirname, but fall back on a substitute if dirname fails. + dstdir=` + (dirname "$dst") 2>/dev/null || + expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$dst" : 'X\(//\)[^/]' \| \ + X"$dst" : 'X\(//\)$' \| \ + X"$dst" : 'X\(/\)' \| . 2>/dev/null || + echo X"$dst" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q' + ` + + test -d "$dstdir" + dstdir_status=$? + fi + fi + + obsolete_mkdir_used=false + + if test $dstdir_status != 0; then + case $posix_mkdir in + '') + # Create intermediate dirs using mode 755 as modified by the umask. + # This is like FreeBSD 'install' as of 1997-10-28. + umask=`umask` + case $stripcmd.$umask in + # Optimize common cases. + *[2367][2367]) mkdir_umask=$umask;; + .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; + + *[0-7]) + mkdir_umask=`expr $umask + 22 \ + - $umask % 100 % 40 + $umask % 20 \ + - $umask % 10 % 4 + $umask % 2 + `;; + *) mkdir_umask=$umask,go-w;; + esac + + # With -d, create the new directory with the user-specified mode. + # Otherwise, rely on $mkdir_umask. + if test -n "$dir_arg"; then + mkdir_mode=-m$mode + else + mkdir_mode= + fi + + posix_mkdir=false + case $umask in + *[123567][0-7][0-7]) + # POSIX mkdir -p sets u+wx bits regardless of umask, which + # is incompatible with FreeBSD 'install' when (umask & 300) != 0. + ;; + *) + tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ + trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 + + if (umask $mkdir_umask && + exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 + then + if test -z "$dir_arg" || { + # Check for POSIX incompatibilities with -m. + # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or + # other-writeable bit of parent directory when it shouldn't. + # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. + ls_ld_tmpdir=`ls -ld "$tmpdir"` + case $ls_ld_tmpdir in + d????-?r-*) different_mode=700;; + d????-?--*) different_mode=755;; + *) false;; + esac && + $mkdirprog -m$different_mode -p -- "$tmpdir" && { + ls_ld_tmpdir_1=`ls -ld "$tmpdir"` + test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" + } + } + then posix_mkdir=: + fi + rmdir "$tmpdir/d" "$tmpdir" + else + # Remove any dirs left behind by ancient mkdir implementations. + rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null + fi + trap '' 0;; + esac;; + esac + + if + $posix_mkdir && ( + umask $mkdir_umask && + $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" + ) + then : + else + + # The umask is ridiculous, or mkdir does not conform to POSIX, + # or it failed possibly due to a race condition. Create the + # directory the slow way, step by step, checking for races as we go. + + case $dstdir in + /*) prefix='/';; + -*) prefix='./';; + *) prefix='';; + esac + + eval "$initialize_posix_glob" + + oIFS=$IFS + IFS=/ + $posix_glob set -f + set fnord $dstdir + shift + $posix_glob set +f + IFS=$oIFS + + prefixes= + + for d + do + test -z "$d" && continue + + prefix=$prefix$d + if test -d "$prefix"; then + prefixes= + else + if $posix_mkdir; then + (umask=$mkdir_umask && + $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break + # Don't fail if two instances are running concurrently. + test -d "$prefix" || exit 1 + else + case $prefix in + *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; + *) qprefix=$prefix;; + esac + prefixes="$prefixes '$qprefix'" + fi + fi + prefix=$prefix/ + done + + if test -n "$prefixes"; then + # Don't fail if two instances are running concurrently. + (umask $mkdir_umask && + eval "\$doit_exec \$mkdirprog $prefixes") || + test -d "$dstdir" || exit 1 + obsolete_mkdir_used=true + fi + fi + fi + + if test -n "$dir_arg"; then + { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && + { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && + { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || + test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 + else + + # Make a couple of temp file names in the proper directory. + dsttmp=$dstdir/_inst.$$_ + rmtmp=$dstdir/_rm.$$_ + + # Trap to clean up those temp files at exit. + trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 + + # Copy the file name to the temp name. + (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && + + # and set any options; do chmod last to preserve setuid bits. + # + # If any of these fail, we abort the whole thing. If we want to + # ignore errors from any of these, just make sure not to ignore + # errors from the above "$doit $cpprog $src $dsttmp" command. + # + { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && + { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && + { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && + { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && + + # If -C, don't bother to copy if it wouldn't change the file. + if $copy_on_change && + old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && + new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && + + eval "$initialize_posix_glob" && + $posix_glob set -f && + set X $old && old=:$2:$4:$5:$6 && + set X $new && new=:$2:$4:$5:$6 && + $posix_glob set +f && + + test "$old" = "$new" && + $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 + then + rm -f "$dsttmp" + else + # Rename the file to the real destination. + $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || + + # The rename failed, perhaps because mv can't rename something else + # to itself, or perhaps because mv is so ancient that it does not + # support -f. + { + # Now remove or move aside any old file at destination location. + # We try this two ways since rm can't unlink itself on some + # systems and the destination file might be busy for other + # reasons. In this case, the final cleanup might fail but the new + # file should still install successfully. + { + test ! -f "$dst" || + $doit $rmcmd -f "$dst" 2>/dev/null || + { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && + { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } + } || + { echo "$0: cannot unlink or rename $dst" >&2 + (exit 1); exit 1 + } + } && + + # Now rename the file to the real destination. + $doit $mvcmd "$dsttmp" "$dst" + } + fi || exit 1 + + trap '' 0 + fi +done + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-time-zone: "UTC" +# time-stamp-end: "; # UTC" +# End: diff --git a/missing b/missing new file mode 100755 index 0000000..28055d2 --- /dev/null +++ b/missing @@ -0,0 +1,376 @@ +#! /bin/sh +# Common stub for a few missing GNU programs while installing. + +scriptversion=2009-04-28.21; # UTC + +# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006, +# 2008, 2009 Free Software Foundation, Inc. +# Originally by Fran,cois Pinard , 1996. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +if test $# -eq 0; then + echo 1>&2 "Try \`$0 --help' for more information" + exit 1 +fi + +run=: +sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p' +sed_minuso='s/.* -o \([^ ]*\).*/\1/p' + +# In the cases where this matters, `missing' is being run in the +# srcdir already. +if test -f configure.ac; then + configure_ac=configure.ac +else + configure_ac=configure.in +fi + +msg="missing on your system" + +case $1 in +--run) + # Try to run requested program, and just exit if it succeeds. + run= + shift + "$@" && exit 0 + # Exit code 63 means version mismatch. This often happens + # when the user try to use an ancient version of a tool on + # a file that requires a minimum version. In this case we + # we should proceed has if the program had been absent, or + # if --run hadn't been passed. + if test $? = 63; then + run=: + msg="probably too old" + fi + ;; + + -h|--h|--he|--hel|--help) + echo "\ +$0 [OPTION]... PROGRAM [ARGUMENT]... + +Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an +error status if there is no known handling for PROGRAM. + +Options: + -h, --help display this help and exit + -v, --version output version information and exit + --run try to run the given command, and emulate it if it fails + +Supported PROGRAM values: + aclocal touch file \`aclocal.m4' + autoconf touch file \`configure' + autoheader touch file \`config.h.in' + autom4te touch the output file, or create a stub one + automake touch all \`Makefile.in' files + bison create \`y.tab.[ch]', if possible, from existing .[ch] + flex create \`lex.yy.c', if possible, from existing .c + help2man touch the output file + lex create \`lex.yy.c', if possible, from existing .c + makeinfo touch the output file + tar try tar, gnutar, gtar, then tar without non-portable flags + yacc create \`y.tab.[ch]', if possible, from existing .[ch] + +Version suffixes to PROGRAM as well as the prefixes \`gnu-', \`gnu', and +\`g' are ignored when checking the name. + +Send bug reports to ." + exit $? + ;; + + -v|--v|--ve|--ver|--vers|--versi|--versio|--version) + echo "missing $scriptversion (GNU Automake)" + exit $? + ;; + + -*) + echo 1>&2 "$0: Unknown \`$1' option" + echo 1>&2 "Try \`$0 --help' for more information" + exit 1 + ;; + +esac + +# normalize program name to check for. +program=`echo "$1" | sed ' + s/^gnu-//; t + s/^gnu//; t + s/^g//; t'` + +# Now exit if we have it, but it failed. Also exit now if we +# don't have it and --version was passed (most likely to detect +# the program). This is about non-GNU programs, so use $1 not +# $program. +case $1 in + lex*|yacc*) + # Not GNU programs, they don't have --version. + ;; + + tar*) + if test -n "$run"; then + echo 1>&2 "ERROR: \`tar' requires --run" + exit 1 + elif test "x$2" = "x--version" || test "x$2" = "x--help"; then + exit 1 + fi + ;; + + *) + if test -z "$run" && ($1 --version) > /dev/null 2>&1; then + # We have it, but it failed. + exit 1 + elif test "x$2" = "x--version" || test "x$2" = "x--help"; then + # Could not run --version or --help. This is probably someone + # running `$TOOL --version' or `$TOOL --help' to check whether + # $TOOL exists and not knowing $TOOL uses missing. + exit 1 + fi + ;; +esac + +# If it does not exist, or fails to run (possibly an outdated version), +# try to emulate it. +case $program in + aclocal*) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified \`acinclude.m4' or \`${configure_ac}'. You might want + to install the \`Automake' and \`Perl' packages. Grab them from + any GNU archive site." + touch aclocal.m4 + ;; + + autoconf*) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified \`${configure_ac}'. You might want to install the + \`Autoconf' and \`GNU m4' packages. Grab them from any GNU + archive site." + touch configure + ;; + + autoheader*) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified \`acconfig.h' or \`${configure_ac}'. You might want + to install the \`Autoconf' and \`GNU m4' packages. Grab them + from any GNU archive site." + files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}` + test -z "$files" && files="config.h" + touch_files= + for f in $files; do + case $f in + *:*) touch_files="$touch_files "`echo "$f" | + sed -e 's/^[^:]*://' -e 's/:.*//'`;; + *) touch_files="$touch_files $f.in";; + esac + done + touch $touch_files + ;; + + automake*) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'. + You might want to install the \`Automake' and \`Perl' packages. + Grab them from any GNU archive site." + find . -type f -name Makefile.am -print | + sed 's/\.am$/.in/' | + while read f; do touch "$f"; done + ;; + + autom4te*) + echo 1>&2 "\ +WARNING: \`$1' is needed, but is $msg. + You might have modified some files without having the + proper tools for further handling them. + You can get \`$1' as part of \`Autoconf' from any GNU + archive site." + + file=`echo "$*" | sed -n "$sed_output"` + test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` + if test -f "$file"; then + touch $file + else + test -z "$file" || exec >$file + echo "#! /bin/sh" + echo "# Created by GNU Automake missing as a replacement of" + echo "# $ $@" + echo "exit 0" + chmod +x $file + exit 1 + fi + ;; + + bison*|yacc*) + echo 1>&2 "\ +WARNING: \`$1' $msg. You should only need it if + you modified a \`.y' file. You may need the \`Bison' package + in order for those modifications to take effect. You can get + \`Bison' from any GNU archive site." + rm -f y.tab.c y.tab.h + if test $# -ne 1; then + eval LASTARG="\${$#}" + case $LASTARG in + *.y) + SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` + if test -f "$SRCFILE"; then + cp "$SRCFILE" y.tab.c + fi + SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` + if test -f "$SRCFILE"; then + cp "$SRCFILE" y.tab.h + fi + ;; + esac + fi + if test ! -f y.tab.h; then + echo >y.tab.h + fi + if test ! -f y.tab.c; then + echo 'main() { return 0; }' >y.tab.c + fi + ;; + + lex*|flex*) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified a \`.l' file. You may need the \`Flex' package + in order for those modifications to take effect. You can get + \`Flex' from any GNU archive site." + rm -f lex.yy.c + if test $# -ne 1; then + eval LASTARG="\${$#}" + case $LASTARG in + *.l) + SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` + if test -f "$SRCFILE"; then + cp "$SRCFILE" lex.yy.c + fi + ;; + esac + fi + if test ! -f lex.yy.c; then + echo 'main() { return 0; }' >lex.yy.c + fi + ;; + + help2man*) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified a dependency of a manual page. You may need the + \`Help2man' package in order for those modifications to take + effect. You can get \`Help2man' from any GNU archive site." + + file=`echo "$*" | sed -n "$sed_output"` + test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` + if test -f "$file"; then + touch $file + else + test -z "$file" || exec >$file + echo ".ab help2man is required to generate this page" + exit $? + fi + ;; + + makeinfo*) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified a \`.texi' or \`.texinfo' file, or any other file + indirectly affecting the aspect of the manual. The spurious + call might also be the consequence of using a buggy \`make' (AIX, + DU, IRIX). You might want to install the \`Texinfo' package or + the \`GNU make' package. Grab either from any GNU archive site." + # The file to touch is that specified with -o ... + file=`echo "$*" | sed -n "$sed_output"` + test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` + if test -z "$file"; then + # ... or it is the one specified with @setfilename ... + infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` + file=`sed -n ' + /^@setfilename/{ + s/.* \([^ ]*\) *$/\1/ + p + q + }' $infile` + # ... or it is derived from the source name (dir/f.texi becomes f.info) + test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info + fi + # If the file does not exist, the user really needs makeinfo; + # let's fail without touching anything. + test -f $file || exit 1 + touch $file + ;; + + tar*) + shift + + # We have already tried tar in the generic part. + # Look for gnutar/gtar before invocation to avoid ugly error + # messages. + if (gnutar --version > /dev/null 2>&1); then + gnutar "$@" && exit 0 + fi + if (gtar --version > /dev/null 2>&1); then + gtar "$@" && exit 0 + fi + firstarg="$1" + if shift; then + case $firstarg in + *o*) + firstarg=`echo "$firstarg" | sed s/o//` + tar "$firstarg" "$@" && exit 0 + ;; + esac + case $firstarg in + *h*) + firstarg=`echo "$firstarg" | sed s/h//` + tar "$firstarg" "$@" && exit 0 + ;; + esac + fi + + echo 1>&2 "\ +WARNING: I can't seem to be able to run \`tar' with the given arguments. + You may want to install GNU tar or Free paxutils, or check the + command line arguments." + exit 1 + ;; + + *) + echo 1>&2 "\ +WARNING: \`$1' is needed, and is $msg. + You might have modified some files without having the + proper tools for further handling them. Check the \`README' file, + it often tells you about the needed prerequisites for installing + this package. You may also peek at any GNU archive site, in case + some other package would contain this missing \`$1' program." + exit 1 + ;; +esac + +exit 0 + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-time-zone: "UTC" +# time-stamp-end: "; # UTC" +# End: diff --git a/src/Makefile.am b/src/Makefile.am new file mode 100644 index 0000000..0795a83 --- /dev/null +++ b/src/Makefile.am @@ -0,0 +1,79 @@ +## Process this file with automake to produce Makefile.in + +bin_PROGRAMS = gpon_dti_agent + +gpon_dti_agent_SOURCES = \ + dti_agent_main.c \ + dti_agent_main.h \ + dti_agent_cli.c \ + dti_agent_cli.h \ + dti_agent_onu.c \ + dti_agent_onu.h \ + dti_agent_onu_ctx.h \ + dti_agent_optic.c \ + dti_agent_optic.h \ + dti_agent_optic_ctx.h \ + dti_agent_ocal.c \ + dti_agent_ocal.h \ + dti_agent_ocal_ctx.h + +AM_CPPFLAGS = \ + -I@srcdir@ \ + -I@top_srcdir@/.. \ + @IFXOS_INCLUDE_PATH@ \ + @DTI_INCLUDE_PATH@ \ + @ONU_INCLUDE_PATH@ \ + @OPTIC_INCLUDE_PATH@ \ + @OCAL_INCLUDE_PATH@ + +AM_CFLAGS = -DLINUX -Wall -Wextra -Wno-unused-parameter + +gpon_dti_agent_CFLAGS = $(AM_CFLAGS) + +gpon_dti_agent_LDADD = +gpon_dti_agent_LDFLAGS = -L@builddir@ + +if STARTUP_REGISTERED +gpon_dti_agent_CFLAGS += -DSTARTUP_WITH_REGISTERED_DEVICE +endif + +if DEVICE_GENERIC +gpon_dti_agent_CFLAGS += -DDEVICE_GENERIC +endif + +if DEVICE_ONU +gpon_dti_agent_CFLAGS += -DDEVICE_GPON_ONU +endif + +if DEVICE_OPTIC +gpon_dti_agent_CFLAGS += -DDEVICE_GPON_OPTIC +endif + +if ONU_SIMULATION +gpon_dti_agent_CFLAGS += -DONU_SIMULATION +gpon_dti_agent_LDFLAGS += -L@ONU_LIBRARY_PATH@ +gpon_dti_agent_LDADD += -lonu +endif + +if OPTIC_SIMULATION +gpon_dti_agent_CFLAGS += -DOPTIC_SIMULATION +gpon_dti_agent_LDFLAGS += -L@OPTIC_LIBRARY_PATH@ +gpon_dti_agent_LDADD += -loptic +endif + +if DEVICE_OCAL +gpon_dti_agent_CFLAGS += -DDEVICE_GPON_OCAL +gpon_dti_agent_LDFLAGS += -L@OCAL_LIBRARY_PATH@ +gpon_dti_agent_LDADD += -local -luci -ldl -lm +endif + +gpon_dti_agent_LDFLAGS += -L@DTI_LIBRARY_PATH@ +gpon_dti_agent_LDADD += -ldti_agent +if DEVICE_GENERIC +gpon_dti_agent_LDADD += -ldti_device_generic +endif + +gpon_dti_agent_LDFLAGS += -L@IFXOS_LIBRARY_PATH@ +gpon_dti_agent_LDADD += -lifxos + +gpon_dti_agent_LDADD += -lpthread -lrt diff --git a/src/Makefile.in b/src/Makefile.in new file mode 100644 index 0000000..d6ee6be --- /dev/null +++ b/src/Makefile.in @@ -0,0 +1,613 @@ +# Makefile.in generated by automake 1.11.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, +# Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +bin_PROGRAMS = gpon_dti_agent$(EXEEXT) +@STARTUP_REGISTERED_TRUE@am__append_1 = -DSTARTUP_WITH_REGISTERED_DEVICE +@DEVICE_GENERIC_TRUE@am__append_2 = -DDEVICE_GENERIC +@DEVICE_ONU_TRUE@am__append_3 = -DDEVICE_GPON_ONU +@DEVICE_OPTIC_TRUE@am__append_4 = -DDEVICE_GPON_OPTIC +@ONU_SIMULATION_TRUE@am__append_5 = -DONU_SIMULATION +@ONU_SIMULATION_TRUE@am__append_6 = -L@ONU_LIBRARY_PATH@ +@ONU_SIMULATION_TRUE@am__append_7 = -lonu +@OPTIC_SIMULATION_TRUE@am__append_8 = -DOPTIC_SIMULATION +@OPTIC_SIMULATION_TRUE@am__append_9 = -L@OPTIC_LIBRARY_PATH@ +@OPTIC_SIMULATION_TRUE@am__append_10 = -loptic +@DEVICE_OCAL_TRUE@am__append_11 = -DDEVICE_GPON_OCAL +@DEVICE_OCAL_TRUE@am__append_12 = -L@OCAL_LIBRARY_PATH@ +@DEVICE_OCAL_TRUE@am__append_13 = -local -luci -ldl -lm +@DEVICE_GENERIC_TRUE@am__append_14 = -ldti_device_generic +subdir = src +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ + $(srcdir)/dti_agent_config.h.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 = dti_agent_config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +am__installdirs = "$(DESTDIR)$(bindir)" +PROGRAMS = $(bin_PROGRAMS) +am_gpon_dti_agent_OBJECTS = gpon_dti_agent-dti_agent_main.$(OBJEXT) \ + gpon_dti_agent-dti_agent_cli.$(OBJEXT) \ + gpon_dti_agent-dti_agent_onu.$(OBJEXT) \ + gpon_dti_agent-dti_agent_optic.$(OBJEXT) \ + gpon_dti_agent-dti_agent_ocal.$(OBJEXT) +gpon_dti_agent_OBJECTS = $(am_gpon_dti_agent_OBJECTS) +am__DEPENDENCIES_1 = +gpon_dti_agent_DEPENDENCIES = $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) +gpon_dti_agent_LINK = $(CCLD) $(gpon_dti_agent_CFLAGS) $(CFLAGS) \ + $(gpon_dti_agent_LDFLAGS) $(LDFLAGS) -o $@ +DEFAULT_INCLUDES = -I.@am__isrc@ +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +am__mv = mv -f +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ +SOURCES = $(gpon_dti_agent_SOURCES) +DIST_SOURCES = $(gpon_dti_agent_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@ +CONFIGURE_OPTIONS = @CONFIGURE_OPTIONS@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DEVICE_GENERIC = @DEVICE_GENERIC@ +DEVICE_OCAL = @DEVICE_OCAL@ +DEVICE_ONU = @DEVICE_ONU@ +DEVICE_OPTIC = @DEVICE_OPTIC@ +DTI_INCLUDE_PATH = @DTI_INCLUDE_PATH@ +DTI_LIBRARY_PATH = @DTI_LIBRARY_PATH@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EXEEXT = @EXEEXT@ +IFXOS_INCLUDE_PATH = @IFXOS_INCLUDE_PATH@ +IFXOS_LIBRARY_PATH = @IFXOS_LIBRARY_PATH@ +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@ +OCAL_INCLUDE_PATH = @OCAL_INCLUDE_PATH@ +OCAL_LIBRARY_PATH = @OCAL_LIBRARY_PATH@ +ONU_INCLUDE_PATH = @ONU_INCLUDE_PATH@ +ONU_LIBRARY_PATH = @ONU_LIBRARY_PATH@ +ONU_SIMULATION = @ONU_SIMULATION@ +OPTIC_INCLUDE_PATH = @OPTIC_INCLUDE_PATH@ +OPTIC_LIBRARY_PATH = @OPTIC_LIBRARY_PATH@ +OPTIC_SIMULATION = @OPTIC_SIMULATION@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +RANLIB = @RANLIB@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STARTUP_REGISTERED = @STARTUP_REGISTERED@ +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@ +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_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +gpon_dti_agent_SOURCES = \ + dti_agent_main.c \ + dti_agent_main.h \ + dti_agent_cli.c \ + dti_agent_cli.h \ + dti_agent_onu.c \ + dti_agent_onu.h \ + dti_agent_onu_ctx.h \ + dti_agent_optic.c \ + dti_agent_optic.h \ + dti_agent_optic_ctx.h \ + dti_agent_ocal.c \ + dti_agent_ocal.h \ + dti_agent_ocal_ctx.h + +AM_CPPFLAGS = \ + -I@srcdir@ \ + -I@top_srcdir@/.. \ + @IFXOS_INCLUDE_PATH@ \ + @DTI_INCLUDE_PATH@ \ + @ONU_INCLUDE_PATH@ \ + @OPTIC_INCLUDE_PATH@ \ + @OCAL_INCLUDE_PATH@ + +AM_CFLAGS = -DLINUX -Wall -Wextra -Wno-unused-parameter +gpon_dti_agent_CFLAGS = $(AM_CFLAGS) $(am__append_1) $(am__append_2) \ + $(am__append_3) $(am__append_4) $(am__append_5) \ + $(am__append_8) $(am__append_11) +gpon_dti_agent_LDADD = $(am__append_7) $(am__append_10) \ + $(am__append_13) -ldti_agent $(am__append_14) -lifxos \ + -lpthread -lrt +gpon_dti_agent_LDFLAGS = -L@builddir@ $(am__append_6) $(am__append_9) \ + $(am__append_12) -L@DTI_LIBRARY_PATH@ -L@IFXOS_LIBRARY_PATH@ +all: dti_agent_config.h + $(MAKE) $(AM_MAKEFLAGS) 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 ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --foreign src/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +dti_agent_config.h: stamp-h1 + @if test ! -f $@; then \ + rm -f stamp-h1; \ + $(MAKE) $(AM_MAKEFLAGS) stamp-h1; \ + else :; fi + +stamp-h1: $(srcdir)/dti_agent_config.h.in $(top_builddir)/config.status + @rm -f stamp-h1 + cd $(top_builddir) && $(SHELL) ./config.status src/dti_agent_config.h +$(srcdir)/dti_agent_config.h.in: $(am__configure_deps) + ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) + rm -f stamp-h1 + touch $@ + +distclean-hdr: + -rm -f dti_agent_config.h stamp-h1 +install-binPROGRAMS: $(bin_PROGRAMS) + @$(NORMAL_INSTALL) + test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)" + @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ + for p in $$list; do echo "$$p $$p"; done | \ + sed 's/$(EXEEXT)$$//' | \ + while read p p1; do if test -f $$p; \ + then echo "$$p"; echo "$$p"; else :; fi; \ + done | \ + sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \ + -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ + sed 'N;N;N;s,\n, ,g' | \ + $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ + { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ + if ($$2 == $$4) files[d] = files[d] " " $$1; \ + else { print "f", $$3 "/" $$4, $$1; } } \ + END { for (d in files) print "f", d, files[d] }' | \ + while read type dir files; do \ + if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ + test -z "$$files" || { \ + echo " $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ + $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ + } \ + ; done + +uninstall-binPROGRAMS: + @$(NORMAL_UNINSTALL) + @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ + files=`for p in $$list; do echo "$$p"; done | \ + sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ + -e 's/$$/$(EXEEXT)/' `; \ + test -n "$$list" || exit 0; \ + echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ + cd "$(DESTDIR)$(bindir)" && rm -f $$files + +clean-binPROGRAMS: + -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS) +gpon_dti_agent$(EXEEXT): $(gpon_dti_agent_OBJECTS) $(gpon_dti_agent_DEPENDENCIES) + @rm -f gpon_dti_agent$(EXEEXT) + $(gpon_dti_agent_LINK) $(gpon_dti_agent_OBJECTS) $(gpon_dti_agent_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gpon_dti_agent-dti_agent_cli.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gpon_dti_agent-dti_agent_main.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gpon_dti_agent-dti_agent_ocal.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gpon_dti_agent-dti_agent_onu.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gpon_dti_agent-dti_agent_optic.Po@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c $< + +.c.obj: +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` + +gpon_dti_agent-dti_agent_main.o: dti_agent_main.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gpon_dti_agent_CFLAGS) $(CFLAGS) -MT gpon_dti_agent-dti_agent_main.o -MD -MP -MF $(DEPDIR)/gpon_dti_agent-dti_agent_main.Tpo -c -o gpon_dti_agent-dti_agent_main.o `test -f 'dti_agent_main.c' || echo '$(srcdir)/'`dti_agent_main.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/gpon_dti_agent-dti_agent_main.Tpo $(DEPDIR)/gpon_dti_agent-dti_agent_main.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='dti_agent_main.c' object='gpon_dti_agent-dti_agent_main.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gpon_dti_agent_CFLAGS) $(CFLAGS) -c -o gpon_dti_agent-dti_agent_main.o `test -f 'dti_agent_main.c' || echo '$(srcdir)/'`dti_agent_main.c + +gpon_dti_agent-dti_agent_main.obj: dti_agent_main.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gpon_dti_agent_CFLAGS) $(CFLAGS) -MT gpon_dti_agent-dti_agent_main.obj -MD -MP -MF $(DEPDIR)/gpon_dti_agent-dti_agent_main.Tpo -c -o gpon_dti_agent-dti_agent_main.obj `if test -f 'dti_agent_main.c'; then $(CYGPATH_W) 'dti_agent_main.c'; else $(CYGPATH_W) '$(srcdir)/dti_agent_main.c'; fi` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/gpon_dti_agent-dti_agent_main.Tpo $(DEPDIR)/gpon_dti_agent-dti_agent_main.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='dti_agent_main.c' object='gpon_dti_agent-dti_agent_main.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gpon_dti_agent_CFLAGS) $(CFLAGS) -c -o gpon_dti_agent-dti_agent_main.obj `if test -f 'dti_agent_main.c'; then $(CYGPATH_W) 'dti_agent_main.c'; else $(CYGPATH_W) '$(srcdir)/dti_agent_main.c'; fi` + +gpon_dti_agent-dti_agent_cli.o: dti_agent_cli.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gpon_dti_agent_CFLAGS) $(CFLAGS) -MT gpon_dti_agent-dti_agent_cli.o -MD -MP -MF $(DEPDIR)/gpon_dti_agent-dti_agent_cli.Tpo -c -o gpon_dti_agent-dti_agent_cli.o `test -f 'dti_agent_cli.c' || echo '$(srcdir)/'`dti_agent_cli.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/gpon_dti_agent-dti_agent_cli.Tpo $(DEPDIR)/gpon_dti_agent-dti_agent_cli.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='dti_agent_cli.c' object='gpon_dti_agent-dti_agent_cli.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gpon_dti_agent_CFLAGS) $(CFLAGS) -c -o gpon_dti_agent-dti_agent_cli.o `test -f 'dti_agent_cli.c' || echo '$(srcdir)/'`dti_agent_cli.c + +gpon_dti_agent-dti_agent_cli.obj: dti_agent_cli.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gpon_dti_agent_CFLAGS) $(CFLAGS) -MT gpon_dti_agent-dti_agent_cli.obj -MD -MP -MF $(DEPDIR)/gpon_dti_agent-dti_agent_cli.Tpo -c -o gpon_dti_agent-dti_agent_cli.obj `if test -f 'dti_agent_cli.c'; then $(CYGPATH_W) 'dti_agent_cli.c'; else $(CYGPATH_W) '$(srcdir)/dti_agent_cli.c'; fi` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/gpon_dti_agent-dti_agent_cli.Tpo $(DEPDIR)/gpon_dti_agent-dti_agent_cli.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='dti_agent_cli.c' object='gpon_dti_agent-dti_agent_cli.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gpon_dti_agent_CFLAGS) $(CFLAGS) -c -o gpon_dti_agent-dti_agent_cli.obj `if test -f 'dti_agent_cli.c'; then $(CYGPATH_W) 'dti_agent_cli.c'; else $(CYGPATH_W) '$(srcdir)/dti_agent_cli.c'; fi` + +gpon_dti_agent-dti_agent_onu.o: dti_agent_onu.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gpon_dti_agent_CFLAGS) $(CFLAGS) -MT gpon_dti_agent-dti_agent_onu.o -MD -MP -MF $(DEPDIR)/gpon_dti_agent-dti_agent_onu.Tpo -c -o gpon_dti_agent-dti_agent_onu.o `test -f 'dti_agent_onu.c' || echo '$(srcdir)/'`dti_agent_onu.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/gpon_dti_agent-dti_agent_onu.Tpo $(DEPDIR)/gpon_dti_agent-dti_agent_onu.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='dti_agent_onu.c' object='gpon_dti_agent-dti_agent_onu.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gpon_dti_agent_CFLAGS) $(CFLAGS) -c -o gpon_dti_agent-dti_agent_onu.o `test -f 'dti_agent_onu.c' || echo '$(srcdir)/'`dti_agent_onu.c + +gpon_dti_agent-dti_agent_onu.obj: dti_agent_onu.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gpon_dti_agent_CFLAGS) $(CFLAGS) -MT gpon_dti_agent-dti_agent_onu.obj -MD -MP -MF $(DEPDIR)/gpon_dti_agent-dti_agent_onu.Tpo -c -o gpon_dti_agent-dti_agent_onu.obj `if test -f 'dti_agent_onu.c'; then $(CYGPATH_W) 'dti_agent_onu.c'; else $(CYGPATH_W) '$(srcdir)/dti_agent_onu.c'; fi` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/gpon_dti_agent-dti_agent_onu.Tpo $(DEPDIR)/gpon_dti_agent-dti_agent_onu.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='dti_agent_onu.c' object='gpon_dti_agent-dti_agent_onu.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gpon_dti_agent_CFLAGS) $(CFLAGS) -c -o gpon_dti_agent-dti_agent_onu.obj `if test -f 'dti_agent_onu.c'; then $(CYGPATH_W) 'dti_agent_onu.c'; else $(CYGPATH_W) '$(srcdir)/dti_agent_onu.c'; fi` + +gpon_dti_agent-dti_agent_optic.o: dti_agent_optic.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gpon_dti_agent_CFLAGS) $(CFLAGS) -MT gpon_dti_agent-dti_agent_optic.o -MD -MP -MF $(DEPDIR)/gpon_dti_agent-dti_agent_optic.Tpo -c -o gpon_dti_agent-dti_agent_optic.o `test -f 'dti_agent_optic.c' || echo '$(srcdir)/'`dti_agent_optic.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/gpon_dti_agent-dti_agent_optic.Tpo $(DEPDIR)/gpon_dti_agent-dti_agent_optic.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='dti_agent_optic.c' object='gpon_dti_agent-dti_agent_optic.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gpon_dti_agent_CFLAGS) $(CFLAGS) -c -o gpon_dti_agent-dti_agent_optic.o `test -f 'dti_agent_optic.c' || echo '$(srcdir)/'`dti_agent_optic.c + +gpon_dti_agent-dti_agent_optic.obj: dti_agent_optic.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gpon_dti_agent_CFLAGS) $(CFLAGS) -MT gpon_dti_agent-dti_agent_optic.obj -MD -MP -MF $(DEPDIR)/gpon_dti_agent-dti_agent_optic.Tpo -c -o gpon_dti_agent-dti_agent_optic.obj `if test -f 'dti_agent_optic.c'; then $(CYGPATH_W) 'dti_agent_optic.c'; else $(CYGPATH_W) '$(srcdir)/dti_agent_optic.c'; fi` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/gpon_dti_agent-dti_agent_optic.Tpo $(DEPDIR)/gpon_dti_agent-dti_agent_optic.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='dti_agent_optic.c' object='gpon_dti_agent-dti_agent_optic.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gpon_dti_agent_CFLAGS) $(CFLAGS) -c -o gpon_dti_agent-dti_agent_optic.obj `if test -f 'dti_agent_optic.c'; then $(CYGPATH_W) 'dti_agent_optic.c'; else $(CYGPATH_W) '$(srcdir)/dti_agent_optic.c'; fi` + +gpon_dti_agent-dti_agent_ocal.o: dti_agent_ocal.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gpon_dti_agent_CFLAGS) $(CFLAGS) -MT gpon_dti_agent-dti_agent_ocal.o -MD -MP -MF $(DEPDIR)/gpon_dti_agent-dti_agent_ocal.Tpo -c -o gpon_dti_agent-dti_agent_ocal.o `test -f 'dti_agent_ocal.c' || echo '$(srcdir)/'`dti_agent_ocal.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/gpon_dti_agent-dti_agent_ocal.Tpo $(DEPDIR)/gpon_dti_agent-dti_agent_ocal.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='dti_agent_ocal.c' object='gpon_dti_agent-dti_agent_ocal.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gpon_dti_agent_CFLAGS) $(CFLAGS) -c -o gpon_dti_agent-dti_agent_ocal.o `test -f 'dti_agent_ocal.c' || echo '$(srcdir)/'`dti_agent_ocal.c + +gpon_dti_agent-dti_agent_ocal.obj: dti_agent_ocal.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gpon_dti_agent_CFLAGS) $(CFLAGS) -MT gpon_dti_agent-dti_agent_ocal.obj -MD -MP -MF $(DEPDIR)/gpon_dti_agent-dti_agent_ocal.Tpo -c -o gpon_dti_agent-dti_agent_ocal.obj `if test -f 'dti_agent_ocal.c'; then $(CYGPATH_W) 'dti_agent_ocal.c'; else $(CYGPATH_W) '$(srcdir)/dti_agent_ocal.c'; fi` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/gpon_dti_agent-dti_agent_ocal.Tpo $(DEPDIR)/gpon_dti_agent-dti_agent_ocal.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='dti_agent_ocal.c' object='gpon_dti_agent-dti_agent_ocal.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gpon_dti_agent_CFLAGS) $(CFLAGS) -c -o gpon_dti_agent-dti_agent_ocal.obj `if test -f 'dti_agent_ocal.c'; then $(CYGPATH_W) 'dti_agent_ocal.c'; else $(CYGPATH_W) '$(srcdir)/dti_agent_ocal.c'; fi` + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) dti_agent_config.h.in $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + set x; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) dti_agent_config.h.in $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) dti_agent_config.h.in $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + list='$(SOURCES) $(HEADERS) dti_agent_config.h.in $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(PROGRAMS) dti_agent_config.h +installdirs: + for dir in "$(DESTDIR)$(bindir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-binPROGRAMS clean-generic mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-hdr distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: install-binPROGRAMS + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-binPROGRAMS + +.MAKE: all 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-hdr distclean-tags distdir dvi \ + dvi-am html html-am info info-am install install-am \ + install-binPROGRAMS install-data install-data-am install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am install-man \ + install-pdf install-pdf-am install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-compile mostlyclean-generic pdf pdf-am ps ps-am \ + tags uninstall uninstall-am uninstall-binPROGRAMS + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/src/dti_agent_cli.c b/src/dti_agent_cli.c new file mode 100644 index 0000000..6d8e1bd --- /dev/null +++ b/src/dti_agent_cli.c @@ -0,0 +1,64 @@ +/****************************************************************************** + + Copyright (c) 2010 + Lantiq Deutschland GmbH + Am Campeon 3; 85579 Neubiberg, Germany + + For licensing information, see the file 'LICENSE' in the root folder of + this software module. + +******************************************************************************/ + +#include "dti_osmap.h" +#include "dti_agent_cli.h" + +/** + This function registers a corresponding send function within the DTI. + The function is used to send incoming command strings to the caller + command line interface (CLI). + The send function must have the format of \ref DTI_CliSendCommandFunc_t + +\param + pDtiAgentContext - points to the DTI Agent context. +\param + dev_name - GPON Optic device base name +\param + cli_if_name - CLI name, via this name the CLI will be identified from + the remote client. +\param + send_fct - function pointer to the send function to send a command + on this CLI. + Provide a NULL pointer to reserve the CLI interface and + to get a interface number (for example, only to register + an event call back). +\param + resp_buf_sz - the buffer size required by the callback function. + +\return + In case of success, the CLI interface is marked as reserved and the + interface number is returned (>= 0) + In case of error IFX_ERROR will be return. + +\remarks + The last available interface is the default loop back interface. +*/ +IFX_int_t dti_cli_add(DTI_AgentCtx_t *agent_ctx, + const IFX_char_t *dev_name, + const IFX_char_t *cli_if_name, + DTI_CliSendCommandFunc_t send_fct, + IFX_uint_t resp_buf_sz) +{ + struct dti_cli_ctx *cli_ctx = DTI_Malloc(sizeof(struct dti_cli_ctx)); + + (void)DTI_snprintf(cli_ctx->dev_name, DTI_MAX_LEN_DEVICE_INTERFACE_NAME, + "%s", dev_name); + + cli_ctx->dev_fd = -1; + + cli_ctx->cli_interface = DTI_CLI_SendFunctionRegister(agent_ctx, + cli_ctx, + cli_if_name, + send_fct, + resp_buf_sz); + return IFX_SUCCESS; +} diff --git a/src/dti_agent_cli.h b/src/dti_agent_cli.h new file mode 100644 index 0000000..89889c0 --- /dev/null +++ b/src/dti_agent_cli.h @@ -0,0 +1,96 @@ +#ifndef _DTI_AGENT_CLI_H +#define _DTI_AGENT_CLI_H +/****************************************************************************** + + Copyright (c) 2011 + Lantiq Deutschland GmbH + Am Campeon 3; 85579 Neubiberg, Germany + + For licensing information, see the file 'LICENSE' in the root folder of + this software module. + +******************************************************************************/ + +/** \file + Debug and Trace Interface - Command Line Interface (CLI) definitions and + declarations. +*/ + +#ifdef __cplusplus +extern "C" { +#endif + +/* ============================================================================ + Includes + ========================================================================= */ +#include "ifx_types.h" +#include "dti_device.h" +#include "dti_agent_interface.h" +#include "dti_cli_interface.h" + +/* ============================================================================ + Defines + ========================================================================= */ + +/* ============================================================================ + Typedefs + ========================================================================= */ + +/** + CLI Ctx handle +*/ +struct dti_cli_ctx { + /** keeps the name of the given device name */ + IFX_char_t dev_name[DTI_MAX_LEN_DEVICE_INTERFACE_NAME]; + + /** devices fd sending CLI-IOCTL */ + IFX_int_t dev_fd; + + /** CLI interface index */ + IFX_int_t cli_interface; +}; + +/* ============================================================================ + Exports + ========================================================================= */ + +/** + This function registers a corresponding send function within the DTI. + The function is used to send incoming command strings to the caller + command line interface (CLI). + The send function must have the format of \ref DTI_CliSendCommandFunc_t + +\param + pDtiAgentContext - points to the DTI Agent context. +\param + dev_name - GPON Optic device base name +\param + cli_if_name - CLI name, via this name the CLI will be identified from + the remote client. +\param + send_fct - function pointer to the send function to send a command + on this CLI. + Provide a NULL pointer to reserve the CLI interface and + to get a interface number (for example, only to register + an event call back). +\param + resp_buf_sz - the buffer size required by the callback function. + +\return + In case of success, the CLI interface is marked as reserved and the + interface number is returned (>= 0) + In case of error IFX_ERROR will be return. + +\remarks + The last available interface is the default loop back interface. +*/ +extern IFX_int_t dti_cli_add(DTI_AgentCtx_t * agent_ctx, + const IFX_char_t *dev_name, + const IFX_char_t *cli_if_name, + DTI_CliSendCommandFunc_t send_fct, + IFX_uint_t resp_buf_sz); + +#ifdef __cplusplus +} +#endif +#endif /* #ifndef _DTI_AGENT_CLI_H */ diff --git a/src/dti_agent_config.h.in b/src/dti_agent_config.h.in new file mode 100644 index 0000000..ee91da2 --- /dev/null +++ b/src/dti_agent_config.h.in @@ -0,0 +1,45 @@ +/* src/dti_agent_config.h.in. Generated from configure.in by autoheader. */ + + +#ifndef _dti_agent_config_h +#define _dti_agent_config_h + +/** \defgroup GPON_DTI_AGENT_CONFIG Optical Network Unit - GPON DTI Agent Configuration + @{ +*/ + + + +/* Define to 1 if your C compiler doesn't accept -c and -o together. */ +#undef NO_MINUS_C_MINUS_O + +/* Name of package */ +#undef PACKAGE + +/* Define to the address where bug reports for this package should be sent. */ +#undef PACKAGE_BUGREPORT + +/* Define to the full name of this package. */ +#undef PACKAGE_NAME + +/* Define to the full name and version of this package. */ +#undef PACKAGE_STRING + +/* Define to the one symbol short name of this package. */ +#undef PACKAGE_TARNAME + +/* Define to the home page for this package. */ +#undef PACKAGE_URL + +/* Define to the version of this package. */ +#undef PACKAGE_VERSION + +/* Version number of package */ +#undef VERSION + + +/** @} */ + +#endif + + diff --git a/src/dti_agent_main.c b/src/dti_agent_main.c new file mode 100644 index 0000000..75ad618 --- /dev/null +++ b/src/dti_agent_main.c @@ -0,0 +1,887 @@ +/****************************************************************************** + + Copyright (c) 2011 + Lantiq Deutschland GmbH + Am Campeon 3; 85579 Neubiberg, Germany + + For licensing information, see the file 'LICENSE' in the root folder of + this software module. + +******************************************************************************/ + +#include "dti_osmap.h" +#include "dti_connection_interface.h" +#include "dti_agent_interface.h" +#include "dti_agent_main.h" +#include "dti_agent_cli.h" + +#if defined(LINUX) +# include +# define DTI_GETOPT_DUMMY NULL +#else +# include "ifx_getopt.h" +# define DTI_GETOPT_DUMMY 0 +#endif + +#include "ifx_getopt_ext.h" + +#if defined(DEVICE_GPON_ONU) +# include "dti_agent_onu.h" +# include "dti_agent_onu_ctx.h" +# include "drv_onu_interface.h" +#endif + +#if defined(DEVICE_GPON_OPTIC) +# include "dti_agent_optic.h" +# include "dti_agent_optic_ctx.h" +# include "drv_optic_interface.h" +#endif + +/* ========================================================================== + Defines and types + ========================================================================== */ + +#ifdef DTI_STATIC +#undef DTI_STATIC +#endif + +#ifdef DTI_DEBUG +#define DTI_STATIC +#else +#define DTI_STATIC static +#endif + +/* for testing, scan for input to terminate */ +#define DTI_TEST_MODE 1 + +/* + Local arguments +*/ +struct dti_op_arguments { + GetOptExt_IntArg_t help; /* h */ + GetOptExt_IntArg_t dbg_level_device; /* v */ + GetOptExt_IntArg_t num_of_worker; /* w */ + GetOptExt_IntArg_t run_in_forground; /* f */ + GetOptExt_IntArg_t lines_per_device; /* l */ + GetOptExt_IntArg_t devices; /* d */ + GetOptExt_IntArg_t dti_port; /* p */ + GetOptExt_IntArg_t dev_auto_msg; /* D */ + GetOptExt_IntArg_t cli_auto_msg; /* C */ +}; + +#if defined(DEVICE_GPON_ONU) +extern DTI_DeviceAccessFct_t dti_dev_access_fct_gpon_onu; +#endif + +#if defined(DEVICE_GPON_OPTIC) +extern DTI_DeviceAccessFct_t dti_dev_access_fct_gpon_optic; +#endif + +#if defined(DEVICE_GPON_OCAL) +extern DTI_DeviceAccessFct_t dti_dev_access_fct_gpon_ocal; +#endif + +#if defined(DEVICE_GENERIC) +extern DTI_DeviceAccessFct_t DTI_DeviceAccessFct_GENERIC; +#endif + +/* ============================================================================ + Local defines + ========================================================================= */ + +/* ========================================================================== + Local Function Declaration + ========================================================================== */ +DTI_STATIC IFX_void_t dti_agent_do_help(void); + +DTI_STATIC IFX_int_t dti_agent(DTI_AgentCtx_t **dti_agent_ctx_out); + +/* ========================================================================== + Local Variables + ========================================================================== */ + +DTI_STATIC struct option dti_long_options[] = { +/* 0 */ {"Help", no_argument, DTI_GETOPT_DUMMY, 'h'}, +/* 1 */ {"dev_dbg", required_argument, DTI_GETOPT_DUMMY, 'v'}, +/* 2 */ {"num_wkr", required_argument, DTI_GETOPT_DUMMY, 'w'}, +/* 3 */ {"fground", no_argument, DTI_GETOPT_DUMMY, 'f'}, +/* 4 */ {"Lines", required_argument, DTI_GETOPT_DUMMY, 'l'}, +/* 5 */ {"Devices", required_argument, DTI_GETOPT_DUMMY, 'd'}, +/* 6 */ {"Port", required_argument, DTI_GETOPT_DUMMY, 'p'}, +/* 7 */ {"DevAuto", required_argument, DTI_GETOPT_DUMMY, 'D'}, +/* 8 */ {"CliAuto", required_argument, DTI_GETOPT_DUMMY, 'C'}, +/* */ {"ip_Addr", required_argument, DTI_GETOPT_DUMMY, 'a'}, + {NULL, 0, DTI_GETOPT_DUMMY, 0} +}; + +/* + 01 2 34 5 */ +#define DTI_GETOPT_LONG_OPTSTRING "hv:w:fl:d:p:D:C:a:" + +DTI_STATIC const char *DTI_description[] = { +/* 0 */ "help screen", +/* 1 */ "debug level device -v ", +/* 2 */ "num of worker thr -w ", +/* 3 */ "run in forground -f ", +/* 4 */ "lines per device -l ", +/* 5 */ "devices -d ", +/* 6 */ "server port -p ", +/* 7 */ "device AutoMsg -D 1", +/* 8 */ "CLI AutoMsg -C 1", +/* */ "server IP address -a ", + IFX_NULL +}; + +/** getOpt option argument list */ +DTI_STATIC struct dti_op_arguments dti_op_args; +/* + { {0, IFX_FALSE} }; +*/ + +/** getOpt string argument list */ +DTI_STATIC GetOptExt_StrArg_t dti_str_params[GET_OPT_EXT_MAX_STR_PARAMS] = + { {"\0", IFX_FALSE} }; + +#if defined(DTI_LIBRARY) + +/** max argument string len */ +#define DTI_OPTIONS_MAX_LEN 255 +/** max number of arguments */ +#define DTI_OPTIONS_MAX_NUM 32 + +/** keep a copy of the original argument string, each argument will be + terminated */ +DTI_STATIC IFX_char_t dti_control_arg_str[DTI_OPTIONS_MAX_LEN]; +/** pointer array to point to the single arguments within the arg-string */ +DTI_STATIC IFX_char_t *dti_control_options[DTI_OPTIONS_MAX_NUM] = { IFX_NULL }; + +#endif + +/* ========================================================================== + Global Variables + ========================================================================== */ +IFX_int_t dti_main_run = 0; + +/* ========================================================================== + Local Function Definitons + ========================================================================== */ + +/** + Printout the "Help Info" for the available arguments. +*/ +DTI_STATIC IFX_void_t dti_agent_do_help(void) +{ + struct option *ptr; + const char **desc = &DTI_description[0]; + ptr = dti_long_options; + + DTI_Printf("%s" DTI_CRLF, DTI_AGENT_WHAT_STR); + DTI_Printf("usage: dti agent [options]" DTI_CRLF); + DTI_Printf("following options defined:" DTI_CRLF); + + while (ptr->name) { + DTI_Printf(" --%s \t(-%c) - %s" DTI_CRLF, ptr->name, ptr->val, + *desc); + + ptr++; + desc++; + } + + DTI_Printf(DTI_CRLF); + + return; +} + +/* + Start the DTI agent with the given startup parameters +*/ +DTI_STATIC IFX_int_t dti_agent(DTI_AgentCtx_t **dti_agent_ctx_out) +{ + IFX_int_t dev_if_num = 0, num_of_devices = 0, lines_per_device = + 0, auto_dev_msg = 0; + DTI_AgentCtx_t *dti_agent_ctx; + DTI_AgentStartupSettingsXDevs_t agent_atartup_settings_xdevs; + DTI_DeviceAccessFct_t *dev_access_fct = IFX_NULL; + + DTI_MemSet(&agent_atartup_settings_xdevs, 0x00, + sizeof(DTI_AgentStartupSettingsXDevs_t)); + + agent_atartup_settings_xdevs.debugLevel = + (dti_op_args.dbg_level_device.bSet == + IFX_TRUE) ? dti_op_args.dbg_level_device.intValue : 4; + + agent_atartup_settings_xdevs.numOfUsedWorker = + (dti_op_args.num_of_worker.bSet == + IFX_TRUE) ? dti_op_args.num_of_worker.intValue : 0; + + agent_atartup_settings_xdevs.bStartupAutoCliMsgSupport = + (dti_op_args.cli_auto_msg.bSet == + IFX_TRUE) ? dti_op_args.cli_auto_msg.intValue : 0; + + agent_atartup_settings_xdevs.listenPort = (IFX_uint16_t) + ((dti_op_args.dti_port.bSet == + IFX_TRUE) ? dti_op_args.dti_port.intValue : 0); + + if (dti_str_params[0].bSet == IFX_TRUE) { + DTI_MemCpy(agent_atartup_settings_xdevs.serverIpAddr, + dti_str_params[0].strValue, 16); + agent_atartup_settings_xdevs.serverIpAddr[15] = '\0'; + } + + num_of_devices = + (dti_op_args.devices.bSet == + IFX_TRUE) ? dti_op_args.devices.intValue : 0; + lines_per_device = + (dti_op_args.lines_per_device.bSet == + IFX_TRUE) ? dti_op_args.lines_per_device.intValue : 0; + auto_dev_msg = + (dti_op_args.dev_auto_msg.bSet == + IFX_TRUE) ? dti_op_args.dev_auto_msg.intValue : 0; + +#if STARTUP_WITH_REGISTERED_DEVICE +#if defined(DEVICE_GPON_ONU) + if (dev_if_num < DTI_MAX_DEVICE_INTERFACES) { + dev_access_fct = &dti_dev_access_fct_gpon_onu; + if ( /*(dev_if_num > 0) && */ (dev_access_fct != IFX_NULL)) { + /* workaround (for testing multiple devices) + this is not the first device, use default values for + setup */ + num_of_devices = 1; + lines_per_device = 1; + auto_dev_msg = 1; + } + + if ((dev_access_fct != IFX_NULL) && + (num_of_devices > 0) && (lines_per_device > 0)) { + DTI_Printf("Device[%d]: Add GPON ONU - devs = %d " + "lines per devs = %d\n", + dev_if_num, num_of_devices, + lines_per_device); + + agent_atartup_settings_xdevs.devIfSettings[dev_if_num]. + numOfDevices = num_of_devices; + agent_atartup_settings_xdevs.devIfSettings[dev_if_num]. + linesPerDevice = lines_per_device; + agent_atartup_settings_xdevs.devIfSettings[dev_if_num]. + pDeviceAccessFct = dev_access_fct; + agent_atartup_settings_xdevs.devIfSettings[dev_if_num]. + bStartupAutoDevMsgSupport = auto_dev_msg; + + dev_if_num++; + } + dev_access_fct = IFX_NULL; + } +#endif + +#if defined(DEVICE_GPON_OPTIC) + if (dev_if_num < DTI_MAX_DEVICE_INTERFACES) { + dev_access_fct = &dti_dev_access_fct_gpon_optic; + if ( /*(dev_if_num > 0) && */ (dev_access_fct != IFX_NULL)) { + /* workaround (for testing multiple devices) + this is not the first device, use default values for + setup */ + num_of_devices = 1; + lines_per_device = 1; + auto_dev_msg = 1; + } + + if ((dev_access_fct != IFX_NULL) && + (num_of_devices > 0) && (lines_per_device > 0)) { + DTI_Printf + ("Device[%d]: Add GPON OPTIC - devs = %d " + "lines per devs = %d\n", dev_if_num, + num_of_devices, + lines_per_device); + + agent_atartup_settings_xdevs.devIfSettings[dev_if_num]. + numOfDevices = num_of_devices; + agent_atartup_settings_xdevs.devIfSettings[dev_if_num]. + linesPerDevice = lines_per_device; + agent_atartup_settings_xdevs.devIfSettings[dev_if_num]. + pDeviceAccessFct = dev_access_fct; + agent_atartup_settings_xdevs.devIfSettings[dev_if_num]. + bStartupAutoDevMsgSupport = auto_dev_msg; + + dev_if_num++; + + } + dev_access_fct = IFX_NULL; + } +#endif + +#if defined(DEVICE_GPON_OCAL) + if (dev_if_num < DTI_MAX_DEVICE_INTERFACES) { + dev_access_fct = &dti_dev_access_fct_gpon_ocal; + if ( /*(dev_if_num > 0) && */ (dev_access_fct != IFX_NULL)) { + /* workaround (for testing multiple devices) + this is not the first device, use default values for + setup */ + num_of_devices = 1; + lines_per_device = 1; + auto_dev_msg = 1; + } + + if ((dev_access_fct != IFX_NULL) && + (num_of_devices > 0) && (lines_per_device > 0)) { + DTI_Printf + ("Device[%d]: Add GPON OCAL - devs = %d " + "lines per devs = %d\n", dev_if_num, + num_of_devices, + lines_per_device); + + agent_atartup_settings_xdevs.devIfSettings[dev_if_num]. + numOfDevices = num_of_devices; + agent_atartup_settings_xdevs.devIfSettings[dev_if_num]. + linesPerDevice = lines_per_device; + agent_atartup_settings_xdevs.devIfSettings[dev_if_num]. + pDeviceAccessFct = dev_access_fct; + agent_atartup_settings_xdevs.devIfSettings[dev_if_num]. + bStartupAutoDevMsgSupport = auto_dev_msg; + + dev_if_num++; + + } + dev_access_fct = IFX_NULL; + } +#endif + +#if defined(DEVICE_GENERIC) + if (dev_if_num < DTI_MAX_DEVICE_INTERFACES) { + dev_access_fct = &DTI_DeviceAccessFct_GENERIC; + if ((dev_if_num > 0) && (dev_access_fct != IFX_NULL)) { + /* workaround (for testing multiple devices) + this is not the first device, use default values for + setup */ + num_of_devices = 1; + lines_per_device = 1; + auto_dev_msg = 0; + } + + if ((dev_access_fct != IFX_NULL) && + (num_of_devices > 0) && (lines_per_device > 0)) { + DTI_Printf + ("Device[%d]: Add GENERIC - devs = %d " + "lines per devs = %d\n", dev_if_num, + num_of_devices, + lines_per_device); + + agent_atartup_settings_xdevs.devIfSettings[dev_if_num]. + numOfDevices = num_of_devices; + agent_atartup_settings_xdevs.devIfSettings[dev_if_num]. + linesPerDevice = lines_per_device; + agent_atartup_settings_xdevs.devIfSettings[dev_if_num]. + pDeviceAccessFct = dev_access_fct; + agent_atartup_settings_xdevs.devIfSettings[dev_if_num]. + bStartupAutoDevMsgSupport = auto_dev_msg; + + dev_if_num++; + } + dev_access_fct = IFX_NULL; + } +#endif +#endif + + agent_atartup_settings_xdevs.numOfUsedDevIf = dev_if_num; + + if (dti_op_args.dbg_level_device.bSet == IFX_TRUE) + DTI_DebugLevelSet((IFX_uint32_t) agent_atartup_settings_xdevs. + debugLevel); + + if (DTI_AgentStartXDevs(&dti_agent_ctx, + &agent_atartup_settings_xdevs) == IFX_SUCCESS) { +#if STARTUP_WITH_REGISTERED_DEVICE +#if defined(DEVICE_GPON_ONU) + if (dti_cli_add(dti_agent_ctx, DRV_IO_GPON_ONU, "ONU", + dti_onu_cli_send, 0x10000) == IFX_SUCCESS) { + DTI_Printf("CLI interface for GPON ONU activated\n"); + } +#endif + +#if defined(DEVICE_GPON_OPTIC) + if (dti_cli_add(dti_agent_ctx, DRV_IO_GPON_OPTIC, "OPTIC", + dti_optic_cli_send, 0x10000) == IFX_SUCCESS) + { + DTI_Printf("CLI interface for GPON Optic activated\n"); + } +#endif +#endif + + DTI_Printf("Agent started, press any key and Enter to exit\n"); + + dti_main_run = 1; + *dti_agent_ctx_out = dti_agent_ctx; + + return IFX_SUCCESS; + } + + dti_main_run = 0; + + return IFX_ERROR; +} + +/* ========================================================================== + Global Part + ========================================================================== */ + +#if (IFXOS_BYTE_ORDER == IFXOS_LITTLE_ENDIAN) +extern IFX_uint32_t DTI_IoctlDataSwap(IFX_uint32_t cmd, IFX_void_t *pData); + +/** Swap packet payload + + \param[in,out] data32 Packet payload + \param[in] size Size of packet payload in 4 byte units (Size / 4) +*/ +IFX_void_t dti_packet_payload_swap(IFX_uint32_t *data32, IFX_uint_t size) +{ + IFX_uint_t i; + + for (i = 0; i < size; i++) { + data32[i] = + ((((IFX_uint32_t) (data32[i]) & 0xff000000) >> 24) | + (((IFX_uint32_t) (data32[i]) & 0x00ff0000) >> 8) | + (((IFX_uint32_t) (data32[i]) & 0x0000ff00) << 8) | + (((IFX_uint32_t) (data32[i]) & 0x000000ff) << 24)); + } +} +#endif + +/** + Parse the given argument array into the option control struct. +*/ +IFX_void_t dti_agent_opt_arg_parse(IFX_int_t argc, IFX_char_t *argv[]) +{ + int parm_no = 0; + + /* + For library call + If the getopt is used while normal operation, the static and global + variables have to be reset before each parse. */ + DTI_MemSet(&dti_op_args, 0x00, sizeof(struct dti_op_arguments)); + DTI_MemSet(dti_str_params, 0x00, sizeof(dti_str_params)); + optind = 0; + + while (1) { + int option_index = optind ? optind : 1; + int c; + + /* 1 colon means there is a required parameter */ + /* 2 colons means there is an optional parameter */ + c = getopt_long(argc, argv, DTI_GETOPT_LONG_OPTSTRING, + dti_long_options, &option_index); + + if (c == -1) { + if (parm_no == 0) { + dti_op_args.help.bSet = IFX_TRUE; + dti_op_args.help.intValue = 1; + } + break; + } + + parm_no++; + + switch (c) { + case 'h': + dti_op_args.help.intValue = 1; + dti_op_args.help.bSet = IFX_TRUE; + break; + case 'v': + GetOptExt_RequiredDigit(optarg, + &dti_op_args.dbg_level_device, + "dbg device"); + break; + case 'w': + GetOptExt_RequiredDigit(optarg, + &dti_op_args.num_of_worker, + "num of worker"); + break; + case 'f': + dti_op_args.run_in_forground.intValue = 1; + dti_op_args.run_in_forground.bSet = IFX_TRUE; + break; + + case 'l': + GetOptExt_RequiredDigit(optarg, + &dti_op_args.lines_per_device, + "lines"); + break; + case 'd': + GetOptExt_RequiredDigit(optarg, + &dti_op_args.devices, + "devices"); + break; + case 'p': + GetOptExt_RequiredDigit(optarg, + &dti_op_args.dti_port, + "port"); + break; + + case 'D': + GetOptExt_RequiredDigit(optarg, + &dti_op_args.dev_auto_msg, + "DevAuto"); + + break; + case 'C': + GetOptExt_RequiredDigit(optarg, + &dti_op_args.cli_auto_msg, + "CliAuto"); + break; + + case 'a': + GetOptExt_RequiredStr(optarg, &dti_str_params[0], + "IP Addr"); + break; + default: + break; + } /* switch(c) {...} */ + } /* while(1) {...} */ + + if (optind < (argc - 1)) { + DTI_Printf("Sorry, there are unrecognized options: "); + while (optind < argc) + DTI_Printf("%s ", argv[optind++]); + + DTI_Printf("\n"); + } +} + +/* + Check if only the help is requested +*/ +IFX_int_t dti_agent_parse_help(void) +{ + if (dti_op_args.help.bSet == 1) { + dti_agent_do_help(); + + return IFX_ERROR; + } + + return IFX_SUCCESS; +} + +#if defined(DTI_LIBRARY) + +DTI_AgentCtx_t *global_dti_agent_ctx = IFX_NULL; + +IFX_int_t dti_agent_libmain(const IFX_char_t *arg_string) +{ + IFX_int_t ret_val = IFX_SUCCESS, arg_cnt = 0; + DTI_AgentCtx_t *dti_agent_ctx; + + if (!arg_string) { + dti_agent_do_help(); + + return IFX_SUCCESS; + } + + DTI_MemSet(dti_control_options, 0x00, sizeof(dti_control_options)); + DTI_MemSet(dti_control_arg_str, 0x00, sizeof(dti_control_arg_str)); + + DTI_snprintf(dti_control_arg_str, DTI_OPTIONS_MAX_LEN, "dti %s", + arg_string); + + arg_cnt = GetOptExt_ParseArgString(dti_control_arg_str, + dti_control_options, + DTI_OPTIONS_MAX_NUM); + + if (arg_cnt <= 0) { + DTI_Printf("Error: DTI Lib - get options <%s>\n", arg_string); + + return IFX_ERROR; + } + + dti_agent_opt_arg_parse(arg_cnt, dti_control_options); + if (dti_agent_parse_help() != IFX_SUCCESS) + return IFX_ERROR; + + if ((ret_val = dti_agent(&dti_agent_ctx)) == IFX_SUCCESS) { + global_dti_agent_ctx = dti_agent_ctx; + + while (dti_main_run == 1) + DTI_SecSleep(1); + + DTI_AgentStop(&dti_agent_ctx); + } + + return ret_val; +} +#endif /* #if defined(DTI_LIBRARY) */ + +#if !defined(DTI_LIBRARY) +/* ========================================================================== + main part + ========================================================================== */ + +/* ========================================================================== + main part - local function declaration + ========================================================================== */ + +DTI_STATIC IFX_boolean_t dti_agent_key_get(IFX_char_t *in_key, + IFX_char_t *in_key_num); + +/* ========================================================================== + main part - variables + ========================================================================== */ + +static IFX_char_t dti_main_in_key = 'c'; +static IFX_char_t dti_main_in_key_num = '0'; + +/* ========================================================================== + main part - local function definiton + ========================================================================== */ + +/** + Check for for keypressed and terminate +*/ +DTI_STATIC IFX_boolean_t dti_agent_key_get(IFX_char_t *in_key, + IFX_char_t *in_key_num) +{ + IFX_int_t key = (IFX_int_t) 'c'; + + while (1) { + key = (char)DTI_GetChar(); + + if (DTI_IsAlNum(key)) + break; + } + + if (DTI_IsDigit(key)) { + if (in_key_num) + *in_key_num = (IFX_char_t) key; + } + + if (DTI_IsAlpha(key)) { + if (in_key) + *in_key = (IFX_char_t) key; + } + + if ((IFX_char_t) key == 'q') + return IFX_TRUE; + else + return IFX_FALSE; +} + +/* ========================================================================== + main + ========================================================================== */ + +int main(int argc, char *argv[]) +{ + IFX_int_t ret_val = IFX_SUCCESS; + DTI_AgentCtx_t *dti_agent_ctx; + + dti_agent_opt_arg_parse(argc, argv); + + if (dti_agent_parse_help() != IFX_SUCCESS) + return -1; + +#if defined(DEVICE_GPON_ONU) && defined (GPON_ONU_SIMULATION) + if (ifx_onu_init() != IFX_SUCCESS) + return -1; +#endif + +#if defined(DEVICE_GPON_OCAL) && defined (GPON_OPTIC_SIMULATION) + if (ifx_optic_init() != IFX_SUCCESS) + return -1; +#endif + + if (DTI_conInit() != IFX_SUCCESS) { + DTI_Printf("Error: DTI - Start Agent, Socket init\n"); + return -1; + } + + if ((ret_val = dti_agent(&dti_agent_ctx)) == IFX_SUCCESS) { + DTI_Printf("DTI - press for quit" DTI_CRLF); + + while (dti_main_run == 1) { + if (dti_op_args.run_in_forground.bSet == IFX_FALSE) { + DTI_SecSleep(1); + } else { + (void)dti_agent_key_get(&dti_main_in_key, + &dti_main_in_key_num); + + switch (dti_main_in_key) { + case 'l': + /* update debug level */ + { + IFX_uint8_t dbg_level = 0; + dbg_level = + (IFX_uint8_t) + (dti_main_in_key_num - '0'); + if ((dbg_level > 0) && + (dbg_level < 5)) { + DTI_Printf + ("DTI - change: " + "debug level %d" + DTI_CRLF, + dbg_level); + DTI_DebugLevelSet( + (IFX_uint32_t) + dbg_level); + } + } + break; + + case 'c': + /* continue */ + break; + +#if defined(DEVICE_GPON_OCAL) + case 'C': + { + /* add gpon ocal interface for + testing */ + DTI_DeviceIfSettings_t + dev_if_ocal; + + dev_if_ocal.numOfDevices = 1; + dev_if_ocal.linesPerDevice = 1; + dev_if_ocal. + bStartupAutoDevMsgSupport = + IFX_TRUE; + dev_if_ocal.pDeviceAccessFct = + &dti_dev_access_fct_gpon_ocal; + + DTI_Printf + ("DTI - Add GPON OCAL Device" + DTI_CRLF); + (void) + DTI_DeviceConfigAdd + (dti_agent_ctx, -1, + &dev_if_ocal); + } + break; +#endif + +#if defined(DEVICE_GPON_ONU) + case 'O': + { + /* add gpon onu interface for + testing */ + DTI_DeviceIfSettings_t + dev_if_onu; + + dev_if_onu.numOfDevices = 1; + dev_if_onu.linesPerDevice = 1; + dev_if_onu. + bStartupAutoDevMsgSupport = + IFX_TRUE; + dev_if_onu.pDeviceAccessFct = + &dti_dev_access_fct_gpon_onu; + + DTI_Printf + ("DTI - Add GPON ONU Device" + DTI_CRLF); + (void) + DTI_DeviceConfigAdd + (dti_agent_ctx, -1, + &dev_if_onu); + + (void)dti_cli_add(dti_agent_ctx, + DRV_IO_GPON_ONU, + "ONU", + dti_onu_cli_send, + 0x10000); + } + break; +#endif + +#if defined(DEVICE_GPON_OPTIC) + case 'o': + { + /* add gpon optic interface for + testing */ + DTI_DeviceIfSettings_t + dev_if_optic; + + dev_if_optic.numOfDevices = 1; + dev_if_optic. + linesPerDevice = 1; + dev_if_optic. + bStartupAutoDevMsgSupport = + IFX_TRUE; + dev_if_optic.pDeviceAccessFct = + &dti_dev_access_fct_gpon_optic; + + DTI_Printf + ("DTI - Add GPON Optic " + "Device" DTI_CRLF); + (void) + DTI_DeviceConfigAdd( + dti_agent_ctx, -1, + &dev_if_optic); + + (void)dti_cli_add(dti_agent_ctx, + DRV_IO_GPON_OPTIC, + "OPTIC", + dti_optic_cli_send, + 0x10000); + } + break; +#endif + +#if defined(DEVICE_GENERIC) + case 'g': + { + /* add generic interface for + testing */ + DTI_DeviceIfSettings_t + dev_if_generic; + + dev_if_generic. + numOfDevices = 1; + dev_if_generic. + linesPerDevice = 1; + dev_if_generic. + bStartupAutoDevMsgSupport = + IFX_FALSE; + dev_if_generic. + pDeviceAccessFct = + &DTI_DeviceAccessFct_GENERIC; + + DTI_Printf + ("DTI - Add Generic Device" + DTI_CRLF); + (void) + DTI_DeviceConfigAdd( + dti_agent_ctx, -1, + &dev_if_generic); + } + break; +#endif + + case 'b': + DTI_Printf + ("DTI - Switch to Background Mode" + DTI_CRLF); + dti_op_args.run_in_forground.bSet = + IFX_TRUE; + break; + + case 'q': + DTI_Printf("DTI - Stop Agent" DTI_CRLF); + dti_main_run = 0; + break; + + default: + break; + } + + } + } + + (void)DTI_AgentStop(&dti_agent_ctx); + } +#if defined(DEVICE_GPON_ONU) && defined (GPON_ONU_SIMULATION) + ifx_onu_exit(); +#endif +#if defined(DEVICE_GPON_OCAL) && defined (GPON_OPTIC_SIMULATION) + ifx_optic_exit(); +#endif + + (void)DTI_conCleanup(); + + return ret_val; +} + +#endif /* #if !defined(DTI_LIBRARY) */ diff --git a/src/dti_agent_main.h b/src/dti_agent_main.h new file mode 100644 index 0000000..2590cf7 --- /dev/null +++ b/src/dti_agent_main.h @@ -0,0 +1,51 @@ +#ifndef _DTI_CLI_H +#define _DTI_CLI_H +/****************************************************************************** + + Copyright (c) 2009 + Lantiq Deutschland GmbH + Am Campeon 3; 85579 Neubiberg, Germany + + For licensing information, see the file 'LICENSE' in the root folder of + this software module. + +******************************************************************************/ + +/** \file + Debug and Trace Interface - Command Line Interface (CLI) definitions and + declarations. +*/ + +#ifdef __cplusplus +extern "C" { +#endif + +/* ============================================================================ + Includes + ========================================================================= */ +#include "ifx_types.h" + +/* ============================================================================ + Defines + ========================================================================= */ + +/* ============================================================================ + Typedefs + ========================================================================= */ + +/* ============================================================================ + Exports + ========================================================================= */ + +extern IFX_void_t dti_packet_payload_swap(IFX_uint32_t *data32, + IFX_uint_t size); + +/** + DTI Agent - Standalone +*/ +extern IFX_int_t dti_agent_libmain(const IFX_char_t *arg_string); + +#ifdef __cplusplus +} +#endif +#endif /* #ifndef _DTI_CLI_H */ diff --git a/src/dti_agent_ocal.c b/src/dti_agent_ocal.c new file mode 100644 index 0000000..83acd5d --- /dev/null +++ b/src/dti_agent_ocal.c @@ -0,0 +1,1574 @@ +/****************************************************************************** + + Copyright (c) 2011 + Lantiq Deutschland GmbH + Am Campeon 3; 85579 Neubiberg, Germany + + For licensing information, see the file 'LICENSE' in the root folder of + this software module. + +******************************************************************************/ + +/** \file + Debug and Trace Interface - Basic Protocol Packet Handling. +*/ + +/* ============================================================================ + Includes + ========================================================================= */ +#include "dti_osmap.h" + +#if defined(DEVICE_GPON_OCAL) + +#include "ifx_dti_protocol.h" +#include "ifx_dti_protocol_device.h" +#include "ifx_dti_protocol_cli.h" + +#include "dti_device.h" +#include "dti_agent_optic.h" +#include "dti_agent_ocal.h" +#include "dti_agent_ocal_ctx.h" +#include "dti_agent_cli.h" + +#include "drv_optic_interface.h" + +#include "ocal_api.h" + +/* ============================================================================ + Defines + ========================================================================= */ + +#ifdef DTI_STATIC +# undef DTI_STATIC +#endif + +#ifdef DTI_DEBUG +# define DTI_STATIC +#else +# define DTI_STATIC static +#endif + +#ifndef _IOWR +# define _IOWR _IOW +#endif + +/* ============================================================================ + Local Function Declaration + ========================================================================= */ + +DTI_STATIC IFX_int_t dti_ocal_dev_open(IFX_char_t *dev_name); + +DTI_STATIC IFX_int_t dti_ocal_dev_close(IFX_int_t dev_fd); + +DTI_STATIC IFX_int_t dti_ocal_cntrl_port_open( + struct dti_dev_gpon_ocal_ctx *dti_ocal_ctx, + IFX_int_t dev_num, + DTI_PacketError_t *packet_err); + +DTI_STATIC IFX_int_t dti_ocal_cntrl_port_close( + struct dti_dev_gpon_ocal_ctx *dti_ocal_ctx, + IFX_int_t dev_num, + DTI_PacketError_t *packet_err); + +DTI_STATIC IFX_void_t dti_ocal_dev_fd_clear( + struct dti_dev_gpon_ocal_ctx *dti_ocal_ctx, + IFX_int_t dev_num); + +DTI_STATIC IFX_int_t dti_ocal_dev_cfg_get(DTI_DeviceSysInfo_t *sys_info); + +/* ============================================================================ + Device Access Functions + ========================================================================= */ +DTI_STATIC IFX_int_t dti_ocal_printout_level_set(IFX_int_t new_dbg_level); + +DTI_STATIC IFX_int_t dti_ocal_module_setup(DTI_DeviceSysInfo_t *dev_sys_info, + DTI_DeviceCtx_t **dti_dev_ctx_out); + +DTI_STATIC IFX_int_t dti_ocal_module_delete(DTI_DeviceSysInfo_t *dev_sys_info, + DTI_DeviceCtx_t **dti_dev_ctx_out); + +DTI_STATIC IFX_int_t dti_ocal_sys_info_write(DTI_DeviceSysInfo_t *dev_sys_info, + IFX_char_t *sys_info_buf, + IFX_int_t buffer_size); + +DTI_STATIC IFX_int_t dti_ocal_reset(DTI_DeviceCtx_t *dti_dev_ctx, + DTI_H2D_DeviceReset_t *in_dev_reset, + DTI_D2H_DeviceReset_t *out_dev_reset, + IFX_int_t rst_mask_size_32, + DTI_PacketError_t *packet_err); + +DTI_STATIC IFX_int_t dti_ocal_download(DTI_DeviceCtx_t *dti_dev_ctx, + DTI_ProtocolServerCtx_t *dti_prot_srv_ctx, + DTI_H2D_DeviceDownload_t *in_dev_dwnld, + DTI_D2H_DeviceDownload_t *out_dev_dwnld, + DTI_PacketError_t *packet_err); + +DTI_STATIC IFX_int_t dti_ocal_device_open(DTI_DeviceCtx_t *dti_dev_ctx, + IFX_int_t dev_num, + DTI_PacketError_t *packet_err); + +DTI_STATIC IFX_int_t dti_ocal_device_close(DTI_DeviceCtx_t *dti_dev_ctx, + IFX_int_t dev_num, + DTI_PacketError_t *packet_err); + +DTI_STATIC IFX_int_t dti_ocal_register_lock(DTI_DeviceCtx_t *dti_dev_ctx, + DTI_H2D_DeviceLock_t *in_lock, + DTI_D2H_DeviceLock_t *out_lock, + IFX_int_t dev_num, + DTI_PacketError_t *packet_err); + +DTI_STATIC IFX_int_t dti_ocal_register_get(DTI_DeviceCtx_t *dti_dev_ctx, + DTI_H2D_RegisterGet_t *in_reg_get, + DTI_D2H_RegisterGet_t *out_reg_get, + IFX_int_t dev_num, + IFX_uint32_t *out_payl_sz_byte, + DTI_PacketError_t *packet_err); + +DTI_STATIC IFX_int_t dti_ocal_register_set(DTI_DeviceCtx_t *dti_dev_ctx, + DTI_H2D_RegisterSet_t *in_reg_set, + IFX_int_t in_reg_set_sz_byte, + IFX_int_t dev_num, + DTI_PacketError_t *packet_err); + +DTI_STATIC IFX_int_t dti_ocal_cfg_set(DTI_DeviceCtx_t *dti_dev_ctx, + DTI_H2D_DeviceConfigSet_t *in_cfg_set, + DTI_D2H_DeviceConfigSet_t *out_cfg_set, + IFX_int_t dev_num, + DTI_PacketError_t *packet_err); + +DTI_STATIC IFX_int_t dti_ocal_cfg_get(DTI_DeviceCtx_t *dti_dev_ctx, + DTI_H2D_DeviceConfigGet_t *in_cfg_get, + DTI_D2H_DeviceConfigGet_t *out_cfg_get, + IFX_int_t dev_num, + DTI_PacketError_t *packet_err); + +DTI_STATIC IFX_int_t dti_ocal_msg8_send(DTI_DeviceCtx_t *dti_dev_ctx, + DTI_H2D_Message8_u *in_msg8_send, + DTI_D2H_Message8_u *out_msg8_send, + IFX_int_t dev_num, + IFX_int_t in_payl_sz_byte, + IFX_int_t *out_payl_sz_byte, + DTI_PacketError_t *packet_err); + +DTI_STATIC IFX_int_t dti_ocal_msg16_send(DTI_DeviceCtx_t *dti_dev_ctx, + DTI_H2D_Message16_u *in_msg16_send, + DTI_D2H_Message16_u *out_msg16_send, + IFX_int_t dev_num, + IFX_int_t in_payl_sz_byte, + IFX_int_t *out_payl_sz_byte, + DTI_PacketError_t *packet_err); + +DTI_STATIC IFX_int_t dti_ocal_msg32_send(DTI_DeviceCtx_t *dti_dev_ctx, + DTI_H2D_Message32_u *in_msg32_send, + DTI_D2H_Message32_u *out_msg32_send, + IFX_int_t dev_num, + IFX_int_t in_payl_sz_byte, + IFX_int_t *out_payl_sz_byte, + DTI_PacketError_t *packet_err); + +DTI_STATIC IFX_int_t dti_ocal_trace_buf_cfg_set(DTI_DeviceCtx_t *dti_dev_ctx, + DTI_H2D_TraceConfigSet_t + *in_trace_config_set, + DTI_D2H_TraceConfigSet_t + *out_trace_config_set, + IFX_int_t dev_num, + DTI_PacketError_t *packet_err); + +DTI_STATIC IFX_int_t dti_ocal_trace_buf_reset(DTI_DeviceCtx_t *dti_dev_ctx, + IFX_int_t dev_num, + DTI_PacketError_t *packet_err); + +DTI_STATIC IFX_int_t dti_ocal_trace_buf_status_get(DTI_DeviceCtx_t *dti_dev_ctx, + DTI_D2H_TraceStatusGet_t + *out_trace_status_get, + IFX_int_t dev_num, + DTI_PacketError_t + *packet_err); + +DTI_STATIC IFX_int_t dti_ocal_trace_buf_get(DTI_DeviceCtx_t *dti_dev_ctx, + DTI_H2D_TraceBufferGet_t + *in_trace_buf_get, + DTI_Packet_t **used_dti_packet_out, + IFX_int_t *used_buffer_out_size, + IFX_int_t dev_num, + IFX_int_t *tr_buf_read_sz_byte, + DTI_PacketError_t *packet_err); + +DTI_STATIC IFX_int_t dti_ocal_debug_read(DTI_DeviceCtx_t *dti_dev_ctx, + DTI_H2D_DebugRead_t *in_dbg_get, + DTI_D2H_DebugRead_t *out_dbg_get, + IFX_int_t dev_num, + IFX_int_t *dbg_read_count, + DTI_PacketError_t *packet_err); + +DTI_STATIC IFX_int_t dti_ocal_debug_write(DTI_DeviceCtx_t *dti_dev_ctx, + DTI_H2D_DebugWrite_t *in_dbg_set, + IFX_uint32_t *out_dbg_get_nu, + IFX_int_t dev_num, + IFX_int_t *dbg_write_count, + DTI_PacketError_t *packet_err); + +DTI_STATIC IFX_int_t dti_ocal_auto_msg_process(DTI_DeviceCtx_t *dti_dev_ctx, + const DTI_Connection_t *dti_con, + IFX_uint32_t dev_select_wait_ms, + IFX_char_t *out_buffer, + IFX_int_t out_buffer_sz_byte); + +DTI_STATIC IFX_int_t dti_ocal_win_easy_cli_access(DTI_DeviceCtx_t *dti_dev_ctx, + IFX_int_t dev_num, + const IFX_uint8_t *data_in, + const IFX_uint32_t size_in, + IFX_uint8_t *data_out, + const IFX_uint32_t size_out, + DTI_PacketError_t *packet_err); + +/* ============================================================================ + Variables + ========================================================================= */ + +/* Create device debug module - user part */ +IFXOS_PRN_USR_MODULE_CREATE(DTI_GPON_OCAL, DTI_PRN_LEVEL_HIGH); + +#if (DTI_DEVICE_INTERFACE_VERSION != 0x00010200) +#error "wrong DTI_DEVICE_INTERFACE_VERSION!" +#endif + +/** + Collection of all available device access functions. +*/ +DTI_DeviceAccessFct_t dti_dev_access_fct_gpon_ocal = { + sizeof(DTI_DeviceAccessFct_t), /* structure check */ + DTI_DEVICE_INTERFACE_VERSION, /* device interface version */ + DTI_DEV_GPON_OCAL_NAME, /* device name */ + + dti_ocal_printout_level_set, + dti_ocal_module_setup, + dti_ocal_module_delete, + dti_ocal_sys_info_write, + + dti_ocal_reset, + dti_ocal_download, + dti_ocal_device_open, + dti_ocal_device_close, + dti_ocal_register_lock, + dti_ocal_register_get, + dti_ocal_register_set, + dti_ocal_cfg_set, + dti_ocal_cfg_get, + dti_ocal_msg16_send, + dti_ocal_msg32_send, + dti_ocal_trace_buf_cfg_set, + dti_ocal_trace_buf_reset, + dti_ocal_trace_buf_status_get, + dti_ocal_trace_buf_get, + dti_ocal_debug_read, + dti_ocal_debug_write, + dti_ocal_auto_msg_process, + dti_ocal_win_easy_cli_access, + +#if (DTI_DEVICE_INTERFACE_VERSION > 0x00000100) + dti_ocal_msg8_send, +#endif +}; + +/* ============================================================================ + Local Function + ========================================================================= */ + +/** + Open a control device of the GPON Optic driver + +\param + dev_num - debug device number +\param + dev_name - GPON Optic device base name + +\return + if success, a valid device fd + else IFX_ERROR. +*/ +DTI_STATIC IFX_int_t dti_ocal_dev_open(IFX_char_t * dev_name) +{ + IFX_int_t dev_fd = -1, conn_num; + IFX_char_t buf[128]; + + for (conn_num = DTI_GPON_OPTIC_START_ID; + conn_num <= DTI_GPON_OPTIC_MAX_ID; conn_num++) { + /* /dev/gpon/ */ + (void)DTI_snprintf(buf, 128, "%s%d", dev_name, conn_num); + dev_fd = DTI_DeviceOpen(buf); + if (dev_fd < 0) { + DTI_PRN_USR_ERR_NL(DTI_GPON_OCAL, DTI_PRN_LEVEL_ERR, + ("WRN: GPON OCAL Dev:" + " Optic Dev Open - <%s> " + "can't open device."DTI_CRLF, buf)); + + /* /dev/gpon/ */ + (void)DTI_snprintf(buf, 128, "%s/%d", dev_name, + conn_num); + dev_fd = DTI_DeviceOpen(buf); + } + + if (dev_fd < 0) { + DTI_PRN_USR_ERR_NL(DTI_GPON_OCAL, DTI_PRN_LEVEL_ERR, + ("WRN: GPON OCAL Dev:" + " Optic Dev Open - <%s> " + "can't open device."DTI_CRLF, buf)); + } else { + DTI_PRN_USR_DBG_NL(DTI_GPON_OCAL, DTI_PRN_LEVEL_HIGH, + ("GPON OCAL Dev:" + " Optic Dev Open - <%s> found." + DTI_CRLF, buf)); + + break; + } + } + + if (dev_fd < 0) { + /* /dev/gpon */ + (void)DTI_snprintf(buf, 128, "%s", dev_name); + dev_fd = DTI_DeviceOpen(buf); + } + + if (dev_fd < 0) { + DTI_PRN_USR_ERR_NL(DTI_GPON_OCAL, DTI_PRN_LEVEL_ERR, + ("WRN: GPON OCAL Dev:" + " Optic Dev Open - <%s> can't " + "open device, giving up."DTI_CRLF, buf)); + + return IFX_ERROR; + } else { + DTI_PRN_USR_DBG_NL(DTI_GPON_OCAL, DTI_PRN_LEVEL_HIGH, + ("GPON OCAL Dev:" + " Optic Dev Open - <%s> found." + DTI_CRLF, buf)); + } + + return dev_fd; +} + +/** + Close a control device of the GPON Optic driver + +\param + dev_fd - a valid device fd + +\return + If success IFX_SUCCESS else IFX_ERROR. + +*/ +DTI_STATIC IFX_int_t dti_ocal_dev_close(IFX_int_t dev_fd) +{ + IFX_int_t ret_val = IFX_ERROR; + + if (dev_fd > 0) + ret_val = DTI_DeviceClose(dev_fd); + + return ret_val; +} + +/* + Check if a control port for the given line is already open, + if not open the control port. + +\param + dti_ocal_ctx - points to the GPON OCAL Device context. +\param + line_num - line number +\param + packet_err - returns the result + +*/ +DTI_STATIC IFX_int_t dti_ocal_cntrl_port_open(struct dti_dev_gpon_ocal_ctx + *dti_ocal_ctx, + IFX_int_t dev_num, + DTI_PacketError_t *packet_err) +{ + if (dti_ocal_ctx->p_optic_dev_fds[dev_num] < 0) { + dti_ocal_ctx->p_optic_dev_fds[dev_num] = + dti_ocal_dev_open(DRV_IO_GPON_OPTIC); + if (dti_ocal_ctx->p_optic_dev_fds[dev_num] < 0) { + *packet_err = DTI_eErrPortOpen; + + DTI_PRN_USR_ERR_NL(DTI_GPON_OCAL, DTI_PRN_LEVEL_ERR, + ("ERROR: GPON OCAL Dev:" + " Optic cntrl port open " + "- failed, dev_num = %d."DTI_CRLF, + dev_num)); + + return IFX_ERROR; + } + + /** \todo Check if it is required */ + /* add the new device to the FDSET struct */ + IFXOS_DevFdSet( + (IFX_uint32_t) dti_ocal_ctx->p_optic_dev_fds[dev_num], + &dti_ocal_ctx->recv_dev_fds); + + if ((dti_ocal_ctx->p_optic_dev_fds[dev_num] + 1) > + dti_ocal_ctx->recv_max_dev_fd) { + dti_ocal_ctx->recv_max_dev_fd = + dti_ocal_ctx->p_optic_dev_fds[dev_num] + 1; + } + } + + return IFX_SUCCESS; +} + +/* + Check if the corresponding debug control device for the given line is already + open, if yes close the debug control device. + +\param + dti_ocal_ctx - points to the GPON OCAL Device context. +\param + dev_num - line number +\param + packet_err - returns the result + +*/ +DTI_STATIC IFX_int_t dti_ocal_cntrl_port_close(struct dti_dev_gpon_ocal_ctx + *dti_ocal_ctx, + IFX_int_t dev_num, + DTI_PacketError_t *packet_err) +{ + if (dti_ocal_ctx->p_optic_dev_fds[dev_num] >= 0) { + /* remove this device form the FDSET struct */ + dti_ocal_dev_fd_clear(dti_ocal_ctx, dev_num); + + (void)dti_ocal_dev_close( + dti_ocal_ctx->p_optic_dev_fds[dev_num]); + dti_ocal_ctx->p_optic_dev_fds[dev_num] = -1; + } + + return IFX_SUCCESS; +} + +/** + Clear a device FD from the FD_SET and recalc new max FD. + +*/ +DTI_STATIC IFX_void_t dti_ocal_dev_fd_clear(struct dti_dev_gpon_ocal_ctx + *dti_ocal_ctx, + IFX_int_t dev_num) +{ +#if defined(IFXOS_HAVE_DEV_FD_CLEAR) + IFX_int_t i, max_dev_fd = 0; + + DTI_DevFdClear(dti_ocal_ctx->pDevFd[dev_num], + &dti_ocal_ctx->recv_dev_fds); + + for (i = 0; i < dti_ocal_ctx->num_of_devs; i++) { + if (dti_ocal_ctx->p_optic_dev_fds[i] >= 0) { + if ((DTI_DevFdIsSet(dti_ocal_ctx->p_optic_dev_fds[i], + &dti_ocal_ctx->recv_dev_fds)) && + (dti_ocal_ctx->p_optic_dev_fds[i] > max_dev_fd)} { + max_dev_fd = dti_ocal_ctx->p_optic_dev_fds[i]; + } + } + } + + dti_ocal_ctx->recv_max_dev_fd = max_dev_fd + 1; +#else + IFX_int_t i, max_dev_fd = 0; + + DTI_DevFdZero(&dti_ocal_ctx->tmp_dev_fds); + dti_ocal_ctx->recv_max_dev_fd = 0; + + for (i = 0; i < dti_ocal_ctx->num_of_optic_devs; i++) { + if ((dti_ocal_ctx->p_optic_dev_fds[i] >= 0) && (i != dev_num)) { + if (DTI_DevFdIsSet((IFX_uint32_t) dti_ocal_ctx-> + p_optic_dev_fds[i], + &dti_ocal_ctx->recv_dev_fds)) { + DTI_DevFdSet((IFX_uint32_t) dti_ocal_ctx-> + p_optic_dev_fds[i], + &dti_ocal_ctx->tmp_dev_fds); + + if (dti_ocal_ctx->p_optic_dev_fds[i] + > max_dev_fd) { + max_dev_fd = + dti_ocal_ctx-> + p_optic_dev_fds[i]; + } + } + } + } + + DTI_MemCpy(&dti_ocal_ctx->recv_dev_fds, &dti_ocal_ctx->tmp_dev_fds, + sizeof(IFXOS_devFd_set_t)); + dti_ocal_ctx->recv_max_dev_fd = (max_dev_fd) ? (max_dev_fd + 1) : 0; + + DTI_DevFdZero(&dti_ocal_ctx->tmp_dev_fds); + +#endif + return; +} + +/* + Request and return the device driver config. + +\param + sys_info - return DTI_DeviceSysInfo_t structure. +\param + pPortsPerDev - return ptr, ports per device. + +\return + IFX_SUCCESS if request was successful, else + IFX_ERROR +*/ +DTI_STATIC IFX_int_t dti_ocal_dev_cfg_get(DTI_DeviceSysInfo_t *sys_info) +{ + sys_info->bControlAutoDevMsgSupport = IFX_FALSE; + + sys_info->numOfDevs = 1; + sys_info->portsPerDev = 1; + sys_info->ifPerDev = 1; + + if ((sys_info->numOfDevs > 0) && (sys_info->portsPerDev > 0)) { + sys_info->numOfPorts = + sys_info->numOfDevs * sys_info->portsPerDev; + sys_info->bValid = IFX_TRUE; + } + + return IFX_SUCCESS; +} + +/* ============================================================================ + Device Access Functions + ========================================================================= */ + +/** + Set a new debug level. +*/ +DTI_STATIC IFX_int_t dti_ocal_printout_level_set(IFX_int_t new_dbg_level) +{ + + IFXOS_PRN_USR_LEVEL_SET(DTI_GPON_OCAL, new_dbg_level); + + return IFX_SUCCESS; +} + +/** + Setup GPON OCAL Module + +\param + dev_sys_info - points to the system infos +\param + dti_dev_ctx_out - pointer to return the allocated GPON OCAL Module struct. + +\return + If success IFX_SUCCESS, the context is returned via the dti_dev_ctx_out param + else IFX_ERROR. + +*/ +DTI_STATIC IFX_int_t dti_ocal_module_setup(DTI_DeviceSysInfo_t *dev_sys_info, + DTI_DeviceCtx_t **dti_dev_ctx_out) +{ + IFX_int_t i, ctxSize = 0; + DTI_DeviceCtx_t *dti_dev_ctx = IFX_NULL; + struct dti_dev_gpon_ocal_ctx *ocal_dev_ctx = IFX_NULL; + DTI_PTR_U u_dti_dev_ctx; + + if ((dti_dev_ctx_out == IFX_NULL) || (dev_sys_info == IFX_NULL)) { + DTI_PRN_USR_ERR_NL(DTI_GPON_OCAL, DTI_PRN_LEVEL_ERR, + ("ERROR: GPON OCAL Dev Module Setup - NULL " + "ptr args."DTI_CRLF)); + + return IFX_ERROR; + } + + if (*dti_dev_ctx_out != IFX_NULL) { + dti_dev_ctx = *dti_dev_ctx_out; + ocal_dev_ctx = (struct dti_dev_gpon_ocal_ctx *) + dti_dev_ctx->pDevice; + } + + if (dti_dev_ctx != IFX_NULL) { + DTI_PRN_USR_ERR_NL(DTI_GPON_OCAL, IFXOS_PRN_LEVEL_WRN, + ("WARNING: GPON OCAL Dev Module Setup - " + "already done ."DTI_CRLF)); + + return IFX_ERROR; + } + + if (dti_ocal_dev_cfg_get(dev_sys_info) != IFX_SUCCESS) { + DTI_PRN_USR_ERR_NL(DTI_GPON_OCAL, DTI_PRN_LEVEL_ERR, + ("Error: GPON OCAL Dev Module Setup - " + "driver config."DTI_CRLF)); + + return IFX_ERROR; + } + + DTI_PRN_USR_DBG_NL(DTI_GPON_OCAL, DTI_PRN_LEVEL_HIGH, + ("GPON OCAL Dev Module Setup - update driver config " + "(devs = %d, portsPerDev = %d)." + DTI_CRLF, dev_sys_info->numOfDevs, + dev_sys_info->portsPerDev)); + + ctxSize = sizeof(DTI_DeviceCtx_t) + + sizeof(struct dti_dev_gpon_ocal_ctx) + + (sizeof(IFX_int_t) * dev_sys_info->numOfDevs); + + ctxSize += + ((dev_sys_info->bControlAutoDevMsgSupport == + IFX_TRUE) ? (DTI_DEV_GPON_OCAL_DEFAULT_MBOX_SIZE) : 0); + + u_dti_dev_ctx.pUInt8 = DTI_Malloc((IFX_uint_t) ctxSize); + + if (u_dti_dev_ctx.pUInt8 == IFX_NULL) { + DTI_PRN_USR_ERR_NL(DTI_GPON_OCAL, DTI_PRN_LEVEL_ERR, + ("ERROR: GPON OCAL Dev Module Setup - " + "Dev Struct alloc."DTI_CRLF)); + + return IFX_ERROR; + } + DTI_MemSet(u_dti_dev_ctx.pUInt8, 0x0, ctxSize); + + /* set context pointer */ + dti_dev_ctx = (DTI_DeviceCtx_t *) DTI_PTR_CAST_GET_ULONG(u_dti_dev_ctx); + if (dti_dev_ctx == IFX_NULL) { + DTI_Free(u_dti_dev_ctx.pUInt8); + + DTI_PRN_USR_ERR_NL(DTI_GPON_OCAL, DTI_PRN_LEVEL_ERR, + ("ERROR: GPON OCAL Dev Module Setup - Dev " + "Struct miss-aligned."DTI_CRLF)); + + return IFX_ERROR; + } + + /* set pDevice pointer */ + u_dti_dev_ctx.pUInt8 += sizeof(DTI_DeviceCtx_t); + ocal_dev_ctx = (struct dti_dev_gpon_ocal_ctx *) + DTI_PTR_CAST_GET_UINT32( + u_dti_dev_ctx); + if (ocal_dev_ctx == IFX_NULL) { + DTI_Free(dti_dev_ctx); + + DTI_PRN_USR_ERR_NL(DTI_GPON_OCAL, DTI_PRN_LEVEL_ERR, + ("ERROR: GPON OCAL Dev Module Setup - " + "pDevice miss-aligned."DTI_CRLF)); + + return IFX_ERROR; + } + + /* set dev_fd pointer */ + u_dti_dev_ctx.pUInt8 += sizeof(struct dti_dev_gpon_ocal_ctx); + ocal_dev_ctx->p_optic_dev_fds = (IFX_int_t *) + DTI_PTR_CAST_GET_UINT32( + u_dti_dev_ctx); + + if (ocal_dev_ctx->p_optic_dev_fds == IFX_NULL) { + DTI_Free(dti_dev_ctx); + + DTI_PRN_USR_ERR_NL(DTI_GPON_OCAL, DTI_PRN_LEVEL_ERR, + ("ERROR: GPON OCAL Dev Module Setup" + " - devFds miss-aligned."DTI_CRLF)); + + return IFX_ERROR; + } + + /* set auto msg buffer pointer */ + if (dev_sys_info->bControlAutoDevMsgSupport == IFX_TRUE) { + u_dti_dev_ctx.pUInt8 += + (sizeof(IFX_int_t) * dev_sys_info->numOfDevs); + ocal_dev_ctx->recv_msg_buf = + (IFX_ulong_t *) DTI_PTR_CAST_GET_ULONG(u_dti_dev_ctx); + + if (ocal_dev_ctx->recv_msg_buf == IFX_NULL) { + DTI_Free(dti_dev_ctx); + + DTI_PRN_USR_ERR_NL(DTI_GPON_OCAL, DTI_PRN_LEVEL_ERR, + ("ERROR: GPON OCAL Module Setup - " + "Gmx Auto MSg Buffer miss-aligned." + DTI_CRLF)); + + return IFX_ERROR; + } + ocal_dev_ctx->recv_msg_buf_sz_byte = + DTI_DEV_GPON_OCAL_DEFAULT_MBOX_SIZE; + } else { + ocal_dev_ctx->recv_msg_buf = IFX_NULL; + ocal_dev_ctx->recv_msg_buf_sz_byte = 0; + } + + for (i = 0; i < dev_sys_info->numOfDevs; i++) { + ocal_dev_ctx->p_optic_dev_fds[i] = -1; + } + + ocal_dev_ctx->num_of_reg_access = + DTI_DEV_GPON_OCAL_MAX_REGISTER_ACCESS_NUM; + ocal_dev_ctx->num_of_dbg_access = + DTI_DEV_GPON_OCAL_MAX_DEBUG_ACCESS_NUM; + + ocal_dev_ctx->num_of_optic_devs = dev_sys_info->numOfDevs; + ocal_dev_ctx->if_per_optic_dev = dev_sys_info->ifPerDev; + ocal_dev_ctx->recv_dev_msg_support = + dev_sys_info->bControlAutoDevMsgSupport; + + dti_dev_ctx->bAutoDevMsgActive = IFX_FALSE; + dti_dev_ctx->pDevice = (IFX_void_t *) ocal_dev_ctx; + *dti_dev_ctx_out = dti_dev_ctx; + + return IFX_SUCCESS; +} + +/** + Delete a GPON OCAL Module. + - close all open devices + - free memory + +\param + dev_sys_info - points to the system infos +\param + dti_dev_ctx_out - contains the module context. + +\return + If success IFX_SUCCESS, the context is freed and the ptr is set to IFX_NULL. + else IFX_ERROR. + +*/ +DTI_STATIC IFX_int_t dti_ocal_module_delete(DTI_DeviceSysInfo_t *dev_sys_info, + DTI_DeviceCtx_t **dti_dev_ctx_out) +{ + IFX_int_t i; + DTI_DeviceCtx_t *dti_dev_ctx = IFX_NULL; + struct dti_dev_gpon_ocal_ctx *dti_ocal_ctx = IFX_NULL; + + if (dti_dev_ctx_out == IFX_NULL) { + DTI_PRN_USR_ERR_NL(DTI_GPON_OCAL, DTI_PRN_LEVEL_ERR, + ("ERROR: GPON OCAL Dev Module Delete - NULL " + "ptr args."DTI_CRLF)); + + return IFX_ERROR; + } + + if (*dti_dev_ctx_out == IFX_NULL) { + DTI_PRN_USR_ERR_NL(DTI_GPON_OCAL, DTI_PRN_LEVEL_ERR, + ("ERROR: GPON OCAL Dev Module Delete - NULL " + "ptr modul ctx."DTI_CRLF)); + + return IFX_ERROR; + } + + dti_dev_ctx = *dti_dev_ctx_out; + *dti_dev_ctx_out = IFX_NULL; + + dti_ocal_ctx = (struct dti_dev_gpon_ocal_ctx *) + dti_dev_ctx->pDevice; + for (i = 0; i < dti_ocal_ctx->num_of_optic_devs; i++) { + if (dti_ocal_ctx->p_optic_dev_fds[i] >= 0) { + (void)dti_ocal_dev_close(dti_ocal_ctx-> + p_optic_dev_fds[i]); + dti_ocal_ctx->p_optic_dev_fds[i] = -1; + } + } + + DTI_Free(dti_dev_ctx); + return IFX_SUCCESS; +} + +/** + Write the Sytem Info of the current DTI Agent instance to the given buffer. + +\param + pAgentSysInfo - points to Sytem Info struct of the current agent + instance. +\param + sys_info_buf - points to the Sytem Info char buffer. +\param + buffer_size - buffer size. + +\return + Number of written bytes. +*/ +DTI_STATIC IFX_int_t dti_ocal_sys_info_write(DTI_DeviceSysInfo_t *dev_sys_info, + IFX_char_t *sys_info_buf, + IFX_int_t buffer_size) +{ + IFX_int_t written_len = 0; + const IFX_char_t *board_name = DTI_BOARD_NAME_STR_GPON_OCAL; + + (void)DTI_snprintf(&sys_info_buf[written_len], + buffer_size - written_len, + "VendorName=%s", DTI_VENDOR_NAME_STR); + written_len = (IFX_int_t) DTI_StrLen(&sys_info_buf[written_len]) + 1; + + if (dev_sys_info->bValid == IFX_TRUE) { + board_name = DTI_BOARD_NAME_STR_GPON_OCAL; + } + + (void)DTI_snprintf(&sys_info_buf[written_len], + buffer_size - written_len, + "BoardName=%s", board_name); + written_len += (IFX_int_t) DTI_StrLen(&sys_info_buf[written_len]) + 1; + + (void)DTI_snprintf(&sys_info_buf[written_len], + buffer_size - written_len, + "BoardRevision=0.0"); + written_len += (IFX_int_t) DTI_StrLen(&sys_info_buf[written_len]) + 1; + + if (dev_sys_info->bValid == IFX_TRUE) { + (void)DTI_snprintf(&sys_info_buf[written_len], + buffer_size - written_len, "NumOfDevices=%d", + dev_sys_info->numOfDevs); + written_len += + (IFX_int_t) DTI_StrLen(&sys_info_buf[written_len]) + 1; + + (void)DTI_snprintf(&sys_info_buf[written_len], + buffer_size - written_len, "MaxChannel=%d", + dev_sys_info->numOfPorts); + written_len += + (IFX_int_t) DTI_StrLen(&sys_info_buf[written_len]) + 1; + } else { + (void)DTI_snprintf(&sys_info_buf[written_len], + buffer_size - written_len, + "NumOfDevices="); + written_len += + (IFX_int_t) DTI_StrLen(&sys_info_buf[written_len]) + 1; + + (void)DTI_snprintf(&sys_info_buf[written_len], + buffer_size - written_len, + "MaxChannel="); + written_len += + (IFX_int_t) DTI_StrLen(&sys_info_buf[written_len]) + 1; + } + + return written_len; +} + +/** + Do an device reset on the selected device. + +\param + dti_dev_ctx - points to the GPON OCAL Device context. +\param + in_dev_reset - points to the DTI Host2Dev Reset struct. +\param + out_dev_reset - points to the DTI Dev2Host Reset struct. +\param + rst_mask_size_32 - number of mask elements (32 Bit). +\param + packet_err - return ptr, return the DTI Packet Error. + +\return + IFX_SUCCESS and returns the DTI Packet Error code. + IFX_ERROR currently no (only in case of non-DTI related errors). +*/ +DTI_STATIC IFX_int_t dti_ocal_reset(DTI_DeviceCtx_t *dti_dev_ctx, + DTI_H2D_DeviceReset_t *in_dev_reset, + DTI_D2H_DeviceReset_t *out_dev_reset, + IFX_int_t rst_mask_size_32, + DTI_PacketError_t *packet_err) +{ + DTI_PRN_USR_DBG_NL(DTI_GPON_OCAL, DTI_PRN_LEVEL_HIGH, + ("WARNING: GPON OCAL Dev Reset" + " - not implemented." DTI_CRLF)); + + *packet_err = DTI_eErrUnknown; + + return IFX_SUCCESS; +} + +/** + Do a FW download on the selected devices + +\param + dti_dev_ctx - points to the GPON OCAL Device context. +\param + dti_prot_srv_ctx - points to the DTI protocol server context. +\param + in_dev_dwnld - points to the DTI Host2Dev Download struct. +\param + out_dev_dwnld - points to the DTI Dev2Host Download struct. +\param + packet_err - return ptr, return the DTI Packet Error. + +\return + IFX_SUCCESS and returns the DTI Packet Error code. + IFX_ERROR currently no (only in case of non-DTI related errors). +*/ +DTI_STATIC IFX_int_t dti_ocal_download(DTI_DeviceCtx_t *dti_dev_ctx, + DTI_ProtocolServerCtx_t *dti_prot_srv_ctx, + DTI_H2D_DeviceDownload_t *in_dev_dwnld, + DTI_D2H_DeviceDownload_t *out_dev_dwnld, + DTI_PacketError_t *packet_err) +{ + DTI_PRN_USR_DBG_NL(DTI_GPON_OCAL, DTI_PRN_LEVEL_HIGH, + ("WARNING: GPON OCAL Dev Download" + "- not implemented." DTI_CRLF)); + + *packet_err = DTI_eErrUnknown; + + return IFX_SUCCESS; +} + +/** + Open a given line device. + +\param + dti_dev_ctx - points to the GPON OCAL Device context. +\param + line_num - line number. +\param + packet_err - return ptr, return the DTI Packet Error. + +\return + IFX_SUCCESS and returns the DTI Packet Error code. + IFX_ERROR currently no (only in case of non-DTI related errors). +*/ +DTI_STATIC IFX_int_t dti_ocal_device_open(DTI_DeviceCtx_t *dti_dev_ctx, + IFX_int_t dev_num, + DTI_PacketError_t *packet_err) +{ + DTI_PRN_USR_DBG_NL(DTI_GPON_OCAL, DTI_PRN_LEVEL_HIGH, + ("WARNING: GPON OCAL Dev DeviceOpen" + " - not implemented." DTI_CRLF)); + + *packet_err = DTI_eErrUnknown; + + return IFX_SUCCESS; +} + +/** + Close a given line device. + +\param + dti_dev_ctx - points to the GPON OCAL Device context. +\param + line_num - line number. +\param + packet_err - return ptr, return the DTI Packet Error. + +\return + IFX_SUCCESS and returns the DTI Packet Error code. + IFX_ERROR currently no (only in case of non-DTI related errors). +*/ +DTI_STATIC IFX_int_t dti_ocal_device_close(DTI_DeviceCtx_t *dti_dev_ctx, + IFX_int_t line_num, + DTI_PacketError_t *packet_err) +{ + DTI_PRN_USR_DBG_NL(DTI_GPON_OCAL, DTI_PRN_LEVEL_HIGH, + ("WARNING: GPON OCAL Dev DeviceClose" + " - not implemented." DTI_CRLF)); + + *packet_err = DTI_eErrUnknown; + + return IFX_SUCCESS; +} + +/** + Get / release the device lock. + +\param + dti_dev_ctx - points to the GPON OCAL Device context. +\param + in_lock - points to the DTI Host2Dev Lock struct. +\param + out_lock - points to the DTI Dev2Host Lock struct. +\param + line_num - line number. +\param + packet_err - return ptr, return the DTI Packet Error. + +\return + IFX_SUCCESS and returns the DTI Packet Error code. + IFX_ERROR currently no (only in case of non-DTI related errors). +*/ +DTI_STATIC IFX_int_t dti_ocal_register_lock(DTI_DeviceCtx_t *dti_dev_ctx, + DTI_H2D_DeviceLock_t *in_lock, + DTI_D2H_DeviceLock_t *out_lock, + IFX_int_t line_num, + DTI_PacketError_t *packet_err) +{ + DTI_PRN_USR_DBG_NL(DTI_GPON_OCAL, DTI_PRN_LEVEL_HIGH, + ("WARNING: GPON OCAL Dev RegisterLock" + " - not implemented." DTI_CRLF)); + + *packet_err = DTI_eErrUnknown; + + return IFX_SUCCESS; +} + +/** + Get a device register (MEI interface). + +\param + dti_dev_ctx - points to the GPON OCAL Device context. +\param + in_reg_get - points to the DTI Host2Dev RegisterGet struct. +\param + out_reg_get - points to the DTI Dev2Host RegisterGet struct. +\param + line_num - line number. +\param + out_payl_sz_byte - return ptr, return the size of the read registers. + 0 in case of error +\param + packet_err - return ptr, return the DTI Packet Error. + +\return + IFX_SUCCESS and returns the DTI Packet Error code. + IFX_ERROR if the register read operation fails. +*/ +DTI_STATIC IFX_int_t dti_ocal_register_get(DTI_DeviceCtx_t *dti_dev_ctx, + DTI_H2D_RegisterGet_t *in_reg_get, + DTI_D2H_RegisterGet_t *out_reg_get, + IFX_int_t dev_num, + IFX_uint32_t *out_payl_sz_byte, + DTI_PacketError_t *packet_err) +{ + DTI_PRN_USR_DBG_NL(DTI_GPON_OCAL, DTI_PRN_LEVEL_HIGH, + ("WARNING: GPON OCAL Dev RegisterGet" + " - not implemented." DTI_CRLF)); + + *packet_err = DTI_eErrUnknown; + + return IFX_SUCCESS; +} + +/** + Get a device register (MEI interface). + +\param + dti_dev_ctx - points to the GPON OCAL Device context. +\param + in_lock - points to the DTI Host2Dev RegisterGet struct. +\param + out_lock - points to the DTI Dev2Host RegisterGet struct. +\param + line_num - line number. +\param + packet_err - return ptr, return the DTI Packet Error. + +\return + IFX_SUCCESS DTI Packet Error code is "no error". + IFX_ERROR if the register read operation fails. +*/ +DTI_STATIC IFX_int_t dti_ocal_register_set(DTI_DeviceCtx_t *dti_dev_ctx, + DTI_H2D_RegisterSet_t *in_reg_set, + IFX_int_t in_reg_set_sz_byte, + IFX_int_t dev_num, + DTI_PacketError_t *packet_err) +{ + DTI_PRN_USR_DBG_NL(DTI_GPON_OCAL, DTI_PRN_LEVEL_HIGH, + ("WARNING: GPON OCAL Dev RegisterSet" + " - not implemented." DTI_CRLF)); + + *packet_err = DTI_eErrUnknown; + + return IFX_SUCCESS; +} + +/** + Set a device configuration. + +\param + dti_dev_ctx - points to the GPON OCAL Device context. +\param + in_cfg_set - points to the DTI Host2Dev ConfigSet struct. +\param + out_cfg_set - points to the DTI Dev2Host ConfigSet struct. +\param + line_num - line number. +\param + packet_err - return ptr, return the DTI Packet Error. + +\return + IFX_SUCCESS and returns the DTI Packet Error code. + IFX_ERROR currently no (only in case of non-DTI related errors). + +\remark + Changes of the autonomous message handling may have influence to the + connection settings (select wait time) +*/ +DTI_STATIC IFX_int_t dti_ocal_cfg_set(DTI_DeviceCtx_t *dti_dev_ctx, + DTI_H2D_DeviceConfigSet_t *in_cfg_set, + DTI_D2H_DeviceConfigSet_t *out_cfg_set, + IFX_int_t line_num, + DTI_PacketError_t *packet_err) +{ + DTI_PRN_USR_DBG_NL(DTI_GPON_OCAL, DTI_PRN_LEVEL_HIGH, + ("WARNING: GPON OCAL Dev CfgSet" + " - not implemented." DTI_CRLF)); + + *packet_err = DTI_eErrUnknown; + + return IFX_SUCCESS; +} + +/** + Get the device configuration of the given line. + +\param + dti_dev_ctx - points to the GPON OCAL Device context. +\param + in_cfg_set - points to the DTI Host2Dev ConfigSet struct. +\param + out_cfg_set - points to the DTI Dev2Host ConfigSet struct. +\param + line_num - line number. +\param + packet_err - return ptr, return the DTI Packet Error. + +\return + IFX_SUCCESS and returns the DTI Packet Error code. + IFX_ERROR currently no (only in case of non-DTI related errors). +*/ +DTI_STATIC IFX_int_t dti_ocal_cfg_get(DTI_DeviceCtx_t *dti_dev_ctx, + DTI_H2D_DeviceConfigGet_t *in_cfg_get, + DTI_D2H_DeviceConfigGet_t *out_cfg_get, + IFX_int_t line_num, + DTI_PacketError_t *packet_err) +{ + DTI_PRN_USR_DBG_NL(DTI_GPON_OCAL, DTI_PRN_LEVEL_HIGH, + ("WARNING: GPON OCAL Dev CfgGet" + " - not implemented." DTI_CRLF)); + + *packet_err = DTI_eErrUnknown; + + return IFX_SUCCESS; +} + +/** + Send a 32 Bit message to the device and wait for the responce. + +\param + dti_dev_ctx - points to the GPON OCAL Device context. +\param + in_msg32_send - points to the DTI 32 bit message send struct. +\param + out_msg32_send - points to the DTI 32 bit message responce struct. +\param + line_num - line number. +\param + in_payl_sz_byte - payload size of the DTI packet [byte]. +\param + out_payl_sz_byte - return ptr, return the OUT payload size. +\param + packet_err - return ptr, return the DTI Packet Error. + +\return + IFX_SUCCESS and returns the DTI Packet Error code. + IFX_ERROR currently no (only in case of non-DTI related errors). +*/ +DTI_STATIC IFX_int_t dti_ocal_msg32_send(DTI_DeviceCtx_t *dti_dev_ctx, + DTI_H2D_Message32_u *in_msg32_send, + DTI_D2H_Message32_u *out_msg32_send, + IFX_int_t dev_num, + IFX_int_t in_payl_sz_byte, + IFX_int_t *out_payl_sz_byte, + DTI_PacketError_t *packet_err) +{ + DTI_PRN_USR_DBG_NL(DTI_GPON_OCAL, DTI_PRN_LEVEL_HIGH, + ("WARNING: GPON OCAL Dev Msg32Send" + " - not implemented." DTI_CRLF)); + + *packet_err = DTI_eErrUnknown; + + return IFX_SUCCESS; +} + +/** + Send a 16 Bit message to the device. + +\param + dti_dev_ctx - points to the GPON OCAL Device context. +\param + in_msg16_send - points to the DTI 16 bit message send struct. +\param + out_msg16_send - points to the DTI 16 bit message responce struct. +\param + line_num - line number. +\param + in_payl_sz_byte - payload size of the DTI packet [byte]. +\param + out_payl_sz_byte - return ptr, return the OUT payload size [byte]. +\param + packet_err - return ptr, return the DTI Packet Error. + +\return + IFX_SUCCESS and returns the DTI Packet Error code. + IFX_ERROR currently no (only in case of non-DTI related errors). +*/ +DTI_STATIC IFX_int_t dti_ocal_msg16_send(DTI_DeviceCtx_t * dti_dev_ctx, + DTI_H2D_Message16_u *in_msg16_send, + DTI_D2H_Message16_u *out_msg16_send, + IFX_int_t line_num, + IFX_int_t in_payl_sz_byte, + IFX_int_t *out_payl_sz_byte, + DTI_PacketError_t *packet_err) +{ + DTI_PRN_USR_DBG_NL(DTI_GPON_OCAL, DTI_PRN_LEVEL_HIGH, + ("WARNING: GPON OCAL Dev Msg16Send" + " - not implemented." DTI_CRLF)); + + *packet_err = DTI_eErrUnknown; + + return IFX_SUCCESS; +} + +/** + Send a 8 Bit message to the device and wait for the responce. + +\param + dti_dev_ctx - points to the GPON OCAL Device context. +\param + in_msg8_send - points to the DTI 8 bit message send struct. +\param + out_msg8_send - points to the DTI 8 bit message responce struct. +\param + line_num - line number. +\param + in_payl_sz_byte - payload size of the DTI packet [byte]. +\param + out_payl_sz_byte - return ptr, return the OUT payload size. +\param + packet_err - return ptr, return the DTI Packet Error. + +\return + IFX_SUCCESS and returns the DTI Packet Error code. + IFX_ERROR currently no (only in case of non-DTI related errors). +*/ +DTI_STATIC IFX_int_t dti_ocal_msg8_send(DTI_DeviceCtx_t *dti_dev_ctx, + DTI_H2D_Message8_u *in_msg8_send, + DTI_D2H_Message8_u *out_msg8_send, + IFX_int_t dev_num, + IFX_int_t in_payl_sz_byte, + IFX_int_t *out_payl_sz_byte, + DTI_PacketError_t *packet_err) +{ + struct dti_dev_gpon_ocal_ctx *dti_ocal_ctx = + (struct dti_dev_gpon_ocal_ctx *) dti_dev_ctx->pDevice; + + IFX_uint32_t cmd; + IFX_uint32_t data_sz; + + IFX_int_t ret = 0; + + dev_num = 0; + *packet_err = DTI_eErrUnknown; + + /* extract OCAL command ID and size */ + cmd = *(unsigned int *)&in_msg8_send->raw.data[0]; + data_sz = *(unsigned int *)&in_msg8_send-> + raw.data[1 * sizeof(unsigned int)]; + cmd= ntohl (cmd); + data_sz = ntohl (data_sz); + /* ensure that data_sz is valid */ + if ((IFX_uint32_t) data_sz > (IFX_uint32_t) in_payl_sz_byte) { + out_msg8_send->raw.sendResult = -1; + *packet_err = DTI_eNoError; + return IFX_SUCCESS; + } + + /* open Optic Driver */ + if (dti_ocal_cntrl_port_open(dti_ocal_ctx, dev_num, packet_err) != + IFX_SUCCESS) { + DTI_PRN_USR_ERR_NL(DTI_GPON_OCAL, DTI_PRN_LEVEL_ERR, + ("ERROR: GPON OCAL device message 8 send - " + "dev_num %d, open error."DTI_CRLF, + dev_num)); + + return IFX_ERROR; + } + + /* execute optic calibration command */ + ret = ocal_cmd_execute(dti_ocal_ctx->p_optic_dev_fds[dev_num], + (enum ocal_cmd) cmd, + (void*) &in_msg8_send-> + raw.data[2 * sizeof(unsigned int)], + (void*) &out_msg8_send->raw.data[0]); + + if (ret < 0) { + DTI_PRN_USR_ERR_NL(DTI_GPON_OCAL, DTI_PRN_LEVEL_ERR, + ("ERROR: executing OCAL command 0x%x, ret %d" + DTI_CRLF, cmd, ret)); + out_msg8_send->raw.sendResult = ret; + *packet_err = DTI_eNoError; + *out_payl_sz_byte = 1; + return IFX_SUCCESS; + } + /* set outgoing packet size */ + *out_payl_sz_byte = ret + 4; + /* result is OK */ + out_msg8_send->raw.sendResult = OCAL_STATUS_OK; + *packet_err = DTI_eNoError; + + return IFX_SUCCESS; +} + +/** + Setup the trace buffer configuration (debug streams). + +\param + dti_dev_ctx - points to the GPON OCAL Device context. +\param + in_trace_config_set - points to the DTI Host2Dev TraceConfigSet struct. +\param + out_trace_config_set - points to the DTI Dev2Host TraceConfigSet struct. +\param + line_num - line number. +\param + packet_err - return ptr, return the DTI Packet Error. + +\return + IFX_SUCCESS and returns the DTI Packet Error code. + IFX_ERROR debug stream setup failed. +*/ +DTI_STATIC IFX_int_t dti_ocal_trace_buf_cfg_set(DTI_DeviceCtx_t + *dti_dev_ctx, + DTI_H2D_TraceConfigSet_t + *in_trace_config_set, + DTI_D2H_TraceConfigSet_t + *out_trace_config_set, + IFX_int_t line_num, + DTI_PacketError_t + *packet_err) +{ + DTI_PRN_USR_DBG_NL(DTI_GPON_OCAL, DTI_PRN_LEVEL_HIGH, + ("WARNING: GPON OCAL Dev TraceBufferCfgGet" + " - not implemented." DTI_CRLF)); + + *packet_err = DTI_eErrUnknown; + + return IFX_SUCCESS; +} + +/** + Reset the current trace buffer (debug streams). + +\param + dti_dev_ctx - points to the GPON OCAL Device context. +\param + line_num - line number. +\param + packet_err - return ptr, return the DTI Packet Error. + +\return + IFX_SUCCESS and returns the DTI Packet Error code. + IFX_ERROR debug stream setup failed. +*/ +DTI_STATIC IFX_int_t dti_ocal_trace_buf_reset(DTI_DeviceCtx_t *dti_dev_ctx, + IFX_int_t line_num, + DTI_PacketError_t *packet_err) +{ + DTI_PRN_USR_DBG_NL(DTI_GPON_OCAL, DTI_PRN_LEVEL_HIGH, + ("WARNING: GPON OCAL Dev TraceBufferReset" + " - not implemented." DTI_CRLF)); + + *packet_err = DTI_eErrUnknown; + + return IFX_SUCCESS; +} + +/** + Setup the trace buffer configuration (debug streams). + +\param + dti_dev_ctx - points to the GPON OCAL Device context. +\param + out_trace_status_get - points to the DTI Dev2Host TraceStatusGet struct. +\param + line_num - line number. +\param + packet_err - return ptr, return the DTI Packet Error. + +\return + IFX_SUCCESS and returns the DTI Packet Error code. + IFX_ERROR debug stream config request failed. +*/ +DTI_STATIC IFX_int_t dti_ocal_trace_buf_status_get(DTI_DeviceCtx_t + *dti_dev_ctx, + DTI_D2H_TraceStatusGet_t + *out_trace_status_get, + IFX_int_t line_num, + DTI_PacketError_t + *packet_err) +{ + DTI_PRN_USR_DBG_NL(DTI_GPON_OCAL, DTI_PRN_LEVEL_HIGH, + ("WARNING: GPON OCAL Dev TraceBufferStatusGet" + " - not implemented." DTI_CRLF)); + + *packet_err = DTI_eErrUnknown; + + return IFX_SUCCESS; +} + +/** + Read data from the device via Debug Access (MEI Debug). + +\param + dti_dev_ctx - points to the GPON OCAL Device context. +\param + in_trace_buf_get - points to the DTI Host2Dev RegisterGet struct. +\param + used_dti_packet_out - return ptr, points to the DTI Out packet. +\param + used_buffer_out_size - return value, points to the DTI Out packet size. +\param + line_num - line number. +\param + tr_buf_read_sz_byte - return ptr, return the number of read registers. +\param + packet_err - return ptr, return the DTI Packet Error. + +\remark + The function is called with the standard out packet. If the requested size + does not fit into this buffer, a corresponding buffer is allocated and used + for the ioctl call. The pointer to this out packet will be returned. + +\return + IFX_SUCCESS debug stream data read successful. + - returns the DTI Packet Error code. + - pointer to the used out package. + - size of the used out package. + IFX_ERROR data read failed. +*/ +DTI_STATIC IFX_int_t dti_ocal_trace_buf_get(DTI_DeviceCtx_t *dti_dev_ctx, + DTI_H2D_TraceBufferGet_t + *in_trace_buf_get, + DTI_Packet_t + **used_dti_packet_out, + IFX_int_t *used_buffer_out_size, + IFX_int_t line_num, + IFX_int_t *tr_buf_read_sz_byte, + DTI_PacketError_t *packet_err) +{ + DTI_PRN_USR_DBG_NL(DTI_GPON_OCAL, DTI_PRN_LEVEL_HIGH, + ("WARNING: GPON OCAL Dev TraceBufferGet" + " - not implemented." DTI_CRLF)); + + *packet_err = DTI_eErrUnknown; + + return IFX_SUCCESS; +} + +/** + Read data from the device via Debug Access (MEI Debug). + +\param + dti_dev_ctx - points to the GPON OCAL Device context. +\param + in_dbg_get - points to the DTI Host2Dev RegisterGet struct. +\param + out_dbg_get - points to the DTI Dev2Host RegisterGet struct. +\param + line_num - line number. +\param + dbg_read_count - return ptr, return the number of read registers. +\param + packet_err - return ptr, return the DTI Packet Error. + +\return + IFX_SUCCESS and returns the DTI Packet Error code. + IFX_ERROR currently no (only in case of non-DTI related errors). +*/ +DTI_STATIC IFX_int_t dti_ocal_debug_read(DTI_DeviceCtx_t *dti_dev_ctx, + DTI_H2D_DebugRead_t *in_dbg_get, + DTI_D2H_DebugRead_t *out_dbg_get, + IFX_int_t line_num, + IFX_int_t *dbg_read_count, + DTI_PacketError_t *packet_err) +{ + DTI_PRN_USR_DBG_NL(DTI_GPON_OCAL, DTI_PRN_LEVEL_HIGH, + ("WARNING: GPON OCAL Dev DebugRead" + " - not implemented." DTI_CRLF)); + + *dbg_read_count = 0; + *packet_err = DTI_eErrUnknown; + + return IFX_SUCCESS; +} + +/** + Write data to the device via Debug Access (MEI Debug). + +\param + dti_dev_ctx - points to the GPON OCAL Device context. +\param + in_dbg_set - points to the DTI Host2Dev RegisterGet struct. +\param + out_dbg_get_nu - not used. +\param + line_num - line number. +\param + dbg_write_count - return ptr, return the number of read registers. +\param + packet_err - return ptr, return the DTI Packet Error. + +\return + IFX_SUCCESS and returns the DTI Packet Error code. + IFX_ERROR currently no (only in case of non-DTI related errors). +*/ +DTI_STATIC IFX_int_t dti_ocal_debug_write(DTI_DeviceCtx_t *dti_dev_ctx, + DTI_H2D_DebugWrite_t *in_dbg_set, + IFX_uint32_t *out_dbg_get_nu, + IFX_int_t line_num, + IFX_int_t *dbg_write_count, + DTI_PacketError_t *packet_err) +{ + DTI_PRN_USR_DBG_NL(DTI_GPON_OCAL, DTI_PRN_LEVEL_HIGH, + ("WARNING: GPON OCAL Dev DebugRead" + " - not implemented." DTI_CRLF)); + + *dbg_write_count = 0; + *packet_err = DTI_eErrUnknown; + + return IFX_SUCCESS; +} + +/** + Check and process for Device Autonomous Messages. + The Auto Msg is read form the device (driver) and a corresponding + DTI packet is created and sent to the upper DTI Client + +\param + dti_dev_ctx - points to the Device context. +\param + dti_con - points to the established DTI Connection data. +\param + dev_select_wait_ms - wait time [ms] for the device select operation. +\param + out_buffer - points to the DTI packet out buffer to create a DTI + packet. +\param + out_buffer_sz_byte - DTI out buffer size [byte] + +\return + IFX_SUCCESS if the DTI packet has been sent. + IFX_ERROR DTI packet has not been sent. + +\remarks + At first the device msg will be read out to free the internal driver buffer. + This is done independant on the established connection. +*/ +DTI_STATIC IFX_int_t dti_ocal_auto_msg_process(DTI_DeviceCtx_t *dti_dev_ctx, + const DTI_Connection_t *dti_con, + IFX_uint32_t dev_select_wait_ms, + IFX_char_t *out_buffer, + IFX_int_t out_buffer_sz_byte) +{ + DTI_PRN_USR_DBG_NL(DTI_GPON_OCAL, DTI_PRN_LEVEL_HIGH, + ("WARNING: GPON OCAL Dev AutoMsgProcess" + " - not implemented." DTI_CRLF)); + + return IFX_SUCCESS; +} + +DTI_STATIC IFX_int_t dti_ocal_win_easy_cli_access(DTI_DeviceCtx_t *dti_dev_ctx, + IFX_int_t line_num, + const IFX_uint8_t *data_in, + const IFX_uint32_t size_in, + IFX_uint8_t *data_out, + const IFX_uint32_t size_out, + DTI_PacketError_t *packet_err) +{ + DTI_PRN_USR_DBG_NL(DTI_GPON_OCAL, DTI_PRN_LEVEL_HIGH, + ("WARNING: GPON OCAL Dev WinEasyCiAccess" + " - not implemented." DTI_CRLF)); + + *packet_err = DTI_eErrUnknown; + return IFX_SUCCESS; +} + +#endif /* DEVICE_GPON_OCAL */ diff --git a/src/dti_agent_ocal.h b/src/dti_agent_ocal.h new file mode 100644 index 0000000..4ea302f --- /dev/null +++ b/src/dti_agent_ocal.h @@ -0,0 +1,64 @@ +#ifndef _DTI_AGENT_OCAL_H +#define _DTI_AGENT_OCAL_H +/****************************************************************************** + + Copyright (c) 2011 + Lantiq Deutschland GmbH + Am Campeon 3; 85579 Neubiberg, Germany + + For licensing information, see the file 'LICENSE' in the root folder of + this software module. + +******************************************************************************/ +#ifdef __cplusplus +extern "C" { +#endif + +/** \file + GPON OCAL device, control struct for GPON Optic Calibration access + and handling. +*/ + +/* ========================================================================== + includes + ========================================================================== */ +#include "ifx_types.h" +#include "ifxos_debug.h" +#include "ifxos_device_access.h" + +/* ========================================================================== + defines + ========================================================================== */ + +/** DTI Device Interface Name */ +#define DTI_DEV_GPON_OCAL_NAME "GPON-OCAL" + +#define DTI_BOARD_NAME_STR_GPON_OCAL "GPON Board (OCAL)" + +#define DTI_GPON_ONU_START_ID 0 +#define DTI_GPON_ONU_MAX_ID 3 + +/** Max number of register accesses per packet */ +#define DTI_DEV_GPON_OCAL_MAX_REGISTER_ACCESS_NUM 0x10 +/** Max number of debug accesses per packet */ +#define DTI_DEV_GPON_OCAL_MAX_DEBUG_ACCESS_NUM 0x10 + +/** default GPON OCAL device mailbox size */ +#define DTI_DEV_GPON_OCAL_DEFAULT_MBOX_SIZE 0x100 + +/* ========================================================================== + macro + ========================================================================== */ + +/* ========================================================================== + types + ========================================================================== */ + +/* ========================================================================== + exports + ========================================================================== */ + +#ifdef __cplusplus +} +#endif +#endif /* _DTI_AGENT_OCAL_H */ diff --git a/src/dti_agent_ocal_ctx.h b/src/dti_agent_ocal_ctx.h new file mode 100644 index 0000000..86c29e2 --- /dev/null +++ b/src/dti_agent_ocal_ctx.h @@ -0,0 +1,88 @@ + +/****************************************************************************** + + Copyright (c) 2011 + Lantiq Deutschland GmbH + Am Campeon 3; 85579 Neubiberg, Germany + + For licensing information, see the file 'LICENSE' in the root folder of + this software module. + +******************************************************************************/ +#ifndef _DTI_AGENT_OCAL_CTX_H +#define _DTI_AGENT_OCAL_CTX_H + +#ifdef __cplusplus +extern "C" { +#endif + +/** \file + GPON OCAL device context, control struct for GPON Optic Calibration access + and handling. +*/ + +/* ========================================================================== + includes + ========================================================================== */ +#include "ifx_types.h" +#include "ifxos_debug.h" +#include "ifxos_device_access.h" + +/* ========================================================================== + defines + ========================================================================== */ + +/* ========================================================================== + macro + ========================================================================== */ + +/* ========================================================================== + types + ========================================================================== */ + +/** + GPON OCAL Control Struct +*/ +struct dti_dev_gpon_ocal_ctx { + /** number of GPON Optic devices */ + IFX_int_t num_of_optic_devs; + + /** interfaces per GPON Optic device */ + IFX_int_t if_per_optic_dev; + + /** points to the array of GPON Optic devices fds (number of + devices * interfaces per device) */ + IFX_int_t *p_optic_dev_fds; + + /* + DTI Config + */ + /** max number of register requests / sets */ + IFX_int_t num_of_reg_access; + /** max number of debug requests / sets */ + IFX_int_t num_of_dbg_access; + + /** recv msg handling - supported */ + IFX_boolean_t recv_dev_msg_support; + /** receive msg handling - max device fd for select */ + IFX_int_t recv_max_dev_fd; + /** receive msg handling - device FDSET */ + IFXOS_devFd_set_t recv_dev_fds; + /** receive handling - for temporary use, device FDSET */ + IFXOS_devFd_set_t tmp_dev_fds; + /** receive msg handling - recv buffer for upcoming msg's */ + IFX_ulong_t *recv_msg_buf; + /** auto msg handling - size of the modem message buffer for NFC + handling */ + IFX_int_t recv_msg_buf_sz_byte; + +}; + +/* ========================================================================== + exports + ========================================================================== */ + +#ifdef __cplusplus +} +#endif +#endif /* _DTI_AGENT_OCAL_CTX_H */ diff --git a/src/dti_agent_onu.c b/src/dti_agent_onu.c new file mode 100644 index 0000000..8a55764 --- /dev/null +++ b/src/dti_agent_onu.c @@ -0,0 +1,2127 @@ +/****************************************************************************** + + Copyright (c) 2011 + Lantiq Deutschland GmbH + Am Campeon 3; 85579 Neubiberg, Germany + + For licensing information, see the file 'LICENSE' in the root folder of + this software module. + +******************************************************************************/ + +/** \file + Debug and Trace Interface - Basic Protocol Packet Handling. +*/ + +/* ============================================================================ + Includes + ========================================================================= */ +#include "dti_osmap.h" + +#if defined(DEVICE_GPON_ONU) + +#include "drv_onu_interface.h" +#include "drv_onu_common_interface.h" +#include "drv_onu_ploam_interface.h" +#include "drv_onu_gtc_interface.h" +#include "drv_onu_gpe_interface.h" +#include "drv_onu_event_interface.h" + +#include "ifx_dti_protocol.h" +#include "ifx_dti_protocol_device.h" +#include "ifx_dti_protocol_cli.h" + +#include "dti_device.h" +#include "dti_agent_onu.h" +#include "dti_agent_onu_ctx.h" +#include "dti_agent_cli.h" + +#if 0 + +#include + +#undef DTI_DeviceControl + +void onu_time_stamp(FILE * pFile, struct tm *t_time) +{ + char s[100]; + + sprintf(s, "%4d-%2d-%2d %2d:%2d:%2d", + t_time->tm_year + 1900, t_time->tm_mon + 1, t_time->tm_mday, + t_time->tm_hour, t_time->tm_min, t_time->tm_sec); + if (t_time->tm_mon < 9) + s[5] = '0'; + if (t_time->tm_mday < 10) + s[8] = '0'; + if (t_time->tm_hour < 10) + s[11] = '0'; + if (t_time->tm_min < 10) + s[14] = '0'; + if (t_time->tm_sec < 10) + s[17] = '0'; + + fprintf(pFile, "%s ", s); +} + +int DTI_DeviceControl(unsigned int fd, unsigned int cmd, unsigned int data) +{ + static FILE *log = NULL; + int ret; + + if (log == NULL) + log = fopen("dti_agent.log", "w"); + + if (log != NULL) { + time_t itime = time(0); + onu_time_stamp(log, localtime(&itime)); + fprintf(log, "cmd %x, data %x, ", cmd, data); + } + ret = IFXOS_DeviceControl(fd, cmd, data); + if (log != NULL) { + fprintf(log, "ret %x\n", ret); + fflush(log); + } + + return ret; +} + +#endif + +/* ============================================================================ + Defines + ========================================================================= */ + +#ifdef DTI_STATIC +# undef DTI_STATIC +#endif + +#ifdef DTI_DEBUG +# define DTI_STATIC +#else +# define DTI_STATIC static +#endif + +#ifndef _IOWR +# define _IOWR _IOW +#endif + +#define GPON_ONU_IOCTL_ARG unsigned long + +/* ============================================================================ + Local Function Declaration + ========================================================================= */ + +DTI_STATIC IFX_int_t dti_onu_dev_open(IFX_char_t *dev_name); + +DTI_STATIC IFX_int_t dti_onu_dev_close(IFX_int_t dev_fd); + +DTI_STATIC IFX_int_t dti_onu_dev_reset( + struct dti_dev_gpon_onu_drv_ctx *dti_onu_ctx, + IFX_int_t dev_num, + DTI_DeviceResetModes_t rst_mode); + +DTI_STATIC IFX_void_t dti_onu_dev_fd_clear( + struct dti_dev_gpon_onu_drv_ctx *dti_onu_ctx, + IFX_int_t dev_num); + +DTI_STATIC IFX_int_t dti_onu_drv_cfg_get(DTI_DeviceSysInfo_t *sys_info); + +/* ============================================================================ + Device Access Functions + ========================================================================= */ +DTI_STATIC IFX_int_t dti_onu_printout_level_set(IFX_int_t new_dbg_level); + +DTI_STATIC IFX_int_t dti_onu_module_setup(DTI_DeviceSysInfo_t *dev_sys_info, + DTI_DeviceCtx_t **dti_dev_ctx_out); + +DTI_STATIC IFX_int_t dti_onu_module_delete(DTI_DeviceSysInfo_t *dev_sys_info, + DTI_DeviceCtx_t **dti_dev_ctx_out); + +DTI_STATIC IFX_int_t dti_onu_sys_info_write(DTI_DeviceSysInfo_t *dev_sys_info, + IFX_char_t *sys_info_buf, + IFX_int_t buffer_size); + +DTI_STATIC IFX_int_t dti_onu_reset(DTI_DeviceCtx_t *dti_dev_ctx, + DTI_H2D_DeviceReset_t *in_dev_reset, + DTI_D2H_DeviceReset_t *out_dev_reset, + IFX_int_t rst_mask_size_32, + DTI_PacketError_t *packet_err); + +DTI_STATIC IFX_int_t dti_onu_download(DTI_DeviceCtx_t *dti_dev_ctx, + DTI_ProtocolServerCtx_t *dti_prot_srv_ctx, + DTI_H2D_DeviceDownload_t *in_dev_dwnld, + DTI_D2H_DeviceDownload_t *out_dev_dwnld, + DTI_PacketError_t *packet_err); + +DTI_STATIC IFX_int_t dti_onu_device_open(DTI_DeviceCtx_t *dti_dev_ctx, + IFX_int_t dev_num, + DTI_PacketError_t *packet_err); + +DTI_STATIC IFX_int_t dti_onu_device_close(DTI_DeviceCtx_t *dti_dev_ctx, + IFX_int_t dev_num, + DTI_PacketError_t *packet_err); + +DTI_STATIC IFX_int_t dti_onu_register_lock(DTI_DeviceCtx_t *dti_dev_ctx, + DTI_H2D_DeviceLock_t *in_lock, + DTI_D2H_DeviceLock_t *out_lock, + IFX_int_t dev_num, + DTI_PacketError_t *packet_err); + +DTI_STATIC IFX_int_t dti_onu_register_get(DTI_DeviceCtx_t *dti_dev_ctx, + DTI_H2D_RegisterGet_t *in_reg_get, + DTI_D2H_RegisterGet_t *out_reg_get, + IFX_int_t dev_num, + IFX_uint32_t *out_payl_sz_byte, + DTI_PacketError_t *packet_err); + +DTI_STATIC IFX_int_t dti_onu_register_set(DTI_DeviceCtx_t *dti_dev_ctx, + DTI_H2D_RegisterSet_t *in_reg_set, + IFX_int_t in_reg_set_sz_byte, + IFX_int_t dev_num, + DTI_PacketError_t *packet_err); + +DTI_STATIC IFX_int_t dti_onu_cfg_set(DTI_DeviceCtx_t *dti_dev_ctx, + DTI_H2D_DeviceConfigSet_t *in_cfg_set, + DTI_D2H_DeviceConfigSet_t *out_cfg_set, + IFX_int_t dev_num, + DTI_PacketError_t *packet_err); + +DTI_STATIC IFX_int_t dti_onu_cfg_get(DTI_DeviceCtx_t *dti_dev_ctx, + DTI_H2D_DeviceConfigGet_t *in_cfg_get, + DTI_D2H_DeviceConfigGet_t *out_cfg_get, + IFX_int_t dev_num, + DTI_PacketError_t *packet_err); + +DTI_STATIC IFX_int_t dti_onu_msg8_send(DTI_DeviceCtx_t *dti_dev_ctx, + DTI_H2D_Message8_u *in_msg8_send, + DTI_D2H_Message8_u *out_msg8_send, + IFX_int_t dev_num, + IFX_int_t in_payl_sz_byte, + IFX_int_t *out_payl_sz_byte, + DTI_PacketError_t *packet_err); + +DTI_STATIC IFX_int_t dti_onu_msg16_send(DTI_DeviceCtx_t *dti_dev_ctx, + DTI_H2D_Message16_u *in_msg16_send, + DTI_D2H_Message16_u *out_msg16_send, + IFX_int_t dev_num, + IFX_int_t in_payl_sz_byte, + IFX_int_t *out_payl_sz_byte, + DTI_PacketError_t *packet_err); + +DTI_STATIC IFX_int_t dti_onu_msg32_send(DTI_DeviceCtx_t *dti_dev_ctx, + DTI_H2D_Message32_u *in_msg32_send, + DTI_D2H_Message32_u *out_msg32_send, + IFX_int_t dev_num, + IFX_int_t in_payl_sz_byte, + IFX_int_t *out_payl_sz_byte, + DTI_PacketError_t *packet_err); + +DTI_STATIC IFX_int_t dti_onu_trace_buf_cfg_set(DTI_DeviceCtx_t *dti_dev_ctx, + DTI_H2D_TraceConfigSet_t + *in_trace_config_set, + DTI_D2H_TraceConfigSet_t + *out_trace_config_set, + IFX_int_t dev_num, + DTI_PacketError_t *packet_err); + +DTI_STATIC IFX_int_t dti_onu_trace_buf_reset(DTI_DeviceCtx_t *dti_dev_ctx, + IFX_int_t dev_num, + DTI_PacketError_t *packet_err); + +DTI_STATIC IFX_int_t dti_onu_trace_buf_status_get(DTI_DeviceCtx_t *dti_dev_ctx, + DTI_D2H_TraceStatusGet_t + *out_trace_status_get, + IFX_int_t dev_num, + DTI_PacketError_t + *packet_err); + +DTI_STATIC IFX_int_t dti_onu_trace_buf_get(DTI_DeviceCtx_t *dti_dev_ctx, + DTI_H2D_TraceBufferGet_t + *in_trace_buf_get, + DTI_Packet_t **used_dti_packet_out, + IFX_int_t *used_buffer_out_size, + IFX_int_t dev_num, + IFX_int_t *tr_buf_read_sz_byte, + DTI_PacketError_t *packet_err); + +DTI_STATIC IFX_int_t dti_onu_debug_read(DTI_DeviceCtx_t *dti_dev_ctx, + DTI_H2D_DebugRead_t *in_dbg_get, + DTI_D2H_DebugRead_t *out_dbg_get, + IFX_int_t dev_num, + IFX_int_t *dbg_read_count, + DTI_PacketError_t *packet_err); + +DTI_STATIC IFX_int_t dti_onu_debug_write(DTI_DeviceCtx_t *dti_dev_ctx, + DTI_H2D_DebugWrite_t *in_dbg_set, + IFX_uint32_t *out_dbg_get_nu, + IFX_int_t dev_num, + IFX_int_t *dbg_write_count, + DTI_PacketError_t *packet_err); + +DTI_STATIC IFX_int_t dti_onu_auto_msg_process(DTI_DeviceCtx_t *dti_dev_ctx, + const DTI_Connection_t *dti_con, + IFX_uint32_t dev_select_wait_ms, + IFX_char_t *out_buffer, + IFX_int_t out_buffer_sz_byte); + +DTI_STATIC IFX_int_t dti_onu_win_easy_cli_access(DTI_DeviceCtx_t *dti_dev_ctx, + IFX_int_t dev_num, + const IFX_uint8_t *data_in, + const IFX_uint32_t size_in, + IFX_uint8_t *data_out, + const IFX_uint32_t size_out, + DTI_PacketError_t *packet_err); + +/* ============================================================================ + Variables + ========================================================================= */ + +/* Create device debug module - user part */ +IFXOS_PRN_USR_MODULE_CREATE(DTI_GPON_ONU, DTI_PRN_LEVEL_HIGH); + +#if (DTI_DEVICE_INTERFACE_VERSION != 0x00010200) +#error "wrong DTI_DEVICE_INTERFACE_VERSION!" +#endif + +/** + Collection of all available device access functions. +*/ +DTI_DeviceAccessFct_t dti_dev_access_fct_gpon_onu = { + sizeof(DTI_DeviceAccessFct_t), /* structure check */ + DTI_DEVICE_INTERFACE_VERSION, /* device interface version */ + DTI_DEV_GPON_ONU_IF_NAME, /* device name */ + + dti_onu_printout_level_set, + dti_onu_module_setup, + dti_onu_module_delete, + dti_onu_sys_info_write, + + dti_onu_reset, + dti_onu_download, + dti_onu_device_open, + dti_onu_device_close, + dti_onu_register_lock, + dti_onu_register_get, + dti_onu_register_set, + dti_onu_cfg_set, + dti_onu_cfg_get, + dti_onu_msg16_send, + dti_onu_msg32_send, + dti_onu_trace_buf_cfg_set, + dti_onu_trace_buf_reset, + dti_onu_trace_buf_status_get, + dti_onu_trace_buf_get, + dti_onu_debug_read, + dti_onu_debug_write, + dti_onu_auto_msg_process, + dti_onu_win_easy_cli_access, + +#if (DTI_DEVICE_INTERFACE_VERSION > 0x00000100) + dti_onu_msg8_send, +#endif +}; + +/* ============================================================================ + Local Function + ========================================================================= */ + +/** + Open a control device of the GPON ONU driver + +\param + dev_num - debug device number +\param + dev_name - GPON ONU device base name + +\return + if success, a valid device fd + else IFX_ERROR. +*/ +DTI_STATIC IFX_int_t dti_onu_dev_open(IFX_char_t * dev_name) +{ + IFX_int_t dev_fd = -1, conn_num; + IFX_char_t buf[128]; + + for (conn_num = DTI_GPON_ONU_START_ID; conn_num <= DTI_GPON_ONU_MAX_ID; + conn_num++) { + /* /dev/gpon/ */ + (void)DTI_snprintf(buf, 128, "%s%d", dev_name, conn_num); + dev_fd = DTI_DeviceOpen(buf); + if (dev_fd < 0) { + DTI_PRN_USR_ERR_NL(DTI_GPON_ONU, DTI_PRN_LEVEL_ERR, + ("WRN: GPON ONU Dev Open - <%s> " + "can't open device."DTI_CRLF, buf)); + + /* /dev/gpon/ */ + (void)DTI_snprintf(buf, 128, "%s/%d", dev_name, + conn_num); + dev_fd = DTI_DeviceOpen(buf); + } + + if (dev_fd < 0) { + DTI_PRN_USR_ERR_NL(DTI_GPON_ONU, DTI_PRN_LEVEL_ERR, + ("WRN: GPON ONU Dev Open - <%s> " + "can't open device."DTI_CRLF, buf)); + } else { + DTI_PRN_USR_DBG_NL(DTI_GPON_ONU, DTI_PRN_LEVEL_HIGH, + ("GPON ONU Dev Open - <%s> found." + DTI_CRLF, buf)); + + break; + } + } + + if (dev_fd < 0) { + /* /dev/gpon */ + (void)DTI_snprintf(buf, 128, "%s", dev_name); + dev_fd = DTI_DeviceOpen(buf); + } + + if (dev_fd < 0) { + DTI_PRN_USR_ERR_NL(DTI_GPON_ONU, DTI_PRN_LEVEL_ERR, + ("WRN: GPON ONU Dev Open - <%s> can't open " + "device, giving up."DTI_CRLF, buf)); + + return IFX_ERROR; + } else { + DTI_PRN_USR_DBG_NL(DTI_GPON_ONU, DTI_PRN_LEVEL_HIGH, + ("GPON ONU Dev Open - <%s> found." DTI_CRLF, + buf)); + } + + return dev_fd; +} + +/** + Close a control device of the GPON ONU driver + +\param + dev_fd - a valid device fd + +\return + If success IFX_SUCCESS else IFX_ERROR. + +*/ +DTI_STATIC IFX_int_t dti_onu_dev_close(IFX_int_t dev_fd) +{ + IFX_int_t ret_val = IFX_ERROR; + + if (dev_fd > 0) + ret_val = DTI_DeviceClose(dev_fd); + + return ret_val; +} + +/* + Check if a control port for the given line is already open, + if not open the control port. + +\param + pDtiGmxCtx - points to the GPON ONU Device context. +\param + line_num - line number +\param + packet_err - returns the result + +*/ +DTI_STATIC IFX_int_t dti_onu_cntrl_port_open(struct dti_dev_gpon_onu_drv_ctx + *dti_onu_ctx, + IFX_int_t dev_num, + DTI_PacketError_t *packet_err) +{ + IFX_int_t ret; + struct fio_exchange ex; + struct onu_event_mask mask; + + if (dti_onu_ctx->p_dev_fds[dev_num] < 0) { + dti_onu_ctx->p_dev_fds[dev_num] = + dti_onu_dev_open(DRV_IO_GPON_ONU); + if (dti_onu_ctx->p_dev_fds[dev_num] < 0) { + *packet_err = DTI_eErrPortOpen; + + DTI_PRN_USR_ERR_NL(DTI_GPON_ONU, DTI_PRN_LEVEL_ERR, + ("ERROR: GPON ONU cntrl port open " + "- failed, dev_num = %d." + DTI_CRLF, dev_num)); + + return IFX_ERROR; + } + + /** + \todo Enable ONU_EVENT_SCE_BP_REACHED event handling + for all fds opened through DTI-connection + to support async. CLI messages for FW Debugger + with information of breakpoint halt (see + \ref DTI_GPON_ONU_Notification). + Find the way to set the mask of enabled events + for created fds via commands from DTI-client. + */ + mask.val = 1<p_dev_fds[dev_num], + FIO_ONU_EVENT_ENABLE_SET, + (IFX_ulong_t) & ex); + if (ret < 0) { + (void)dti_onu_dev_close(dti_onu_ctx->p_dev_fds[dev_num]); + DTI_PRN_USR_ERR_NL(DTI_GPON_ONU, DTI_PRN_LEVEL_ERR, + ("ERROR: GPON ONU event enable set " + "ioctl - failed, dev %d, " + "retCode = %d." + DTI_CRLF, dev_num, ret)); + return IFX_ERROR; + } + + /* add the new device to the FDSET struct */ + IFXOS_DevFdSet((IFX_uint32_t) dti_onu_ctx->p_dev_fds[dev_num], + &dti_onu_ctx->recv_dev_fds); + + if ((dti_onu_ctx->p_dev_fds[dev_num] + 1) > + dti_onu_ctx->recv_max_dev_fd) { + dti_onu_ctx->recv_max_dev_fd = + dti_onu_ctx->p_dev_fds[dev_num] + 1; + } + } + + return IFX_SUCCESS; +} + +/* + Check if the corresponding debug control device for the given line is already + open, if yes close the debug control device. + +\param + pDtiGmxCtx - points to the GPON ONU Device context. +\param + dev_num - line number +\param + packet_err - returns the result + +*/ +DTI_STATIC IFX_int_t dti_onu_cntrl_port_close(struct dti_dev_gpon_onu_drv_ctx + *dti_onu_ctx, + IFX_int_t dev_num, + DTI_PacketError_t *packet_err) +{ + if (dti_onu_ctx->p_dev_fds[dev_num] >= 0) { + /* remove this device form the FDSET struct */ + dti_onu_dev_fd_clear(dti_onu_ctx, dev_num); + + (void)dti_onu_dev_close(dti_onu_ctx->p_dev_fds[dev_num]); + dti_onu_ctx->p_dev_fds[dev_num] = -1; + } + + return IFX_SUCCESS; +} + +/* + Resets a GPON ONU device. + +\param + dti_onu_ctx - points to the GPON ONU Device context. +\param + dev_num - device number +\param + rst_mode - reset mode (both = 0, soft = 1, hard = 2) + +\return + -1 if something went wrong, else + size of the mailbox +*/ +DTI_STATIC IFX_int_t dti_onu_dev_reset(struct dti_dev_gpon_onu_drv_ctx + *dti_onu_ctx, + IFX_int_t dev_num, + DTI_DeviceResetModes_t rst_mode) +{ + IFX_int_t op_err = IFX_SUCCESS, ret_val = 0; + IFX_boolean_t do_soft_rst = IFX_FALSE, do_hard_rst = IFX_FALSE; + DTI_PacketError_t packet_err; + + switch (rst_mode) { + case DTI_eRstDefault: + do_soft_rst = IFX_TRUE; + do_hard_rst = IFX_TRUE; + break; + + case DTI_eRstSoftReset: + do_soft_rst = IFX_TRUE; + break; + + case DTI_eRstHardReset: + do_hard_rst = IFX_TRUE; + break; + default: + DTI_PRN_USR_ERR_NL(DTI_GPON_ONU, DTI_PRN_LEVEL_ERR, + ("ERROR: GPON ONU device reset - unknown " + "reset mode %d." DTI_CRLF, rst_mode)); + return IFX_ERROR; + } + + if (dti_onu_cntrl_port_open(dti_onu_ctx, dev_num, &packet_err) != + IFX_SUCCESS) { + DTI_PRN_USR_ERR_NL(DTI_GPON_ONU, DTI_PRN_LEVEL_ERR, + ("ERROR: GPON ONU device reset - dev_num %d," + " open error." DTI_CRLF, dev_num)); + + return IFX_ERROR; + } + + /* hard reset */ + if (do_hard_rst == IFX_TRUE) { + + DTI_PRN_USR_DBG_NL(DTI_GPON_ONU, DTI_PRN_LEVEL_HIGH, + ("GPON ONU device reset - do Hard Reset, " + "dev %d"DTI_CRLF, dev_num)); + + if ((ret_val = + DTI_DeviceControl(dti_onu_ctx->p_dev_fds[dev_num], + FIO_ONU_RESET, + (GPON_ONU_IOCTL_ARG) 0)) < 0) { + DTI_PRN_USR_ERR_NL(DTI_GPON_ONU, DTI_PRN_LEVEL_ERR, + ("ERROR: GPON ONU device reset " + "ioctl - Hard Rst failed, dev %d, " + "retCode = %d." + DTI_CRLF, dev_num, ret_val)); + + op_err = IFX_ERROR; + } + } + + /* soft reset */ + if (do_soft_rst == IFX_TRUE) { + DTI_PRN_USR_DBG_NL(DTI_GPON_ONU, DTI_PRN_LEVEL_HIGH, + ("GPON ONU device reset - do Soft Reset, " + "dev %d" + DTI_CRLF, dev_num)); + + if ((ret_val = + DTI_DeviceControl(dti_onu_ctx->p_dev_fds[dev_num], + FIO_ONU_RESET, + (GPON_ONU_IOCTL_ARG) 0)) < 0) { + DTI_PRN_USR_ERR_NL(DTI_GPON_ONU, DTI_PRN_LEVEL_ERR, + ("ERROR: GPON ONU device reset " + "ioctl - Soft Rst failed, dev %d, " + "retCode = %d." + DTI_CRLF, dev_num, ret_val)); + + op_err = IFX_ERROR; + } + } + + return op_err; +} + +/** + Clear a device FD from the FD_SET and recalc new max FD. + +*/ +DTI_STATIC IFX_void_t dti_onu_dev_fd_clear(struct dti_dev_gpon_onu_drv_ctx * + dti_onu_ctx, + IFX_int_t dev_num) +{ +#if defined(IFXOS_HAVE_DEV_FD_CLEAR) + IFX_int_t i, max_dev_fd = 0; + + DTI_DevFdClear(dti_onu_ctx->pDevFd[dev_num], + &dti_onu_ctx->recv_dev_fds); + + for (i = 0; i < dti_onu_ctx->num_of_devs; i++) { + if (dti_onu_ctx->pDevFd[i] >= 0) { + if ((DTI_DevFdIsSet(dti_onu_ctx->p_dev_fds[i], + &dti_onu_ctx->recv_dev_fds)) && + (dti_onu_ctx->p_dev_fds[i] > max_dev_fd)} { + max_dev_fd = dti_onu_ctx->p_dev_fds[i]; + } + } + } + + dti_onu_ctx->recv_max_dev_fd = max_dev_fd + 1; +#else + IFX_int_t i, max_dev_fd = 0; + + DTI_DevFdZero(&dti_onu_ctx->tmp_dev_fds); + dti_onu_ctx->recv_max_dev_fd = 0; + + for (i = 0; i < dti_onu_ctx->num_of_devs; i++) { + if ((dti_onu_ctx->p_dev_fds[i] >= 0) && (i != dev_num)) { + if (DTI_DevFdIsSet((IFX_uint32_t) dti_onu_ctx-> + p_dev_fds[i], + &dti_onu_ctx->recv_dev_fds)) { + DTI_DevFdSet((IFX_uint32_t) dti_onu_ctx-> + p_dev_fds[i], + &dti_onu_ctx->tmp_dev_fds); + + if (dti_onu_ctx->p_dev_fds[i] > max_dev_fd) { + max_dev_fd = dti_onu_ctx->p_dev_fds[i]; + } + } + } + } + + DTI_MemCpy(&dti_onu_ctx->recv_dev_fds, &dti_onu_ctx->tmp_dev_fds, + sizeof(IFXOS_devFd_set_t)); + dti_onu_ctx->recv_max_dev_fd = (max_dev_fd) ? (max_dev_fd + 1) : 0; + + DTI_DevFdZero(&dti_onu_ctx->tmp_dev_fds); + +#endif + return; +} + +/* + Request and return the device driver config. + +\param + sys_info - return DTI_DeviceSysInfo_t structure. +\param + pPortsPerDev - return ptr, ports per device. + +\return + IFX_SUCCESS if request was successful, else + IFX_ERROR +*/ +DTI_STATIC IFX_int_t dti_onu_drv_cfg_get(DTI_DeviceSysInfo_t *sys_info) +{ + sys_info->bControlAutoDevMsgSupport = IFX_TRUE; + + sys_info->numOfDevs = 1; + sys_info->portsPerDev = 1; + sys_info->ifPerDev = 1; + + if ((sys_info->numOfDevs > 0) && (sys_info->portsPerDev > 0)) { + sys_info->numOfPorts = + sys_info->numOfDevs * sys_info->portsPerDev; + sys_info->bValid = IFX_TRUE; + } + + return IFX_SUCCESS; +} + +/* ============================================================================ + Device Access Functions + ========================================================================= */ + +/** + Set a new debug level. +*/ +DTI_STATIC IFX_int_t dti_onu_printout_level_set(IFX_int_t new_dbg_level) +{ + + IFXOS_PRN_USR_LEVEL_SET(DTI_GPON_ONU, new_dbg_level); + + return IFX_SUCCESS; +} + +/** + Setup GPON ONU Module + +\param + dev_sys_info - points to the system infos +\param + dti_dev_ctx_out - pointer to return the allocated GPON ONU Modul struct. + +\return + If success IFX_SUCCESS, the context is returned via the dti_dev_ctx_out param + else IFX_ERROR. + +*/ +DTI_STATIC IFX_int_t dti_onu_module_setup(DTI_DeviceSysInfo_t *dev_sys_info, + DTI_DeviceCtx_t **dti_dev_ctx_out) +{ + IFX_int_t i, ctxSize = 0; + DTI_DeviceCtx_t *dti_dev_ctx = IFX_NULL; + struct dti_dev_gpon_onu_drv_ctx *onu_dev_ctx = IFX_NULL; + DTI_PTR_U u_dti_dev_ctx; + + if ((dti_dev_ctx_out == IFX_NULL) || (dev_sys_info == IFX_NULL)) { + DTI_PRN_USR_ERR_NL(DTI_GPON_ONU, DTI_PRN_LEVEL_ERR, + ("ERROR: GPON ONU Dev Module Setup - NULL " + "ptr args."DTI_CRLF)); + + return IFX_ERROR; + } + + if (*dti_dev_ctx_out != IFX_NULL) { + dti_dev_ctx = *dti_dev_ctx_out; + onu_dev_ctx = (struct dti_dev_gpon_onu_drv_ctx *) + dti_dev_ctx->pDevice; + } + + if (dti_dev_ctx != IFX_NULL) { + DTI_PRN_USR_ERR_NL(DTI_GPON_ONU, IFXOS_PRN_LEVEL_WRN, + ("WARNING: GPON ONU Dev Module Setup - " + "already done ."DTI_CRLF)); + + return IFX_ERROR; + } + + if (dti_onu_drv_cfg_get(dev_sys_info) != IFX_SUCCESS) { + DTI_PRN_USR_ERR_NL(DTI_GPON_ONU, DTI_PRN_LEVEL_ERR, + ("Error: GPON ONU Dev Module Setup - " + "driver config."DTI_CRLF)); + + return IFX_ERROR; + } + + DTI_PRN_USR_DBG_NL(DTI_GPON_ONU, DTI_PRN_LEVEL_HIGH, + ("GPON ONU Dev Module Setup - update driver config " + "(devs = %d, portsPerDev = %d)." + DTI_CRLF, dev_sys_info->numOfDevs, + dev_sys_info->portsPerDev)); + + ctxSize = sizeof(DTI_DeviceCtx_t) + + sizeof(struct dti_dev_gpon_onu_drv_ctx) + + (sizeof(IFX_int_t) * dev_sys_info->numOfDevs); + + ctxSize += + ((dev_sys_info->bControlAutoDevMsgSupport == + IFX_TRUE) ? (DTI_DEV_GPON_ONU_DEFAULT_MBOX_SIZE) : 0); + + u_dti_dev_ctx.pUInt8 = DTI_Malloc((IFX_uint_t) ctxSize); + + if (u_dti_dev_ctx.pUInt8 == IFX_NULL) { + DTI_PRN_USR_ERR_NL(DTI_GPON_ONU, DTI_PRN_LEVEL_ERR, + ("ERROR: GPON ONU Dev Module Setup - " + "Dev Struct alloc."DTI_CRLF)); + + return IFX_ERROR; + } + DTI_MemSet(u_dti_dev_ctx.pUInt8, 0x0, ctxSize); + + /* set context pointer */ + dti_dev_ctx = (DTI_DeviceCtx_t *) DTI_PTR_CAST_GET_ULONG(u_dti_dev_ctx); + if (dti_dev_ctx == IFX_NULL) { + DTI_Free(u_dti_dev_ctx.pUInt8); + + DTI_PRN_USR_ERR_NL(DTI_GPON_ONU, DTI_PRN_LEVEL_ERR, + ("ERROR: GPON ONU Dev Module Setup - Dev " + "Struct miss-aligned."DTI_CRLF)); + + return IFX_ERROR; + } + + /* set pDevice pointer */ + u_dti_dev_ctx.pUInt8 += sizeof(DTI_DeviceCtx_t); + onu_dev_ctx = (struct dti_dev_gpon_onu_drv_ctx *) + DTI_PTR_CAST_GET_UINT32(u_dti_dev_ctx); + if (onu_dev_ctx == IFX_NULL) { + DTI_Free(dti_dev_ctx); + + DTI_PRN_USR_ERR_NL(DTI_GPON_ONU, DTI_PRN_LEVEL_ERR, + ("ERROR: GPON ONU Dev Module Setup - " + "pDevice miss-aligned."DTI_CRLF)); + + return IFX_ERROR; + } + + /* set dev_fd pointer */ + u_dti_dev_ctx.pUInt8 += sizeof(struct dti_dev_gpon_onu_drv_ctx); + onu_dev_ctx->p_dev_fds = (IFX_int_t *) + DTI_PTR_CAST_GET_UINT32(u_dti_dev_ctx); + + if (onu_dev_ctx->p_dev_fds == IFX_NULL) { + DTI_Free(dti_dev_ctx); + + DTI_PRN_USR_ERR_NL(DTI_GPON_ONU, DTI_PRN_LEVEL_ERR, + ("ERROR: GPON ONU Dev Module Setup - devFds " + "miss-aligned."DTI_CRLF)); + + return IFX_ERROR; + } + + /* set auto msg buffer pointer */ + if (dev_sys_info->bControlAutoDevMsgSupport == IFX_TRUE) { + u_dti_dev_ctx.pUInt8 += + (sizeof(IFX_int_t) * dev_sys_info->numOfDevs); + onu_dev_ctx->recv_msg_buf = + (IFX_ulong_t *) DTI_PTR_CAST_GET_ULONG(u_dti_dev_ctx); + + if (onu_dev_ctx->recv_msg_buf == IFX_NULL) { + DTI_Free(dti_dev_ctx); + + DTI_PRN_USR_ERR_NL(DTI_GPON_ONU, DTI_PRN_LEVEL_ERR, + ("ERROR: GPON ONU Module Setup - " + "Gmx Auto MSg Buffer miss-aligned." + DTI_CRLF)); + + return IFX_ERROR; + } + onu_dev_ctx->recv_msg_buf_sz_byte = + DTI_DEV_GPON_ONU_DEFAULT_MBOX_SIZE; + } else { + onu_dev_ctx->recv_msg_buf = IFX_NULL; + onu_dev_ctx->recv_msg_buf_sz_byte = 0; + } + + for (i = 0; i < dev_sys_info->numOfDevs; i++) { + onu_dev_ctx->p_dev_fds[i] = -1; + } + + onu_dev_ctx->num_of_reg_access = + DTI_DEV_GPON_ONU_MAX_REGISTER_ACCESS_NUM; + onu_dev_ctx->num_of_dbg_access = + DTI_DEV_GPON_ONU_MAX_DEBUG_ACCESS_NUM; + + onu_dev_ctx->num_of_devs = dev_sys_info->numOfDevs; + onu_dev_ctx->if_per_dev = dev_sys_info->ifPerDev; + onu_dev_ctx->recv_dev_msg_support = + dev_sys_info->bControlAutoDevMsgSupport; + + dti_dev_ctx->bAutoDevMsgActive = IFX_TRUE; + dti_dev_ctx->pDevice = (IFX_void_t *) onu_dev_ctx; + *dti_dev_ctx_out = dti_dev_ctx; + + return IFX_SUCCESS; +} + +/** + Delete a GPON ONU Module. + - close all open devices + - free memory + +\param + dev_sys_info - points to the system infos +\param + dti_dev_ctx_out - contains the modul context. + +\return + If success IFX_SUCCESS, the context is freed and the ptr is set to IFX_NULL. + else IFX_ERROR. + +*/ +DTI_STATIC IFX_int_t dti_onu_module_delete(DTI_DeviceSysInfo_t *dev_sys_info, + DTI_DeviceCtx_t **dti_dev_ctx_out) +{ + IFX_int_t i; + DTI_DeviceCtx_t *dti_dev_ctx = IFX_NULL; + struct dti_dev_gpon_onu_drv_ctx *dti_onu_drv_ctx = IFX_NULL; + + if (dti_dev_ctx_out == IFX_NULL) { + DTI_PRN_USR_ERR_NL(DTI_GPON_ONU, DTI_PRN_LEVEL_ERR, + ("ERROR: GPON ONU Dev Module Delete - NULL " + "ptr args."DTI_CRLF)); + + return IFX_ERROR; + } + + if (*dti_dev_ctx_out == IFX_NULL) { + DTI_PRN_USR_ERR_NL(DTI_GPON_ONU, DTI_PRN_LEVEL_ERR, + ("ERROR: GPON ONU Dev Module Delete - NULL " + "ptr modul ctx."DTI_CRLF)); + + return IFX_ERROR; + } + + dti_dev_ctx = *dti_dev_ctx_out; + *dti_dev_ctx_out = IFX_NULL; + + dti_onu_drv_ctx = (struct dti_dev_gpon_onu_drv_ctx *) + dti_dev_ctx->pDevice; + for (i = 0; i < dti_onu_drv_ctx->num_of_devs; i++) { + if (dti_onu_drv_ctx->p_dev_fds[i] >= 0) { + (void)dti_onu_dev_close(dti_onu_drv_ctx->p_dev_fds[i]); + dti_onu_drv_ctx->p_dev_fds[i] = -1; + } + } + + DTI_Free(dti_dev_ctx); + return IFX_SUCCESS; +} + +/** + Write the Sytem Info of the current DTI Agent instance to the given buffer. + +\param + pAgentSysInfo - points to Sytem Info struct of the current agent + instance. +\param + sys_info_buf - points to the Sytem Info char buffer. +\param + buffer_size - buffer size. + +\return + Number of written bytes. +*/ +DTI_STATIC IFX_int_t dti_onu_sys_info_write(DTI_DeviceSysInfo_t *dev_sys_info, + IFX_char_t *sys_info_buf, + IFX_int_t buffer_size) +{ + IFX_int_t written_len = 0; + const IFX_char_t *board_name = DTI_BOARD_NAME_STR_GPON_ONU; + + (void)DTI_snprintf(&sys_info_buf[written_len], + buffer_size - written_len, + "VendorName=%s", DTI_VENDOR_NAME_STR); + written_len = (IFX_int_t) DTI_StrLen(&sys_info_buf[written_len]) + 1; + + if (dev_sys_info->bValid == IFX_TRUE) { + board_name = DTI_BOARD_NAME_STR_GPON_ONU; + } + + (void)DTI_snprintf(&sys_info_buf[written_len], + buffer_size - written_len, + "BoardName=%s", board_name); + written_len += (IFX_int_t) DTI_StrLen(&sys_info_buf[written_len]) + 1; + + (void)DTI_snprintf(&sys_info_buf[written_len], + buffer_size - written_len, + "BoardRevision=0.0"); + written_len += (IFX_int_t) DTI_StrLen(&sys_info_buf[written_len]) + 1; + + if (dev_sys_info->bValid == IFX_TRUE) { + (void)DTI_snprintf(&sys_info_buf[written_len], + buffer_size - written_len, "NumOfDevices=%d", + dev_sys_info->numOfDevs); + written_len += + (IFX_int_t) DTI_StrLen(&sys_info_buf[written_len]) + 1; + + (void)DTI_snprintf(&sys_info_buf[written_len], + buffer_size - written_len, "MaxChannel=%d", + dev_sys_info->numOfPorts); + written_len += + (IFX_int_t) DTI_StrLen(&sys_info_buf[written_len]) + 1; + } else { + (void)DTI_snprintf(&sys_info_buf[written_len], + buffer_size - written_len, + "NumOfDevices="); + written_len += + (IFX_int_t) DTI_StrLen(&sys_info_buf[written_len]) + 1; + + (void)DTI_snprintf(&sys_info_buf[written_len], + buffer_size - written_len, + "MaxChannel="); + written_len += + (IFX_int_t) DTI_StrLen(&sys_info_buf[written_len]) + 1; + } + + return written_len; +} + +/** + Do an device reset on the selected device. + +\param + dti_dev_ctx - points to the GPON ONU Device context. +\param + in_dev_reset - points to the DTI Host2Dev Reset struct. +\param + out_dev_reset - points to the DTI Dev2Host Reset struct. +\param + rst_mask_size_32 - number of mask elements (32 Bit). +\param + packet_err - return ptr, return the DTI Packet Error. + +\return + IFX_SUCCESS and returns the DTI Packet Error code. + IFX_ERROR currently no (only in case of non-DTI related errors). +*/ +DTI_STATIC IFX_int_t dti_onu_reset(DTI_DeviceCtx_t *dti_dev_ctx, + DTI_H2D_DeviceReset_t *in_dev_reset, + DTI_D2H_DeviceReset_t *out_dev_reset, + IFX_int_t rst_mask_size_32, + DTI_PacketError_t *packet_err) +{ + IFX_int_t dev_num; + IFX_uint32_t dev_mask = 0, result_mask = 0; + struct dti_dev_gpon_onu_drv_ctx *dti_onu_ctx = + (struct dti_dev_gpon_onu_drv_ctx *) dti_dev_ctx->pDevice; + + for (dev_num = 0; dev_num < dti_onu_ctx->num_of_devs; dev_num++) + dev_mask |= 0x1 << dev_num; + + if (~dev_mask & in_dev_reset->mask[0]) { + DTI_PRN_USR_ERR_NL(DTI_GPON_ONU, DTI_PRN_LEVEL_ERR, + ("WARNING: GPON ONU Dev Reset - ignore " + "invalid devs, mask 0x%08X, max = %d." + DTI_CRLF, in_dev_reset->mask[0], + dti_onu_ctx->num_of_devs)); + } + dev_mask = (in_dev_reset->mask[0] & dev_mask); + + switch (in_dev_reset->mode) { + case DTI_eRstDefault: + case DTI_eRstSoftReset: + case DTI_eRstHardReset: + break; + + default: + DTI_PRN_USR_ERR_NL(DTI_GPON_ONU, DTI_PRN_LEVEL_ERR, + ("ERROR: GPON ONU Dev Reset - unknown reset " + "mode %d."DTI_CRLF, + in_dev_reset->mode)); + + *packet_err = DTI_eErrInvalidParameters; + out_dev_reset->mode = in_dev_reset->mode; + out_dev_reset->mask[0] = in_dev_reset->mask[0]; + + return IFX_SUCCESS; + } + + for (dev_num = 0; dev_num < dti_onu_ctx->num_of_devs; dev_num++) { + if (dev_mask & (0x1 << dev_num)) { + if (dti_onu_dev_reset + (dti_onu_ctx, dev_num, + in_dev_reset->mode) == IFX_SUCCESS) { + result_mask |= (0x1 << dev_num); + } + } + } + + if (result_mask != in_dev_reset->mask[0]) { + DTI_PRN_USR_ERR_NL(DTI_GPON_ONU, DTI_PRN_LEVEL_ERR, + ("ERROR: GPON ONU Dev Reset - incomplete, " + "req = 0x%08X, done = 0x%08X, mode %d." + DTI_CRLF, in_dev_reset->mask, result_mask, + in_dev_reset->mode)); + + *packet_err = DTI_eErrPortOperation; + } else { + DTI_PRN_USR_DBG_NL(DTI_GPON_ONU, DTI_PRN_LEVEL_HIGH, + ("GPON ONU Dev Reset - done, mask = 0x%08X, " + "mode = %d."DTI_CRLF, + result_mask, in_dev_reset->mode)); + + *packet_err = DTI_eNoError; + } + + out_dev_reset->mode = in_dev_reset->mode; + out_dev_reset->mask[0] = result_mask; + + return IFX_SUCCESS; +} + +/** + Do a FW download on the selected devices + +\param + dti_dev_ctx - points to the GPON ONU Device context. +\param + dti_prot_srv_ctx - points to the DTI protocol server context. +\param + in_dev_dwnld - points to the DTI Host2Dev Download struct. +\param + out_dev_dwnld - points to the DTI Dev2Host Download struct. +\param + packet_err - return ptr, return the DTI Packet Error. + +\return + IFX_SUCCESS and returns the DTI Packet Error code. + IFX_ERROR currently no (only in case of non-DTI related errors). +*/ +DTI_STATIC IFX_int_t dti_onu_download(DTI_DeviceCtx_t *dti_dev_ctx, + DTI_ProtocolServerCtx_t *dti_prot_srv_ctx, + DTI_H2D_DeviceDownload_t *in_dev_dwnld, + DTI_D2H_DeviceDownload_t *out_dev_dwnld, + DTI_PacketError_t *packet_err) +{ + DTI_PRN_USR_ERR_NL(DTI_GPON_ONU, DTI_PRN_LEVEL_ERR, + ("ERROR: Device Download - not supported." + DTI_CRLF)); + out_dev_dwnld->errorMask = 0xFFFFFFFF; + + *packet_err = DTI_eErrUnknown; + return IFX_SUCCESS; +} + +/** + Open a given line device. + +\param + dti_dev_ctx - points to the GPON ONU Device context. +\param + line_num - line number. +\param + packet_err - return ptr, return the DTI Packet Error. + +\return + IFX_SUCCESS and returns the DTI Packet Error code. + IFX_ERROR currently no (only in case of non-DTI related errors). +*/ +DTI_STATIC IFX_int_t dti_onu_device_open(DTI_DeviceCtx_t *dti_dev_ctx, + IFX_int_t dev_num, + DTI_PacketError_t *packet_err) +{ + struct dti_dev_gpon_onu_drv_ctx *dti_onu_ctx = + (struct dti_dev_gpon_onu_drv_ctx *) dti_dev_ctx->pDevice; + + *packet_err = DTI_eNoError; + + if (dti_onu_cntrl_port_open(dti_onu_ctx, dev_num, packet_err) != + IFX_SUCCESS) { + DTI_PRN_USR_ERR_NL(DTI_GPON_ONU, DTI_PRN_LEVEL_ERR, + ("ERROR: GPON ONU Device Open - " + "dev_num %d, open error."DTI_CRLF, + dev_num)); + + return IFX_ERROR; + } + + return IFX_SUCCESS; +} + +/** + Close a given line device. + +\param + dti_dev_ctx - points to the GPON ONU Device context. +\param + line_num - line number. +\param + packet_err - return ptr, return the DTI Packet Error. + +\return + IFX_SUCCESS and returns the DTI Packet Error code. + IFX_ERROR currently no (only in case of non-DTI related errors). +*/ +DTI_STATIC IFX_int_t dti_onu_device_close(DTI_DeviceCtx_t *dti_dev_ctx, + IFX_int_t line_num, + DTI_PacketError_t *packet_err) +{ + struct dti_dev_gpon_onu_drv_ctx *dti_onu_ctx = + (struct dti_dev_gpon_onu_drv_ctx *) dti_dev_ctx->pDevice; + + *packet_err = DTI_eNoError; + + if (dti_onu_cntrl_port_close(dti_onu_ctx, line_num, packet_err) != + IFX_SUCCESS) { + DTI_PRN_USR_ERR_NL(DTI_GPON_ONU, DTI_PRN_LEVEL_ERR, + ("ERROR: GPON ONU Device Close - line %d, " + "close error."DTI_CRLF, line_num)); + + return IFX_ERROR; + } + + return IFX_SUCCESS; +} + +/** + Get / release the device lock. + +\param + dti_dev_ctx - points to the GPON ONU Device context. +\param + in_lock - points to the DTI Host2Dev Lock struct. +\param + out_lock - points to the DTI Dev2Host Lock struct. +\param + line_num - line number. +\param + packet_err - return ptr, return the DTI Packet Error. + +\return + IFX_SUCCESS and returns the DTI Packet Error code. + IFX_ERROR currently no (only in case of non-DTI related errors). +*/ +DTI_STATIC IFX_int_t dti_onu_register_lock(DTI_DeviceCtx_t *dti_dev_ctx, + DTI_H2D_DeviceLock_t *in_lock, + DTI_D2H_DeviceLock_t *out_lock, + IFX_int_t line_num, + DTI_PacketError_t *packet_err) +{ + out_lock->lock = 0; + *packet_err = DTI_eErrUnknown; + return IFX_SUCCESS; +} + +/** + Get a device register (MEI interface). + +\param + dti_dev_ctx - points to the GPON ONU Device context. +\param + in_reg_get - points to the DTI Host2Dev RegisterGet struct. +\param + out_reg_get - points to the DTI Dev2Host RegisterGet struct. +\param + line_num - line number. +\param + out_payl_sz_byte - return ptr, return the size of the read registers. + 0 in case of error +\param + packet_err - return ptr, return the DTI Packet Error. + +\return + IFX_SUCCESS and returns the DTI Packet Error code. + IFX_ERROR if the register read operation fails. +*/ +DTI_STATIC IFX_int_t dti_onu_register_get(DTI_DeviceCtx_t *dti_dev_ctx, + DTI_H2D_RegisterGet_t *in_reg_get, + DTI_D2H_RegisterGet_t *out_reg_get, + IFX_int_t dev_num, + IFX_uint32_t *out_payl_sz_byte, + DTI_PacketError_t *packet_err) +{ + int ret; + struct dti_dev_gpon_onu_drv_ctx *dti_onu_ctx = + (struct dti_dev_gpon_onu_drv_ctx *) dti_dev_ctx->pDevice; + struct fio_exchange ex; + struct onu_reg_addr reg; + struct onu_reg_val *val; + + ex.error = 0; + ex.length = sizeof(reg); + ex.p_data = ® + + reg.form = 32; + reg.address = in_reg_get->address; + + if (dti_onu_cntrl_port_open(dti_onu_ctx, dev_num, packet_err) != + IFX_SUCCESS) { + DTI_PRN_USR_ERR_NL(DTI_GPON_ONU, DTI_PRN_LEVEL_ERR, + ("ERROR: GPON ONU device register get - " + "dev_num %d, open error."DTI_CRLF, + dev_num)); + + return IFX_ERROR; + } + + ret = + DTI_DeviceControl(dti_onu_ctx->p_dev_fds[dev_num], + FIO_ONU_REGISTER_GET, (IFX_ulong_t) & ex); + + if (ret < 0) { + *packet_err = DTI_eErrUnknown; + return IFX_ERROR; + } + + val = (struct onu_reg_val *) & reg; + + out_reg_get->data[0] = val->value; + *out_payl_sz_byte = 4; + + return IFX_SUCCESS; +} + +/** + Get a device register (MEI interface). + +\param + dti_dev_ctx - points to the GMXD Device context. +\param + in_lock - points to the DTI Host2Dev RegisterGet struct. +\param + out_lock - points to the DTI Dev2Host RegisterGet struct. +\param + line_num - line number. +\param + packet_err - return ptr, return the DTI Packet Error. + +\return + IFX_SUCCESS DTI Packet Error code is "no error". + IFX_ERROR if the register read operation fails. +*/ +DTI_STATIC IFX_int_t dti_onu_register_set(DTI_DeviceCtx_t *dti_dev_ctx, + DTI_H2D_RegisterSet_t *in_reg_set, + IFX_int_t in_reg_set_sz_byte, + IFX_int_t dev_num, + DTI_PacketError_t *packet_err) +{ + int ret; + struct dti_dev_gpon_onu_drv_ctx *dti_onu_ctx = + (struct dti_dev_gpon_onu_drv_ctx *) dti_dev_ctx->pDevice; + struct fio_exchange ex; + struct onu_reg_addr_val reg; + + ex.error = 0; + ex.length = sizeof(reg); + ex.p_data = ® + + if (dti_onu_cntrl_port_open(dti_onu_ctx, dev_num, packet_err) != + IFX_SUCCESS) { + DTI_PRN_USR_ERR_NL(DTI_GPON_ONU, DTI_PRN_LEVEL_ERR, + ("ERROR: GPON ONU device register set - " + "dev_num %d, open error."DTI_CRLF, + dev_num)); + + return IFX_ERROR; + } + + reg.form = 32; + reg.address = in_reg_set->address; + reg.value = in_reg_set->data[0]; + + ret = + DTI_DeviceControl(dti_onu_ctx->p_dev_fds[dev_num], + FIO_ONU_REGISTER_SET, (IFX_ulong_t) & ex); + + if (ret < 0) { + *packet_err = DTI_eErrUnknown; + return IFX_ERROR; + } + + return IFX_SUCCESS; +} + +/** + Set a device configuration. + +\param + pDtiConCtx - points to the DTI connection setup. +\param + dti_dev_ctx - points to the GMXD Device context. +\param + in_cfg_set - points to the DTI Host2Dev ConfigSet struct. +\param + out_cfg_set - points to the DTI Dev2Host ConfigSet struct. +\param + line_num - line number. +\param + packet_err - return ptr, return the DTI Packet Error. + +\return + IFX_SUCCESS and returns the DTI Packet Error code. + IFX_ERROR currently no (only in case of non-DTI related errors). + +\remark + Changes of the autonomous message handling may have influence to the + connection settings (select wait time) +*/ +DTI_STATIC IFX_int_t dti_onu_cfg_set(DTI_DeviceCtx_t *dti_dev_ctx, + DTI_H2D_DeviceConfigSet_t *in_cfg_set, + DTI_D2H_DeviceConfigSet_t *out_cfg_set, + IFX_int_t line_num, + DTI_PacketError_t *packet_err) +{ + struct dti_dev_gpon_onu_drv_ctx *dti_onu_ctx = + (struct dti_dev_gpon_onu_drv_ctx *) dti_dev_ctx->pDevice; + + DTI_MemSet(out_cfg_set, 0x00, sizeof(DTI_D2H_DeviceConfigSet_t)); + out_cfg_set->key = in_cfg_set->key; + + switch (in_cfg_set->key) { + case DTI_eTimeout: + out_cfg_set->value = 0; + *packet_err = DTI_eErrUnknown; + break; + + case DTI_eAutonousMessages: + out_cfg_set->value = 0; + *packet_err = DTI_eErrUnknown; + break; + + case DTI_eMaxRegAccess: + if (in_cfg_set->value > + DTI_DEV_GPON_ONU_MAX_REGISTER_ACCESS_NUM) { + dti_onu_ctx->num_of_reg_access = + DTI_DEV_GPON_ONU_MAX_REGISTER_ACCESS_NUM; + *packet_err = DTI_eErrConfiguration; + } else { + dti_onu_ctx->num_of_reg_access = + (IFX_int_t) in_cfg_set->value; + *packet_err = DTI_eNoError; + } + out_cfg_set->value = + (IFX_uint32_t)dti_onu_ctx->num_of_reg_access; + break; + + case DTI_eMaxDebugAccess: + if (in_cfg_set->value > + DTI_DEV_GPON_ONU_MAX_DEBUG_ACCESS_NUM) { + dti_onu_ctx->num_of_dbg_access = + DTI_DEV_GPON_ONU_MAX_DEBUG_ACCESS_NUM; + *packet_err = DTI_eErrConfiguration; + } else { + dti_onu_ctx->num_of_dbg_access = + (IFX_int_t) in_cfg_set->value; + *packet_err = DTI_eNoError; + } + out_cfg_set->value = + (IFX_uint32_t)dti_onu_ctx->num_of_dbg_access; + break; + + /* R/O */ + case DTI_eMailboxSize: + default: + out_cfg_set->value = 0; + *packet_err = DTI_eErrUnknown; + break; + } + + return IFX_SUCCESS; +} + +/** + Get the device configuration of the given line. + +\param + dti_dev_ctx - points to the GPON ONU Device context. +\param + in_cfg_set - points to the DTI Host2Dev ConfigSet struct. +\param + out_cfg_set - points to the DTI Dev2Host ConfigSet struct. +\param + line_num - line number. +\param + packet_err - return ptr, return the DTI Packet Error. + +\return + IFX_SUCCESS and returns the DTI Packet Error code. + IFX_ERROR currently no (only in case of non-DTI related errors). +*/ +DTI_STATIC IFX_int_t dti_onu_cfg_get(DTI_DeviceCtx_t *dti_dev_ctx, + DTI_H2D_DeviceConfigGet_t *in_cfg_get, + DTI_D2H_DeviceConfigGet_t *out_cfg_get, + IFX_int_t line_num, + DTI_PacketError_t *packet_err) +{ + struct dti_dev_gpon_onu_drv_ctx *dti_onu_ctx = + (struct dti_dev_gpon_onu_drv_ctx *) dti_dev_ctx->pDevice; + + DTI_MemSet(out_cfg_get, 0x00, sizeof(DTI_D2H_DeviceConfigGet_t)); + out_cfg_get->key = in_cfg_get->key; + + switch (in_cfg_get->key) { + case DTI_eTimeout: + *packet_err = DTI_eErrUnknown; + break; + + case DTI_eAutonousMessages: + *packet_err = DTI_eErrUnknown; + break; + + case DTI_eMailboxSize: + *packet_err = DTI_eErrUnknown; + break; + + case DTI_eMaxRegAccess: + out_cfg_get->value = + (IFX_uint32_t)dti_onu_ctx->num_of_reg_access; + *packet_err = DTI_eNoError; + break; + + case DTI_eMaxDebugAccess: + out_cfg_get->value = + (IFX_uint32_t)dti_onu_ctx->num_of_dbg_access; + *packet_err = DTI_eNoError; + break; + + default: + *packet_err = DTI_eErrUnknown; + break; + } + + return IFX_SUCCESS; +} + +/** + Send a 32 Bit message to the device and wait for the responce. + +\param + dti_dev_ctx - points to the GPON ONU Device context. +\param + in_msg32_send - points to the DTI 32 bit message send struct. +\param + out_msg32_send - points to the DTI 32 bit message responce struct. +\param + line_num - line number. +\param + in_payl_sz_byte - payload size of the DTI packet [byte]. +\param + out_payl_sz_byte - return ptr, return the OUT payload size. +\param + packet_err - return ptr, return the DTI Packet Error. + +\return + IFX_SUCCESS and returns the DTI Packet Error code. + IFX_ERROR currently no (only in case of non-DTI related errors). +*/ +DTI_STATIC IFX_int_t dti_onu_msg32_send(DTI_DeviceCtx_t *dti_dev_ctx, + DTI_H2D_Message32_u *in_msg32_send, + DTI_D2H_Message32_u *out_msg32_send, + IFX_int_t dev_num, + IFX_int_t in_payl_sz_byte, + IFX_int_t *out_payl_sz_byte, + DTI_PacketError_t *packet_err) +{ + *packet_err = DTI_eErrUnknown; + + return IFX_SUCCESS; +} + +/** + Send a 16 Bit message to the device. + +\note + In the GPON ONU system you got not for all messages a responce!! + --> simple send the messages and retrun + --> a responce is send up per default as autonomious message. + +\param + dti_dev_ctx - points to the GPON ONU Device context. +\param + in_msg16_send - points to the DTI 16 bit message send struct. +\param + out_msg16_send - points to the DTI 16 bit message responce struct. +\param + line_num - line number. +\param + in_payl_sz_byte - payload size of the DTI packet [byte]. +\param + out_payl_sz_byte - return ptr, return the OUT payload size [byte]. +\param + packet_err - return ptr, return the DTI Packet Error. + +\return + IFX_SUCCESS and returns the DTI Packet Error code. + IFX_ERROR currently no (only in case of non-DTI related errors). +*/ +DTI_STATIC IFX_int_t dti_onu_msg16_send(DTI_DeviceCtx_t * dti_dev_ctx, + DTI_H2D_Message16_u *in_msg16_send, + DTI_D2H_Message16_u *out_msg16_send, + IFX_int_t line_num, + IFX_int_t in_payl_sz_byte, + IFX_int_t *out_payl_sz_byte, + DTI_PacketError_t *packet_err) +{ + *packet_err = DTI_eErrUnknown; + + return IFX_SUCCESS; +} + +/** + Send a 8 Bit message to the device and wait for the responce. + +\param + dti_dev_ctx - points to the GPON ONU Device context. +\param + in_msg8_send - points to the DTI 8 bit message send struct. +\param + out_msg8_send - points to the DTI 8 bit message responce struct. +\param + line_num - line number. +\param + in_payl_sz_byte - payload size of the DTI packet [byte]. +\param + out_payl_sz_byte - return ptr, return the OUT payload size. +\param + packet_err - return ptr, return the DTI Packet Error. + +\return + IFX_SUCCESS and returns the DTI Packet Error code. + IFX_ERROR currently no (only in case of non-DTI related errors). +*/ +DTI_STATIC IFX_int_t dti_onu_msg8_send(DTI_DeviceCtx_t *dti_dev_ctx, + DTI_H2D_Message8_u *in_msg8_send, + DTI_D2H_Message8_u *out_msg8_send, + IFX_int_t dev_num, + IFX_int_t in_payl_sz_byte, + IFX_int_t *out_payl_sz_byte, + DTI_PacketError_t *packet_err) +{ + struct dti_dev_gpon_onu_drv_ctx *dti_onu_ctx = + (struct dti_dev_gpon_onu_drv_ctx *) dti_dev_ctx->pDevice; + struct fio_exchange exchange; + + IFX_uint32_t cmd; + IFX_uint32_t data_sz; + + IFX_int_t ret = 0; + + dev_num = 0; + *packet_err = DTI_eErrUnknown; + + /* extract ioctl command and size */ + cmd = *(unsigned int *)&in_msg8_send->raw.data[0]; + data_sz = *(unsigned int *)&in_msg8_send->raw.data[4]; + + /* set outgoing packet size */ + *out_payl_sz_byte = 0; + + /** ensure that data_sz is valid */ + if ((IFX_uint32_t) in_payl_sz_byte < (IFX_uint32_t) 8) { + out_msg8_send->raw.sendResult = -1; + *packet_err = DTI_eNoError; + return IFX_SUCCESS; + } + + /* copy input data to output packet */ + memcpy(&out_msg8_send->raw.data[0], + &in_msg8_send->raw.data[8], in_payl_sz_byte - 8); + + /* fill exchange */ + exchange.error = 0; + exchange.length = data_sz; + exchange.p_data = &out_msg8_send->raw.data[0]; + + if (dti_onu_cntrl_port_open(dti_onu_ctx, dev_num, packet_err) != + IFX_SUCCESS) { + DTI_PRN_USR_ERR_NL(DTI_GPON_ONU, DTI_PRN_LEVEL_ERR, + ("ERROR: GPON ONU device message 8 send - " + "dev_num %d, open error."DTI_CRLF, + dev_num)); + + return IFX_ERROR; + } + /* execute ioctl command */ + ret = DTI_DeviceControl(dti_onu_ctx->p_dev_fds[dev_num], cmd, + (IFX_ulong_t) & exchange); + if (ret < 0) { + DTI_PRN_USR_ERR_NL(DTI_GPON_ONU, DTI_PRN_LEVEL_ERR, + ("ERROR: executing ioctl 0x%x, ret %d" + DTI_CRLF, cmd, ret)); + out_msg8_send->raw.sendResult = -3; + *packet_err = DTI_eNoError; + return IFX_SUCCESS; + } + + if (exchange.error) { + DTI_PRN_USR_ERR_NL(DTI_GPON_ONU, DTI_PRN_LEVEL_ERR, + ("ERROR: executing ioctl 0x%x, driver " + "error 0x%x"DTI_CRLF, + cmd, exchange.error)); + } + + /* set outgoing packet size */ + *out_payl_sz_byte = exchange.length + 4; + + /* result is OK */ + out_msg8_send->raw.sendResult = exchange.error; + *packet_err = DTI_eNoError; + + return IFX_SUCCESS; +} + +/** + Setup the trace buffer configuration (debug streams). + +\remark + This function releases current configuration if the Debug Streams are + already configured before the new config is set. + +\param + dti_dev_ctx - points to the GPON ONU Device context. +\param + in_trace_config_set - points to the DTI Host2Dev TraceConfigSet struct. +\param + out_trace_config_set - points to the DTI Dev2Host TraceConfigSet struct. +\param + line_num - line number. +\param + packet_err - return ptr, return the DTI Packet Error. + +\return + IFX_SUCCESS and returns the DTI Packet Error code. + IFX_ERROR debug stream setup failed. +*/ +DTI_STATIC IFX_int_t dti_onu_trace_buf_cfg_set(DTI_DeviceCtx_t + *dti_dev_ctx, + DTI_H2D_TraceConfigSet_t + *in_trace_config_set, + DTI_D2H_TraceConfigSet_t + *out_trace_config_set, + IFX_int_t line_num, + DTI_PacketError_t + *packet_err) +{ + DTI_PRN_USR_DBG_NL(DTI_GPON_ONU, DTI_PRN_LEVEL_HIGH, + ("WARNING: GPON ONU Dev TraceBufferConfigSet - not " + "implemented."DTI_CRLF)); + + out_trace_config_set->size = 0; + *packet_err = DTI_eErrUnknown; + + return IFX_SUCCESS; +} + +/** + Reset the current trace buffer (debug streams). + +\param + dti_dev_ctx - points to the GPON ONU Device context. +\param + line_num - line number. +\param + packet_err - return ptr, return the DTI Packet Error. + +\return + IFX_SUCCESS and returns the DTI Packet Error code. + IFX_ERROR debug stream setup failed. +*/ +DTI_STATIC IFX_int_t dti_onu_trace_buf_reset(DTI_DeviceCtx_t *dti_dev_ctx, + IFX_int_t line_num, + DTI_PacketError_t *packet_err) +{ + DTI_PRN_USR_DBG_NL(DTI_GPON_ONU, DTI_PRN_LEVEL_HIGH, + ("WARNING: GPON ONU Dev TraceBufferReset - not " + "implemented."DTI_CRLF)); + + *packet_err = DTI_eErrUnknown; + + return IFX_SUCCESS; +} + +/** + Setup the trace buffer configuration (debug streams). + +\param + dti_dev_ctx - points to the GPON ONU Device context. +\param + out_trace_status_get - points to the DTI Dev2Host TraceStatusGet struct. +\param + line_num - line number. +\param + packet_err - return ptr, return the DTI Packet Error. + +\return + IFX_SUCCESS and returns the DTI Packet Error code. + IFX_ERROR debug stream config request failed. +*/ +DTI_STATIC IFX_int_t dti_onu_trace_buf_status_get(DTI_DeviceCtx_t + *dti_dev_ctx, + DTI_D2H_TraceStatusGet_t + *out_trace_status_get, + IFX_int_t line_num, + DTI_PacketError_t + *packet_err) +{ + DTI_PRN_USR_DBG_NL(DTI_GPON_ONU, DTI_PRN_LEVEL_HIGH, + ("WARNING: GPON ONU Dev TraceBufferStatusGet - not " + "implemented."DTI_CRLF)); + + out_trace_status_get->mode = 0; + out_trace_status_get->size = 0; + out_trace_status_get->fill = 0; + + *packet_err = DTI_eErrUnknown; + + return IFX_SUCCESS; +} + +/** + Read data from the device via Debug Access (MEI Debug). + +\param + dti_dev_ctx - points to the GPON ONU Device context. +\param + in_trace_buf_get - points to the DTI Host2Dev RegisterGet struct. +\param + used_dti_packet_out - return ptr, points to the DTI Out packet. +\param + used_buffer_out_size - return value, points to the DTI Out packet size. +\param + line_num - line number. +\param + tr_buf_read_sz_byte - return ptr, return the number of read registers. +\param + packet_err - return ptr, return the DTI Packet Error. + +\remark + The function is called with the standard out packet. If the requested size + does not fit into this buffer, a corresponding buffer is allocated and used + for the ioctl call. The pointer to this out packet will be returned. + +\return + IFX_SUCCESS debug stream data read successful. + - returns the DTI Packet Error code. + - pointer to the used out package. + - size of the used out package. + IFX_ERROR data read failed. +*/ +DTI_STATIC IFX_int_t dti_onu_trace_buf_get(DTI_DeviceCtx_t *dti_dev_ctx, + DTI_H2D_TraceBufferGet_t + *in_trace_buf_get, + DTI_Packet_t + **used_dti_packet_out, + IFX_int_t *used_buffer_out_size, + IFX_int_t line_num, + IFX_int_t *tr_buf_read_sz_byte, + DTI_PacketError_t *packet_err) +{ + DTI_PRN_USR_DBG_NL(DTI_GPON_ONU, DTI_PRN_LEVEL_HIGH, + ("WARNING: GPON ONU Dev TraceBufferGet - not " + "implemented."DTI_CRLF)); + + *tr_buf_read_sz_byte = 0; + *packet_err = DTI_eErrUnknown; + + return IFX_SUCCESS; +} + +/** + Read data from the device via Debug Access (MEI Debug). + +\param + dti_dev_ctx - points to the GPON ONU Device context. +\param + in_dbg_get - points to the DTI Host2Dev RegisterGet struct. +\param + out_dbg_get - points to the DTI Dev2Host RegisterGet struct. +\param + line_num - line number. +\param + dbg_read_count - return ptr, return the number of read registers. +\param + packet_err - return ptr, return the DTI Packet Error. + +\return + IFX_SUCCESS and returns the DTI Packet Error code. + IFX_ERROR currently no (only in case of non-DTI related errors). +*/ +DTI_STATIC IFX_int_t dti_onu_debug_read(DTI_DeviceCtx_t *dti_dev_ctx, + DTI_H2D_DebugRead_t *in_dbg_get, + DTI_D2H_DebugRead_t *out_dbg_get, + IFX_int_t line_num, + IFX_int_t *dbg_read_count, + DTI_PacketError_t *packet_err) +{ + DTI_PRN_USR_DBG_NL(DTI_GPON_ONU, DTI_PRN_LEVEL_HIGH, + ("WARNING: GPON ONU Dev DebugRead - not implemented." + DTI_CRLF)); + + *dbg_read_count = 0; + *packet_err = DTI_eErrUnknown; + + return IFX_SUCCESS; +} + +/** + Write data to the device via Debug Access (MEI Debug). + +\param + dti_dev_ctx - points to the GPON ONU Device context. +\param + in_dbg_set - points to the DTI Host2Dev RegisterGet struct. +\param + out_dbg_get_nu - not used. +\param + line_num - line number. +\param + dbg_write_count - return ptr, return the number of read registers. +\param + packet_err - return ptr, return the DTI Packet Error. + +\return + IFX_SUCCESS and returns the DTI Packet Error code. + IFX_ERROR currently no (only in case of non-DTI related errors). +*/ +DTI_STATIC IFX_int_t dti_onu_debug_write(DTI_DeviceCtx_t *dti_dev_ctx, + DTI_H2D_DebugWrite_t *in_dbg_set, + IFX_uint32_t *out_dbg_get_nu, + IFX_int_t line_num, + IFX_int_t *dbg_write_count, + DTI_PacketError_t *packet_err) +{ + DTI_PRN_USR_DBG_NL(DTI_GPON_ONU, DTI_PRN_LEVEL_HIGH, + ("WARNING: GPON ONU Dev DebugRead - not implemented." + DTI_CRLF)); + + *dbg_write_count = 0; + *packet_err = DTI_eErrUnknown; + + return IFX_SUCCESS; +} + +/** + The notification is read from the device (driver) and a corresponding + DTI packet is created and sent to the upper DTI Client + +\param + pDev - points to the device context. +\param + dti_con - points to the established DTI Connection data. +\param + line_num - line number. +\param + out_buffer - points to the DTI packet out buffer to create a DTI + packet. +\param + out_buffer_sz_byte - DTI out buffer size [byte] + +\return + IFX_SUCCESS if the DTI packet has been sent. + IFX_ERROR DTI packet has not been sent. + +\remarks + At first the device msg will be read out to free the internal driver buffer. + This is done independant on the established connection. +*/ +IFX_int_t DTI_GPON_ONU_Notification(struct dti_dev_gpon_onu_drv_ctx + *dti_onu_ctx, + IFX_int_t dev_num, + const DTI_Connection_t *dti_con, + IFX_char_t *out_buffer, + IFX_int_t out_buffer_sz_byte) +{ + DTI_PacketError_t packet_err = DTI_eNoError; + DTI_Packet_t *auto_msg_packet = (DTI_Packet_t *) out_buffer; + struct fio_exchange exchange; + IFX_int_t ret; + struct onu_fifo_data *fifo_data; + IFX_int_t payload_size; + + exchange.p_data = &auto_msg_packet->payload[0]; + exchange.length = 0; + + if (dti_onu_ctx == NULL) + return IFX_ERROR; + + ret = + DTI_DeviceControl(dti_onu_ctx->p_dev_fds[dev_num], + FIO_ONU_EVENT_FIFO, (IFX_ulong_t) & exchange); + if (ret < 0) + return IFX_ERROR; + + if (exchange.length < sizeof(struct onu_fifo_header)) + return IFX_ERROR; + + fifo_data = (struct onu_fifo_data *) exchange.p_data; + payload_size = out_buffer_sz_byte - sizeof(auto_msg_packet->header); + if (fifo_data->header.id == ONU_EVENT_SCE_BP_REACHED) + { + /** + The values of snprintf() function arguments + are stored in stack, so, it is correct to write + the new values in the buffer the old values were + read from. + */ + payload_size = snprintf((IFX_char_t *)&auto_msg_packet->payload[0], + payload_size, + "errorcode=%d tid=%d addr=%d ", + exchange.error, + fifo_data->data.sce_break_point.tid, + fifo_data->data.sce_break_point.addr); + + (void)DTI_headerPacketTypeSet(auto_msg_packet, + DTI_PacketType_eCliString, + DTI_e8Bit, + payload_size); + } + else + { + (void)DTI_headerPacketTypeSet(auto_msg_packet, + DTI_PacketType_eMessageSend, DTI_e8Bit, + exchange.length); + } + + /* complete header setup */ + auto_msg_packet->header.port = dev_num; + auto_msg_packet->header.tan = 0; + auto_msg_packet->header.error = packet_err; + + if (DTI_packetSend(dti_con, auto_msg_packet) != IFX_SUCCESS) + return IFX_ERROR; + + return IFX_SUCCESS; +} + +/** + Check and process for Device Autonomous Messages. + The Auto Msg is read form the device (driver) and a corresponding + DTI packet is created and sent to the upper DTI Client + +\param + dti_dev_ctx - points to the Device context. +\param + dti_con - points to the established DTI Connection data. +\param + dev_select_wait_ms - wait time [ms] for the device select operation. +\param + out_buffer - points to the DTI packet out buffer to create a DTI + packet. +\param + out_buffer_sz_byte - DTI out buffer size [byte] + +\return + IFX_SUCCESS if the DTI packet has been sent. + IFX_ERROR DTI packet has not been sent. + +\remarks + At first the device msg will be read out to free the internal driver buffer. + This is done independant on the established connection. +*/ +DTI_STATIC IFX_int_t dti_onu_auto_msg_process(DTI_DeviceCtx_t *dti_dev_ctx, + const DTI_Connection_t *dti_con, + IFX_uint32_t dev_select_wait_ms, + IFX_char_t *out_buffer, + IFX_int_t out_buffer_sz_byte) +{ + IFX_int_t ret_val = IFX_SUCCESS; + struct dti_dev_gpon_onu_drv_ctx *dti_onu_ctx = + (struct dti_dev_gpon_onu_drv_ctx *) dti_dev_ctx->pDevice; + + if (dti_onu_ctx->recv_max_dev_fd == 0) + /* min DevFd = 0 --> maxFD = 0 +1, no device enabled */ + return IFX_SUCCESS; + + DTI_DevFdZero(&dti_onu_ctx->tmp_dev_fds); + ret_val = DTI_DeviceSelect((IFX_uint32_t) dti_onu_ctx->recv_max_dev_fd, + &dti_onu_ctx->recv_dev_fds, + &dti_onu_ctx->tmp_dev_fds, + dev_select_wait_ms); + + if (ret_val < 0) + return IFX_ERROR; + + if (ret_val == 0) + return IFX_SUCCESS; + + return DTI_GPON_ONU_Notification(dti_onu_ctx, 0, dti_con, out_buffer, + out_buffer_sz_byte); +} + +DTI_STATIC IFX_int_t dti_onu_win_easy_cli_access(DTI_DeviceCtx_t *dti_dev_ctx, + IFX_int_t line_num, + const IFX_uint8_t *data_in, + const IFX_uint32_t size_in, + IFX_uint8_t *data_out, + const IFX_uint32_t size_out, + DTI_PacketError_t *packet_err) +{ + DTI_PRN_USR_DBG_NL(DTI_GPON_ONU, DTI_PRN_LEVEL_HIGH, + ("WARNING: GPON ONU Dev WinEasyCiAccess - not " + "implemented."DTI_CRLF)); + + *packet_err = DTI_eErrUnknown; + return IFX_SUCCESS; +} + +IFX_int_t dti_onu_cli_send(IFX_void_t * cb_ctx, const IFX_char_t *cmd_in, + IFX_char_t *result_out, IFX_int_t *result_sz_byte, + IFX_int_t *result_code) +{ + struct dti_cli_ctx *cli_ctx = (struct dti_cli_ctx *) cb_ctx; + struct fio_exchange exchange; + IFX_int_t ret = 0; + + *result_sz_byte = 0; + + if (cli_ctx->dev_fd == -1) { + DTI_PRN_USR_DBG_NL(DTI_GPON_ONU, DTI_PRN_LEVEL_HIGH, + ("GPON ONU CLI Send - open device for first " + "use."DTI_CRLF)); + + cli_ctx->dev_fd = dti_onu_dev_open(cli_ctx->dev_name); + } + if (cli_ctx->dev_fd == -1) { + return IFX_ERROR; + } + + exchange.error = 0; + strcpy(result_out, cmd_in); + + /* driver has to react on 'vig' */ +#if 0 + /** + \todo make driver accept vig instead of vg (from DSLT) */ + if (strcmp(result_out, "vig") == 0) + strcpy(result_out, "vg"); +#endif + + exchange.p_data = result_out; + exchange.length = (IFX_uint32_t) strlen(result_out) + 1; + + ret = DTI_DeviceControl(cli_ctx->dev_fd, FIO_ONU_CLI, + (IFX_ulong_t) & exchange); + + if (ret < 0 || exchange.error != 0) + return IFX_ERROR; + + strcpy(result_out, exchange.p_data); + *result_sz_byte = exchange.length; + + return IFX_SUCCESS; +} + +#endif /* DEVICE_GPON_ONU */ diff --git a/src/dti_agent_onu.h b/src/dti_agent_onu.h new file mode 100644 index 0000000..b5d0230 --- /dev/null +++ b/src/dti_agent_onu.h @@ -0,0 +1,69 @@ +#ifndef _DTI_AGENT_ONU_H +#define _DTI_AGENT_ONU_H +/****************************************************************************** + + Copyright (c) 2011 + Lantiq Deutschland GmbH + Am Campeon 3; 85579 Neubiberg, Germany + + For licensing information, see the file 'LICENSE' in the root folder of + this software module. + +******************************************************************************/ +#ifdef __cplusplus +extern "C" { +#endif + +/** \file + GPON ONU device, control struct for GPON Optic access and handling. +*/ + +/* ========================================================================== + includes + ========================================================================== */ +#include "ifx_types.h" +#include "ifxos_debug.h" +#include "ifxos_device_access.h" + +/* ========================================================================== + defines + ========================================================================== */ + +/** DTI Device Interface Name */ +#define DTI_DEV_GPON_ONU_IF_NAME "GPON-ONU" + +#define DTI_BOARD_NAME_STR_GPON_ONU "GPON Board (ONU)" + +#define DTI_GPON_ONU_START_ID 0 +#define DTI_GPON_ONU_MAX_ID 3 + +/** Max number of register accesses per packet */ +#define DTI_DEV_GPON_ONU_MAX_REGISTER_ACCESS_NUM 0x10 +/** Max number of debug accesses per packet */ +#define DTI_DEV_GPON_ONU_MAX_DEBUG_ACCESS_NUM 0x10 + +/** default GPON ONU device mailbox size */ +#define DTI_DEV_GPON_ONU_DEFAULT_MBOX_SIZE 0x100 + +/* ========================================================================== + macro + ========================================================================== */ + +/* ========================================================================== + types + ========================================================================== */ + +/* ========================================================================== + exports + ========================================================================== */ + +extern IFX_int_t dti_onu_cli_send(IFX_void_t *cb_ctx, + const IFX_char_t *cmd_in, + IFX_char_t *result_out, + IFX_int_t *result_sz_byte, + IFX_int_t *result_code); + +#ifdef __cplusplus +} +#endif +#endif /* _DTI_AGENT_ONU_H */ diff --git a/src/dti_agent_onu_ctx.h b/src/dti_agent_onu_ctx.h new file mode 100644 index 0000000..e475dc9 --- /dev/null +++ b/src/dti_agent_onu_ctx.h @@ -0,0 +1,94 @@ + +/****************************************************************************** + + Copyright (c) 2011 + Lantiq Deutschland GmbH + Am Campeon 3; 85579 Neubiberg, Germany + + For licensing information, see the file 'LICENSE' in the root folder of + this software module. + +******************************************************************************/ +#ifndef _DTI_AGENT_ONU_CTX_H +#define _DTI_AGENT_ONU_CTX_H + +#ifdef __cplusplus +extern "C" { +#endif + +/** \file + GPON ONU device context, control struct for GPON Optic access and handling. +*/ + +/* ========================================================================== + includes + ========================================================================== */ +#include "ifx_types.h" +#include "ifxos_debug.h" +#include "ifxos_device_access.h" + +/* ========================================================================== + defines + ========================================================================== */ + +/* ========================================================================== + macro + ========================================================================== */ + +/* ========================================================================== + types + ========================================================================== */ + +/** + GPON ONU Driver Control Struct + + A GPON ONU system is identified by its + - number of devices + + To access a device via the GPON ONU driver the driver provides for each + interface a device. + +*/ +struct dti_dev_gpon_onu_drv_ctx { + /** number of devices */ + IFX_int_t num_of_devs; + + /** interfaces per device */ + IFX_int_t if_per_dev; + + /** points to the array of devices fds (number of devices * interfaces + per device) */ + IFX_int_t *p_dev_fds; + + /* + DTI Config + */ + /** max number of register requests / sets */ + IFX_int_t num_of_reg_access; + /** max number of debug requests / sets */ + IFX_int_t num_of_dbg_access; + + /** recv msg handling - supported */ + IFX_boolean_t recv_dev_msg_support; + /** receive msg handling - max device fd for select */ + IFX_int_t recv_max_dev_fd; + /** receive msg handling - device FDSET */ + IFXOS_devFd_set_t recv_dev_fds; + /** receive handling - for temporary use, device FDSET */ + IFXOS_devFd_set_t tmp_dev_fds; + /** receive msg handling - recv buffer for upcoming msg's */ + IFX_ulong_t *recv_msg_buf; + /** auto msg handling - size of the modem message buffer for NFC + handling */ + IFX_int_t recv_msg_buf_sz_byte; + +}; + +/* ========================================================================== + exports + ========================================================================== */ + +#ifdef __cplusplus +} +#endif +#endif /* _DTI_AGENT_ONU_CTX_H */ diff --git a/src/dti_agent_optic.c b/src/dti_agent_optic.c new file mode 100644 index 0000000..56c12de --- /dev/null +++ b/src/dti_agent_optic.c @@ -0,0 +1,2008 @@ +/****************************************************************************** + + Copyright (c) 2011 + Lantiq Deutschland GmbH + Am Campeon 3; 85579 Neubiberg, Germany + + For licensing information, see the file 'LICENSE' in the root folder of + this software module. + +******************************************************************************/ + +/** \file + Debug and Trace Interface - Basic Protocol Packet Handling. +*/ + +/* ============================================================================ + Includes + ========================================================================= */ +#include "dti_osmap.h" + +#if defined(DEVICE_GPON_OPTIC) + +#include "drv_optic_interface.h" + +#include "ifx_dti_protocol.h" +#include "ifx_dti_protocol_device.h" +# +#include "dti_device.h" +#include "dti_agent_main.h" +#include "dti_agent_optic.h" +#include "dti_agent_optic_ctx.h" +#include "dti_agent_cli.h" + +/* ============================================================================ + Defines + ========================================================================= */ + +#ifdef DTI_STATIC +# undef DTI_STATIC +#endif + +#ifdef DTI_DEBUG +# define DTI_STATIC +#else +# define DTI_STATIC static +#endif + +#ifndef _IOWR +# define _IOWR _IOW +#endif + +#define GPON_OPTIC_IOCTL_ARG unsigned long + +/* ============================================================================ + Local Function Declaration + ========================================================================= */ + +DTI_STATIC IFX_int_t dti_optic_dev_open(IFX_char_t *dev_name); + +DTI_STATIC IFX_int_t dti_optic_dev_close(IFX_int_t dev_fd); + +DTI_STATIC IFX_int_t dti_optic_dev_reset(struct dti_dev_gpon_optic_drv_ctx + *dti_optic_ctx, + IFX_int_t dev_num, + DTI_DeviceResetModes_t rst_mode); + +DTI_STATIC IFX_void_t dti_optic_dev_fd_clear(struct dti_dev_gpon_optic_drv_ctx + *dti_optic_ctx, + IFX_int_t dev_num); + +DTI_STATIC IFX_int_t dti_optic_drv_cfg_get(DTI_DeviceSysInfo_t *sys_info); + +/* +DTI_STATIC IFX_int_t DTI_GEMINAX_configGet_MbSize( + DTI_DEV_GeminaxDriverCtx_t *pDtiGmxCtx, + IFX_int_t line_num, + DTI_PacketError_t *packet_err); + +DTI_STATIC IFX_int_t DTI_GEMINAX_msgRecv( + DTI_DEV_GeminaxDriverCtx_t *pDtiGmxCtx, + const DTI_Connection_t *dti_con, + IFX_int_t dev_num, + IFX_char_t *out_buffer, + IFX_int_t out_buffer_sz_byte); +*/ + +/* ============================================================================ + Device Access Functions + ========================================================================= */ +DTI_STATIC IFX_int_t dti_optic_printout_level_set(IFX_int_t new_dbg_level); + +DTI_STATIC IFX_int_t dti_optic_module_setup(DTI_DeviceSysInfo_t *dev_sys_info, + DTI_DeviceCtx_t **dti_dev_ctx_out); + +DTI_STATIC IFX_int_t dti_optic_module_delete(DTI_DeviceSysInfo_t *dev_sys_info, + DTI_DeviceCtx_t **dti_dev_ctx_out); + +DTI_STATIC IFX_int_t dti_optic_sys_info_write(DTI_DeviceSysInfo_t *dev_sys_info, + IFX_char_t *sys_info_buf, + IFX_int_t buffer_size); + +DTI_STATIC IFX_int_t dti_optic_reset(DTI_DeviceCtx_t *dti_dev_ctx, + DTI_H2D_DeviceReset_t *in_dev_reset, + DTI_D2H_DeviceReset_t *out_dev_reset, + IFX_int_t rst_mask_size_32, + DTI_PacketError_t *packet_err); + +DTI_STATIC IFX_int_t dti_optic_download(DTI_DeviceCtx_t *dti_dev_ctx, + DTI_ProtocolServerCtx_t + *dti_prot_srv_ctx, + DTI_H2D_DeviceDownload_t *in_dev_dwnld, + DTI_D2H_DeviceDownload_t *out_dev_dwnld, + DTI_PacketError_t *packet_err); + +DTI_STATIC IFX_int_t dti_optic_device_open(DTI_DeviceCtx_t *dti_dev_ctx, + IFX_int_t dev_num, + DTI_PacketError_t *packet_err); + +DTI_STATIC IFX_int_t dti_optic_device_close(DTI_DeviceCtx_t *dti_dev_ctx, + IFX_int_t dev_num, + DTI_PacketError_t *packet_err); + +DTI_STATIC IFX_int_t dti_optic_register_lock(DTI_DeviceCtx_t *dti_dev_ctx, + DTI_H2D_DeviceLock_t *in_lock, + DTI_D2H_DeviceLock_t *out_lock, + IFX_int_t dev_num, + DTI_PacketError_t *packet_err); + +DTI_STATIC IFX_int_t dti_optic_register_get(DTI_DeviceCtx_t *dti_dev_ctx, + DTI_H2D_RegisterGet_t *in_reg_get, + DTI_D2H_RegisterGet_t *out_reg_get, + IFX_int_t dev_num, + IFX_uint32_t *out_payl_sz_byte, + DTI_PacketError_t *packet_err); + +DTI_STATIC IFX_int_t dti_optic_register_set(DTI_DeviceCtx_t *dti_dev_ctx, + DTI_H2D_RegisterSet_t *in_reg_set, + IFX_int_t in_reg_set_sz_byte, + IFX_int_t dev_num, + DTI_PacketError_t *packet_err); + +DTI_STATIC IFX_int_t dti_optic_cfg_set(DTI_DeviceCtx_t *dti_dev_ctx, + DTI_H2D_DeviceConfigSet_t *in_cfg_set, + DTI_D2H_DeviceConfigSet_t *out_cfg_set, + IFX_int_t dev_num, + DTI_PacketError_t *packet_err); + +DTI_STATIC IFX_int_t dti_optic_cfg_get(DTI_DeviceCtx_t *dti_dev_ctx, + DTI_H2D_DeviceConfigGet_t *in_cfg_get, + DTI_D2H_DeviceConfigGet_t *out_cfg_get, + IFX_int_t dev_num, + DTI_PacketError_t *packet_err); + +DTI_STATIC IFX_int_t dti_optic_msg8_send(DTI_DeviceCtx_t *dti_dev_ctx, + DTI_H2D_Message8_u *in_msg8_send, + DTI_D2H_Message8_u *out_msg8_send, + IFX_int_t dev_num, + IFX_int_t in_payl_sz_byte, + IFX_int_t *out_payl_sz_byte, + DTI_PacketError_t *packet_err); + +DTI_STATIC IFX_int_t dti_optic_msg16_send(DTI_DeviceCtx_t *dti_dev_ctx, + DTI_H2D_Message16_u *in_msg16_send, + DTI_D2H_Message16_u *out_msg16_send, + IFX_int_t dev_num, + IFX_int_t in_payl_sz_byte, + IFX_int_t *out_payl_sz_byte, + DTI_PacketError_t *packet_err); + +DTI_STATIC IFX_int_t dti_optic_msg32_send(DTI_DeviceCtx_t *dti_dev_ctx, + DTI_H2D_Message32_u *in_msg32_send, + DTI_D2H_Message32_u *out_msg32_send, + IFX_int_t dev_num, + IFX_int_t in_payl_sz_byte, + IFX_int_t *out_payl_sz_byte, + DTI_PacketError_t *packet_err); + +DTI_STATIC IFX_int_t dti_optic_trace_buf_cfg_set(DTI_DeviceCtx_t *dti_dev_ctx, + DTI_H2D_TraceConfigSet_t + *in_trace_config_set, + DTI_D2H_TraceConfigSet_t + *out_trace_config_set, + IFX_int_t dev_num, + DTI_PacketError_t *packet_err); + +DTI_STATIC IFX_int_t dti_optic_trace_buf_reset(DTI_DeviceCtx_t *dti_dev_ctx, + IFX_int_t dev_num, + DTI_PacketError_t *packet_err); + +DTI_STATIC IFX_int_t dti_optic_trace_buf_status_get(DTI_DeviceCtx_t + *dti_dev_ctx, + DTI_D2H_TraceStatusGet_t + *out_trace_status_get, + IFX_int_t dev_num, + DTI_PacketError_t + *packet_err); + +DTI_STATIC IFX_int_t dti_optic_trace_buf_get(DTI_DeviceCtx_t *dti_dev_ctx, + DTI_H2D_TraceBufferGet_t + *in_trace_buf_get, + DTI_Packet_t **used_dti_packet_out, + IFX_int_t *used_buffer_out_size, + IFX_int_t dev_num, + IFX_int_t *tr_buf_read_sz_byte, + DTI_PacketError_t *packet_err); + +DTI_STATIC IFX_int_t dti_optic_debug_read(DTI_DeviceCtx_t *dti_dev_ctx, + DTI_H2D_DebugRead_t *in_dbg_get, + DTI_D2H_DebugRead_t *out_dbg_get, + IFX_int_t dev_num, + IFX_int_t *dbg_read_count, + DTI_PacketError_t *packet_err); + +DTI_STATIC IFX_int_t dti_optic_debug_write(DTI_DeviceCtx_t *dti_dev_ctx, + DTI_H2D_DebugWrite_t *in_dbg_set, + IFX_uint32_t *out_dbg_get_nu, + IFX_int_t dev_num, + IFX_int_t *dbg_write_count, + DTI_PacketError_t *packet_err); + +DTI_STATIC IFX_int_t dti_optic_auto_msg_process(DTI_DeviceCtx_t *dti_dev_ctx, + const DTI_Connection_t *dti_con, + IFX_uint32_t dev_select_wait_ms, + IFX_char_t *out_buffer, + IFX_int_t out_buffer_sz_byte); + +DTI_STATIC IFX_int_t dti_optic_win_easy_cli_access(DTI_DeviceCtx_t *dti_dev_ctx, + IFX_int_t dev_num, + const IFX_uint8_t *data_in, + const IFX_uint32_t size_in, + IFX_uint8_t *data_out, + const IFX_uint32_t size_out, + DTI_PacketError_t + *packet_err); + +/* ============================================================================ + Variables + ========================================================================= */ + +/* Create device debug module - user part */ +IFXOS_PRN_USR_MODULE_CREATE(DTI_GPON_OPTIC, DTI_PRN_LEVEL_HIGH); + +#if (DTI_DEVICE_INTERFACE_VERSION != 0x00010200) +#error "wrong DTI_DEVICE_INTERFACE_VERSION!" +#endif + + +/** + Collection of all available device access functions. +*/ +DTI_DeviceAccessFct_t dti_dev_access_fct_gpon_optic = { + sizeof(DTI_DeviceAccessFct_t), /* structure check */ + DTI_DEVICE_INTERFACE_VERSION, /* device interface version */ + DTI_DEV_GPON_OPTIC_IF_NAME, /* device name */ + + dti_optic_printout_level_set, + dti_optic_module_setup, + dti_optic_module_delete, + dti_optic_sys_info_write, + + dti_optic_reset, + dti_optic_download, + dti_optic_device_open, + dti_optic_device_close, + dti_optic_register_lock, + dti_optic_register_get, + dti_optic_register_set, + dti_optic_cfg_set, + dti_optic_cfg_get, + dti_optic_msg16_send, + dti_optic_msg32_send, + dti_optic_trace_buf_cfg_set, + dti_optic_trace_buf_reset, + dti_optic_trace_buf_status_get, + dti_optic_trace_buf_get, + dti_optic_debug_read, + dti_optic_debug_write, + dti_optic_auto_msg_process, + dti_optic_win_easy_cli_access, + +#if (DTI_DEVICE_INTERFACE_VERSION > 0x00000100) + dti_optic_msg8_send, +#endif +}; + +/* ============================================================================ + Local Function + ========================================================================= */ + +/** + Open a control device of the GPON Optic driver + +\param + dev_num - debug device number +\param + dev_name - GPON Optic device base name + +\return + if success, a valid device fd + else IFX_ERROR. +*/ +DTI_STATIC IFX_int_t dti_optic_dev_open(IFX_char_t *dev_name) +{ + IFX_int_t dev_fd = -1, conn_num; + IFX_char_t buf[128]; + + for (conn_num = DTI_GPON_OPTIC_START_ID; + conn_num <= DTI_GPON_OPTIC_MAX_ID; conn_num++) { + /* /dev/gpon/ */ + (void)DTI_snprintf(buf, 128, "%s%d", dev_name, conn_num); + dev_fd = DTI_DeviceOpen(buf); + if (dev_fd < 0) { + DTI_PRN_USR_ERR_NL(DTI_GPON_OPTIC, DTI_PRN_LEVEL_ERR, + ("WRN: GPON Optic Dev Open - <%s> " + "can't open device."DTI_CRLF, buf)); + + /* /dev/gpon/ */ + (void)DTI_snprintf(buf, 128, "%s/%d", dev_name, + conn_num); + dev_fd = DTI_DeviceOpen(buf); + } + + if (dev_fd < 0) { + DTI_PRN_USR_ERR_NL(DTI_GPON_OPTIC, DTI_PRN_LEVEL_ERR, + ("WRN: GPON Optic Dev Open - <%s> " + "can't open device."DTI_CRLF, buf)); + } else { + DTI_PRN_USR_DBG_NL(DTI_GPON_OPTIC, DTI_PRN_LEVEL_HIGH, + ("GPON Optic Dev Open - <%s> found." + DTI_CRLF, buf)); + + break; + } + } + + if (dev_fd < 0) { + /* /dev/gpon */ + (void)DTI_snprintf(buf, 128, "%s", dev_name); + dev_fd = DTI_DeviceOpen(buf); + } + + if (dev_fd < 0) { + DTI_PRN_USR_ERR_NL(DTI_GPON_OPTIC, DTI_PRN_LEVEL_ERR, + ("WRN: GPON Optic Dev Open - <%s> can't " + "open device, giving up."DTI_CRLF, buf)); + + return IFX_ERROR; + } else { + DTI_PRN_USR_DBG_NL(DTI_GPON_OPTIC, DTI_PRN_LEVEL_HIGH, + ("GPON Optic Dev Open - <%s> found." + DTI_CRLF, buf)); + } + + return dev_fd; +} + +/** + Close a control device of the GPON Optic driver + +\param + dev_fd - a valid device fd + +\return + If success IFX_SUCCESS else IFX_ERROR. + +*/ +DTI_STATIC IFX_int_t dti_optic_dev_close(IFX_int_t dev_fd) +{ + IFX_int_t ret_val = IFX_ERROR; + + if (dev_fd > 0) + ret_val = DTI_DeviceClose(dev_fd); + + return ret_val; +} + +/* + Check if a control port for the given line is already open, + if not open the control port. + +\param + pDtiGmxCtx - points to the GPON Optic Device context. +\param + line_num - line number +\param + packet_err - returns the result + +*/ +DTI_STATIC IFX_int_t dti_optic_cntrl_port_open(struct dti_dev_gpon_optic_drv_ctx + *dti_optic_ctx, + IFX_int_t dev_num, + DTI_PacketError_t *packet_err) +{ + if (dti_optic_ctx->p_dev_fds[dev_num] < 0) { + dti_optic_ctx->p_dev_fds[dev_num] = + dti_optic_dev_open(DRV_IO_GPON_OPTIC); + if (dti_optic_ctx->p_dev_fds[dev_num] < 0) { + *packet_err = DTI_eErrPortOpen; + + DTI_PRN_USR_ERR_NL(DTI_GPON_OPTIC, DTI_PRN_LEVEL_ERR, + ("ERROR: GPON Optic cntrl port open " + "- failed, dev_num = %d."DTI_CRLF, + dev_num)); + + return IFX_ERROR; + } + + /* add the new device to the FDSET struct */ + IFXOS_DevFdSet((IFX_uint32_t) dti_optic_ctx->p_dev_fds[dev_num], + &dti_optic_ctx->recv_dev_fds); + + if ((dti_optic_ctx->p_dev_fds[dev_num] + 1) > + dti_optic_ctx->recv_max_dev_fd) { + dti_optic_ctx->recv_max_dev_fd = + dti_optic_ctx->p_dev_fds[dev_num] + 1; + } + } + + return IFX_SUCCESS; +} + +/* + Check if the corresponding debug control device for the given line is already + open, if yes close the debug control device. + +\param + pDtiGmxCtx - points to the GPON Optic Device context. +\param + dev_num - line number +\param + packet_err - returns the result + +*/ +DTI_STATIC IFX_int_t dti_optic_cntrl_port_close( + struct dti_dev_gpon_optic_drv_ctx *dti_optic_ctx, + IFX_int_t dev_num, DTI_PacketError_t *packet_err) +{ + if (dti_optic_ctx->p_dev_fds[dev_num] >= 0) { + /* remove this device form the FDSET struct */ + dti_optic_dev_fd_clear(dti_optic_ctx, dev_num); + + (void)dti_optic_dev_close(dti_optic_ctx->p_dev_fds[dev_num]); + dti_optic_ctx->p_dev_fds[dev_num] = -1; + } + + return IFX_SUCCESS; +} + +/* + Resets a GPON Optic device. + +\param + dti_optic_ctx - points to the GPON Optic Device context. +\param + dev_num - device number +\param + rst_mode - reset mode (both = 0, soft = 1, hard = 2) + +\return + -1 if something went wrong, else + size of the mailbox +*/ +DTI_STATIC IFX_int_t dti_optic_dev_reset(struct dti_dev_gpon_optic_drv_ctx + *dti_optic_ctx, + IFX_int_t dev_num, + DTI_DeviceResetModes_t rst_mode) +{ + IFX_int_t op_err = IFX_SUCCESS, ret_val = 0; + IFX_boolean_t do_soft_rst = IFX_FALSE, do_hard_rst = IFX_FALSE; + DTI_PacketError_t packet_err; + + switch (rst_mode) { + case DTI_eRstDefault: + do_soft_rst = IFX_TRUE; + do_hard_rst = IFX_TRUE; + break; + + case DTI_eRstSoftReset: + do_soft_rst = IFX_TRUE; + break; + + case DTI_eRstHardReset: + do_hard_rst = IFX_TRUE; + break; + default: + DTI_PRN_USR_ERR_NL(DTI_GPON_OPTIC, DTI_PRN_LEVEL_ERR, + ("ERROR: GPON Optic device reset - unknown " + "reset mode %d."DTI_CRLF, rst_mode)); + return IFX_ERROR; + } + + if (dti_optic_cntrl_port_open(dti_optic_ctx, dev_num, &packet_err) != + IFX_SUCCESS) { + DTI_PRN_USR_ERR_NL(DTI_GPON_OPTIC, DTI_PRN_LEVEL_ERR, + ("ERROR: GPON Optic device reset - " + "dev_num %d, open error."DTI_CRLF, + dev_num)); + + return IFX_ERROR; + } + + /* hard reset */ + if (do_hard_rst == IFX_TRUE) { + + DTI_PRN_USR_DBG_NL(DTI_GPON_OPTIC, DTI_PRN_LEVEL_HIGH, + ("GPON Optic device reset - do Hard Reset, " + "dev %d"DTI_CRLF, dev_num)); + + if ((ret_val = + DTI_DeviceControl(dti_optic_ctx->p_dev_fds[dev_num], + FIO_OPTIC_RESET, + (GPON_OPTIC_IOCTL_ARG) 0)) < 0) { + DTI_PRN_USR_ERR_NL(DTI_GPON_OPTIC, DTI_PRN_LEVEL_ERR, + ("ERROR: GPON Optic device reset " + "ioctl - Hard Rst failed, dev %d, " + "retCode = %d."DTI_CRLF, + dev_num, ret_val)); + + op_err = IFX_ERROR; + } + } + + /* soft reset */ + if (do_soft_rst == IFX_TRUE) { + DTI_PRN_USR_DBG_NL(DTI_GPON_OPTIC, DTI_PRN_LEVEL_HIGH, + ("GPON Optic device reset - do Soft Reset, " + "dev %d"DTI_CRLF, dev_num)); + + if ((ret_val = + DTI_DeviceControl(dti_optic_ctx->p_dev_fds[dev_num], + FIO_OPTIC_RESET, + (GPON_OPTIC_IOCTL_ARG) 0)) < 0) { + DTI_PRN_USR_ERR_NL(DTI_GPON_OPTIC, DTI_PRN_LEVEL_ERR, + ("ERROR: GPON Optic device reset " + "ioctl - Soft Rst failed, dev %d, " + "retCode = %d."DTI_CRLF, + dev_num, ret_val)); + + op_err = IFX_ERROR; + } + } + + return op_err; +} + +/** + Clear a device FD from the FD_SET and recalc new max FD. + +*/ +DTI_STATIC IFX_void_t dti_optic_dev_fd_clear(struct dti_dev_gpon_optic_drv_ctx + *dti_optic_ctx, + IFX_int_t dev_num) +{ +#if defined(IFXOS_HAVE_DEV_FD_CLEAR) + IFX_int_t i, max_dev_fd = 0; + + DTI_DevFdClear(dti_optic_ctx->pDevFd[dev_num], + &dti_optic_ctx->recv_dev_fds); + + for (i = 0; i < dti_optic_ctx->num_of_devs; i++) { + if (dti_optic_ctx->pDevFd[i] >= 0) { + if ((DTI_DevFdIsSet(dti_optic_ctx->p_dev_fds[i], + &dti_optic_ctx->recv_dev_fds)) && + (dti_optic_ctx->p_dev_fds[i] > max_dev_fd)} { + max_dev_fd = dti_optic_ctx->p_dev_fds[i]; + } + } + } + + dti_optic_ctx->recv_max_dev_fd = max_dev_fd + 1; +#else + IFX_int_t i, max_dev_fd = 0; + + DTI_DevFdZero(&dti_optic_ctx->tmp_dev_fds); + dti_optic_ctx->recv_max_dev_fd = 0; + + for (i = 0; i < dti_optic_ctx->num_of_devs; i++) { + if ((dti_optic_ctx->p_dev_fds[i] >= 0) && (i != dev_num)) { + if (DTI_DevFdIsSet((IFX_uint32_t) dti_optic_ctx-> + p_dev_fds[i], + &dti_optic_ctx->recv_dev_fds)) { + DTI_DevFdSet((IFX_uint32_t) dti_optic_ctx-> + p_dev_fds[i], + &dti_optic_ctx->tmp_dev_fds); + + if (dti_optic_ctx->p_dev_fds[i] > max_dev_fd) { + max_dev_fd = + dti_optic_ctx->p_dev_fds[i]; + } + } + } + } + + DTI_MemCpy(&dti_optic_ctx->recv_dev_fds, &dti_optic_ctx->tmp_dev_fds, + sizeof(IFXOS_devFd_set_t)); + dti_optic_ctx->recv_max_dev_fd = (max_dev_fd) ? (max_dev_fd + 1) : 0; + + DTI_DevFdZero(&dti_optic_ctx->tmp_dev_fds); + +#endif + return; +} + +/* + Request and return the device driver config. + +\param + sys_info - return DTI_DeviceSysInfo_t structure. +\param + pPortsPerDev - return ptr, ports per device. + +\return + IFX_SUCCESS if request was successful, else + IFX_ERROR +*/ +DTI_STATIC IFX_int_t dti_optic_drv_cfg_get(DTI_DeviceSysInfo_t *sys_info) +{ + sys_info->bControlAutoDevMsgSupport = IFX_TRUE; + + sys_info->numOfDevs = 1; + sys_info->portsPerDev = 1; + sys_info->ifPerDev = 1; + + if ((sys_info->numOfDevs > 0) && (sys_info->portsPerDev > 0)) { + sys_info->numOfPorts = + sys_info->numOfDevs * sys_info->portsPerDev; + sys_info->bValid = IFX_TRUE; + } + + return IFX_SUCCESS; +} + +/* ============================================================================ + Device Access Functions + ========================================================================= */ + +/** + Set a new debug level. +*/ +DTI_STATIC IFX_int_t dti_optic_printout_level_set(IFX_int_t new_dbg_level) +{ + + DTI_Printf + ("dti_optic_printout_level_set - change: debug level %d " + "<-----------"DTI_CRLF, new_dbg_level); + + IFXOS_PRN_USR_LEVEL_SET(DTI_GPON_OPTIC, new_dbg_level); + + return IFX_SUCCESS; +} + +/** + Setup GPON Optic Module + +\param + dev_sys_info - points to the system infos +\param + dti_dev_ctx_out - pointer to return the allocated GPON Optic Modul struct. + +\return + If success IFX_SUCCESS, the context is returned via the dti_dev_ctx_out param + else IFX_ERROR. + +*/ +DTI_STATIC IFX_int_t dti_optic_module_setup(DTI_DeviceSysInfo_t *dev_sys_info, + DTI_DeviceCtx_t **dti_dev_ctx_out) +{ + IFX_int_t i, ctxSize = 0; + DTI_DeviceCtx_t *dti_dev_ctx = IFX_NULL; + struct dti_dev_gpon_optic_drv_ctx *optic_dev_ctx = IFX_NULL; + DTI_PTR_U u_dti_dev_ctx; + + if ((dti_dev_ctx_out == IFX_NULL) || (dev_sys_info == IFX_NULL)) { + DTI_PRN_USR_ERR_NL(DTI_GPON_OPTIC, DTI_PRN_LEVEL_ERR, + ("ERROR: GPON Optic Dev Module Setup - NULL " + "ptr args."DTI_CRLF)); + + return IFX_ERROR; + } + + if (*dti_dev_ctx_out != IFX_NULL) { + dti_dev_ctx = *dti_dev_ctx_out; + optic_dev_ctx = + (struct dti_dev_gpon_optic_drv_ctx *) dti_dev_ctx->pDevice; + } + + if (dti_dev_ctx != IFX_NULL) { + DTI_PRN_USR_ERR_NL(DTI_GPON_OPTIC, IFXOS_PRN_LEVEL_WRN, + ("WARNING: GPON Optic Dev Module Setup - " + "already done ."DTI_CRLF)); + + return IFX_ERROR; + } + + if (dti_optic_drv_cfg_get(dev_sys_info) != IFX_SUCCESS) { + DTI_PRN_USR_ERR_NL(DTI_GPON_OPTIC, DTI_PRN_LEVEL_ERR, + ("Error: GPON Optic Dev Module Setup - " + "driver config."DTI_CRLF)); + + return IFX_ERROR; + } + + DTI_PRN_USR_DBG_NL(DTI_GPON_OPTIC, DTI_PRN_LEVEL_HIGH, + ("GPON Optic Dev Module Setup - update driver " + "config (devs = %d, portsPerDev = %d)."DTI_CRLF, + dev_sys_info->numOfDevs, + dev_sys_info->portsPerDev)); + + ctxSize = + sizeof(DTI_DeviceCtx_t) + + sizeof(struct dti_dev_gpon_optic_drv_ctx) + + (sizeof(IFX_int_t) * dev_sys_info->numOfDevs); + + ctxSize += + ((dev_sys_info->bControlAutoDevMsgSupport == + IFX_TRUE) ? (DTI_DEV_GPON_OPTIC_DEFAULT_MBOX_SIZE) : 0); + + u_dti_dev_ctx.pUInt8 = DTI_Malloc((IFX_uint_t) ctxSize); + + if (u_dti_dev_ctx.pUInt8 == IFX_NULL) { + DTI_PRN_USR_ERR_NL(DTI_GPON_OPTIC, DTI_PRN_LEVEL_ERR, + ("ERROR: GPON Optic Dev Module Setup - " + "Dev Struct alloc."DTI_CRLF)); + + return IFX_ERROR; + } + DTI_MemSet(u_dti_dev_ctx.pUInt8, 0x0, ctxSize); + + /* set context pointer */ + dti_dev_ctx = (DTI_DeviceCtx_t *) DTI_PTR_CAST_GET_ULONG(u_dti_dev_ctx); + if (dti_dev_ctx == IFX_NULL) { + DTI_Free(u_dti_dev_ctx.pUInt8); + + DTI_PRN_USR_ERR_NL(DTI_GPON_OPTIC, DTI_PRN_LEVEL_ERR, + ("ERROR: GPON Optic Dev Module Setup - Dev " + "Struct miss-aligned."DTI_CRLF)); + + return IFX_ERROR; + } + + /* set pDevice pointer */ + u_dti_dev_ctx.pUInt8 += sizeof(DTI_DeviceCtx_t); + optic_dev_ctx =(struct dti_dev_gpon_optic_drv_ctx *) + DTI_PTR_CAST_GET_UINT32(u_dti_dev_ctx); + if (optic_dev_ctx == IFX_NULL) { + DTI_Free(dti_dev_ctx); + + DTI_PRN_USR_ERR_NL(DTI_GPON_OPTIC, DTI_PRN_LEVEL_ERR, + ("ERROR: GPON Optic Dev Module Setup - " + "pDevice miss-aligned."DTI_CRLF)); + + return IFX_ERROR; + } + + /* set dev_fd pointer */ + u_dti_dev_ctx.pUInt8 += sizeof(struct dti_dev_gpon_optic_drv_ctx); + optic_dev_ctx->p_dev_fds = + (IFX_int_t *) DTI_PTR_CAST_GET_UINT32(u_dti_dev_ctx); + if (optic_dev_ctx->p_dev_fds == IFX_NULL) { + DTI_Free(dti_dev_ctx); + + DTI_PRN_USR_ERR_NL(DTI_GPON_OPTIC, DTI_PRN_LEVEL_ERR, + ("ERROR: GPON Optic Dev Module Setup - " + "devFds miss-aligned."DTI_CRLF)); + + return IFX_ERROR; + } + + /* set auto msg buffer pointer */ + if (dev_sys_info->bControlAutoDevMsgSupport == IFX_TRUE) { + u_dti_dev_ctx.pUInt8 += + (sizeof(IFX_int_t) * dev_sys_info->numOfDevs); + optic_dev_ctx->recv_msg_buf = + (IFX_ulong_t *) DTI_PTR_CAST_GET_ULONG(u_dti_dev_ctx); + + if (optic_dev_ctx->recv_msg_buf == IFX_NULL) { + DTI_Free(dti_dev_ctx); + + DTI_PRN_USR_ERR_NL(DTI_GPON_OPTIC, DTI_PRN_LEVEL_ERR, + ("ERROR: Geminax Dev Module Setup -" + " Gmx Auto MSg Buffer miss-aligned." + DTI_CRLF)); + + return IFX_ERROR; + } + optic_dev_ctx->recv_msg_buf_sz_byte = + DTI_DEV_GPON_OPTIC_DEFAULT_MBOX_SIZE; + } else { + optic_dev_ctx->recv_msg_buf = IFX_NULL; + optic_dev_ctx->recv_msg_buf_sz_byte = 0; + } + + for (i = 0; i < dev_sys_info->numOfDevs; i++) + optic_dev_ctx->p_dev_fds[i] = -1; + + optic_dev_ctx->num_of_reg_access = + DTI_DEV_GPON_OPTIC_MAX_REGISTER_ACCESS_NUM; + optic_dev_ctx->num_of_dbg_access = + DTI_DEV_GPON_OPTIC_MAX_DEBUG_ACCESS_NUM; + + optic_dev_ctx->num_of_devs = dev_sys_info->numOfDevs; + optic_dev_ctx->if_per_dev = dev_sys_info->ifPerDev; + optic_dev_ctx->recv_dev_msg_support = + dev_sys_info->bControlAutoDevMsgSupport; + + dti_dev_ctx->bAutoDevMsgActive = IFX_TRUE; + dti_dev_ctx->pDevice = (IFX_void_t *) optic_dev_ctx; + *dti_dev_ctx_out = dti_dev_ctx; + +/* + optic_dev_ctx->cli_interface = DTI_CLI_SendFunctionRegister(agent_ctx, + *dti_dev_ctx_out, "OPTIC", dti_optic_cli_send, + 0x10000); +*/ + + return IFX_SUCCESS; +} + +/** + Delete a GPON Optic Module. + - close all open devices + - free memory + +\param + dev_sys_info - points to the system infos +\param + dti_dev_ctx_out - contains the modul context. + +\return + If success IFX_SUCCESS, the context is freed and the ptr is set to IFX_NULL. + else IFX_ERROR. + +*/ +DTI_STATIC IFX_int_t dti_optic_module_delete(DTI_DeviceSysInfo_t *dev_sys_info, + DTI_DeviceCtx_t **dti_dev_ctx_out) +{ + IFX_int_t i; + DTI_DeviceCtx_t *dti_dev_ctx = IFX_NULL; + struct dti_dev_gpon_optic_drv_ctx *dti_optic_drv_ctx = IFX_NULL; + + if (dti_dev_ctx_out == IFX_NULL) { + DTI_PRN_USR_ERR_NL(DTI_GPON_OPTIC, DTI_PRN_LEVEL_ERR, + ("ERROR: GPON Optic Dev Module Delete - " + "NULL ptr args."DTI_CRLF)); + + return IFX_ERROR; + } + + if (*dti_dev_ctx_out == IFX_NULL) { + DTI_PRN_USR_ERR_NL(DTI_GPON_OPTIC, DTI_PRN_LEVEL_ERR, + ("ERROR: GPON Optic Dev Module Delete - " + "NULL ptr modul ctx."DTI_CRLF)); + + return IFX_ERROR; + } + + dti_dev_ctx = *dti_dev_ctx_out; + *dti_dev_ctx_out = IFX_NULL; + + dti_optic_drv_ctx = (struct dti_dev_gpon_optic_drv_ctx *) + dti_dev_ctx->pDevice; + for (i = 0; i < dti_optic_drv_ctx->num_of_devs; i++) { + if (dti_optic_drv_ctx->p_dev_fds[i] >= 0) { + (void)dti_optic_dev_close(dti_optic_drv_ctx-> + p_dev_fds[i]); + dti_optic_drv_ctx->p_dev_fds[i] = -1; + } + } + + DTI_Free(dti_dev_ctx); + return IFX_SUCCESS; +} + +/** + Write the Sytem Info of the current DTI Agent instance to the given buffer. + +\param + pAgentSysInfo - points to Sytem Info struct of the current agent + instance. +\param + sys_info_buf - points to the Sytem Info char buffer. +\param + buffer_size - buffer size. + +\return + Number of written bytes. +*/ +DTI_STATIC IFX_int_t dti_optic_sys_info_write(DTI_DeviceSysInfo_t *dev_sys_info, + IFX_char_t *sys_info_buf, + IFX_int_t buffer_size) +{ + IFX_int_t written_len = 0; + const IFX_char_t *board_name = DTI_BOARD_NAME_STR_GPON_OPTIC; + + (void)DTI_snprintf(&sys_info_buf[written_len], + buffer_size - written_len, + "VendorName=%s", DTI_VENDOR_NAME_STR); + written_len = (IFX_int_t) DTI_StrLen(&sys_info_buf[written_len]) + 1; + + if (dev_sys_info->bValid == IFX_TRUE) { + board_name = DTI_BOARD_NAME_STR_GPON_OPTIC; + } + + (void)DTI_snprintf(&sys_info_buf[written_len], + buffer_size - written_len, + "BoardName=%s", board_name); + written_len += (IFX_int_t) DTI_StrLen(&sys_info_buf[written_len]) + 1; + + (void)DTI_snprintf(&sys_info_buf[written_len], + buffer_size - written_len, + "BoardRevision=0.0"); + written_len += (IFX_int_t) DTI_StrLen(&sys_info_buf[written_len]) + 1; + + if (dev_sys_info->bValid == IFX_TRUE) { + (void)DTI_snprintf(&sys_info_buf[written_len], + buffer_size - written_len, "NumOfDevices=%d", + dev_sys_info->numOfDevs); + written_len += + (IFX_int_t) DTI_StrLen(&sys_info_buf[written_len]) + 1; + + (void)DTI_snprintf(&sys_info_buf[written_len], + buffer_size - written_len, "MaxChannel=%d", + dev_sys_info->numOfPorts); + written_len += + (IFX_int_t) DTI_StrLen(&sys_info_buf[written_len]) + 1; + } else { + (void)DTI_snprintf(&sys_info_buf[written_len], + buffer_size - written_len, + "NumOfDevices="); + written_len += + (IFX_int_t) DTI_StrLen(&sys_info_buf[written_len]) + 1; + + (void)DTI_snprintf(&sys_info_buf[written_len], + buffer_size - written_len, + "MaxChannel="); + written_len += + (IFX_int_t) DTI_StrLen(&sys_info_buf[written_len]) + 1; + } + + return written_len; +} + +/** + Do an device reset on the selected device. + +\param + dti_dev_ctx - points to the GPON Optic Device context. +\param + in_dev_reset - points to the DTI Host2Dev Reset struct. +\param + out_dev_reset - points to the DTI Dev2Host Reset struct. +\param + rst_mask_size_32 - number of mask elements (32 Bit). +\param + packet_err - return ptr, return the DTI Packet Error. + +\return + IFX_SUCCESS and returns the DTI Packet Error code. + IFX_ERROR currently no (only in case of non-DTI related errors). +*/ +DTI_STATIC IFX_int_t dti_optic_reset(DTI_DeviceCtx_t *dti_dev_ctx, + DTI_H2D_DeviceReset_t *in_dev_reset, + DTI_D2H_DeviceReset_t *out_dev_reset, + IFX_int_t rst_mask_size_32, + DTI_PacketError_t *packet_err) +{ + IFX_int_t dev_num; + IFX_uint32_t dev_mask = 0, result_mask = 0; + struct dti_dev_gpon_optic_drv_ctx *dti_optic_ctx = + (struct dti_dev_gpon_optic_drv_ctx *) dti_dev_ctx->pDevice; + + for (dev_num = 0; dev_num < dti_optic_ctx->num_of_devs; dev_num++) + dev_mask |= 0x1 << dev_num; + + if (~dev_mask & in_dev_reset->mask[0]) { + DTI_PRN_USR_ERR_NL(DTI_GPON_OPTIC, DTI_PRN_LEVEL_ERR, + ("WARNING: GPON Optic Dev Reset - ignore " + "invalid devs, mask 0x%08X, max = %d." + DTI_CRLF, in_dev_reset->mask[0], + dti_optic_ctx->num_of_devs)); + } + dev_mask = (in_dev_reset->mask[0] & dev_mask); + + switch (in_dev_reset->mode) { + case DTI_eRstDefault: + case DTI_eRstSoftReset: + case DTI_eRstHardReset: + break; + + default: + DTI_PRN_USR_ERR_NL(DTI_GPON_OPTIC, DTI_PRN_LEVEL_ERR, + ("ERROR: GPON Optic Dev Reset - unknown " + "reset mode %d."DTI_CRLF, + in_dev_reset->mode)); + + *packet_err = DTI_eErrInvalidParameters; + out_dev_reset->mode = in_dev_reset->mode; + out_dev_reset->mask[0] = in_dev_reset->mask[0]; + + return IFX_SUCCESS; + } + + for (dev_num = 0; dev_num < dti_optic_ctx->num_of_devs; dev_num++) { + if (dev_mask & (0x1 << dev_num)) { + if (dti_optic_dev_reset + (dti_optic_ctx, dev_num, + in_dev_reset->mode) == IFX_SUCCESS) { + result_mask |= (0x1 << dev_num); + } + } + } + + if (result_mask != in_dev_reset->mask[0]) { + DTI_PRN_USR_ERR_NL(DTI_GPON_OPTIC, DTI_PRN_LEVEL_ERR, + ("ERROR: GPON Optic Dev Reset - incomplete, " + "req = 0x%08X, done = 0x%08X, mode %d." + DTI_CRLF, in_dev_reset->mask, result_mask, + in_dev_reset->mode)); + + *packet_err = DTI_eErrPortOperation; + } else { + DTI_PRN_USR_DBG_NL(DTI_GPON_OPTIC, DTI_PRN_LEVEL_HIGH, + ("GPON Optic Dev Reset - done, " + "mask = 0x%08X, mode = %d."DTI_CRLF, + result_mask, in_dev_reset->mode)); + + *packet_err = DTI_eNoError; + } + + out_dev_reset->mode = in_dev_reset->mode; + out_dev_reset->mask[0] = result_mask; + + return IFX_SUCCESS; +} + +/** + Do a FW download on the selected devices + +\param + dti_dev_ctx - points to the GPON Optic Device context. +\param + dti_prot_srv_ctx - points to the DTI protocol server context. +\param + in_dev_dwnld - points to the DTI Host2Dev Download struct. +\param + out_dev_dwnld - points to the DTI Dev2Host Download struct. +\param + packet_err - return ptr, return the DTI Packet Error. + +\return + IFX_SUCCESS and returns the DTI Packet Error code. + IFX_ERROR currently no (only in case of non-DTI related errors). +*/ +DTI_STATIC IFX_int_t dti_optic_download(DTI_DeviceCtx_t *dti_dev_ctx, + DTI_ProtocolServerCtx_t + *dti_prot_srv_ctx, + DTI_H2D_DeviceDownload_t *in_dev_dwnld, + DTI_D2H_DeviceDownload_t *out_dev_dwnld, + DTI_PacketError_t *packet_err) +{ + DTI_PRN_USR_ERR_NL(DTI_GPON_OPTIC, DTI_PRN_LEVEL_ERR, + ("ERROR: Device Download - not supported."DTI_CRLF)); + out_dev_dwnld->errorMask = 0xFFFFFFFF; + + *packet_err = DTI_eErrUnknown; + return IFX_SUCCESS; +} + +/** + Open a given line device. + +\param + dti_dev_ctx - points to the GPON Optic Device context. +\param + line_num - line number. +\param + packet_err - return ptr, return the DTI Packet Error. + +\return + IFX_SUCCESS and returns the DTI Packet Error code. + IFX_ERROR currently no (only in case of non-DTI related errors). +*/ +DTI_STATIC IFX_int_t dti_optic_device_open(DTI_DeviceCtx_t *dti_dev_ctx, + IFX_int_t dev_num, + DTI_PacketError_t *packet_err) +{ + struct dti_dev_gpon_optic_drv_ctx *dti_optic_ctx = + (struct dti_dev_gpon_optic_drv_ctx *) dti_dev_ctx->pDevice; + + *packet_err = DTI_eNoError; + + if (dti_optic_cntrl_port_open(dti_optic_ctx, dev_num, packet_err) != + IFX_SUCCESS) { + DTI_PRN_USR_ERR_NL(DTI_GPON_OPTIC, DTI_PRN_LEVEL_ERR, + ("ERROR: GPON Optic Device Open - " + "dev_num %d, open error."DTI_CRLF, + dev_num)); + + return IFX_ERROR; + } + + return IFX_SUCCESS; +} + +/** + Close a given line device. + +\param + dti_dev_ctx - points to the GPON Optic Device context. +\param + line_num - line number. +\param + packet_err - return ptr, return the DTI Packet Error. + +\return + IFX_SUCCESS and returns the DTI Packet Error code. + IFX_ERROR currently no (only in case of non-DTI related errors). +*/ +DTI_STATIC IFX_int_t dti_optic_device_close(DTI_DeviceCtx_t *dti_dev_ctx, + IFX_int_t line_num, + DTI_PacketError_t *packet_err) +{ + struct dti_dev_gpon_optic_drv_ctx *dti_optic_ctx = + (struct dti_dev_gpon_optic_drv_ctx *) dti_dev_ctx->pDevice; + + *packet_err = DTI_eNoError; + + if (dti_optic_cntrl_port_close(dti_optic_ctx, + line_num, packet_err) != IFX_SUCCESS) { + DTI_PRN_USR_ERR_NL(DTI_GPON_OPTIC, DTI_PRN_LEVEL_ERR, + ("ERROR: GPON Optic Device Close - line %d," + " close error."DTI_CRLF, line_num)); + + return IFX_ERROR; + } + + return IFX_SUCCESS; +} + +/** + Get / release the device lock. + +\param + dti_dev_ctx - points to the GPON Optic Device context. +\param + in_lock - points to the DTI Host2Dev Lock struct. +\param + out_lock - points to the DTI Dev2Host Lock struct. +\param + line_num - line number. +\param + packet_err - return ptr, return the DTI Packet Error. + +\return + IFX_SUCCESS and returns the DTI Packet Error code. + IFX_ERROR currently no (only in case of non-DTI related errors). +*/ +DTI_STATIC IFX_int_t dti_optic_register_lock(DTI_DeviceCtx_t *dti_dev_ctx, + DTI_H2D_DeviceLock_t *in_lock, + DTI_D2H_DeviceLock_t *out_lock, + IFX_int_t line_num, + DTI_PacketError_t *packet_err) +{ + out_lock->lock = 0; + *packet_err = DTI_eErrUnknown; + return IFX_SUCCESS; +} + +/** + Get a device register (MEI interface). + +\param + dti_dev_ctx - points to the GPON Optic Device context. +\param + in_reg_get - points to the DTI Host2Dev RegisterGet struct. +\param + out_reg_get - points to the DTI Dev2Host RegisterGet struct. +\param + line_num - line number. +\param + out_payl_sz_byte - return ptr, return the size of the read registers. + 0 in case of error +\param + packet_err - return ptr, return the DTI Packet Error. + +\return + IFX_SUCCESS and returns the DTI Packet Error code. + IFX_ERROR if the register read operation fails. +*/ +DTI_STATIC IFX_int_t dti_optic_register_get(DTI_DeviceCtx_t *dti_dev_ctx, + DTI_H2D_RegisterGet_t *in_reg_get, + DTI_D2H_RegisterGet_t *out_reg_get, + IFX_int_t dev_num, + IFX_uint32_t *out_payl_sz_byte, + DTI_PacketError_t *packet_err) +{ + int ret; + struct dti_dev_gpon_optic_drv_ctx *dti_optic_ctx = + (struct dti_dev_gpon_optic_drv_ctx *) dti_dev_ctx->pDevice; + struct optic_exchange ex; + union optic_reg_get reg; + + ex.error = 0; + ex.length = sizeof(reg); + ex.p_data = ® + + switch (dti_dev_ctx->pPacketIn->header.packetOptions) { + case DTI_e8Bit: + reg.in.form = 8; + break; + case DTI_e16Bit: + reg.in.form = 16; + break; + case DTI_e32Bit: + reg.in.form = 32; + break; + default: + DTI_PRN_USR_ERR_NL(DTI_GPON_OPTIC, DTI_PRN_LEVEL_ERR, + ("ERROR: GPON Optic device register get - " + "register type %d not supported."DTI_CRLF, + dti_dev_ctx->pPacketIn->header. + packetOptions)); + break; + } + reg.in.address = in_reg_get->address; + + if (dti_optic_cntrl_port_open(dti_optic_ctx, dev_num, packet_err) != + IFX_SUCCESS) { + DTI_PRN_USR_ERR_NL(DTI_GPON_OPTIC, DTI_PRN_LEVEL_ERR, + ("ERROR: GPON Optic device register get - " + "dev_num %d, open error."DTI_CRLF, + dev_num)); + + return IFX_ERROR; + } + + ret = + DTI_DeviceControl(dti_optic_ctx->p_dev_fds[dev_num], + FIO_OPTIC_REGISTER_GET, (IFX_ulong_t) &ex); + + if (ret < 0) { + *packet_err = DTI_eErrUnknown; + return IFX_ERROR; + } + + out_reg_get->data[0] = reg.out.value; + *out_payl_sz_byte = 4; + + return IFX_SUCCESS; +} + +/** + Get a device register (MEI interface). + +\param + dti_dev_ctx - points to the GMXD Device context. +\param + in_lock - points to the DTI Host2Dev RegisterGet struct. +\param + out_lock - points to the DTI Dev2Host RegisterGet struct. +\param + line_num - line number. +\param + packet_err - return ptr, return the DTI Packet Error. + +\return + IFX_SUCCESS DTI Packet Error code is "no error". + IFX_ERROR if the register read operation fails. +*/ +DTI_STATIC IFX_int_t dti_optic_register_set(DTI_DeviceCtx_t *dti_dev_ctx, + DTI_H2D_RegisterSet_t *in_reg_set, + IFX_int_t in_reg_set_sz_byte, + IFX_int_t dev_num, + DTI_PacketError_t *packet_err) +{ + int ret; + struct dti_dev_gpon_optic_drv_ctx *dti_optic_ctx = + (struct dti_dev_gpon_optic_drv_ctx *) dti_dev_ctx->pDevice; + struct optic_exchange ex; + struct optic_reg_set reg; + + ex.error = 0; + ex.length = sizeof(reg); + ex.p_data = ® + + switch (dti_dev_ctx->pPacketIn->header.packetOptions) { + case DTI_e8Bit: + reg.form = 8; + break; + case DTI_e16Bit: + reg.form = 16; + break; + case DTI_e32Bit: + reg.form = 32; + break; + default: + DTI_PRN_USR_ERR_NL(DTI_GPON_OPTIC, DTI_PRN_LEVEL_ERR, + ("ERROR: GPON Optic device register set - " + "register type %d not supported."DTI_CRLF, + dti_dev_ctx->pPacketIn->header. + packetOptions)); + break; + } + + reg.address = in_reg_set->address; + reg.value = in_reg_set->data[0]; + + if (dti_optic_cntrl_port_open(dti_optic_ctx, dev_num, packet_err) != + IFX_SUCCESS) { + DTI_PRN_USR_ERR_NL(DTI_GPON_OPTIC, DTI_PRN_LEVEL_ERR, + ("ERROR: GPON Optic device register set - " + "dev_num %d, open error."DTI_CRLF, + dev_num)); + + return IFX_ERROR; + } + + ret = + DTI_DeviceControl(dti_optic_ctx->p_dev_fds[dev_num], + FIO_OPTIC_REGISTER_SET, (IFX_ulong_t) &ex); + + if (ret < 0) { + *packet_err = DTI_eErrUnknown; + return IFX_ERROR; + } + + return IFX_SUCCESS; +} + +/** + Set a device configuration. + +\param + pDtiConCtx - points to the DTI connection setup. +\param + dti_dev_ctx - points to the GMXD Device context. +\param + in_cfg_set - points to the DTI Host2Dev ConfigSet struct. +\param + out_cfg_set - points to the DTI Dev2Host ConfigSet struct. +\param + line_num - line number. +\param + packet_err - return ptr, return the DTI Packet Error. + +\return + IFX_SUCCESS and returns the DTI Packet Error code. + IFX_ERROR currently no (only in case of non-DTI related errors). + +\remark + Changes of the autonomous message handling may have influence to the + connection settings (select wait time) +*/ +DTI_STATIC IFX_int_t dti_optic_cfg_set(DTI_DeviceCtx_t *dti_dev_ctx, + DTI_H2D_DeviceConfigSet_t *in_cfg_set, + DTI_D2H_DeviceConfigSet_t *out_cfg_set, + IFX_int_t line_num, + DTI_PacketError_t *packet_err) +{ + struct dti_dev_gpon_optic_drv_ctx *dti_optic_ctx = + (struct dti_dev_gpon_optic_drv_ctx *) dti_dev_ctx->pDevice; + + DTI_MemSet(out_cfg_set, 0x00, sizeof(DTI_D2H_DeviceConfigSet_t)); + out_cfg_set->key = in_cfg_set->key; + + switch (in_cfg_set->key) { + case DTI_eTimeout: + out_cfg_set->value = 0; + *packet_err = DTI_eErrUnknown; + break; + + case DTI_eAutonousMessages: + out_cfg_set->value = 0; + *packet_err = DTI_eErrUnknown; + break; + + case DTI_eMaxRegAccess: + if (in_cfg_set->value > + DTI_DEV_GPON_OPTIC_MAX_REGISTER_ACCESS_NUM) { + dti_optic_ctx->num_of_reg_access = + DTI_DEV_GPON_OPTIC_MAX_REGISTER_ACCESS_NUM; + *packet_err = DTI_eErrConfiguration; + } else { + dti_optic_ctx->num_of_reg_access = + (IFX_int_t) in_cfg_set->value; + *packet_err = DTI_eNoError; + } + out_cfg_set->value = + (IFX_uint32_t) dti_optic_ctx->num_of_reg_access; + break; + + case DTI_eMaxDebugAccess: + if (in_cfg_set->value > + DTI_DEV_GPON_OPTIC_MAX_DEBUG_ACCESS_NUM) { + dti_optic_ctx->num_of_dbg_access = + DTI_DEV_GPON_OPTIC_MAX_DEBUG_ACCESS_NUM; + *packet_err = DTI_eErrConfiguration; + } else { + dti_optic_ctx->num_of_dbg_access = + (IFX_int_t) in_cfg_set->value; + *packet_err = DTI_eNoError; + } + out_cfg_set->value = + (IFX_uint32_t) dti_optic_ctx->num_of_dbg_access; + break; + + /* R/O */ + case DTI_eMailboxSize: + default: + out_cfg_set->value = 0; + *packet_err = DTI_eErrUnknown; + break; + } + + return IFX_SUCCESS; +} + +/** + Get the device configuration of the given line. + +\param + dti_dev_ctx - points to the GPON Optic Device context. +\param + in_cfg_set - points to the DTI Host2Dev ConfigSet struct. +\param + out_cfg_set - points to the DTI Dev2Host ConfigSet struct. +\param + line_num - line number. +\param + packet_err - return ptr, return the DTI Packet Error. + +\return + IFX_SUCCESS and returns the DTI Packet Error code. + IFX_ERROR currently no (only in case of non-DTI related errors). +*/ +DTI_STATIC IFX_int_t dti_optic_cfg_get(DTI_DeviceCtx_t *dti_dev_ctx, + DTI_H2D_DeviceConfigGet_t *in_cfg_get, + DTI_D2H_DeviceConfigGet_t *out_cfg_get, + IFX_int_t line_num, + DTI_PacketError_t *packet_err) +{ + struct dti_dev_gpon_optic_drv_ctx *dti_optic_ctx = + (struct dti_dev_gpon_optic_drv_ctx *) dti_dev_ctx->pDevice; + + DTI_MemSet(out_cfg_get, 0x00, sizeof(DTI_D2H_DeviceConfigGet_t)); + out_cfg_get->key = in_cfg_get->key; + + switch (in_cfg_get->key) { + case DTI_eTimeout: + *packet_err = DTI_eErrUnknown; + break; + + case DTI_eAutonousMessages: + *packet_err = DTI_eErrUnknown; + break; + + case DTI_eMailboxSize: + *packet_err = DTI_eErrUnknown; + break; + + case DTI_eMaxRegAccess: + out_cfg_get->value = + (IFX_uint32_t) dti_optic_ctx->num_of_reg_access; + *packet_err = DTI_eNoError; + break; + + case DTI_eMaxDebugAccess: + out_cfg_get->value = + (IFX_uint32_t) dti_optic_ctx->num_of_dbg_access; + *packet_err = DTI_eNoError; + break; + + default: + *packet_err = DTI_eErrUnknown; + break; + } + + return IFX_SUCCESS; +} + +/** + Send a 8 Bit message to the device. + +\note + In the GPON Optic system you got not for all messages a responce!! + --> simple send the messages and retrun + --> a responce is send up per default as autonomious message. + +\param + dti_dev_ctx - points to the GPON Optic Device context. +\param + in_msg8_send - points to the DTI 8 bit message send struct. +\param + out_msg8_send - points to the DTI 8 bit message responce struct. +\param + line_num - line number. +\param + in_payl_sz_byte - payload size of the DTI packet [byte]. +\param + out_payl_sz_byte - return ptr, return the OUT payload size [byte]. +\param + packet_err - return ptr, return the DTI Packet Error. + +\return + IFX_SUCCESS and returns the DTI Packet Error code. + IFX_ERROR currently no (only in case of non-DTI related errors). +*/ +DTI_STATIC IFX_int_t dti_optic_msg8_send(DTI_DeviceCtx_t *dti_dev_ctx, + DTI_H2D_Message8_u *in_msg8_send, + DTI_D2H_Message8_u *out_msg8_send, + IFX_int_t dev_num, + IFX_int_t in_payl_sz_byte, + IFX_int_t *out_payl_sz_byte, + DTI_PacketError_t *packet_err) +{ + *packet_err = DTI_eErrUnknown; + + return IFX_SUCCESS; +} + +/** + Send a 16 Bit message to the device. + +\note + In the GPON Optic system you got not for all messages a responce!! + --> simple send the messages and retrun + --> a responce is send up per default as autonomious message. + +\param + dti_dev_ctx - points to the GPON Optic Device context. +\param + in_msg16_send - points to the DTI 16 bit message send struct. +\param + out_msg16_send - points to the DTI 16 bit message responce struct. +\param + line_num - line number. +\param + in_payl_sz_byte - payload size of the DTI packet [byte]. +\param + out_payl_sz_byte - return ptr, return the OUT payload size [byte]. +\param + packet_err - return ptr, return the DTI Packet Error. + +\return + IFX_SUCCESS and returns the DTI Packet Error code. + IFX_ERROR currently no (only in case of non-DTI related errors). +*/ +DTI_STATIC IFX_int_t dti_optic_msg16_send(DTI_DeviceCtx_t *dti_dev_ctx, + DTI_H2D_Message16_u *in_msg16_send, + DTI_D2H_Message16_u *out_msg16_send, + IFX_int_t line_num, + IFX_int_t in_payl_sz_byte, + IFX_int_t *out_payl_sz_byte, + DTI_PacketError_t *packet_err) +{ + *packet_err = DTI_eErrUnknown; + + return IFX_SUCCESS; +} + +/** + Send a 32 Bit message to the device and wait for the responce. + +\param + dti_dev_ctx - points to the GPON Optic Device context. +\param + in_msg32_send - points to the DTI 32 bit message send struct. +\param + out_msg32_send - points to the DTI 32 bit message responce struct. +\param + line_num - line number. +\param + in_payl_sz_byte - payload size of the DTI packet [byte]. +\param + out_payl_sz_byte - return ptr, return the OUT payload size. +\param + packet_err - return ptr, return the DTI Packet Error. + +\return + IFX_SUCCESS and returns the DTI Packet Error code. + IFX_ERROR currently no (only in case of non-DTI related errors). +*/ +DTI_STATIC IFX_int_t dti_optic_msg32_send(DTI_DeviceCtx_t *dti_dev_ctx, + DTI_H2D_Message32_u *in_msg32_send, + DTI_D2H_Message32_u *out_msg32_send, + IFX_int_t dev_num, + IFX_int_t in_payl_sz_byte, + IFX_int_t *out_payl_sz_byte, + DTI_PacketError_t *packet_err) +{ + struct dti_dev_gpon_optic_drv_ctx *dti_optic_ctx = + (struct dti_dev_gpon_optic_drv_ctx *) dti_dev_ctx->pDevice; + struct optic_exchange ex; + + IFX_uint32_t cmd; + IFX_uint32_t data_sz; + + IFX_int_t ret = 0; + + dev_num = 0; + *packet_err = DTI_eErrUnknown; + + /* extract ioctl command and size */ + cmd = in_msg32_send->raw.data[0]; + data_sz = in_msg32_send->raw.data[1]; + + /* set outgoing packet size */ + *out_payl_sz_byte = data_sz + 4 + 4 - data_sz % 4; + + /* ensure that data_sz is valid */ + if ((IFX_uint32_t) data_sz > (IFX_uint32_t) in_payl_sz_byte) { + out_msg32_send->raw.sendResult = -1; + *packet_err = DTI_eNoError; + return IFX_SUCCESS; + } + + /* fill exchange */ + ex.error = 0; + ex.length = data_sz; + ex.p_data = &out_msg32_send->raw.data[0]; + + /* swap packet */ +#if (IFXOS_BYTE_ORDER == IFXOS_LITTLE_ENDIAN) + dti_packet_payload_swap(&in_msg32_send->raw.data[0], + in_payl_sz_byte / 4); +#endif + + /* copy input data to output packet */ + memcpy(&out_msg32_send->raw.data[0], &in_msg32_send->raw.data[2], + data_sz); + + if (dti_optic_cntrl_port_open(dti_optic_ctx, dev_num, packet_err) != + IFX_SUCCESS) { + DTI_PRN_USR_ERR_NL(DTI_GPON_OPTIC, DTI_PRN_LEVEL_ERR, + ("ERROR: GPON Optic device message 32 send " + "- dev_num %d, open error."DTI_CRLF, + dev_num)); + + return IFX_ERROR; + } + /* execute ioctl command */ + ret = DTI_DeviceControl(dti_optic_ctx->p_dev_fds[dev_num], cmd, + (IFX_ulong_t) & ex); + if (ret < 0) { + out_msg32_send->raw.sendResult = -3; + *packet_err = DTI_eNoError; + return IFX_SUCCESS; + } + + /* result is OK */ + out_msg32_send->raw.sendResult = ex.error; + *packet_err = DTI_eNoError; + + /* swap packet */ +#if (IFXOS_BYTE_ORDER == IFXOS_LITTLE_ENDIAN) + dti_packet_payload_swap(&out_msg32_send->raw.sendResult, + *out_payl_sz_byte / 4); +#endif + + return IFX_SUCCESS; +} + +/** + Setup the trace buffer configuration (debug streams). + +\remark + This function releases current configuration if the Debug Streams are + already configured before the new config is set. + +\param + dti_dev_ctx - points to the GPON Optic Device context. +\param + in_trace_config_set - points to the DTI Host2Dev TraceConfigSet struct. +\param + out_trace_config_set - points to the DTI Dev2Host TraceConfigSet struct. +\param + line_num - line number. +\param + packet_err - return ptr, return the DTI Packet Error. + +\return + IFX_SUCCESS and returns the DTI Packet Error code. + IFX_ERROR debug stream setup failed. +*/ +DTI_STATIC IFX_int_t dti_optic_trace_buf_cfg_set(DTI_DeviceCtx_t *dti_dev_ctx, + DTI_H2D_TraceConfigSet_t + *in_trace_config_set, + DTI_D2H_TraceConfigSet_t + *out_trace_config_set, + IFX_int_t line_num, + DTI_PacketError_t *packet_err) +{ + DTI_PRN_USR_DBG_NL(DTI_GPON_OPTIC, DTI_PRN_LEVEL_HIGH, + ("WARNING: GPON Optic Dev TraceBufferConfigSet - " + "not implemented."DTI_CRLF)); + + out_trace_config_set->size = 0; + *packet_err = DTI_eErrUnknown; + + return IFX_SUCCESS; +} + +/** + Reset the current trace buffer (debug streams). + +\param + dti_dev_ctx - points to the GPON Optic Device context. +\param + line_num - line number. +\param + packet_err - return ptr, return the DTI Packet Error. + +\return + IFX_SUCCESS and returns the DTI Packet Error code. + IFX_ERROR debug stream setup failed. +*/ +DTI_STATIC IFX_int_t dti_optic_trace_buf_reset(DTI_DeviceCtx_t *dti_dev_ctx, + IFX_int_t line_num, + DTI_PacketError_t *packet_err) +{ + DTI_PRN_USR_DBG_NL(DTI_GPON_OPTIC, DTI_PRN_LEVEL_HIGH, + ("WARNING: GPON Optic Dev TraceBufferReset - not " + "implemented."DTI_CRLF)); + + *packet_err = DTI_eErrUnknown; + + return IFX_SUCCESS; +} + +/** + Setup the trace buffer configuration (debug streams). + +\param + dti_dev_ctx - points to the GPON Optic Device context. +\param + out_trace_status_get - points to the DTI Dev2Host TraceStatusGet struct. +\param + line_num - line number. +\param + packet_err - return ptr, return the DTI Packet Error. + +\return + IFX_SUCCESS and returns the DTI Packet Error code. + IFX_ERROR debug stream config request failed. +*/ +DTI_STATIC IFX_int_t dti_optic_trace_buf_status_get(DTI_DeviceCtx_t *dti_dev_ctx, + DTI_D2H_TraceStatusGet_t + *out_trace_status_get, + IFX_int_t line_num, + DTI_PacketError_t + *packet_err) +{ + DTI_PRN_USR_DBG_NL(DTI_GPON_OPTIC, DTI_PRN_LEVEL_HIGH, + ("WARNING: GPON Optic Dev TraceBufferStatusGet - " + "not implemented."DTI_CRLF)); + + out_trace_status_get->mode = 0; + out_trace_status_get->size = 0; + out_trace_status_get->fill = 0; + + *packet_err = DTI_eErrUnknown; + + return IFX_SUCCESS; +} + +/** + Read data from the device via Debug Access (MEI Debug). + +\param + dti_dev_ctx - points to the GPON Optic Device context. +\param + in_trace_buf_get - points to the DTI Host2Dev RegisterGet struct. +\param + used_dti_packet_out - return ptr, points to the DTI Out packet. +\param + used_buffer_out_size - return value, points to the DTI Out packet size. +\param + line_num - line number. +\param + tr_buf_read_sz_byte - return ptr, return the number of read registers. +\param + packet_err - return ptr, return the DTI Packet Error. + +\remark + The function is called with the standard out packet. If the requested size + does not fit into this buffer, a corresponding buffer is allocated and used + for the ioctl call. The pointer to this out packet will be returned. + +\return + IFX_SUCCESS debug stream data read successful. + - returns the DTI Packet Error code. + - pointer to the used out package. + - size of the used out package. + IFX_ERROR data read failed. +*/ +DTI_STATIC IFX_int_t dti_optic_trace_buf_get(DTI_DeviceCtx_t *dti_dev_ctx, + DTI_H2D_TraceBufferGet_t + *in_trace_buf_get, + DTI_Packet_t + **used_dti_packet_out, + IFX_int_t + *used_buffer_out_size, + IFX_int_t line_num, + IFX_int_t + *tr_buf_read_sz_byte, + DTI_PacketError_t *packet_err) +{ + DTI_PRN_USR_DBG_NL(DTI_GPON_OPTIC, DTI_PRN_LEVEL_HIGH, + ("WARNING: GPON Optic Dev TraceBufferGet - not " + "implemented."DTI_CRLF)); + + *tr_buf_read_sz_byte = 0; + *packet_err = DTI_eErrUnknown; + + return IFX_SUCCESS; +} + +/** + Read data from the device via Debug Access (MEI Debug). + +\param + dti_dev_ctx - points to the GPON Optic Device context. +\param + in_dbg_get - points to the DTI Host2Dev RegisterGet struct. +\param + out_dbg_get - points to the DTI Dev2Host RegisterGet struct. +\param + line_num - line number. +\param + dbg_read_count - return ptr, return the number of read registers. +\param + packet_err - return ptr, return the DTI Packet Error. + +\return + IFX_SUCCESS and returns the DTI Packet Error code. + IFX_ERROR currently no (only in case of non-DTI related errors). +*/ +DTI_STATIC IFX_int_t dti_optic_debug_read(DTI_DeviceCtx_t *dti_dev_ctx, + DTI_H2D_DebugRead_t *in_dbg_get, + DTI_D2H_DebugRead_t *out_dbg_get, + IFX_int_t line_num, + IFX_int_t *dbg_read_count, + DTI_PacketError_t *packet_err) +{ + DTI_PRN_USR_DBG_NL(DTI_GPON_OPTIC, DTI_PRN_LEVEL_HIGH, + ("WARNING: GPON Optic Dev DebugRead - not " + "implemented."DTI_CRLF)); + + *dbg_read_count = 0; + *packet_err = DTI_eErrUnknown; + + return IFX_SUCCESS; +} + +/** + Write data to the device via Debug Access (MEI Debug). + +\param + dti_dev_ctx - points to the GPON Optic Device context. +\param + in_dbg_set - points to the DTI Host2Dev RegisterGet struct. +\param + out_dbg_get_nu - not used. +\param + line_num - line number. +\param + dbg_write_count - return ptr, return the number of read registers. +\param + packet_err - return ptr, return the DTI Packet Error. + +\return + IFX_SUCCESS and returns the DTI Packet Error code. + IFX_ERROR currently no (only in case of non-DTI related errors). +*/ +DTI_STATIC IFX_int_t dti_optic_debug_write(DTI_DeviceCtx_t *dti_dev_ctx, + DTI_H2D_DebugWrite_t *in_dbg_set, + IFX_uint32_t *out_dbg_get_nu, + IFX_int_t line_num, + IFX_int_t *dbg_write_count, + DTI_PacketError_t *packet_err) +{ + DTI_PRN_USR_DBG_NL(DTI_GPON_OPTIC, DTI_PRN_LEVEL_HIGH, + ("WARNING: GPON Optic Dev DebugRead - not " + "implemented."DTI_CRLF)); + + *dbg_write_count = 0; + *packet_err = DTI_eErrUnknown; + + return IFX_SUCCESS; +} + +/** + Check and process for Device Autonomous Messages. + The Auto Msg is read form the device (driver) and a corresponding + DTI packet is created and sent to the upper DTI Client + +\param + dti_dev_ctx - points to the Device context. +\param + dti_con - points to the established DTI Connection data. +\param + dev_select_wait_ms - wait time [ms] for the device select operation. +\param + out_buffer - points to the DTI packet out buffer to create a DTI + packet. +\param + out_buffer_sz_byte - DTI out buffer size [byte] + +\return + IFX_SUCCESS if the DTI packet has been sent. + IFX_ERROR DTI packet has not been sent. + +\remarks + At first the device msg will be read out to free the internal driver buffer. + This is done independant on the established connection. +*/ +DTI_STATIC IFX_int_t dti_optic_auto_msg_process(DTI_DeviceCtx_t *dti_dev_ctx, + const DTI_Connection_t *dti_con, + IFX_uint32_t dev_select_wait_ms, + IFX_char_t *out_buffer, + IFX_int_t out_buffer_sz_byte) +{ + IFX_int_t ret_val = IFX_SUCCESS; + struct dti_dev_gpon_optic_drv_ctx *dti_optic_ctx = + (struct dti_dev_gpon_optic_drv_ctx *) dti_dev_ctx->pDevice; + + if (dti_optic_ctx->recv_max_dev_fd == 0) + /* min DevFd = 0 --> maxFD = 0 +1, no devive enabled */ + return IFX_SUCCESS; + + DTI_DevFdZero(&dti_optic_ctx->tmp_dev_fds); + ret_val = DTI_DeviceSelect ((IFX_uint32_t)dti_optic_ctx-> + recv_max_dev_fd, + &dti_optic_ctx->recv_dev_fds, + &dti_optic_ctx->tmp_dev_fds, + dev_select_wait_ms); + + if (ret_val < 0) + return IFX_ERROR; + + return IFX_SUCCESS; +} + +DTI_STATIC IFX_int_t dti_optic_win_easy_cli_access(DTI_DeviceCtx_t *dti_dev_ctx, + IFX_int_t line_num, + const IFX_uint8_t *data_in, + const IFX_uint32_t size_in, + IFX_uint8_t *data_out, + const IFX_uint32_t size_out, + DTI_PacketError_t + *packet_err) +{ + DTI_PRN_USR_DBG_NL(DTI_GPON_OPTIC, DTI_PRN_LEVEL_HIGH, + ("WARNING: GPON Optic Dev WinEasyCiAccess - not " + "implemented."DTI_CRLF)); + + *packet_err = DTI_eErrUnknown; + return IFX_SUCCESS; +} + +IFX_int_t dti_optic_cli_send(IFX_void_t *cb_ctx, const IFX_char_t *cmd_in, + IFX_char_t *result_out, IFX_int_t *result_sz_byte, + IFX_int_t *result_code) +{ + struct dti_cli_ctx *cli_ctx = (struct dti_cli_ctx *) cb_ctx; + struct optic_exchange exchange; + IFX_int_t ret = 0; + + *result_sz_byte = 0; + + if (cli_ctx->dev_fd == -1) { + DTI_PRN_USR_DBG_NL(DTI_GPON_OPTIC, DTI_PRN_LEVEL_HIGH, + ("GPON Optic CLI Send - open device for " + "first use."DTI_CRLF)); + + cli_ctx->dev_fd = dti_optic_dev_open(cli_ctx->dev_name); + } + + if (cli_ctx->dev_fd == -1) + return IFX_ERROR; + + exchange.error = 0; + strcpy(result_out, cmd_in); + + /* driver has to react on "vig" */ +#if 0 + /** + \todo make driver accept vig instead of vg (from DSLT) */ + if (strcmp(result_out, "vig") == 0) + strcpy(result_out, "vg"); +#endif + + exchange.p_data = result_out; + exchange.length = (IFX_uint32_t) strlen(result_out) + 1; + + ret = DTI_DeviceControl(cli_ctx->dev_fd, FIO_OPTIC_CLI, + (IFX_ulong_t) &exchange); + + if (ret < 0 || exchange.error != 0) + return IFX_ERROR; + + strcpy(result_out, exchange.p_data); + *result_sz_byte = exchange.length; + + return IFX_SUCCESS; +} + +#endif /* DEVICE_GPON_OPTIC */ diff --git a/src/dti_agent_optic.h b/src/dti_agent_optic.h new file mode 100644 index 0000000..fd65296 --- /dev/null +++ b/src/dti_agent_optic.h @@ -0,0 +1,69 @@ +#ifndef _DTI_AGENT_OPTIC_H +#define _DTI_AGENT_OPTIC_H +/****************************************************************************** + + Copyright (c) 2011 + Lantiq Deutschland GmbH + Am Campeon 3; 85579 Neubiberg, Germany + + For licensing information, see the file 'LICENSE' in the root folder of + this software module. + +******************************************************************************/ +#ifdef __cplusplus +extern "C" { +#endif + +/** \file + GPON Optic device, control struct for GPON Optic access and handling. +*/ + +/* ========================================================================== + includes + ========================================================================== */ +#include "ifx_types.h" +#include "ifxos_debug.h" +#include "ifxos_device_access.h" + +/* ========================================================================== + defines + ========================================================================== */ + +/** DTI Device Interface Name */ +#define DTI_DEV_GPON_OPTIC_IF_NAME "GPON-OPTIC" + +#define DTI_BOARD_NAME_STR_GPON_OPTIC "GPON Board (optic)" + +#define DTI_GPON_OPTIC_START_ID 0 +#define DTI_GPON_OPTIC_MAX_ID 3 + +/** Max number of register accesses per packet */ +#define DTI_DEV_GPON_OPTIC_MAX_REGISTER_ACCESS_NUM 0x10 +/** Max number of debug accesses per packet */ +#define DTI_DEV_GPON_OPTIC_MAX_DEBUG_ACCESS_NUM 0x10 + +/** default GPON Optic device mailbox size */ +#define DTI_DEV_GPON_OPTIC_DEFAULT_MBOX_SIZE 0x100 + +/* ========================================================================== + macro + ========================================================================== */ + +/* ========================================================================== + types + ========================================================================== */ + +/* ========================================================================== + exports + ========================================================================== */ + +extern IFX_int_t dti_optic_cli_send(IFX_void_t *cb_ctx, + const IFX_char_t *cmd_in, + IFX_char_t *result_out, + IFX_int_t *result_sz_byte, + IFX_int_t *result_code); + +#ifdef __cplusplus +} +#endif +#endif /* _DTI_AGENT_OPTIC_H */ diff --git a/src/dti_agent_optic_ctx.h b/src/dti_agent_optic_ctx.h new file mode 100644 index 0000000..1a8b4b9 --- /dev/null +++ b/src/dti_agent_optic_ctx.h @@ -0,0 +1,93 @@ +/****************************************************************************** + + Copyright (c) 2011 + Lantiq Deutschland GmbH + Am Campeon 3; 85579 Neubiberg, Germany + + For licensing information, see the file 'LICENSE' in the root folder of + this software module. + +******************************************************************************/ +#ifndef _DTI_AGENT_OPTIC_CTX_H +#define _DTI_AGENT_OPTIC_CTX_H + +#ifdef __cplusplus +extern "C" { +#endif + +/** \file + GPON Optic device context, control struct for GPON Optic access and handling. +*/ + +/* ========================================================================== + includes + ========================================================================== */ +#include "ifx_types.h" +#include "ifxos_debug.h" +#include "ifxos_device_access.h" + +/* ========================================================================== + defines + ========================================================================== */ + +/* ========================================================================== + macro + ========================================================================== */ + +/* ========================================================================== + types + ========================================================================== */ + +/** + GPON Optic Driver Control Struct + + A GPON optic system is identified by its + - number of devices + + To access a device via the GPON Optic driver the driver provides for each + interface a device. + +*/ +struct dti_dev_gpon_optic_drv_ctx { + /** number of devices */ + IFX_int_t num_of_devs; + + /** interfaces per device */ + IFX_int_t if_per_dev; + + /** points to the array of devices fds (number of devices * interfaces + per device) */ + IFX_int_t *p_dev_fds; + + /* + DTI Config + */ + /** max number of register requests / sets */ + IFX_int_t num_of_reg_access; + /** max number of debug requests / sets */ + IFX_int_t num_of_dbg_access; + + /** recv msg handling - supported */ + IFX_boolean_t recv_dev_msg_support; + /** receive msg handling - max device fd for select */ + IFX_int_t recv_max_dev_fd; + /** receive msg handling - device FDSET */ + IFXOS_devFd_set_t recv_dev_fds; + /** receive handling - for temporary use, device FDSET */ + IFXOS_devFd_set_t tmp_dev_fds; + /** receive msg handling - recv buffer for upcoming msg's */ + IFX_ulong_t *recv_msg_buf; + /** auto msg handling - size of the modem message buffer for NFC + handling */ + IFX_int_t recv_msg_buf_sz_byte; + +}; + +/* ========================================================================== + exports + ========================================================================== */ + +#ifdef __cplusplus +} +#endif +#endif /* _DTI_AGENT_OPTIC_CTX_H */