# HG changeset patch # User alexs # Date 1255310769 -3600 # Node ID 3d4d52f8a035dc2fcf4bc861411656ca9c7ca5ee # Parent 79275fdb4f207cc8691b6e1194ed4587143512e5 * Removed files not contained within a default checkout of this branch These files were likely introduced by propogated changes but not removed as CVS tended to omit files from some checkouts without reason diff --git a/COPYING b/COPYING deleted file mode 100644 --- a/COPYING +++ /dev/null @@ -1,340 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc. - 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Library General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) year name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - , 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Library General -Public License instead of this License. diff --git a/ChangeLog b/ChangeLog deleted file mode 100644 --- a/ChangeLog +++ /dev/null @@ -1,116 +0,0 @@ -2003-03-27 Bart Veer - - * configure.in, configure: - Look for the host-side sources in tools/src as well as in host, as - per the 2.0 release tree. - Look for per-package host-side software in any/all versions of a - package, not just "current". - -2003-02-12 Bart Veer - - * README.host: update Tcl-related instructions - - * Makefile.in: regenerate - -2002-08-13 Bart Veer - - * README.host: update host-side build instructions - -2002-08-03 Bart Veer - - * acinclude.m4, configure.in, Makefile.am: - Rework host-side autoconf support - -1999-11-10 Bart Veer - - * configure.in - * configure - Added host/tools/configtool/standalone/common - -1999-11-09 Bart Veer - - * configure: - * configure.in: - Added host/tools/ecostest/common, suppressed the configtool - support for now. - -1999-08-12 Bart Veer - - * Makefile.in: - * acinclude.m4: - * aclocal.m4: - * configure.in: - * configure: - First attempt at autoconfiscation of the configtool. - -1999-06-03 Bart Veer - - * acinclude.m4: - Trying to sort out the compiler flags a bit better. - -1999-06-02 Bart Veer - - * acinclude.m4: - Added -enable-debuginfo flag which will do the right thing - for both gcc/g++ (add -g) and VC++ (add -MDd or -MD) - -1999-03-25 Bart Veer - - * configure.in: - * aclocal.m4: - * acinclude.m4: - * Makefile.am: - Sorting out the banner. - -1999-01-26 Bart Veer - - * configure.in: - * configure: - * aclocal.m4: - * Makefile.in - Update to use autoconf 2.13 and automake 1.4 - - * acinclude.m4 (CYG_AC_PATH_TCL): - Improve the support for linking with Tcl - -1999-01-21 Bart Veer - - * acinclude.m4: - Added new macro CYG_AC_SUBST_VERSION so that different packages - can use different symbols for versioning. - -1999-01-19 Bart Veer - - * acinclude.m4: - * aclocal.m4: - * Makefile.in: - Added new macros: CYG_AC_MSVC_PATH for handling pathname - problems between cygwin and VC++; and CYG_AC_PATH_TCL so - that the user can specify the location of a suitable Tcl - installation. - -1998-12-24 Bart Veer - - * configure.in: - * configure: - * aclocal.m4: - * acinclude.m4: - * Makefile.in: - * Makefile.am: - Provide support for building all host-side packages. - -1998-07-13 Bart Veer - - * ltconfig - * ltmain-sh - Merge with latest versions from devo - - * missing - * mkinstalldirs - * config.guess - * config.sub - * install-sh - * ltconfig - * ltmain-sh - Restore files that had been removed prematurely - diff --git a/Makefile.am b/Makefile.am deleted file mode 100644 --- a/Makefile.am +++ /dev/null @@ -1,44 +0,0 @@ -## Process this file with automake to produce Makefile.in -## ===================================================================== -## -## Makefile.am -## -## eCos host-side software toplevel makefile -## -## ===================================================================== -#######ECOSHOSTGPLCOPYRIGHTBEGIN#### -## ------------------------------------------- -# Copyright (C) 2002 Bart Veer -# Copyright (C) 1998, 1999, 2000, 2001 Red Hat, Inc. -# -# This file is part of the eCos host tools. -# -# This program is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License as published by the Free -# Software Foundation; either version 2 of the License, or (at your option) -# any later version. -# -# This program is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for -# more details. -# -# You should have received a copy of the GNU General Public License along with -# this program; if not, write to the Free Software Foundation, Inc., -# 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -## ------------------------------------------- -#######ECOSHOSTGPLCOPYRIGHTEND#### -## ===================================================================== -#######DESCRIPTIONBEGIN#### -## -## Author(s): bartv -## Contact(s): bartv -## Date: 1998/12/17 -## Version: 0.01 -## -######DESCRIPTIONEND#### -## ===================================================================== - -AUTOMAKE_OPTIONS = 1.3 foreign -SUBDIRS = @SUBDIRS@ - diff --git a/Makefile.in b/Makefile.in deleted file mode 100644 --- a/Makefile.in +++ /dev/null @@ -1,363 +0,0 @@ -# Makefile.in generated automatically by automake 1.4-p5 from Makefile.am - -# Copyright (C) 1994, 1995-8, 1999, 2001 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. - -#######ECOSHOSTGPLCOPYRIGHTBEGIN#### -# Copyright (C) 2002 Bart Veer -# Copyright (C) 1998, 1999, 2000, 2001 Red Hat, Inc. -# -# This file is part of the eCos host tools. -# -# This program is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License as published by the Free -# Software Foundation; either version 2 of the License, or (at your option) -# any later version. -# -# This program is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for -# more details. -# -# You should have received a copy of the GNU General Public License along with -# this program; if not, write to the Free Software Foundation, Inc., -# 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -#######ECOSHOSTGPLCOPYRIGHTEND#### -#######DESCRIPTIONBEGIN#### -######DESCRIPTIONEND#### - - -SHELL = @SHELL@ - -srcdir = @srcdir@ -top_srcdir = @top_srcdir@ -VPATH = @srcdir@ -prefix = @prefix@ -exec_prefix = @exec_prefix@ - -bindir = @bindir@ -sbindir = @sbindir@ -libexecdir = @libexecdir@ -datadir = @datadir@ -sysconfdir = @sysconfdir@ -sharedstatedir = @sharedstatedir@ -localstatedir = @localstatedir@ -libdir = @libdir@ -infodir = @infodir@ -mandir = @mandir@ -includedir = @includedir@ -oldincludedir = /usr/include - -DESTDIR = - -pkgdatadir = $(datadir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ - -top_builddir = . - -ACLOCAL = @ACLOCAL@ -AUTOCONF = @AUTOCONF@ -AUTOMAKE = @AUTOMAKE@ -AUTOHEADER = @AUTOHEADER@ - -INSTALL = @INSTALL@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS) -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -transform = @program_transform_name@ - -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -host_alias = @host_alias@ -host_triplet = @host@ -CC = @CC@ -CXX = @CXX@ -ECOS_REPOSITORY = @ECOS_REPOSITORY@ -MAINT = @MAINT@ -MAKEINFO = @MAKEINFO@ -MSVC_SRCDIR = @MSVC_SRCDIR@ -PACKAGE = @PACKAGE@ -PACKAGE_DIR = @PACKAGE_DIR@ -PACKAGE_INSTALL = @PACKAGE_INSTALL@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -VERSION = @VERSION@ -ecos_CFLAGS = @ecos_CFLAGS@ -ecos_CXXFLAGS = @ecos_CXXFLAGS@ -ecos_INCLUDES = @ecos_INCLUDES@ -ecos_LDADD = @ecos_LDADD@ -ecos_LIBS = @ecos_LIBS@ -ecos_infra_incdir = @ecos_infra_incdir@ -ecos_infra_libdir = @ecos_infra_libdir@ -ecos_libcdl_incdir = @ecos_libcdl_incdir@ -ecos_libcdl_libdir = @ecos_libcdl_libdir@ -ecos_tk_includes = @ecos_tk_includes@ -ecos_tk_libs = @ecos_tk_libs@ - -AUTOMAKE_OPTIONS = 1.3 foreign -SUBDIRS = @SUBDIRS@ -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -mkinstalldirs = $(SHELL) $(top_srcdir)/acsupport/mkinstalldirs -CONFIG_CLEAN_FILES = -DIST_COMMON = COPYING ChangeLog Makefile.am Makefile.in acinclude.m4 \ -aclocal.m4 configure configure.in - - -DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) - -TAR = gtar -GZIP_ENV = --best -all: all-redirect -.SUFFIXES: -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) - cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile - -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES) - cd $(top_builddir) \ - && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status - -$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ configure.in acinclude.m4 - cd $(srcdir) && $(ACLOCAL) - -config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - $(SHELL) ./config.status --recheck -$(srcdir)/configure: @MAINTAINER_MODE_TRUE@$(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES) - cd $(srcdir) && $(AUTOCONF) - -# 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. - -@SET_MAKE@ - -all-recursive install-data-recursive install-exec-recursive \ -installdirs-recursive install-recursive uninstall-recursive \ -check-recursive installcheck-recursive info-recursive dvi-recursive: - @set fnord $(MAKEFLAGS); amf=$$2; \ - dot_seen=no; \ - target=`echo $@ | sed s/-recursive//`; \ - list='$(SUBDIRS)'; for subdir in $$list; do \ - echo "Making $$target in $$subdir"; \ - if test "$$subdir" = "."; then \ - dot_seen=yes; \ - local_target="$$target-am"; \ - else \ - local_target="$$target"; \ - fi; \ - (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ - || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ - done; \ - if test "$$dot_seen" = "no"; then \ - $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ - fi; test -z "$$fail" - -mostlyclean-recursive clean-recursive distclean-recursive \ -maintainer-clean-recursive: - @set fnord $(MAKEFLAGS); amf=$$2; \ - dot_seen=no; \ - rev=''; list='$(SUBDIRS)'; for subdir in $$list; do \ - rev="$$subdir $$rev"; \ - test "$$subdir" != "." || dot_seen=yes; \ - done; \ - test "$$dot_seen" = "no" && rev=". $$rev"; \ - target=`echo $@ | sed s/-recursive//`; \ - for subdir in $$rev; do \ - echo "Making $$target in $$subdir"; \ - if test "$$subdir" = "."; then \ - local_target="$$target-am"; \ - else \ - local_target="$$target"; \ - fi; \ - (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ - || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ - done && test -z "$$fail" -tags-recursive: - list='$(SUBDIRS)'; for subdir in $$list; do \ - test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ - done - -tags: TAGS - -ID: $(HEADERS) $(SOURCES) $(LISP) - list='$(SOURCES) $(HEADERS)'; \ - unique=`for i in $$list; do echo $$i; done | \ - awk ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - here=`pwd` && cd $(srcdir) \ - && mkid -f$$here/ID $$unique $(LISP) - -TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP) - tags=; \ - here=`pwd`; \ - list='$(SUBDIRS)'; for subdir in $$list; do \ - if test "$$subdir" = .; then :; else \ - test -f $$subdir/TAGS && tags="$$tags -i $$here/$$subdir/TAGS"; \ - fi; \ - done; \ - list='$(SOURCES) $(HEADERS)'; \ - unique=`for i in $$list; do echo $$i; done | \ - awk ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \ - || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS) - -mostlyclean-tags: - -clean-tags: - -distclean-tags: - -rm -f TAGS ID - -maintainer-clean-tags: - -distdir = $(PACKAGE)-$(VERSION) -top_distdir = $(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 - -rm -rf $(distdir) - GZIP=$(GZIP_ENV) $(TAR) zxf $(distdir).tar.gz - mkdir $(distdir)/=build - mkdir $(distdir)/=inst - dc_install_base=`cd $(distdir)/=inst && pwd`; \ - cd $(distdir)/=build \ - && ../configure --srcdir=.. --prefix=$$dc_install_base \ - && $(MAKE) $(AM_MAKEFLAGS) \ - && $(MAKE) $(AM_MAKEFLAGS) dvi \ - && $(MAKE) $(AM_MAKEFLAGS) check \ - && $(MAKE) $(AM_MAKEFLAGS) install \ - && $(MAKE) $(AM_MAKEFLAGS) installcheck \ - && $(MAKE) $(AM_MAKEFLAGS) dist - -rm -rf $(distdir) - @banner="$(distdir).tar.gz is ready for distribution"; \ - dashes=`echo "$$banner" | sed s/./=/g`; \ - echo "$$dashes"; \ - echo "$$banner"; \ - echo "$$dashes" -dist: distdir - -chmod -R a+r $(distdir) - GZIP=$(GZIP_ENV) $(TAR) chozf $(distdir).tar.gz $(distdir) - -rm -rf $(distdir) -dist-all: distdir - -chmod -R a+r $(distdir) - GZIP=$(GZIP_ENV) $(TAR) chozf $(distdir).tar.gz $(distdir) - -rm -rf $(distdir) -distdir: $(DISTFILES) - -rm -rf $(distdir) - mkdir $(distdir) - -chmod 777 $(distdir) - here=`cd $(top_builddir) && pwd`; \ - top_distdir=`cd $(distdir) && pwd`; \ - distdir=`cd $(distdir) && pwd`; \ - cd $(top_srcdir) \ - && $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --foreign Makefile - @for file in $(DISTFILES); do \ - d=$(srcdir); \ - if test -d $$d/$$file; then \ - cp -pr $$d/$$file $(distdir)/$$file; \ - else \ - test -f $(distdir)/$$file \ - || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ - || cp -p $$d/$$file $(distdir)/$$file || :; \ - fi; \ - done - for subdir in $(SUBDIRS); do \ - if test "$$subdir" = .; then :; else \ - test -d $(distdir)/$$subdir \ - || mkdir $(distdir)/$$subdir \ - || exit 1; \ - chmod 777 $(distdir)/$$subdir; \ - (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir=../$(distdir) distdir=../$(distdir)/$$subdir distdir) \ - || exit 1; \ - fi; \ - done -info-am: -info: info-recursive -dvi-am: -dvi: dvi-recursive -check-am: all-am -check: check-recursive -installcheck-am: -installcheck: installcheck-recursive -install-exec-am: -install-exec: install-exec-recursive - -install-data-am: -install-data: install-data-recursive - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am -install: install-recursive -uninstall-am: -uninstall: uninstall-recursive -all-am: Makefile -all-redirect: all-recursive -install-strip: - $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install -installdirs: installdirs-recursive -installdirs-am: - - -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -rm -f Makefile $(CONFIG_CLEAN_FILES) - -rm -f config.cache config.log stamp-h stamp-h[0-9]* - -maintainer-clean-generic: -mostlyclean-am: mostlyclean-tags mostlyclean-generic - -mostlyclean: mostlyclean-recursive - -clean-am: clean-tags clean-generic mostlyclean-am - -clean: clean-recursive - -distclean-am: distclean-tags distclean-generic clean-am - -distclean: distclean-recursive - -rm -f config.status - -maintainer-clean-am: maintainer-clean-tags maintainer-clean-generic \ - distclean-am - @echo "This command is intended for maintainers to use;" - @echo "it deletes files that may require special tools to rebuild." - -maintainer-clean: maintainer-clean-recursive - -rm -f config.status - -.PHONY: install-data-recursive uninstall-data-recursive \ -install-exec-recursive uninstall-exec-recursive installdirs-recursive \ -uninstalldirs-recursive all-recursive check-recursive \ -installcheck-recursive info-recursive dvi-recursive \ -mostlyclean-recursive distclean-recursive clean-recursive \ -maintainer-clean-recursive tags tags-recursive mostlyclean-tags \ -distclean-tags clean-tags maintainer-clean-tags distdir info-am info \ -dvi-am dvi check check-am installcheck-am installcheck install-exec-am \ -install-exec install-data-am install-data install-am install \ -uninstall-am uninstall all-redirect all-am all installdirs-am \ -installdirs mostlyclean-generic distclean-generic clean-generic \ -maintainer-clean-generic clean mostlyclean distclean maintainer-clean - - -# 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/README.host b/README.host deleted file mode 100644 --- a/README.host +++ /dev/null @@ -1,365 +0,0 @@ - eCos Host-side Software - ======================= - -This README file only describes the eCos host-side software. For -details of the eCos target-side software or the required toolchains, -please see other documentation. A good starting point is -http://sources.redhat.com/ecos - -There are two categories of host-side software. The host subdirectory -contains generic software, primarily related to the eCos configuration -technology. All eCos users will need to use some of this technology to -configure and build eCos, either using pre-built binaries or by -building the host-side software from source. The generic software -should be portable to a wide range of host platforms. - -There is also package-specific host-side software. Much of this is I/O -related. For example the generic USB-slave package contains some -programs related to testing; a test application is run on a target -with suitable USB slave-side hardware, and needs to interact with -another program running on the USB host; the latter is -package-specific host-side software and can be found in the -subdirectory packages/io/usb/slave. Code like this may have -significant platform dependencies and may only work on a single -platform or on a small number of platforms. There may also be -special requirements, for example it may be necessary to install some -programs suid root so that they have appropriate access to the -hardware. - - -The host subdirectory includes the following: - -infra/ - This is an implementation of the eCos infrastructure that can be - used on the host-side, and provides assertion, tracing and - testcase support. - - NOTE: the eCos infrastructure facilities are not especially - well-suited to host-side development, in particular they are not - C++-oriented. There are plans to remove the current infrastructure - completely and replace it with something more suitable. People - planning new projects should be aware of this, and may wish to - avoid using the current infrastructure. - -libcdl/ - The CDL library lies at the heart of the eCos configuration - technology. - -tools/configtool/ - The sources to the various configuration tools can be found here. - -tools/configtool/common/common/ - Contains sources related to makefile generation, shared by the - command line and graphical tools. - -tools/configtool/standalone/common/ - Contains the command line ecosconfig tool. - -tools/configtool/standalone/wxwin/ - Contains sources for the wxWindows-based, Linux and Windows graphical - configuration tool. The Windows version can currently only be - built with Visual C++, not with cygwin g++. - -tools/configtool/common/win32/ -tools/configtool/standalone/win32/ - Contains sources for the older, MFC-based, Windows-only graphical - configuration tool. Again this can currently only be built with - Visual C++. - -The two graphical configuration tools have their own build procedures, -described in tools/configtool/standalone/wxwin/ReadMe and -tools/configtool/standalone/win32/ReadMe respectively. - -Package-specific host-side code lives in the host subdirectory of the -appropriate package, for example packages/io/usb/slave//host. -Most packages only provide target-side code and hence will not have a -host subdirectory. Users can install various packages from a variety -of sources, and where a package does have host-side software the -package documentation should be consulted for further information. - - -Installing on Linux, Other Unix Systems, and Cygwin ---------------------------------------------------- - -Both generic host-side software (infra, libcdl and ecosconfig) and -package-specific software can be built with the conventional -"configure/make/make install" sequence. However the code does not -conform fully to GNU coding standards so some operations such as "make -dist" are not supported. There is limited support for DejaGnu-based -testing. - -Much of the host-side software has a dependency on Tcl. This is not -supplied with the sources since many users will already have a -suitable installation, for example it is shipped as standard with all -major Linux distributions. The generic host-side software should work -with any release of Tcl from 8.0 onwards. The package-specific -software requires a more recent version, 8.3 or later. If no suitable -Tcl installation is available then the configure step will still -succeed but some of the package-specific software will not be built. - -There are two main approaches to building the host-side software: - -1) build the generic and the package-specific code in one build tree. - This uses the top-level configure script. The script automatically - invokes the configure script in the main host subdirectory. In - addition it searches the packages hierarchy for host subdirectories - containing their own configure scripts and will invoke those. - - Note: the search for host subdirectories happens during configure - time, not during the make. If new packages with host-side code are - added to the repository then it will be necessary to re-run the - toplevel configure script. - -2) build the generic code in one build tree, using the configure - script in the toplevel's host subdirectory. Then build some or all - of the package-specific code in separate build trees, using the - configure scripts in each package's host subdirectory. - -The first approach is generally simpler. However some of the -package-specific code requires special installation, for example a -program may have to be installed suid root so that it has the right -privileges to access hardware, and hence the "make install" step has -to be run by the superuser. Also some of the package-specific code is -rather specialized and may be of no interest to many users. For -example, the USB testing code is only useful when developing -USB-based applications. Hence some users may prefer the second -approach, building just the generic code and a subset of the -package-specific code. - -It is necessary to use a separate build tree rather than build -directly in the source tree. This is enforced by the configure scripts. - - $ mkdir build - $ cd build - -The next step is to run the desired configure script. To build all -the host-side software this means the toplevel configure script: - - $ /configure - -Alternatively to build just the generic host-side software, use the -configure script in the host subdirectory. - - $ mkdir host - $ cd host - $ /host/configure - -Or, to build just one package's host-side code: - - $ mkdir -p packages/io/usb/slave/current/host - $ cd packages/io/usb/slave/current/host - $ /packages/io/usb/slave/current/host/configure - -(It is not actually necessary to use the same directory structure in -the build tree as in the source tree, but doing so can avoid -confusion). - -A list of all the command-line options can be obtained by running -"configure --help". The most important ones are as follows: - -1) --prefix. This can be used to specify the location of the install - tree, defaulting to /usr/local, so the ecosconfig program ends up - in /usr/local/bin/ecosconfig and the CDL library ends up in - /usr/local/lib/libcdl.a. If an alternative location is preferred - this can be specified with --prefix, for example: - - $ /configure --prefix=/usr/local/ecos - -2) --enable-debug. By default all assertions and tracing are disabled. - When debugging any of the generic host-side software these should - be enabled. Some package-specific code may not have any extra - debug support, in which case --enable-debug would be ignored. - - $ /configure --enable-debug - - It is also possible to control most of the assertion and tracing - macros at a finer grain. This is intended mainly for use by the - developers. - - --disable-asserts disable all assertions - --disable-preconditions disable a subset of the assertions - --disable-postconditions disable a subset of the assertions - --disable-invariants disable a subset of the assertions - --disable-loopinvariants disable a subset of the assertions - --disable-tracing disable tracing - --disable-fntracing disable function entry/exit tracing - -3) --with-tcl= - --with-tcl-version= - - The host-side tools have a dependency on Tcl, which is not supplied - with the sources because many people will already have a suitable - installation. Specifically it is necessary to have the header file - tcl.h and appropriate libraries such that -ltcl will work - this - can involve either static or shared libraries. Some tools may require - Tk as well as Tcl. - - Unfortunately there is considerable variation in Tcl installations. - In theory all Tcl installations have a file tclConfig.sh which - defines exactly how to compile and link code that uses Tcl, and Tk - has a similar file tkConfig.sh. The eCos configure scripts look for - these files, first in $(prefix)/lib, then in /usr/lib. If the system - already has a Tcl installation in /usr then the configure script will - automatically find /usr/lib/tclConfig.sh and it is not necessary - to pass additional options when configuring the eCos host-side - software. Alternatively, if for example you have installed a more - recent version of Tcl/Tk in the same place that you want to install the - eCos software, e.g. /usr/local, then $(prefix)/lib/tclConfig.sh - will be read in. - - It is also possible that a more recent version of Tcl has been installed - in a different location. For example, you may wish to install the eCos host - tools in /opt/ecos but use a version of Tcl installed in /usr/local. The - eCos configure scripts need to be told explicitly where to look for - the Tcl: - - $ /configure --with-tcl=/usr/local ... - - Some systems, for example Debian Linux 3.0, do not install tclConfig.sh - in /usr/lib because that makes it more difficult to have several different - versions of Tcl installed at the same time. Instead tclConfig.sh is found - in a versioned directory such as /usr/lib/tcl8.3. Since several versions - may be installed the desired one must be specified explicitly. - - $ /configure --with-tcl-version=8.3 - - The --with-tcl and --with-tcl-version options are combined to give a search path: - - /lib/tclConfig.sh - /lib/tcl/tclConfig.sh - /lib/tclConfig.sh - /lib/tcl/tclConfig.sh - /usr/lib/tclConfig.sh - /usr/lib/tcl/tclConfig.sh - - If tclConfig.sh cannot be found in any of these places then it is assumed - that Tcl has not been properly installed and the eCos configure script will - fail. The --with-tcl and --with-tcl-version are also used to give a search - path for tkConfig.sh - - /lib/tkConfig.sh - /lib/tk/tkConfig.sh - /lib/tkConfig.sh - /lib/tk/tkConfig.sh - /usr/lib/tkConfig.sh - /usr/lib/tk/tkConfig.sh - - Again, the configure scripts must be able to find tkConfig.sh - - Once tclConfig.sh and tkConfig.sh have been found and read in, the eCos - configure scripts should have all the information needed to compile and - link code that uses Tcl. First the location of key headers such as - is needed. A tclConfig.sh file may define TCL_INC_DIR to give - a specific location, otherwise the header files should be in - $(TCL_PREFIX)/include. If cannot be found then the eCos configure - scripts will fail. - - Next it is necessary to work out how to link applications with Tcl. This - information should be provided by a tclConfig.sh variable TCL_LIB_SPEC. - Unfortunately not all Tcl installations set this, for example the cygwin - Tcl 8.4 release. If TCL_LIB_SPEC is not defined then instead the - configure script will look for a library libtcl.a, where is - specified using --with-tcl-version, then for a library libtcl.a - -Following the configure step the build tree should be set up -correctly. All that remains is the actual build and install: - - $ make - $ make install - -This should result in an ecosconfig executable, plus appropriate -libraries and header files. If the install prefix is a system -location, for example /usr/local/, then "make install" will normally -require root privileges. Also some of the package-specific software -has special installation requirements, for example programs that need -to be installed suid root, and this will also need root privileges. - - -Installing with Visual C++ --------------------------- - -Under Windows it is possible to build the generic host-side software -(infra, libcdl and ecosconfig) with Visual C++ but this is deprecated. -Building with g++ under cygwin is preferred. - -It is still necessary to run the configure script and a suitable make -utility. That requires a shell and a Unix-like environment, as -provided by cygwin. The Visual C++ compiler cl.exe needs to be on the -shell's search path, and some environment variables such as INCLUDE -and LIB may need to be set to point at the Visual C++ installation - -the details may vary depending on the version of the compiler. Then -the configure command should be run like this: - - $ CC=cl CXX=cl /host/configure - -Note that the path should be a cygwin path: cygwin mount points are -accepted and forward slashes should be used. The various configure -scripts now detect that Visual C++ should be used, and adapt -accordingly. - -Depending on what cygwin mount points are set up, /usr/local may or -may not be an appropriate install location for VC++ applications. -If not, the install location should be specified with --prefix: - - $ CC=cl CXX=cl /configure --prefix= - -It is also necessary to use the right version of Tcl. For a VC++ build -the cygwin release of Tcl should not be used. Instead a suitable -prebuilt Tcl package can be obtained from http://www.tcl.tk/. -It is necessary to tell the configure script where this has been -installed, for example: - - $ CC=cl CXX=cl /configure --prefix= \ - --with-tcl=/cygdrive/d/local/scriptics/Tcl/tcl8.1 - -The library name will be of the form tcl81.lib, and there will not be -a symbolic link from tcl.lib to the appropriate version. It will be -necessary to specify the Tcl version explicitly since the default -version is currently 8.0. - - $ CC=cl CXX=cl /configure --prefix= \ - --with-tcl=/d/local/scriptics/Tcl/tcl8.1 --with-tcl-version=81 - -Following a successful configure, the tools can be built and installed -in the normal fashion: - - $ make - $ make install - - -More Information -================ - -Please see the eCos web site, http://sources.redhat.com/ecos/, for -further details. This includes the FAQ, a form for reporting problems, -and details of the various mailing lists -(http://sources.redhat.com/ecos/intouch.html) At the time of writing -there are no separate mailing lists for the eCos host-side sources, -the main mailing list ecos-discuss@sources.redhat.com should be used -instead. - -//####COPYRIGHTBEGIN#### -// -//---------------------------------------------------------------------------- -// Copyright (C) 2002 Bart Veer -// Copyright (C) 2000, 2001 Red Hat, Inc. -// -// This file is part of the eCos host tools. -// -// This program is free software; you can redistribute it and/or modify it -// under the terms of the GNU General Public License as published by the Free -// Software Foundation; either version 2 of the License, or (at your option) -// any later version. -// -// This program is distributed in the hope that it will be useful, but WITHOUT -// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for -// more details. -// -// You should have received a copy of the GNU General Public License along with -// this program; if not, write to the Free Software Foundation, Inc., -// 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -// -// ---------------------------------------------------------------------------- -// -//####COPYRIGHTEND#### diff --git a/acinclude.m4 b/acinclude.m4 deleted file mode 100644 --- a/acinclude.m4 +++ /dev/null @@ -1,44 +0,0 @@ -dnl Process this file with aclocal to get an aclocal.m4 file. Then -dnl process that with autoconf. -dnl ==================================================================== -dnl -dnl acinclude.m4 -dnl -dnl ==================================================================== -dnl ####ECOSHOSTGPLCOPYRIGHTBEGIN#### -dnl ---------------------------------------------------------------------------- -dnl Copyright (C) 2002 Bart Veer -dnl -dnl This file is part of the eCos host tools. -dnl -dnl This program is free software; you can redistribute it and/or modify it -dnl under the terms of the GNU General Public License as published by the Free -dnl Software Foundation; either version 2 of the License, or (at your option) -dnl any later version. -dnl -dnl This program is distributed in the hope that it will be useful, but WITHOUT -dnl ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -dnl FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for -dnl more details. -dnl -dnl You should have received a copy of the GNU General Public License along with -dnl this program; if not, write to the Free Software Foundation, Inc., -dnl 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -dnl -dnl ---------------------------------------------------------------------------- -dnl ####ECOSHOSTGPLCOPYRIGHTEND#### -dnl ==================================================================== -dnl#####DESCRIPTIONBEGIN#### -dnl -dnl Author(s): bartv -dnl Contact(s): bartv -dnl Date: 2002/08/03 -dnl Version: 0.01 -dnl -dnl####DESCRIPTIONEND#### -dnl ==================================================================== - -dnl Access shared macros. -dnl AM_CONDITIONAL needs to be mentioned here or else aclocal does not -dnl incorporate the macro into aclocal.m4 -sinclude(acsupport/acinclude.m4) diff --git a/aclocal.m4 b/aclocal.m4 deleted file mode 100644 --- a/aclocal.m4 +++ /dev/null @@ -1,182 +0,0 @@ -dnl aclocal.m4 generated automatically by aclocal 1.4-p5 - -dnl Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc. -dnl This file is free software; the Free Software Foundation -dnl gives unlimited permission to copy and/or distribute it, -dnl with or without modifications, as long as this notice is preserved. - -dnl This program is distributed in the hope that it will be useful, -dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without -dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A -dnl PARTICULAR PURPOSE. - -dnl Process this file with aclocal to get an aclocal.m4 file. Then -dnl process that with autoconf. -dnl ==================================================================== -dnl -dnl acinclude.m4 -dnl -dnl ==================================================================== -dnl ####ECOSHOSTGPLCOPYRIGHTBEGIN#### -dnl ---------------------------------------------------------------------------- -dnl Copyright (C) 2002 Bart Veer -dnl -dnl This file is part of the eCos host tools. -dnl -dnl This program is free software; you can redistribute it and/or modify it -dnl under the terms of the GNU General Public License as published by the Free -dnl Software Foundation; either version 2 of the License, or (at your option) -dnl any later version. -dnl -dnl This program is distributed in the hope that it will be useful, but WITHOUT -dnl ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -dnl FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for -dnl more details. -dnl -dnl You should have received a copy of the GNU General Public License along with -dnl this program; if not, write to the Free Software Foundation, Inc., -dnl 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -dnl -dnl ---------------------------------------------------------------------------- -dnl ####ECOSHOSTGPLCOPYRIGHTEND#### -dnl ==================================================================== -dnl#####DESCRIPTIONBEGIN#### -dnl -dnl Author(s): bartv -dnl Contact(s): bartv -dnl Date: 2002/08/03 -dnl Version: 0.01 -dnl -dnl####DESCRIPTIONEND#### -dnl ==================================================================== - -dnl Access shared macros. -dnl AM_CONDITIONAL needs to be mentioned here or else aclocal does not -dnl incorporate the macro into aclocal.m4 -sinclude(acsupport/acinclude.m4) - -# Define a conditional. - -AC_DEFUN([AM_CONDITIONAL], -[AC_SUBST($1_TRUE) -AC_SUBST($1_FALSE) -if $2; then - $1_TRUE= - $1_FALSE='#' -else - $1_TRUE='#' - $1_FALSE= -fi]) - -# Do all the work for Automake. 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. - -# serial 1 - -dnl Usage: -dnl AM_INIT_AUTOMAKE(package,version, [no-define]) - -AC_DEFUN([AM_INIT_AUTOMAKE], -[AC_REQUIRE([AC_PROG_INSTALL]) -PACKAGE=[$1] -AC_SUBST(PACKAGE) -VERSION=[$2] -AC_SUBST(VERSION) -dnl test to see if srcdir already configured -if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then - AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) -fi -ifelse([$3],, -AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) -AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])) -AC_REQUIRE([AM_SANITY_CHECK]) -AC_REQUIRE([AC_ARG_PROGRAM]) -dnl FIXME This is truly gross. -missing_dir=`cd $ac_aux_dir && pwd` -AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir) -AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir) -AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir) -AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir) -AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir) -AC_REQUIRE([AC_PROG_MAKE_SET])]) - -# -# Check to make sure that the build environment is sane. -# - -AC_DEFUN([AM_SANITY_CHECK], -[AC_MSG_CHECKING([whether build environment is sane]) -# Just in case -sleep 1 -echo timestamp > conftestfile -# 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 conftestfile 2> /dev/null` - if test "[$]*" = "X"; then - # -L didn't work. - set X `ls -t $srcdir/configure conftestfile` - fi - if test "[$]*" != "X $srcdir/configure conftestfile" \ - && test "[$]*" != "X conftestfile $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" = conftestfile - ) -then - # Ok. - : -else - AC_MSG_ERROR([newly created file is older than distributed files! -Check your system clock]) -fi -rm -f conftest* -AC_MSG_RESULT(yes)]) - -dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY) -dnl The program must properly implement --version. -AC_DEFUN([AM_MISSING_PROG], -[AC_MSG_CHECKING(for working $2) -# Run test in a subshell; some versions of sh will print an error if -# an executable is not found, even if stderr is redirected. -# Redirect stdin to placate older versions of autoconf. Sigh. -if ($2 --version) < /dev/null > /dev/null 2>&1; then - $1=$2 - AC_MSG_RESULT(found) -else - $1="$3/missing $2" - AC_MSG_RESULT(missing) -fi -AC_SUBST($1)]) - -# Add --enable-maintainer-mode option to configure. -# From Jim Meyering - -# serial 1 - -AC_DEFUN([AM_MAINTAINER_MODE], -[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) - dnl maintainer-mode is disabled by default - AC_ARG_ENABLE(maintainer-mode, -[ --enable-maintainer-mode enable make rules and dependencies not useful - (and sometimes confusing) to the casual installer], - USE_MAINTAINER_MODE=$enableval, - USE_MAINTAINER_MODE=no) - AC_MSG_RESULT($USE_MAINTAINER_MODE) - AM_CONDITIONAL(MAINTAINER_MODE, test $USE_MAINTAINER_MODE = yes) - MAINT=$MAINTAINER_MODE_TRUE - AC_SUBST(MAINT)dnl -] -) - diff --git a/acsupport/ChangeLog b/acsupport/ChangeLog deleted file mode 100644 --- a/acsupport/ChangeLog +++ /dev/null @@ -1,51 +0,0 @@ -2003-02-12 Bart Veer - - * acinclude.m4: Another attempt at the Tcl macro, to cope with - cygwin tcl 8.3 and 8.4. Also fix some problems with VC++ builds. - -2002-10-27 Bart Veer - - * acinclude.m4 (ECOS_PATH_TCL): fix typo that prevented a build - under Debian Woody - -2002-09-22 Bart Veer - - * acinclude.m4: - Add the Tcl library path to ecos_LDADD (patch provided by Andrew - Lunn). Also add a reminder about ecos_tcl_version issues and - fix up Tk support. - -2002-08-27 Robin Farine - - * acinclude.m4 (ECOS_PATH_TCL): having found tclConfig.sh in - //tcl, search for tkConfig.sh in //tcl and in - //tk. - -2002-08-03 Bart Veer - - * Created as part of autoconf reorganization. - -//####COPYRIGHTBEGIN#### -// -// ---------------------------------------------------------------------------- -// Copyright (C) 2002, 2003 Bart Veer -// -// This file is part of the eCos autoconf support. -// -// This program is free software; you can redistribute it and/or modify it -// under the terms of the GNU General Public License as published by the Free -// Software Foundation; either version 2 of the License, or (at your option) -// any later version. -// -// This program is distributed in the hope that it will be useful, but WITHOUT -// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for -// more details. -// -// You should have received a copy of the GNU General Public License along with -// this program; if not, write to the Free Software Foundation, Inc., -// 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -// -// ---------------------------------------------------------------------------- -// -//####COPYRIGHTEND#### diff --git a/acsupport/acinclude.m4 b/acsupport/acinclude.m4 deleted file mode 100644 --- a/acsupport/acinclude.m4 +++ /dev/null @@ -1,891 +0,0 @@ -dnl Process this file with aclocal to get an aclocal.m4 file. Then -dnl process that with autoconf. -dnl ==================================================================== -dnl -dnl acinclude.m4 -dnl -dnl Various autoconf macros that are shared between different -dnl eCos packages. -dnl -dnl ==================================================================== -dnl ####ECOSHOSTGPLCOPYRIGHTBEGIN#### -dnl ---------------------------------------------------------------------------- -dnl Copyright (C) 2002, 2003 Bart Veer -dnl Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc. -dnl -dnl This file is part of the eCos host tools. -dnl -dnl This program is free software; you can redistribute it and/or modify it -dnl under the terms of the GNU General Public License as published by the Free -dnl Software Foundation; either version 2 of the License, or (at your option) -dnl any later version. -dnl -dnl This program is distributed in the hope that it will be useful, but WITHOUT -dnl ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -dnl FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for -dnl more details. -dnl -dnl You should have received a copy of the GNU General Public License along with -dnl this program; if not, write to the Free Software Foundation, Inc., -dnl 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -dnl -dnl ---------------------------------------------------------------------------- -dnl ####ECOSHOSTGPLCOPYRIGHTEND#### -dnl ==================================================================== -dnl#####DESCRIPTIONBEGIN#### -dnl -dnl Author(s): bartv -dnl Contact(s): bartv -dnl Date: 1998/12/16 -dnl Version: 0.01 -dnl -dnl####DESCRIPTIONEND#### -dnl ==================================================================== - -dnl ==================================================================== -dnl Ensure that configure is not being run in the source tree, i.e. -dnl that a separate build tree has been created. This is not absolutely -dnl necessary at the time of writing but may become so in future, and -dnl is good practice. - -AC_DEFUN(ECOS_CHECK_BUILD_ne_SRC,[ - AC_MSG_CHECKING([that a separate build tree is being used]) - ecos_cwd=`/bin/pwd` - if test "${srcdir}" = "." ; then - srcdir=${ecos_cwd} - fi - if test "${ecos_cwd}" = "${srcdir}" ; then - AC_MSG_RESULT([no]) - AC_MSG_ERROR([This configure script should not be run inside the source tree. Instead please use a separate build tree]) - else - AC_MSG_RESULT(yes) - fi -]) - -dnl ==================================================================== -dnl The AM_INIT_AUTOMAKE() will define a symbol VERSION for the -dnl package's version number. Unfortunately this symbol is rather -dnl hard to share if several different packages are involved, so this -dnl macro is used to define an alternative symbol - -AC_DEFUN(ECOS_SUBST_VERSION,[ - AC_REQUIRE([AM_INIT_AUTOMAKE]) - ifelse($#,1,,AC_MSG_ERROR([Invalid number of arguments passed to ECOS SUBST_VERSION])) - AC_DEFINE_UNQUOTED($1, "$VERSION") -]) - -dnl -------------------------------------------------------------------- -dnl Convert a cygwin pathname to something acceptable to VC++ (but -dnl still invoked from bash and cygwin's make). This means using -dnl the cygpath utility and then translating any backslashes into -dnl forward slashes to avoid confusing make. - -AC_DEFUN(ECOS_MSVC_PATH, [ - AC_REQUIRE([ECOS_PROG_MSVC]) - ifelse($#, 1, , AC_MSG_ERROR("Invalid number of arguments passed to ECOS MSVC_PATH")) - if test "${MSVC}" = "yes" ; then - $1=`cygpath -w ${$1} | tr \\\\\\\\ /` - fi -]) - -dnl ==================================================================== -dnl An internal utility to define eCos variants of various compilation -dnl related flags. The aim is to avoid messing with CFLAGS, LIBS, and -dnl so on because those are used for feature tests as well as for -dnl passing on to the application. -AC_DEFUN(ECOS_PROG_DEFINE_COMPILER_FLAGS,[ - ecos_CFLAGS="" - ecos_CXXFLAGS="" - ecos_LDADD="" - ecos_INCLUDES="" - ecos_LIBS="" - AC_SUBST(ecos_CFLAGS) - AC_SUBST(ecos_CXXFLAGS) - AC_SUBST(ecos_LDADD) - AC_SUBST(ecos_INCLUDES) - AC_SUBST(ecos_LIBS) -]) - -dnl For historical reasons some of the eCos host-side software can be -dnl built with Visual C++ as well as g++. The user can specify this -dnl at configure time using CC=cl, where cl.exe is the compiler driver. -dnl This macro will set the variable MSVC to "yes" or to "no" depending -dnl on whether or not VC++ is being used, analogous to the variable -dnl GCC set by AC_PROG_CC. It provides support for an automake -dnl conditional thus allowing the makefile to adapt somewhat to the -dnl compiler being used. Finally it fills in the ECOS_INCLUDES, -dnl ECOS_LIBS and ECOS_LDADD variables with suitable initial values. - -AC_DEFUN(ECOS_PROG_MSVC,[ - AC_REQUIRE([AC_PROG_CC]) - AC_REQUIRE([AC_PROG_CXX]) - AC_REQUIRE([ECOS_PROG_DEFINE_COMPILER_FLAGS]) - - AC_MSG_CHECKING("for Visual C++") - MSVC="no"; - if test "${CC}" = "cl" ; then - MSVC="yes" - CXX="cl" - MSVC_SRCDIR=${srcdir} - ECOS_MSVC_PATH(MSVC_SRCDIR) - AC_SUBST(MSVC_SRCDIR) - ecos_INCLUDES="${ecos_INCLUDES} \"-I${MSVC_SRCDIR}\"" - ecos_LDADD="-link" - ecos_LIBS="advapi32.lib" - fi - AM_CONDITIONAL(MSVC, test "${MSVC}" = "yes") - if test "${MSVC}" = "yes" ; then - AC_MSG_RESULT([unfortunately yes]) - else - AC_MSG_RESULT([no]) - fi -]) - -dnl ==================================================================== -dnl Set up sensible flags for the various different compilers. This -dnl is achieved by manipulating AM-CFLAGS and AM-CXXFLAGS via a subst, -dnl plus undoing the setting of CFLAGS and CXXFLAGS done by -dnl the AC_PROC_CC and AC_PROG_CXX macros (e.g. setting the default -dnl compilation flags to -O2). Note that this relies -dnl on knowing about the internals of those macros. -dnl -dnl There is little point in checking the cache: this macro does -dnl not do any feature tests so checking the cache would probably -dnl be more expensive than doing the work here. -dnl -dnl For now the only supported compilers are gcc/g++ and VC++. Attempts -dnl to use another compiler will result in an error at configure-time. -AC_DEFUN(ECOS_PROG_STANDARD_COMPILER_FLAGS, [ - AC_REQUIRE([AC_PROG_CC]) - AC_REQUIRE([AC_PROG_CXX]) - AC_REQUIRE([ECOS_PROG_DEFINE_COMPILER_FLAGS]) - AC_REQUIRE([ECOS_PROG_MSVC]) - - AC_MSG_CHECKING("the default compiler flags") - - dnl Add a user-settable flag to control whether or debugging info is - dnl incorporated at compile-time. - ecosflags_enable_debug="no" - AC_ARG_ENABLE(debug,[ --enable-debug do a debug rather than a release build], - [case "${enableval}" in - yes) ecosflags_enable_debug="yes" ;; - *) ecosflags_enable_debug="no" ;; - esac]) - - dnl For VC++ builds also provide a flag for ANSI vs. unicode builds. - dnl For now this does not actually affect the compiler flags. - dnl NOTE: there may also have to be a flag to control whether or - dnl the VC++ multi-threading flags are enabled. - ecosflags_enable_ansi="no" - if test "${MSVC}" = "yes" ; then - AC_ARG_ENABLE(ansi,[ --enable-ansi do an ANSI rather than a unicode build], - [case "${enableval}" in - yes) ecosflags_enable_ansi="yes" ;; - *) ecosflags_enable_ansi="no" ;; - esac]) - fi - - dnl Now we know what the user is after. - if test "${GCC}" = "yes" ; then - ecos_CFLAGS="${ecos_CFLAGS} -pipe -Wall -Wpointer-arith -Wbad-function-cast -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs" - ecos_CXXFLAGS="${ecos_CXXFLAGS} -pipe -Wall -Wpointer-arith -Wbad-function-cast -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Woverloaded-virtual" - elif test "${MSVC}" = "yes" ; then - ecos_CFLAGS="${ecos_CFLAGS} -nologo -W3" - ecos_CXXFLAGS="${ecos_CXXFLAGS} -nologo -W3 -GR -GX" - else - AC_MSG_ERROR("default flags for ${CC} are not known") - fi - - dnl Choose between debugging and optimization. - if test "${ecosflags_enable_debug}" = "yes" ; then - if test "${GCC}" = "yes" ; then - ecos_CFLAGS="${ecos_CFLAGS} -g -O0" - ecos_CXXFLAGS="${ecos_CXXFLAGS} -g -O0" - elif test "${MSVC}" = "yes" ; then - ecos_CFLAGS="${ecos_CFLAGS} -MDd -Zi" - ecos_CXXFLAGS="${ecos_CXXFLAGS} -MDd -Zi" - fi - else - dnl For now building with g++ implies -O0 rather than -O2. The - dnl compile-time performance of g++ at -O2 has been disappointing - dnl for quite some time, and the eCos host-side code is not - dnl sufficiently cpu-intensive to require -O2. - if test "${GCC}" = "yes" ; then - ecos_CFLAGS="${ecos_CFLAGS} -O0" - ecos_CXXFLAGS="${ecos_CXXFLAGS} -O0" - elif test "${MSVC}" = "yes" ; then - ecos_CFLAGS="${ecos_CFLAGS} -MD -O2" - ecos_CXXFLAGS="${ecos_CXXFLAGS} -MD -O2" - fi - fi - - CFLAGS="${ac_save_CFLAGS}" - CXXFLAGS="${ac_save_CXXFLAGS}" - - AC_MSG_RESULT(done) -]) - -dnl -------------------------------------------------------------------- -dnl User-settable options for assertions and tracing. -dnl -dnl The settable options are: -dnl --disable-asserts -dnl --disable-preconditions -dnl --disable-postconditions -dnl --disable-invariants -dnl --disable-loopinvariants -dnl --disable-tracing -dnl --disable-fntracing - -AC_DEFUN(ECOS_ARG_INFRASTRUCTURE, [ - - AC_REQUIRE([ECOS_PROG_STANDARD_COMPILER_FLAGS]) - - if test "${ecosflags_enable_debug}" = "yes" ; then - ecosinfra_asserts="yes" - ecosinfra_preconditions="yes" - ecosinfra_postconditions="yes" - ecosinfra_invariants="yes" - ecosinfra_loopinvariants="yes" - ecosinfra_tracing="yes" - ecosinfra_fntracing="yes" - else - ecosinfra_asserts="no" - ecosinfra_preconditions="no" - ecosinfra_postconditions="no" - ecosinfra_invariants="no" - ecosinfra_loopinvariants="no" - ecosinfra_tracing="no" - ecosinfra_fntracing="no" - fi - - AC_ARG_ENABLE(asserts,[ --disable-asserts disable all assertions], - [case "${enableval}" in - yes) ecosinfra_asserts="yes" ;; - no) ecosinfra_asserts="no" ;; - *) AC_MSG_ERROR([bad value ${enableval} for disable-asserts option]) ;; - esac]) - if test "${ecosinfra_asserts}" = "yes"; then - AC_DEFINE(CYGDBG_USE_ASSERTS) - fi - - AC_ARG_ENABLE(preconditions, [ --disable-preconditions disable a subset of the assertions], - [case "${enableval}" in - yes) ecosinfra_preconditions="yes" ;; - no) ecosinfra_preconditions="no" ;; - *) AC_MSG_ERROR([bad value ${enableval} for disable-preconditions option]) ;; - esac]) - if test "${ecosinfra_preconditions}" = "yes"; then - AC_DEFINE(CYGDBG_INFRA_DEBUG_PRECONDITIONS) - fi - - AC_ARG_ENABLE(postconditions, [ --disable-postconditions disable a subset of the assertions], - [case "${enableval}" in - yes) ecosinfra_postconditions="yes" ;; - no) ecosinfra_postconditions="no" ;; - *) AC_MSG_ERROR([bad value ${enableval} for disable-postconditions option]) ;; - esac]) - if test "${ecosinfra_postconditions}" = "yes"; then - AC_DEFINE(CYGDBG_INFRA_DEBUG_POSTCONDITIONS) - fi - - AC_ARG_ENABLE(invariants, [ --disable-invariants disable a subset of the assertions], - [case "${enableval}" in - yes) ecosinfra_invariants="yes" ;; - no) ecosinfra_invariants="no" ;; - *) AC_MSG_ERROR([bad value ${enableval} for disable-invariants option]) ;; - esac]) - if test "${ecosinfra_invariants}" = "yes"; then - AC_DEFINE(CYGDBG_INFRA_DEBUG_INVARIANTS) - fi - - AC_ARG_ENABLE(loopinvariants, [ --disable-loopinvariants disable a subset of the assertions], - [case "${enableval}" in - yes) ecosinfra_loopinvariants="yes" ;; - no) ecosinfra_loopinvariants="no" ;; - *) AC_MSG_ERROR([bad value ${enableval} for disable-loopinvariants option]) ;; - esac]) - if test "${ecosinfra_loopinvariants}" = "yes"; then - AC_DEFINE(CYGDBG_INFRA_DEBUG_LOOP_INVARIANTS) - fi - - AC_ARG_ENABLE(tracing,[ --disable-tracing disable tracing], - [case "${enableval}" in - yes) ecosinfra_tracing="yes" ;; - no) ecosinfra_tracing="no" ;; - *) AC_MSG_ERROR([bad value ${enableval} for disable-tracing option]) ;; - esac]) - if test "${ecosinfra_tracing}" = "yes"; then - AC_DEFINE(CYGDBG_USE_TRACING) - fi - - AC_ARG_ENABLE(fntracing,[ --disable-fntracing disable function entry/exit tracing], - [case "${enableval}" in - yes) ecosinfra_fntracing="yes" ;; - no) ecosinfra_fntracing=no ;; - *) AC_MSG_ERROR([bad value ${enableval} for disable-fntracing option]) ;; - esac]) - if test "${ecosinfra_fntracing}" = "yes"; then - AC_DEFINE(CYGDBG_INFRA_DEBUG_FUNCTION_REPORTS) - fi -]) - -dnl ==================================================================== -dnl Inspired by KDE's autoconfig -dnl This macro takes three Arguments like this: -dnl AC_FIND_FILE(foo.h, $incdirs, incdir) -dnl the filename to look for, the list of paths to check and -dnl the variable with the result. - -AC_DEFUN(AC_FIND_FILE,[ - $3="" - for i in $2; do - if test -r "$i/$1"; then - $3=$i - break - fi - done -]) - -dnl ==================================================================== -dnl Variation of the above. -dnl This macro takes three Arguments like this: -dnl AC_FIND_DIR(infra, $incdirs, incdir) -dnl the directory name to look for, the list of paths to check and -dnl the variable with the result. - -AC_DEFUN(AC_FIND_DIR,[ - $3="" - for i in $2; do - if test -d "$i/$1"; then - $3=$i - break - fi - done -]) - -dnl ==================================================================== -dnl Work out details of the Tcl/tk installation that should be used. -dnl In theory this is simple: when Tcl is installed in -dnl (usually /usr) there should be a file /lib/tclConfig.sh -dnl which defines exactly how to build Tcl-based applications. Of course -dnl Tcl may be installed anywhere, not just in /usr, so it is necessary -dnl to do some searching. There is a command-line argument -dnl --with-tcl= to specify the Tcl installation, so the macro -dnl can search for /lib/tclConfig.sh, /lib/tclConfig.sh -dnl and /usr/lib/tclConfig.sh -dnl -dnl Unfortunately not all systems use this convention. For example, -dnl at the time of writing Debian installs tclConfig.sh in a versioned -dnl subdirectory /usr/lib/tcl8.3/tclConfig.sh. Hence there is an -dnl additional argument --with-tcl-version= which is used to -dnl extend the search path. -dnl -dnl For VC++ builds the situation is different again. Tcl may be -dnl installed anywhere, so the data in tclConfig.sh is not useful -dnl (and that file may not be provided at all). Instead --with-tcl -dnl must be used to specify the path. Alternatively separate paths -dnl for headers and libraries can be specified using --with-tcl-header -dnl and --with-tcl-lib. Usually it will also be necessary to specify -dnl the library version number using --with-tcl-version. - -dnl This adds two main command-line options, --with-tcl= to -dnl specify the Tcl install directory, and --with-tcl-version= -dnl to control which version of Tcl should be used. For finer-grained -dnl control there are additional options --with-tcl-header and -dnl --with-tcl-version. It is assumed that Tcl and Tk are installed -dnl in the same place. -dnl -dnl On Unix systems and under cygwin there should be a file -dnl $(tcl_prefix)/lib/tclConfig.sh containing all the information -dnl needed for Tcl. This file is consulted and the appropriate -dnl variables extracted. Similar information for Tk lives in -dnl tkConfig.sh. As a useful side effect all variables defined -dnl in those scripts can be accessed. -dnl -dnl To confuse matters, subtly different naming conventions are used -dnl under Unix and NT. Under Unix the Tcl library will be called -dnl libtcl8.0.a, libtcl8.1.a, etc. with a dot between the major and -dnl minor version. Under NT (including cygwin) the library will be -dnl called tcl80.lib, tcl81.lib, libtcl80.a, libtcl81.a, etc. -dnl without a dot. -dnl -dnl Currently this macro assumes that Tcl is preinstalled, and not -dnl built alongside eCos. Specifically the macro checks that -dnl tcl.h can be found, plus on Unix systems tclConfig.sh and -dnl tkConfig.sh as well. -dnl -dnl This macro updates the build-related variables ecos_INCLUDES, -dnl ecos_LDADD, and ecos_LIBS. The latter assumes the application -dnl only needs Tcl. If Tk is needed as well then the variable -dnl ecos_tklibs should be used in addition. - -AC_DEFUN(ECOS_PATH_TCL, [ - - AC_REQUIRE([ECOS_PROG_MSVC]) - AC_REQUIRE([AC_CYGWIN]) - - ecos_tk_libs="" - ecos_tk_libdir="" - - dnl Where is the Tcl installation, and what version should be used? - AC_MSG_CHECKING(for Tcl installation) - AC_ARG_WITH(tcl,[ --with-tcl= location of Tcl header and libraries]) - AC_ARG_WITH(tcl-version,[ --with-tcl-version= version of Tcl to be used]) - - dnl If using VC++ then there are no sensible default directories - dnl to search for a Tcl installation. Instead the user must - dnl supply either --with-tcl, or both --with-tcl-header and - dnl --with-tcl-lib. - dnl - dnl Also when using VC++ there is no tclConfig.sh file to - dnl consult about which libraries are needed. Instead that - dnl information is hard-wired here. - if test "${MSVC}" = "yes" ; then - AC_ARG_WITH(tcl-header,[ --with-tcl-header= location of Tcl header]) - AC_ARG_WITH(tcl-lib,[ --with-tcl-lib= location of Tcl libraries]) - ecos_tcl_incdir="" - ecos_tcl_libdir="" - if test "${with_tcl_version+set}" != set ; then - AC_MSG_ERROR(You must specify a Tcl version using --with-tcl-version=) - fi - if test "${with_tcl_header+set}" = set ; then - ecos_tcl_incdir=${with_tcl_header} - elif test "${with_tcl+set}" = set ; then - ecos_tcl_incdir="${with_tcl}/include" - else - AC_MSG_ERROR(You must specify a Tcl installation with either --with-tcl= or --with-tcl-header=) - fi - if test "${with_tcl_lib+set}" = set; then - ecos_tcl_libdir=${with_tcl_lib} - elif test "${with_tcl+set}" = set; then - ecos_tcl_libdir="${with_tcl}/lib" - else - AC_MSG_ERROR(You must specify a Tcl installation with either --with-tcl= or --with-tcl-lib=) - fi - - dnl Sanity check, make sure that there is a tcl.h header file. - dnl If not then there is no point in proceeding. - if test \! -r "${ecos_tcl_incdir}/tcl.h" ; then - AC_MSG_ERROR([unable to locate Tcl header file tcl.h]) - fi - - ECOS_MSVC_PATH(ecos_tcl_incdir) - ECOS_MSVC_PATH(ecos_tcl_libdir) - ecos_INCLUDES="${ecos_INCLUDES} \"-I${ecos_tcl_incdir}\"" - ecos_LIBS="${ecos_LIBS} tcl${with_tcl_version}.lib" - ecos_LDADD="${ecos_LDADD} \"-libpath=${ecos_tcl_libdir}\"" - - dnl FIXME: what libraries are needed for a tk application under VC++? - dnl and can the version be determined more accurately? - ecos_tk_libs="" - - else - dnl Try to find tclConfig.sh - possibles="" - if test "${with_tcl+set}" = set ; then - possibles="${with_tcl}/lib" - if test "${with_tcl_version+set}" = set ; then - possibles="${possibles} ${with_tcl}/lib/tcl${with_tcl_version}" - fi - fi - possibles="${possibles} ${prefix}/lib" - if test "${with_tcl_version+set}" = set ; then - possibles="${possibles} ${prefix}/lib/tcl${with_tcl_version}" - fi - possibles="${possibles} /usr/lib" - if test "${with_tcl_version+set}" = set ; then - possibles="${possibles} /usr/lib/tcl${with_tcl_version}" - fi - AC_FIND_FILE("tclConfig.sh", ${possibles}, tclconfig) - if test \! -r "${tclconfig}/tclConfig.sh" ; then - AC_MSG_ERROR(unable to locate Tcl configuration file tclConfig.sh) - else - . ${tclconfig}/tclConfig.sh - - dnl Now we need to figure out where to find the Tcl header files. - dnl tclConfig.sh may define a variable TCL_INC_DIR, otherwise - dnl use TCL_PREFIX/include - if test -z "${TCL_INC_DIR}" ; then - ecos_tcl_incdir="${TCL_PREFIX}/include" - else - ecos_tcl_incdir="${TCL_INC_DIR}" - fi - if test \! -r "${ecos_tcl_incdir}/tcl.h" ; then - AC_MSG_ERROR(unable to locate Tcl header file tcl.h) - else - dnl On Unix systems -I/usr/include is unnecessary, and can - dnl cause problems on hosts where gcc is not the platform's - dnl default compiler because of the use of unfixed headers. - dnl Hence it is explicitly removed here. - if test "${ecos_tcl_incdir}" != "/usr/include" ; then - ecos_INCLUDES="${ecos_INCLUDES} -I${ecos_tcl_incdir}" - fi - fi - - dnl There should be a variable TCL_LIB_SPEC which defines - dnl exactly how to link with Tcl. Unfortunately this is not - dnl 100% guaranteed, so a backup solution is still needed. - dnl NOTE: there is also TCL_LIBS defining additional libraries - dnl such as -ldl. That may have to be added to ecos_LIBS. - if test -z "${TCL_LIB_SPEC}" -a "${with_tcl_version+set}" = set ; then - AC_FIND_FILE("libtcl${with_tcl_version}.a", ${possibles}, libtcl) - if test -r "${libtcl}/libtcl${with_tcl_version}.a" ; then - TCL_LIB_SPEC="-L${libtcl} -ltcl${with_tcl_version}" - fi - fi - if test -z "${TCL_LIB_SPEC}" ; then - AC_FIND_FILE("libtcl.a", ${possibles}, libtcl) - if test -r "${libtcl}/libtcl.a" ; then - TCL_LIB_SPEC="-L${libtcl} -ltcl" - fi - fi - if test -z "${TCL_LIB_SPEC}" ; then - AC_MSG_ERROR(${tclconfig}/tclConfig.sh does not define TCL_LIB_SPEC, and unable to find libtcl.a) - fi - ecos_LIBS="${ecos_LIBS} ${TCL_LIB_SPEC}" - - dnl Next, look for tkConfig.sh - possibles=`echo ${possibles} | sed -e 's,tcl,tk,g'` - AC_FIND_FILE("tkConfig.sh", ${possibles}, tkconfig) - if test \! -r "${tkconfig}/tkConfig.sh" ; then - AC_MSG_ERROR(unable to locate Tk config file tkConfig.sh) - else - . ${tkconfig}/tkConfig.sh - if test -z "${TK_INC_DIR}" ; then - if test "${TK_PREFIX}" = "/usr" ; then - ecos_tk_includes="${TK_XINCLUDES}" - else - ecos_tk_includes="-I${TK_PREFIX}/include ${TK_XINCLUDES}" - fi - else - ecos_tk_includes="-I${TK_INC_DIR} ${TK_XINCLUDES}" - fi - - dnl As with TCL_LIB_SPEC, TK_LIB_SPEC may be empty - if test -z "${TK_LIB_SPEC}" -a "${with_tcl_version+set}" = set ; then - AC_FIND_FILE("libtk${with_tcl_version}.a", ${possibles}, libtk) - if test -r "${libtk}/libtk${with_tcl_version}.a" ; then - TK_LIB_SPEC="-L${libtk} -ltk${with_tcl_version}" - fi - fi - if test -z "${TK_LIB_SPEC}" ; then - AC_FIND_FILE("libtk.a", ${possibles}, libtk) - if test -r "${libtk}/libtk.a" ; then - TK_LIB_SPEC="-L${libtk} -ltk" - fi - fi - if test -z "${TK_LIB_SPEC}" ; then - AC_MSG_ERROR(${tkconfig}/tkConfig.sh does not define TK_LIB_SPEC, and unable to find libtk.a) - fi - ecos_tk_libs="${TK_LIB_SPEC} ${TK_LIBS}" - fi - fi - fi - - AC_MSG_RESULT([-I${ecos_tcl_incdir} ${TCL_LIB_SPEC}]) - AC_SUBST(ecos_tk_includes) - AC_SUBST(ecos_tk_libs) -]) - -dnl ==================================================================== -dnl Search for the infrastructure headers. Usually these can be picked -dnl up from host/infra in the build tree. This macro updates -dnl ecos_INCLUDES, ecos_LDADD and ecos_LIBS appropriately. In addition -dnl it defines new variables ecos_infra_incdir and ecos_infra_libdir, -dnl useful for listing explicit dependencies. -dnl -dnl This macro should only be used in configure scripts that run after -dnl the infrastructure has been configured because it relies on the -dnl infra directory already having been created in the build tree. - -AC_DEFUN(ECOS_PATH_INFRA, [ - AC_MSG_CHECKING([for eCos host-side infrastructure]) - - dnl Where are we in the build tree? First assume that we are in the host - dnl tree, thus allowing configury of just the host-side. If that fails - dnl assume we can be anywhere. - infra_builddir="" - possibles=".. ../.. ../../.. ../../../.. ../../../../.." - AC_FIND_DIR("infra", ${possibles}, infra_builddir) - if test "${infra_builddir}" = "" ; then - possibles="../host ../../host ../../../host ../../../../host ../../../../../host ../../../../../../host" - AC_FIND_DIR("infra", ${possibles}, infra_builddir) - fi - if test "${infra_builddir}" != "" ; then - infra_builddir="${infra_builddir}/infra" - infra_builddir=`cd ${infra_builddir} && /bin/pwd` - fi - - ecos_infra_incdir="" - ecos_infra_libdir="" - ecos_infra_libs="" - - AC_ARG_WITH(infra-header,[ --with-infra-header= location of eCos infrastructure headers]) - AC_ARG_WITH(infra-lib,[ --with-infra-lib= location of eCos infrastructure library]) - AC_ARG_WITH(infra,[ --with-infra= location of eCos infrastructure installation]) - - if test "${with_infra_header+set}" = "set"; then - ecos_infra_incdir="${with_infra_header}" - elif test "${with_infra+set}" = "set"; then - ecos_infra_incdir="${with_infra}/include" - elif test "${infra_builddir}" != "" ; then - ecos_infra_incdir="${infra_builddir}" - else - AC_MSG_ERROR([infrastructure headers not found]) - fi - if test "${MSVC}" = "yes" ; then - ecos_msvc_infra_incdir=${ecos_infra_incdir} - ECOS_MSVC_PATH(ecos_msvc_infra_incdir) - ecos_INCLUDES="${ecos_INCLUDES} \"-I${ecos_msvc_infra_incdir}\"" - else - ecos_INCLUDES="${ecos_INCLUDES} -I${ecos_infra_incdir}" - fi - - if test "${with_infra_lib+set}" = "set"; then - ecos_infra_libdir="${with_infra_lib}" - elif test "${with_infra+set}" = "set"; then - ecos_infra_libdir="${with_infra}/lib" - elif test "${infra_builddir}" != "" ; then - ecos_infra_libdir="${infra_builddir}" - else - AC_MSG_ERROR([infrastructure library not found]) - fi - if test "${MSVC}" = "yes" ; then - ecos_msvc_infra_libdir=${ecos_infra_libdir} - ECOS_MSVC_PATH(ecos_msvc_infra_libdir) - ecos_LIBS="${ecos_LIBS} cyginfra.lib" - ecos_LDADD="${ecos_LDADD} \"-libpath=${ecos_msvc_infra_libdir}\"" - else - ecos_LIBS="${ecos_LIBS} -lcyginfra" - ecos_LDADD="${ecos_LDADD} -L${ecos_infra_libdir}" - fi - - AC_SUBST(ecos_infra_incdir) - AC_SUBST(ecos_infra_libdir) - AC_MSG_RESULT(-I[${ecos_infra_incdir} -L${ecos_infra_libdir}]) -]) - -dnl ==================================================================== -dnl And a very similar macro for libcdl, but note that the headers -dnl are in the source tree rather than the build tree. - -AC_DEFUN(ECOS_PATH_LIBCDL, [ - AC_MSG_CHECKING([for libcdl]) - - dnl Where are we in the source tree? - libcdl_srcdir="" - possibles="${srcdir}/.. ${srcdir}/../.. ${srcdir}/../../.. ${srcdir}/../../../.. ${srcdir}/../../../../.." - AC_FIND_DIR("libcdl", ${possibles}, libcdl_srcdir) - if test "${libcdl_srcdir}" = "" ; then - possibles="${srcdir}/../host ${srcdir}/../../host ${srcdir}/../../../host ${srcdir}/../../../../host ${srcdir}/../../../../../host ${srcdir}/../../../../../../host" - AC_FIND_DIR("libcdl", ${possibles}, libcdl_srcdir) - fi - if test "${libcdl_srcdir}" != "" ; then - libcdl_srcdir="${libcdl_srcdir}/libcdl" - libcdl_srcdir=`cd ${libcdl_srcdir} && /bin/pwd` - fi - - dnl And where are we in the build tree? - libcdl_builddir="" - possibles=".. ../.. ../../.. ../../../.. ../../../../.." - AC_FIND_DIR("libcdl", ${possibles}, libcdl_builddir) - if test "${libcdl_builddir}" = "" ; then - possibles="../host ../../host ../../../host ../../../../host ../../../../../host ../../../../../../host" - AC_FIND_DIR("libcdl", ${possibles}, libcdl_builddir) - fi - if test "${libcdl_builddir}" != "" ; then - libcdl_builddir="${libcdl_builddir}/libcdl" - libcdl_builddir=`cd ${libcdl_builddir} && /bin/pwd` - fi - - ecos_libcdl_incdir="" - ecos_libcdl_libdir="" - ecos_libcdl_libs="" - - AC_ARG_WITH(libcdl-header,[ --with-libcdl-header= location of eCos libcdl headers]) - AC_ARG_WITH(libcdl-lib,[ --with-libcdl-lib= location of eCos libcdl library]) - AC_ARG_WITH(libcdl,[ --with-libcdl= location of eCos libcdl installation]) - - if test "${with_libcdl_header+set}" = "set"; then - ecos_libcdl_incdir="${with_libcdl_header}" - elif test "${with_libcdl+set}" = "set"; then - ecos_libcdl_incdir="${with_libcdl}/include" - elif test "${libcdl_srcdir}" != "" ; then - ecos_libcdl_incdir="${libcdl_srcdir}" - fi - if test \! -r "${ecos_libcdl_incdir}/cdl.hxx" ; then - AC_MSG_ERROR([libcdl headers not found]) - fi - if test "${MSVC}" = "yes" ; then - ecos_msvc_libcdl_incdir="${ecos_libcdl_incdir}" - ECOS_MSVC_PATH(ecos_msvc_libcdl_incdir) - ecos_INCLUDES="${ecos_INCLUDES} \"-I${ecos_msvc_libcdl_incdir}\"" - else - ecos_INCLUDES="${ecos_INCLUDES} -I${ecos_libcdl_incdir}" - fi - - if test "${with_libcdl_lib+set}" = "set"; then - ecos_libcdl_libdir="${with_libcdl_lib}" - elif test "${with_libcdl+set}" = "set"; then - ecos_libcdl_libdir="${with_libcdl}/lib" - elif test "${libcdl_builddir}" != "" ; then - ecos_libcdl_libdir="${libcdl_builddir}" - else - AC_MSG_ERROR([libcdl library not found]) - fi - if test "${MSVC}" = "yes" ; then - ecos_msvc_libcdl_libdir=${ecos_libcdl_libdir} - ECOS_MSVC_PATH(ecos_msvc_libcdl_libdir) - ecos_LIBS="${ecos_LIBS} cdl.lib" - ecos_LDADD="${ecos_LDADD} \"-libpath=${ecos_msvc_libcdl_libdir}\"" - else - ecos_LIBS="${ecos_LIBS} -lcdl" - ecos_LDADD="${ecos_LDADD} -L${ecos_libcdl_libdir}" - fi - - AC_SUBST(ecos_libcdl_incdir) - AC_SUBST(ecos_libcdl_libdir) - AC_MSG_RESULT([-I${ecos_libcdl_incdir} -L${ecos_libcdl_libdir}]) -]) - -dnl ==================================================================== -dnl Look for a 64 bit data type. It is necessary to check both C and C++ -dnl compilers. -dnl -dnl A better implementation would check whether or not AC_PROG_CC and -dnl AC_PROG_CXX have been invoked and only test the appropriate -dnl compiler. -dnl -dnl When cross-compiling, default to long long on the assumption that -dnl gcc/g++ must be used and long long is likely to be the 64 bit data -dnl type. This is not guaranteed, but sufficiently likely to meet -dnl the requirements for the time being. The CHECK_SIZEOF() macro -dnl might be another way to get the desired information. - -AC_DEFUN(ECOS_TYPE_64bit, [ - AC_REQUIRE([AC_PROG_CC]) - AC_REQUIRE([AC_PROG_CXX]) - - AC_CACHE_CHECK("for a 64 bit data type",ecos_cv_type_64bit,[ - for type in "long" "long long" "__int64"; do - AC_LANG_SAVE - AC_LANG_C - AC_TRY_RUN([ - main() { - return 8 != sizeof($type); - } - ],ctype_64bit=$type,ctype_64bit="unknown",ctype_64bit="long long") - AC_LANG_CPLUSPLUS - AC_TRY_RUN([ - int main(int argc, char ** argv) { - return 8 != sizeof($type); - } - ],cxxtype_64bit=$type,cxxtype_64bit="unknown",cxxtype_64bit="long long") - AC_LANG_RESTORE - if test "${ctype_64bit}" = "${type}" -a "${cxxtype_64bit}" = "${type}"; then - ecos_cv_type_64bit="${type}" - break - fi - done - ]) - if test "${ecos_cv_type_64bit}" = ""; then - AC_MSG_ERROR(Unable to figure out how to do 64 bit arithmetic) - else - if test "${ecos_cv_type_64bit}" != "long long"; then - AC_DEFINE_UNQUOTED(cyg_halint64,${ecos_cv_type_64bit}) - AC_DEFINE_UNQUOTED(cyg_halcount64,${ecos_cv_type_64bit}) - fi - fi -]) - -dnl ==================================================================== -dnl Check that both the C and C++ compilers support __PRETTY_FUNCTION__ - -AC_DEFUN(ECOS_C_PRETTY_FUNCTION,[ - AC_REQUIRE([AC_PROG_CC]) - AC_REQUIRE([AC_PROG_CXX]) - - AC_CACHE_CHECK("for __PRETTY_FUNCTION__ support",ecos_cv_c_pretty_function,[ - AC_LANG_SAVE - AC_LANG_C - AC_TRY_LINK( - [#include ], - [puts(__PRETTY_FUNCTION__);], - c_ok="yes", - c_ok="no" - ) - AC_LANG_CPLUSPLUS - AC_TRY_LINK( - [#include ], - [puts(__PRETTY_FUNCTION__);], - cxx_ok="yes", - cxx_ok="no" - ) - AC_LANG_RESTORE - if test "${c_ok}" = "yes" -a "${cxx_ok}" = "yes"; then - ecos_cv_c_pretty_function="yes" - fi - ]) - if test "${ecos_cv_c_pretty_function}" = "yes"; then - AC_DEFINE(CYGDBG_INFRA_DEBUG_FUNCTION_PSEUDOMACRO) - fi -]) - -dnl ==================================================================== -dnl During installation eCos package-specific host-side code should be -dnl versioned in the same way as the packages themselves, allowing -dnl different versions to coexist in one installation. This is analogous -dnl to having multiple versions of a shared library installed so that -dnl applications can load whichever one they were linked with. -dnl -dnl To support all this the host-side code needs access to a number -dnl of directory names: -dnl ECOS_REPOSITORY e.g. ~/ecc/ecc -dnl PACKAGE_DIR e.g. hal/synth/arch -dnl PACKAGE_VERSION e.g. current -dnl PACKAGE_INSTALL e.g. hal/synth/arch/current -dnl -dnl These, together with the standard variable libexecdir, allow -dnl the host-side code to navigate around both source and install -dnl trees. - -AC_DEFUN(ECOS_PACKAGE_DIRS,[ - - dnl srcdir will be something like /packages///host - package_dir=`cd ${srcdir} && /bin/pwd` - PACKAGE_VERSION=`dirname ${package_dir}` - PACKAGE_VERSION=`basename ${PACKAGE_VERSION}` - - dnl Now look for an "acsupport" directory as a good way of identifying - dnl the root of the repository. Assume that this does not clash with - dnl any real packages in the repository. Also assume that no silly games - dnl are being played with symlinks. - package_dir=`dirname ${package_dir}` - package_dir=`dirname ${package_dir}` - - possibles="${package_dir}/.. ${package_dir}/../.. ${package_dir}/../../.. ${package_dir}/../../../.." - possibles="${possibles} ${package_dir}/../../../../.. ${package_dir}/../../../../../.." - AC_FIND_DIR("acsupport", ${possibles}, repository_root) - if test "${repository_root}" = "" ; then - AC_MSG_ERROR([Failed to identify this package's position within the eCos repository]) - fi - dnl repository_root will still contain the ..'s, instead of an absolute path - ECOS_REPOSITORY=`cd "${repository_root}/packages/pkgconf/.." && /bin/pwd` - - dnl Now we have two absolute paths, so just remove one from the other - PACKAGE_DIR=`echo ${package_dir} | sed -e "s:${ECOS_REPOSITORY}/::"` - - dnl To avoid creating too many subdirectories on the host-side, turn - dnl e.g. hal/synth/arch into hal_synth_arch. Theoretically this could - dnl go wrong because multiple packages could map onto the same string, - dnl but in practice there should be a net reduction in complexity. - dnl bartv: / to _ conversion disabled for now, 5 March 2002 - PACKAGE_INSTALL="${PACKAGE_DIR}/${PACKAGE_VERSION}" - dnl PACKAGE_INSTALL=`echo ${PACKAGE_INSTALL} | sed -e "s:/:_:g"` - - AC_SUBST(ECOS_REPOSITORY) - AC_SUBST(PACKAGE_DIR) - AC_SUBST(PACKAGE_VERSION) - AC_SUBST(PACKAGE_INSTALL) -]) diff --git a/acsupport/config.guess b/acsupport/config.guess deleted file mode 100644 --- a/acsupport/config.guess +++ /dev/null @@ -1,1171 +0,0 @@ -#! /bin/sh -# Attempt to guess a canonical system name. -# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000 -# Free Software Foundation, Inc. -# -# This file is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -# -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - -# Written by Per Bothner . -# Please send patches to . -# -# This script attempts to guess a canonical system name similar to -# config.sub. If it succeeds, it prints the system name on stdout, and -# exits with 0. Otherwise, it exits with 1. -# -# The plan is that this can be called by configure scripts if you -# don't specify an explicit system type (host/target name). -# -# Only a few systems have been added to this list; please add others -# (but try to keep the structure clean). -# - -# Use $HOST_CC if defined. $CC may point to a cross-compiler -if test x"$CC_FOR_BUILD" = x; then - if test x"$HOST_CC" != x; then - CC_FOR_BUILD="$HOST_CC" - else - if test x"$CC" != x; then - CC_FOR_BUILD="$CC" - else - CC_FOR_BUILD=cc - fi - fi -fi - - -# This is needed to find uname on a Pyramid OSx when run in the BSD universe. -# (ghazi@noc.rutgers.edu 8/24/94.) -if (test -f /.attbin/uname) >/dev/null 2>&1 ; then - PATH=$PATH:/.attbin ; export PATH -fi - -UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown -UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown -UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown -UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown - -dummy=dummy-$$ -trap 'rm -f $dummy.c $dummy.o $dummy; exit 1' 1 2 15 - -# Note: order is significant - the case branches are not exclusive. - -case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in - *:NetBSD:*:*) - # Netbsd (nbsd) targets should (where applicable) match one or - # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, - # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently - # switched to ELF, *-*-netbsd* would select the old - # object file format. This provides both forward - # compatibility and a consistent mechanism for selecting the - # object file format. - # Determine the machine/vendor (is the vendor relevant). - case "${UNAME_MACHINE}" in - amiga) machine=m68k-cbm ;; - arm32) machine=arm-unknown ;; - atari*) machine=m68k-atari ;; - sun3*) machine=m68k-sun ;; - mac68k) machine=m68k-apple ;; - macppc) machine=powerpc-apple ;; - hp3[0-9][05]) machine=m68k-hp ;; - ibmrt|romp-ibm) machine=romp-ibm ;; - *) machine=${UNAME_MACHINE}-unknown ;; - esac - # The Operating System including object format. - if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ - | grep __ELF__ >/dev/null - then - # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). - # Return netbsd for either. FIX? - os=netbsd - else - os=netbsdelf - fi - # The OS release - release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` - # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: - # contains redundant information, the shorter form: - # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. - echo "${machine}-${os}${release}" - exit 0 ;; - alpha:OSF1:*:*) - if test $UNAME_RELEASE = "V4.0"; then - UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` - fi - # A Vn.n version is a released version. - # A Tn.n version is a released field test version. - # A Xn.n version is an unreleased experimental baselevel. - # 1.2 uses "1.2" for uname -r. - cat <$dummy.s - .data -\$Lformat: - .byte 37,100,45,37,120,10,0 # "%d-%x\n" - - .text - .globl main - .align 4 - .ent main -main: - .frame \$30,16,\$26,0 - ldgp \$29,0(\$27) - .prologue 1 - .long 0x47e03d80 # implver \$0 - lda \$2,-1 - .long 0x47e20c21 # amask \$2,\$1 - lda \$16,\$Lformat - mov \$0,\$17 - not \$1,\$18 - jsr \$26,printf - ldgp \$29,0(\$26) - mov 0,\$16 - jsr \$26,exit - .end main -EOF - $CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null - if test "$?" = 0 ; then - case `./$dummy` in - 0-0) - UNAME_MACHINE="alpha" - ;; - 1-0) - UNAME_MACHINE="alphaev5" - ;; - 1-1) - UNAME_MACHINE="alphaev56" - ;; - 1-101) - UNAME_MACHINE="alphapca56" - ;; - 2-303) - UNAME_MACHINE="alphaev6" - ;; - 2-307) - UNAME_MACHINE="alphaev67" - ;; - esac - fi - rm -f $dummy.s $dummy - echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - exit 0 ;; - Alpha\ *:Windows_NT*:*) - # How do we know it's Interix rather than the generic POSIX subsystem? - # Should we change UNAME_MACHINE based on the output of uname instead - # of the specific Alpha model? - echo alpha-pc-interix - exit 0 ;; - 21064:Windows_NT:50:3) - echo alpha-dec-winnt3.5 - exit 0 ;; - Amiga*:UNIX_System_V:4.0:*) - echo m68k-cbm-sysv4 - exit 0;; - amiga:OpenBSD:*:*) - echo m68k-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - *:[Aa]miga[Oo][Ss]:*:*) - echo ${UNAME_MACHINE}-unknown-amigaos - exit 0 ;; - arc64:OpenBSD:*:*) - echo mips64el-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - arc:OpenBSD:*:*) - echo mipsel-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - hkmips:OpenBSD:*:*) - echo mips-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - pmax:OpenBSD:*:*) - echo mipsel-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - sgi:OpenBSD:*:*) - echo mips-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - wgrisc:OpenBSD:*:*) - echo mipsel-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - *:OS/390:*:*) - echo i370-ibm-openedition - exit 0 ;; - arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) - echo arm-acorn-riscix${UNAME_RELEASE} - exit 0;; - SR2?01:HI-UX/MPP:*:*) - echo hppa1.1-hitachi-hiuxmpp - exit 0;; - Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) - # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. - if test "`(/bin/universe) 2>/dev/null`" = att ; then - echo pyramid-pyramid-sysv3 - else - echo pyramid-pyramid-bsd - fi - exit 0 ;; - NILE*:*:*:dcosx) - echo pyramid-pyramid-svr4 - exit 0 ;; - sun4H:SunOS:5.*:*) - echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit 0 ;; - sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) - echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit 0 ;; - i86pc:SunOS:5.*:*) - echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit 0 ;; - sun4*:SunOS:6*:*) - # According to config.sub, this is the proper way to canonicalize - # SunOS6. Hard to guess exactly what SunOS6 will be like, but - # it's likely to be more like Solaris than SunOS4. - echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit 0 ;; - sun4*:SunOS:*:*) - case "`/usr/bin/arch -k`" in - Series*|S4*) - UNAME_RELEASE=`uname -v` - ;; - esac - # Japanese Language versions have a version number like `4.1.3-JL'. - echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` - exit 0 ;; - sun3*:SunOS:*:*) - echo m68k-sun-sunos${UNAME_RELEASE} - exit 0 ;; - sun*:*:4.2BSD:*) - UNAME_RELEASE=`(head -1 /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` - test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 - case "`/bin/arch`" in - sun3) - echo m68k-sun-sunos${UNAME_RELEASE} - ;; - sun4) - echo sparc-sun-sunos${UNAME_RELEASE} - ;; - esac - exit 0 ;; - aushp:SunOS:*:*) - echo sparc-auspex-sunos${UNAME_RELEASE} - exit 0 ;; - atari*:OpenBSD:*:*) - echo m68k-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - # The situation for MiNT is a little confusing. The machine name - # can be virtually everything (everything which is not - # "atarist" or "atariste" at least should have a processor - # > m68000). The system name ranges from "MiNT" over "FreeMiNT" - # to the lowercase version "mint" (or "freemint"). Finally - # the system name "TOS" denotes a system which is actually not - # MiNT. But MiNT is downward compatible to TOS, so this should - # be no problem. - atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} - exit 0 ;; - atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} - exit 0 ;; - *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} - exit 0 ;; - milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) - echo m68k-milan-mint${UNAME_RELEASE} - exit 0 ;; - hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) - echo m68k-hades-mint${UNAME_RELEASE} - exit 0 ;; - *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) - echo m68k-unknown-mint${UNAME_RELEASE} - exit 0 ;; - sun3*:OpenBSD:*:*) - echo m68k-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - mac68k:OpenBSD:*:*) - echo m68k-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - mvme68k:OpenBSD:*:*) - echo m68k-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - mvme88k:OpenBSD:*:*) - echo m88k-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - powerpc:machten:*:*) - echo powerpc-apple-machten${UNAME_RELEASE} - exit 0 ;; - RISC*:Mach:*:*) - echo mips-dec-mach_bsd4.3 - exit 0 ;; - RISC*:ULTRIX:*:*) - echo mips-dec-ultrix${UNAME_RELEASE} - exit 0 ;; - VAX*:ULTRIX*:*:*) - echo vax-dec-ultrix${UNAME_RELEASE} - exit 0 ;; - 2020:CLIX:*:* | 2430:CLIX:*:*) - echo clipper-intergraph-clix${UNAME_RELEASE} - exit 0 ;; - mips:*:*:UMIPS | mips:*:*:RISCos) - sed 's/^ //' << EOF >$dummy.c -#ifdef __cplusplus -#include /* for printf() prototype */ - int main (int argc, char *argv[]) { -#else - int main (argc, argv) int argc; char *argv[]; { -#endif - #if defined (host_mips) && defined (MIPSEB) - #if defined (SYSTYPE_SYSV) - printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); - #endif - #if defined (SYSTYPE_SVR4) - printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); - #endif - #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) - printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); - #endif - #endif - exit (-1); - } -EOF - $CC_FOR_BUILD $dummy.c -o $dummy \ - && ./$dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \ - && rm $dummy.c $dummy && exit 0 - rm -f $dummy.c $dummy - echo mips-mips-riscos${UNAME_RELEASE} - exit 0 ;; - Night_Hawk:Power_UNIX:*:*) - echo powerpc-harris-powerunix - exit 0 ;; - m88k:CX/UX:7*:*) - echo m88k-harris-cxux7 - exit 0 ;; - m88k:*:4*:R4*) - echo m88k-motorola-sysv4 - exit 0 ;; - m88k:*:3*:R3*) - echo m88k-motorola-sysv3 - exit 0 ;; - AViiON:dgux:*:*) - # DG/UX returns AViiON for all architectures - UNAME_PROCESSOR=`/usr/bin/uname -p` - if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110] - then - if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ - [ ${TARGET_BINARY_INTERFACE}x = x ] - then - echo m88k-dg-dgux${UNAME_RELEASE} - else - echo m88k-dg-dguxbcs${UNAME_RELEASE} - fi - else - echo i586-dg-dgux${UNAME_RELEASE} - fi - exit 0 ;; - M88*:DolphinOS:*:*) # DolphinOS (SVR3) - echo m88k-dolphin-sysv3 - exit 0 ;; - M88*:*:R3*:*) - # Delta 88k system running SVR3 - echo m88k-motorola-sysv3 - exit 0 ;; - XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) - echo m88k-tektronix-sysv3 - exit 0 ;; - Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) - echo m68k-tektronix-bsd - exit 0 ;; - *:IRIX*:*:*) - echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` - exit 0 ;; - ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. - echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id - exit 0 ;; # Note that: echo "'`uname -s`'" gives 'AIX ' - i?86:AIX:*:*) - echo i386-ibm-aix - exit 0 ;; - *:AIX:2:3) - if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then - sed 's/^ //' << EOF >$dummy.c - #include - - main() - { - if (!__power_pc()) - exit(1); - puts("powerpc-ibm-aix3.2.5"); - exit(0); - } -EOF - $CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm $dummy.c $dummy && exit 0 - rm -f $dummy.c $dummy - echo rs6000-ibm-aix3.2.5 - elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then - echo rs6000-ibm-aix3.2.4 - else - echo rs6000-ibm-aix3.2 - fi - exit 0 ;; - *:AIX:*:4) - IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | head -1 | awk '{ print $1 }'` - if /usr/sbin/lsattr -EHl ${IBM_CPU_ID} | grep POWER >/dev/null 2>&1; then - IBM_ARCH=rs6000 - else - IBM_ARCH=powerpc - fi - if [ -x /usr/bin/oslevel ] ; then - IBM_REV=`/usr/bin/oslevel` - else - IBM_REV=4.${UNAME_RELEASE} - fi - echo ${IBM_ARCH}-ibm-aix${IBM_REV} - exit 0 ;; - *:AIX:*:*) - echo rs6000-ibm-aix - exit 0 ;; - ibmrt:4.4BSD:*|romp-ibm:BSD:*) - echo romp-ibm-bsd4.4 - exit 0 ;; - ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and - echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to - exit 0 ;; # report: romp-ibm BSD 4.3 - *:BOSX:*:*) - echo rs6000-bull-bosx - exit 0 ;; - DPX/2?00:B.O.S.:*:*) - echo m68k-bull-sysv3 - exit 0 ;; - 9000/[34]??:4.3bsd:1.*:*) - echo m68k-hp-bsd - exit 0 ;; - hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) - echo m68k-hp-bsd4.4 - exit 0 ;; - 9000/[34678]??:HP-UX:*:*) - case "${UNAME_MACHINE}" in - 9000/31? ) HP_ARCH=m68000 ;; - 9000/[34]?? ) HP_ARCH=m68k ;; - 9000/[678][0-9][0-9]) - sed 's/^ //' << EOF >$dummy.c - #include - #include - - int main () - { - #if defined(_SC_KERNEL_BITS) - long bits = sysconf(_SC_KERNEL_BITS); - #endif - long cpu = sysconf (_SC_CPU_VERSION); - - switch (cpu) - { - case CPU_PA_RISC1_0: puts ("hppa1.0"); break; - case CPU_PA_RISC1_1: puts ("hppa1.1"); break; - case CPU_PA_RISC2_0: - #if defined(_SC_KERNEL_BITS) - switch (bits) - { - case 64: puts ("hppa2.0w"); break; - case 32: puts ("hppa2.0n"); break; - default: puts ("hppa2.0"); break; - } break; - #else /* !defined(_SC_KERNEL_BITS) */ - puts ("hppa2.0"); break; - #endif - default: puts ("hppa1.0"); break; - } - exit (0); - } -EOF - (CCOPTS= $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null ) && HP_ARCH=`./$dummy` - rm -f $dummy.c $dummy - esac - HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` - echo ${HP_ARCH}-hp-hpux${HPUX_REV} - exit 0 ;; - 3050*:HI-UX:*:*) - sed 's/^ //' << EOF >$dummy.c - #include - int - main () - { - long cpu = sysconf (_SC_CPU_VERSION); - /* The order matters, because CPU_IS_HP_MC68K erroneously returns - true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct - results, however. */ - if (CPU_IS_PA_RISC (cpu)) - { - switch (cpu) - { - case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; - case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; - case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; - default: puts ("hppa-hitachi-hiuxwe2"); break; - } - } - else if (CPU_IS_HP_MC68K (cpu)) - puts ("m68k-hitachi-hiuxwe2"); - else puts ("unknown-hitachi-hiuxwe2"); - exit (0); - } -EOF - $CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm $dummy.c $dummy && exit 0 - rm -f $dummy.c $dummy - echo unknown-hitachi-hiuxwe2 - exit 0 ;; - 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) - echo hppa1.1-hp-bsd - exit 0 ;; - 9000/8??:4.3bsd:*:*) - echo hppa1.0-hp-bsd - exit 0 ;; - *9??*:MPE/iX:*:*) - echo hppa1.0-hp-mpeix - exit 0 ;; - hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) - echo hppa1.1-hp-osf - exit 0 ;; - hp8??:OSF1:*:*) - echo hppa1.0-hp-osf - exit 0 ;; - i?86:OSF1:*:*) - if [ -x /usr/sbin/sysversion ] ; then - echo ${UNAME_MACHINE}-unknown-osf1mk - else - echo ${UNAME_MACHINE}-unknown-osf1 - fi - exit 0 ;; - parisc*:Lites*:*:*) - echo hppa1.1-hp-lites - exit 0 ;; - hppa*:OpenBSD:*:*) - echo hppa-unknown-openbsd - exit 0 ;; - C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) - echo c1-convex-bsd - exit 0 ;; - C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) - if getsysinfo -f scalar_acc - then echo c32-convex-bsd - else echo c2-convex-bsd - fi - exit 0 ;; - C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) - echo c34-convex-bsd - exit 0 ;; - C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) - echo c38-convex-bsd - exit 0 ;; - C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) - echo c4-convex-bsd - exit 0 ;; - CRAY*X-MP:*:*:*) - echo xmp-cray-unicos - exit 0 ;; - CRAY*Y-MP:*:*:*) - echo ymp-cray-unicos${UNAME_RELEASE} - exit 0 ;; - CRAY*[A-Z]90:*:*:*) - echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ - | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ - -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ - exit 0 ;; - CRAY*TS:*:*:*) - echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit 0 ;; - CRAY*T3E:*:*:*) - echo alpha-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit 0 ;; - CRAY*SV1:*:*:*) - echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit 0 ;; - CRAY-2:*:*:*) - echo cray2-cray-unicos - exit 0 ;; - F300:UNIX_System_V:*:*) - FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` - FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` - echo "f300-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" - exit 0 ;; - F301:UNIX_System_V:*:*) - echo f301-fujitsu-uxpv`echo $UNAME_RELEASE | sed 's/ .*//'` - exit 0 ;; - hp300:OpenBSD:*:*) - echo m68k-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - i?86:BSD/386:*:* | i?86:BSD/OS:*:*) - echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} - exit 0 ;; - sparc*:BSD/OS:*:*) - echo sparc-unknown-bsdi${UNAME_RELEASE} - exit 0 ;; - *:BSD/OS:*:*) - echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} - exit 0 ;; - *:FreeBSD:*:*) - if test -x /usr/bin/objformat; then - if test "elf" = "`/usr/bin/objformat`"; then - echo ${UNAME_MACHINE}-unknown-freebsdelf`echo ${UNAME_RELEASE}|sed -e 's/[-_].*//'` - exit 0 - fi - fi - echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` - exit 0 ;; - *:OpenBSD:*:*) - echo ${UNAME_MACHINE}-unknown-openbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` - exit 0 ;; - i*:CYGWIN*:*) - echo ${UNAME_MACHINE}-pc-cygwin - exit 0 ;; - i*:MINGW*:*) - echo ${UNAME_MACHINE}-pc-mingw32 - exit 0 ;; - i*:Windows_NT*:* | Pentium*:Windows_NT*:*) - # How do we know it's Interix rather than the generic POSIX subsystem? - # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we - # UNAME_MACHINE based on the output of uname instead of i386? - echo i386-pc-interix - exit 0 ;; - i*:UWIN*:*) - echo ${UNAME_MACHINE}-pc-uwin - exit 0 ;; - p*:CYGWIN*:*) - echo powerpcle-unknown-cygwin - exit 0 ;; - prep*:SunOS:5.*:*) - echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit 0 ;; - *:GNU:*:*) - echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` - exit 0 ;; - *:Linux:*:*) - - # The BFD linker knows what the default object file format is, so - # first see if it will tell us. cd to the root directory to prevent - # problems with other programs or directories called `ld' in the path. - ld_help_string=`cd /; ld --help 2>&1` - ld_supported_emulations=`echo $ld_help_string \ - | sed -ne '/supported emulations:/!d - s/[ ][ ]*/ /g - s/.*supported emulations: *// - s/ .*// - p'` - case "$ld_supported_emulations" in - *ia64) - echo "${UNAME_MACHINE}-unknown-linux" - exit 0 - ;; - i?86linux) - echo "${UNAME_MACHINE}-pc-linux-gnuaout" - exit 0 - ;; - i?86coff) - echo "${UNAME_MACHINE}-pc-linux-gnucoff" - exit 0 - ;; - sparclinux) - echo "${UNAME_MACHINE}-unknown-linux-gnuaout" - exit 0 - ;; - armlinux) - echo "${UNAME_MACHINE}-unknown-linux-gnuaout" - exit 0 - ;; - elf32arm*) - echo "${UNAME_MACHINE}-unknown-linux-gnuoldld" - exit 0 - ;; - armelf_linux*) - echo "${UNAME_MACHINE}-unknown-linux-gnu" - exit 0 - ;; - m68klinux) - echo "${UNAME_MACHINE}-unknown-linux-gnuaout" - exit 0 - ;; - elf32ppc | elf32ppclinux) - # Determine Lib Version - cat >$dummy.c < -#if defined(__GLIBC__) -extern char __libc_version[]; -extern char __libc_release[]; -#endif -main(argc, argv) - int argc; - char *argv[]; -{ -#if defined(__GLIBC__) - printf("%s %s\n", __libc_version, __libc_release); -#else - printf("unkown\n"); -#endif - return 0; -} -EOF - LIBC="" - $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null - if test "$?" = 0 ; then - ./$dummy | grep 1\.99 > /dev/null - if test "$?" = 0 ; then - LIBC="libc1" - fi - fi - rm -f $dummy.c $dummy - echo powerpc-unknown-linux-gnu${LIBC} - exit 0 - ;; - esac - - if test "${UNAME_MACHINE}" = "alpha" ; then - cat <$dummy.s - .data - \$Lformat: - .byte 37,100,45,37,120,10,0 # "%d-%x\n" - - .text - .globl main - .align 4 - .ent main - main: - .frame \$30,16,\$26,0 - ldgp \$29,0(\$27) - .prologue 1 - .long 0x47e03d80 # implver \$0 - lda \$2,-1 - .long 0x47e20c21 # amask \$2,\$1 - lda \$16,\$Lformat - mov \$0,\$17 - not \$1,\$18 - jsr \$26,printf - ldgp \$29,0(\$26) - mov 0,\$16 - jsr \$26,exit - .end main -EOF - LIBC="" - $CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null - if test "$?" = 0 ; then - case `./$dummy` in - 0-0) - UNAME_MACHINE="alpha" - ;; - 1-0) - UNAME_MACHINE="alphaev5" - ;; - 1-1) - UNAME_MACHINE="alphaev56" - ;; - 1-101) - UNAME_MACHINE="alphapca56" - ;; - 2-303) - UNAME_MACHINE="alphaev6" - ;; - 2-307) - UNAME_MACHINE="alphaev67" - ;; - esac - - objdump --private-headers $dummy | \ - grep ld.so.1 > /dev/null - if test "$?" = 0 ; then - LIBC="libc1" - fi - fi - rm -f $dummy.s $dummy - echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} ; exit 0 - elif test "${UNAME_MACHINE}" = "mips" ; then - cat >$dummy.c < /* for printf() prototype */ - int main (int argc, char *argv[]) { -#else - int main (argc, argv) int argc; char *argv[]; { -#endif -#ifdef __MIPSEB__ - printf ("%s-unknown-linux-gnu\n", argv[1]); -#endif -#ifdef __MIPSEL__ - printf ("%sel-unknown-linux-gnu\n", argv[1]); -#endif - return 0; -} -EOF - $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy "${UNAME_MACHINE}" && rm $dummy.c $dummy && exit 0 - rm -f $dummy.c $dummy - elif test "${UNAME_MACHINE}" = "s390"; then - echo s390-ibm-linux && exit 0 - else - # Either a pre-BFD a.out linker (linux-gnuoldld) - # or one that does not give us useful --help. - # GCC wants to distinguish between linux-gnuoldld and linux-gnuaout. - # If ld does not provide *any* "supported emulations:" - # that means it is gnuoldld. - echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations:" - test $? != 0 && echo "${UNAME_MACHINE}-pc-linux-gnuoldld" && exit 0 - - case "${UNAME_MACHINE}" in - i?86) - VENDOR=pc; - ;; - *) - VENDOR=unknown; - ;; - esac - # Determine whether the default compiler is a.out or elf - cat >$dummy.c < -#ifdef __cplusplus -#include /* for printf() prototype */ - int main (int argc, char *argv[]) { -#else - int main (argc, argv) int argc; char *argv[]; { -#endif -#ifdef __ELF__ -# ifdef __GLIBC__ -# if __GLIBC__ >= 2 - printf ("%s-${VENDOR}-linux-gnu\n", argv[1]); -# else - printf ("%s-${VENDOR}-linux-gnulibc1\n", argv[1]); -# endif -# else - printf ("%s-${VENDOR}-linux-gnulibc1\n", argv[1]); -# endif -#else - printf ("%s-${VENDOR}-linux-gnuaout\n", argv[1]); -#endif - return 0; -} -EOF - $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy "${UNAME_MACHINE}" && rm $dummy.c $dummy && exit 0 - rm -f $dummy.c $dummy - fi ;; -# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. earlier versions -# are messed up and put the nodename in both sysname and nodename. - i?86:DYNIX/ptx:4*:*) - echo i386-sequent-sysv4 - exit 0 ;; - i?86:UNIX_SV:4.2MP:2.*) - # Unixware is an offshoot of SVR4, but it has its own version - # number series starting with 2... - # I am not positive that other SVR4 systems won't match this, - # I just have to hope. -- rms. - # Use sysv4.2uw... so that sysv4* matches it. - echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} - exit 0 ;; - i?86:*:4.*:* | i?86:SYSTEM_V:4.*:*) - UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` - if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then - echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} - else - echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} - fi - exit 0 ;; - i?86:*:5:7*) - # Fixed at (any) Pentium or better - UNAME_MACHINE=i586 - if [ ${UNAME_SYSTEM} = "UnixWare" ] ; then - echo ${UNAME_MACHINE}-sco-sysv${UNAME_RELEASE}uw${UNAME_VERSION} - else - echo ${UNAME_MACHINE}-pc-sysv${UNAME_RELEASE} - fi - exit 0 ;; - i?86:*:3.2:*) - if test -f /usr/options/cb.name; then - UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then - UNAME_REL=`(/bin/uname -X|egrep Release|sed -e 's/.*= //')` - (/bin/uname -X|egrep i80486 >/dev/null) && UNAME_MACHINE=i486 - (/bin/uname -X|egrep '^Machine.*Pentium' >/dev/null) \ - && UNAME_MACHINE=i586 - (/bin/uname -X|egrep '^Machine.*Pent ?II' >/dev/null) \ - && UNAME_MACHINE=i686 - (/bin/uname -X|egrep '^Machine.*Pentium Pro' >/dev/null) \ - && UNAME_MACHINE=i686 - echo ${UNAME_MACHINE}-pc-sco$UNAME_REL - else - echo ${UNAME_MACHINE}-pc-sysv32 - fi - exit 0 ;; - i?86:*DOS:*:*) - echo ${UNAME_MACHINE}-pc-msdosdjgpp - exit 0 ;; - pc:*:*:*) - # Left here for compatibility: - # uname -m prints for DJGPP always 'pc', but it prints nothing about - # the processor, so we play safe by assuming i386. - echo i386-pc-msdosdjgpp - exit 0 ;; - Intel:Mach:3*:*) - echo i386-pc-mach3 - exit 0 ;; - paragon:*:*:*) - echo i860-intel-osf1 - exit 0 ;; - i860:*:4.*:*) # i860-SVR4 - if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then - echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 - else # Add other i860-SVR4 vendors below as they are discovered. - echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 - fi - exit 0 ;; - mini*:CTIX:SYS*5:*) - # "miniframe" - echo m68010-convergent-sysv - exit 0 ;; - M68*:*:R3V[567]*:*) - test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;; - 3[34]??:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 4850:*:4.0:3.0) - OS_REL='' - test -r /etc/.relid \ - && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` - /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ - && echo i486-ncr-sysv4.3${OS_REL} && exit 0 - /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ - && echo i586-ncr-sysv4.3${OS_REL} && exit 0 ;; - 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) - /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ - && echo i486-ncr-sysv4 && exit 0 ;; - m68*:LynxOS:2.*:*) - echo m68k-unknown-lynxos${UNAME_RELEASE} - exit 0 ;; - mc68030:UNIX_System_V:4.*:*) - echo m68k-atari-sysv4 - exit 0 ;; - i?86:LynxOS:2.*:* | i?86:LynxOS:3.[01]*:*) - echo i386-unknown-lynxos${UNAME_RELEASE} - exit 0 ;; - TSUNAMI:LynxOS:2.*:*) - echo sparc-unknown-lynxos${UNAME_RELEASE} - exit 0 ;; - rs6000:LynxOS:2.*:* | PowerPC:LynxOS:2.*:*) - echo rs6000-unknown-lynxos${UNAME_RELEASE} - exit 0 ;; - SM[BE]S:UNIX_SV:*:*) - echo mips-dde-sysv${UNAME_RELEASE} - exit 0 ;; - RM*:ReliantUNIX-*:*:*) - echo mips-sni-sysv4 - exit 0 ;; - RM*:SINIX-*:*:*) - echo mips-sni-sysv4 - exit 0 ;; - *:SINIX-*:*:*) - if uname -p 2>/dev/null >/dev/null ; then - UNAME_MACHINE=`(uname -p) 2>/dev/null` - echo ${UNAME_MACHINE}-sni-sysv4 - else - echo ns32k-sni-sysv - fi - exit 0 ;; - PENTIUM:CPunix:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort - # says - echo i586-unisys-sysv4 - exit 0 ;; - *:UNIX_System_V:4*:FTX*) - # From Gerald Hewes . - # How about differentiating between stratus architectures? -djm - echo hppa1.1-stratus-sysv4 - exit 0 ;; - *:*:*:FTX*) - # From seanf@swdc.stratus.com. - echo i860-stratus-sysv4 - exit 0 ;; - mc68*:A/UX:*:*) - echo m68k-apple-aux${UNAME_RELEASE} - exit 0 ;; - news*:NEWS-OS:*:6*) - echo mips-sony-newsos6 - exit 0 ;; - R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) - if [ -d /usr/nec ]; then - echo mips-nec-sysv${UNAME_RELEASE} - else - echo mips-unknown-sysv${UNAME_RELEASE} - fi - exit 0 ;; - BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. - echo powerpc-be-beos - exit 0 ;; - BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. - echo powerpc-apple-beos - exit 0 ;; - BePC:BeOS:*:*) # BeOS running on Intel PC compatible. - echo i586-pc-beos - exit 0 ;; - SX-4:SUPER-UX:*:*) - echo sx4-nec-superux${UNAME_RELEASE} - exit 0 ;; - SX-5:SUPER-UX:*:*) - echo sx5-nec-superux${UNAME_RELEASE} - exit 0 ;; - Power*:Rhapsody:*:*) - echo powerpc-apple-rhapsody${UNAME_RELEASE} - exit 0 ;; - *:Rhapsody:*:*) - echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} - exit 0 ;; - Power*:Mac*OS:*:*) - echo powerpc-apple-macos${UNAME_RELEASE} - exit 0 ;; - *:Mac*OS:*:*) - echo ${UNAME_MACHINE}-apple-macos${UNAME_RELEASE} - exit 0 ;; - *:QNX:*:4*) - echo i386-qnx-qnx${UNAME_VERSION} - exit 0 ;; -esac - -#echo '(No uname command or uname output not recognized.)' 1>&2 -#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 - -cat >$dummy.c < -# include -#endif -main () -{ -#if defined (sony) -#if defined (MIPSEB) - /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, - I don't know.... */ - printf ("mips-sony-bsd\n"); exit (0); -#else -#include - printf ("m68k-sony-newsos%s\n", -#ifdef NEWSOS4 - "4" -#else - "" -#endif - ); exit (0); -#endif -#endif - -#if defined (__arm) && defined (__acorn) && defined (__unix) - printf ("arm-acorn-riscix"); exit (0); -#endif - -#if defined (hp300) && !defined (hpux) - printf ("m68k-hp-bsd\n"); exit (0); -#endif - -#if defined (NeXT) -#if !defined (__ARCHITECTURE__) -#define __ARCHITECTURE__ "m68k" -#endif - int version; - version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; - if (version < 4) - printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); - else - printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); - exit (0); -#endif - -#if defined (MULTIMAX) || defined (n16) -#if defined (UMAXV) - printf ("ns32k-encore-sysv\n"); exit (0); -#else -#if defined (CMU) - printf ("ns32k-encore-mach\n"); exit (0); -#else - printf ("ns32k-encore-bsd\n"); exit (0); -#endif -#endif -#endif - -#if defined (__386BSD__) - printf ("i386-pc-bsd\n"); exit (0); -#endif - -#if defined (sequent) -#if defined (i386) - printf ("i386-sequent-dynix\n"); exit (0); -#endif -#if defined (ns32000) - printf ("ns32k-sequent-dynix\n"); exit (0); -#endif -#endif - -#if defined (_SEQUENT_) - struct utsname un; - - uname(&un); - - if (strncmp(un.version, "V2", 2) == 0) { - printf ("i386-sequent-ptx2\n"); exit (0); - } - if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ - printf ("i386-sequent-ptx1\n"); exit (0); - } - printf ("i386-sequent-ptx\n"); exit (0); - -#endif - -#if defined (vax) -#if !defined (ultrix) - printf ("vax-dec-bsd\n"); exit (0); -#else - printf ("vax-dec-ultrix\n"); exit (0); -#endif -#endif - -#if defined (alliant) && defined (i860) - printf ("i860-alliant-bsd\n"); exit (0); -#endif - - exit (1); -} -EOF - -$CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy && rm $dummy.c $dummy && exit 0 -rm -f $dummy.c $dummy - -# Apollos put the system type in the environment. - -test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; } - -# Convex versions that predate uname can use getsysinfo(1) - -if [ -x /usr/convex/getsysinfo ] -then - case `getsysinfo -f cpu_type` in - c1*) - echo c1-convex-bsd - exit 0 ;; - c2*) - if getsysinfo -f scalar_acc - then echo c32-convex-bsd - else echo c2-convex-bsd - fi - exit 0 ;; - c34*) - echo c34-convex-bsd - exit 0 ;; - c38*) - echo c38-convex-bsd - exit 0 ;; - c4*) - echo c4-convex-bsd - exit 0 ;; - esac -fi - -#echo '(Unable to guess system type)' 1>&2 - -exit 1 diff --git a/acsupport/config.sub b/acsupport/config.sub deleted file mode 100644 --- a/acsupport/config.sub +++ /dev/null @@ -1,1250 +0,0 @@ -#! /bin/sh -# Configuration validation subroutine script, version 1.1. -# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000 -# Free Software Foundation, Inc. -# -# This file is (in principle) common to ALL GNU software. -# The presence of a machine in this file suggests that SOME GNU software -# can handle that machine. It does not imply ALL GNU software can. -# -# This file is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, -# Boston, MA 02111-1307, USA. - -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - -# Written by Per Bothner . -# Please send patches to . -# -# Configuration subroutine to validate and canonicalize a configuration type. -# Supply the specified configuration type as an argument. -# If it is invalid, we print an error message on stderr and exit with code 1. -# Otherwise, we print the canonical config type on stdout and succeed. - -# This file is supposed to be the same for all GNU packages -# and recognize all the CPU types, system types and aliases -# that are meaningful with *any* GNU software. -# Each package is responsible for reporting which valid configurations -# it does not support. The user should be able to distinguish -# a failure to support a valid configuration from a meaningless -# configuration. - -# The goal of this file is to map all the various variations of a given -# machine specification into a single specification in the form: -# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM -# or in some cases, the newer four-part form: -# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM -# It is wrong to echo any other type of specification. - -if [ x$1 = x ] -then - echo Configuration name missing. 1>&2 - echo "Usage: $0 CPU-MFR-OPSYS" 1>&2 - echo "or $0 ALIAS" 1>&2 - echo where ALIAS is a recognized configuration type. 1>&2 - exit 1 -fi - -# First pass through any local machine types. -case $1 in - *local*) - echo $1 - exit 0 - ;; - *) - ;; -esac - -# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). -# Here we must recognize all the valid KERNEL-OS combinations. -maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` -case $maybe_os in - linux-gnu*) - os=-$maybe_os - basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` - ;; - *) - basic_machine=`echo $1 | sed 's/-[^-]*$//'` - if [ $basic_machine != $1 ] - then os=`echo $1 | sed 's/.*-/-/'` - else os=; fi - ;; -esac - -### Let's recognize common machines as not being operating systems so -### that things like config.sub decstation-3100 work. We also -### recognize some manufacturers as not being operating systems, so we -### can provide default operating systems below. -case $os in - -sun*os*) - # Prevent following clause from handling this invalid input. - ;; - -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ - -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ - -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ - -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ - -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ - -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ - -apple) - os= - basic_machine=$1 - ;; - -sim | -cisco | -oki | -wec | -winbond) - os= - basic_machine=$1 - ;; - -scout) - ;; - -wrs) - os=-vxworks - basic_machine=$1 - ;; - -hiux*) - os=-hiuxwe2 - ;; - -sco5) - os=-sco3.2v5 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco4) - os=-sco3.2v4 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco3.2.[4-9]*) - os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco3.2v[4-9]*) - # Don't forget version if it is 3.2v4 or newer. - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco*) - os=-sco3.2v2 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -udk*) - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -isc) - os=-isc2.2 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -clix*) - basic_machine=clipper-intergraph - ;; - -isc*) - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -lynx*) - os=-lynxos - ;; - -ptx*) - basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` - ;; - -windowsnt*) - os=`echo $os | sed -e 's/windowsnt/winnt/'` - ;; - -psos*) - os=-psos - ;; - -mint | -mint[0-9]*) - basic_machine=m68k-atari - os=-mint - ;; -esac - -# Decode aliases for certain CPU-COMPANY combinations. -case $basic_machine in - # Recognize the basic CPU types without company name. - # Some are omitted here because they have special meanings below. - tahoe | i860 | ia64 | m32r | m68k | m68000 | m88k | ns32k | arc | arm \ - | arme[lb] | pyramid | mn10200 | mn10300 | tron | a29k \ - | 580 | i960 | h8300 \ - | hppa | hppa1.0 | hppa1.1 | hppa2.0 | hppa2.0w | hppa2.0n \ - | alpha | alphaev[4-8] | alphaev56 | alphapca5[67] \ - | alphaev6[78] \ - | we32k | ns16k | clipper | i370 | sh | powerpc | powerpcle \ - | 1750a | dsp16xx | pdp11 | mips16 | mips64 | mipsel | mips64el \ - | mips64orion | mips64orionel | mipstx39 | mipstx39el \ - | mips64vr4300 | mips64vr4300el | mips64vr4100 | mips64vr4100el \ - | mips64vr5000 | miprs64vr5000el | mcore \ - | sparc | sparclet | sparclite | sparc64 | sparcv9 | v850 | c4x \ - | thumb | d10v | fr30 | avr) - basic_machine=$basic_machine-unknown - ;; - m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | z8k | v70 | h8500 | w65 | pj | pjl) - ;; - - # We use `pc' rather than `unknown' - # because (1) that's what they normally are, and - # (2) the word "unknown" tends to confuse beginning users. - i[34567]86) - basic_machine=$basic_machine-pc - ;; - # Object if more than one company name word. - *-*-*) - echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 - exit 1 - ;; - # Recognize the basic CPU types with company name. - # FIXME: clean up the formatting here. - vax-* | tahoe-* | i[34567]86-* | i860-* | ia64-* | m32r-* | m68k-* | m68000-* \ - | m88k-* | sparc-* | ns32k-* | fx80-* | arc-* | arm-* | c[123]* \ - | mips-* | pyramid-* | tron-* | a29k-* | romp-* | rs6000-* \ - | power-* | none-* | 580-* | cray2-* | h8300-* | h8500-* | i960-* \ - | xmp-* | ymp-* \ - | hppa-* | hppa1.0-* | hppa1.1-* | hppa2.0-* | hppa2.0w-* | hppa2.0n-* \ - | alpha-* | alphaev[4-8]-* | alphaev56-* | alphapca5[67]-* \ - | alphaev6[78]-* \ - | we32k-* | cydra-* | ns16k-* | pn-* | np1-* | xps100-* \ - | clipper-* | orion-* \ - | sparclite-* | pdp11-* | sh-* | powerpc-* | powerpcle-* \ - | sparc64-* | sparcv9-* | sparc86x-* | mips16-* | mips64-* | mipsel-* \ - | mips64el-* | mips64orion-* | mips64orionel-* \ - | mips64vr4100-* | mips64vr4100el-* | mips64vr4300-* | mips64vr4300el-* \ - | mipstx39-* | mipstx39el-* | mcore-* \ - | f301-* | armv*-* | s390-* | sv1-* | t3e-* \ - | m88110-* | m680[01234]0-* | m683?2-* | m68360-* | z8k-* | d10v-* \ - | thumb-* | v850-* | d30v-* | tic30-* | c30-* | fr30-* ) - ;; - # Recognize the various machine names and aliases which stand - # for a CPU type and a company and sometimes even an OS. - 386bsd) - basic_machine=i386-unknown - os=-bsd - ;; - 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) - basic_machine=m68000-att - ;; - 3b*) - basic_machine=we32k-att - ;; - a29khif) - basic_machine=a29k-amd - os=-udi - ;; - adobe68k) - basic_machine=m68010-adobe - os=-scout - ;; - alliant | fx80) - basic_machine=fx80-alliant - ;; - altos | altos3068) - basic_machine=m68k-altos - ;; - am29k) - basic_machine=a29k-none - os=-bsd - ;; - amdahl) - basic_machine=580-amdahl - os=-sysv - ;; - amiga | amiga-*) - basic_machine=m68k-cbm - ;; - amigaos | amigados) - basic_machine=m68k-cbm - os=-amigaos - ;; - amigaunix | amix) - basic_machine=m68k-cbm - os=-sysv4 - ;; - apollo68) - basic_machine=m68k-apollo - os=-sysv - ;; - apollo68bsd) - basic_machine=m68k-apollo - os=-bsd - ;; - aux) - basic_machine=m68k-apple - os=-aux - ;; - balance) - basic_machine=ns32k-sequent - os=-dynix - ;; - convex-c1) - basic_machine=c1-convex - os=-bsd - ;; - convex-c2) - basic_machine=c2-convex - os=-bsd - ;; - convex-c32) - basic_machine=c32-convex - os=-bsd - ;; - convex-c34) - basic_machine=c34-convex - os=-bsd - ;; - convex-c38) - basic_machine=c38-convex - os=-bsd - ;; - cray | ymp) - basic_machine=ymp-cray - os=-unicos - ;; - cray2) - basic_machine=cray2-cray - os=-unicos - ;; - [ctj]90-cray) - basic_machine=c90-cray - os=-unicos - ;; - crds | unos) - basic_machine=m68k-crds - ;; - da30 | da30-*) - basic_machine=m68k-da30 - ;; - decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) - basic_machine=mips-dec - ;; - delta | 3300 | motorola-3300 | motorola-delta \ - | 3300-motorola | delta-motorola) - basic_machine=m68k-motorola - ;; - delta88) - basic_machine=m88k-motorola - os=-sysv3 - ;; - dpx20 | dpx20-*) - basic_machine=rs6000-bull - os=-bosx - ;; - dpx2* | dpx2*-bull) - basic_machine=m68k-bull - os=-sysv3 - ;; - ebmon29k) - basic_machine=a29k-amd - os=-ebmon - ;; - elxsi) - basic_machine=elxsi-elxsi - os=-bsd - ;; - encore | umax | mmax) - basic_machine=ns32k-encore - ;; - es1800 | OSE68k | ose68k | ose | OSE) - basic_machine=m68k-ericsson - os=-ose - ;; - fx2800) - basic_machine=i860-alliant - ;; - genix) - basic_machine=ns32k-ns - ;; - gmicro) - basic_machine=tron-gmicro - os=-sysv - ;; - h3050r* | hiux*) - basic_machine=hppa1.1-hitachi - os=-hiuxwe2 - ;; - h8300hms) - basic_machine=h8300-hitachi - os=-hms - ;; - h8300xray) - basic_machine=h8300-hitachi - os=-xray - ;; - h8500hms) - basic_machine=h8500-hitachi - os=-hms - ;; - harris) - basic_machine=m88k-harris - os=-sysv3 - ;; - hp300-*) - basic_machine=m68k-hp - ;; - hp300bsd) - basic_machine=m68k-hp - os=-bsd - ;; - hp300hpux) - basic_machine=m68k-hp - os=-hpux - ;; - hp3k9[0-9][0-9] | hp9[0-9][0-9]) - basic_machine=hppa1.0-hp - ;; - hp9k2[0-9][0-9] | hp9k31[0-9]) - basic_machine=m68000-hp - ;; - hp9k3[2-9][0-9]) - basic_machine=m68k-hp - ;; - hp9k6[0-9][0-9] | hp6[0-9][0-9]) - basic_machine=hppa1.0-hp - ;; - hp9k7[0-79][0-9] | hp7[0-79][0-9]) - basic_machine=hppa1.1-hp - ;; - hp9k78[0-9] | hp78[0-9]) - # FIXME: really hppa2.0-hp - basic_machine=hppa1.1-hp - ;; - hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) - # FIXME: really hppa2.0-hp - basic_machine=hppa1.1-hp - ;; - hp9k8[0-9][13679] | hp8[0-9][13679]) - basic_machine=hppa1.1-hp - ;; - hp9k8[0-9][0-9] | hp8[0-9][0-9]) - basic_machine=hppa1.0-hp - ;; - hppa-next) - os=-nextstep3 - ;; - hppaosf) - basic_machine=hppa1.1-hp - os=-osf - ;; - hppro) - basic_machine=hppa1.1-hp - os=-proelf - ;; - i370-ibm* | ibm*) - basic_machine=i370-ibm - ;; -# I'm not sure what "Sysv32" means. Should this be sysv3.2? - i[34567]86v32) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-sysv32 - ;; - i[34567]86v4*) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-sysv4 - ;; - i[34567]86v) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-sysv - ;; - i[34567]86sol2) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-solaris2 - ;; - i386mach) - basic_machine=i386-mach - os=-mach - ;; - i386-vsta | vsta) - basic_machine=i386-unknown - os=-vsta - ;; - i386-go32 | go32) - basic_machine=i386-unknown - os=-go32 - ;; - i386-mingw32 | mingw32) - basic_machine=i386-unknown - os=-mingw32 - ;; - i386-qnx | qnx) - basic_machine=i386-qnx - ;; - iris | iris4d) - basic_machine=mips-sgi - case $os in - -irix*) - ;; - *) - os=-irix4 - ;; - esac - ;; - isi68 | isi) - basic_machine=m68k-isi - os=-sysv - ;; - m88k-omron*) - basic_machine=m88k-omron - ;; - magnum | m3230) - basic_machine=mips-mips - os=-sysv - ;; - merlin) - basic_machine=ns32k-utek - os=-sysv - ;; - miniframe) - basic_machine=m68000-convergent - ;; - *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) - basic_machine=m68k-atari - os=-mint - ;; - mipsel*-linux*) - basic_machine=mipsel-unknown - os=-linux-gnu - ;; - mips*-linux*) - basic_machine=mips-unknown - os=-linux-gnu - ;; - mips3*-*) - basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` - ;; - mips3*) - basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown - ;; - mmix*) - basic_machine=mmix-knuth - os=-mmixware - ;; - monitor) - basic_machine=m68k-rom68k - os=-coff - ;; - msdos) - basic_machine=i386-unknown - os=-msdos - ;; - mvs) - basic_machine=i370-ibm - os=-mvs - ;; - ncr3000) - basic_machine=i486-ncr - os=-sysv4 - ;; - netbsd386) - basic_machine=i386-unknown - os=-netbsd - ;; - netwinder) - basic_machine=armv4l-rebel - os=-linux - ;; - news | news700 | news800 | news900) - basic_machine=m68k-sony - os=-newsos - ;; - news1000) - basic_machine=m68030-sony - os=-newsos - ;; - news-3600 | risc-news) - basic_machine=mips-sony - os=-newsos - ;; - necv70) - basic_machine=v70-nec - os=-sysv - ;; - next | m*-next ) - basic_machine=m68k-next - case $os in - -nextstep* ) - ;; - -ns2*) - os=-nextstep2 - ;; - *) - os=-nextstep3 - ;; - esac - ;; - nh3000) - basic_machine=m68k-harris - os=-cxux - ;; - nh[45]000) - basic_machine=m88k-harris - os=-cxux - ;; - nindy960) - basic_machine=i960-intel - os=-nindy - ;; - mon960) - basic_machine=i960-intel - os=-mon960 - ;; - np1) - basic_machine=np1-gould - ;; - op50n-* | op60c-*) - basic_machine=hppa1.1-oki - os=-proelf - ;; - OSE68000 | ose68000) - basic_machine=m68000-ericsson - os=-ose - ;; - os68k) - basic_machine=m68k-none - os=-os68k - ;; - pa-hitachi) - basic_machine=hppa1.1-hitachi - os=-hiuxwe2 - ;; - paragon) - basic_machine=i860-intel - os=-osf - ;; - pbd) - basic_machine=sparc-tti - ;; - pbb) - basic_machine=m68k-tti - ;; - pc532 | pc532-*) - basic_machine=ns32k-pc532 - ;; - pentium | p5 | k5 | k6 | nexen) - basic_machine=i586-pc - ;; - pentiumpro | p6 | 6x86) - basic_machine=i686-pc - ;; - pentiumii | pentium2) - basic_machine=i786-pc - ;; - pentium-* | p5-* | k5-* | k6-* | nexen-*) - basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - pentiumpro-* | p6-* | 6x86-*) - basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - pentiumii-* | pentium2-*) - basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - pn) - basic_machine=pn-gould - ;; - power) basic_machine=rs6000-ibm - ;; - ppc) basic_machine=powerpc-unknown - ;; - ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - ppcle | powerpclittle | ppc-le | powerpc-little) - basic_machine=powerpcle-unknown - ;; - ppcle-* | powerpclittle-*) - basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - ps2) - basic_machine=i386-ibm - ;; - rom68k) - basic_machine=m68k-rom68k - os=-coff - ;; - rm[46]00) - basic_machine=mips-siemens - ;; - rtpc | rtpc-*) - basic_machine=romp-ibm - ;; - sa29200) - basic_machine=a29k-amd - os=-udi - ;; - sequent) - basic_machine=i386-sequent - ;; - sh) - basic_machine=sh-hitachi - os=-hms - ;; - sparclite-wrs) - basic_machine=sparclite-wrs - os=-vxworks - ;; - sps7) - basic_machine=m68k-bull - os=-sysv2 - ;; - spur) - basic_machine=spur-unknown - ;; - st2000) - basic_machine=m68k-tandem - ;; - stratus) - basic_machine=i860-stratus - os=-sysv4 - ;; - sun2) - basic_machine=m68000-sun - ;; - sun2os3) - basic_machine=m68000-sun - os=-sunos3 - ;; - sun2os4) - basic_machine=m68000-sun - os=-sunos4 - ;; - sun3os3) - basic_machine=m68k-sun - os=-sunos3 - ;; - sun3os4) - basic_machine=m68k-sun - os=-sunos4 - ;; - sun4os3) - basic_machine=sparc-sun - os=-sunos3 - ;; - sun4os4) - basic_machine=sparc-sun - os=-sunos4 - ;; - sun4sol2) - basic_machine=sparc-sun - os=-solaris2 - ;; - sun3 | sun3-*) - basic_machine=m68k-sun - ;; - sun4) - basic_machine=sparc-sun - ;; - sun386 | sun386i | roadrunner) - basic_machine=i386-sun - ;; - sv1) - basic_machine=sv1-cray - os=-unicos - ;; - symmetry) - basic_machine=i386-sequent - os=-dynix - ;; - t3e) - basic_machine=t3e-cray - os=-unicos - ;; - tx39) - basic_machine=mipstx39-unknown - ;; - tx39el) - basic_machine=mipstx39el-unknown - ;; - tower | tower-32) - basic_machine=m68k-ncr - ;; - udi29k) - basic_machine=a29k-amd - os=-udi - ;; - ultra3) - basic_machine=a29k-nyu - os=-sym1 - ;; - v810 | necv810) - basic_machine=v810-nec - os=-none - ;; - vaxv) - basic_machine=vax-dec - os=-sysv - ;; - vms) - basic_machine=vax-dec - os=-vms - ;; - vpp*|vx|vx-*) - basic_machine=f301-fujitsu - ;; - vxworks960) - basic_machine=i960-wrs - os=-vxworks - ;; - vxworks68) - basic_machine=m68k-wrs - os=-vxworks - ;; - vxworks29k) - basic_machine=a29k-wrs - os=-vxworks - ;; - w65*) - basic_machine=w65-wdc - os=-none - ;; - w89k-*) - basic_machine=hppa1.1-winbond - os=-proelf - ;; - xmp) - basic_machine=xmp-cray - os=-unicos - ;; - xps | xps100) - basic_machine=xps100-honeywell - ;; - z8k-*-coff) - basic_machine=z8k-unknown - os=-sim - ;; - none) - basic_machine=none-none - os=-none - ;; - -# Here we handle the default manufacturer of certain CPU types. It is in -# some cases the only manufacturer, in others, it is the most popular. - w89k) - basic_machine=hppa1.1-winbond - ;; - op50n) - basic_machine=hppa1.1-oki - ;; - op60c) - basic_machine=hppa1.1-oki - ;; - mips) - if [ x$os = x-linux-gnu ]; then - basic_machine=mips-unknown - else - basic_machine=mips-mips - fi - ;; - romp) - basic_machine=romp-ibm - ;; - rs6000) - basic_machine=rs6000-ibm - ;; - vax) - basic_machine=vax-dec - ;; - pdp11) - basic_machine=pdp11-dec - ;; - we32k) - basic_machine=we32k-att - ;; - sparc | sparcv9) - basic_machine=sparc-sun - ;; - cydra) - basic_machine=cydra-cydrome - ;; - orion) - basic_machine=orion-highlevel - ;; - orion105) - basic_machine=clipper-highlevel - ;; - mac | mpw | mac-mpw) - basic_machine=m68k-apple - ;; - pmac | pmac-mpw) - basic_machine=powerpc-apple - ;; - c4x*) - basic_machine=c4x-none - os=-coff - ;; - *) - echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 - exit 1 - ;; -esac - -# Here we canonicalize certain aliases for manufacturers. -case $basic_machine in - *-digital*) - basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` - ;; - *-commodore*) - basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` - ;; - *) - ;; -esac - -# Decode manufacturer-specific aliases for certain operating systems. - -if [ x"$os" != x"" ] -then -case $os in - # First match some system type aliases - # that might get confused with valid system types. - # -solaris* is a basic system type, with this one exception. - -solaris1 | -solaris1.*) - os=`echo $os | sed -e 's|solaris1|sunos4|'` - ;; - -solaris) - os=-solaris2 - ;; - -svr4*) - os=-sysv4 - ;; - -unixware*) - os=-sysv4.2uw - ;; - -gnu/linux*) - os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` - ;; - # First accept the basic system types. - # The portable systems comes first. - # Each alternative MUST END IN A *, to match a version number. - # -sysv* is not here because it comes later, after sysvr4. - -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ - | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\ - | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \ - | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ - | -aos* \ - | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ - | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ - | -hiux* | -386bsd* | -netbsd* | -openbsd* | -freebsd* | -riscix* \ - | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ - | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ - | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ - | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ - | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \ - | -interix* | -uwin* | -rhapsody* | -opened* | -openstep* | -oskit*) - # Remember, each alternative MUST END IN *, to match a version number. - ;; - -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ - | -windows* | -osx | -abug | -netware* | -os9* | -beos* \ - | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) - ;; - -mac*) - os=`echo $os | sed -e 's|mac|macos|'` - ;; - -linux*) - os=`echo $os | sed -e 's|linux|linux-gnu|'` - ;; - -sunos5*) - os=`echo $os | sed -e 's|sunos5|solaris2|'` - ;; - -sunos6*) - os=`echo $os | sed -e 's|sunos6|solaris3|'` - ;; - -opened*) - os=-openedition - ;; - -wince*) - os=-wince - ;; - -osfrose*) - os=-osfrose - ;; - -osf*) - os=-osf - ;; - -utek*) - os=-bsd - ;; - -dynix*) - os=-bsd - ;; - -acis*) - os=-aos - ;; - -386bsd) - os=-bsd - ;; - -ctix* | -uts*) - os=-sysv - ;; - -ns2 ) - os=-nextstep2 - ;; - # Preserve the version number of sinix5. - -sinix5.*) - os=`echo $os | sed -e 's|sinix|sysv|'` - ;; - -sinix*) - os=-sysv4 - ;; - -triton*) - os=-sysv3 - ;; - -oss*) - os=-sysv3 - ;; - -qnx) - os=-qnx4 - ;; - -svr4) - os=-sysv4 - ;; - -svr3) - os=-sysv3 - ;; - -sysvr4) - os=-sysv4 - ;; - # This must come after -sysvr4. - -sysv*) - ;; - -ose*) - os=-ose - ;; - -es1800*) - os=-ose - ;; - -xenix) - os=-xenix - ;; - -*mint | -*MiNT) - os=-mint - ;; - -none) - ;; - *) - # Get rid of the `-' at the beginning of $os. - os=`echo $os | sed 's/[^-]*-//'` - echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 - exit 1 - ;; -esac -else - -# Here we handle the default operating systems that come with various machines. -# The value should be what the vendor currently ships out the door with their -# machine or put another way, the most popular os provided with the machine. - -# Note that if you're going to try to match "-MANUFACTURER" here (say, -# "-sun"), then you have to tell the case statement up towards the top -# that MANUFACTURER isn't an operating system. Otherwise, code above -# will signal an error saying that MANUFACTURER isn't an operating -# system, and we'll never get to this point. - -case $basic_machine in - *-acorn) - os=-riscix1.2 - ;; - arm*-rebel) - os=-linux - ;; - arm*-semi) - os=-aout - ;; - pdp11-*) - os=-none - ;; - *-dec | vax-*) - os=-ultrix4.2 - ;; - m68*-apollo) - os=-domain - ;; - i386-sun) - os=-sunos4.0.2 - ;; - m68000-sun) - os=-sunos3 - # This also exists in the configure program, but was not the - # default. - # os=-sunos4 - ;; - m68*-cisco) - os=-aout - ;; - mips*-cisco) - os=-elf - ;; - mips*-*) - os=-elf - ;; - *-tti) # must be before sparc entry or we get the wrong os. - os=-sysv3 - ;; - sparc-* | *-sun) - os=-sunos4.1.1 - ;; - *-be) - os=-beos - ;; - *-ibm) - os=-aix - ;; - *-wec) - os=-proelf - ;; - *-winbond) - os=-proelf - ;; - *-oki) - os=-proelf - ;; - *-hp) - os=-hpux - ;; - *-hitachi) - os=-hiux - ;; - i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) - os=-sysv - ;; - *-cbm) - os=-amigaos - ;; - *-dg) - os=-dgux - ;; - *-dolphin) - os=-sysv3 - ;; - m68k-ccur) - os=-rtu - ;; - m88k-omron*) - os=-luna - ;; - *-next ) - os=-nextstep - ;; - *-sequent) - os=-ptx - ;; - *-crds) - os=-unos - ;; - *-ns) - os=-genix - ;; - i370-*) - os=-mvs - ;; - *-next) - os=-nextstep3 - ;; - *-gould) - os=-sysv - ;; - *-highlevel) - os=-bsd - ;; - *-encore) - os=-bsd - ;; - *-sgi) - os=-irix - ;; - *-siemens) - os=-sysv4 - ;; - *-masscomp) - os=-rtu - ;; - f301-fujitsu) - os=-uxpv - ;; - *-rom68k) - os=-coff - ;; - *-*bug) - os=-coff - ;; - *-apple) - os=-macos - ;; - *-atari*) - os=-mint - ;; - *) - os=-none - ;; -esac -fi - -# Here we handle the case where we know the os, and the CPU type, but not the -# manufacturer. We pick the logical manufacturer. -vendor=unknown -case $basic_machine in - *-unknown) - case $os in - -riscix*) - vendor=acorn - ;; - -sunos*) - vendor=sun - ;; - -aix*) - vendor=ibm - ;; - -beos*) - vendor=be - ;; - -hpux*) - vendor=hp - ;; - -mpeix*) - vendor=hp - ;; - -hiux*) - vendor=hitachi - ;; - -unos*) - vendor=crds - ;; - -dgux*) - vendor=dg - ;; - -luna*) - vendor=omron - ;; - -genix*) - vendor=ns - ;; - -mvs* | -opened*) - vendor=ibm - ;; - -ptx*) - vendor=sequent - ;; - -vxsim* | -vxworks*) - vendor=wrs - ;; - -aux*) - vendor=apple - ;; - -hms*) - vendor=hitachi - ;; - -mpw* | -macos*) - vendor=apple - ;; - -*mint | -*MiNT) - vendor=atari - ;; - esac - basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` - ;; -esac - -echo $basic_machine$os diff --git a/acsupport/install-sh b/acsupport/install-sh deleted file mode 100644 --- a/acsupport/install-sh +++ /dev/null @@ -1,251 +0,0 @@ -#!/bin/sh -# -# install - install a program, script, or datafile -# This comes from X11R5 (mit/util/scripts/install.sh). -# -# Copyright 1991 by the Massachusetts Institute of Technology -# -# Permission to use, copy, modify, distribute, and sell this software and its -# documentation for any purpose is hereby granted without fee, provided that -# the above copyright notice appear in all copies and that both that -# copyright notice and this permission notice appear in supporting -# documentation, and that the name of M.I.T. not be used in advertising or -# publicity pertaining to distribution of the software without specific, -# written prior permission. M.I.T. makes no representations about the -# suitability of this software for any purpose. It is provided "as is" -# without express or implied warranty. -# -# 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. It can only install one file at a time, a restriction -# shared with many OS's install programs. - - -# set DOITPROG to echo to test this script - -# Don't use :- since 4.3BSD and earlier shells don't like it. -doit="${DOITPROG-}" - - -# put in absolute paths if you don't have them in your path; or use env. vars. - -mvprog="${MVPROG-mv}" -cpprog="${CPPROG-cp}" -chmodprog="${CHMODPROG-chmod}" -chownprog="${CHOWNPROG-chown}" -chgrpprog="${CHGRPPROG-chgrp}" -stripprog="${STRIPPROG-strip}" -rmprog="${RMPROG-rm}" -mkdirprog="${MKDIRPROG-mkdir}" - -transformbasename="" -transform_arg="" -instcmd="$mvprog" -chmodcmd="$chmodprog 0755" -chowncmd="" -chgrpcmd="" -stripcmd="" -rmcmd="$rmprog -f" -mvcmd="$mvprog" -src="" -dst="" -dir_arg="" - -while [ x"$1" != x ]; do - case $1 in - -c) instcmd="$cpprog" - shift - continue;; - - -d) dir_arg=true - shift - continue;; - - -m) chmodcmd="$chmodprog $2" - shift - shift - continue;; - - -o) chowncmd="$chownprog $2" - shift - shift - continue;; - - -g) chgrpcmd="$chgrpprog $2" - shift - shift - continue;; - - -s) stripcmd="$stripprog" - shift - continue;; - - -t=*) transformarg=`echo $1 | sed 's/-t=//'` - shift - continue;; - - -b=*) transformbasename=`echo $1 | sed 's/-b=//'` - shift - continue;; - - *) if [ x"$src" = x ] - then - src=$1 - else - # this colon is to work around a 386BSD /bin/sh bug - : - dst=$1 - fi - shift - continue;; - esac -done - -if [ x"$src" = x ] -then - echo "install: no input file specified" - exit 1 -else - true -fi - -if [ x"$dir_arg" != x ]; then - dst=$src - src="" - - if [ -d $dst ]; then - instcmd=: - chmodcmd="" - else - instcmd=mkdir - fi -else - -# Waiting for this to be detected by the "$instcmd $src $dsttmp" command -# might cause directories to be created, which would be especially bad -# if $src (and thus $dsttmp) contains '*'. - - if [ -f $src -o -d $src ] - then - true - else - echo "install: $src does not exist" - exit 1 - fi - - if [ x"$dst" = x ] - then - echo "install: no destination specified" - exit 1 - else - true - fi - -# If destination is a directory, append the input filename; if your system -# does not like double slashes in filenames, you may need to add some logic - - if [ -d $dst ] - then - dst="$dst"/`basename $src` - else - true - fi -fi - -## this sed command emulates the dirname command -dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` - -# Make sure that the destination directory exists. -# this part is taken from Noah Friedman's mkinstalldirs script - -# Skip lots of stat calls in the usual case. -if [ ! -d "$dstdir" ]; then -defaultIFS=' -' -IFS="${IFS-${defaultIFS}}" - -oIFS="${IFS}" -# Some sh's can't handle IFS=/ for some reason. -IFS='%' -set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'` -IFS="${oIFS}" - -pathcomp='' - -while [ $# -ne 0 ] ; do - pathcomp="${pathcomp}${1}" - shift - - if [ ! -d "${pathcomp}" ] ; - then - $mkdirprog "${pathcomp}" - else - true - fi - - pathcomp="${pathcomp}/" -done -fi - -if [ x"$dir_arg" != x ] -then - $doit $instcmd $dst && - - if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi && - if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi && - if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi && - if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi -else - -# If we're going to rename the final executable, determine the name now. - - if [ x"$transformarg" = x ] - then - dstfile=`basename $dst` - else - dstfile=`basename $dst $transformbasename | - sed $transformarg`$transformbasename - fi - -# don't allow the sed command to completely eliminate the filename - - if [ x"$dstfile" = x ] - then - dstfile=`basename $dst` - else - true - fi - -# Make a temp file name in the proper directory. - - dsttmp=$dstdir/#inst.$$# - -# Move or copy the file name to the temp name - - $doit $instcmd $src $dsttmp && - - trap "rm -f ${dsttmp}" 0 && - -# 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 $instcmd $src $dsttmp" command. - - if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi && - if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi && - if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi && - if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi && - -# Now rename the file to the real destination. - - $doit $rmcmd -f $dstdir/$dstfile && - $doit $mvcmd $dsttmp $dstdir/$dstfile - -fi && - - -exit 0 diff --git a/acsupport/ltconfig b/acsupport/ltconfig deleted file mode 100644 --- a/acsupport/ltconfig +++ /dev/null @@ -1,2822 +0,0 @@ -#! /bin/sh - -# ltconfig - Create a system-specific libtool. -# Copyright (C) 1996-1999 Free Software Foundation, Inc. -# Gordon Matzigkeit , 1996 -# -# This file is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -# -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - -# A lot of this script is taken from autoconf-2.10. - -# Check that we are running under the correct shell. -SHELL=${CONFIG_SHELL-/bin/sh} -echo=echo -if test "X$1" = X--no-reexec; then - # Discard the --no-reexec flag, and continue. - shift -elif test "X$1" = X--fallback-echo; then - # used as fallback echo - shift - cat </dev/null`" = 'X\t'; then - # Yippee, $echo works! - : -else - # Restart under the correct shell. - exec "$SHELL" "$0" --no-reexec ${1+"$@"} -fi - -# Find the correct PATH separator. Usually this is `:', but -# DJGPP uses `;' like DOS. -if test "X${PATH_SEPARATOR+set}" != "Xset"; then - UNAME=${UNAME-`uname 2>/dev/null`} - case X$UNAME in - *-DOS) PATH_SEPARATOR=';' ;; - *) PATH_SEPARATOR=':' ;; - esac -fi - -# The HP-UX ksh and POSIX shell print the target directory to stdout -# if CDPATH is set. -if test "${CDPATH+set}" = set; then CDPATH=; export CDPATH; fi - -if test "X${echo_test_string+set}" != "Xset"; then - # find a string as large as possible, as long as the shell can cope with it - for cmd in 'sed 50q "$0"' 'sed 20q "$0"' 'sed 10q "$0"' 'sed 2q "$0"' 'echo test'; do - # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ... - if (echo_test_string="`eval $cmd`") 2>/dev/null && - echo_test_string="`eval $cmd`" && - (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null; then - break - fi - done -fi - -if test "X`($echo '\t') 2>/dev/null`" != 'X\t' || - test "X`($echo "$echo_test_string") 2>/dev/null`" != X"$echo_test_string"; then - # The Solaris, AIX, and Digital Unix default echo programs unquote - # backslashes. This makes it impossible to quote backslashes using - # echo "$something" | sed 's/\\/\\\\/g' - # - # So, first we look for a working echo in the user's PATH. - - IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}" - for dir in $PATH /usr/ucb; do - if test -f $dir/echo && - test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && - test "X`($dir/echo "$echo_test_string") 2>/dev/null`" = X"$echo_test_string"; then - echo="$dir/echo" - break - fi - done - IFS="$save_ifs" - - if test "X$echo" = Xecho; then - # We didn't find a better echo, so look for alternatives. - if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' && - test "X`(print -r "$echo_test_string") 2>/dev/null`" = X"$echo_test_string"; then - # This shell has a builtin print -r that does the trick. - echo='print -r' - elif test -f /bin/ksh && test "X$CONFIG_SHELL" != X/bin/ksh; then - # If we have ksh, try running ltconfig again with it. - ORIGINAL_CONFIG_SHELL="${CONFIG_SHELL-/bin/sh}" - export ORIGINAL_CONFIG_SHELL - CONFIG_SHELL=/bin/ksh - export CONFIG_SHELL - exec "$CONFIG_SHELL" "$0" --no-reexec ${1+"$@"} - else - # Try using printf. - echo='printf "%s\n"' - if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && - test "X`($echo "$echo_test_string") 2>/dev/null`" = X"$echo_test_string"; then - # Cool, printf works - : - elif test "X`("$ORIGINAL_CONFIG_SHELL" "$0" --fallback-echo '\t') 2>/dev/null`" = 'X\t' && - test "X`("$ORIGINAL_CONFIG_SHELL" "$0" --fallback-echo "$echo_test_string") 2>/dev/null`" = X"$echo_test_string"; then - CONFIG_SHELL="$ORIGINAL_CONFIG_SHELL" - export CONFIG_SHELL - SHELL="$CONFIG_SHELL" - export SHELL - echo="$CONFIG_SHELL $0 --fallback-echo" - elif test "X`("$CONFIG_SHELL" "$0" --fallback-echo '\t') 2>/dev/null`" = 'X\t' && - test "X`("$CONFIG_SHELL" "$0" --fallback-echo "$echo_test_string") 2>/dev/null`" = X"$echo_test_string"; then - echo="$CONFIG_SHELL $0 --fallback-echo" - else - # maybe with a smaller string... - prev=: - - for cmd in 'echo test' 'sed 2q "$0"' 'sed 10q "$0"' 'sed 20q "$0"' 'sed 50q "$0"'; do - if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null; then - break - fi - prev="$cmd" - done - - if test "$prev" != 'sed 50q "$0"'; then - echo_test_string=`eval $prev` - export echo_test_string - exec "${ORIGINAL_CONFIG_SHELL}" "$0" ${1+"$@"} - else - # Oops. We lost completely, so just stick with echo. - echo=echo - fi - fi - fi - fi -fi - -# Sed substitution that helps us do robust quoting. It backslashifies -# metacharacters that are still active within double-quoted strings. -Xsed='sed -e s/^X//' -sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g' - -# Same as above, but do not quote variable references. -double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g' - -# Sed substitution to delay expansion of an escaped shell variable in a -# double_quote_subst'ed string. -delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' - -# The name of this program. -progname=`$echo "X$0" | $Xsed -e 's%^.*/%%'` - -# Constants: -PROGRAM=ltconfig -PACKAGE=libtool -VERSION=1.2f -TIMESTAMP=" (1.385 1999/03/15 17:24:54)" -ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.c 1>&5' -ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.c $LIBS 1>&5' -rm="rm -f" - -help="Try \`$progname --help' for more information." - -# Global variables: -default_ofile=libtool -can_build_shared=yes -enable_shared=yes -# All known linkers require a `.a' archive for static linking. -enable_static=yes -enable_fast_install=yes -enable_dlopen=unknown -ltmain= -silent= -srcdir= -ac_config_guess= -ac_config_sub= -host= -nonopt= -ofile="$default_ofile" -verify_host=yes -with_gcc=no -with_gnu_ld=no -need_locks=yes -ac_ext=c -objext=o -libext=a -cache_file= - -old_AR="$AR" -old_CC="$CC" -old_CFLAGS="$CFLAGS" -old_CPPFLAGS="$CPPFLAGS" -old_LD="$LD" -old_LN_S="$LN_S" -old_NM="$NM" -old_RANLIB="$RANLIB" -old_DLLTOOL="$DLLTOOL" -old_AS="$AS" - -# Parse the command line options. -args= -prev= -for option -do - case "$option" in - -*=*) optarg=`echo "$option" | sed 's/[-_a-zA-Z0-9]*=//'` ;; - *) optarg= ;; - esac - - # If the previous option needs an argument, assign it. - if test -n "$prev"; then - eval "$prev=\$option" - prev= - continue - fi - - case "$option" in - --help) cat <&2 - echo "$help" 1>&2 - exit 1 - ;; - - *) - if test -z "$ltmain"; then - ltmain="$option" - elif test -z "$host"; then -# This generates an unnecessary warning for sparc-sun-solaris4.1.3_U1 -# if test -n "`echo $option| sed 's/[-a-z0-9.]//g'`"; then -# echo "$progname: warning \`$option' is not a valid host type" 1>&2 -# fi - host="$option" - else - echo "$progname: too many arguments" 1>&2 - echo "$help" 1>&2 - exit 1 - fi ;; - esac -done - -if test -z "$ltmain"; then - echo "$progname: you must specify a LTMAIN file" 1>&2 - echo "$help" 1>&2 - exit 1 -fi - -if test ! -f "$ltmain"; then - echo "$progname: \`$ltmain' does not exist" 1>&2 - echo "$help" 1>&2 - exit 1 -fi - -# Quote any args containing shell metacharacters. -ltconfig_args= -for arg -do - case "$arg" in - *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*) - ltconfig_args="$ltconfig_args '$arg'" ;; - *) ltconfig_args="$ltconfig_args $arg" ;; - esac -done - -# A relevant subset of AC_INIT. - -# File descriptor usage: -# 0 standard input -# 1 file creation -# 2 errors and warnings -# 3 some systems may open it to /dev/tty -# 4 used on the Kubota Titan -# 5 compiler messages saved in config.log -# 6 checking for... messages and results -if test "$silent" = yes; then - exec 6>/dev/null -else - exec 6>&1 -fi -exec 5>>./config.log - -# NLS nuisances. -# Only set LANG and LC_ALL to C if already set. -# These must not be set unconditionally because not all systems understand -# e.g. LANG=C (notably SCO). -if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi -if test "${LANG+set}" = set; then LANG=C; export LANG; fi - -if test -n "$cache_file" && test -r "$cache_file"; then - echo "loading cache $cache_file within ltconfig" - . $cache_file -fi - -if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then - # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu. - if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then - ac_n= ac_c=' -' ac_t=' ' - else - ac_n=-n ac_c= ac_t= - fi -else - ac_n= ac_c='\c' ac_t= -fi - -if test -z "$srcdir"; then - # Assume the source directory is the same one as the path to LTMAIN. - srcdir=`$echo "X$ltmain" | $Xsed -e 's%/[^/]*$%%'` - test "$srcdir" = "$ltmain" && srcdir=. -fi - -trap "$rm conftest*; exit 1" 1 2 15 -if test "$verify_host" = yes; then - # Check for config.guess and config.sub. - ac_aux_dir= - for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do - if test -f $ac_dir/config.guess; then - ac_aux_dir=$ac_dir - break - fi - done - if test -z "$ac_aux_dir"; then - echo "$progname: cannot find config.guess in $srcdir $srcdir/.. $srcdir/../.." 1>&2 - echo "$help" 1>&2 - exit 1 - fi - ac_config_guess=$ac_aux_dir/config.guess - ac_config_sub=$ac_aux_dir/config.sub - - # Make sure we can run config.sub. - if $SHELL $ac_config_sub sun4 >/dev/null 2>&1; then : - else - echo "$progname: cannot run $ac_config_sub" 1>&2 - echo "$help" 1>&2 - exit 1 - fi - - echo $ac_n "checking host system type""... $ac_c" 1>&6 - - host_alias=$host - case "$host_alias" in - "") - if host_alias=`$SHELL $ac_config_guess`; then : - else - echo "$progname: cannot guess host type; you must specify one" 1>&2 - echo "$help" 1>&2 - exit 1 - fi ;; - esac - host=`$SHELL $ac_config_sub $host_alias` - echo "$ac_t$host" 1>&6 - - # Make sure the host verified. - test -z "$host" && exit 1 - -elif test -z "$host"; then - echo "$progname: you must specify a host type if you use \`--no-verify'" 1>&2 - echo "$help" 1>&2 - exit 1 -else - host_alias=$host -fi - -# Transform linux* to *-*-linux-gnu*, to support old configure scripts. -case "$host_os" in -linux-gnu*) ;; -linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'` -esac - -host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` -host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` -host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` - -case "$host_os" in -aix3*) - # AIX sometimes has problems with the GCC collect2 program. For some - # reason, if we set the COLLECT_NAMES environment variable, the problems - # vanish in a puff of smoke. - if test "${COLLECT_NAMES+set}" != set; then - COLLECT_NAMES= - export COLLECT_NAMES - fi - ;; -esac - -# Determine commands to create old-style static archives. -old_archive_cmds='$AR cru $oldlib$oldobjs' -old_postinstall_cmds='chmod 644 $oldlib' -old_postuninstall_cmds= - -# Set a sane default for `AR'. -test -z "$AR" && AR=ar - -# If RANLIB is not set, then run the test. -if test "${RANLIB+set}" != "set"; then - result=no - - echo $ac_n "checking for ranlib... $ac_c" 1>&6 - IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}" - for dir in $PATH; do - test -z "$dir" && dir=. - if test -f $dir/ranlib; then - RANLIB="ranlib" - result="ranlib" - break - fi - done - IFS="$save_ifs" - - echo "$ac_t$result" 1>&6 -fi - -if test -n "$RANLIB"; then - old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" - old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds" -fi - -# Set sane defaults for `DLLTOOL' and `AS', used on cygwin. -test -z "$DLLTOOL" && DLLTOOL=dlltool -test -z "$AS" && AS=as - -# Check to see if we are using GCC. -if test "$with_gcc" != yes || test -z "$CC"; then - # If CC is not set, then try to find GCC or a usable CC. - if test -z "$CC"; then - echo $ac_n "checking for gcc... $ac_c" 1>&6 - IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}" - for dir in $PATH; do - IFS="$save_ifs" - test -z "$dir" && dir=. - if test -f $dir/gcc; then - CC="gcc" - break - fi - done - IFS="$save_ifs" - - if test -n "$CC"; then - echo "$ac_t$CC" 1>&6 - else - echo "$ac_t"no 1>&6 - fi - fi - - # Not "gcc", so try "cc", rejecting "/usr/ucb/cc". - if test -z "$CC"; then - echo $ac_n "checking for cc... $ac_c" 1>&6 - IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}" - cc_rejected=no - for dir in $PATH; do - test -z "$dir" && dir=. - if test -f $dir/cc; then - if test "$dir/cc" = "/usr/ucb/cc"; then - cc_rejected=yes - continue - fi - CC="cc" - break - fi - done - IFS="$save_ifs" - if test $cc_rejected = yes; then - # We found a bogon in the path, so make sure we never use it. - set dummy $CC - shift - if test $# -gt 0; then - # We chose a different compiler from the bogus one. - # However, it has the same name, so the bogon will be chosen - # first if we set CC to just the name; use the full file name. - shift - set dummy "$dir/cc" "$@" - shift - CC="$@" - fi - fi - - if test -n "$CC"; then - echo "$ac_t$CC" 1>&6 - else - echo "$ac_t"no 1>&6 - fi - - if test -z "$CC"; then - echo "$progname: error: no acceptable cc found in \$PATH" 1>&2 - exit 1 - fi - fi - - # Now see if the compiler is really GCC. - with_gcc=no - echo $ac_n "checking whether we are using GNU C... $ac_c" 1>&6 - echo "$progname:564: checking whether we are using GNU C" >&5 - - $rm conftest.c - cat > conftest.c <&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then - with_gcc=yes - fi - $rm conftest.c - echo "$ac_t$with_gcc" 1>&6 -fi - -# Allow CC to be a program name with arguments. -set dummy $CC -compiler="$2" - -echo $ac_n "checking for object suffix... $ac_c" 1>&6 -$rm conftest* -echo 'int i = 1;' > conftest.c -echo "$progname:586: checking for object suffix" >& 5 -if { (eval echo $progname:587: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; }; then - # Append any warnings to the config.log. - cat conftest.err 1>&5 - - for ac_file in conftest.*; do - case $ac_file in - *.c) ;; - *) objext=`echo $ac_file | sed -e s/conftest.//` ;; - esac - done -else - cat conftest.err 1>&5 - echo "$progname: failed program was:" >&5 - cat conftest.c >&5 -fi -$rm conftest* -echo "$ac_t$objext" 1>&6 - -echo $ac_n "checking for $compiler option to produce PIC... $ac_c" 1>&6 -pic_flag= -special_shlib_compile_flags= -wl= -link_static_flag= -no_builtin_flag= - -if test "$with_gcc" = yes; then - wl='-Wl,' - link_static_flag='-static' - - case "$host_os" in - beos* | irix5* | irix6* | osf3* | osf4*) - # PIC is the default for these OSes. - ;; - aix*) - # Below there is a dirty hack to force normal static linking with -ldl - # The problem is because libdl dynamically linked with both libc and - # libC (AIX C++ library), which obviously doesn't included in libraries - # list by gcc. This cause undefined symbols with -static flags. - # This hack allows C programs to be linked with "-static -ldl", but - # we not sure about C++ programs. - link_static_flag="$link_static_flag ${wl}-lC" - ;; - cygwin* | mingw* | os2*) - # We can build DLLs from non-PIC. - ;; - amigaos*) - # FIXME: we need at least 68020 code to build shared libraries, but - # adding the `-m68020' flag to GCC prevents building anything better, - # like `-m68040'. - pic_flag='-m68020 -resident32 -malways-restore-a4' - ;; - *) - pic_flag='-fPIC' - ;; - esac -else - # PORTME Check for PIC flags for the system compiler. - case "$host_os" in - aix3* | aix4*) - # All AIX code is PIC. - link_static_flag='-bnso -bI:/lib/syscalls.exp' - ;; - - hpux9* | hpux10* | hpux11*) - # Is there a better link_static_flag that works with the bundled CC? - wl='-Wl,' - link_static_flag="${wl}-a ${wl}archive" - pic_flag='+Z' - ;; - - irix5* | irix6*) - wl='-Wl,' - link_static_flag='-non_shared' - # PIC (with -KPIC) is the default. - ;; - - cygwin* | mingw* | os2*) - # We can build DLLs from non-PIC. - ;; - - osf3* | osf4*) - # All OSF/1 code is PIC. - wl='-Wl,' - link_static_flag='-non_shared' - ;; - - sco3.2v5*) - pic_flag='-Kpic' - link_static_flag='-dn' - special_shlib_compile_flags='-belf' - ;; - - solaris*) - pic_flag='-KPIC' - link_static_flag='-Bstatic' - wl='-Wl,' - ;; - - sunos4*) - pic_flag='-PIC' - link_static_flag='-Bstatic' - wl='-Qoption ld ' - ;; - - sysv4.2uw2* | sysv4.3* | sysv5*) - pic_flag='-KPIC' - link_static_flag='-Bstatic' - wl='-Wl,' - ;; - - uts4*) - pic_flag='-pic' - link_static_flag='-Bstatic' - ;; - - *) - can_build_shared=no - ;; - esac -fi - -if test -n "$pic_flag"; then - echo "$ac_t$pic_flag" 1>&6 - - # Check to make sure the pic_flag actually works. - echo $ac_n "checking if $compiler PIC flag $pic_flag works... $ac_c" 1>&6 - $rm conftest* - echo "int some_variable = 0;" > conftest.c - save_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS $pic_flag -DPIC" - echo "$progname:717: checking if $compiler PIC flag $pic_flag works" >&5 - if { (eval echo $progname:718: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; } && test -s conftest.$objext; then - # Append any warnings to the config.log. - cat conftest.err 1>&5 - - case "$host_os" in - hpux9* | hpux10* | hpux11*) - # On HP-UX, both CC and GCC only warn that PIC is supported... then they - # create non-PIC objects. So, if there were any warnings, we assume that - # PIC is not supported. - if test -s conftest.err; then - echo "$ac_t"no 1>&6 - can_build_shared=no - pic_flag= - else - echo "$ac_t"yes 1>&6 - pic_flag=" $pic_flag" - fi - ;; - *) - echo "$ac_t"yes 1>&6 - pic_flag=" $pic_flag" - ;; - esac - else - # Append any errors to the config.log. - cat conftest.err 1>&5 - can_build_shared=no - pic_flag= - echo "$ac_t"no 1>&6 - fi - CFLAGS="$save_CFLAGS" - $rm conftest* -else - echo "$ac_t"none 1>&6 -fi - -# Check to see if options -o and -c are simultaneously supported by compiler -echo $ac_n "checking if $compiler supports -c -o file.o... $ac_c" 1>&6 -$rm conftest* -echo "int some_variable = 0;" > conftest.c -save_CFLAGS="$CFLAGS" -CFLAGS="$CFLAGS -c -o conftest2.o" -echo "$progname:760: checking if $compiler supports -c -o file.o" >&5 -if { (eval echo $progname:761: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; } && test -s conftest2.o; then - - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings - if test -s conftest.err; then - echo "$ac_t"no 1>&6 - compiler_c_o=no - else - echo "$ac_t"yes 1>&6 - compiler_c_o=yes - fi -else - # Append any errors to the config.log. - cat conftest.err 1>&5 - compiler_c_o=no - echo "$ac_t"no 1>&6 -fi -CFLAGS="$save_CFLAGS" -$rm conftest* - -if test x"$compiler_c_o" = x"yes"; then - # Check to see if we can write to a .lo - echo $ac_n "checking if $compiler supports -c -o file.lo... $ac_c" 1>&6 - $rm conftest* - echo "int some_variable = 0;" > conftest.c - save_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS -c -o conftest.lo" - echo "$progname:788: checking if $compiler supports -c -o file.lo" >&5 -if { (eval echo $progname:789: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; } && test -s conftest.lo; then - - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings - if test -s conftest.err; then - echo "$ac_t"no 1>&6 - compiler_o_lo=no - else - echo "$ac_t"yes 1>&6 - compiler_o_lo=yes - fi - else - # Append any errors to the config.log. - cat conftest.err 1>&5 - compiler_o_lo=no - echo "$ac_t"no 1>&6 - fi - CFLAGS="$save_CFLAGS" - $rm conftest* -else - compiler_o_lo=no -fi - -# Check to see if we can do hard links to lock some files if needed -hard_links="nottested" -if test "$compiler_c_o" = no && test "$need_locks" != no; then - # do not overwrite the value of need_locks provided by the user - echo $ac_n "checking if we can lock with hard links... $ac_c" 1>&6 - hard_links=yes - $rm conftest* - ln conftest.a conftest.b 2>/dev/null && hard_links=no - touch conftest.a - ln conftest.a conftest.b 2>&5 || hard_links=no - ln conftest.a conftest.b 2>/dev/null && hard_links=no - echo "$ac_t$hard_links" 1>&6 - $rm conftest* - if test "$hard_links" = no; then - echo "*** WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2 - need_locks=warn - fi -else - need_locks=no -fi - -if test "$with_gcc" = yes; then - # Check to see if options -fno-rtti -fno-exceptions are supported by compiler - echo $ac_n "checking if $compiler supports -fno-rtti -fno-exceptions ... $ac_c" 1>&6 - $rm conftest* - echo "int some_variable = 0;" > conftest.c - save_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS -fno-rtti -fno-exceptions -c conftest.c" - echo "$progname:840: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 - if { (eval echo $progname:841: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; } && test -s conftest.o; then - - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings - if test -s conftest.err; then - echo "$ac_t"no 1>&6 - compiler_rtti_exceptions=no - else - echo "$ac_t"yes 1>&6 - compiler_rtti_exceptions=yes - fi - else - # Append any errors to the config.log. - cat conftest.err 1>&5 - compiler_rtti_exceptions=no - echo "$ac_t"no 1>&6 - fi - CFLAGS="$save_CFLAGS" - $rm conftest* - - if test "$compiler_rtti_exceptions" = "yes"; then - no_builtin_flag=' -fno-builtin -fno-rtti -fno-exceptions' - else - no_builtin_flag=' -fno-builtin' - fi - -fi - -# Check for any special shared library compilation flags. -if test -n "$special_shlib_compile_flags"; then - echo "$progname: warning: \`$CC' requires \`$special_shlib_compile_flags' to build shared libraries" 1>&2 - if echo "$old_CC $old_CFLAGS " | egrep -e "[ ]$special_shlib_compile_flags[ ]" >/dev/null; then : - else - echo "$progname: add \`$special_shlib_compile_flags' to the CC or CFLAGS env variable and reconfigure" 1>&2 - can_build_shared=no - fi -fi - -echo $ac_n "checking if $compiler static flag $link_static_flag works... $ac_c" 1>&6 -$rm conftest* -echo 'main(){return(0);}' > conftest.c -save_LDFLAGS="$LDFLAGS" -LDFLAGS="$LDFLAGS $link_static_flag" -echo "$progname:884: checking if $compiler static flag $link_static_flag works" >&5 -if { (eval echo $progname:885: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then - echo "$ac_t$link_static_flag" 1>&6 -else - echo "$ac_t"none 1>&6 - link_static_flag= -fi -LDFLAGS="$save_LDFLAGS" -$rm conftest* - -if test -z "$LN_S"; then - # Check to see if we can use ln -s, or we need hard links. - echo $ac_n "checking whether ln -s works... $ac_c" 1>&6 - $rm conftestdata - if ln -s X conftestdata 2>/dev/null; then - $rm conftestdata - LN_S="ln -s" - else - LN_S=ln - fi - if test "$LN_S" = "ln -s"; then - echo "$ac_t"yes 1>&6 - else - echo "$ac_t"no 1>&6 - fi -fi - -# Make sure LD is an absolute path. -if test -z "$LD"; then - ac_prog=ld - if test "$with_gcc" = yes; then - # Check if gcc -print-prog-name=ld gives a path. - echo $ac_n "checking for ld used by GCC... $ac_c" 1>&6 - echo "$progname:917: checking for ld used by GCC" >&5 - ac_prog=`($CC -print-prog-name=ld) 2>&5` - case "$ac_prog" in - # Accept absolute paths. - /* | [A-Za-z]:[\\/]*) - re_direlt='/[^/][^/]*/\.\./' - # Canonicalize the path of ld - ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'` - while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do - ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"` - done - test -z "$LD" && LD="$ac_prog" - ;; - "") - # If it fails, then pretend we are not using GCC. - ac_prog=ld - ;; - *) - # If it is relative, then search for the first ld in PATH. - with_gnu_ld=unknown - ;; - esac - elif test "$with_gnu_ld" = yes; then - echo $ac_n "checking for GNU ld... $ac_c" 1>&6 - echo "$progname:941: checking for GNU ld" >&5 - else - echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6 - echo "$progname:944: checking for non-GNU ld" >&5 - fi - - if test -z "$LD"; then - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}" - for ac_dir in $PATH; do - test -z "$ac_dir" && ac_dir=. - if test -f "$ac_dir/$ac_prog"; then - LD="$ac_dir/$ac_prog" - # Check to see if the program is GNU ld. I'd rather use --version, - # but apparently some GNU ld's only accept -v. - # Break only if it was the GNU/non-GNU ld that we prefer. - if "$LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then - test "$with_gnu_ld" != no && break - else - test "$with_gnu_ld" != yes && break - fi - fi - done - IFS="$ac_save_ifs" - fi - - if test -n "$LD"; then - echo "$ac_t$LD" 1>&6 - else - echo "$ac_t"no 1>&6 - fi - - if test -z "$LD"; then - echo "$progname: error: no acceptable ld found in \$PATH" 1>&2 - exit 1 - fi -fi - -# Check to see if it really is or is not GNU ld. -echo $ac_n "checking if the linker ($LD) is GNU ld... $ac_c" 1>&6 -# I'd rather use --version here, but apparently some GNU ld's only accept -v. -if $LD -v 2>&1 &5; then - with_gnu_ld=yes -else - with_gnu_ld=no -fi -echo "$ac_t$with_gnu_ld" 1>&6 - -# See if the linker supports building shared libraries. -echo $ac_n "checking whether the linker ($LD) supports shared libraries... $ac_c" 1>&6 - -allow_undefined_flag= -no_undefined_flag= -need_lib_prefix=unknown -need_version=unknown -# when you set need_version to no, make sure it does not cause -set_version -# flags to be left without arguments -archive_cmds= -archive_expsym_cmds= -old_archive_from_new_cmds= -export_dynamic_flag_spec= -whole_archive_flag_spec= -thread_safe_flag_spec= -hardcode_libdir_flag_spec= -hardcode_libdir_separator= -hardcode_direct=no -hardcode_minus_L=no -hardcode_shlibpath_var=unsupported -runpath_var= -always_export_symbols=no -export_symbols_cmds='$NM $libobjs | $global_symbol_pipe | sed '\''s/.* //'\'' | sort | uniq > $export_symbols' -# include_expsyms should be a list of space-separated symbols to be *always* -# included in the symbol list -include_expsyms= -# exclude_expsyms can be an egrep regular expression of symbols to exclude -# it will be wrapped by ` (' and `)$', so one must not match beginning or -# end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', -# as well as any symbol that contains `d'. -exclude_expsyms= - -case "$host_os" in -cygwin* | mingw*) - # 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 "$with_gcc" != yes; then - with_gnu_ld=no - fi - ;; - -freebsd2* | sunos4*) - exclude_expsyms="_GLOBAL_OFFSET_TABLE_" - ;; - -esac - -ld_shlibs=yes -if test "$with_gnu_ld" = yes; then - # If archive_cmds runs LD, not CC, wlarc should be empty - wlarc='${wl}' - - # See if GNU ld supports shared libraries. - case "$host_os" in - aix3* | aix4*) - # On AIX, the GNU linker is very broken - ld_shlibs=no - cat <&2 - -*** Warning: the GNU linker, at least up to release 2.9.1, is reported -*** to be unable to reliably create shared libraries on AIX. -*** Therefore, libtool is disabling shared libraries support. If you -*** really care for shared libraries, you may want to modify your PATH -*** so that a non-GNU linker is found, and then restart. - -EOF - ;; - - amigaos*) - archive_cmds='$rm $objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $objdir/a2ixlibrary.data~$AR cru $lib $libobjs~$RANLIB $lib~(cd $objdir && a2ixlibrary -32)' - hardcode_libdir_flag_spec='-L$libdir' - hardcode_minus_L=yes - ;; - - sunos4*) - archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linkopts' - wlarc= - hardcode_direct=yes - hardcode_minus_L=yes - hardcode_shlibpath_var=no - ;; - - beos*) - if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then - archive_cmds='$CC -nostart $libobjs $deplibs $linkopts ${wl}-soname $wl$soname -o $lib' - else - ld_shlibs=no - fi - ;; - - cygwin* | mingw*) - # hardcode_libdir_flag_spec is actually meaningless, as there is - # no search path for DLLs. - hardcode_libdir_flag_spec='-L$libdir' - allow_undefined_flag=unsupported - always_export_symbols=yes - - # Extract the symbol export list from an `--export-all' def file, - # then regenerate the def file from the symbol export list, so that - # the compiled dll only exports the symbol export list. - export_symbols_cmds='rm -f $objdir/$soname-ltdll.c~ - sed -e "/^# \/\* ltdll.c starts here \*\//,/^# \/\* ltdll.c ends here \*\// { s/^# //; p; }" -e d < $0 > $objdir/$soname-ltdll.c~ - (cd $objdir && $CC -c $soname-ltdll.c)~ - $DLLTOOL --export-all --exclude-symbols DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12 --output-def $objdir/$soname-def $objdir/$soname-ltdll.$objext $libobjs~ - sed -e "1,/EXPORTS/d" -e "s/ @ [0-9]* ; *//" < $objdir/$soname-def > $export_symbols' - - archive_expsym_cmds='echo EXPORTS > $objdir/$soname-def~ - _lt_hint=1; - for symbol in `cat $export_symbols`; do - echo " \$symbol @ \$_lt_hint ; " >> $objdir/$soname-def; - _lt_hint=`expr 1 + \$_lt_hint`; - done~ - $CC -Wl,--base-file,$objdir/$soname-base -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 -o $lib $objdir/$soname-ltdll.$objext $libobjs $deplibs $linkopts~ - $DLLTOOL --as=$AS --dllname $soname --exclude-symbols DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12 --def $objdir/$soname-def --base-file $objdir/$soname-base --output-exp $objdir/$soname-exp~ - $CC -Wl,--base-file,$objdir/$soname-base $objdir/$soname-exp -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 -o $lib $objdir/$soname-ltdll.$objext $libobjs $deplibs $linkopts~ - $DLLTOOL --as=$AS --dllname $soname --exclude-symbols DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12 --def $objdir/$soname-def --base-file $objdir/$soname-base --output-exp $objdir/$soname-exp~ - $CC $objdir/$soname-exp -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 -o $lib $objdir/$soname-ltdll.$objext $libobjs $deplibs $linkopts' - - old_archive_from_new_cmds='$DLLTOOL --as=$AS --dllname $soname --def $objdir/$soname-def --output-lib $objdir/$libname.a' - ;; - - *) - if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then - archive_cmds='$CC -shared $libobjs $deplibs $linkopts ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds='$CC -shared $libobjs $deplibs $linkopts ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - else - ld_shlibs=no - fi - ;; - esac - - if test "$ld_shlibs" = yes; then - runpath_var=LD_RUN_PATH - hardcode_libdir_flag_spec='${wl}--rpath ${wl}$libdir' - export_dynamic_flag_spec='${wl}--export-dynamic' - whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' - fi -else - # PORTME fill in a description of your system's linker (not GNU ld) - case "$host_os" in - aix3*) - allow_undefined_flag=unsupported - always_export_symbols=yes - archive_expsym_cmds='$LD -o $objdir/$soname $libobjs $deplibs $linkopts -bE:$export_symbols -T512 -H512 -bM:SRE~$AR cru $lib $objdir/$soname' - # Note: this linker hardcodes the directories in LIBPATH if there - # are no directories specified by -L. - hardcode_minus_L=yes - if test "$with_gcc" = yes && test -z "$link_static_flag"; then - # Neither direct hardcoding nor static linking is supported with a - # broken collect2. - hardcode_direct=unsupported - fi - ;; - - aix4*) - allow_undefined_flag= - if test "$with_gcc" = yes; then - if strings `${CC} -print-prog-name=collect2` | \ - grep resolve_lib_name >/dev/null - then - # We have reworked collect2 - hardcode_direct=yes - else - # We have old collect2 - hardcode_direct=unsupported - fi - archive_cmds='$CC -shared ${wl}-bnoentry -o $objdir/$soname $libobjs $deplibs $linkopts' - else - always_export_symbols=yes - archive_expsym_cmds='$CC -o $objdir/$soname $libobjs $deplibs $linkopts ${wl}-bE:$export_symbols ${wl}-bM:SRE ${wl}-bnoentry' - hardcode_direct=yes - fi - hardcode_minus_L=yes - # Though LIBPATH variable hardcodes shlibpath into executable, - # it doesn't affect searching for -l* libraries; this confuses - # tests in mdemo. - hardcode_shlibpath_var=unsupported - hardcode_libdir_flag_spec='-L$libdir' - ;; - - amigaos*) - archive_cmds='$rm $objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $objdir/a2ixlibrary.data~$AR cru $lib $libobjs~$RANLIB $lib~(cd $objdir && a2ixlibrary -32)' - hardcode_libdir_flag_spec='-L$libdir' - hardcode_minus_L=yes - ;; - - cygwin* | mingw*) - # 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=' ' - allow_undefined_flag=unsupported - # Tell ltmain to make .lib files, not .a files. - libext=lib - # FIXME: Setting linknames here is a bad hack. - archive_cmds='$CC -o $lib $libobjs $linkopts `echo "$deplibs" | sed -e '\''s/ -lc$//'\''` -link -dll~linknames=' - # The linker will automatically build a .lib file if we build a DLL. - old_archive_from_new_cmds='true' - # FIXME: Should let the user specify the lib program. - old_archive_cmds='lib /OUT:$oldlib$oldobjs' - fix_srcfile_path='`cygpath -w $srcfile`' - ;; - - freebsd1*) - ld_shlibs=no - can_build_shared=no - ;; - - # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor - # support. Future versions do this automatically, but an explicit c++rt0.o - # does not break anything, and helps significantly (at the cost of a little - # extra space). - freebsd2.2*) - archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linkopts /usr/lib/c++rt0.o' - hardcode_libdir_flag_spec='-R$libdir' - hardcode_direct=yes - hardcode_minus_L=no # verified on 2.2.6 - hardcode_shlibpath_var=no - ;; - - # Unfortunately, older versions of FreeBSD 2 do not have this feature. - freebsd2*) - archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linkopts' - hardcode_direct=yes - hardcode_minus_L=yes - hardcode_shlibpath_var=no - ;; - - # FreeBSD 3 and greater uses gcc -shared to do shared libraries. - freebsd*) - archive_cmds='$CC -shared -o $lib $libobjs $deplibs $linkopts' - hardcode_libdir_flag_spec='-R$libdir' - hardcode_direct=yes - hardcode_minus_L=no - hardcode_shlibpath_var=no - ;; - - hpux9*) - archive_cmds='$rm $objdir/$soname~$LD -b +s +b $install_libdir -o $objdir/$soname $libobjs $deplibs $linkopts~test $objdir/$soname = $lib || mv $objdir/$soname $lib' - hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' - hardcode_direct=yes - hardcode_minus_L=yes - export_dynamic_flag_spec='${wl}-E' - ;; - - hpux10* | hpux11*) - archive_cmds='$LD -b +h $soname +s +b $install_libdir -o $lib $libobjs $deplibs $linkopts' - hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' - hardcode_direct=yes - hardcode_minus_L=yes - export_dynamic_flag_spec='${wl}-E' - ;; - - irix5* | irix6*) - if test "$with_gcc" = yes; then - archive_cmds='$CC -shared $libobjs $deplibs $linkopts ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib' - else - archive_cmds='$LD -shared $libobjs $deplibs $linkopts -soname $soname `test -n "$verstring" && echo -set_version $verstring` -o $lib' - fi - hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator=: - ;; - - netbsd*) - if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then - archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linkopts' # a.out - else - archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linkopts' # ELF - fi - hardcode_libdir_flag_spec='${wl}-R$libdir' - hardcode_direct=yes - hardcode_shlibpath_var=no - ;; - - openbsd*) - archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linkopts' - hardcode_libdir_flag_spec='-R$libdir' - hardcode_direct=yes - hardcode_shlibpath_var=no - ;; - - os2*) - hardcode_libdir_flag_spec='-L$libdir' - hardcode_minus_L=yes - allow_undefined_flag=unsupported - archive_cmds='$echo "LIBRARY $libname INITINSTANCE" > $objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $objdir/$libname.def~$echo DATA >> $objdir/$libname.def~$echo " SINGLE NONSHARED" >> $objdir/$libname.def~$echo EXPORTS >> $objdir/$libname.def~emxexp $libobjs >> $objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $linkopts $objdir/$libname.def' - old_archive_from_new_cmds='emximp -o $objdir/$libname.a $objdir/$libname.def' - ;; - - osf3* | osf4*) - if test "$with_gcc" = yes; then - allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' - archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $linkopts ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib' - else - allow_undefined_flag=' -expect_unresolved \*' - archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linkopts -soname $soname `test -n "$verstring" && echo -set_version $verstring` -o $lib' - fi - hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator=: - ;; - - sco3.2v5*) - archive_cmds='$LD -G -o $lib $libobjs $deplibs $linkopts' - hardcode_direct=yes - ;; - - solaris*) - no_undefined_flag=' -z text' - # $CC -shared without GNU ld will not create a library from C++ - # object files and a static libstdc++, better avoid it by now - archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linkopts' - archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ - $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linkopts~$rm $lib.exp' - hardcode_libdir_flag_spec='-R$libdir' - hardcode_shlibpath_var=no - ;; - - sunos4*) - # Why do we need -Bstatic? To avoid inter-library dependencies, maybe... - if test "$with_gcc" = yes; then - # Use -fPIC here because libgcc is multilibbed - archive_cmds='$CC -shared ${wl}-Bstatic -fPIC -o $lib $libobjs $deplibs $linkopts' - else - archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linkopts' - fi - hardcode_libdir_flag_spec='-L$libdir' - hardcode_direct=yes - hardcode_minus_L=yes - hardcode_shlibpath_var=no - ;; - - sysv4.3*) - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts' - hardcode_direct=no - hardcode_minus_L=no - hardcode_shlibpath_var=no - export_dynamic_flag_spec='-Bexport' - ;; - - uts4*) - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts' - hardcode_libdir_flag_spec='-L$libdir' - hardcode_direct=no - hardcode_minus_L=no - hardcode_shlibpath_var=no - ;; - - dgux*) - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts' - hardcode_libdir_flag_spec='-L$libdir' - hardcode_direct=no - hardcode_minus_L=no - hardcode_shlibpath_var=no - ;; - - *) - ld_shlibs=no - can_build_shared=no - ;; - esac -fi -echo "$ac_t$ld_shlibs" 1>&6 - -if test -z "$NM"; then - echo $ac_n "checking for BSD-compatible nm... $ac_c" 1>&6 - case "$NM" in - /* | [A-Za-z]:[/\\]*) ;; # Let the user override the test with a path. - *) - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}" - for ac_dir in $PATH /usr/ucb /usr/ccs/bin /bin; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/nm; then - # Check to see if the nm accepts a BSD-compat flag. - # Adding the `sed 1q' prevents false positives on HP-UX, which says: - # nm: unknown option "B" ignored - if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then - NM="$ac_dir/nm -B" - break - elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then - NM="$ac_dir/nm -p" - break - else - NM=${NM="$ac_dir/nm"} # keep the first match, but - continue # so that we can try to find one that supports BSD flags - fi - fi - done - IFS="$ac_save_ifs" - test -z "$NM" && NM=nm - ;; - esac - echo "$ac_t$NM" 1>&6 -fi - -# Check for command to grab the raw symbol name followed by C symbol from nm. -echo $ac_n "checking command to parse $NM output... $ac_c" 1>&6 - -# These are sane defaults that work on at least a few old systems. -# [They come from Ultrix. What could be older than Ultrix?!! ;)] - -# Character class describing NM global symbol codes. -symcode='[BCDEGRST]' - -# Regexp to match symbols that can be accessed directly from C. -sympat='\([_A-Za-z][_A-Za-z0-9]*\)' - -# Transform the above into a raw symbol and a C symbol. -symxfrm='\1 \2\3 \3' - -# Transform an extracted symbol line into a proper C declaration -global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern char \1;/p'" - -# Define system-specific variables. -case "$host_os" in -aix*) - symcode='[BCDT]' - ;; -cygwin* | mingw*) - symcode='[ABCDGISTW]' - ;; -hpux*) # Its linker distinguishes data from code symbols - global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern char \1();/p' -e 's/^. .* \(.*\)$/extern char \1;/p'" - ;; -irix*) - symcode='[BCDEGRST]' - ;; -solaris*) - symcode='[BDT]' - ;; -esac - -# If we're using GNU nm, then use its standard symbol codes. -if $NM -V 2>&1 | egrep '(GNU|with BFD)' > /dev/null; then - symcode='[ABCDGISTW]' -fi - -# Try without a prefix undercore, then with it. -for ac_symprfx in "" "_"; do - - # Write the raw and C identifiers. - global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode\)[ ][ ]*\($ac_symprfx\)$sympat$/$symxfrm/p'" - - # Check to see that the pipe works correctly. - pipe_works=no - $rm conftest* - cat > conftest.c <&5 - if { (eval echo $progname:1448: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; } && test -s conftest.$objext; then - # Now try to grab the symbols. - nlist=conftest.nm - if { echo "$progname:1451: eval \"$NM conftest.$objext | $global_symbol_pipe > $nlist\"" >&5; eval "$NM conftest.$objext | $global_symbol_pipe > $nlist 2>&5"; } && test -s "$nlist"; then - - # Try sorting and uniquifying the output. - if sort "$nlist" | uniq > "$nlist"T; then - mv -f "$nlist"T "$nlist" - else - rm -f "$nlist"T - fi - - # Make sure that we snagged all the symbols we need. - if egrep ' nm_test_var$' "$nlist" >/dev/null; then - if egrep ' nm_test_func$' "$nlist" >/dev/null; then - cat < conftest.c -#ifdef __cplusplus -extern "C" { -#endif - -EOF - # Now generate the symbol file. - eval "$global_symbol_to_cdecl"' < "$nlist" >> conftest.c' - - cat <> conftest.c -#if defined (__STDC__) && __STDC__ -# define lt_ptr_t void * -#else -# define lt_ptr_t char * -# define const -#endif - -/* The mapping between symbol names and symbols. */ -const struct { - const char *name; - lt_ptr_t address; -} -lt_preloaded_symbols[] = -{ -EOF - sed 's/^. \(.*\) \(.*\)$/ {"\2", (lt_ptr_t) \&\2},/' < "$nlist" >> conftest.c - cat <<\EOF >> conftest.c - {0, (lt_ptr_t) 0} -}; - -#ifdef __cplusplus -} -#endif -EOF - # Now try linking the two files. - mv conftest.$objext conftestm.$objext - save_LIBS="$LIBS" - save_CFLAGS="$CFLAGS" - LIBS="conftestm.$objext" - CFLAGS="$CFLAGS$no_builtin_flag" - if { (eval echo $progname:1503: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then - pipe_works=yes - else - echo "$progname: failed program was:" >&5 - cat conftest.c >&5 - fi - LIBS="$save_LIBS" - else - echo "cannot find nm_test_func in $nlist" >&5 - fi - else - echo "cannot find nm_test_var in $nlist" >&5 - fi - else - echo "cannot run $global_symbol_pipe" >&5 - fi - else - echo "$progname: failed program was:" >&5 - cat conftest.c >&5 - fi - $rm conftest* - - # Do not use the global_symbol_pipe unless it works. - if test "$pipe_works" = yes; then - break - else - global_symbol_pipe= - fi -done -echo "$ac_t$pipe_works" 1>&6 - -if test -z "$global_symbol_pipe"; then - global_symbol_to_cdecl= -fi - -# Check hardcoding attributes. -echo $ac_n "checking how to hardcode library paths into programs... $ac_c" 1>&6 -hardcode_action= -if test -n "$hardcode_libdir_flag_spec" || \ - test -n "$runpath_var"; then - - # We can hardcode non-existant directories. - if test "$hardcode_direct" != no && \ - test "$hardcode_minus_L" != no && \ - test "$hardcode_shlibpath_var" != no; then - - # Linking always hardcodes the temporary library directory. - hardcode_action=relink - else - # We can link without hardcoding, and we can hardcode nonexisting dirs. - hardcode_action=immediate - fi -else - # We cannot hardcode anything, or else we can only hardcode existing - # directories. - hardcode_action=unsupported -fi -echo "$ac_t$hardcode_action" 1>&6 - - -reload_flag= -reload_cmds='$LD$reload_flag -o $output$reload_objs' -echo $ac_n "checking for $LD option to reload object files... $ac_c" 1>&6 -# PORTME Some linkers may need a different reload flag. -reload_flag='-r' -echo "$ac_t$reload_flag" 1>&6 -test -n "$reload_flag" && reload_flag=" $reload_flag" - -# PORTME Fill in your ld.so characteristics -library_names_spec= -libname_spec='lib$name' -soname_spec= -postinstall_cmds= -postuninstall_cmds= -finish_cmds= -finish_eval= -shlibpath_var= -shlibpath_overrides_runpath=unknown -version_type=none -dynamic_linker="$host_os ld.so" -sys_lib_dlsearch_path_spec="/lib /usr/lib" -sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" -file_magic_cmd= -file_magic_test_file= -deplibs_check_method='unknown' -# Need to set the preceding variable on all platforms that support -# interlibrary dependencies. -# 'none' -- dependencies not supported. -# `unknown' -- same as none, but documents that we really don't know. -# 'pass_all' -- all dependencies passed with no checks. -# 'test_compile' -- check by making test program. -# 'file_magic [regex]' -- check by looking for files in library path -# which responds to the $file_magic_cmd with a given egrep regex. -# If you have `file' or equivalent on your system and you're not sure -# whether `pass_all' will *always* work, you probably want this one. -echo $ac_n "checking dynamic linker characteristics... $ac_c" 1>&6 -case "$host_os" in -aix3*) - version_type=linux - library_names_spec='${libname}${release}.so$versuffix $libname.a' - shlibpath_var=LIBPATH - - # AIX has no versioning support, so we append a major version to the name. - soname_spec='${libname}${release}.so$major' - ;; - -aix4*) - version_type=linux - # AIX has no versioning support, so currently we can not hardcode correct - # soname into executable. Probably we can add versioning support to - # collect2, so additional links can be useful in future. - # We preserve .a as extension for shared libraries though AIX4.2 - # and later linker supports .so - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.a' - shlibpath_var=LIBPATH - deplibs_check_method=pass_all - ;; - -amigaos*) - library_names_spec='$libname.ixlibrary $libname.a' - # Create ${libname}_ixlibrary.a entries in /sys/libs. - finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "(cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a)"; (cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a) || exit 1; done' - ;; - -beos*) - library_names_spec='${libname}.so' - dynamic_linker="$host_os ld.so" - shlibpath_var=LIBRARY_PATH - ;; - -bsdi4*) - version_type=linux - library_names_spec='${libname}.so$major ${libname}.so' - soname_spec='${libname}.so' - finish_cmds='PATH="$PATH:/sbin" ldconfig $libdir' - shlibpath_var=LD_LIBRARY_PATH - deplibs_check_method='file_magic ELF 32-bit LSB shared object' - file_magic_cmd=/usr/bin/file - file_magic_test_file=/shlib/libc.so - sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" - sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" - # the default ld.so.conf also contains /usr/contrib/lib and - # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow - # libtool to hard-code these into programs - ;; - -cygwin* | mingw*) - version_type=windows - if test "$with_gcc" = yes; then - library_names_spec='${libname}`echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll $libname.a' - else - library_names_spec='${libname}`echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll $libname.lib' - fi - dynamic_linker='Win32 ld.exe' - deplibs_check_method='file_magic file format pei*-i386.*architecture: i386' - file_magic_cmd='objdump -f' - need_lib_prefix=no - # FIXME: first we should search . and the directory the executable is in - shlibpath_var=PATH - ;; - -freebsd1*) - dynamic_linker=no - ;; - -freebsd*) - objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout` - version_type=freebsd-$objformat - case "$version_type" in - freebsd-elf*) - deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB shared object' - file_magic_cmd=/usr/bin/file - file_magic_test_file=`echo /usr/lib/libc.so*` - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so' - need_version=no - need_lib_prefix=no - ;; - freebsd-*) - deplibs_check_method=unknown - library_names_spec='${libname}${release}.so$versuffix $libname.so$versuffix' - need_version=yes - ;; - esac - finish_cmds='PATH="$PATH:/sbin" OBJFORMAT="'"$objformat"'" ldconfig -m $libdir' - shlibpath_var=LD_LIBRARY_PATH - ;; - -gnu*) - version_type=linux - library_names_spec='${libname}${release}.so$versuffix ${libname}.so' - shlibpath_var=LD_LIBRARY_PATH - ;; - -hpux9* | hpux10* | hpux11*) - # Give a soname corresponding to the major version so that dld.sl refuses to - # link against other versions. - dynamic_linker="$host_os dld.sl" - version_type=sunos - need_lib_prefix=no - need_version=no - shlibpath_var=SHLIB_PATH - library_names_spec='${libname}${release}.sl$versuffix ${libname}${release}.sl$major $libname.sl' - soname_spec='${libname}${release}.sl$major' - # HP-UX runs *really* slowly unless shared libraries are mode 555. - postinstall_cmds='chmod 555 $lib' - ;; - -irix5*) - version_type=irix - soname_spec='${libname}${release}.so' - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so' - shlibpath_var=LD_LIBRARY_PATH - deplibs_check_method="file_magic ELF 32-bit MSB dynamic lib MIPS - version 1" # or should it be pass_all? - file_magic_cmd=/usr/bin/file - file_magic_test_file=`echo /lib/libc.so*` - shlibpath_overrides_runpath=no - ;; - -irix6*) - version_type=irix - need_lib_prefix=no - need_version=no - soname_spec='${libname}${release}.so' - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so' - case "$LD" in # libtool.m4 will add one of these switches to LD - *-32|*"-32 ") libsuff= shlibsuff= libmagic=32-bit;; - *-n32|*"-n32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; - *-64|*"-64 ") libsuff=64 shlibsuff=64 libmagic=64-bit;; - *) libsuff= shlibsuff= libmagic=never-match;; - esac - shlibpath_var=LD_LIBRARY${shlibsuff}_PATH - shlibpath_overrides_runpath=no - # even though /usr/local/lib is always searched, the man-page says - # shared libraries should not be installed there if they use an ABI - # different from -32, so we'd better not search for shared libraries - # there either - sys_lib_search_path_spec="/lib${libsuff} /usr/lib${libsuff} /usr/local/lib${libsuff}" - sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff} /usr/local/lib${libsuff}" - deplibs_check_method="file_magic ELF ${libmagic} MSB mips-[1234] dynamic lib MIPS - version 1" # or should it be pass_all? - file_magic_cmd=/usr/bin/file - file_magic_test_file=`echo /lib${libsuff}/libc.so*` - ;; - -# No shared lib support for Linux oldld, aout, or coff. -linux-gnuoldld* | linux-gnuaout* | linux-gnucoff*) - dynamic_linker=no - ;; - -# This must be Linux ELF. -linux-gnu*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' - soname_spec='${libname}${release}.so$major' - finish_cmds='PATH="$PATH:/sbin" ldconfig -n $libdir' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' - file_magic_cmd=/usr/bin/file - file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so` - - if test -f /lib/ld.so.1; then - dynamic_linker='GNU ld.so' - else - # Only the GNU ld.so supports shared libraries on MkLinux. - case "$host_cpu" in - powerpc*) dynamic_linker=no ;; - *) dynamic_linker='Linux ld.so' ;; - esac - fi - ;; - -netbsd*) - version_type=sunos - if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then - library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix' - finish_cmds='PATH="$PATH:/sbin" ldconfig -m $libdir' - dynamic_linker='NetBSD (a.out) ld.so' - else - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major ${libname}${release}.so ${libname}.so' - soname_spec='${libname}${release}.so$major' - dynamic_linker='NetBSD ld.elf_so' - fi - shlibpath_var=LD_LIBRARY_PATH - ;; - -openbsd*) - version_type=sunos - if test "$with_gnu_ld" = yes; then - need_lib_prefix=no - need_version=no - fi - library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' - shlibpath_var=LD_LIBRARY_PATH - ;; - -os2*) - libname_spec='$name' - need_lib_prefix=no - library_names_spec='$libname.dll $libname.a' - dynamic_linker='OS/2 ld.exe' - shlibpath_var=LIBPATH - ;; - -osf3* | osf4*) - version_type=osf - soname_spec='${libname}${release}.so' - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so' - shlibpath_var=LD_LIBRARY_PATH - # deplibs_check_method='pass_all' - # Although pass_all appears to work, it copies symbols from static libraries - # into shared ones and exports them. So, when a program is linked with two - # or more libraries that have got copies of the same symbols, link fails - # This was only tested on osf4: - deplibs_check_method='file_magic COFF format alpha shared library' - file_magic_cmd=/usr/bin/file - file_magic_test_file=/shlib/libc.so - sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" - sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" - ;; - -sco3.2v5*) - version_type=osf - soname_spec='${libname}${release}.so$major' - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' - shlibpath_var=LD_LIBRARY_PATH - ;; - -solaris*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' - soname_spec='${libname}${release}.so$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - # ldd complains unless libraries are executable - postinstall_cmds='chmod +x $lib' - deplibs_check_method="file_magic ELF [0-9][0-9]-bit [LM]SB dynamic lib" - file_magic_cmd=/usr/bin/file - file_magic_test_file=/lib/libc.so - ;; - -sunos4*) - version_type=sunos - library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix' - finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - if test "$with_gnu_ld" = yes; then - need_lib_prefix=no - fi - need_version=yes - ;; - -sysv4.2uw2* | sysv4.3* | sysv5*) - version_type=linux - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' - soname_spec='${libname}${release}.so$major' - shlibpath_var=LD_LIBRARY_PATH - case "$host_vendor" in - ncr) - deplibs_check_method='pass_all' - ;; - esac - ;; - -uts4*) - version_type=linux - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' - soname_spec='${libname}${release}.so$major' - shlibpath_var=LD_LIBRARY_PATH - ;; - -dgux*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' - soname_spec='${libname}${release}.so$major' - shlibpath_var=LD_LIBRARY_PATH - ;; - -*) - dynamic_linker=no - ;; -esac -echo "$ac_t$dynamic_linker" 1>&6 -test "$dynamic_linker" = no && can_build_shared=no - -# Report the final consequences. -echo "checking if libtool supports shared libraries... $can_build_shared" 1>&6 - -if test -n "$file_magic_test_file" && test -n "$file_magic_cmd"; then - case "$deplibs_check_method" in - "file_magic "*) - file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`" - if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | - egrep "$file_magic_regex" > /dev/null; then - : - else - cat <&2 - -*** Warning: the command libtool uses to detect shared libraries, -*** $file_magic_cmd, produces output that libtool cannot recognize. -*** The result is that libtool may fail to recognize shared libraries -*** as such. This will affect the creation of libtool libraries that -*** depend on shared libraries, but programs linked with such libtool -*** libraries will work regardless of this problem. Nevertheless, you -*** may want to report the problem to your system manager and/or to -*** bug-libtool@gnu.org - -EOF - fi ;; - esac -fi - -echo $ac_n "checking whether to build shared libraries... $ac_c" 1>&6 -test "$can_build_shared" = "no" && enable_shared=no - -# On AIX, shared libraries and static libraries use the same namespace, and -# are all built from PIC. -case "$host_os" in -aix3*) - test "$enable_shared" = yes && enable_static=no - if test -n "$RANLIB"; then - archive_cmds="$archive_cmds~\$RANLIB \$lib" - postinstall_cmds='$RANLIB $lib' - fi - ;; - -aix4*) - test "$enable_shared" = yes && enable_static=no - ;; -esac - -echo "$ac_t$enable_shared" 1>&6 - -# Make sure either enable_shared or enable_static is yes. -test "$enable_shared" = yes || enable_static=yes - -echo "checking whether to build static libraries... $enable_static" 1>&6 - -if test "$hardcode_action" = relink; then - # Fast installation is not supported - enable_fast_install=no -elif test "$shlibpath_overrides_runpath" = yes || - test "$enable_shared" = no; then - # Fast installation is not necessary - enable_fast_install=needless -fi - -echo $ac_n "checking for objdir... $ac_c" 1>&6 -rm -f .libs 2>/dev/null -mkdir .libs 2>/dev/null -if test -d .libs; then - objdir=.libs -else - # MS-DOS does not allow filenames that begin with a dot. - objdir=_libs -fi -rmdir .libs 2>/dev/null -echo "$ac_t$objdir" 1>&6 - -if test "x$enable_dlopen" != xyes; then - enable_dlopen=unknown - enable_dlopen_self=unknown - enable_dlopen_self_static=unknown -else -if eval "test \"`echo '$''{'lt_cv_dlopen'+set}'`\" != set"; then - lt_cv_dlopen=no lt_cv_dlopen_libs= -echo $ac_n "checking for dlopen""... $ac_c" 1>&6 -echo "$progname:1977: checking for dlopen" >&5 -if eval "test \"`echo '$''{'ac_cv_func_dlopen'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext < -/* Override any gcc2 internal prototype to avoid an error. */ -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char dlopen(); - -int main() { - -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_dlopen) || defined (__stub___dlopen) -choke me -#else -dlopen(); -#endif - -; return 0; } -EOF -if { (eval echo $progname:2004: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_func_dlopen=yes" -else - echo "$progname: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_func_dlopen=no" -fi -rm -f conftest* -fi - -if eval "test \"`echo '$ac_cv_func_'dlopen`\" = yes"; then - echo "$ac_t""yes" 1>&6 - lt_cv_dlopen="dlopen" -else - echo "$ac_t""no" 1>&6 -echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6 -echo "$progname:2022: checking for dlopen in -ldl" >&5 -ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - ac_save_LIBS="$LIBS" -LIBS="-ldl $LIBS" -cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" -else - echo "$progname: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=no" -fi -rm -f conftest* -LIBS="$ac_save_LIBS" - -fi -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then - echo "$ac_t""yes" 1>&6 - lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" -else - echo "$ac_t""no" 1>&6 -echo $ac_n "checking for dld_link in -ldld""... $ac_c" 1>&6 -echo "$progname:2059: checking for dld_link in -ldld" >&5 -ac_lib_var=`echo dld'_'dld_link | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - ac_save_LIBS="$LIBS" -LIBS="-ldld $LIBS" -cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" -else - echo "$progname: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=no" -fi -rm -f conftest* -LIBS="$ac_save_LIBS" - -fi -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then - echo "$ac_t""yes" 1>&6 - lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld" -else - echo "$ac_t""no" 1>&6 -echo $ac_n "checking for shl_load""... $ac_c" 1>&6 -echo "$progname:2096: checking for shl_load" >&5 -if eval "test \"`echo '$''{'ac_cv_func_shl_load'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext < -/* Override any gcc2 internal prototype to avoid an error. */ -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char shl_load(); - -int main() { - -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_shl_load) || defined (__stub___shl_load) -choke me -#else -shl_load(); -#endif - -; return 0; } -EOF -if { (eval echo $progname:2123: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_func_shl_load=yes" -else - echo "$progname: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_func_shl_load=no" -fi -rm -f conftest* -fi - -if eval "test \"`echo '$ac_cv_func_'shl_load`\" = yes"; then - echo "$ac_t""yes" 1>&6 - lt_cv_dlopen="shl_load" -else - echo "$ac_t""no" 1>&6 -echo $ac_n "checking for LoadLibrary""... $ac_c" 1>&6 -echo "$progname:2141: checking for LoadLibrary" >&5 -if eval "test \"`echo '$''{'ac_cv_func_LoadLibrary'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext < -/* Override any gcc2 internal prototype to avoid an error. */ -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char LoadLibrary(); - -int main() { - -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_LoadLibrary) || defined (__stub___LoadLibrary) -choke me -#else -LoadLibrary(); -#endif - -; return 0; } -EOF -if { (eval echo $progname:2168: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_func_LoadLibrary=yes" -else - echo "$progname: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_func_LoadLibrary=no" -fi -rm -f conftest* -fi - -if eval "test \"`echo '$ac_cv_func_'LoadLibrary`\" = yes"; then - echo "$ac_t""yes" 1>&6 - lt_cv_dlopen="LoadLibrary" -else - echo "$ac_t""no" 1>&6 -fi - - -fi - - -fi - - -fi - - -fi - -fi - - if test "x$lt_cv_dlopen" != xno; then - enable_dlopen=yes - fi - - case "$lt_cv_dlopen" in - dlopen) -for ac_hdr in dlfcn.h; do -ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` -echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "$progname:2210: checking for $ac_hdr" >&5 -if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext < -int fnord = 0; -EOF -ac_try="$ac_compile conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo $progname:2220: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` -if test -z "$ac_err"; then - rm -rf conftest* - eval "ac_cv_header_$ac_safe=yes" -else - echo "$ac_err" >&5 - echo "$progname: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_header_$ac_safe=no" -fi -rm -f conftest* -fi -if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then - echo "$ac_t""yes" 1>&6 -else - echo "$ac_t""no" 1>&6 -fi -done - - if test "x$ac_cv_header_dlfcn_h" = xyes; then - CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" - fi - eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" - LIBS="$lt_cv_dlopen_libs $LIBS" - - echo $ac_n "checking whether a program can dlopen itself""... $ac_c" 1>&6 -echo "$progname:2248: checking whether a program can dlopen itself" >&5 -if test "${lt_cv_dlopen_self+set}" = set; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - if test "$cross_compiling" = yes; then - lt_cv_dlopen_self=cross - else - cat > conftest.c < -#endif - -#include - -#ifdef RTLD_GLOBAL -# define LTDL_GLOBAL RTLD_GLOBAL -#else -# ifdef DL_GLOBAL -# define LTDL_GLOBAL DL_GLOBAL -# else -# define LTDL_GLOBAL 0 -# endif -#endif - -/* We may have to define LTDL_LAZY_OR_NOW in the command line if we - find out it does not work in some platform. */ -#ifndef LTDL_LAZY_OR_NOW -# ifdef RTLD_LAZY -# define LTDL_LAZY_OR_NOW RTLD_LAZY -# else -# ifdef DL_LAZY -# define LTDL_LAZY_OR_NOW DL_LAZY -# else -# ifdef RTLD_NOW -# define LTDL_LAZY_OR_NOW RTLD_NOW -# else -# ifdef DL_NOW -# define LTDL_LAZY_OR_NOW DL_NOW -# else -# define LTDL_LAZY_OR_NOW 0 -# endif -# endif -# endif -# endif -#endif - -fnord() { int i=42;} -main() { void *self, *ptr1, *ptr2; self=dlopen(0,LTDL_GLOBAL|LTDL_LAZY_OR_NOW); - if(self) { ptr1=dlsym(self,"fnord"); ptr2=dlsym(self,"_fnord"); - if(ptr1 || ptr2) exit(0); } exit(1); } - -EOF -if { (eval echo $progname:2302: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null -then - lt_cv_dlopen_self=yes -else - echo "$progname: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -fr conftest* - lt_cv_dlopen_self=no -fi -rm -fr conftest* -fi - -fi - -echo "$ac_t""$lt_cv_dlopen_self" 1>&6 - - if test "$lt_cv_dlopen_self" = yes; then - LDFLAGS="$LDFLAGS $link_static_flag" - echo $ac_n "checking whether a statically linked program can dlopen itself""... $ac_c" 1>&6 -echo "$progname:2321: checking whether a statically linked program can dlopen itself" >&5 -if test "${lt_cv_dlopen_self_static+set}" = set; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - if test "$cross_compiling" = yes; then - lt_cv_dlopen_self_static=cross - else - cat > conftest.c < -#endif - -#include - -#ifdef RTLD_GLOBAL -# define LTDL_GLOBAL RTLD_GLOBAL -#else -# ifdef DL_GLOBAL -# define LTDL_GLOBAL DL_GLOBAL -# else -# define LTDL_GLOBAL 0 -# endif -#endif - -/* We may have to define LTDL_LAZY_OR_NOW in the command line if we - find out it does not work in some platform. */ -#ifndef LTDL_LAZY_OR_NOW -# ifdef RTLD_LAZY -# define LTDL_LAZY_OR_NOW RTLD_LAZY -# else -# ifdef DL_LAZY -# define LTDL_LAZY_OR_NOW DL_LAZY -# else -# ifdef RTLD_NOW -# define LTDL_LAZY_OR_NOW RTLD_NOW -# else -# ifdef DL_NOW -# define LTDL_LAZY_OR_NOW DL_NOW -# else -# define LTDL_LAZY_OR_NOW 0 -# endif -# endif -# endif -# endif -#endif - -fnord() { int i=42;} -main() { void *self, *ptr1, *ptr2; self=dlopen(0,LTDL_GLOBAL|LTDL_LAZY_OR_NOW); - if(self) { ptr1=dlsym(self,"fnord"); ptr2=dlsym(self,"_fnord"); - if(ptr1 || ptr2) exit(0); } exit(1); } - -EOF -if { (eval echo $progname:2375: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null -then - lt_cv_dlopen_self_static=yes -else - echo "$progname: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -fr conftest* - lt_cv_dlopen_self_static=no -fi -rm -fr conftest* -fi - -fi - -echo "$ac_t""$lt_cv_dlopen_self_static" 1>&6 -fi - ;; - esac - - case "$lt_cv_dlopen_self" in - yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; - *) enable_dlopen_self=unknown ;; - esac - - case "$lt_cv_dlopen_self_static" in - yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; - *) enable_dlopen_self_static=unknown ;; - esac -fi - -# Copy echo and quote the copy, instead of the original, because it is -# used later. -ltecho="$echo" -if test "X$ltecho" = "X$CONFIG_SHELL $0 --fallback-echo"; then - ltecho="$CONFIG_SHELL \$0 --fallback-echo" -fi -LTSHELL="$SHELL" - -LTCONFIG_VERSION="$VERSION" - -# Only quote variables if we're using ltmain.sh. -case "$ltmain" in -*.sh) - # Now quote all the things that may contain metacharacters. - for var in ltecho old_CC old_CFLAGS old_CPPFLAGS old_LD old_NM old_RANLIB \ - old_LN_S old_DLLTOOL old_AS AR CC LD LN_S NM LTSHELL LTCONFIG_VERSION \ - reload_flag reload_cmds wl \ - pic_flag link_static_flag no_builtin_flag export_dynamic_flag_spec \ - thread_safe_flag_spec whole_archive_flag_spec libname_spec \ - library_names_spec soname_spec \ - RANLIB old_archive_cmds old_archive_from_new_cmds old_postinstall_cmds \ - old_postuninstall_cmds archive_cmds archive_expsym_cmds postinstall_cmds postuninstall_cmds \ - file_magic_cmd export_symbols_cmds deplibs_check_method allow_undefined_flag no_undefined_flag \ - finish_cmds finish_eval global_symbol_pipe global_symbol_to_cdecl \ - hardcode_libdir_flag_spec hardcode_libdir_separator \ - sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ - compiler_c_o compiler_o_lo need_locks exclude_expsyms include_expsyms; do - - case "$var" in - reload_cmds | old_archive_cmds | old_archive_from_new_cmds | \ - old_postinstall_cmds | old_postuninstall_cmds | \ - export_symbols_cmds | archive_cmds | archive_expsym_cmds | \ - postinstall_cmds | postuninstall_cmds | \ - finish_cmds | sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) - # Double-quote double-evaled strings. - eval "$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" - ;; - *) - eval "$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" - ;; - esac - done - - case "$ltecho" in - *'\$0 --fallback-echo"') - ltecho=`$echo "X$ltecho" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` - ;; - esac - - trap "$rm \"$ofile\"; exit 1" 1 2 15 - echo "creating $ofile" - $rm "$ofile" - cat < "$ofile" -#! $SHELL - -# `$echo "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. -# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP) -# NOTE: Changes made to this file will be lost: look at ltconfig or ltmain.sh. -# -# Copyright (C) 1996-1999 Free Software Foundation, Inc. -# Gordon Matzigkeit , 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 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -# -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - -# Sed that helps us avoid accidentally triggering echo(1) options like -n. -Xsed="sed -e s/^X//" - -# The HP-UX ksh and POSIX shell print the target directory to stdout -# if CDPATH is set. -if test "\${CDPATH+set}" = set; then CDPATH=; export CDPATH; fi - -### BEGIN LIBTOOL CONFIG -EOF - cfgfile="$ofile" - ;; - -*) - # Double-quote the variables that need it (for aesthetics). - for var in old_CC old_CFLAGS old_CPPFLAGS old_LD old_NM old_RANLIB \ - old_LN_S old_DLLTOOL old_AS; do - eval "$var=\\\"\$var\\\"" - done - - # Just create a config file. - cfgfile="$ofile.cfg" - trap "$rm \"$cfgfile\"; exit 1" 1 2 15 - echo "creating $cfgfile" - $rm "$cfgfile" - cat < "$cfgfile" -# `$echo "$cfgfile" | sed 's%^.*/%%'` - Libtool configuration file. -# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP) -EOF - ;; -esac - -cat <> "$cfgfile" -# Libtool was configured as follows, on host `(hostname || uname -n) 2>/dev/null | sed 1q`: -# -# CC=$old_CC CFLAGS=$old_CFLAGS CPPFLAGS=$old_CPPFLAGS \\ -# LD=$old_LD NM=$old_NM RANLIB=$old_RANLIB LN_S=$old_LN_S \\ -# DLLTOOL="$old_DLLTOOL" AS="$old_AS" \\ -# $0$ltconfig_args -# -# Compiler and other test output produced by $progname, useful for -# debugging $progname, is in ./config.log if it exists. - -# The version of $progname that generated this script. -LTCONFIG_VERSION=$LTCONFIG_VERSION - -# Shell to use when invoking shell scripts. -SHELL=$LTSHELL - -# Whether or not to build shared libraries. -build_libtool_libs=$enable_shared - -# Whether or not to build static libraries. -build_old_libs=$enable_static - -# Whether or not to optimize for fast installation. -fast_install=$enable_fast_install - -# The host system. -host_alias=$host_alias -host=$host - -# An echo program that does not interpret backslashes. -echo=$ltecho - -# The archiver. -AR=$AR - -# The default C compiler. -CC=$CC - -# The linker used to build libraries. -LD=$LD - -# Whether we need hard or soft links. -LN_S=$LN_S - -# A BSD-compatible nm program. -NM=$NM - -# Used on cygwin: DLL creation program. -DLLTOOL="$DLLTOOL" - -# Used on cygwin: assembler. -AS="$AS" - -# The name of the directory that contains temporary libtool files. -objdir=$objdir - -# How to create reloadable object files. -reload_flag=$reload_flag -reload_cmds=$reload_cmds - -# How to pass a linker flag through the compiler. -wl=$wl - -# Object file suffix (normally "o"). -objext="$objext" - -# Old archive suffix (normally "a"). -libext="$libext" - -# Additional compiler flags for building library objects. -pic_flag=$pic_flag - -# Does compiler simultaneously support -c and -o options -compiler_c_o=$compiler_c_o - -# Can we write directly to a .lo ? -compiler_o_lo=$compiler_o_lo - -# Must we lock files when doing compilation ? -need_locks=$need_locks - -# Do we need the lib prefix for modules? -need_lib_prefix=$need_lib_prefix - -# Do we need a version for libraries? -need_version=$need_version - -# Whether dlopen is supported. -dlopen=$enable_dlopen - -# Whether dlopen of programs is supported. -dlopen_self=$enable_dlopen_self - -# Whether dlopen of statically linked programs is supported. -dlopen_self_static=$enable_dlopen_self_static - -# Compiler flag to prevent dynamic linking. -link_static_flag=$link_static_flag - -# Compiler flag to turn off builtin functions. -no_builtin_flag=$no_builtin_flag - -# Compiler flag to allow reflexive dlopens. -export_dynamic_flag_spec=$export_dynamic_flag_spec - -# Compiler flag to generate shared objects directly from archives. -whole_archive_flag_spec=$whole_archive_flag_spec - -# Compiler flag to generate thread-safe objects. -thread_safe_flag_spec=$thread_safe_flag_spec - -# Library versioning type. -version_type=$version_type - -# Format of library name prefix. -libname_spec=$libname_spec - -# List of archive names. First name is the real one, the rest are links. -# The last name is the one that the linker finds with -lNAME. -library_names_spec=$library_names_spec - -# The coded name of the library, if different from the real name. -soname_spec=$soname_spec - -# Commands used to build and install an old-style archive. -RANLIB=$RANLIB -old_archive_cmds=$old_archive_cmds -old_postinstall_cmds=$old_postinstall_cmds -old_postuninstall_cmds=$old_postuninstall_cmds - -# Create an old-style archive from a shared archive. -old_archive_from_new_cmds=$old_archive_from_new_cmds - -# Commands used to build and install a shared archive. -archive_cmds=$archive_cmds -archive_expsym_cmds=$archive_expsym_cmds -postinstall_cmds=$postinstall_cmds -postuninstall_cmds=$postuninstall_cmds - -# Method to check whether dependent libraries are shared objects. -deplibs_check_method=$deplibs_check_method - -# Command to use when deplibs_check_method == file_magic -file_magic_cmd=$file_magic_cmd - -# Flag that allows shared libraries with undefined symbols to be built. -allow_undefined_flag=$allow_undefined_flag - -# Flag that forces no undefined symbols. -no_undefined_flag=$no_undefined_flag - -# Commands used to finish a libtool library installation in a directory. -finish_cmds=$finish_cmds - -# Same as above, but a single script fragment to be evaled but not shown. -finish_eval=$finish_eval - -# Take the output of nm and produce a listing of raw symbols and C names. -global_symbol_pipe=$global_symbol_pipe - -# Transform the output of nm in a proper C declaration -global_symbol_to_cdecl=$global_symbol_to_cdecl - -# This is the shared library runtime path variable. -runpath_var=$runpath_var - -# This is the shared library path variable. -shlibpath_var=$shlibpath_var - -# Is shlibpath searched before the hard-coded library search path? -shlibpath_overrides_runpath=$shlibpath_overrides_runpath - -# How to hardcode a shared library path into an executable. -hardcode_action=$hardcode_action - -# Flag to hardcode \$libdir into a binary during linking. -# This must work even if \$libdir does not exist. -hardcode_libdir_flag_spec=$hardcode_libdir_flag_spec - -# Whether we need a single -rpath flag with a separated argument. -hardcode_libdir_separator=$hardcode_libdir_separator - -# Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the -# resulting binary. -hardcode_direct=$hardcode_direct - -# Set to yes if using the -LDIR flag during linking hardcodes DIR into the -# resulting binary. -hardcode_minus_L=$hardcode_minus_L - -# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into -# the resulting binary. -hardcode_shlibpath_var=$hardcode_shlibpath_var - -# Compile-time system search path for libraries -sys_lib_search_path_spec=$sys_lib_search_path_spec - -# Run-time system search path for libraries -sys_lib_dlsearch_path_spec=$sys_lib_dlsearch_path_spec - -# Fix the shell variable \$srcfile for the compiler. -fix_srcfile_path="$fix_srcfile_path" - -# Set to yes if exported symbols are required -always_export_symbols=$always_export_symbols - -# The command to extract exported symbols -export_symbols_cmds=$export_symbols_cmds - -# Symbols that should not be listed in the preloaded symbols -exclude_expsyms=$exclude_expsyms - -# Symbols that must always be exported -include_expsyms=$include_expsyms - -EOF - -case "$ltmain" in -*.sh) - echo '### END LIBTOOL CONFIG' >> "$ofile" - echo >> "$ofile" - case "$host_os" in - aix3*) - cat <<\EOF >> "$ofile" - -# AIX sometimes has problems with the GCC collect2 program. For some -# reason, if we set the COLLECT_NAMES environment variable, the problems -# vanish in a puff of smoke. -if test "${COLLECT_NAMES+set}" != set; then - COLLECT_NAMES= - export COLLECT_NAMES -fi -EOF - ;; - esac - - # Append the ltmain.sh script. - cat "$ltmain" >> "$ofile" || (rm -f "$ofile"; exit 1) - - chmod +x "$ofile" - ;; - -*) - # Compile the libtool program. - echo "FIXME: would compile $ltmain" - ;; -esac - -test -n "$cache_file" || exit 0 - -# AC_CACHE_SAVE -trap '' 1 2 15 -cat > confcache <<\EOF -# 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. It is not useful on other systems. -# If it contains results you don't want to keep, you may remove or edit it. -# -# By default, configure uses ./config.cache as the cache file, -# creating it if it does not exist already. You can give configure -# the --cache-file=FILE option to use a different cache file; that is -# what configure does when it calls configure scripts in -# subdirectories, so they share the cache. -# Giving --cache-file=/dev/null disables caching, for debugging configure. -# config.status only pays attention to the cache file if you give it the -# --recheck option to rerun configure. -# -EOF -# The following way of writing the cache mishandles newlines in values, -# but we know of no workaround that is simple, portable, and efficient. -# So, don't put newlines in cache variables' values. -# 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. -(set) 2>&1 | - case `(ac_space=' '; set | grep ac_space) 2>&1` in - *ac_space=\ *) - # `set' does not quote correctly, so add quotes (double-quote substitution - # turns \\\\ into \\, and sed turns \\ into \). - sed -n \ - -e "s/'/'\\\\''/g" \ - -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p" - ;; - *) - # `set' quotes correctly as required by POSIX, so do not add quotes. - sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p' - ;; - esac >> confcache -if cmp -s $cache_file confcache; then - : -else - if test -w $cache_file; then - echo "updating cache $cache_file" - cat confcache > $cache_file - else - echo "not updating unwritable cache $cache_file" - fi -fi -rm -f confcache - -exit 0 - -# Local Variables: -# mode:shell-script -# sh-indentation:2 -# End: diff --git a/acsupport/ltmain.sh b/acsupport/ltmain.sh deleted file mode 100644 --- a/acsupport/ltmain.sh +++ /dev/null @@ -1,3779 +0,0 @@ -# ltmain.sh - Provide generalized library-building support services. -# NOTE: Changing this file will not affect anything until you rerun ltconfig. -# -# Copyright (C) 1996-1999 Free Software Foundation, Inc. -# Gordon Matzigkeit , 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 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -# -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - -# Check that we have a working $echo. -if test "X$1" = X--no-reexec; then - # Discard the --no-reexec flag, and continue. - shift -elif test "X$1" = X--fallback-echo; then - # used as fallback echo - shift - cat </dev/null`" = 'X\t'; then - # Yippee, $echo works! - : -else - # Restart under the correct shell, and then maybe $echo will work. - exec $SHELL "$0" --no-reexec ${1+"$@"} -fi - -# The name of this program. -progname=`$echo "$0" | sed 's%^.*/%%'` -modename="$progname" - -# Constants. -PROGRAM=ltmain.sh -PACKAGE=libtool -VERSION=1.2f -TIMESTAMP=" (1.385 1999/03/15 17:24:54)" - -default_mode= -help="Try \`$progname --help' for more information." -magic="%%%MAGIC variable%%%" -mkdir="mkdir" -mv="mv -f" -rm="rm -f" - -# Sed substitution that helps us do robust quoting. It backslashifies -# metacharacters that are still active within double-quoted strings. -Xsed='sed -e 1s/^X//' -sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g' -SP2NL='tr \040 \012' -NL2SP='tr \012 \040' - -# NLS nuisances. -# Only set LANG and LC_ALL to C if already set. -# These must not be set unconditionally because not all systems understand -# e.g. LANG=C (notably SCO). -# We save the old values to restore during execute mode. -if test "${LC_ALL+set}" = set; then - save_LC_ALL="$LC_ALL"; LC_ALL=C; export LC_ALL -fi -if test "${LANG+set}" = set; then - save_LANG="$LANG"; LANG=C; export LANG -fi - -if test "$LTCONFIG_VERSION" != "$VERSION"; then - echo "$modename: ltconfig version \`$LTCONFIG_VERSION' does not match $PROGRAM version \`$VERSION'" 1>&2 - echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 - exit 1 -fi - -if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then - echo "$modename: not configured to build any kind of library" 1>&2 - echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 - exit 1 -fi - -# Global variables. -mode=$default_mode -nonopt= -prev= -prevopt= -run= -show="$echo" -show_help= -execute_dlfiles= -lo2o="s/\\.lo\$/.${objext}/" - -# Parse our command line options once, thoroughly. -while test $# -gt 0 -do - arg="$1" - shift - - case "$arg" in - -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;; - *) optarg= ;; - esac - - # If the previous option needs an argument, assign it. - if test -n "$prev"; then - case "$prev" in - execute_dlfiles) - eval "$prev=\"\$$prev \$arg\"" - ;; - *) - eval "$prev=\$arg" - ;; - esac - - prev= - prevopt= - continue - fi - - # Have we seen a non-optional argument yet? - case "$arg" in - --help) - show_help=yes - ;; - - --version) - echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP" - exit 0 - ;; - - --config) - sed -e '1,/^### BEGIN LIBTOOL CONFIG/d' -e '/^### END LIBTOOL CONFIG/,$d' $0 - exit 0 - ;; - - --debug) - echo "$progname: enabling shell trace mode" - set -x - ;; - - --dry-run | -n) - run=: - ;; - - --features) - echo "host: $host" - if test "$build_libtool_libs" = yes; then - echo "enable shared libraries" - else - echo "disable shared libraries" - fi - if test "$build_old_libs" = yes; then - echo "enable static libraries" - else - echo "disable static libraries" - fi - exit 0 - ;; - - --finish) mode="finish" ;; - - --mode) prevopt="--mode" prev=mode ;; - --mode=*) mode="$optarg" ;; - - --quiet | --silent) - show=: - ;; - - -dlopen) - prevopt="-dlopen" - prev=execute_dlfiles - ;; - - -*) - $echo "$modename: unrecognized option \`$arg'" 1>&2 - $echo "$help" 1>&2 - exit 1 - ;; - - *) - nonopt="$arg" - break - ;; - esac -done - -if test -n "$prevopt"; then - $echo "$modename: option \`$prevopt' requires an argument" 1>&2 - $echo "$help" 1>&2 - exit 1 -fi - -if test -z "$show_help"; then - - # Infer the operation mode. - if test -z "$mode"; then - case "$nonopt" in - *cc | *++ | gcc* | *-gcc*) - mode=link - for arg - do - case "$arg" in - -c) - mode=compile - break - ;; - esac - done - ;; - *db | *dbx | *strace | *truss) - mode=execute - ;; - *install*|cp|mv) - mode=install - ;; - *rm) - mode=uninstall - ;; - *) - # If we have no mode, but dlfiles were specified, then do execute mode. - test -n "$execute_dlfiles" && mode=execute - - # Just use the default operation mode. - if test -z "$mode"; then - if test -n "$nonopt"; then - $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2 - else - $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2 - fi - fi - ;; - esac - fi - - # Only execute mode is allowed to have -dlopen flags. - if test -n "$execute_dlfiles" && test "$mode" != execute; then - $echo "$modename: unrecognized option \`-dlopen'" 1>&2 - $echo "$help" 1>&2 - exit 1 - fi - - # Change the help message to a mode-specific one. - generic_help="$help" - help="Try \`$modename --help --mode=$mode' for more information." - - # These modes are in order of execution frequency so that they run quickly. - case "$mode" in - # libtool compile mode - compile) - modename="$modename: compile" - # Get the compilation command and the source file. - base_compile= - lastarg= - srcfile="$nonopt" - suppress_output= - - user_target=no - for arg - do - # Accept any command-line options. - case "$arg" in - -o) - if test "$user_target" != "no"; then - $echo "$modename: you cannot specify \`-o' more than once" 1>&2 - exit 1 - fi - user_target=next - ;; - - -static) - build_old_libs=yes - continue - ;; - esac - - case "$user_target" in - next) - # The next one is the -o target name - user_target=yes - continue - ;; - yes) - # We got the output file - user_target=set - libobj="$arg" - continue - ;; - esac - - # Accept the current argument as the source file. - lastarg="$srcfile" - srcfile="$arg" - - # Aesthetically quote the previous argument. - - # Backslashify any backslashes, double quotes, and dollar signs. - # These are the only characters that are still specially - # interpreted inside of double-quoted scrings. - lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"` - - # Double-quote args containing other shell metacharacters. - # Many Bourne shells cannot handle close brackets correctly in scan - # sets, so we specify it separately. - case "$lastarg" in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*) - lastarg="\"$lastarg\"" - ;; - esac - - # Add the previous argument to base_compile. - if test -z "$base_compile"; then - base_compile="$lastarg" - else - base_compile="$base_compile $lastarg" - fi - done - - case "$user_target" in - set) - ;; - no) - # Get the name of the library object. - libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'` - ;; - *) - $echo "$modename: you must specify a target with \`-o'" 1>&2 - exit 1 - ;; - esac - - # Recognize several different file suffixes. - # If the user specifies -o file.o, it is replaced with file.lo - xform='[cCFSfmso]' - case "$libobj" in - *.ada) xform=ada ;; - *.adb) xform=adb ;; - *.ads) xform=ads ;; - *.asm) xform=asm ;; - *.c++) xform=c++ ;; - *.cc) xform=cc ;; - *.cpp) xform=cpp ;; - *.cxx) xform=cxx ;; - *.f90) xform=f90 ;; - *.for) xform=for ;; - esac - - libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"` - - case "$libobj" in - *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;; - *) - $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2 - exit 1 - ;; - esac - - if test -z "$base_compile"; then - $echo "$modename: you must specify a compilation command" 1>&2 - $echo "$help" 1>&2 - exit 1 - fi - - # Delete any leftover library objects. - if test "$build_old_libs" = yes; then - removelist="$obj $libobj" - else - removelist="$libobj" - fi - - $run $rm $removelist - trap "$run $rm $removelist; exit 1" 1 2 15 - - # Calculate the filename of the output object if compiler does - # not support -o with -c - if test "$compiler_c_o" = no; then - output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\..*$%%'`.${objext} - lockfile="$output_obj.lock" - removelist="$removelist $output_obj $lockfile" - trap "$run $rm $removelist; exit 1" 1 2 15 - else - need_locks=no - lockfile= - fi - - # Lock this critical section if it is needed - # We use this script file to make the link, it avoids creating a new file - if test "$need_locks" = yes; then - until ln "$0" "$lockfile" 2>/dev/null; do - $show "Waiting for $lockfile to be removed" - sleep 2 - done - elif test "$need_locks" = warn; then - if test -f "$lockfile"; then - echo "\ -*** ERROR, $lockfile exists and contains: -`cat $lockfile 2>/dev/null` - -This indicates that another process is trying to use the same -temporary object file, and libtool could not work around it because -your compiler does not support \`-c' and \`-o' together. If you -repeat this compilation, it may succeed, by chance, but you had better -avoid parallel builds (make -j) in this platform, or get a better -compiler." - - $run $rm $removelist - exit 1 - fi - echo $srcfile > "$lockfile" - fi - - if test -n "$fix_srcfile_path"; then - eval srcfile=\"$fix_srcfile_path\" - fi - - # Only build a PIC object if we are building libtool libraries. - if test "$build_libtool_libs" = yes; then - # Without this assignment, base_compile gets emptied. - fbsd_hideous_sh_bug=$base_compile - - # All platforms use -DPIC, to notify preprocessed assembler code. - command="$base_compile $pic_flag -DPIC $srcfile" - if test "$build_old_libs" = yes; then - lo_libobj="$libobj" - dir=`$echo "X$libobj" | $Xsed -e 's%/[^/]*$%%'` - if test "X$dir" = "X$libobj"; then - dir="$objdir" - else - dir="$dir/$objdir" - fi - libobj="$dir/"`$echo "X$libobj" | $Xsed -e 's%^.*/%%'` - - if test -d "$dir"; then - $show "$rm $libobj" - $run $rm $libobj - else - $show "$mkdir $dir" - $run $mkdir $dir - status=$? - if test $status -ne 0 && test ! -d $dir; then - exit $status - fi - fi - fi - if test "$compiler_o_lo" = yes; then - output_obj="$libobj" - command="$command -o $output_obj" - elif test "$compiler_c_o" = yes; then - output_obj="$obj" - command="$command -o $output_obj" - fi - - $show "$command" - if $run eval "$command"; then : - else - test -n "$output_obj" && $run $rm $removelist - exit 1 - fi - - if test "$need_locks" = warn && - test x"`cat $lockfile 2>/dev/null`" != x"$srcfile"; then - echo "\ -*** ERROR, $lockfile contains: -`cat $lockfile 2>/dev/null` - -but it should contain: -$srcfile - -This indicates that another process is trying to use the same -temporary object file, and libtool could not work around it because -your compiler does not support \`-c' and \`-o' together. If you -repeat this compilation, it may succeed, by chance, but you had better -avoid parallel builds (make -j) in this platform, or get a better -compiler." - - $run $rm $removelist - exit 1 - fi - - # Just move the object if needed, then go on to compile the next one - if test x"$output_obj" != x"$libobj"; then - $show "$mv $output_obj $libobj" - if $run $mv $output_obj $libobj; then : - else - error=$? - $run $rm $removelist - exit $error - fi - fi - - # If we have no pic_flag, then copy the object into place and finish. - if test -z "$pic_flag" && test "$build_old_libs" = yes; then - # Rename the .lo from within objdir to obj - if test -f $obj; then - $show $rm $obj - $run $rm $obj - fi - - $show "$mv $libobj $obj" - if $run $mv $libobj $obj; then : - else - error=$? - $run $rm $removelist - exit $error - fi - - # Now arrange that obj and lo_libobj become the same file - $show "$LN_S $obj $lo_libobj" - if $run $LN_S $obj $lo_libobj; then - exit 0 - else - error=$? - $run $rm $removelist - exit $error - fi - fi - - # Allow error messages only from the first compilation. - suppress_output=' >/dev/null 2>&1' - fi - - # Only build a position-dependent object if we build old libraries. - if test "$build_old_libs" = yes; then - command="$base_compile $srcfile" - if test "$compiler_c_o" = yes; then - command="$command -o $obj" - output_obj="$obj" - fi - - # Suppress compiler output if we already did a PIC compilation. - command="$command$suppress_output" - $show "$command" - if $run eval "$command"; then : - else - $run $rm $removelist - exit 1 - fi - - if test "$need_locks" = warn && - test x"`cat $lockfile 2>/dev/null`" != x"$srcfile"; then - echo "\ -*** ERROR, $lockfile contains: -`cat $lockfile 2>/dev/null` - -but it should contain: -$srcfile - -This indicates that another process is trying to use the same -temporary object file, and libtool could not work around it because -your compiler does not support \`-c' and \`-o' together. If you -repeat this compilation, it may succeed, by chance, but you had better -avoid parallel builds (make -j) in this platform, or get a better -compiler." - - $run $rm $removelist - exit 1 - fi - - # Just move the object if needed - if test x"$output_obj" != x"$obj"; then - $show "$mv $output_obj $obj" - if $run $mv $output_obj $obj; then : - else - error=$? - $run $rm $removelist - exit $error - fi - fi - - # Create an invalid libtool object if no PIC, so that we do not - # accidentally link it into a program. - if test "$build_libtool_libs" != yes; then - $show "echo timestamp > $libobj" - $run eval "echo timestamp > \$libobj" || exit $? - else - # Move the .lo from within objdir - $show "$mv $libobj $lo_libobj" - if $run $mv $libobj $lo_libobj; then : - else - error=$? - $run $rm $removelist - exit $error - fi - fi - fi - - # Unlock the critical section if it was locked - if test "$need_locks" != no; then - $rm "$lockfile" - fi - - exit 0 - ;; - - # libtool link mode - link) - modename="$modename: link" - C_compiler="$CC" # save it, to compile generated C sources - CC="$nonopt" - case "$host" in - *-*-cygwin* | *-*-mingw* | *-*-os2*) - # It is impossible to link a dll without this setting, and - # we shouldn't force the makefile maintainer to figure out - # which system we are compiling for in order to pass an extra - # flag for every libtool invokation. - # allow_undefined=no - - # FIXME: Unfortunately, there are problems with the above when trying - # to make a dll which has undefined symbols, in which case not - # even a static library is built. For now, we need to specify - # -no-undefined on the libtool link line when we can be certain - # that all symbols are satisfied, otherwise we get a static library. - allow_undefined=yes - - # This is a source program that is used to create dlls on Windows - # Don't remove nor modify the starting and closing comments -# /* ltdll.c starts here */ -# #define WIN32_LEAN_AND_MEAN -# #include -# #undef WIN32_LEAN_AND_MEAN -# #include -# -# BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved); -# -# #include -# DECLARE_CYGWIN_DLL( DllMain ); -# HINSTANCE __hDllInstance_base; -# -# BOOL APIENTRY -# DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved) -# { -# __hDllInstance_base = hInst; -# return TRUE; -# } -# /* ltdll.c ends here */ - # This is a source program that is used to create import libraries - # on Windows for dlls which lack them. Don't remove nor modify the - # starting and closing comments -# /* impgen.c starts here */ -# /* Copyright (C) 1999 Free Software Foundation, Inc. -# -# This file is part of GNU libtool. -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -# */ -# -# #include /* for printf() */ -# #include /* for open(), lseek(), read() */ -# #include /* for O_RDONLY, O_BINARY */ -# #include /* for strdup() */ -# -# static unsigned int -# pe_get16 (fd, offset) -# int fd; -# int offset; -# { -# unsigned char b[2]; -# lseek (fd, offset, SEEK_SET); -# read (fd, b, 2); -# return b[0] + (b[1]<<8); -# } -# -# static unsigned int -# pe_get32 (fd, offset) -# int fd; -# int offset; -# { -# unsigned char b[4]; -# lseek (fd, offset, SEEK_SET); -# read (fd, b, 4); -# return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24); -# } -# -# static unsigned int -# pe_as32 (ptr) -# void *ptr; -# { -# unsigned char *b = ptr; -# return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24); -# } -# -# int -# main (argc, argv) -# int argc; -# char *argv[]; -# { -# int dll; -# unsigned long pe_header_offset, opthdr_ofs, num_entries, i; -# unsigned long export_rva, export_size, nsections, secptr, expptr; -# unsigned long name_rvas, nexp; -# unsigned char *expdata, *erva; -# char *filename, *dll_name; -# -# filename = argv[1]; -# -# dll = open(filename, O_RDONLY|O_BINARY); -# if (!dll) -# return 1; -# -# dll_name = filename; -# -# for (i=0; filename[i]; i++) -# if (filename[i] == '/' || filename[i] == '\\' || filename[i] == ':') -# dll_name = filename + i +1; -# -# pe_header_offset = pe_get32 (dll, 0x3c); -# opthdr_ofs = pe_header_offset + 4 + 20; -# num_entries = pe_get32 (dll, opthdr_ofs + 92); -# -# if (num_entries < 1) /* no exports */ -# return 1; -# -# export_rva = pe_get32 (dll, opthdr_ofs + 96); -# export_size = pe_get32 (dll, opthdr_ofs + 100); -# nsections = pe_get16 (dll, pe_header_offset + 4 +2); -# secptr = (pe_header_offset + 4 + 20 + -# pe_get16 (dll, pe_header_offset + 4 + 16)); -# -# expptr = 0; -# for (i = 0; i < nsections; i++) -# { -# char sname[8]; -# unsigned long secptr1 = secptr + 40 * i; -# unsigned long vaddr = pe_get32 (dll, secptr1 + 12); -# unsigned long vsize = pe_get32 (dll, secptr1 + 16); -# unsigned long fptr = pe_get32 (dll, secptr1 + 20); -# lseek(dll, secptr1, SEEK_SET); -# read(dll, sname, 8); -# if (vaddr <= export_rva && vaddr+vsize > export_rva) -# { -# expptr = fptr + (export_rva - vaddr); -# if (export_rva + export_size > vaddr + vsize) -# export_size = vsize - (export_rva - vaddr); -# break; -# } -# } -# -# expdata = (unsigned char*)malloc(export_size); -# lseek (dll, expptr, SEEK_SET); -# read (dll, expdata, export_size); -# erva = expdata - export_rva; -# -# nexp = pe_as32 (expdata+24); -# name_rvas = pe_as32 (expdata+32); -# -# printf ("EXPORTS\n"); -# for (i = 0; i&2 - fi - build_libtool_libs=no - build_old_libs=yes - break - ;; - esac - done - - # See if our shared archives depend on static archives. - test -n "$old_archive_from_new_cmds" && build_old_libs=yes - - # Go through the arguments, transforming them on the way. - while test $# -gt 0; do - arg="$1" - shift - - # If the previous option needs an argument, assign it. - if test -n "$prev"; then - case "$prev" in - output) - compile_command="$compile_command @OUTPUT@" - finalize_command="$finalize_command @OUTPUT@" - ;; - esac - - case "$prev" in - dlfiles|dlprefiles) - if test "$preload" = no; then - # Add the symbol object into the linking commands. - compile_command="$compile_command @SYMFILE@" - finalize_command="$finalize_command @SYMFILE@" - preload=yes - fi - case "$arg" in - *.la | *.lo) ;; # We handle these cases below. - self) - if test "$prev" = dlprefiles; then - dlself=yes - elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then - dlself=yes - fi - prev= - continue - ;; - *) - dlprefiles="$dlprefiles $arg" - test "$prev" = dlfiles && dlfiles="$dlfiles $arg" - prev= - ;; - esac - ;; - expsyms) - export_symbols="$arg" - if test ! -f "$arg"; then - $echo "$modename: symbol file \`$arg' does not exist" - exit 1 - fi - prev= - continue - ;; - expsyms_regex) - export_symbols_regex="$arg" - prev= - continue - ;; - release) - release="-$arg" - prev= - continue - ;; - rpath) - rpath="$rpath $arg" - prev= - continue - ;; - xrpath) - xrpath="$xrpath $arg" - prev= - continue - ;; - *) - eval "$prev=\"\$arg\"" - prev= - continue - ;; - esac - fi - - prevarg="$arg" - - case "$arg" in - -all-static) - if test -n "$link_static_flag"; then - compile_command="$compile_command $link_static_flag" - finalize_command="$finalize_command $link_static_flag" - dlopen_self=$dlopen_self_static - fi - continue - ;; - - -allow-undefined) - # FIXME: remove this flag sometime in the future. - $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2 - continue - ;; - - -avoid-version) - avoid_version=yes - continue - ;; - - -dlopen) - prev=dlfiles - continue - ;; - - -dlpreopen) - prev=dlprefiles - continue - ;; - - -export-dynamic) - if test "$export_dynamic" != yes; then - export_dynamic=yes - if test -n "$export_dynamic_flag_spec"; then - eval arg=\"$export_dynamic_flag_spec\" - else - arg= - fi - fi - ;; - - -export-symbols | -export-symbols-regex) - if test -n "$export_symbols" || test -n "$export_symbols_regex"; then - $echo "$modename: cannot have more than one -exported-symbols" - exit 1 - fi - if test "$arg" = "-export-symbols"; then - prev=expsyms - else - prev=expsyms_regex - fi - continue - ;; - - -L*) - dir=`$echo "X$arg" | $Xsed -e 's%^-L\(.*\)$%\1%'` - case "$dir" in - /* | [A-Za-z]:[/\\]*) - # Add the corresponding hardcode_libdir_flag, if it is not identical. - ;; - *) - $echo "$modename: \`-L$dir' cannot specify a relative directory" 1>&2 - exit 1 - ;; - esac - case " $deplibs " in - *" $arg "*) ;; - *) deplibs="$deplibs $arg";; - esac - case " $lib_search_path " in - *" $dir "*) ;; - *) lib_search_path="$lib_search_path $dir";; - esac - case "$host" in - *-*-cygwin* | *-*-mingw* | *-*-os2*) - dllsearchdir=`cd "$dir" && pwd || echo "$dir"` - case ":$dllsearchpath:" in - ::) dllsearchpath="$dllsearchdir";; - *":$dllsearchdir:"*) ;; - *) dllsearchpath="$dllsearchpath:$dllsearchdir";; - esac - ;; - esac - ;; - - -l*) - deplibs="$deplibs $arg" - ;; - - -module) - if test "$module" != yes; then - module=yes - if test -n "$export_dynamic_flag_spec"; then - eval arg=\"$export_dynamic_flag_spec\" - else - arg= - fi - fi - ;; - - -no-undefined) - allow_undefined=no - continue - ;; - - -o) prev=output ;; - - -release) - prev=release - continue - ;; - - -rpath) - prev=rpath - continue - ;; - - -R) - prev=xrpath - continue - ;; - - -R*) - xrpath="$xrpath "`$echo "X$arg" | $Xsed -e 's/^-R//'` - continue - ;; - - -static) - # If we have no pic_flag, then this is the same as -all-static. - if test -z "$pic_flag" && test -n "$link_static_flag"; then - compile_command="$compile_command $link_static_flag" - finalize_command="$finalize_command $link_static_flag" - dlopen_self=$dlopen_self_static - fi - continue - ;; - - -thread-safe) - thread_safe=yes - continue - ;; - - -version-info) - prev=vinfo - continue - ;; - - # Some other compiler flag. - -* | +*) - # Unknown arguments in both finalize_command and compile_command need - # to be aesthetically quoted because they are evaled later. - arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` - case "$arg" in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*) - arg="\"$arg\"" - ;; - esac - ;; - - *.o | *.obj | *.a | *.lib) - # A standard object. - objs="$objs $arg" - ;; - - *.lo) - # A library object. - if test "$prev" = dlfiles; then - dlfiles="$dlfiles $arg" - if test "$build_libtool_libs" = yes && test "$dlopen" = yes; then - prev= - continue - else - # If libtool objects are unsupported, then we need to preload. - prev=dlprefiles - fi - fi - - if test "$prev" = dlprefiles; then - # Preload the old-style object. - dlprefiles="$dlprefiles "`$echo "X$arg" | $Xsed -e "$lo2o"` - prev= - fi - libobjs="$libobjs $arg" - ;; - - *.la) - # A libtool-controlled library. - - dlname= - libdir= - library_names= - old_library= - - # Check to see that this really is a libtool archive. - if (sed -e '2q' $arg | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : - else - $echo "$modename: \`$arg' is not a valid libtool archive" 1>&2 - exit 1 - fi - - # If the library was installed with an old release of libtool, - # it will not redefine variable installed. - installed=yes - - # If there is no directory component, then add one. - case "$arg" in - */* | *\\*) . $arg ;; - *) . ./$arg ;; - esac - - # Get the name of the library we link against. - linklib= - for l in $old_library $library_names; do - linklib="$l" - done - - if test -z "$linklib"; then - $echo "$modename: cannot find name of link library for \`$arg'" 1>&2 - exit 1 - fi - - # Find the relevant object directory and library name. - name=`$echo "X$arg" | $Xsed -e 's%^.*/%%' -e 's/\.la$//' -e 's/^lib//'` - - if test "X$installed" = Xyes; then - dir="$libdir" - else - dir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` - if test "X$dir" = "X$arg"; then - dir="$objdir" - else - dir="$dir/$objdir" - fi - fi - - if test -n "$dependency_libs"; then - # Extract -R from dependency_libs - temp_deplibs= - for deplib in $dependency_libs; do - case "$deplib" in - -R*) temp_xrpath=`$echo "X$deplib" | $Xsed -e 's/^-R//'` - case " $rpath $xrpath " in - *" $temp_xrpath "*) ;; - *) xrpath="$xrpath $temp_xrpath";; - esac;; - -L*) case "$compile_command $temp_deplibs " in - *" $deplib "*) ;; - *) temp_deplibs="$temp_deplibs $deplib";; - esac;; - *) temp_deplibs="$temp_deplibs $deplib";; - esac - done - dependency_libs="$temp_deplibs" - fi - - if test -z "$libdir"; then - # It is a libtool convenience library, so add in its objects. - convenience="$convenience $dir/$old_library" - old_convenience="$old_convenience $dir/$old_library" - deplibs="$deplibs$dependency_libs" - compile_command="$compile_command $dir/$old_library$dependency_libs" - finalize_command="$finalize_command $dir/$old_library$dependency_libs" - continue - fi - - # This library was specified with -dlopen. - if test "$prev" = dlfiles; then - dlfiles="$dlfiles $arg" - if test -z "$dlname" || test "$dlopen" != yes || test "$build_libtool_libs" = no; then - # If there is no dlname, no dlopen support or we're linking statically, - # we need to preload. - prev=dlprefiles - else - # We should not create a dependency on this library, but we - # may need any libraries it requires. - compile_command="$compile_command$dependency_libs" - finalize_command="$finalize_command$dependency_libs" - prev= - continue - fi - fi - - # The library was specified with -dlpreopen. - if test "$prev" = dlprefiles; then - # Prefer using a static library (so that no silly _DYNAMIC symbols - # are required to link). - if test -n "$old_library"; then - dlprefiles="$dlprefiles $dir/$old_library" - else - dlprefiles="$dlprefiles $dir/$linklib" - fi - prev= - fi - - if test "$build_libtool_libs" = yes && test -n "$library_names"; then - link_against_libtool_libs="$link_against_libtool_libs $arg" - if test -n "$shlibpath_var"; then - # Make sure the rpath contains only unique directories. - case "$temp_rpath " in - *" $dir "*) ;; - *) temp_rpath="$temp_rpath $dir" ;; - esac - fi - - # We need an absolute path. - case "$dir" in - /* | [A-Za-z]:[/\\]*) absdir="$dir" ;; - *) - absdir=`cd "$dir" && pwd` - if test -z "$absdir"; then - $echo "$modename: cannot determine absolute directory name of \`$libdir'" 1>&2 - exit 1 - fi - ;; - esac - - # This is the magic to use -rpath. - # Skip directories that are in the system default run-time - # search path, unless they have been requested with -R. - case " $sys_lib_dlsearch_path " in - *" $absdir "*) ;; - *) - case "$compile_rpath " in - *" $absdir "*) ;; - *) compile_rpath="$compile_rpath $absdir" - esac - ;; - esac - - case " $sys_lib_dlsearch_path " in - *" $libdir "*) ;; - *) - case "$finalize_rpath " in - *" $libdir "*) ;; - *) finalize_rpath="$finalize_rpath $libdir" - esac - ;; - esac - - lib_linked=yes - case "$hardcode_action" in - immediate | unsupported) - if test "$hardcode_direct" = no; then - compile_command="$compile_command $dir/$linklib" - deplibs="$deplibs $dir/$linklib" - case "$host" in - *-*-cygwin* | *-*-mingw* | *-*-os2*) - dllsearchdir=`cd "$dir" && pwd || echo "$dir"` - if test -n "$dllsearchpath"; then - dllsearchpath="$dllsearchpath:$dllsearchdir" - else - dllsearchpath="$dllsearchdir" - fi - ;; - esac - elif test "$hardcode_minus_L" = no; then - case "$host" in - *-*-sunos*) - compile_shlibpath="$compile_shlibpath$dir:" - ;; - esac - case "$compile_command " in - *" -L$dir "*) ;; - *) compile_command="$compile_command -L$dir";; - esac - compile_command="$compile_command -l$name" - deplibs="$deplibs -L$dir -l$name" - elif test "$hardcode_shlibpath_var" = no; then - case ":$compile_shlibpath:" in - *":$dir:"*) ;; - *) compile_shlibpath="$compile_shlibpath$dir:";; - esac - compile_command="$compile_command -l$name" - deplibs="$deplibs -l$name" - else - lib_linked=no - fi - ;; - - relink) - if test "$hardcode_direct" = yes; then - compile_command="$compile_command $absdir/$linklib" - deplibs="$deplibs $absdir/$linklib" - elif test "$hardcode_minus_L" = yes; then - case "$compile_command " in - *" -L$absdir "*) ;; - *) compile_command="$compile_command -L$absdir";; - esac - compile_command="$compile_command -l$name" - deplibs="$deplibs -L$absdir -l$name" - elif test "$hardcode_shlibpath_var" = yes; then - case ":$compile_shlibpath:" in - *":$absdir:"*) ;; - *) compile_shlibpath="$compile_shlibpath$absdir:";; - esac - compile_command="$compile_command -l$name" - deplibs="$deplibs -l$name" - else - lib_linked=no - fi - ;; - - *) - lib_linked=no - ;; - esac - - if test "$lib_linked" != yes; then - $echo "$modename: configuration error: unsupported hardcode properties" - exit 1 - fi - - # Finalize command for both is simple: just hardcode it. - if test "$hardcode_direct" = yes; then - finalize_command="$finalize_command $libdir/$linklib" - elif test "$hardcode_minus_L" = yes; then - case "$finalize_command " in - *" -L$libdir "*) ;; - *) finalize_command="$finalize_command -L$libdir";; - esac - finalize_command="$finalize_command -l$name" - elif test "$hardcode_shlibpath_var" = yes; then - case ":$finalize_shlibpath:" in - *":$libdir:"*) ;; - *) finalize_shlibpath="$finalize_shlibpath$libdir:";; - esac - finalize_command="$finalize_command -l$name" - else - # We cannot seem to hardcode it, guess we'll fake it. - case "$finalize_command " in - *" -L$dir "*) ;; - *) finalize_command="$finalize_command -L$libdir";; - esac - finalize_command="$finalize_command -l$name" - fi - else - # Transform directly to old archives if we don't build new libraries. - if test -n "$pic_flag" && test -z "$old_library"; then - $echo "$modename: cannot find static library for \`$arg'" 1>&2 - exit 1 - fi - - # Here we assume that one of hardcode_direct or hardcode_minus_L - # is not unsupported. This is valid on all known static and - # shared platforms. - if test "$hardcode_direct" != unsupported; then - test -n "$old_library" && linklib="$old_library" - compile_command="$compile_command $dir/$linklib" - finalize_command="$finalize_command $dir/$linklib" - else - case "$compile_command " in - *" -L$dir "*) ;; - *) compile_command="$compile_command -L$dir";; - esac - compile_command="$compile_command -l$name" - case "$finalize_command " in - *" -L$dir "*) ;; - *) finalize_command="$finalize_command -L$dir";; - esac - finalize_command="$finalize_command -l$name" - fi - fi - - # Add in any libraries that this one depends upon. - compile_command="$compile_command$dependency_libs" - finalize_command="$finalize_command$dependency_libs" - continue - ;; - - # Some other compiler argument. - *) - # Unknown arguments in both finalize_command and compile_command need - # to be aesthetically quoted because they are evaled later. - arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` - case "$arg" in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*) - arg="\"$arg\"" - ;; - esac - ;; - esac - - # Now actually substitute the argument into the commands. - if test -n "$arg"; then - compile_command="$compile_command $arg" - finalize_command="$finalize_command $arg" - fi - done - - if test -n "$prev"; then - $echo "$modename: the \`$prevarg' option requires an argument" 1>&2 - $echo "$help" 1>&2 - exit 1 - fi - - oldlibs= - # calculate the name of the file, without its directory - outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'` - libobjs_save="$libobjs" - - case "$output" in - "") - $echo "$modename: you must specify an output file" 1>&2 - $echo "$help" 1>&2 - exit 1 - ;; - - *.a | *.lib) - if test -n "$link_against_libtool_libs"; then - $echo "$modename: error: cannot link libtool libraries into archives" 1>&2 - exit 1 - fi - - if test -n "$deplibs"; then - $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2 - fi - - if test -n "$dlfiles$dlprefiles"; then - $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2 - fi - - if test -n "$rpath"; then - $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2 - fi - - if test -n "$xrpath"; then - $echo "$modename: warning: \`-R' is ignored for archives" 1>&2 - fi - - if test -n "$vinfo"; then - $echo "$modename: warning: \`-version-info' is ignored for archives" 1>&2 - fi - - if test -n "$release"; then - $echo "$modename: warning: \`-release' is ignored for archives" 1>&2 - fi - - if test -n "$export_symbols"; then - $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2 - fi - - # Now set the variables for building old libraries. - build_libtool_libs=no - oldlibs="$output" - ;; - - *.la) - # Make sure we only generate libraries of the form `libNAME.la'. - case "$outputname" in - lib*) - name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'` - eval libname=\"$libname_spec\" - ;; - *) - if test "$module" = no; then - $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2 - $echo "$help" 1>&2 - exit 1 - fi - if test "$need_lib_prefix" != no; then - # Add the "lib" prefix for modules if required - name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'` - eval libname=\"$libname_spec\" - else - libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'` - fi - ;; - esac - - output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'` - if test "X$output_objdir" = "X$output"; then - output_objdir="$objdir" - else - output_objdir="$output_objdir/$objdir" - fi - - # All the library-specific variables (install_libdir is set above). - library_names= - old_library= - dlname= - - if test -n "$objs"; then - $echo "$modename: cannot build libtool library \`$output' from non-libtool objects:$objs" 2>&1 - exit 1 - fi - - # How the heck are we supposed to write a wrapper for a shared library? - if test -n "$link_against_libtool_libs"; then - $echo "$modename: error: cannot link shared libraries into libtool libraries" 1>&2 - exit 1 - fi - - if test -n "$dlfiles$dlprefiles"; then - $echo "$modename: warning: \`-dlopen' is ignored for libtool libraries" 1>&2 - fi - - set dummy $rpath - if test $# -gt 2; then - $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2 - fi - install_libdir="$2" - - oldlibs= - if test -z "$rpath"; then - if test "$build_libtool_libs" = yes; then - # Building a libtool convenience library. - libext=al - oldlibs="$output_objdir/$libname.$libext $oldlibs" - build_libtool_libs=convenience - build_old_libs=yes - fi - dependency_libs="$deplibs" - - if test -n "$vinfo"; then - $echo "$modename: warning: \`-version-info' is ignored for convenience libraries" 1>&2 - fi - - if test -n "$release"; then - $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2 - fi - else - - # Parse the version information argument. - IFS="${IFS= }"; save_ifs="$IFS"; IFS=':' - set dummy $vinfo 0 0 0 - IFS="$save_ifs" - - if test -n "$8"; then - $echo "$modename: too many parameters to \`-version-info'" 1>&2 - $echo "$help" 1>&2 - exit 1 - fi - - current="$2" - revision="$3" - age="$4" - - # Check that each of the things are valid numbers. - case "$current" in - 0 | [1-9] | [1-9][0-9]*) ;; - *) - $echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2 - $echo "$modename: \`$vinfo' is not valid version information" 1>&2 - exit 1 - ;; - esac - - case "$revision" in - 0 | [1-9] | [1-9][0-9]*) ;; - *) - $echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2 - $echo "$modename: \`$vinfo' is not valid version information" 1>&2 - exit 1 - ;; - esac - - case "$age" in - 0 | [1-9] | [1-9][0-9]*) ;; - *) - $echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2 - $echo "$modename: \`$vinfo' is not valid version information" 1>&2 - exit 1 - ;; - esac - - if test $age -gt $current; then - $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2 - $echo "$modename: \`$vinfo' is not valid version information" 1>&2 - exit 1 - fi - - # Calculate the version variables. - major= - versuffix= - verstring= - case "$version_type" in - none) ;; - - irix) - major=`expr $current - $age + 1` - versuffix="$major.$revision" - verstring="sgi$major.$revision" - - # Add in all the interfaces that we are compatible with. - loop=$revision - while test $loop != 0; do - iface=`expr $revision - $loop` - loop=`expr $loop - 1` - verstring="sgi$major.$iface:$verstring" - done - ;; - - linux) - major=.`expr $current - $age` - versuffix="$major.$age.$revision" - ;; - - osf) - major=`expr $current - $age` - versuffix=".$current.$age.$revision" - verstring="$current.$age.$revision" - - # Add in all the interfaces that we are compatible with. - loop=$age - while test $loop != 0; do - iface=`expr $current - $loop` - loop=`expr $loop - 1` - verstring="$verstring:${iface}.0" - done - - # Make executables depend on our current version. - verstring="$verstring:${current}.0" - ;; - - sunos) - major=".$current" - versuffix=".$current.$revision" - ;; - - freebsd-aout) - major=".$current" - versuffix=".$current.$revision"; - ;; - - freebsd-elf) - major=".$current" - versuffix=".$current"; - ;; - - windows) - # Like Linux, but with '-' rather than '.', since we only - # want one extension on Windows 95. - major=`expr $current - $age` - versuffix="-$major-$age-$revision" - ;; - - *) - $echo "$modename: unknown library version type \`$version_type'" 1>&2 - echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 - exit 1 - ;; - esac - - # Clear the version info if we defaulted, and they specified a release. - if test -z "$vinfo" && test -n "$release"; then - major= - verstring="0.0" - if test "$need_version" = no; then - versuffix= - else - versuffix=".0.0" - fi - fi - - # Remove version info from name if versioning should be avoided - if test "$avoid_version" = yes && test "$need_version" = no; then - major= - versuffix= - verstring="" - fi - - # Check to see if the archive will have undefined symbols. - if test "$allow_undefined" = yes; then - if test "$allow_undefined_flag" = unsupported; then - $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2 - build_libtool_libs=no - build_old_libs=yes - fi - else - # Don't allow undefined symbols. - allow_undefined_flag="$no_undefined_flag" - fi - - dependency_libs="$deplibs" - case "$host" in - *-*-cygwin* | *-*-mingw* | *-*-os2*) - # these systems don't actually have a c library (as such)! - ;; - *) - # Add libc to deplibs on all other systems. - deplibs="$deplibs -lc" - ;; - esac - fi - - # Create the output directory, or remove our outputs if we need to. - if test -d $output_objdir; then - $show "${rm}r $output_objdir/$outputname $output_objdir/$libname.* $output_objdir/${libname}${release}.*" - $run ${rm}r $output_objdir/$outputname $output_objdir/$libname.* $output_objdir/${libname}${release}.* - else - $show "$mkdir $output_objdir" - $run $mkdir $output_objdir - status=$? - if test $status -ne 0 && test ! -d $output_objdir; then - exit $status - fi - fi - - # Now set the variables for building old libraries. - if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then - oldlibs="$oldlibs $output_objdir/$libname.$libext" - - # Transform .lo files to .o files. - oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP` - fi - - if test "$build_libtool_libs" = yes; then - # Transform deplibs into only deplibs that can be linked in shared. - name_save=$name - libname_save=$libname - release_save=$release - versuffix_save=$versuffix - major_save=$major - # I'm not sure if I'm treating the release correctly. I think - # release should show up in the -l (ie -lgmp5) so we don't want to - # add it in twice. Is that correct? - release="" - versuffix="" - major="" - newdeplibs= - droppeddeps=no - case "$deplibs_check_method" in - pass_all) - newdeplibs=$deplibs - ;; # Don't check for shared/static. Everything works. - # This might be a little naive. We might want to check - # whether the library exists or not. But this is on - # osf3 & osf4 and I'm not really sure... Just - # implementing what was already the behaviour. - test_compile) - # This code stresses the "libraries are programs" paradigm to its - # limits. Maybe even breaks it. We compile a program, linking it - # against the deplibs as a proxy for the library. Then we can check - # whether they linked in statically or dynamically with ldd. - $rm conftest.c - cat > conftest.c </dev/null` - for potent_lib in $potential_libs; do - # Follow soft links. - if ls -lLd "$potlib" 2>/dev/null \ - | grep " -> " >/dev/null; then - continue - fi - # The statement above tries to avoid entering an - # endless loop below, in case of cyclic links. - # We might still enter an endless loop, since a link - # loop can be closed while we follow links, - # but so what? - potlib="$potent_lib" - while test -h "$potlib" 2>/dev/null; do - potliblink=`ls -ld $potlib | sed 's/.* -> //'` - case "$potliblink" in - /*) potlib="$potliblink";; - *) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";; - esac - done - if eval $file_magic_cmd \"\$potlib\" \ - | sed 10q \ - | egrep "$file_magic_regex" > /dev/null; then - newdeplibs="$newdeplibs $a_deplib" - a_deplib="" - break 2 - fi - done - done - if test -n "$a_deplib" ; then - droppeddeps=yes - echo - echo "*** Warning: This library needs some functionality provided by $a_deplib." - echo "*** I have the capability to make that library automatically link in when" - echo "*** you link to this library. But I can only do this if you have a" - echo "*** shared version of the library, which you do not appear to have." - fi - else - # Add a -L argument. - newdeplibs="$newdeplibs $a_deplib" - fi - done # Gone through all deplibs. - ;; - none | unknown | *) newdeplibs="" - if $echo "X $deplibs" | $Xsed -e 's/ -lc$//' \ - -e 's/ -[LR][^ ]*//g' -e 's/[ ]//g' | - grep . >/dev/null; then - echo - if test "X$deplibs_check_method" = "Xnone"; then - echo "*** Warning: inter-library dependencies are not supported in this platform." - else - echo "*** Warning: inter-library dependencies are not known to be supported." - fi - echo "*** All declared inter-library dependencies are being dropped." - droppeddeps=yes - fi - ;; - esac - versuffix=$versuffix_save - major=$major_save - release=$release_save - libname=$libname_save - name=$name_save - - if test "$droppeddeps" = yes; then - if test "$module" = yes; then - echo - echo "*** Warning: libtool could not satisfy all declared inter-library" - echo "*** dependencies of module $libname. Therefore, libtool will create" - echo "*** a static module, that should work as long as the dlopening" - echo "*** application is linked with the -dlopen flag." - if test -z "$global_symbol_pipe"; then - echo - echo "*** However, this would only work if libtool was able to extract symbol" - echo "*** lists from a program, using \`nm' or equivalent, but libtool could" - echo "*** not find such a program. So, this module is probably useless." - echo "*** \`nm' from GNU binutils and a full rebuild may help." - fi - if test "$build_old_libs" = no; then - oldlibs="$output_objdir/$libname.$libext" - build_libtool_libs=module - build_old_libs=yes - else - build_libtool_libs=no - fi - dlname= - library_names= - else - echo "*** The inter-library dependencies that have been dropped here will be" - echo "*** automatically added whenever a program is linked with this library" - echo "*** or is declared to -dlopen it." - fi - fi - fi - - # test again, we may have decided not to build it any more - if test "$build_libtool_libs" = yes; then - deplibs=$newdeplibs - # Done checking deplibs! - - # Get the real and link names of the library. - eval library_names=\"$library_names_spec\" - set dummy $library_names - realname="$2" - shift; shift - - if test -n "$soname_spec"; then - eval soname=\"$soname_spec\" - else - soname="$realname" - fi - - lib="$output_objdir/$realname" - for link - do - linknames="$linknames $link" - done - - # Ensure that we have .o objects for linkers which dislike .lo - # (e.g. aix) incase we are running --disable-static - for obj in $libobjs; do - oldobj=`$echo "X$obj" | $Xsed -e "$lo2o"` - test -f $oldobj || ${LN_S} $obj $oldobj - done - - # Use standard objects if they are pic - test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` - - if test -n "$whole_archive_flag_spec"; then - if test -n "$convenience"; then - eval libobjs=\"\$libobjs $whole_archive_flag_spec\" - fi - else - for xlib in $convenience; do - # Extract the objects. - xdir="$xlib"x - generated="$generated $xdir" - xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'` - - $show "${rm}r $xdir" - $run ${rm}r "$xdir" - $show "mkdir $xdir" - $run mkdir "$xdir" - status=$? - if test $status -ne 0 && test ! -d "$xdir"; then - exit $status - fi - $show "(cd $xdir && $AR x ../$xlib)" - $run eval "(cd \$xdir && $AR x ../\$xlib)" || exit $? - - libobjs="$libobjs "`find $xdir -name \*.o -print -o -name \*.lo -print | $NL2SP` - done - fi - - if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then - eval flag=\"$thread_safe_flag_spec\" - - linkopts="$linkopts $flag" - fi - - # Prepare the list of exported symbols - if test -z "$export_symbols"; then - if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then - $show "generating symbol list for \`$libname.la'" - export_symbols="$objdir/$libname.exp" - $run $rm $export_symbols - eval cmds=\"$export_symbols_cmds\" - IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do - IFS="$save_ifs" - $show "$cmd" - $run eval "$cmd" || exit $? - done - IFS="$save_ifs" - if test -n "$export_symbols_regex"; then - $show "egrep -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\"" - $run eval 'egrep -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' - $show "$mv \"${export_symbols}T\" \"$export_symbols\"" - $run eval '$mv "${export_symbols}T" "$export_symbols"' - fi - fi - fi - - if test -n "$export_symbols" && test -n "$include_expsyms"; then - $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"' - fi - - # Do each of the archive commands. - if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then - eval cmds=\"$archive_expsym_cmds\" - else - eval cmds=\"$archive_cmds\" - fi - IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do - IFS="$save_ifs" - $show "$cmd" - $run eval "$cmd" || exit $? - done - IFS="$save_ifs" - - # Create links to the real library. - for linkname in $linknames; do - if test "$realname" != "$linkname"; then - $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)" - $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $? - fi - done - - # If -module or -export-dynamic was specified, set the dlname. - if test "$module" = yes || test "$export_dynamic" = yes; then - # On all known operating systems, these are identical. - dlname="$soname" - fi - fi - ;; - - *.lo | *.o | *.obj) - if test -n "$link_against_libtool_libs"; then - $echo "$modename: error: cannot link libtool libraries into objects" 1>&2 - exit 1 - fi - - if test -n "$deplibs"; then - $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2 - fi - - if test -n "$dlfiles$dlprefiles"; then - $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2 - fi - - if test -n "$rpath"; then - $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2 - fi - - if test -n "$xrpath"; then - $echo "$modename: warning: \`-R' is ignored for objects" 1>&2 - fi - - if test -n "$vinfo"; then - $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2 - fi - - if test -n "$release"; then - $echo "$modename: warning: \`-release' is ignored for objects" 1>&2 - fi - - case "$output" in - *.lo) - if test -n "$objs"; then - $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2 - exit 1 - fi - libobj="$output" - obj=`$echo "X$output" | $Xsed -e "$lo2o"` - ;; - *) - libobj= - obj="$output" - ;; - esac - - # Delete the old objects. - $run $rm $obj $libobj - - # Create the old-style object. - reload_objs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP` - - output="$obj" - eval cmds=\"$reload_cmds\" - IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do - IFS="$save_ifs" - $show "$cmd" - $run eval "$cmd" || exit $? - done - IFS="$save_ifs" - - # Exit if we aren't doing a library object file. - test -z "$libobj" && exit 0 - - if test "$build_libtool_libs" != yes; then - # Create an invalid libtool object if no PIC, so that we don't - # accidentally link it into a program. - $show "echo timestamp > $libobj" - $run eval "echo timestamp > $libobj" || exit $? - exit 0 - fi - - if test -n "$pic_flag"; then - # Only do commands if we really have different PIC objects. - reload_objs="$libobjs" - output="$libobj" - eval cmds=\"$reload_cmds\" - IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do - IFS="$save_ifs" - $show "$cmd" - $run eval "$cmd" || exit $? - done - IFS="$save_ifs" - else - # Just create a symlink. - $show $rm $libobj - $run $rm $libobj - $show "$LN_S $obj $libobj" - $run $LN_S $obj $libobj || exit $? - fi - - exit 0 - ;; - - # Anything else should be a program. - *) - if test -n "$vinfo"; then - $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2 - fi - - if test -n "$release"; then - $echo "$modename: warning: \`-release' is ignored for programs" 1>&2 - fi - - if test "$preload" = yes; then - if test "$dlopen" = unknown && test "$dlopen_self" = unknown && - test "$dlopen_self_static" = unknown; then - $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support." - fi - fi - - if test "$dlself" = yes && test "$export_dynamic" = no; then - $echo "$modename: error: \`-dlopen self' requires \`-export-dynamic'" 1>&2 - exit 1 - fi - - if test -n "$rpath$xrpath"; then - # If the user specified any rpath flags, then add them. - for libdir in $rpath $xrpath; do - # This is the magic to use -rpath. - case "$compile_rpath " in - *" $libdir "*) ;; - *) compile_rpath="$compile_rpath $libdir" ;; - esac - case "$finalize_rpath " in - *" $libdir "*) ;; - *) finalize_rpath="$finalize_rpath $libdir" ;; - esac - done - fi - - # Now hardcode the library paths - rpath= - hardcode_libdirs= - for libdir in $compile_rpath $finalize_rpath; do - if test -n "$hardcode_libdir_flag_spec"; then - if test -n "$hardcode_libdir_separator"; then - if test -z "$hardcode_libdirs"; then - hardcode_libdirs="$libdir" - else - # Just accumulate the unique libdirs. - case "$hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator" in - *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) - ;; - *) - hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" - ;; - esac - fi - else - eval flag=\"$hardcode_libdir_flag_spec\" - - rpath="$rpath $flag" - fi - elif test -n "$runpath_var"; then - case "$perm_rpath " in - *" $libdir "*) ;; - *) perm_rpath="$perm_rpath $libdir" ;; - esac - fi - done - # Substitute the hardcoded libdirs into the rpath. - if test -n "$hardcode_libdir_separator" && - test -n "$hardcode_libdirs"; then - libdir="$hardcode_libdirs" - eval rpath=\" $hardcode_libdir_flag_spec\" - fi - compile_rpath="$rpath" - - rpath= - hardcode_libdirs= - for libdir in $finalize_rpath; do - if test -n "$hardcode_libdir_flag_spec"; then - if test -n "$hardcode_libdir_separator"; then - if test -z "$hardcode_libdirs"; then - hardcode_libdirs="$libdir" - else - # Just accumulate the unique libdirs. - case "$hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator" in - *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) - ;; - *) - hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" - ;; - esac - fi - else - eval flag=\"$hardcode_libdir_flag_spec\" - - rpath="$rpath $flag" - fi - elif test -n "$runpath_var"; then - case "$finalize_perm_rpath " in - *" $libdir "*) ;; - *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;; - esac - fi - done - # Substitute the hardcoded libdirs into the rpath. - if test -n "$hardcode_libdir_separator" && - test -n "$hardcode_libdirs"; then - libdir="$hardcode_libdirs" - eval rpath=\" $hardcode_libdir_flag_spec\" - fi - finalize_rpath="$rpath" - - output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'` - if test "X$output_objdir" = "X$output"; then - output_objdir="$objdir" - else - output_objdir="$output_objdir/$objdir" - fi - - if test -n "$libobjs" && test "$build_old_libs" = yes; then - # Transform all the library objects into standard objects. - compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` - finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` - fi - - dlsyms= - if test -n "$dlfiles$dlprefiles" || test "$dlself" = yes; then - if test -n "$NM" && test -n "$global_symbol_pipe"; then - dlsyms="${outputname}S.c" - else - $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2 - fi - fi - - if test -n "$dlsyms"; then - case "$dlsyms" in - "") ;; - *.c) - # Discover the nlist of each of the dlfiles. - nlist="$objdir/${output}.nm" - - if test -d $objdir; then - $show "$rm $nlist ${nlist}S ${nlist}T" - $run $rm "$nlist" "${nlist}S" "${nlist}T" - else - $show "$mkdir $objdir" - $run $mkdir $objdir - status=$? - if test $status -ne 0 && test ! -d $objdir; then - exit $status - fi - fi - - # Parse the name list into a source file. - $show "creating $objdir/$dlsyms" - - $echo > "$objdir/$dlsyms" "\ -/* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */ -/* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */ - -#ifdef __cplusplus -extern \"C\" { -#endif - -/* Prevent the only kind of declaration conflicts we can make. */ -#define lt_preloaded_symbols some_other_symbol - -/* External symbol declarations for the compiler. */\ -" - - if test "$dlself" = yes; then - $show "generating symbol list for \`$output'" - - echo ': @PROGRAM@ ' > "$nlist" - - # Add our own program objects to the symbol list. - progfiles=`$echo "X$objs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` - for arg in $progfiles; do - $show "extracting global C symbols from \`$arg'" - $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'" - done - - if test -n "$exclude_expsyms"; then - $run eval 'egrep -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' - $run eval '$mv "$nlist"T "$nlist"' - fi - - if test -n "$export_symbols_regex"; then - $run eval 'egrep -e "$export_symbols_regex" "$nlist" > "$nlist"T' - $run eval '$mv "$nlist"T "$nlist"' - fi - - # Prepare the list of exported symbols - if test -z "$export_symbols"; then - export_symbols="$objdir/$output.exp" - $run $rm $export_symbols - $run eval "sed -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' - else - $run $rm $export_symbols - $run eval "sed -e 's/\([][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$objdir/$output.exp"' - $run eval 'grep -f "$objdir/$output.exp" < "$nlist" > "$nlist"T' - $run eval 'mv "$nlist"T "$nlist"' - fi - fi - - for arg in $dlprefiles; do - $show "extracting global C symbols from \`$arg'" - name=`echo "$arg" | sed -e 's%^.*/%%'` - $run eval 'echo ": $name " >> "$nlist"' - $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'" - done - - if test -z "$run"; then - # Make sure we have at least an empty file. - test -f "$nlist" || : > "$nlist" - - if test -n "$exclude_expsyms"; then - egrep -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T - $mv "$nlist"T "$nlist" - fi - - # Try sorting and uniquifying the output. - if grep -v "^: " < "$nlist" | sort +2 | uniq > "$nlist"S; then - : - else - grep -v "^: " < "$nlist" > "$nlist"S - fi - - if test -f "$nlist"S; then - eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"' - else - echo '/* NONE */' >> "$output_objdir/$dlsyms" - fi - - $echo >> "$output_objdir/$dlsyms" "\ - -#undef lt_preloaded_symbols - -#if defined (__STDC__) && __STDC__ -# define lt_ptr_t void * -#else -# define lt_ptr_t char * -# define const -#endif - -/* The mapping between symbol names and symbols. */ -const struct { - const char *name; - lt_ptr_t address; -} -lt_preloaded_symbols[] = -{\ -" - - sed -n -e 's/^: \([^ ]*\) $/ {\"\1\", (lt_ptr_t) 0},/p' \ - -e 's/^. \([^ ]*\) \([^ ]*\)$/ {"\2", (lt_ptr_t) \&\2},/p' \ - < "$nlist" >> "$output_objdir/$dlsyms" - - $echo >> "$output_objdir/$dlsyms" "\ - {0, (lt_ptr_t) 0} -}; - -/* This works around a problem in FreeBSD linker */ -#ifdef FREEBSD_WORKAROUND -static const void *lt_preloaded_setup() { - return lt_preloaded_symbols; -} -#endif - -#ifdef __cplusplus -} -#endif\ -" - fi - - pic_flag_for_symtable= - case "$host" in - # compiling the symbol table file with pic_flag works around - # a FreeBSD bug that causes programs to crash when -lm is - # linked before any other PIC object. But we must not use - # pic_flag when linking with -static. The problem exists in - # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1. - *-*-freebsd2*|*-*-freebsd3.0*) - case "$compile_command " in - *" -static "*) ;; - *) pic_flag_for_symtable=" $pic_flag -DPIC -DFREEBSD_WORKAROUND";; - esac - esac - - # Now compile the dynamic symbol file. - $show "(cd $objdir && $C_compiler -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")" - $run eval '(cd $objdir && $C_compiler -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $? - - # Transform the symbol file into the correct name. - compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$objdir/${output}S.${objext}%"` - finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$objdir/${output}S.${objext}%"` - ;; - *) - $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2 - exit 1 - ;; - esac - else - # We keep going just in case the user didn't refer to - # lt_preloaded_symbols. The linker will fail if global_symbol_pipe - # really was required. - - # Nullify the symbol file. - compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"` - finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"` - fi - - if test -z "$link_against_libtool_libs" || test "$build_libtool_libs" != yes; then - # Replace the output file specification. - compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'` - link_command="$compile_command$compile_rpath" - - # We have no uninstalled library dependencies, so finalize right now. - $show "$link_command" - $run eval "$link_command" - exit $? - fi - - if test -n "$shlibpath_var"; then - # We should set the shlibpath_var - rpath= - for dir in $temp_rpath; do - case "$dir" in - /* | [A-Za-z]:[/\\]*) - # Absolute path. - rpath="$rpath$dir:" - ;; - *) - # Relative path: add a thisdir entry. - rpath="$rpath\$thisdir/$dir:" - ;; - esac - done - temp_rpath="$rpath" - fi - - if test -n "$compile_shlibpath$finalize_shlibpath"; then - compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command" - fi - if test -n "$finalize_shlibpath"; then - finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command" - fi - - compile_var= - finalize_var= - if test -n "$runpath_var"; then - if test -n "$perm_rpath"; then - # We should set the runpath_var. - rpath= - for dir in $perm_rpath; do - rpath="$rpath$dir:" - done - compile_var="$runpath_var=\"$rpath\$$runpath_var\" " - fi - if test -n "$finalize_perm_rpath"; then - # We should set the runpath_var. - rpath= - for dir in $finalize_perm_rpath; do - rpath="$rpath$dir:" - done - finalize_var="$runpath_var=\"$rpath\$$runpath_var\" " - fi - fi - - if test "$hardcode_action" = relink; then - # Fast installation is not supported - link_command="$compile_var$compile_command$compile_rpath" - relink_command="$finalize_var$finalize_command$finalize_rpath" - - # AGH! Flame the AIX and HP-UX people for me, will ya? - $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2 - $echo "$modename: \`$output' will be relinked during installation" 1>&2 - else - if test "$fast_install" != no; then - link_command="$finalize_var$compile_command$finalize_rpath" - if test "$fast_install" = yes; then - relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'` - else - # fast_install is set to needless - relink_command= - fi - else - link_command="$compile_var$compile_command$compile_rpath" - relink_command="$finalize_var$finalize_command$finalize_rpath" - fi - fi - - # Replace the output file specification. - link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` - - # Create the binary in the object directory, then wrap it. - if test ! -d $output_objdir; then - $show "$mkdir $output_objdir" - $run $mkdir $output_objdir - status=$? - if test $status -ne 0 && test ! -d $objdir; then - exit $status - fi - fi - - # Delete the old output file. - $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname - - $show "$link_command" - $run eval "$link_command" || exit $? - - # Now create the wrapper script. - $show "creating $output" - - # Quote the relink command for shipping. - if test -n "$relink_command"; then - relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"` - fi - - # Quote $echo for shipping. - if test "X$echo" = "X$SHELL $0 --fallback-echo"; then - case "$0" in - /* | [A-Za-z]:[/\\]*) qecho="$SHELL $0 --fallback-echo";; - *) qecho="$SHELL `pwd`/$0 --fallback-echo";; - esac - qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"` - else - qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"` - fi - - # Only actually do things if our run command is non-null. - if test -z "$run"; then - # win32 will think the script is a binary if it has - # a .exe suffix, so we strip it off here. - case $output in - *.exe) output=`echo $output|sed 's,.exe$,,'` ;; - esac - $rm $output - trap "$rm $output; exit 1" 1 2 15 - - $echo > $output "\ -#! $SHELL - -# $output - temporary wrapper script for $objdir/$outputname -# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP -# -# The $output program cannot be directly executed until all the libtool -# libraries that it depends on are installed. -# -# This wrapper script should never be moved out of the build directory. -# If it is, it will not operate correctly. - -# Sed substitution that helps us do robust quoting. It backslashifies -# metacharacters that are still active within double-quoted strings. -Xsed='sed -e 1s/^X//' -sed_quote_subst='$sed_quote_subst' - -# The HP-UX ksh and POSIX shell print the target directory to stdout -# if CDPATH is set. -if test \"\${CDPATH+set}\" = set; then CDPATH=; export CDPATH; fi - -relink_command=\"$relink_command\" - -# This environment variable determines our operation mode. -if test \"\$libtool_install_magic\" = \"$magic\"; then - # install mode needs the following variable: - link_against_libtool_libs='$link_against_libtool_libs' -else - # When we are sourced in execute mode, \$file and \$echo are already set. - if test \"\$libtool_execute_magic\" != \"$magic\"; then - echo=\"$qecho\" - file=\"\$0\" - # Make sure echo works. - if test \"X\$1\" = X--no-reexec; then - # Discard the --no-reexec flag, and continue. - shift - elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then - # Yippee, \$echo works! - : - else - # Restart under the correct shell, and then maybe \$echo will work. - exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"} - fi - fi\ -" - $echo >> $output "\ - - # Find the directory that this script lives in. - thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\` - test \"x\$thisdir\" = \"x\$file\" && thisdir=. - - # Follow symbolic links until we get to the real thisdir. - file=\`ls -ld \"\$file\" | sed -n 's/.*-> //p'\` - while test -n \"\$file\"; do - destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\` - - # If there was a directory component, then change thisdir. - if test \"x\$destdir\" != \"x\$file\"; then - case \"\$destdir\" in - /* | [A-Za-z]:[/\\]*) thisdir=\"\$destdir\" ;; - *) thisdir=\"\$thisdir/\$destdir\" ;; - esac - fi - - file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\` - file=\`ls -ld \"\$thisdir/\$file\" | sed -n 's/.*-> //p'\` - done - - # Try to get the absolute directory name. - absdir=\`cd \"\$thisdir\" && pwd\` - test -n \"\$absdir\" && thisdir=\"\$absdir\" -" - - if test "$fast_install" = yes; then - echo >> $output "\ - program=lt-'$outputname' - progdir=\"\$thisdir/$objdir\" - - if test ! -f \"\$progdir/\$program\" || \\ - { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | sed 1q\`; \\ - test \"X\$file\" != \"X\$progdir/\$program\"; }; then - - file=\"\$\$-\$program\" - - if test ! -d \"\$progdir\"; then - $mkdir \"\$progdir\" - else - $rm \"\$progdir/\$file\" - fi" - - echo >> $output "\ - - # relink executable if necessary - if test -n \"\$relink_command\"; then - if (cd \"\$thisdir\" && eval \$relink_command); then : - else - $rm \"\$progdir/\$file\" - exit 1 - fi - fi - - $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null || - { $rm \"\$progdir/\$program\"; - $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; } - $rm \"\$progdir/\$file\" - fi" - else - echo >> $output "\ - program='$outputname' - progdir=\"\$thisdir/$objdir\" -" - fi - - echo >> $output "\ - - if test -f \"\$progdir/\$program\"; then" - - # Export our shlibpath_var if we have one. - if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then - $echo >> $output "\ - # Add our own library path to $shlibpath_var - $shlibpath_var=\"$temp_rpath\$$shlibpath_var\" - - # Some systems cannot cope with colon-terminated $shlibpath_var - # The second colon is a workaround for a bug in BeOS R4 sed - $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\` - - export $shlibpath_var -" - fi - - # fixup the dll searchpath if we need to. - if test -n "$dllsearchpath"; then - $echo >> $output "\ - # Add the dll search path components to the executable PATH - PATH=$dllsearchpath:\$PATH -" - fi - - $echo >> $output "\ - if test \"\$libtool_execute_magic\" != \"$magic\"; then - # Run the actual program with our arguments. -" - case $host in - *-*-cygwin* | *-*-mingw | *-*-os2*) - # win32 systems need to use the prog path for dll - # lookup to work - $echo >> $output "\ - exec \$progdir\\\\\$program \${1+\"\$@\"} -" - ;; - *) - $echo >> $output "\ - # Export the path to the program. - PATH=\"\$progdir:\$PATH\" - export PATH - - exec \$program \${1+\"\$@\"} -" - ;; - esac - $echo >> $output "\ - \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\" - exit 1 - fi - else - # The program doesn't exist. - \$echo \"\$0: error: \$progdir/\$program does not exist\" 1>&2 - \$echo \"This script is just a wrapper for \$program.\" 1>&2 - echo \"See the $PACKAGE documentation for more information.\" 1>&2 - exit 1 - fi -fi\ -" - chmod +x $output - fi - exit 0 - ;; - esac - - # See if we need to build an old-fashioned archive. - for oldlib in $oldlibs; do - - if test "$build_libtool_libs" = convenience; then - oldobjs="$libobjs_save" - addlibs="$convenience" - build_libtool_libs=no - else - if test "$build_libtool_libs" = module; then - oldobjs="$libobjs_save" - build_libtool_libs=no - else - oldobjs="$objs "`$echo "X$libobjs_save" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP` - fi - addlibs="$old_convenience" - fi - - # Add in members from convenience archives. - for xlib in $addlibs; do - # Extract the objects. - xdir="$xlib"x - generated="$generated $xdir" - xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'` - - $show "${rm}r $xdir" - $run ${rm}r "$xdir" - $show "mkdir $xdir" - $run mkdir "$xdir" - status=$? - if test $status -ne 0 && test ! -d "$xdir"; then - exit $status - fi - $show "(cd $xdir && $AR x ../$xlib)" - $run eval "(cd \$xdir && $AR x ../\$xlib)" || exit $? - - oldobjs="$oldobjs "`find $xdir -name \*.o -print -o -name \*.lo -print | $NL2SP` - done - - # Do each command in the archive commands. - if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then - eval cmds=\"$old_archive_from_new_cmds\" - else - eval cmds=\"$old_archive_cmds\" - fi - IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do - IFS="$save_ifs" - $show "$cmd" - $run eval "$cmd" || exit $? - done - IFS="$save_ifs" - done - - if test -n "$generated"; then - $show "${rm}r$generated" - $run ${rm}r$generated - fi - - # Now create the libtool archive. - case "$output" in - *.la) - old_library= - test "$build_old_libs" = yes && old_library="$libname.$libext" - $show "creating $output" - - if test -n "$xrpath"; then - temp_xrpath= - for libdir in $xrpath; do - temp_xrpath="$temp_xrpath -R$libdir" - done - dependency_libs="$temp_xrpath $dependency_libs" - fi - - # Only create the output if not a dry run. - if test -z "$run"; then - $echo > $output "\ -# $output - a libtool library file -# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP - -# The name that we can dlopen(3). -dlname='$dlname' - -# Names of this library. -library_names='$library_names' - -# The name of the static archive. -old_library='$old_library' - -# Libraries that this one depends upon. -dependency_libs='$dependency_libs' - -# Version information for $libname. -current=$current -age=$age -revision=$revision - -# Is this an already installed library? -installed=no - -# Directory that this library needs to be installed in: -libdir='$install_libdir'\ -" - - $rm "$output_objdir/$outputname"i - sed 's/^installed=no$/installed=yes/' \ - < "$output" > "$output_objdir/$outputname"i || exit 1 - fi - - # Do a symbolic link so that the libtool archive can be found in - # LD_LIBRARY_PATH before the program is installed. - $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)" - $run eval "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)" || exit $? - ;; - esac - exit 0 - ;; - - # libtool install mode - install) - modename="$modename: install" - - # There may be an optional sh(1) argument at the beginning of - # install_prog (especially on Windows NT). - if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh; then - # Aesthetically quote it. - arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"` - case "$arg" in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*) - arg="\"$arg\"" - ;; - esac - install_prog="$arg " - arg="$1" - shift - else - install_prog= - arg="$nonopt" - fi - - # The real first argument should be the name of the installation program. - # Aesthetically quote it. - arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` - case "$arg" in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*) - arg="\"$arg\"" - ;; - esac - install_prog="$install_prog$arg" - - # We need to accept at least all the BSD install flags. - dest= - files= - opts= - prev= - install_type= - isdir=no - stripme= - for arg - do - if test -n "$dest"; then - files="$files $dest" - dest="$arg" - continue - fi - - case "$arg" in - -d) isdir=yes ;; - -f) prev="-f" ;; - -g) prev="-g" ;; - -m) prev="-m" ;; - -o) prev="-o" ;; - -s) - stripme=" -s" - continue - ;; - -*) ;; - - *) - # If the previous option needed an argument, then skip it. - if test -n "$prev"; then - prev= - else - dest="$arg" - continue - fi - ;; - esac - - # Aesthetically quote the argument. - arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` - case "$arg" in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*) - arg="\"$arg\"" - ;; - esac - install_prog="$install_prog $arg" - done - - if test -z "$install_prog"; then - $echo "$modename: you must specify an install program" 1>&2 - $echo "$help" 1>&2 - exit 1 - fi - - if test -n "$prev"; then - $echo "$modename: the \`$prev' option requires an argument" 1>&2 - $echo "$help" 1>&2 - exit 1 - fi - - if test -z "$files"; then - if test -z "$dest"; then - $echo "$modename: no file or destination specified" 1>&2 - else - $echo "$modename: you must specify a destination" 1>&2 - fi - $echo "$help" 1>&2 - exit 1 - fi - - # Strip any trailing slash from the destination. - dest=`$echo "X$dest" | $Xsed -e 's%/$%%'` - - # Check to see that the destination is a directory. - test -d "$dest" && isdir=yes - if test "$isdir" = yes; then - destdir="$dest" - destname= - else - destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'` - test "X$destdir" = "X$dest" && destdir=. - destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'` - - # Not a directory, so check to see that there is only one file specified. - set dummy $files - if test $# -gt 2; then - $echo "$modename: \`$dest' is not a directory" 1>&2 - $echo "$help" 1>&2 - exit 1 - fi - fi - case "$destdir" in - /* | [A-Za-z]:[/\\]*) ;; - *) - for file in $files; do - case "$file" in - *.lo) ;; - *) - $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2 - $echo "$help" 1>&2 - exit 1 - ;; - esac - done - ;; - esac - - # This variable tells wrapper scripts just to set variables rather - # than running their programs. - libtool_install_magic="$magic" - - staticlibs= - future_libdirs= - current_libdirs= - for file in $files; do - - # Do each installation. - case "$file" in - *.a | *.lib) - # Do the static libraries later. - staticlibs="$staticlibs $file" - ;; - - *.la) - # Check to see that this really is a libtool archive. - if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : - else - $echo "$modename: \`$file' is not a valid libtool archive" 1>&2 - $echo "$help" 1>&2 - exit 1 - fi - - library_names= - old_library= - # If there is no directory component, then add one. - case "$file" in - */* | *\\*) . $file ;; - *) . ./$file ;; - esac - - # Add the libdir to current_libdirs if it is the destination. - if test "X$destdir" = "X$libdir"; then - case "$current_libdirs " in - *" $libdir "*) ;; - *) current_libdirs="$current_libdirs $libdir" ;; - esac - else - # Note the libdir as a future libdir. - case "$future_libdirs " in - *" $libdir "*) ;; - *) future_libdirs="$future_libdirs $libdir" ;; - esac - fi - - dir="`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/" - test "X$dir" = "X$file/" && dir= - dir="$dir$objdir" - - # See the names of the shared library. - set dummy $library_names - if test -n "$2"; then - realname="$2" - shift - shift - - # Install the shared library and build the symlinks. - $show "$install_prog $dir/$realname $destdir/$realname" - $run eval "$install_prog $dir/$realname $destdir/$realname" || exit $? - test "X$dlname" = "X$realname" && dlname= - - if test $# -gt 0; then - # Delete the old symlinks, and create new ones. - for linkname - do - test "X$dlname" = "X$linkname" && dlname= - if test "$linkname" != "$realname"; then - $show "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)" - $run eval "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)" - fi - done - fi - - if test -n "$dlname"; then - # Install the dynamically-loadable library. - $show "$install_prog $dir/$dlname $destdir/$dlname" - $run eval "$install_prog $dir/$dlname $destdir/$dlname" || exit $? - fi - - # Do each command in the postinstall commands. - lib="$destdir/$realname" - eval cmds=\"$postinstall_cmds\" - IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do - IFS="$save_ifs" - $show "$cmd" - $run eval "$cmd" || exit $? - done - IFS="$save_ifs" - fi - - # Install the pseudo-library for information purposes. - name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` - instname="$dir/$name"i - if test ! -f "$instname"; then - # Just in case it was removed... - $show "Creating $instname" - $rm "$instname" - sed 's/^installed=no$/installed=yes/' "$file" > "$instname" - fi - $show "$install_prog $instname $destdir/$name" - $run eval "$install_prog $instname $destdir/$name" || exit $? - - # Maybe install the static library, too. - test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library" - ;; - - *.lo) - # Install (i.e. copy) a libtool object. - - # Figure out destination file name, if it wasn't already specified. - if test -n "$destname"; then - destfile="$destdir/$destname" - else - destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'` - destfile="$destdir/$destfile" - fi - - # Deduce the name of the destination old-style object file. - case "$destfile" in - *.lo) - staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"` - ;; - *.o | *.obj) - staticdest="$destfile" - destfile= - ;; - *) - $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2 - $echo "$help" 1>&2 - exit 1 - ;; - esac - - # Install the libtool object if requested. - if test -n "$destfile"; then - $show "$install_prog $file $destfile" - $run eval "$install_prog $file $destfile" || exit $? - fi - - # Install the old object if enabled. - if test "$build_old_libs" = yes; then - # Deduce the name of the old-style object file. - staticobj=`$echo "X$file" | $Xsed -e "$lo2o"` - - $show "$install_prog $staticobj $staticdest" - $run eval "$install_prog \$staticobj \$staticdest" || exit $? - fi - exit 0 - ;; - - *) - # Figure out destination file name, if it wasn't already specified. - if test -n "$destname"; then - destfile="$destdir/$destname" - else - destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'` - destfile="$destdir/$destfile" - fi - - # Do a test to see if this is really a libtool program. - if (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then - link_against_libtool_libs= - relink_command= - - # If there is no directory component, then add one. - case "$file" in - */* | *\\*) . $file ;; - *) . ./$file ;; - esac - - # Check the variables that should have been set. - if test -z "$link_against_libtool_libs"; then - $echo "$modename: invalid libtool wrapper script \`$file'" 1>&2 - exit 1 - fi - - finalize=yes - for lib in $link_against_libtool_libs; do - # Check to see that each library is installed. - libdir= - if test -f "$lib"; then - # If there is no directory component, then add one. - case "$lib" in - */* | *\\*) . $lib ;; - *) . ./$lib ;; - esac - fi - libfile="$libdir/`$echo "X$lib" | $Xsed -e 's%^.*/%%g'`" - if test -n "$libdir" && test ! -f "$libfile"; then - $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2 - finalize=no - fi - done - - outputname= - if test "$fast_install" = no && test -n "$relink_command"; then - if test "$finalize" = yes; then - outputname="/tmp/$$-$file" - # Replace the output file specification. - relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'` - - $echo "$modename: warning: relinking \`$file' on behalf of your buggy system linker" 1>&2 - $show "$relink_command" - if $run eval "$relink_command"; then : - else - $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2 - continue - fi - file="$outputname" - else - $echo "$modename: warning: cannot relink \`$file' on behalf of your buggy system linker" 1>&2 - fi - else - # Install the binary that we compiled earlier. - file=`$echo "X$file" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"` - fi - fi - - $show "$install_prog$stripme $file $destfile" - $run eval "$install_prog\$stripme \$file \$destfile" || exit $? - test -n "$outputname" && $rm $outputname - ;; - esac - done - - for file in $staticlibs; do - name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` - - # Set up the ranlib parameters. - oldlib="$destdir/$name" - - $show "$install_prog $file $oldlib" - $run eval "$install_prog \$file \$oldlib" || exit $? - - # Do each command in the postinstall commands. - eval cmds=\"$old_postinstall_cmds\" - IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do - IFS="$save_ifs" - $show "$cmd" - $run eval "$cmd" || exit $? - done - IFS="$save_ifs" - done - - if test -n "$future_libdirs"; then - $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2 - fi - - if test -n "$current_libdirs"; then - # Maybe just do a dry run. - test -n "$run" && current_libdirs=" -n$current_libdirs" - exec $SHELL $0 --finish$current_libdirs - exit 1 - fi - - exit 0 - ;; - - # libtool finish mode - finish) - modename="$modename: finish" - libdirs="$nonopt" - admincmds= - - if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then - for dir - do - libdirs="$libdirs $dir" - done - - for libdir in $libdirs; do - if test -n "$finish_cmds"; then - # Do each command in the finish commands. - eval cmds=\"$finish_cmds\" - IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do - IFS="$save_ifs" - $show "$cmd" - $run eval "$cmd" || admincmds="$admincmds - $cmd" - done - IFS="$save_ifs" - fi - if test -n "$finish_eval"; then - # Do the single finish_eval. - eval cmds=\"$finish_eval\" - $run eval "$cmds" || admincmds="$admincmds - $cmds" - fi - done - fi - - # Exit here if they wanted silent mode. - test "$show" = : && exit 0 - - echo "----------------------------------------------------------------------" - echo "Libraries have been installed in:" - for libdir in $libdirs; do - echo " $libdir" - done - echo - echo "If you ever happen to want to link against installed libraries" - echo "in a given directory, LIBDIR, you must either use libtool, and" - echo "specify the full pathname of the library, or use \`-LLIBDIR'" - echo "flag during linking and do at least one of the following:" - if test -n "$shlibpath_var"; then - echo " - add LIBDIR to the \`$shlibpath_var' environment variable" - echo " during execution" - fi - if test -n "$runpath_var"; then - echo " - add LIBDIR to the \`$runpath_var' environment variable" - echo " during linking" - fi - if test -n "$hardcode_libdir_flag_spec"; then - libdir=LIBDIR - eval flag=\"$hardcode_libdir_flag_spec\" - - echo " - use the \`$flag' linker flag" - fi - if test -n "$admincmds"; then - echo " - have your system administrator run these commands:$admincmds" - fi - if test -f /etc/ld.so.conf; then - echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'" - fi - echo - echo "See any operating system documentation about shared libraries for" - echo "more information, such as the ld(1) and ld.so(8) manual pages." - echo "----------------------------------------------------------------------" - exit 0 - ;; - - # libtool execute mode - execute) - modename="$modename: execute" - - # The first argument is the command name. - cmd="$nonopt" - if test -z "$cmd"; then - $echo "$modename: you must specify a COMMAND" 1>&2 - $echo "$help" - exit 1 - fi - - # Handle -dlopen flags immediately. - for file in $execute_dlfiles; do - if test ! -f "$file"; then - $echo "$modename: \`$file' is not a file" 1>&2 - $echo "$help" 1>&2 - exit 1 - fi - - dir= - case "$file" in - *.la) - # Check to see that this really is a libtool archive. - if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : - else - $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 - $echo "$help" 1>&2 - exit 1 - fi - - # Read the libtool library. - dlname= - library_names= - - # If there is no directory component, then add one. - case "$file" in - */* | *\\*) . $file ;; - *) . ./$file ;; - esac - - # Skip this library if it cannot be dlopened. - if test -z "$dlname"; then - # Warn if it was a shared library. - test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'" - continue - fi - - dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` - test "X$dir" = "X$file" && dir=. - - if test -f "$dir/$objdir/$dlname"; then - dir="$dir/$objdir" - else - $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2 - exit 1 - fi - ;; - - *.lo) - # Just add the directory containing the .lo file. - dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` - test "X$dir" = "X$file" && dir=. - ;; - - *) - $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2 - continue - ;; - esac - - # Get the absolute pathname. - absdir=`cd "$dir" && pwd` - test -n "$absdir" && dir="$absdir" - - # Now add the directory to shlibpath_var. - if eval "test -z \"\$$shlibpath_var\""; then - eval "$shlibpath_var=\"\$dir\"" - else - eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\"" - fi - done - - # This variable tells wrapper scripts just to set shlibpath_var - # rather than running their programs. - libtool_execute_magic="$magic" - - # Check if any of the arguments is a wrapper script. - args= - for file - do - case "$file" in - -*) ;; - *) - # Do a test to see if this is really a libtool program. - if (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then - # If there is no directory component, then add one. - case "$file" in - */* | *\\*) . $file ;; - *) . ./$file ;; - esac - - # Transform arg to wrapped name. - file="$progdir/$program" - fi - ;; - esac - # Quote arguments (to preserve shell metacharacters). - file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"` - args="$args \"$file\"" - done - - if test -z "$run"; then - # Export the shlibpath_var. - eval "export $shlibpath_var" - - # Restore saved enviroment variables - if test "${save_LC_ALL+set}" = set; then - LC_ALL="$save_LC_ALL"; export LC_ALL - fi - if test "${save_LANG+set}" = set; then - LANG="$save_LANG"; export LANG - fi - - # Now actually exec the command. - eval "exec \$cmd$args" - - $echo "$modename: cannot exec \$cmd$args" - exit 1 - else - # Display what would be done. - eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\"" - $echo "export $shlibpath_var" - $echo "$cmd$args" - exit 0 - fi - ;; - - # libtool uninstall mode - uninstall) - modename="$modename: uninstall" - rm="$nonopt" - files= - - for arg - do - case "$arg" in - -*) rm="$rm $arg" ;; - *) files="$files $arg" ;; - esac - done - - if test -z "$rm"; then - $echo "$modename: you must specify an RM program" 1>&2 - $echo "$help" 1>&2 - exit 1 - fi - - for file in $files; do - dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` - test "X$dir" = "X$file" && dir=. - name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` - - rmfiles="$file" - - case "$name" in - *.la) - # Possibly a libtool archive, so verify it. - if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then - . $dir/$name - - # Delete the libtool libraries and symlinks. - for n in $library_names; do - rmfiles="$rmfiles $dir/$n" - test "X$n" = "X$dlname" && dlname= - done - test -n "$dlname" && rmfiles="$rmfiles $dir/$dlname" - test -n "$old_library" && rmfiles="$rmfiles $dir/$old_library" - - $show "$rm $rmfiles" - $run $rm $rmfiles - - if test -n "$library_names"; then - # Do each command in the postuninstall commands. - eval cmds=\"$postuninstall_cmds\" - IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do - IFS="$save_ifs" - $show "$cmd" - $run eval "$cmd" - done - IFS="$save_ifs" - fi - - if test -n "$old_library"; then - # Do each command in the old_postuninstall commands. - eval cmds=\"$old_postuninstall_cmds\" - IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do - IFS="$save_ifs" - $show "$cmd" - $run eval "$cmd" - done - IFS="$save_ifs" - fi - - # FIXME: should reinstall the best remaining shared library. - fi - ;; - - *.lo) - if test "$build_old_libs" = yes; then - oldobj=`$echo "X$name" | $Xsed -e "$lo2o"` - rmfiles="$rmfiles $dir/$oldobj" - fi - $show "$rm $rmfiles" - $run $rm $rmfiles - ;; - - *) - $show "$rm $rmfiles" - $run $rm $rmfiles - ;; - esac - done - exit 0 - ;; - - "") - $echo "$modename: you must specify a MODE" 1>&2 - $echo "$generic_help" 1>&2 - exit 1 - ;; - esac - - $echo "$modename: invalid operation mode \`$mode'" 1>&2 - $echo "$generic_help" 1>&2 - exit 1 -fi # test -z "$show_help" - -# We need to display help for each of the modes. -case "$mode" in -"") $echo \ -"Usage: $modename [OPTION]... [MODE-ARG]... - -Provide generalized library-building support services. - - --config show all configuration variables - --debug enable verbose shell tracing --n, --dry-run display commands without modifying any files - --features display basic configuration information and exit - --finish same as \`--mode=finish' - --help display this help message and exit - --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS] - --quiet same as \`--silent' - --silent don't print informational messages - --version print version information - -MODE must be one of the following: - - compile compile a source file into a libtool object - execute automatically set library path, then run a program - finish complete the installation of libtool libraries - install install libraries or executables - link create a library or an executable - uninstall remove libraries from an installed directory - -MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for -a more detailed description of MODE." - exit 0 - ;; - -compile) - $echo \ -"Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE - -Compile a source file into a libtool library object. - -This mode accepts the following additional options: - - -o OUTPUT-FILE set the output file name to OUTPUT-FILE - -static always build a \`.o' file suitable for static linking - -COMPILE-COMMAND is a command to be used in creating a \`standard' object file -from the given SOURCEFILE. - -The output file name is determined by removing the directory component from -SOURCEFILE, then substituting the C source code suffix \`.c' with the -library object suffix, \`.lo'." - ;; - -execute) - $echo \ -"Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]... - -Automatically set library path, then run a program. - -This mode accepts the following additional options: - - -dlopen FILE add the directory containing FILE to the library path - -This mode sets the library path environment variable according to \`-dlopen' -flags. - -If any of the ARGS are libtool executable wrappers, then they are translated -into their corresponding uninstalled binary, and any of their required library -directories are added to the library path. - -Then, COMMAND is executed, with ARGS as arguments." - ;; - -finish) - $echo \ -"Usage: $modename [OPTION]... --mode=finish [LIBDIR]... - -Complete the installation of libtool libraries. - -Each LIBDIR is a directory that contains libtool libraries. - -The commands that this mode executes may require superuser privileges. Use -the \`--dry-run' option if you just want to see what would be executed." - ;; - -install) - $echo \ -"Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND... - -Install executables or libraries. - -INSTALL-COMMAND is the installation command. The first component should be -either the \`install' or \`cp' program. - -The rest of the components are interpreted as arguments to that command (only -BSD-compatible install options are recognized)." - ;; - -link) - $echo \ -"Usage: $modename [OPTION]... --mode=link LINK-COMMAND... - -Link object files or libraries together to form another library, or to -create an executable program. - -LINK-COMMAND is a command using the C compiler that you would use to create -a program from several object files. - -The following components of LINK-COMMAND are treated specially: - - -all-static do not do any dynamic linking at all - -avoid-version do not add a version suffix if possible - -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime - -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols - -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) - -export-symbols SYMFILE - try to export only the symbols listed in SYMFILE - -LLIBDIR search LIBDIR for required installed libraries - -lNAME OUTPUT-FILE requires the installed library libNAME - -module build a library that can dlopened - -no-undefined declare that a library does not refer to external symbols - -o OUTPUT-FILE create OUTPUT-FILE from the specified objects - -release RELEASE specify package release information - -rpath LIBDIR the created library will eventually be installed in LIBDIR - -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries - -static do not do any dynamic linking of libtool libraries - -version-info CURRENT[:REVISION[:AGE]] - specify library version info [each variable defaults to 0] - -All other options (arguments beginning with \`-') are ignored. - -Every other argument is treated as a filename. Files ending in \`.la' are -treated as uninstalled libtool libraries, other files are standard or library -object files. - -If the OUTPUT-FILE ends in \`.la', then a libtool library is created, -only library objects (\`.lo' files) may be specified, and \`-rpath' is -required, except when creating a convenience library. - -If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created -using \`ar' and \`ranlib', or on Windows using \`lib'. - -If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file -is created, otherwise an executable program is created." - ;; - -uninstall) - $echo -"Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE... - -Remove libraries from an installation directory. - -RM is the name of the program to use to delete files associated with each FILE -(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed -to RM. - -If FILE is a libtool library, all the files associated with it are deleted. -Otherwise, only FILE itself is deleted using RM." - ;; - -*) - $echo "$modename: invalid operation mode \`$mode'" 1>&2 - $echo "$help" 1>&2 - exit 1 - ;; -esac - -echo -$echo "Try \`$modename --help' for more information about other modes." - -exit 0 - -# Local Variables: -# mode:shell-script -# sh-indentation:2 -# End: diff --git a/acsupport/missing b/acsupport/missing deleted file mode 100644 --- a/acsupport/missing +++ /dev/null @@ -1,188 +0,0 @@ -#! /bin/sh -# Common stub for a few missing GNU programs while installing. -# Copyright (C) 1996, 1997 Free Software Foundation, Inc. -# Franc,ois 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, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -# 02111-1307, USA. - -if test $# -eq 0; then - echo 1>&2 "Try \`$0 --help' for more information" - exit 1 -fi - -case "$1" in - - -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 - -Supported PROGRAM values: - aclocal touch file \`aclocal.m4' - autoconf touch file \`configure' - autoheader touch file \`config.h.in' - 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 - lex create \`lex.yy.c', if possible, from existing .c - makeinfo touch the output file - yacc create \`y.tab.[ch]', if possible, from existing .[ch]" - ;; - - -v|--v|--ve|--ver|--vers|--versi|--versio|--version) - echo "missing - GNU libit 0.0" - ;; - - -*) - echo 1>&2 "$0: Unknown \`$1' option" - echo 1>&2 "Try \`$0 --help' for more information" - exit 1 - ;; - - aclocal) - echo 1>&2 "\ -WARNING: \`$1' is missing on your system. You should only need it if - you modified \`acinclude.m4' or \`configure.in'. 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 missing on your system. You should only need it if - you modified \`configure.in'. 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 missing on your system. You should only need it if - you modified \`acconfig.h' or \`configure.in'. 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.in` - if test -z "$files"; then - files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^):]*\)).*/\1/p' configure.in` - test -z "$files" || files="$files.in" - else - files=`echo "$files" | sed -e 's/:/ /g'` - fi - test -z "$files" && files="config.h.in" - touch $files - ;; - - automake) - echo 1>&2 "\ -WARNING: \`$1' is missing on your system. You should only need it if - you modified \`Makefile.am', \`acinclude.m4' or \`configure.in'. - 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$/touch \1.in/' \ - | sh - ;; - - bison|yacc) - echo 1>&2 "\ -WARNING: \`$1' is missing on your system. 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 [ $# -ne 1 ]; then - eval LASTARG="\${$#}" - case "$LASTARG" in - *.y) - SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` - if [ -f "$SRCFILE" ]; then - cp "$SRCFILE" y.tab.c - fi - SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` - if [ -f "$SRCFILE" ]; then - cp "$SRCFILE" y.tab.h - fi - ;; - esac - fi - if [ ! -f y.tab.h ]; then - echo >y.tab.h - fi - if [ ! -f y.tab.c ]; then - echo 'main() { return 0; }' >y.tab.c - fi - ;; - - lex|flex) - echo 1>&2 "\ -WARNING: \`$1' is missing on your system. 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 [ $# -ne 1 ]; then - eval LASTARG="\${$#}" - case "$LASTARG" in - *.l) - SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` - if [ -f "$SRCFILE" ]; then - cp "$SRCFILE" lex.yy.c - fi - ;; - esac - fi - if [ ! -f lex.yy.c ]; then - echo 'main() { return 0; }' >lex.yy.c - fi - ;; - - makeinfo) - echo 1>&2 "\ -WARNING: \`$1' is missing on your system. 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." - file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` - if test -z "$file"; then - file=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` - file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $file` - fi - touch $file - ;; - - *) - echo 1>&2 "\ -WARNING: \`$1' is needed, and you do not seem to have it handy on your - system. 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 prerequirements 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 diff --git a/acsupport/mkinstalldirs b/acsupport/mkinstalldirs deleted file mode 100644 --- a/acsupport/mkinstalldirs +++ /dev/null @@ -1,36 +0,0 @@ -#! /bin/sh -# mkinstalldirs --- make directory hierarchy -# Author: Noah Friedman -# Created: 1993-05-16 -# Last modified: 1994-03-25 -# Public domain - -errstatus=0 - -for file in ${1+"$@"} ; do - set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'` - shift - - pathcomp= - for d in ${1+"$@"} ; do - pathcomp="$pathcomp$d" - case "$pathcomp" in - -* ) pathcomp=./$pathcomp ;; - esac - - if test ! -d "$pathcomp"; then - echo "mkdir $pathcomp" 1>&2 - mkdir "$pathcomp" > /dev/null 2>&1 || lasterr=$? - fi - - if test ! -d "$pathcomp"; then - errstatus=$lasterr - fi - - pathcomp="$pathcomp/" - done -done - -exit $errstatus - -# mkinstalldirs ends here diff --git a/configure b/configure deleted file mode 100644 --- a/configure +++ /dev/null @@ -1,1245 +0,0 @@ -#! /bin/sh - -# Guess values for system-dependent variables and create Makefiles. -# Generated automatically using autoconf version 2.13 -# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc. -# -# This configure script is free software; the Free Software Foundation -# gives unlimited permission to copy, distribute and modify it. - -# Defaults: -ac_help= -ac_default_prefix=/usr/local -# Any additions from configure.in: -ac_help="$ac_help - --enable-maintainer-mode enable make rules and dependencies not useful - (and sometimes confusing) to the casual installer" - -# Initialize some variables set by options. -# The variables have the same names as the options, with -# dashes changed to underlines. -build=NONE -cache_file=./config.cache -exec_prefix=NONE -host=NONE -no_create= -nonopt=NONE -no_recursion= -prefix=NONE -program_prefix=NONE -program_suffix=NONE -program_transform_name=s,x,x, -silent= -site= -srcdir= -target=NONE -verbose= -x_includes=NONE -x_libraries=NONE -bindir='${exec_prefix}/bin' -sbindir='${exec_prefix}/sbin' -libexecdir='${exec_prefix}/libexec' -datadir='${prefix}/share' -sysconfdir='${prefix}/etc' -sharedstatedir='${prefix}/com' -localstatedir='${prefix}/var' -libdir='${exec_prefix}/lib' -includedir='${prefix}/include' -oldincludedir='/usr/include' -infodir='${prefix}/info' -mandir='${prefix}/man' - -# Initialize some other variables. -subdirs= -MFLAGS= MAKEFLAGS= -SHELL=${CONFIG_SHELL-/bin/sh} -# Maximum number of lines to put in a shell here document. -ac_max_here_lines=12 - -ac_prev= -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=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;; - *) ac_optarg= ;; - esac - - # Accept the important Cygnus configure options, so we can diagnose typos. - - case "$ac_option" in - - -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 ;; - -build=* | --build=* | --buil=* | --bui=* | --bu=*) - build="$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" ;; - - -datadir | --datadir | --datadi | --datad | --data | --dat | --da) - ac_prev=datadir ;; - -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ - | --da=*) - datadir="$ac_optarg" ;; - - -disable-* | --disable-*) - ac_feature=`echo $ac_option|sed -e 's/-*disable-//'` - # Reject names that are not valid shell variable names. - if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then - { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } - fi - ac_feature=`echo $ac_feature| sed 's/-/_/g'` - eval "enable_${ac_feature}=no" ;; - - -enable-* | --enable-*) - ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'` - # Reject names that are not valid shell variable names. - if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then - { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } - fi - ac_feature=`echo $ac_feature| sed 's/-/_/g'` - case "$ac_option" in - *=*) ;; - *) ac_optarg=yes ;; - esac - eval "enable_${ac_feature}='$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) - # 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 << EOF -Usage: configure [options] [host] -Options: [defaults in brackets after descriptions] -Configuration: - --cache-file=FILE cache test results in FILE - --help print this message - --no-create do not create output files - --quiet, --silent do not print \`checking...' messages - --version print the version of autoconf that created configure -Directory and file names: - --prefix=PREFIX install architecture-independent files in PREFIX - [$ac_default_prefix] - --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX - [same as prefix] - --bindir=DIR user executables in DIR [EPREFIX/bin] - --sbindir=DIR system admin executables in DIR [EPREFIX/sbin] - --libexecdir=DIR program executables in DIR [EPREFIX/libexec] - --datadir=DIR read-only architecture-independent data in DIR - [PREFIX/share] - --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc] - --sharedstatedir=DIR modifiable architecture-independent data in DIR - [PREFIX/com] - --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var] - --libdir=DIR object code libraries in DIR [EPREFIX/lib] - --includedir=DIR C header files in DIR [PREFIX/include] - --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include] - --infodir=DIR info documentation in DIR [PREFIX/info] - --mandir=DIR man documentation in DIR [PREFIX/man] - --srcdir=DIR find the sources in DIR [configure dir or ..] - --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 -EOF - cat << EOF -Host type: - --build=BUILD configure for building on BUILD [BUILD=HOST] - --host=HOST configure for HOST [guessed] - --target=TARGET configure for TARGET [TARGET=HOST] -Features and packages: - --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) - --enable-FEATURE[=ARG] include FEATURE [ARG=yes] - --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] - --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) - --x-includes=DIR X include files are in DIR - --x-libraries=DIR X library files are in DIR -EOF - if test -n "$ac_help"; then - echo "--enable and --with options recognized:$ac_help" - fi - exit 0 ;; - - -host | --host | --hos | --ho) - ac_prev=host ;; - -host=* | --host=* | --hos=* | --ho=*) - host="$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" ;; - - -localstatedir | --localstatedir | --localstatedi | --localstated \ - | --localstate | --localstat | --localsta | --localst \ - | --locals | --local | --loca | --loc | --lo) - ac_prev=localstatedir ;; - -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ - | --localstate=* | --localstat=* | --localsta=* | --localst=* \ - | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) - 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) - 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" ;; - - -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 ;; - -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) - target="$ac_optarg" ;; - - -v | -verbose | --verbose | --verbos | --verbo | --verb) - verbose=yes ;; - - -version | --version | --versio | --versi | --vers) - echo "configure generated by autoconf version 2.13" - exit 0 ;; - - -with-* | --with-*) - ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'` - # Reject names that are not valid shell variable names. - if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then - { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } - fi - ac_package=`echo $ac_package| sed 's/-/_/g'` - case "$ac_option" in - *=*) ;; - *) ac_optarg=yes ;; - esac - eval "with_${ac_package}='$ac_optarg'" ;; - - -without-* | --without-*) - ac_package=`echo $ac_option|sed -e 's/-*without-//'` - # Reject names that are not valid shell variable names. - if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then - { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } - fi - ac_package=`echo $ac_package| sed 's/-/_/g'` - eval "with_${ac_package}=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" ;; - - -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; } - ;; - - *) - if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then - echo "configure: warning: $ac_option: invalid host type" 1>&2 - fi - if test "x$nonopt" != xNONE; then - { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } - fi - nonopt="$ac_option" - ;; - - esac -done - -if test -n "$ac_prev"; then - { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; } -fi - -trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 - -# File descriptor usage: -# 0 standard input -# 1 file creation -# 2 errors and warnings -# 3 some systems may open it to /dev/tty -# 4 used on the Kubota Titan -# 6 checking for... messages and results -# 5 compiler messages saved in config.log -if test "$silent" = yes; then - exec 6>/dev/null -else - exec 6>&1 -fi -exec 5>./config.log - -echo "\ -This file contains any messages produced by compilers while -running configure, to aid debugging if configure makes a mistake. -" 1>&5 - -# Strip out --no-create and --no-recursion so they do not pile up. -# Also quote any args containing shell metacharacters. -ac_configure_args= -for ac_arg -do - case "$ac_arg" in - -no-create | --no-create | --no-creat | --no-crea | --no-cre \ - | --no-cr | --no-c) ;; - -no-recursion | --no-recursion | --no-recursio | --no-recursi \ - | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;; - *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*) - ac_configure_args="$ac_configure_args '$ac_arg'" ;; - *) ac_configure_args="$ac_configure_args $ac_arg" ;; - esac -done - -# NLS nuisances. -# Only set these to C if already set. These must not be set unconditionally -# because not all systems understand e.g. LANG=C (notably SCO). -# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'! -# Non-C LC_CTYPE values break the ctype check. -if test "${LANG+set}" = set; then LANG=C; export LANG; fi -if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi -if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi -if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi - -# confdefs.h avoids OS command line length limits that DEFS can exceed. -rm -rf conftest* confdefs.h -# AIX cpp loses on an empty file, so make sure it contains at least a newline. -echo > confdefs.h - -# A filename unique to this package, relative to the directory that -# configure is in, which we can look for to find out if srcdir is correct. -ac_unique_file=acsupport/config.guess - -# 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 its parent. - ac_prog=$0 - ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'` - test "x$ac_confdir" = "x$ac_prog" && ac_confdir=. - 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 - if test "$ac_srcdir_defaulted" = yes; then - { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; } - else - { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; } - fi -fi -srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'` - -# Prefer explicitly selected file to automatically selected ones. -if test -z "$CONFIG_SITE"; then - if test "x$prefix" != xNONE; then - CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" - else - CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" - fi -fi -for ac_site_file in $CONFIG_SITE; do - if test -r "$ac_site_file"; then - echo "loading site script $ac_site_file" - . "$ac_site_file" - fi -done - -if test -r "$cache_file"; then - echo "loading cache $cache_file" - . $cache_file -else - echo "creating cache $cache_file" - > $cache_file -fi - -ac_ext=c -# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. -ac_cpp='$CPP $CPPFLAGS' -ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' -ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' -cross_compiling=$ac_cv_prog_cc_cross - -ac_exeext= -ac_objext=o -if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then - # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu. - if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then - ac_n= ac_c=' -' ac_t=' ' - else - ac_n=-n ac_c= ac_t= - fi -else - ac_n= ac_c='\c' ac_t= -fi - - -ac_aux_dir= -for ac_dir in acsupport $srcdir/acsupport; 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 - fi -done -if test -z "$ac_aux_dir"; then - { echo "configure: error: can not find install-sh or install.sh in acsupport $srcdir/acsupport" 1>&2; exit 1; } -fi -ac_config_guess=$ac_aux_dir/config.guess -ac_config_sub=$ac_aux_dir/config.sub -ac_configure=$ac_aux_dir/configure # This should be Cygnus configure. - - -# Make sure we can run config.sub. -if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then : -else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; } -fi - -echo $ac_n "checking host system type""... $ac_c" 1>&6 -echo "configure:554: checking host system type" >&5 - -host_alias=$host -case "$host_alias" in -NONE) - case $nonopt in - NONE) - if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then : - else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; } - fi ;; - *) host_alias=$nonopt ;; - esac ;; -esac - -host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias` -host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` -host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` -host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` -echo "$ac_t""$host" 1>&6 - -# 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 -# 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" -# ./install, which can be erroneously created by make from ./install.sh. -echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 -echo "configure:586: checking for a BSD compatible install" >&5 -if test -z "$INSTALL"; then -if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":" - for ac_dir in $PATH; do - # Account for people who put trailing slashes in PATH elements. - case "$ac_dir/" in - /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/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 - if test -f $ac_dir/$ac_prog; then - if test $ac_prog = install && - grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then - # AIX install. It has an incompatible calling convention. - : - else - ac_cv_path_install="$ac_dir/$ac_prog -c" - break 2 - fi - fi - done - ;; - esac - done - IFS="$ac_save_IFS" - -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. We don't cache a - # path for INSTALL within a source directory, because that will - # break other packages using the cache if that directory is - # removed, or if the path is relative. - INSTALL="$ac_install_sh" - fi -fi -echo "$ac_t""$INSTALL" 1>&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_PROGRAM}' - -test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' - -echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6 -echo "configure:639: checking whether build environment is sane" >&5 -# Just in case -sleep 1 -echo timestamp > conftestfile -# 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 conftestfile 2> /dev/null` - if test "$*" = "X"; then - # -L didn't work. - set X `ls -t $srcdir/configure conftestfile` - fi - if test "$*" != "X $srcdir/configure conftestfile" \ - && test "$*" != "X conftestfile $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". - { echo "configure: error: ls -t appears to fail. Make sure there is not a broken -alias in your environment" 1>&2; exit 1; } - fi - - test "$2" = conftestfile - ) -then - # Ok. - : -else - { echo "configure: error: newly created file is older than distributed files! -Check your system clock" 1>&2; exit 1; } -fi -rm -f conftest* -echo "$ac_t""yes" 1>&6 -if test "$program_transform_name" = s,x,x,; then - program_transform_name= -else - # Double any \ or $. echo might interpret backslashes. - cat <<\EOF_SED > conftestsed -s,\\,\\\\,g; s,\$,$$,g -EOF_SED - program_transform_name="`echo $program_transform_name|sed -f conftestsed`" - rm -f conftestsed -fi -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" - -# sed with no file args requires a program. -test "$program_transform_name" = "" && program_transform_name="s,x,x," - -echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 -echo "configure:696: checking whether ${MAKE-make} sets \${MAKE}" >&5 -set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftestmake <<\EOF -all: - @echo 'ac_maketemp="${MAKE}"' -EOF -# GNU make sometimes prints "make[1]: Entering...", which would confuse us. -eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=` -if test -n "$ac_maketemp"; then - eval ac_cv_prog_make_${ac_make}_set=yes -else - eval ac_cv_prog_make_${ac_make}_set=no -fi -rm -f conftestmake -fi -if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then - echo "$ac_t""yes" 1>&6 - SET_MAKE= -else - echo "$ac_t""no" 1>&6 - SET_MAKE="MAKE=${MAKE-make}" -fi - - -PACKAGE=eCos - -VERSION=2.0 - -if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then - { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; } -fi - - - -missing_dir=`cd $ac_aux_dir && pwd` -echo $ac_n "checking for working aclocal""... $ac_c" 1>&6 -echo "configure:735: checking for working aclocal" >&5 -# Run test in a subshell; some versions of sh will print an error if -# an executable is not found, even if stderr is redirected. -# Redirect stdin to placate older versions of autoconf. Sigh. -if (aclocal --version) < /dev/null > /dev/null 2>&1; then - ACLOCAL=aclocal - echo "$ac_t""found" 1>&6 -else - ACLOCAL="$missing_dir/missing aclocal" - echo "$ac_t""missing" 1>&6 -fi - -echo $ac_n "checking for working autoconf""... $ac_c" 1>&6 -echo "configure:748: checking for working autoconf" >&5 -# Run test in a subshell; some versions of sh will print an error if -# an executable is not found, even if stderr is redirected. -# Redirect stdin to placate older versions of autoconf. Sigh. -if (autoconf --version) < /dev/null > /dev/null 2>&1; then - AUTOCONF=autoconf - echo "$ac_t""found" 1>&6 -else - AUTOCONF="$missing_dir/missing autoconf" - echo "$ac_t""missing" 1>&6 -fi - -echo $ac_n "checking for working automake""... $ac_c" 1>&6 -echo "configure:761: checking for working automake" >&5 -# Run test in a subshell; some versions of sh will print an error if -# an executable is not found, even if stderr is redirected. -# Redirect stdin to placate older versions of autoconf. Sigh. -if (automake --version) < /dev/null > /dev/null 2>&1; then - AUTOMAKE=automake - echo "$ac_t""found" 1>&6 -else - AUTOMAKE="$missing_dir/missing automake" - echo "$ac_t""missing" 1>&6 -fi - -echo $ac_n "checking for working autoheader""... $ac_c" 1>&6 -echo "configure:774: checking for working autoheader" >&5 -# Run test in a subshell; some versions of sh will print an error if -# an executable is not found, even if stderr is redirected. -# Redirect stdin to placate older versions of autoconf. Sigh. -if (autoheader --version) < /dev/null > /dev/null 2>&1; then - AUTOHEADER=autoheader - echo "$ac_t""found" 1>&6 -else - AUTOHEADER="$missing_dir/missing autoheader" - echo "$ac_t""missing" 1>&6 -fi - -echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6 -echo "configure:787: checking for working makeinfo" >&5 -# Run test in a subshell; some versions of sh will print an error if -# an executable is not found, even if stderr is redirected. -# Redirect stdin to placate older versions of autoconf. Sigh. -if (makeinfo --version) < /dev/null > /dev/null 2>&1; then - MAKEINFO=makeinfo - echo "$ac_t""found" 1>&6 -else - MAKEINFO="$missing_dir/missing makeinfo" - echo "$ac_t""missing" 1>&6 -fi - - -echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6 -echo "configure:801: checking whether to enable maintainer-specific portions of Makefiles" >&5 - # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given. -if test "${enable_maintainer_mode+set}" = set; then - enableval="$enable_maintainer_mode" - USE_MAINTAINER_MODE=$enableval -else - USE_MAINTAINER_MODE=no -fi - - echo "$ac_t""$USE_MAINTAINER_MODE" 1>&6 - - -if test $USE_MAINTAINER_MODE = yes; then - MAINTAINER_MODE_TRUE= - MAINTAINER_MODE_FALSE='#' -else - MAINTAINER_MODE_TRUE='#' - MAINTAINER_MODE_FALSE= -fi - MAINT=$MAINTAINER_MODE_TRUE - - - - echo $ac_n "checking that a separate build tree is being used""... $ac_c" 1>&6 -echo "configure:825: checking that a separate build tree is being used" >&5 - ecos_cwd=`/bin/pwd` - if test "${srcdir}" = "." ; then - srcdir=${ecos_cwd} - fi - if test "${ecos_cwd}" = "${srcdir}" ; then - echo "$ac_t""no" 1>&6 - { echo "configure: error: This configure script should not be run inside the source tree. Instead please use a separate build tree" 1>&2; exit 1; } - else - echo "$ac_t""yes" 1>&6 - fi - - - -if test -f "${srcdir}/host/configure" ; then - SUBDIRS="host" -elif test -f "${srcdir}/tools/src/configure" ; then - SUBDIRS="tools/src" -else - SUBDIRS="" -fi - - -PKGHOSTDIRS="" -FOUND_CONFIGURES="" -FOUND_CONFIGURES="${FOUND_CONFIGURES} ${srcdir}/packages/*/*/host/configure" -FOUND_CONFIGURES="${FOUND_CONFIGURES} ${srcdir}/packages/*/*/*/host/configure" -FOUND_CONFIGURES="${FOUND_CONFIGURES} ${srcdir}/packages/*/*/*/*/host/configure" -FOUND_CONFIGURES="${FOUND_CONFIGURES} ${srcdir}/packages/*/*/*/*/*/host/configure" -FOUND_CONFIGURES="${FOUND_CONFIGURES} ${srcdir}/packages/*/*/*/*/*/*/host/configure" -for configure in ${FOUND_CONFIGURES}; do - if test -f ${configure}; then - hostdir=`dirname ${configure}` - hostdir=`echo ${hostdir} | sed -e "s:^${srcdir}/::"` - PKGHOSTDIRS="${PKGHOSTDIRS} ${hostdir}" - fi -done - -SUBDIRS="${SUBDIRS} ${PKGHOSTDIRS}" - - - - -subdirs="${SUBDIRS}" - -trap '' 1 2 15 -cat > confcache <<\EOF -# 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. It is not useful on other systems. -# If it contains results you don't want to keep, you may remove or edit it. -# -# By default, configure uses ./config.cache as the cache file, -# creating it if it does not exist already. You can give configure -# the --cache-file=FILE option to use a different cache file; that is -# what configure does when it calls configure scripts in -# subdirectories, so they share the cache. -# Giving --cache-file=/dev/null disables caching, for debugging configure. -# config.status only pays attention to the cache file if you give it the -# --recheck option to rerun configure. -# -EOF -# The following way of writing the cache mishandles newlines in values, -# but we know of no workaround that is simple, portable, and efficient. -# So, don't put newlines in cache variables' values. -# 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. -(set) 2>&1 | - case `(ac_space=' '; set | grep ac_space) 2>&1` in - *ac_space=\ *) - # `set' does not quote correctly, so add quotes (double-quote substitution - # turns \\\\ into \\, and sed turns \\ into \). - sed -n \ - -e "s/'/'\\\\''/g" \ - -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p" - ;; - *) - # `set' quotes correctly as required by POSIX, so do not add quotes. - sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p' - ;; - esac >> confcache -if cmp -s $cache_file confcache; then - : -else - if test -w $cache_file; then - echo "updating cache $cache_file" - cat confcache > $cache_file - else - echo "not updating unwritable cache $cache_file" - fi -fi -rm -f confcache - -trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 - -test "x$prefix" = xNONE && prefix=$ac_default_prefix -# Let make expand exec_prefix. -test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' - -# Any assignment to VPATH causes Sun make to only execute -# the first set of double-colon rules, so remove it if not needed. -# If there is a colon in the path, we need to keep it. -if test "x$srcdir" = x.; then - ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d' -fi - -trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15 - -# Transform confdefs.h into DEFS. -# Protect against shell expansion while executing Makefile rules. -# Protect against Makefile macro expansion. -cat > conftest.defs <<\EOF -s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%-D\1=\2%g -s%[ `~#$^&*(){}\\|;'"<>?]%\\&%g -s%\[%\\&%g -s%\]%\\&%g -s%\$%$$%g -EOF -DEFS=`sed -f conftest.defs confdefs.h | tr '\012' ' '` -rm -f conftest.defs - - -# Without the "./", some shells look in PATH for config.status. -: ${CONFIG_STATUS=./config.status} - -echo creating $CONFIG_STATUS -rm -f $CONFIG_STATUS -cat > $CONFIG_STATUS </dev/null | sed 1q`: -# -# $0 $ac_configure_args -# -# Compiler output produced by configure, useful for debugging -# configure, is in ./config.log if it exists. - -ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]" -for ac_option -do - case "\$ac_option" in - -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) - echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion" - exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;; - -version | --version | --versio | --versi | --vers | --ver | --ve | --v) - echo "$CONFIG_STATUS generated by autoconf version 2.13" - exit 0 ;; - -help | --help | --hel | --he | --h) - echo "\$ac_cs_usage"; exit 0 ;; - *) echo "\$ac_cs_usage"; exit 1 ;; - esac -done - -ac_given_srcdir=$srcdir -ac_given_INSTALL="$INSTALL" - -trap 'rm -fr `echo "Makefile" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 -EOF -cat >> $CONFIG_STATUS < conftest.subs <<\\CEOF -$ac_vpsub -$extrasub -s%@SHELL@%$SHELL%g -s%@CFLAGS@%$CFLAGS%g -s%@CPPFLAGS@%$CPPFLAGS%g -s%@CXXFLAGS@%$CXXFLAGS%g -s%@FFLAGS@%$FFLAGS%g -s%@DEFS@%$DEFS%g -s%@LDFLAGS@%$LDFLAGS%g -s%@LIBS@%$LIBS%g -s%@exec_prefix@%$exec_prefix%g -s%@prefix@%$prefix%g -s%@program_transform_name@%$program_transform_name%g -s%@bindir@%$bindir%g -s%@sbindir@%$sbindir%g -s%@libexecdir@%$libexecdir%g -s%@datadir@%$datadir%g -s%@sysconfdir@%$sysconfdir%g -s%@sharedstatedir@%$sharedstatedir%g -s%@localstatedir@%$localstatedir%g -s%@libdir@%$libdir%g -s%@includedir@%$includedir%g -s%@oldincludedir@%$oldincludedir%g -s%@infodir@%$infodir%g -s%@mandir@%$mandir%g -s%@host@%$host%g -s%@host_alias@%$host_alias%g -s%@host_cpu@%$host_cpu%g -s%@host_vendor@%$host_vendor%g -s%@host_os@%$host_os%g -s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g -s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g -s%@INSTALL_DATA@%$INSTALL_DATA%g -s%@PACKAGE@%$PACKAGE%g -s%@VERSION@%$VERSION%g -s%@ACLOCAL@%$ACLOCAL%g -s%@AUTOCONF@%$AUTOCONF%g -s%@AUTOMAKE@%$AUTOMAKE%g -s%@AUTOHEADER@%$AUTOHEADER%g -s%@MAKEINFO@%$MAKEINFO%g -s%@SET_MAKE@%$SET_MAKE%g -s%@MAINTAINER_MODE_TRUE@%$MAINTAINER_MODE_TRUE%g -s%@MAINTAINER_MODE_FALSE@%$MAINTAINER_MODE_FALSE%g -s%@MAINT@%$MAINT%g -s%@SUBDIRS@%$SUBDIRS%g -s%@subdirs@%$subdirs%g - -CEOF -EOF - -cat >> $CONFIG_STATUS <<\EOF - -# Split the substitutions into bite-sized pieces for seds with -# small command number limits, like on Digital OSF/1 and HP-UX. -ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script. -ac_file=1 # Number of current file. -ac_beg=1 # First line for current file. -ac_end=$ac_max_sed_cmds # Line after last line for current file. -ac_more_lines=: -ac_sed_cmds="" -while $ac_more_lines; do - if test $ac_beg -gt 1; then - sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file - else - sed "${ac_end}q" conftest.subs > conftest.s$ac_file - fi - if test ! -s conftest.s$ac_file; then - ac_more_lines=false - rm -f conftest.s$ac_file - else - if test -z "$ac_sed_cmds"; then - ac_sed_cmds="sed -f conftest.s$ac_file" - else - ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file" - fi - ac_file=`expr $ac_file + 1` - ac_beg=$ac_end - ac_end=`expr $ac_end + $ac_max_sed_cmds` - fi -done -if test -z "$ac_sed_cmds"; then - ac_sed_cmds=cat -fi -EOF - -cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF -for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then - # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". - case "$ac_file" in - *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` - ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; - *) ac_file_in="${ac_file}.in" ;; - esac - - # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories. - - # Remove last slash and all that follows it. Not all systems have dirname. - ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` - if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then - # The file is in a subdirectory. - test ! -d "$ac_dir" && mkdir "$ac_dir" - ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`" - # A "../" for each directory in $ac_dir_suffix. - ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'` - else - ac_dir_suffix= ac_dots= - fi - - case "$ac_given_srcdir" in - .) srcdir=. - if test -z "$ac_dots"; then top_srcdir=. - else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;; - /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;; - *) # Relative path. - srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix" - top_srcdir="$ac_dots$ac_given_srcdir" ;; - esac - - case "$ac_given_INSTALL" in - [/$]*) INSTALL="$ac_given_INSTALL" ;; - *) INSTALL="$ac_dots$ac_given_INSTALL" ;; - esac - - echo creating "$ac_file" - rm -f "$ac_file" - configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure." - case "$ac_file" in - *Makefile*) ac_comsub="1i\\ -# $configure_input" ;; - *) ac_comsub= ;; - esac - - ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` - sed -e "$ac_comsub -s%@configure_input@%$configure_input%g -s%@srcdir@%$srcdir%g -s%@top_srcdir@%$top_srcdir%g -s%@INSTALL@%$INSTALL%g -" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file -fi; done -rm -f conftest.s* - -EOF -cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF -${CONFIG_SHELL-/bin/sh} ${top_srcdir}/acsupport/mkinstalldirs ${REQUIRED_DIRS} - -exit 0 -EOF -chmod +x $CONFIG_STATUS -rm -fr confdefs* $ac_clean_files -test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1 - -if test "$no_recursion" != yes; then - - # Remove --cache-file and --srcdir arguments so they do not pile up. - ac_sub_configure_args= - ac_prev= - for ac_arg in $ac_configure_args; do - if test -n "$ac_prev"; then - ac_prev= - continue - fi - case "$ac_arg" in - -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=*) - ;; - -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) - ac_prev=srcdir ;; - -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) - ;; - *) ac_sub_configure_args="$ac_sub_configure_args $ac_arg" ;; - esac - done - - for ac_config_dir in ${SUBDIRS}; do - - # Do not complain, so a configure script can configure whichever - # parts of a large source tree are present. - if test ! -d $srcdir/$ac_config_dir; then - continue - fi - - echo configuring in $ac_config_dir - - case "$srcdir" in - .) ;; - *) - if test -d ./$ac_config_dir || mkdir ./$ac_config_dir; then :; - else - { echo "configure: error: can not create `pwd`/$ac_config_dir" 1>&2; exit 1; } - fi - ;; - esac - - ac_popdir=`pwd` - cd $ac_config_dir - - # A "../" for each directory in /$ac_config_dir. - ac_dots=`echo $ac_config_dir|sed -e 's%^\./%%' -e 's%[^/]$%&/%' -e 's%[^/]*/%../%g'` - - case "$srcdir" in - .) # No --srcdir option. We are building in place. - ac_sub_srcdir=$srcdir ;; - /*) # Absolute path. - ac_sub_srcdir=$srcdir/$ac_config_dir ;; - *) # Relative path. - ac_sub_srcdir=$ac_dots$srcdir/$ac_config_dir ;; - esac - - # Check for guested configure; otherwise get Cygnus style configure. - if test -f $ac_sub_srcdir/configure; then - ac_sub_configure=$ac_sub_srcdir/configure - elif test -f $ac_sub_srcdir/configure.in; then - ac_sub_configure=$ac_configure - else - echo "configure: warning: no configuration information is in $ac_config_dir" 1>&2 - ac_sub_configure= - fi - - # The recursion is here. - if test -n "$ac_sub_configure"; then - - # Make the cache file name correct relative to the subdirectory. - case "$cache_file" in - /*) ac_sub_cache_file=$cache_file ;; - *) # Relative path. - ac_sub_cache_file="$ac_dots$cache_file" ;; - esac - case "$ac_given_INSTALL" in - [/$]*) INSTALL="$ac_given_INSTALL" ;; - *) INSTALL="$ac_dots$ac_given_INSTALL" ;; - esac - - echo "running ${CONFIG_SHELL-/bin/sh} $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_sub_srcdir" - # The eval makes quoting arguments work. - if eval ${CONFIG_SHELL-/bin/sh} $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_sub_srcdir - then : - else - { echo "configure: error: $ac_sub_configure failed for $ac_config_dir" 1>&2; exit 1; } - fi - fi - - cd $ac_popdir - done -fi - diff --git a/configure.in b/configure.in deleted file mode 100644 --- a/configure.in +++ /dev/null @@ -1,195 +0,0 @@ -dnl Process this file with autoconf to produce a configure script. -dnl ==================================================================== -dnl -dnl configure.in -dnl -dnl Top-level configure script for eCos software. -dnl -dnl ==================================================================== -dnl ####ECOSHOSTGPLCOPYRIGHTBEGIN#### -dnl ---------------------------------------------------------------------------- -dnl Copyright (C) 2002, 2003 Bart Veer -dnl Copyright (C) 1998, 1999, 2000, 2001 Red Hat, Inc. -dnl -dnl This file is part of the eCos host tools. -dnl -dnl This program is free software; you can redistribute it and/or modify it -dnl under the terms of the GNU General Public License as published by the Free -dnl Software Foundation; either version 2 of the License, or (at your option) -dnl any later version. -dnl -dnl This program is distributed in the hope that it will be useful, but WITHOUT -dnl ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -dnl FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for -dnl more details. -dnl -dnl You should have received a copy of the GNU General Public License along with -dnl this program; if not, write to the Free Software Foundation, Inc., -dnl 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -dnl ---------------------------------------------------------------------------- -dnl ####ECOSHOSTGPLCOPYRIGHTEND#### -dnl ==================================================================== -dnl#####DESCRIPTIONBEGIN#### -dnl -dnl Author(s): bartv -dnl Contact(s): bartv -dnl Date: 1998/12/17 -dnl Version: 0.01 -dnl -dnl####DESCRIPTIONEND#### -dnl ==================================================================== - -dnl eCos is a componentized architecture for deeply embedded systems. -dnl It requires a very different configuration system from typical -dnl autoconfiscated software such as the various GNU packages. -dnl -dnl The main eCos host-side software is autoconfiscated to some extent, -dnl in that the usual sequence of "configure;make;make install" will -dnl work under the right conditions. However it does not conform to -dnl the GNU coding standards in numerous ways, for example "make dist" -dnl will not work. The main eCos host-side software lives in the -dnl "host" subdirectory, and is built unconditionally. -dnl -dnl The eCos target-side software lives in the "packages" subdirectory, -dnl and is organized in numerous subdirectories corresponding to different -dnl packages and potentially different versions of each package. In the -dnl master repository managed by CVS there will only be one version of -dnl each package, "current", which simplifies things somewhat. Other -dnl repositories will not be quite so straightforward and require a -dnl suitable administration tool. -dnl -dnl The various eCos packages are not currently auto-confiscated. -dnl In particular building eCos requires the use of eCos configuration -dnl technology, not autoconf - there is simply no good way of handling -dnl a system as highly configurable as eCos using a few command-line -dnl options passed to "configure". There would also be serious confusion -dnl between host and target, especially when e.g. cross-compiling the -dnl host tools. However a possible future enhancement -dnl would involve making eCos releases via configure and make, thus -dnl allowing for a release process that combines building the various -dnl host-side tools such as gcc with creating eCos epk's for the various -dnl packages. -dnl -dnl A complication is that some of the eCos target-side packages also -dnl contain package-specific host-side support. For example the -dnl Linux synthetic target support uses special host-side software -dnl to provide I/O facilities: the architectural HAL package provdes -dnl generic support, the synthetic ethernet package extends this -dnl with ethernet support, and so on. Such package-specific host-side -dnl software does not belong in the main host subdirectory, that -dnl would make it very difficult to distribute new packages or -dnl new versions of a package. However keeping the code with the -dnl various packages makes building more complicated. -dnl -dnl 1) if the entire repository is managed by CVS or anoncvs, this -dnl configure script will search the packages tree for any packages -dnl that have host-side software that needs to be built - -dnl specifically, that have a file "configure" inside a "host" -dnl subdirectory in a version of a package. -dnl -dnl 2) if instead the repository contains additional packages -dnl installed as epk's and managed by an administration tool then -dnl it is the responsibility of that tool to let the users build -dnl and rebuild the host-side software as required, for whichever -dnl host platform or platforms are being used. In other words -dnl it is the responsibility of the admin tool to create a -dnl suitable build directory and run "configure; make; make install", -dnl usually as part of the installation process. Note that several -dnl versions of a package may be installed, and it is the -dnl responsibility of each package to take this into account -dnl (although the configure macros are aware of this to some extent, -dnl and will e.g. generate suitable install directory names). -dnl Also note that the top-level configure script will not pick -dnl up such packages because they will be versioned, i.e. the -dnl test for current/host/configure will fail because the -dnl version will not be "current". -dnl -dnl 3) as a special case it may be desirable to ship pre-built binaries -dnl of some of the package-specific software. It is not clear -dnl just what would be the best way of shipping these - putting -dnl them into the epk's would not be quite right because that would -dnl make the epk's host-specific rather than generic. -dnl -dnl There is an unresolved problem with possible dependencies between -dnl packages, if e.g. the host-side of the synthetic ethernet package could -dnl only be built after the architectural synthetic target package. - -dnl Some of the eCos documentation is generic and lives in the "doc" -dnl subdirectory. Other eCos documentation is package-specific and lives -dnl in the appropriate package directory. At present there is no support -dnl for building the documentation via configure and make, but such -dnl support may be added in future. -dnl -dnl There is a subdirectory acsupport containing various files such -dnl as config.guess and install.sh that are common. This also contains -dnl an acinclude.m4 file with various macros that are useful for -dnl eCos. - -dnl Generic initialization. -AC_INIT(acsupport/config.guess) -AC_CONFIG_AUX_DIR(acsupport) -AC_CANONICAL_HOST -AM_INIT_AUTOMAKE(eCos,2.0,0) -AM_MAINTAINER_MODE -ECOS_CHECK_BUILD_ne_SRC - -dnl Nothing actually gets built in this directory, so there should be no -dnl need to worry about compiler flags etc. Instead, the problem is -dnl figuring out what should actually get built. -dnl -dnl 1) the host subdirectory should always get built, if it exists. -dnl With the 2.0 release system the directory gets moved to -dnl tools/src - -if test -f "${srcdir}/host/configure" ; then - SUBDIRS="host" -elif test -f "${srcdir}/tools/src/configure" ; then - SUBDIRS="tools/src" -else - SUBDIRS="" -fi - -dnl 2) any package which has a configure script in a -dnl current/host subdirectory should also get built. -dnl -dnl Searching the directory tree is currently done by shell globbing. -dnl Invoking "find" with suitable arguments might be quicker, but -dnl less portable. On some hosts there may be problems with environmental -dnl limits if too many packages provide host-side software. -dnl -dnl Currently there is no ordering of packages, so e.g. a device -dnl driver's host-side support cannot depend on some HAL package -dnl because the latter may not have been built and installed yet. -dnl This is a good thing because packages are meant to be self-contained -dnl whenever possible. Interaction between packages is typically handled -dnl at the Tcl level at run-time, so there are no build-time complications. - -PKGHOSTDIRS="" -FOUND_CONFIGURES="" -FOUND_CONFIGURES="${FOUND_CONFIGURES} ${srcdir}/packages/*/*/host/configure" -FOUND_CONFIGURES="${FOUND_CONFIGURES} ${srcdir}/packages/*/*/*/host/configure" -FOUND_CONFIGURES="${FOUND_CONFIGURES} ${srcdir}/packages/*/*/*/*/host/configure" -FOUND_CONFIGURES="${FOUND_CONFIGURES} ${srcdir}/packages/*/*/*/*/*/host/configure" -FOUND_CONFIGURES="${FOUND_CONFIGURES} ${srcdir}/packages/*/*/*/*/*/*/host/configure" -for configure in ${FOUND_CONFIGURES}; do - if test -f ${configure}; then - dnl A configure script has been found in the source tree. - dnl First turn it into a directory, then replace the absolute path - dnl with a relative one. - hostdir=`dirname ${configure}` - hostdir=`echo ${hostdir} | sed -e "s:^${srcdir}/::"` - PKGHOSTDIRS="${PKGHOSTDIRS} ${hostdir}" - fi -done - -SUBDIRS="${SUBDIRS} ${PKGHOSTDIRS}" - -dnl Because the eCos directory layout does not conform to GNU conventions -dnl it is necessary to create various levels of intermediate directories. -dnl This happens via config.status, prior to the recursion into the -dnl appropriate directories. -AC_OUTPUT_COMMANDS([${CONFIG_SHELL-/bin/sh} ${top_srcdir}/acsupport/mkinstalldirs ${REQUIRED_DIRS}],REQUIRED_DIRS="${SUBDIRS}") - -AC_SUBST(SUBDIRS) -AC_CONFIG_SUBDIRS(${SUBDIRS}) -AC_OUTPUT(Makefile) diff --git a/doc/ChangeLog b/doc/ChangeLog deleted file mode 100644 --- a/doc/ChangeLog +++ /dev/null @@ -1,142 +0,0 @@ -2004-06-20 Andrew Lunn - - * sgml/doclist: Added flash API documentation. - -2004-06-15 Jonathan Larmour - - * sgml/makemakefile: Replace plusses with x'es in all entities. - -2004-04-19 John Dallaway - - * sgml/doclist: Remove RedBoot documentation which is now built - separately. - -2004-04-14 Nick Garnett - - * sgml/doclist: Added PPP package documentation. - -2003-11-25 Manu Sharma - - * sgml/doclist: Add OpenBSD specific documentation. - -2003-11-22 Andrew Lunn - - * sgml/doclist: Added ipsec packages documentation - * sgml/makemakefile: Added another set of man pages to the kludge. - -2003-11-08 Andrew Lunn - - * sgml/user-guide/programming.sgml: Suggest Unix users may prefer - ecosconfig rather than the GUI. - * sgml/user-guide/makefile: Listed the other .sgml files so - dependency checking works - -2003-09-11 Gary Thomas - - * sgml/doclist: Add ethernet PHY documentation. - -2003-07-09 Jonathan Larmour - - * sgml/makemakefile: Update trademark info and sort. - -2003-05-01 Jonathan Larmour - - * sgml/jadetex.cfg: Add this to configure PDF output nicely with index - and coloured links. - -2003-03-23 Iztok Zupet - - * sgml/makemakefile: modified copyfiles to copy png-s instead of - gif-s. - * sgml/README-PDF: Comment on pdfjadetext failure and workaround. - -2003-03-27 Thomas Koeller - - * sgml/makemakefile: Modified to generate makefile that can - be used to build docs in arbitrary directory. - -2003-02-25 Andrew Lunn - - * sgml/doclist: Added the simple network time protocol client - documentation. - -2003-02-24 Jonathan Larmour - - * sgml/doclist: Reorder in a slightly more logical order with - related bits grouped together. - Add docs for power management, USB (slave, eth slave, and SA11x0 - and NEC uPD8985xx drivers), and synthetic target HAL, eth and - watchdog drivers. - - * sgml/.cvsignore: Add gifs and rename ecos.* to ecos-ref.* - - * sgml/makemakefile: Rename ecos.sgml/html/etc. to ecos-ref. - Copy over GIFs where they exist. - Don't treat porting guide specially at the top... treat it only as - specially as the other special cases. - Update (C) holders. - Update licence/warranty blurb. - -2003-01-30 Andrew Lunn - - * sgml/doclist: Added snmp-manpages.sgml - * sgml/makemakefile: Extend the kludge to include snmp-manpages.sgml - -2003-01-22 John Dallaway - - * sgml/makemakefile: Allow eCos package version to be specified - (when not "current") as the first command line parameter. - -2003-01-04 Jonathan Larmour - - * sgml/makemakefile: Oops, use new entity consistently in generated - ecos.sgml. - -2003-01-03 Jonathan Larmour - - * sgml/makemakefile: Try to shorten generated entity names. - * sgml/doclist: add terminating LF. - -2002-12-22 Nick Garnett - - * sgml/doclist: Added HTTPD package documentation. - - * sgml/.cvsignore: Added files generated during PDF build. - -2002-10-28 Andrew Lunn - - * sgml/makemakefile: Removed the second OTHER_SGML which clobbers - the first correct definition, so stopping dependencies working. - -2002-10-15 Iztok Zupet - - * sgml/README-PDF: added - * sgml/makemakefile: defined MAIN_PDF - -2002-10-15 Jonathan Larmour - - * sgml/makemakefile: Only put ecos.sgml in MAIN_SGML. Put all others - in OTHER_SGML. From Bart Veer. - -2002-09-02 Andrew Lunn - - * sgml/doclist: Added the CPU load package documentation. - -2002-08-09 Andrew Lunn - - * sgml/doclist: Added the CRC package documentation. - -2002-08-09 Andrew Lunn - - * sgml/.cvsignore: Ignore the generated html files etc. - -2002-08-07 Andrew Lunn - - * sgml/makemakefile: Replaced the old internal RedHat ecc - directory name with the new name "packages" - diff --git a/doc/sgml/.cvsignore b/doc/sgml/.cvsignore deleted file mode 100644 --- a/doc/sgml/.cvsignore +++ /dev/null @@ -1,9 +0,0 @@ -ecos-ref.sgml -ecos-ref.tex -ecos-ref.log -ecos-ref.aux -ecos-ref.out -ecos-ref.pdf -makefile -*.html -*.gif diff --git a/doc/sgml/README-PDF b/doc/sgml/README-PDF deleted file mode 100644 --- a/doc/sgml/README-PDF +++ /dev/null @@ -1,31 +0,0 @@ -To build the PDF version of docs (on Linux), simply use: -make pdfa4 for A4 size or -make pdfletter for US letter size - -If Your pdfjadetex complains with - > ! TeX capacity exceeded, sorry [save size=5000]. -then define - save_size.pdfjadetex=10000 (at least) in - /usr/share/texmf/web2c/texmf.cnf instead of 5000. - -If Your pdfjadetex complains with - > ! TeX capacity exceeded, sorry [number of strings=55000]. -then define - max_strings.pdfjadetex=155000 (for instance) in - /usr/share/texmf/web2c/texmf.cnf instead of 5000. - -If You don't get coloured links in Your output, or if You -wish to modify the pdfjadetex default behaviour then add -a file named jadetex.cfg into each directory where the build -takes place and put something like that into: - -\hypersetup{pdfpagemode=None, pdfauthor=eCos (pdfjadetex) , colorlinks=true, - linkcolor=blue, pdfstartview=FitH} - -Regards -Iztok - - - - - diff --git a/doc/sgml/doclist b/doc/sgml/doclist deleted file mode 100644 --- a/doc/sgml/doclist +++ /dev/null @@ -1,39 +0,0 @@ -kernel/current/doc/kernel.sgml -hal/common/current/doc/hal.sgml -hal/common/current/doc/porting.sgml -language/c/libc/common/current/doc/libc.sgml -io/common/current/doc/io.sgml -io/fileio/current/doc/fileio.sgml -io/pci/current/doc/pci.sgml -io/flash/current/doc/flash.sgml -compat/posix/current/doc/posix.sgml -compat/uitron/current/doc/uitron.sgml -net/common/current/doc/tcpip.sgml -net/common/current/doc/tcpip-manpages.sgml -net/bsd_tcpip/current/doc/freebsd.sgml -net/tcpip/current/doc/openbsd.sgml -net/tcpip/current/doc/openbsd-manpages-bridge.sgml -net/tcpip/current/doc/openbsd-manpages-netintro.sgml -net/tcpip/current/doc/openbsd-manpages-stp.sgml -net/ns/dns/current/doc/dns.sgml -net/common/current/doc/ipsec.sgml -net/ipsec/libipsec/current/doc/libipsec-manpages.sgml -net/ppp/current/doc/ppp.sgml -io/eth/current/doc/ethdrv.sgml -devs/eth/phy/current/doc/eth_phy.sgml -net/snmp/agent/current/doc/snmp.sgml -net/snmp/agent/current/doc/snmp-manpages.sgml -net/httpd/current/doc/httpd.sgml -net/ftpclient/current/doc/ftpclient.sgml -net/sntp/current/doc/sntp.sgml -services/crc/current/doc/crc.sgml -services/cpuload/current/doc/cpuload.sgml -services/profile/gprof/current/doc/profile.sgml -services/power/common/current/doc/power.sgml -io/usb/slave/current/doc/usbs.sgml -io/usb/eth/slave/current/doc/usbseth.sgml -hal/synth/arch/current/doc/synth.sgml -devs/usb/sa11x0/current/doc/usbs_sa11x0.sgml -devs/usb/nec_upd985xx/current/doc/usbs_upd985xx.sgml -devs/eth/synth/ecosynth/current/doc/syntheth.sgml -devs/watchdog/synth/current/doc/synth_watchdog.sgml diff --git a/doc/sgml/jadetex.cfg b/doc/sgml/jadetex.cfg deleted file mode 100644 --- a/doc/sgml/jadetex.cfg +++ /dev/null @@ -1,1 +0,0 @@ -\hypersetup{pdfauthor=eCos (pdfjadetex) , colorlinks=true, linkcolor=blue, pdfstartview=FitH} diff --git a/doc/sgml/makemakefile b/doc/sgml/makemakefile deleted file mode 100644 --- a/doc/sgml/makemakefile +++ /dev/null @@ -1,225 +0,0 @@ -#!/bin/sh - -touch ecos-ref.sgml -touch makefile -chmod +w ecos-ref.sgml -chmod +w makefile - -sgmldir="`dirname $0`" -doclist="${sgmldir}/doclist" -toplvl="${sgmldir}/../.." - -cat > makefile <> makefile -/bin/echo -n OTHER_SGML := >> makefile - -cat >ecos-ref.sgml < - - - - -EOF - -PACKAGEVER=${1:-'current'} - -for i in `cat ${doclist}`; do - line="`echo $i | sed 's/#.*//;'`" - if (test ! -z $line); then - /bin/echo -n " ${toplvl}/packages/$i" | sed "s@/current/@/${PACKAGEVER}/@g" >> makefile - entityi="`echo $i | sed 's@\+@x@g; s@/@-@g; s@\.@-@g; s@_@-@g; s@-current-doc@@g; s@-current@@g'`" - echo "" | sed "s@/current/@/${PACKAGEVER}/@g" >> ecos-ref.sgml - fi -done - -# Go through again but find GIFs and PNGs to copy -for i in `for j in \`cat ${doclist}\` ; do dirname $j ; done | sort | uniq` ; do - diri=`echo ${toplvl}/packages/$i | sed "s@/current/@/${PACKAGEVER}/@g"` - dirigifs=`ls $diri/*.gif $diri/*.png 2>/dev/null | tr '\n' ' '` - if [ x"$dirigifs" != x ]; then - copyfiles="$copyfiles $dirigifs" - fi -done - -cat >> makefile <> ecos-ref.sgml < -]> - - - - eCos Reference Manual - - - 1998 - 1999 - 2000 - 2001 - 2002 - 2003 - Red Hat, Inc. - Nick Garnett (eCosCentric) - Jonathan Larmour (eCosCentric) - Andrew Lunn (Ascom) - Gary Thomas (MLB Associates) - Bart Veer (eCosCentric) - - - - Documentation licensing terms -This material may be distributed only subject to the terms -and conditions set forth in the Open Publication License, v1.0 -or later (the latest version is presently available at -http://www.opencontent.org/openpub/). - - -Distribution of substantively modified versions of this -document is prohibited without the explicit permission of the -copyright holder. - -Distribution of the work or derivative of the work in any -standard (paper) book form is prohibited unless prior -permission is obtained from the copyright holder. - - - - Trademarks -Altera® and Excalibur™ are trademarks of Altera Corporation. -AMD® is a registered trademark of Advanced Micro Devices, Inc. -ARM®, StrongARM®, Thumb®, ARM7™, ARM9™ is a registered trademark of Advanced RISC Machines, Ltd. -Cirrus Logic® and Maverick™ are registered trademarks of Cirrus Logic, Inc. -Cogent™ is a trademark of Cogent Computer Systems, Inc. -Compaq® is a registered trademark of the Compaq Computer Corporation. -Fujitsu® is a registered trademark of Fujitsu Limited. -IBM®, and PowerPC™ are trademarks of International Business Machines Corporation. -IDT® is a registered trademark of Integrated Device Technology Inc. -Intel®, i386™, Pentium®, StrataFlash® and XScale™ are trademarks of Intel Corporation. -Intrinsyc® and Cerf™ are trademarks of Intrinsyc Software, Inc. -Linux® is a registered trademark of Linus Torvalds. -Matsushita™ and Panasonic® are trademarks of the Matsushita Electric Industrial Corporation. -Microsoft®, Windows®, Windows NT® and Windows XP® are registered trademarks of Microsoft Corporation, Inc. -MIPS®, MIPS32™ MIPS64™, 4K&trade, 5K™ Atlas™ and Malta™ are trademarks of MIPS Technologies, Inc. -Motorola®, ColdFire® is a trademark of Motorola, Inc. -NEC® V800™, V850™, V850/SA1™, V850/SB1™, VR4300™, and VRC4375™ are trademarks of NEC Corporation. -PMC-Sierra® RM7000™ and Ocelot™ are trademarks of PMC-Sierra Incorporated. -Red Hat, eCos™, RedBoot™, GNUPro®, and Insight™ are trademarks of Red Hat, Inc. -Samsung® and CalmRISC™ are trademarks or registered trademarks of Samsung, Inc. -Sharp® is a registered trademark of Sharp Electronics Corp. -SPARC® is a registered trademark of SPARC International, Inc., and is used under license by Sun Microsystems, Inc. -Sun Microsystems® and Solaris® are registered trademarks of Sun Microsystems, Inc. -SuperH™ and Renesas™ are trademarks owned by Renesas Technology Corp. -Texas Instruments®, OMAP™ and Innovator™ are trademarks of Texas Instruments Incorporated. -Toshiba® is a registered trademark of the Toshiba Corporation. -UNIX® is a registered trademark of The Open Group. -All other brand and product names, trademarks, and copyrights are the -property of their respective owners. - - -Warranty -eCos and RedBoot are open source software, covered by a -modified version of the GNU -General Public Licence, -and you are welcome to change it and/or distribute copies of it under certain -conditions. See http://ecos.sourceware.org/license-overview.html - for more information about the license. -eCos and RedBoot software have NO WARRANTY. -Because this software is licensed free of charge, there are no warranties -for it, to the extent permitted by applicable law. Except when otherwise stated -in writing, the copyright holders and/or other parties provide the software -“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 software is with you. Should the software prove defective, you assume -the cost of all necessary servicing, repair or correction. - 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. - - - - -EOF - -for i in `cat ${doclist}`; do - line="`echo $i | sed 's/#.*//;'`" - if (test ! -z $line); then - entityi="`echo $i | sed 's@\+@x@g; s@/@-@g; s@\.@-@g; s@_@-@g; s@-current-doc@@g; s@-current@@g'`" - # special kludge - if [ "`basename $i`" != "tcpip-manpages.sgml" -a \ - "`basename $i`" != "snmp-manpages.sgml" -a \ - "`basename $i`" != "libipsec.sgml" -a \ - "`basename $i`" != "libipsec-manpages.sgml" -a \ - "`basename $i`" != "openbsd-manpages-bridge.sgml" -a \ - "`basename $i`" != "openbsd-manpages-netintro.sgml" -a \ - "`basename $i`" != "openbsd-manpages-stp.sgml" -a \ - "`basename $i`" != "porting.sgml" ]; then - echo "&$entityi;" >> ecos-ref.sgml - fi - fi -done - -echo '' >> ecos-ref.sgml diff --git a/doc/sgml/user-guide/.cvsignore b/doc/sgml/user-guide/.cvsignore deleted file mode 100644 --- a/doc/sgml/user-guide/.cvsignore +++ /dev/null @@ -1,1 +0,0 @@ -*.html \ No newline at end of file diff --git a/doc/sgml/user-guide/ChangeLog b/doc/sgml/user-guide/ChangeLog deleted file mode 100644 --- a/doc/sgml/user-guide/ChangeLog +++ /dev/null @@ -1,165 +0,0 @@ -2004-06-15 Roland Cassebohn - - * target-setup.sgml: - * real-time-characterization.sgmo: - Added documentation for the aim711 module - -2003-10-17 Alex Schuilenburg - * user-guide/installation.sgml: - * user-guide/introduction.sgml: - * user-guide/makefile: - * user-guide/target-setup.sgml: - Brought URLs up to date and amended header which was incaccurate - (referred to alternative licenses no longer available) - -2003-07-09 Jonathan Larmour - - * user-guide.sgml: Update trademark info and sort. - - * real-time-characterization.sgml: real-time characterization is - discussed in ref manual, not user guide. - -2003-05-04 John Dallaway - - * installation.sgml: Refer to installation instructions on the - eCos website. - -2003-05-01 Jonathan Larmour - - * jadetex.cfg: Add this to configure PDF output nicely with index - and coloured links. - - * pix/*.gif: Delete as they are now unused. - * introduction.sgml: Add ID for notation and conventions chap. - -2003-03-03 John Dallaway - - * programming-concepts-techniques.sgml: - PKG_INSTALL_DIR -> INSTALL_DIR - -2003-02-12 Nick Garnett - - * user-guide.sgml: - * config-tool.sgml: - * configuration.sgml: - Files extensively modified to bring them up to date. Essentially - the old Tutorial document has been merged in with the User Guide - to give a single document from which to start with eCos. - - * introduction.sgml: - * installation.sgml: - * programming.sgml: - * programming-concepts-techniques.sgml: - * target-setup.sgml: - * real-time-characterization.sgml: - New files containing both fresh text and text merged in from the - old tutorial, which is now obsolete. - - * pix/templates01.png: - * pix/ARMStartup01.png: - * pix/build-lib01.png: - * pix/build-tests01.png: - * pix/twothreads2.png: - Graphics copied here from old tutorial. - - -2002-10-15 Iztok Zupet - - * user-guide.sgml: pictures (gif==>png) - * pix/*.png: generated from gifs with gimp - * makefile: defined MAIN_PDF - -2002-09-23 Andrew Lunn - - * .cvsignore: Ignore the generated html files. - -2002-02-26 Julian Smart - - * config-tool.sgml: updated further text and graphics - for Windows/Unix configtool. - -2002-02-15 Julian Smart - - * user-guide.sgml: added further GIF files - * config-tool.sgml: started to updated text and graphics - to encompass Windows and Linux tools. - -2002-02-07 Jonathan Larmour - - * user-guide.sgml: Move special topics to kernel doc. - * special-topics.sgml: delete. - - * config-tool.sgml: Add ids to all s and s - * configuration.sgml: ditto. - * programming-concepts-techniques.sgml: ditto. - * special-topics.sgml: ditto. - -2001-12-21 Jonathan Larmour - - * user-guide.sgml: Move pictures to pix/ subdirectory. - -2001-12-17 Mark Galassi - - * added legal stuff and contact information. - -2001-11-28 Jonathan Larmour - - * configuration.sgml: Many cosmetic fixes, to bring the document in - line with the version on sources.redhat.com, including adding a little - missing content. - * config-tool.sgml: Ditto. - * programming-concepts-techniques.sgml: Ditto. - - * config-tool.sgml: Fix fig1 title. - -2001-11-23 Mark Galassi - - * configuration.sgml: took care of the tags. - -2001-11-21 Mark Galassi - - * programming-concepts-techniques.sgml: restored the two tables in - this part. - - * config-tool.sgml: reinstated the keyboard shortcut table. - - * config-tool.sgml, configuration.sgml, - programming-concepts-techniques.sgml, special-topics.sgml: the new - files with the individual parts. - - * user-guide.sgml: split each part into its own file to make - editing more manageable. - -2001-10-31 Mark Galassi - - * user-guide-not-normalized.sgml: this is the deprecated - original hand-edited file. - - * user-guide.sgml: this is now the normalized file and the active - one. - - * user-duide-normalized.sgml: removed this file. - - * user-guide.sgml: last change (update the DTD) before I replace - this had-edited version with the normalized one. - -2001-10-29 Mark Galassi - - * user-guide-normalized.sgml: put this in because it satisfies all - the little nitpicks on other systems. - -2001-10-21 Mark Galassi - - * user-guide.sgml: more fixes; the HTML seems quite correct. - - * *.gif: added all .gif files to CVS. - - * user-guide.sgml: validates!! - - * user-guide.sgml: 85% validates now. - -2001-10-20 Mark Galassi - - * user-guide.sgml: now into part III for the touch-up work. - - * user-guide.sgml: did more fixing up. diff --git a/doc/sgml/user-guide/config-tool.sgml b/doc/sgml/user-guide/config-tool.sgml deleted file mode 100644 --- a/doc/sgml/user-guide/config-tool.sgml +++ /dev/null @@ -1,1520 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -The eCos Configuration Tool - - - - -Getting Started - - - - -Introduction - - The eCos Configuration Tool is used - to tailor eCos at source level, prior to compilation or - assembly, and provides a configuration file and a set of - files used to build user applications. The sources and other - files used for building a configuration are provided in a - component repository, which is loaded - when the eCos Configuration Tool - is invoked. The component repository includes a set of files - defining the structure of relationships between the - Configuration Tool and other components, and is written in a - Component Definition Language (CDL). - For a description of the concepts underlying component - configuration, see . - - - - - -Invoking the <productname>eCos</productname> <application>Configuration Tool</application> - - -On Linux - -Add the eCos Configuration Tool install directory to your PATH, for example: - - -export PATH=/opt/ecos/ecos&Version;/bin:$PATH - - -You may run configtool with zero, one or two arguments. You can specify the eCos repository - location, and/or an eCos save file (extension .ecc) on the command line. The ordering of these -two arguments is not significant. For example: - - -configtool /opt/ecos/ecos&Version;/packages myfile.ecc - - -The Configuration Tool will be displayed (see ). - - - -On Windows - -There are two ways in which to invoke the eCos Configuration Tool: - - - from the desktop explorer or program set up at installation - time (by default - Start - -> - Programs - -> - eCos - -> - Configuration Tool - ). - - -type (at a command prompt or in the - Start - menu’s - Run - item): <foldername>\ConfigTool.exe where <foldername> is - the full path of the directory in which you installed the eCos - Configuration Tool. - - - - -The - Configuration Tool - will be displayed (see ). - - - - -You may run configtool with zero, one or two arguments. You can specify the eCos repository -location, and/or an eCos save file (extension .ecc) on the command line. The ordering of these -two arguments is not significant. For example: - - -configtool "c:\Program Files\eCos\packages" myfile.ecc - - - - -If you invoke the configuration tool from the command line with ---help, you will see this output: - - -Usage: eCos Configuration Tool [-h] [-e] [-v] [-c] [input file 1] [input file 2] - -h --help displays help on the command line parameters - -e --edit-only edit save file only - -v --version print version - -c --compile-help compile online help only - - -This summarizes valid parameters and switches. Switches are shown with -both short form and long form. - ---help shows valid options and parameters, as above. - ---edit-only runs the Configuration Tool in a mode that -suppresses creation of a build tree, in case you only want to create and edit save files. - ---version shows version and build date information, and exits. - ---compile-help compiles help contents files from the HTML documentation -files that the tool finds in the eCos repository, and exits. - -
-<application>Configuration Tool</application> - -
-
-
- - - - - -The Component Repository -When you invoke the eCos Configuration Tool, it accesses the Component - Repository, a read-only location of configuration - information. For an explanation of “Component - Repository” see . -The eCos Configuration Tool will look - for a component repository using (in descending order of preference): - - -A location specified on the command line - - - -The component repository most recently used by the -current user - - -An eCos distribution under /opt/ecos (under -Linux) or a default location set by the installation procedure (under -Windows) - - -User input - - -The final case above will normally only occur if the previous - repository has been moved or (under Windows) installation information stored in - the Windows registry has been modified; it will result in a dialog box -being displayed that allows you to specify the repository location: -
-Repository relocation dialog box - -
-Note that in order to use the eCos Configuration Tool you are obliged to provide a - valid repository location. -In the rare event that you subsequently wish to change - the component location, select - Build->Repository - and the above dialog box will then be displayed. -You can check the location of the current repository, the current save file -path, and the current hardware template and default package, -by selecting Help->Repository Information.... -A summary will be displayed. -
- - - - - -<productname>eCos</productname> <application>Configuration Tool</application> Documents - -Configuration Save File -eCos configuration settings and other information - (such as disabled conflicts) that are set using the - eCos Configuration Tool are saved to - a file between sessions. By default, when the - eCos Configuration Tool is first - invoked, it reads and displays information from the - Component Registry and displays the information in an - untitled blank document. You can perform the following - operations on a document: - -Save the currently active document -Use the “File->Save” menu - item or click the Save Document icon on the - toolbar; if the current document is unnamed, you will be prompted - to supply a name for the configuration save file. -
-Save As dialog box - -
-
- -Open an existing document -Select File->Open, - or click the Open Document icon on the toolbar. - You will be prompted to supply a name for the configuration save - file. -
-Open dialog box - -
-
- -Open a document you have used recently -Click its name at the bottom of the - File menu. -Documents may also be opened by: - - -double-clicking a Configuration Save File in the desktop -explorer (Windows only); - - -invoking the eCos -Configuration Tool -with the name of a Configuration File as command-line argument, -or by creating a shortcut to the eCos Configuration Tool with such an argument -(under Windows or a suitable Linux desktop environment). - - - - -Create a new blank document based on the Component - Registry -Select File->New, -or click the New Document icon on the toolbar. - - -Save to a different file name -Select File->Save - As. You will be prompted to supply a new - name for the configuration save file. - -
- -Build and Install Trees -The location of the build and install trees are - derived from the eCos save file name as illustrated in the - following example: -Save file name = “c:\My - eCos\config1.ecc” -Install tree folder = “c:\My - eCos\config1_install” -Build tree folder = “c:\My - eCos\config1_build” -These names are automatically generated from the name - of the save file. -See also . - -
-
- - - - - -Getting Help - -The eCos Configuration Tool contains -several methods for accessing online help. - - - - - -Context-sensitive Help for Dialogs -Most dialogs displayed by the eCos Configuration Tool are supplied -with context-sensitive help. You can then get help relating -to any control within the current dialog box by - - - -Right-clicking the control (or pressing - F1 - ) -A “What’s This?” popup menu will - be displayed. Click the menu to display a brief description of the - function of the selected control. - - -Clicking the question mark icon in the dialog - caption bar (Windows) or the question mark button on the dialog (Linux). -A question mark cursor will be displayed. Click on - any control to display a brief description of its - function. - - -Some dialogs may have a Help - button. You can press this to display a more general - description of the function of the dialog box as a whole. - This help will be in HTML form; for more information, see - below. - - - - - -Context-sensitive Help for Other Windows -In the Help menu, click - Help On... - -and then click on a window (or click on the arrow/question mark button -on the toolbar, then click on a window). A small popup window page describing the -window will be displayed. The same thing can be achieved by right-clicking -on a window and clicking on What's This?. - - - - -Context-sensitive Help for Configuration Items -In the configuration window, right-click on a configuration -item (or use Shift+F10). A context -menu will be displayed; select Visit Documentation -to display the page in the eCos documentation that most closely -corresponds to the selected item. - - - -Methods of Displaying HTML Help - - - - - -Using the internal help system. This will show an internal viewer similar to Microsoft HTML Help, with a contents -hierarchy on the left and HTML pages on the right; see . The index is regenerated for each repository. If the documentation in -the repository has changed but the contents does not reflect this, please use the Tools Regenerate Help Index menu -item. - - - - - -Using the default HTML browser. On Unix, you will need a .mailcap entry similar to this: - - - - -text/html; netscape -no-about-splash %s - - - - - - -Using the specified browser. - - - - - - -
-HTML Help viewer - -
-If you wish, you may choose to have HTML Help displayed -in a browser of your choice. To do this, select View->Settings and -use the controls in the View Documentation group to select the replacement browser. -Note that the Navigation facilities of the built-in HTML -Help system will be unavailable if you choose this method -of displaying help. -
-
- - - - - -Customization -The following visual aspects of the eCos Configuration Tool can be changed to suit - individual preferences. These aspects are saved on a per-user - basis, so that when the eCos Configuration Tool is next invoked by the same - user, the appearance will be as set in the previous - session. - -Window Placement -The relative sizes of all windows in the eCos Configuration Tool may be adjusted by dragging - the splitter bars that separate the windows. The chosen - sizes will be used the next time the eCos Configuration Tool is invoked by the current - user. -All windows except the Configuration - Window may be shown or hidden by using the - commands under the View menu (for - example, View->Output) or the - corresponding keyboard accelerators - (Alt+1 to - Alt+4). - - -Your chosen set of windows (and their relative sizes) will -be preserved between invocations of the eCos Configuration -Tool. - - - -Settings -To change other visual aspects, select - View->Settings - and then select the Display and - View tabs depending on the settings - you wish to alter.. - The options are as follows: - - - - -Settings: Display tab - -
-Settings dialog, Display tab - -
- - -Labels - -In the configuration window, you can choose to have - either descriptive names (the - default) or macro names displayed as - tree item labels. Descriptive names are generally more - comprehensible, but macro names are used in some contexts - such as conflict resolution and may be directly related to - the source code of the configuration. Note that it is - possible to search for an item in the configuration view - by selecting - Find->Edit - (see ). Both - descriptive names and macro names can be searched. - - - -Integer Items -You can choose to have integer items in the - Configuration Window displayed in decimal or hexadecimal - format. - - - -Font - - -Change the font for a particular window by selecting the window name using the drop-down list, -then clicking on Change Font to select a font for that -window. The changes will be applied when the press OK to dismiss the Settings dialog. -If you never make font changes, then the windows will take -the default setting determined by your current Windows or Unix environment. - - - - -Miscellaneous - - -If the Splash Screen checkbox is checked, a splash -window will appear as the application is loading. Uncheck this to eliminate the splash screen. - - - -
- - -Settings: Viewers tab - -
-Settings dialog, Viewers tab - -
- - -View header files - -You can change the viewer used to display header files. - - - -View documentation - -You can change the viewer used to display HTML files. -See . - - - - - - -
- -
-
- - - - - -Screen Layout -The following windows are available within the - eCos Configuration - Tool: - - - - Configuration Window - - - Properties Window - - - Short Description - - - Conflicts - - - Output - - - -The layout of the windows may be adjusted to suit your - preferences: see . - - -Configuration Window -This is the principal window used to configure eCos. It - takes the form of a tree-based representation of the - configuration items within the currently loaded eCos - packages. -In the case of items whose values may be changed, - controls are available to set the item values. These either - take the form of check boxes or radio buttons within the - tree itself or cells to the right of the thin vertical - splitter bar. Controls in the tree may be used in the usual - way; cells, however, must first be activated. -To activate a cell, simply click on it: it will assume a sunken -appearance and data can then be edited in the cell. To terminate -in-cell editing, click elsewhere in the configuration window or -press ENTER. To discard the partial results -of in-cell editing and revert to the previous value, press ESCAPE. - - - -Cells come in three varieties, according to the type of - data they accept: - -Cell types - - - -Cell Type -Data Accepted - - - - -Integer -Decimal or hexadecimal values - - -Floating Point -Floating point values - - -String -Any - - - -
-In the case of string cells, you can double-click the cell -to display a dialog box containing a larger region in which to edit -the string value. This is useful in the case of long strings, or -those spanning multiple lines. - -Disabled items -Some items will appear disabled. In this case the item - label and any associated controls and cells will be - grayed. It is not be possible to change the values of - disabled items. - -Right-Clicking -You can right-click on an item in the configuration - window item to display a pop-up menu which (depending on - the type of the item selected) allows you to: - - - Properties – - information relating to the currently selected item - is displayed. The information is equivalent to that - displayed in the Properties - Window. - - - Restore Defaults - - the default value of the currently selected item is - restored. - - -Visit Documentation - - causes the HTML page most closely relating to the - currently selected item to be displayed. This has - the same effect as double-clicking the URL property - in the Properties Window. - - - View Header File - – this causes the file containing the items to - be displayed. This is equivalent to double-clicking - on the File property in the Properties Window. The - viewer used for this purpose may be changed using - the View->Settings menu item - (see ). - Note that this operation is only possible when the - current configuration is saved, in order to avoid - the possibility of changing the source - repository. - - -Unload Package - - this is equivalent to using the - Build->Packages menu item to - select and unload the package in - question. - - - - - -Conflicts Window -This window exists to display any configuration item - conflicts. Conflicts are the result of failures to meet - the requirements between configuration items expressed in - the CDL. See . -The window comprises three columns: - - - Item -This is the macro name of the first item involved - in the conflict. - - - - Conflict -This is a description of the conflict type. The currently - supported types are “unresolved”, “illegal - value”, “evaluation exception”, “goal - unsatisfied” and “bad data”. - - - - Property -This contains a description of the configuration - item’s property that caused the conflict. -Within the conflicts window you can right-click on - any item to display a context menu which allows you to - choose from one of the following options: - - - -To locate the item involved in the -conflict, double-click in the first or third column, or -right-click over the item and choose Locate -from the popup menu. - - -You can use the Tools->Resolve Conflicts menu -item, or right-click over the item and select Resolve from the popup menu, -to resolve conflicts — . - -Output Window -This window displays any output generated by - execution of external tools and any error messages that - are not suitable for display in other forms (for - example, as message boxes). -Within the output window you can right-click to display a -context menu which allows you to: - - -Save the contents of the window to a - file - - -Clear the contents of the - window - - - - -Properties Window -This window displays the CDL properties of the item - currently selected in the configuration window. The same - information may be displayed by right-clicking the item - and selecting “properties”. - -Two properties may be double-clicked as - follows: - - -URL – - double-clicking on a URL property causes the - referenced HTML page to be displayed. This has the - same effect as right-clicking on the item and - choosing “Visit - Documentation”. - - -File – - double-clicking on a File property in a saved - configuration causes the File to be displayed. The - viewer used for this purpose may be changed using - the View->Settings menu - item. Note that this operation is only possible when - the current configuration is saved, in order to - avoid the possibility of changing the source - repository. - - - - -Short Description Window -This window displays a short description of the item - currently selected in the configuration window. More - extensive documentation may be available by - right-clicking on the item and choosing “Visit - Documentation”. - - -
-
- - - - - -Updating the Configuration - -Adding and Removing Packages -To add or remove packages from the configuration, select - Build->Packages. - The following dialog box will be displayed: -
-Packages dialog box - -
-The left-hand list shows those packages that are available to - be loaded. The right-hand list shows those that are - currently loaded. In order to transfer packages from one - list to another (that is, to load or unload packages) - double-click the selection or click the - Add or Remove - buttons. - -The version drop-down list displays the versions of the - selected packages. When loading packages, this control may - be used to load versions other than the most recent - (current). Note that if more than one package is selected, - the version drop-down list will display only the versions - common to all the selected packages. - -The window under the version displays a brief - description of the selected package. If more than one - package is selected, this window will be blank. - - - Under the description window there is a Keywords -control into which you can type a string to be matched against -package names, macro names and descriptions. The lists are updated -a second or so after typing has stopped. -If you type several separate words, -all of these words must be associated with a given package -for that package to be displayed. If you select -the Match exactly checkbox, then the string -is taken to be a complete fragment and matched against the beginning -of a name, macro name or descriptions. All matches are done -case-insensitively. - - -If you check Omit hardware packages, only -non-hardware packages will be shown. - - -
- -Platform Selection -To add, modify or remove entries in the list of - platforms used for running tests, select - Tools->Platforms. The following - dialog will be displayed: -
-Platforms dialog box - -
-You may add, modify or remove platform entries as you - wish, but in order to run tests, a platform must be defined - to correspond to the currently loaded hardware template. The - information associated with each platform name is used to - run tests. -To modify a platform, click the - Modify button with the appropriate - platform selected, or double-click on an entry in the list. - A dialog will be displayed that allows you to change the - command prefix, platform type and arguments for - GDB. -
-Platform Modify dialog box - -
-To add a new platform, click the - Add button. A similar dialog will be - displayed that allows you to define a new platform. To - remove a platform, click the Delete - button or press the DEL key with the - appropriate platform selected. - -The command prefix is used when running tests in order - to determine the names of the executables (such as gdb) to - be used. For example, if the gdb executable name is - “arm-elf-gdb.exe” the prefix should be set to - “arm-elf”. -The platform type indicates the capabilities of the platform -- whether it is hardware or a simulator, and whether breakpoints -are supported. -The arguments for the GDB field allow -additional arguments to be passed to gdb when it is used to run -a test. This is typically used in the case of simulators linked -to gdb in order to define memory layout. -
- -Using Templates -To load a configuration based on a template, select - Build->Templates. -The following dialog box will be displayed: -
-Templates dialog box - -
-Change the hardware template, the packages template, or - both. To select a hardware template, choose from the first - drop-list. To choose a packages template, choose from the - second. Brief descriptions of each kind of template are - provided in the corresponding edit boxes. - -Resolving conflicts -During the process of configuring eCos it is possible - that conflicts will be created. For more details of the - meaning of conflicts, see . -The Conflicts Window displays all conflicts in the - current configuration. Additionally, a window in the - status bar displays a count of the conflicts. Because the - resolution of conflicts can be time-consuming, a mechanism - exists whereby conflicts can be resolved - automatically. -You can choose to have a conflicts resolution dialog - box displayed by means of the View->Settings... - menu item, on the Conflict Resolution -tab of the dialog. -
-Options - -
-You can choose to have conflicts checked under the - following circumstances: - - -After any item is changed (in other words, - as soon as the conflict is created) - - -Before saving the configuration (including - building) - - -Never - - -The method you chose depends on how much you need - your configuration to be free of conflicts. You may - want to avoid having to clean up all the conflicts at - once, or you may want to keep the configuration - consistent at all times. If you have major changes to - implement, which may resolve the conflicts, then you - might want to wait until after you have completed - these changes before you check for conflicts. - - -If you choose to check conflicts after any item - is changed, only newly arising conflicts are displayed. - If you choose to check for conflicts before saving the - configuration, the complete set is - displayed. - -
- -Automatic resolution -If you check the “Automatically suggest - fixes” check box, a conflicts resolution dialog box - will be displayed whenever new conflicts are created. The - same dialog box may be displayed at any stage by means of - the Tools->Resolve Conflicts - menu item. - -The conflicts resolution dialog box contains two major windows. -
-Resolve conflicts window - -
-The upper contains the set of conflicts to be addressed; the -format of the data being as that of the Conflicts Window. The lower -window contains a set of proposed resolutions – each entry -is a suggested configuration item value change that as a whole may -be expected to lead to the currently selected conflict being resolved. -Note that there is no guarantee: - - -that automatic resolutions will be determinable for every -conflict. - - - that the resolutions for separate conflicts will be independent. -In other words, the resolution of one conflict may serve to prevent -the resolution of another. - - - that the resolution conflicts will not create further -conflicts. - - -The above warnings are, however, conservative. In practice -(so long as the number and extent of conflicts are limited) automatic -conflict resolution may be used to good effect to correct problems -without undue amounts of programmer intervention. -In order to select the conflicts to be applied, select or -clear the check boxes against the resolutions for each proposed -resolution. By default all resolutions are selected; you can return -to the default state (in other words, cause all check boxes for -each conflict to again become checked) by pressing the “Reset” button. -Note that multiple selection may be used in the resolutions control -to allow ranges of check boxes to be toggled in one gesture. -When you are happy to apply the selected resolutions for each -conflict displayed, click Apply; this will -apply the resolutions. Alternatively you may cancel from the dialog -box without any resolutions being applied. -
-
-
- - - - - -Searching -Select Edit --> Find. -You will be presented with a Find dialog box: -
-Find dialog box - -
-Using this dialog box you can search for an exact text string -in any one of three ways, as specified by your selection in the “Search -in” drop-list: - - -Macro names - the search is for a text match within -configuration item macro names - - - Item names - the search is for a text match within -configuration item descriptive names - - - Short descriptions - the search is for a text match -within configuration item short descriptions - - -Note that to invoke Find you can also -click the Find icon on the toolbar. -
- - - - - -Building -When you have configured eCos, you may build the configuration. -On the Build menu, click: - - - -Library - (or click the Build Library icon on the toolbar) – this -causes the eCos configuration to be built. The result of a successful -build will be (among other things) a library against which user -code can be linked - - - -Tests - – this causes the eCos configuration to be built, and -additionally builds the relevant test cases linked against the eCos library - - - -Clean - – this removes all intermediate files, thus causing a -subsequent build/library or build/tests operation -to cause recompilation of all relevant files. - - - -Stop - – this causes a currently executing build (any of the -above steps) to be interrupted - - -Build options may be displayed by using the Build->Options menu -item. This displays a dialog box containing a drop-list control -and two windows. The drop-list control allows you to select the -type of build option to be displayed (for example “LDFLAGS” are -the options applied at link-time. The left-hand window is a tree -view of the packages loaded in the current configuration. The right-hand -window is a list of the build options that will be used for the -currently selected package. -Note that this dialog box currently affords only read-only -access to the build options. In order to change build options you -must edit the relevant string configuration item. -A single level of inheritance is supported: each package’s -build options are combined with the global options (these are to -be found in the “Global build options” folder -in the configuration view). - - -Selecting Build Tools -Normally the installation process will supply the information -required for the eCosConfiguration Tool to -locate the build tools (compiler, linker, etc.) necessary -to perform a build. However if this information is not registered, -or it is necessary to specify the location manually (for example, -when a new toolchain installation has been made), select Tools->Paths->Build -Tools. The following dialog box will be displayed: -
-Build tools - -
-This dialog box allows you to locate the folder containing -the build tools. -
- -Selecting User Tools -Normally the installation process will supply the information -required for the eCosConfiguration Tool to -locate the user tools (cat, ls, etc.) necessary to perform -a build. However if this information is not registered, or it is -necessary to specify the location manually (for example, when a -new toolchain installation has been made), select Tools->Paths->User -Tools. The following dialog box will be displayed: -
-User tools - -
-
-
- - - - - -Execution -Test executables that have been linked using the Build/Tests -operation against the current configuration can be executed by selecting Tools->Run -Tests. -When tests are run, the Configuration Tool looks -for a platform name corresponding to the currently loaded hardware template. -If no such platform is found, a dialog will be displayed for you -to define one; this dialog is similar to that displayed by the Add function -in the Tools->Platforms dialog, but -in this case the platform name cannot be changed. -When a test run is invoked, a property sheet is displayed, -comprising three tabs: Executables, Output and Summary. -Note that the property sheet is resizable. -Three buttons appear on the property sheet itself: Run/Stop, Close and Properties. -The Run button is used to initiate a -test run. Those tests selected on the Executables tab -are run, and the output recorded on the Output and Summary tabs. -During the course of a run, the Run button -changes to “Stop”. The button may be used to interrupt -a test run at any point. - -Properties -The Properties button is used to change -the connectivity properties for the test run. -
-Properties dialog box - -
- -Download Timeout - This group of controls serves to set the maximum time that - is allowed for downloading a test to the target board. If - the time is exceeded, the test will be deemed to have - failed for reason of “Download Timeout” and - the execution of that particular test will be abandoned. - This option only applies to tests run on hardware, not to - those executed in a simulator. Times are in units of - elapsed seconds. -Three options are available using the drop-down - list: - - -Calculated from file size - an estimate of the maximum -time required for download is made using the (stripped) executable -size and the currently used baud rate - - - Specified - a user-specified value may be entered in -the adjacent edit box - - - None - no maximum download time is to be applied. - - - - -Run time Timeout -This group of controls serves to set the maximum time - that is allowed for executing a test on the target board - or in a simulator. If the time is exceeded, the test will - be deemed to have failed for reason of - “Timeout” and the execution of that particular - test will be abandoned. In the case of hardware, the time - is measured in elapsed seconds: in the case of a simulator - it is in CPU seconds. -Three options are available using the drop-down - list: - - -None - no maximum download time is to be - applied. - - -Specified - a user-specified value may be - entered in the adjacent edit box - - -Default - a default value of 30 seconds is - used - - - - -Connection -The Connection controls may be used - to specify how the target board is to be accessed. - -If the target board is connected using a serial cable, the Serial radio -button should be checked. In this case you can select a port (COM1, -COM2, …) and an appropriate baud rate using drop-list boxes. -If the target board is accessed remotely using GDB remote -protocol, the “TCP/IP” radio button should -be checked. In this case you can select a host name and TCP/IP port -number using edit boxes. - - -Executables Tab -This is used to adjust the set of tests available for execution. -A check box against each executable name indicates whether that -executable will be included when the Run button -is pressed. The Check All and Uncheck -All buttons may be used to check or uncheck all items. -When the property sheet is first displayed, it will be pre-populated -with those test executables that have been linked using the Build/Tests -operation against the current configuration. -
-Run tests - -
-You can right-click in the window to display a context menu -containing Add and Remove items. -Clicking Remove will remove those executables -selected. Clicking Add will display a dialog -box that allows you to add to the set of items. Equivalently the Add button -may be used to add executables, and the DEL key -may be used to remove them. -You can use the Add from Folder button -to add a number of executables in a specified folder (optionally -including subfolders, if you click on Yes when -asked). -
-Add files from folder - -
- - -
- -Output Tab -This tab is used to display the output from running tests. -The output can be saved to a file or cleared by means of the popup -menu displayed when you right-click in the window. - - -Summary Tab -This tab is used to display a record, in summary form, of -those tests executed. For each execution, the following information -is displayed: - - - Time - the date and time of execution - - - Host - the host name of the machine -from which the test was downloaded - - - Platform - the platform on which -the test was executed - - - Executable - the executable (file -name) of the test executed - - - Status - the result of executing -the test. This will be one of the following: - - - Not started - - -No result - - -Inapplicable - - - Pass - - -DTimeout - - -Timeout - - -Cancelled - - - Fail - - -Assert fail - - - Size - the size [stripped/unstripped] of -the test executed - - - Download - the download time [mm:ss/mm:ss] used. -The first of the two times displayed represents the actual time -used: the second the limit time. - - - Elapsed - the elapsed time [mm:ss] used. - - - Execution - the execution time - [mm:ss/mm:ss] used. The first of the -two times displayed represents the actual time used: the second -the limit time. - - -The output can be saved to a file or cleared by means of the -popup menu displayed when you right-click in the window. - -
-
- - - - - -Creating a Shell -To call up a shell window, select Tools->Shell. -Under Windows, you will get a Cygwin shell similar to the one below. On Linux, you will -get a standard Linux shell window. - - -Keyboard Accelerators -The following table presents the list of keyboard accelerators -that can be used with the Configuration Tool. - -Keyboard accelerators - - - - Accelerator - Action - Remarks - - - - - -Alt+1 -hide/show properties window - - - - -Alt+2 -hide/show output window - - - -Alt+3 -hide/show short description window - - - -Alt+4 -hide/show conflicts window - - - - -Ctrl+A -select alloutput -window and in-cell editing - -Ctrl+C -copyoutput window -and in-cell editing - -Ctrl+F -Edit->Find - -Ctrl+N -File->New - -Ctrl+O -File->Open - -Ctrl+S -File->Save - -Ctrl+V -Pastein-cell editing -only - -Ctrl+X -Cutin-cell-editing -only - -Ctrl+Z -Undoin-cell editing -only - -F1 -Context-sensitive help - -F3 -Find next - -F7 -Build->Library - -Shift+F7 -Build->Tests - -Alt+F6 -View->Next window - - -Shift+Alt+0 -View->Previous window - - -Shift+Ins -Pastein-cell editing -only - -Shift+F10 -Display context menuConfiguration -window - -Alt+Enter -Display properties dialog box -Configuration window - -> -Increment item valueConfiguration -window - -<Decrement -item valueConfiguration window - -Space -Toggle item valueConfiguration -window - - -
- -
-
- - - - -
- diff --git a/doc/sgml/user-guide/configuration.sgml b/doc/sgml/user-guide/configuration.sgml deleted file mode 100644 --- a/doc/sgml/user-guide/configuration.sgml +++ /dev/null @@ -1,2023 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Configuration and the Package Repository - -The following chapters contain information on running - ecosconfig (the command line tool that - manipulates configurations and constructs build trees) and on - managing a source repository across multiple versions of - eCos. - - -Manual Configuration - - eCos developers will generally use the graphical - Configuration Tool for configuring an eCos system and building - the target library. However, some user prefer to use command - line tools. These command line tools can also be used for batch - operations on all platforms, for example as part of a nightly - rebuild and testing procedure. - - -In the current release of the system the command line tools - do not provide exactly the same functionality as the graphical - tool. Most importantly, there is no facility to resolve - configuration conflicts interactively. -The eCos configuration system, both graphical and command - line tools, are under constant development and enhancement. - Developers should note that the procedures described may change - considerably in future releases. - - -Directory Tree Structure -When building eCos there are three main directory trees to - consider: the source tree, the build tree, and the install - tree. -The source tree, also known as the component repository, - is read-only. It is possible to use a single component - repository for any number of different configurations, and - it is also possible to share a component repository between - multiple users by putting it on a network drive. -The build tree contains everything that is specific to a - particular configuration, including header and other files - that contain configuration data, and the object files that - result from compiling the system sources for this - configuration. -The install tree is usually located in the install subdirectory -of the build tree. Once an eCos system has been built, the install -tree contains all the files needed for application development including -the header files and the target library. By making copies of the -install tree after a build it is possible to separate application -development and system configuration, which may be desirable for -some organizations. - - - -Creating the Build Tree -Generating a build tree is a non-trivial operation and - should not be attempted manually. Instead, eCos is shipped - with a tool called ecosconfig that should - be used to create a build tree. -Usually ecosconfig will be -run inside the build tree itself. If you are creating a new build -tree then typically you will create a new empty directory using -the mkdir command, cd into -that directory, and then invoke ecosconfig to -create a configuration. By default, the configuration is stored -in a file ecos.ecc in the current -directory. The configuration may be modified by editing this file directly. ecosconfig itself -deals with a number of coarse-grained configuration options such -as the target platform and the packages that should be used. -The ecosconfig tool is also -used subsequently to generate a build tree for a configuration. -Once a build tree exists, it is possible to run ecosconfig again -inside the same build tree. This will be necessary if your wish -to change some of the configuration options. -ecosconfig does not generate -the top-level directory of the build tree; you must do this - yourself. -$ mkdir ecos-work -$ cd ecos-work -The next step is to run ecosconfig: -$ ecosconfig <qualifiers> <command> - -ecosconfig qualifiers -The available command line qualifiers for - ecosconfig are as follows. Multiple - qualifiers may be used on the command line: - - - - - -Provides basic usage guidelines for the - available commands and qualifiers. - - - - - -Specifies an eCos configuration save file for - use by the tool. By default, the file - ecos.ecc in the - current directory is used. Developers may prefer to - use a common location for all their eCos - configurations rather than keep the configuration - information in the base of the build tree. - - - - - -Specifies an alternative location for the - install tree. By default, the install tree resides - inside the install - directory in the build tree. Developers may prefer - to locate the build tree in a temporary file - hierarchy but keep the install tree in a more - permanent location. - - - - - -Specifies the location of the component - repository. By default, the tool uses the location - specified in the - ECOS_REPOSITORY - environment variable. Developers may prefer to use - of this qualifier if they are working with more than - one repository. - - - - - -Disables the implicit resolution of conflicts - while manipulating the configuration data. - developers may prefer to resolve conflicts by - editing the eCos configuration save file - manually. - - - - - - - -By default, ecosconfig will exit with an error code if the current -configuration contains any conflicts, and it is not possible to -generate or update a build tree for such configurations. This -qualifier causes ecosconfig to ignore such problems, and hence it is -possible to generate a build tree even if there are still -conflicts. Of course, there are no guarantees that the resulting -system will actually do anything. - - - - - - - - -Display more information. - - - - - - - - -Display less information. - - - - - -The , and - qualifiers can also be written with two arguments, -for example: - - -ecosconfig --srcdir <dir> ... - - -This simplifies filename completion with some shells. - - - -ecosconfig commands -The available commands for - ecosconfig are as - follows: - - -list - -Lists the available packages, targets and - templates as installed in the eCos repository. - Aliases and package versions are also - reported. - - - -new <target> [<template> [<version>]] - -Creates a new eCos configuration for - the specified target hardware and saves it. A - software template may also be specified. By default, - the template named ‘default’ is used. If - the template version is not specified, the latest - version is used. - - - -target <target> - -Changes the target hardware selection - for the eCos configuration. This has the effect of - unloading packages supporting the target selected - previously and loading the packages which support - the new hardware. This command will be used - typically when switching between a simulator and - real hardware. - - - -template <template> [<version>] - -Changes the template selection for the eCos - configuration. This has the effect of unloading - packages specified by the template selected - previously and loading the packages specified by the - new template. By default, the latest version of the - specified template is used. - - - -remove <packages> - -Removes the specified packages from the eCos - configuration. This command will be used typically - when the template on which a configuration is based - contains packages which are not required. - - - -add <packages> - -Adds the specified packages to the eCos configuration. This -command will be used typically when the template on which a -configuration is based does not contain all the packages which are -required.For example, add-on packages provided by third parties will -not be known to the standard templates, so they will have to be added -explicitly. - - - -version <version> <packages> - -Selects the specified version of a - number of packages in the eCos configuration. By - default, the most recent version of each package is - used. This command will be used typically when an - older version of a package is required. - - - -check - -Presents the following information - concerning the current configuration: - - -the selected target hardware - - -the selected template - - -additional packages - - -removed packages - - -the selected version of packages - where this is not the most recent - version - - -conflicts in the current configuration - - - - - -resolve - -Resolves conflicts identified in the - current eCos configuration by invoking an inference - capability. Resolved conflicts are reported, but not - all conflicts may be resolvable. This command will - be used typically following manual editing of the - configuration. - - - -export <file> - -Exports a minimal eCos configuration - save file with the specified name. This file - contains only those options which do not have their - default value. Such files are used typically to - transfer option values from one configuration to - another. - - - -import <file> - -Imports a minimal eCos configuration - save file with the specified name. The values of - those options specified in the file are applied to - the current configuration. - - - -tree - -Generates a build tree based on the current eCos - configuration. This command will be used typically - just before building eCos.Normally a build tree can -only be generated if if the configuration has no unresolved -conflicts, but can be used to override -this. - - - - - - -Conflicts and constraints -Configuration options are not completely independent. For example -the C library's strtod() and atof() -functions rely on the math library package to provide certain functionality. If the math library package is removed then the C -library can no longer provide these functions. Each package describes constraints like these in CDL "requires" properties. If a constraint is not satisfied, then the configuration contains a conflict. For any given conflict there can -be several resolution options. For example, it would be possible to add the math library package back to the -configuration, or to disable the strtod() and atof() functions. - -The eCos configuration tools will report any conflicts in the current configuration. If there are any such conflicts -then the configuration is usually unsafe and it makes no sense to build and run eCos in such circumstances. In fact, -any attempt at building eCos is likely to fail. In exceptional cases it is possible to override this by using e.g. the - qualifier with ecosconfig. - - -Many constraints are fairly simple in nature, and the configuration tools contain an inference engine which can -resolve the associated conflicts automatically. For example, if the math library package is removed then the -inference engine can resolve the resulting conflict by disabling the configuration option for strtod() and atof(). All -such changes will be reported. Sometimes the inference engine cannot resolve a conflict, for example it is not -allowed to override a change that has been made explicitly by the user. Sometimes it will find a solution which does -not match the application's requirements. - - -A typical session involving conflicts would look something like this: - -$ ecosconfig new pid -This creates a new configuration with the default template. For most targets this will not result in any conflicts, -because the default settings for the various options meet the requirements of the default template. - For some targets -there may be conflicts and the inference engine would come into play. - -$ ecosconfig remove libm -U CYGSEM_LIBC_STDIO_SCANF_FLOATING_POINT, new inferred value 0 -U CYGFUN_LIBC_strtod, new inferred value 0 -U CYGSEM_LIBC_STDIO_PRINTF_FLOATING_POINT, new inferred value 0 - -ecosconfig reports that this change caused three conflicts, all in the C library. The inference engine was able to -resolve all the conflicts and update the relevant configuration options accordingly. -To suppress the inference engine can be used: - -$ ecosconfig new pid -$ ecosconfig --no-resolve remove libm -C CYGSEM_LIBC_STDIO_SCANF_FLOATING_POINT, "requires" constraint not satisfied: CYGPKG_LIBM -C CYGSEM_LIBC_STDIO_PRINTF_FLOATING_POINT, "requires" constraint not satisfied: CYGPKG_LIBM -C CYGFUN_LIBC_strtod, "requires" constraint not satisfied: CYGPKG_LIBM - -Three unresolved conflicts are reported. - -The check command can be used to get the current state of the -configuration, and the qualifier will provide additional information: - -$ ecosconfig --srcdir /home/bartv/ecc/ecc --verbose check -Target: pid -Template: default -Removed: - CYGPKG_LIBM -3 conflict(s): -C CYGFUN_LIBC_strtod, "requires" constraint not satisfied: CYGPKG_LIBM - Possible solution: - CYGFUN_LIBC_strtod -> 0 - CYGSEM_LIBC_STDIO_SCANF_FLOATING_POINT -> 0 -C CYGSEM_LIBC_STDIO_PRINTF_FLOATING_POINT, "requires" constraint not satisfied: CYGPKG_LIBM - Possible solution: - CYGSEM_LIBC_STDIO_PRINTF_FLOATING_POINT -> 0 -C CYGSEM_LIBC_STDIO_SCANF_FLOATING_POINT, "requires" constraint not satisfied: CYGPKG_LIBM - Possible solution: - CYGSEM_LIBC_STDIO_SCANF_FLOATING_POINT -> 0 - - -If the proposed solutions are acceptable, the resolve command can be used to apply them: - -$ ecosconfig resolve -U CYGSEM_LIBC_STDIO_SCANF_FLOATING_POINT, new inferred value 0 -U CYGFUN_LIBC_strtod, new inferred value 0 -U CYGSEM_LIBC_STDIO_PRINTF_FLOATING_POINT, new inferred value 0 - -The current configuration is again conflict-free and it is possible to generate a build tree. The qualifier can -be used to suppress the change messages, if desired. - -When changing individual configuration options by editing the ecos.ecc file (as described below), the resulting -system should be checked and any problems should be resolved. For example, if CYGFUN_LIBC_strtod is -explicitly enabled in the savefile: - -$ edit ecos.ecc -$ ecosconfig check -Target: pid -Template: default -Removed: - CYGPKG_LIBM -1 conflict(s): -C CYGFUN_LIBC_strtod, "requires" constraint not satisfied: CYGPKG_LIBM -$ ecosconfig resolve -C CYGFUN_LIBC_strtod, "requires" constraint not satisfied: CYGPKG_LIBM - -In this case the inference engine cannot resolve the conflict automatically because that would involve changing a -user setting. Any attempt to generate a build tree will fail: - -$ ecosconfig --srcdir /home/bartv/ecc/ecc tree -C CYGFUN_LIBC_strtod, "requires" constraint not satisfied: CYGPKG_LIBM -Unable to generate build tree, this configuration still contains conflicts. -Either resolve the conflicts or use --ignore-errors - - -It is still possible to generate a build tree: - -$ ecosconfig --srcdir /home/bartv/ecc/ecc --ignore-errors tree -C CYGFUN_LIBC_strtod, "requires" constraint not satisfied: CYGPKG_LIBM -$ make - -In this case eCos will fail to build. In other cases of unresolved conflicts eCos may build, but may not run. In -general all conflicts should be resolved by editing the ecos.ecc file, by letting the inference engine make appropriate -changes, or by other means, before any attempt is made to build or run eCos. - - - -Building the System -Once a build tree has been generated with - ecosconfig, building eCos is straightforward: -$ make -The build tree contains the subdirectories, makefiles, - and everything else that is needed to generate the default - configuration for the selected architecture and platform. - The only requirement is that the tools needed for that - architecture, for example - powerpc-eabi-g++, - are available using the standard search path. If this is not - the case then the make will - fail with an error message. If you have a multiprocessor - system then it may be more efficient to use: -$ make -j n -where n is equal to the - number of processors on your system. -Once the make process - has completed, the install tree will contain the header - files and the target library that are needed for application - development. -It is also possible to build the system’s test cases -for the current configuration: -$ make tests -The resulting test executables will end up in a - tests subdirectory of the - install tree. -If disk space is scarce then it is possible to make the copy -of the install tree for application development purposes, and then -use: -$ make clean -The build tree will now use up a minimum of disk space — the -bulk of what is left consists of configuration header files that -you may have edited and hence should not be deleted automatically. -However, it is possible to rebuild the system at any time without -re-invoking ecosconfig, just by -running make again. -Under exceptional circumstances it may be necessary to run make -clean for other reasons, such as when a new release -of the toolchain is installed. The toolchain includes a number of -header files which are closely tied to the compiler, for example limits.h, -and these header files are not and should not be duplicated by eCos. -The makefiles perform header file dependency analysis, so that when -a header file is changed all affected sources will be rebuilt during -the next make. This is very useful -when the configuration header files are changed, but it also means -that a build tree containing information about the locations of -header files must be rebuilt. If a new version of the toolchain -is installed and the old version is removed then this location information -is no longer accurate, and make will -complain that certain dependencies cannot be satisfied. Under such circumstances -it is necessary to do a make clean first. - - -Packages -eCos is a component architecture. The system comes as a - number of packages which can be - enabled or disabled as required, and new packages can be - added as they become available. Unfortunately, the packages - are not completely independent: for example the µITRON - compatibility package relies almost entirely on - functionality provided by the kernel package, and it would - not make sense to try to build µITRON if the kernel - was disabled. The C library has fewer dependencies: some - parts of the C library rely on kernel functionality, but it - is possible to disable these parts and thus build a system - that has the C library but no kernel. The - ecosconfig tool has the capability of - checking that all the dependencies are satisfied, but it - may still be possible to produce configurations that will - not build or (conceivably) that will build but not run. - Developers should be aware of this and take appropriate - care. -By default, ecosconfig will -include all packages that are appropriate for the specified hardware -in the configuration. The common HAL package and -the eCos infrastructure must be present in every configuration. In -addition, it is always necessary to have one architectural HAL package -and one platform HAL package. Other packages are optional, and can -be added or removed from a configuration as required. -The application may not require all of the packages; for example, -it might not need the µITRON compatibility -package, or the floating point support provided by the math library. -There is a slight overhead when eCos is built because the packages -will get compiled, and there is also a small disk space penalty. -However, any unused facilities will get stripped out at link-time, -so having redundant packages will not affect the final executable. - - -Coarse-grained Configuration -Coarse-grained configuration of - an eCos system means making configuration changes using the - ecosconfig tool. These changes - include: - - -switching to different target hardware - - -switching to a different template - - -adding or removing a package - - -changing the version of a package - - -Whenever ecosconfig generates or - updates an eCos configuration, it generates a configuration - save file. -Suppose that the configuration was first created using - the following command line: -$ ecosconfig new stdeval1 -To change the target hardware to the Cogent CMA28x - PowerPC board, the following command would be needed: - -$ ecosconfig target cma28x -To switch to the PowerPC simulator instead: -$ ecosconfig target psim -As the hardware changes, hardware-related packages such as -the HAL packages and device drivers will be added to and removed -from the configuration as appropriate. -To remove any package from the current configuration, use -the remove command: -$ ecosconfig remove uitron -You can disable multiple packages using multiple arguments, -for example: -$ ecosconfig remove uitron libm -If this turns out to have been a mistake then you can - re-enable one or more packages with the - add command: -$ ecosconfig add libm -Changing the desired version for a package is also - straightforward: -$ ecosconfig version v2_1 kernel -It is necessary to regenerate the build tree and header - files following any changes to the configuration before - rebuilding eCos: -$ ecosconfig tree - - -Fine-grained Configuration -ecosconfig only provides - coarse-grained control over the configuration: the hardware, - the template and the packages that should be built. Unlike - the Configuration Tool, - ecosconfig does not provide - any facilities for manipulating finer-grained configuration options such as how many - priority levels the scheduler should support. There are - hundreds of these options, and manipulating them by means of - command line arguments would not be sensible. -In the current system fine-grained configuration options may -be manipulated by manual editing of the configuration file. When -a file has been edited in this way, the ecosconfig tool -should be used to check the configuration for any conflicts which -may have been introduced: -$ ecosconfig check -The check command will list -all conflicts and will also rewrite the configuration file, propagating -any changes which affect other options. The user may choose to resolve -the conflicts either by re-editing the configuration file manually -or by invoking the inference engine using the resolve command: -$ ecosconfig resolve -The resolve command will -list all conflicts which can be resolved and save the resulting changes -to the configuration. -It is necessary to regenerate the build tree and header files -following any changes to the configuration before rebuilding eCos: -$ ecosconfig tree -All the configuration options and their descriptions are listed -in the eCos Reference Manual. - - -Editing an <productname>eCos</productname> Savefile -The eCos configuration information is held in a single - savefile, typically ecos.ecc, which can - be generated by either the GUI configuration tool or by the - command line ecosconfig tool. The file - normally exists at the top level of the build tree. It is a - text file, allowing the various configurations options to be - edited inside a suitable text editor or by other programs or - scripts, as well as in the GUI config tool. -An eCos savefile is actually a script in the Tcl programming -language, so any modifications to the file need to preserve Tcl -syntax. For most configuration options, any modifications will be -trivial and there is no need to worry about Tcl syntax. For example, -changing a 1 to a 0 to disable an option. For more complicated -options, for example CYGDAT_UITRON_TASK_EXTERNS, -which involves some lines of C code, more care has -to be taken. If an edited savefile is no longer a valid Tcl script -then the configuration tools will be unable to read back the data -for further processing, for example to generate a build tree. An -outline of Tcl syntax is given below. One point worth noting here -is that a line that begins with a “#” is -usually a comment, and the bulk of an eCos savefile actually consists -of such comments, to make it easier to edit. - -Header -An eCos savefile begins with a header, which typically - looks something like this: -# eCos saved configuration -# ---- commands -------------------------------------------------------- -# This section contains information about the savefile format. -# It should not be edited. Any modifications made to this section -# may make it impossible for the configuration tools to read -# the savefile. - -cdl_savefile_version 1; -cdl_savefile_command cdl_savefile_version {}; -cdl_savefile_command cdl_savefile_command {}; -cdl_savefile_command -cdl_configuration { description hardware template package }; -cdl_savefile_command cdl_package { value_source user_value wizard_value inferred_value }; -cdl_savefile_command cdl_component { value_source user_value wizard_value inferred_value }; -cdl_savefile_command cdl_option { value_source user_value wizard_value inferred_value }; -cdl_savefile_command cdl_interface { value_source user_value wizard_value inferred_value }; - -This section of the savefile is intended for use by the - configuration system, and should not be edited. If this - section is edited then the various configuration tools may no - longer be able to read in the modified savefile. - - -Toplevel Section -The header is followed by a section that defines the - configuration as a whole. A typical example would - be: -# ---- toplevel -------------------------------------------------------- -# This section defines the toplevel configuration object. The only -# values that can be changed are the name of the configuration and -# the description field. It is not possible to modify the target, -# the template or the set of packages simply by editing the lines -# below because these changes have wide-ranging effects. Instead -# the appropriate tools should be used to make such modifications. - -cdl_configuration eCos { -description ““ ; - -# These fields should not be modified. -hardware pid ; -template uitron ; -package -hardware CYGPKG_HAL_ARM current ; -package -hardware CYGPKG_HAL_ARM_PID current ; -package -hardware CYGPKG_IO_SERIAL current ; -package -template CYGPKG_HAL current ; -package -template CYGPKG_IO current ; -package -template CYGPKG_INFRA current ; -package -template CYGPKG_KERNEL current ; -package -template CYGPKG_UITRON current ; -package -template CYGPKG_LIBC current ; -package -template CYGPKG_LIBM current ; -package -template CYGPKG_DEVICES_WALLCLOCK current ; -package -template CYGPKG_ERROR current ; -}; - -This section allows the configuration tools to reload the -various packages that make up the configuration. Most of the information -should not be edited. If it is necessary to add a new package or -to remove an existing one then the appropriate tools should be used -for this, for example: -$ ecosconfig remove CYGPKG_LIBM -There are two fields which can be edited. Configurations have -a name; in this case eCos. They can also have a description, which -is some arbitrary text. The configuration tools do not make use -of these fields, they exist so that users can store additional information -about a configuration. - - -Conflicts Section -The toplevel section is followed by details of all the - conflicts (if any) in the configuration, for - example: -# ---- conflicts ------------------------------------------------------- -# There are 2 conflicts. -# -# option CYGNUM_LIBC_TIME_DST_DEFAULT_OFFSET -# Property LegalValues -# Illegal current value 100000 -# Legal values are: -90000 to 90000 -# -# option CYGSEM_LIBC_TIME_CLOCK_WORKING -# Property Requires -# Requires constraint not satisfied: CYGFUN_KERNEL_THREADS_TIMER - -When editing a configuration you may end up with something -that is invalid. Any problems in the configuration will be reported -in the conflicts section. In this case there are two conflicts. -The option CYGNUM_LIBC_TIME_DST_DEFAULT_OFFSET has -been given an illegal value: typically this would be fixed by searching -for the definition of that option later on in the savefile and modifying -the value. The second conflict is more interesting, an unsatisfied requires constraint. -Configuration options are not independent: disabling some functionality -in, say, the kernel, can have an impact elsewhere; in this case -the C library. The various dependencies between the options are -specified by the component developers and checked by the configuration -system. In this case there are two obvious ways in which the conflict could -be resolved: re-enabling CYGFUN_KERNEL_THREADS_TIMER, -or disabling CYGSEM_LIBC_TIME_CLOCK_WORKING. -Both of these options will be listed later on in the file. -Some care has to be taken when modifying configuration options, -to avoid introducing new conflict. For instance it is possible that -there might be other options in the system which have a dependency -on CYGSEM_LIBC_TIME_CLOCK_WORKING, -so disabling that option may not be the best way to resolve the -conflict. Details of all such dependencies are provided in the appropriate -places in the savefile. -It is not absolutely required that a configuration be conflict-free -before generating a build tree and building eCos. It is up to the -developers of each component to decide what would happen if an attempt -is made to build eCos while there are still conflicts. In serious -cases there is likely to be a compile-time failure, or possibly -a link-time failure. In less serious cases the system may build -happily and the application can be linked with the resulting library, -but the component may not quite function as intended - although -it may still be good enough for the specific needs of the application. -It is also possible that everything builds and links, but once in -a while the system will unaccountably crash. Using a configuration -that still has conflicts is done entirely at the user’s -risk. - - -Data Section -The bulk of the savefile lists the various packages, - components, and options, including their values and the - various dependencies. A number of global options come - first, especially those related to the build process such - as compiler flags. These are followed by the various - packages, and the components and options within those - packages, in order. -Packages, components and options are organized in a - hierarchy. If a particular component is disabled then all - options and sub-components below it will be inactive: any - changes made to these will have no effect. The savefile - contains information about the hierarchy in the form of - comments, for example: -cdl_package CYGPKG_KERNEL ... -# > -cdl_component CYGPKG_KERNEL_EXCEPTIONS ... -# > -cdl_option CYGSEM_KERNEL_EXCEPTIONS_DECODE ... -cdl_option CYGSEM_KERNEL_EXCEPTIONS_GLOBAL ... -# < -cdl_component CYGPKG_KERNEL_SCHED ... -# > -cdl_option CYGSEM_KERNEL_SCHED_MLQUEUE ... -cdl_option CYGSEM_KERNEL_SCHED_BITMAP ... -# < -# < - -This corresponds to the following hierarchy: - CYGPKG_KERNEL - CYGPKG_KERNEL_EXCEPTIONS - CYGSEM_KERNEL_EXCEPTIONS_DECODE - CYGSEM_KERNEL_EXCEPTIONS_GLOBAL - CYGPKG_KERNEL_SCHED - CYGSEM_KERNEL_SCHED_MLQUEUE - CYGSEM_KERNEL_SCHED_BITMAP - -Providing the hierarchy information in this way allows - programs or scripts to analyze the savefile and readily - determine the hierarchy. It could also be used by a - sufficiently powerful editor to support structured editing - of eCos savefiles. The information is not used by the - configuration tools themselves since they obtain the - hierarchy from the original CDL scripts. -Each configurable entity is preceded by a comment, of - the following form: -# Kernel schedulers -# doc: ref/ecos-ref/ecos-kernel-overview.html#THE-SCHEDULER -# The eCos kernel provides a choice of schedulers. In addition -# there are a number of configuration options to control the -# detailed behaviour of these schedulers. -cdl_component CYGPKG_KERNEL_SCHED { -... -}; - -This provides a short textual alias - Kernel schedulers for the - component. If online documentation is available for the - configurable entity then this will come next. Finally - there is a short description of the entity as a whole. All - this information is provided by the component - developers. -Each configurable entity takes the form: -<type> <name> { - <data> -}; -Configurable entities may not be active. This can be either -because the parent is disabled or inactive, or because there are -one or more active_if properties. Modifying -the value of an inactive entity has no effect on the configuration, -so this information is provided first: - -cdl_option CYGSEM_KERNEL_EXCEPTIONS_DECODE { -# This option is not active -# The parent CYGPKG_KERNEL_EXCEPTIONS is disabled -... -}; - -... - -cdl_option CYGIMP_IDLE_THREAD_YIELD { -# This option is not active -# ActiveIf constraint: (CYGNUM_KERNEL_SCHED_PRIORITIES == 1) -# CYGNUM_KERNEL_SCHED_PRIORITIES == 32 -# --> 0 -... -}; - - -For CYGIMP_IDLE_THREAD_YIELD the -savefile lists the expression that must be satisfied if the option -is to be active, followed by the current value of all entities that -are referenced in the expression, and finally the result of evaluating -that expression. -Not all options are directly modifiable in the savefile. First, -the value of packages (which is the version of that package loaded -into the configuration) cannot be modified here. - - -cdl_package CYGPKG_KERNEL { -# Packages cannot be added or removed, nor can their version be changed, -# simply by editing their value. Instead the appropriate configuration -# should be used to perform these actions. -... -}; - - -The version of a package can be changed using e.g.: -$ ecosconfig version 1.3 CYGPKG_KERNEL -Even though a package’s value cannot be modified -here, it is still important for the savefile to contain the details. -In particular packages may impose constraints on other configurable -entities and may be referenced by other configurable entities. Also -it would be difficult to understand or extract the configuration’s -hierarchy if the packages were not listed in the appropriate places -in the savefile. -Some components (or, conceivably, options) do not have any -associated data. Typically they serve only to introduce another -level in the hierarchy, which can be useful in the context of the -GUI configuration tool. - - -cdl_component CYGPKG_HAL_COMMON_INTERRUPTS { -# There is no associated value. -}; - - -Other components or options have a calculated value. These -are not user-modifiable, but typically the value will depend on -other options which can be modified. Such calculated options can -be useful when controlling what gets built or what ends up in the -generated configuration header files. A calculated value may also -effect other parts of the configuration, for instance, via a requires constraint. - - -cdl_option BUFSIZ { -# Calculated value: CYGSEM_LIBC_STDIO_WANT_BUFFERED_IO ? CYGNUM_LIBC_STDIO_BUFSIZE : 0 -# CYGSEM_LIBC_STDIO_WANT_BUFFERED_IO == 1 -# CYGNUM_LIBC_STDIO_BUFSIZE == 256 -# Current_value: 256 -}; - - -A special type of calculated value is the interface. -The value of an interface is the number of active and enabled options -which implement that interface. Again the value -of an interface cannot be modified directly; only by modifying the -options which implement the interface. However, an interface can -be referenced by other parts of the configuration. -cdl_interface CYGINT_KERNEL_SCHEDULER { -# Implemented by CYGSEM_KERNEL_SCHED_MLQUEUE, active, enabled -# Implemented by CYGSEM_KERNEL_SCHED_BITMAP, active, disabled -# This value cannot be modified here. -# Current_value: 1 -# Requires: 1 == CYGINT_KERNEL_SCHEDULER -# CYGINT_KERNEL_SCHEDULER == 1 -# --> 1 - - -# The following properties are affected by this value -# interface CYGINT_KERNEL_SCHEDULER -# Requires: 1 == CYGINT_KERNEL_SCHEDULER -}; -If the configurable entity is modifiable then there will be -lines like the following: - -cdl_option CYGSEM_KERNEL_SCHED_MLQUEUE { -... -# Flavor: bool -# No user value, uncomment the following line to provide one. -# user_value 1 -# value_source default -# Default value: 1 -... -}; - - -Configurable entities can have one of four different flavors: -none, bool, data and booldata. Flavor none indicates that there -is no data associated with the entity, typically it just acts as -a placeholder in the overall hierarchy. Flavor bool is the most -common, it is a simple yes-or-no choice. Flavor data is for more -complicated configuration choices, for instance the size of an array -or the name of a device. Flavor booldata is a combination of bool -and data: the option can be enabled or disabled, and there is some -additional data associated with the option as well. -In the above example the user has not modified this particular -option, as indicated by the comment and by the commented-out user_value line. -To disable this option the file should be edited to: - - -cdl_option CYGSEM_KERNEL_SCHED_MLQUEUE { -... -# Flavor: bool -# No user value, uncomment the following line to provide one. -user_value 0 -# value_source default -# Default value: 1 -... -} - - -The comment preceding the user_value -0 line can be removed if desired, otherwise it -will be removed automatically the next time the file is read and -updated by the configuration tools. -Much the same process should be used for options with the -data flavor, for example: - -cdl_option CYGNUM_LIBC_TIME_DST_DEFAULT_OFFSET { -# Flavor: data -# No user value, uncomment the following line to provide one. -# user_value 3600 -# value_source default -# Default value: 3600 -# Legal values: -90000 to 90000 -}; - - -can be changed to: - - -cdl_option CYGNUM_LIBC_TIME_DST_DEFAULT_OFFSET { -# Flavor: data -user_value 7200 -# value_source default -# Default value: 3600 -# Legal values: -90000 to 90000 }; - - -Note that the original text provides the default value in -the user_value comment, -on the assumption that the desired new value is likely to be similar -to the default value. The value_source comment -does not need to be updated, it will be fixed up if the savefile -is fed back into the configuration system and regenerated. -For options with the booldata flavor, the user_value line -needs take two arguments. The first argument is for the boolean -part, the second for the data part. For example: - -cdl_component CYGNUM_LIBM_COMPATIBILITY { -# Flavor: booldata -# No user value, uncomment the following line to provide one. -# user_value 1 POSIX -# value_source default -# Default value: 1 POSIX -# Legal values: “POSIX” “IEEE” “XOPEN” “SVID” -... -}; - - -could be changed to: - -cdl_component CYGNUM_LIBM_COMPATIBILITY { -# Flavor: booldata -user_value 1 IEEE -# value_source default -# Default value: 1 POSIX -# Legal values: “POSIX” “IEEE” “XOPEN” “SVID” -... -}; - - -or alternatively, if the whole component should be disabled, -to: - -cdl_component CYGNUM_LIBM_COMPATIBILITY { -# Flavor: booldata -user_value 0 POSIX -# value_source default -# Default value: 1 POSIX -# Legal values: “POSIX” “IEEE” “XOPEN” “SVID” -... -}; - - -Some options take values that span multiple lines. An example -would be: - - -cdl_option CYGDAT_UITRON_MEMPOOLVAR_INITIALIZERS { -# Flavor: data -# No user value, uncomment the following line to provide one. -# user_value \ -# “CYG_UIT_MEMPOOLVAR( vpool1, 2000 ), \\ -# CYG_UIT_MEMPOOLVAR( vpool2, 2000 ), \\ -# CYG_UIT_MEMPOOLVAR( vpool3, 2000 ),” -# value_source default -# Default value: \ -# “CYG_UIT_MEMPOOLVAR( vpool1, 2000 ), \\ -# CYG_UIT_MEMPOOLVAR( vpool2, 2000 ), \\ -# CYG_UIT_MEMPOOLVAR( vpool3, 2000 ),” -}; - - -Setting a user value for this option involves uncommenting -and modifying all relevant lines, for example: - - -cdl_option CYGDAT_UITRON_MEMPOOLVAR_INITIALIZERS { -# Flavor: data -user_value \ -“CYG_UIT_MEMPOOLVAR( vpool1, 4000 ), \\ -CYG_UIT_MEMPOOLVAR( vpool2, 4000 ),” -# value_source default -# Default value: \ -# “CYG_UIT_MEMPOOLVAR( vpool1, 2000 ), \\ -# CYG_UIT_MEMPOOLVAR( vpool2, 2000 ), \\ -# CYG_UIT_MEMPOOLVAR( vpool3, 2000 ),” -}; - - -In such cases appropriate care has to be taken to preserve -Tcl syntax, as discussed below. -The configuration system has the ability to keep track of - several different values for any given option. All options - start off with a default value, in other words their value - source is set to default. If a - configuration involves conflicts and the configuration - system’s inference engine is allowed to resolve these - automatically then it may provide an - inferred value instead, for - example: - - -cdl_option CYGMFN_KERNEL_SYNCH_CONDVAR_TIMED_WAIT { -# Flavor: bool -# No user value, uncomment the following line to provide one. -# user_value 1 -# The inferred value should not be edited directly. -inferred_value 0 -# value_source inferred -# Default value: 1 -... -}; - - -Inferred values are calculated by the configuration system -and should not be edited by the user. If the inferred value is not -correct then a user value should be substituted instead: - - -cdl_option CYGMFN_KERNEL_SYNCH_CONDVAR_TIMED_WAIT { -# Flavor: bool -user_value 1 -# The inferred value should not be edited directly. -inferred_value 0 -# value_source inferred -# Default value: 1 -... -}; -The inference engine will not override a user value with an -inferred one. Making a change like this may well re-introduce a -conflict, since the inferred value was only calculated to resolve -a conflict. Another run of the inference engine may find a different -and more acceptable way of resolving the conflict, but this is not guaranteed -and it may be up to the user to examine the various dependencies -and work out an acceptable solution. -Inferred values are listed in the savefile because the exact -inferred value may depend on the order in which changes were made -and conflicts were resolved. If the inferred values were absent -then it is possible that reloading a savefile would not exactly -restore the configuration. Default values on the other hand are -entirely deterministic so there is no actual need for the values -to be listed in the savefile. However, the default value can be -very useful information so it is provided in a comment. -Occasionally the user will want to do some experimentation, -and temporarily switch an option from a user value back to a default -or inferred one to see what the effect would be. This could be achieved -by simply commenting out the user value. For instance, if the current -savefile contains: - -cdl_option CYGMFN_KERNEL_SYNCH_CONDVAR_TIMED_WAIT { -# Flavor: bool -user_value 1 -# The inferred value should not be edited directly. -inferred_value 0 -# value_source user -# Default value: 1 -... -}; - - -then the inferred value could be restored by commenting out -or removing the user_value line: - -cdl_option CYGMFN_KERNEL_SYNCH_CONDVAR_TIMED_WAIT { -# Flavor: bool -# user_value 1 -# The inferred value should not be edited directly. -inferred_value 0 -# value_source user -# Default value: 1 -... -}; - - -This is fine for simple values. However if the value is complicated -then there is a problem: commenting out the user_value line -or lines means that the user value becomes invisible to the configuration system, -so if the savefile is loaded and then regenerated the information -will be lost. An alternative approach is to keep the user_value but -explicitly set the value_source line, -for example: - - -cdl_option CYGMFN_KERNEL_SYNCH_CONDVAR_TIMED_WAIT { -# Flavor: bool -user_value 1 -# The inferred value should not be edited directly. -inferred_value 0 -value_source inferred -# Default value: 1 -... -}; - - -In this case the configuration system will use the inferred -value for the purposes of dependency analysis etc., even though -a user value is present. To restore the user value the value_source line -can be commented out again. If there is no explicit value_source then -the configuration system will just use the highest priority one: -the user value if it exists; otherwise the inferred value if it -exists; otherwise the default value which always exists. -The default value for an option can be a simple constant, -or it can be an expression involving other options. In the latter -case the expression will be listed, together with the values for -all options referenced in the expression and the current result -of evaluating that expression. This is for informational purposes -only, the default value is always recalculated deterministically -when loading in a savefile. - - -cdl_option CYGBLD_GLOBAL_COMMAND_PREFIX { -# Flavor: data -# No user value, uncomment the following line to provide one. -# user_value arm-elf -# value_source default -# Default value: CYGHWR_THUMB ? “thumb-elf” : “arm-elf” -# CYGHWR_THUMB == 0 -# --> arm-elf -}; - - -For options with the data or booldata flavor, there are likely -to be constraints on the possible values. If the value is supposed -to be a number in a given range and a user value of “hello -world” is provided instead then there -are likely to be compile-time failures. Component developers can -specify constraints on the legal values, and these will be listed -in the savefile. - -cdl_option X_TLOSS { -# Flavor: data -# No user value, uncomment the following line to provide one. -# user_value 1.41484755040569E+16 -# value_source default -# Default value: 1.41484755040569E+16 -# Legal values: 1 to 1e308 -}; - - -cdl_component CYGNUM_LIBM_COMPATIBILITY { -# Flavor: booldata -# No user value, uncomment the following line to provide one. -# user_value 1 POSIX -# value_source default -# Default value: 1 POSIX -# Legal values: “POSIX” “IEEE” “XOPEN” “SVID” -... -}; - - -In some cases the legal values list may be an expression involving -other options. If so then the current values of the referenced options -will be listed, together with the result of evaluating the list -expression, just as for default value expressions. -If an illegal value is provided then this will result in a -conflict, listed in the conflicts section of the savefile. For more -complicated options a simple legal values list is not sufficient -to allow the current value to be validated, and the configuration -system will be unable to flag conflicts. This issue will be addressed in -future releases of the configuration system. -Following the value-related fields for a given option, any requires constraints belonging -to this option will be listed. These constraints are only effective -if the option is active and, for bool and booldata flavors, enabled. -If some aspect of eCos functionality is inactive or disabled then -it cannot impose any constraints on the rest of the system. As usual, -the full expression will be listed followed by the current values -of all options that are referenced and the result of evaluating -the expression: - - -cdl_option CYGSEM_LIBC_TIME_TIME_WORKING { -... -# Requires: CYGPKG_DEVICES_WALLCLOCK -# CYGPKG_DEVICES_WALLCLOCK == current -# --> 1 -}; - - -When modifying the value of an option it is useful to know -not only what constraints the option imposes on the rest of the -system but also what other options in the system depend in some -way on this one. The savefile provides this information: -cdl_option CYGFUN_KERNEL_THREADS_TIMER { -... -# The following properties are affected by this value -# option CYGMFN_KERNEL_SYNCH_CONDVAR_TIMED_WAIT -# Requires: CYGFUN_KERNEL_THREADS_TIMER -# option CYGIMP_UITRON_STRICT_CONFORMANCE -# Requires: CYGFUN_KERNEL_THREADS_TIMER -# option CYGSEM_LIBC_TIME_CLOCK_WORKING -# Requires: CYGFUN_KERNEL_THREADS_TIMER -}; - - - - -Tcl Syntax -eCos savefiles are implemented as Tcl scripts, and are read -in by running the data through a standard Tcl interpreter that has -been extended with a small number of additional commands such as cdl_option and cdl_configuration. -In many cases this is an implementation detail that can be safely -ignored while editing a savefile: simply replacing a 1 with -a 0 to disable some functionality -is not going to affect whether or not the savefile is still a valid -Tcl script and can be processed by a Tcl interpreter. However, there -are more complicated cases where an understanding of Tcl syntax -is at least desirable, for example: - - -cdl_option CYGDAT_UITRON_MEMPOOLVAR_EXTERNS { - # Flavor: data - user_value \ - “static char vpool1\[ 2000 \], \\ - vpool2\[ 2000 \], \\ - vpool3\[ 2000 \];” -# value_source default -# Default value: \ - # “static char vpool1\[ 2000 \], \\ - # vpool2\[ 2000 \], \\ - # vpool3\[ 2000 \];” -}; - - -The backslash at the end of the user_value line -is processed by the Tcl interpreter as a line continuation character. -The quote marks around the user data are also interpreted by the -Tcl interpreter and serve to turn the entire data field into a single -argument. The backslashes preceding the opening and closing square -brackets prevent the Tcl interpreter from treating these characters -specially, otherwise there would be an attempt at command -substitution as described below. The double backslashes -at the end of each line of the data will be turned into a single -backslash by the Tcl interpreter, rather than escaping the newline -character, so that the actual data seen by the configuration system -is: - - -static char vpool1[ 2000 ], \ - vpool2[ 2000 ], \ - vpool3[ 2000 ]; - - -This is of course the data that should end up in the µITRON -configuration header file. The opening and closing braces surrounding -the entire body of the option data are also significant and cause -this body to be passed as a single argument to the cdl_option command. -The closing semicolon is optional in this example, but provides -a small amount of additional robustness if the savefile is edited -such that it is no longer a valid Tcl script. If the data contained -any $ characters then -these would have to be treated specially as well, via a backslash escape. -In spite of what all the above might seem to suggest, Tcl -is actually a very simple yet powerful scripting language: the syntax -is defined by just eleven rules. On occasion this simplicity means -that Tcl’s behaviour is subtly different from other languages, -which can confuse newcomers. -When the Tcl interpreter is passed some data such as puts -Hello, it splits this data into a command and its -arguments. The command will be terminated by a newline or by a semicolon, -unless one of the quoting mechanisms is used. The command and each -of its arguments are separated by white space. So in the following -example: -puts Hello -set x 42 -will result in two separate commands being executed. The first -command is puts and is passed a -single argument, Hello. The second -command is set and is passed two -arguments, x and 42. -The intervening newline character serves to terminate the first -command, and a semi-colon separator could be used instead: -puts Hello;set x 42 -Any white space surrounding the semicolon is just ignored -because it does not serve to separate arguments. -Now consider the following: -set x Hello world -This is not valid Tcl. It is an attempt to invoke the set command -with three arguments: x, Hello, -and world. The set only -takes two arguments, a variable name and a value, so it is necessary -to combine the data into a single argument by quoting: -set x “Hello world” -When the Tcl interpreter encounters the first quote character -it treats all subsequent data up to but not including the closing -quote as part of the current argument. The quote marks are removed -by the interpreter, so the second argument passed to the set command -is just Hello world without the -quote characters. This can be significant in the context of eCos savefiles. -For instance, consider the following configuration option: - - -cdl_option CYGDAT_LIBC_STDIO_DEFAULT_CONSOLE { -# Flavor: data -# No user value, uncomment the following line to provide one. -# user_value “\”/dev/ttydiag\”” -# value_source default -# Default value: “\”/dev/ttydiag\”” -}; - - -The desired value of the configuration option should be a -valid C string, complete with quote characters. If the savefile -was edited to: - - -cdl_option CYGDAT_LIBC_STDIO_DEFAULT_CONSOLE { -# Flavor: data -user_value “/dev/ttydiag” -# value_source default -# Default value: “\”/dev/ttydiag\”” -}; - - -then the Tcl interpreter would remove the quote marks when -the savefile is read back in, so the option’s value would -not have any quote marks and would not be a valid C string. The -configuration system is not yet able to perform the required validation -so the following #define would -be generated in the configuration header file: -#define CYGDAT_LIBC_STDIO_DEFAULT_CONSOLE /dev/ttydiag -This is likely to cause a compile-time failure when building -eCos. -A quoted argument continues until the closing quote character -is encountered, which means that it can span multiple lines. This -can also be encountered in eCos savefiles, for instance, in the CYGDAT_UITRON_MEMPOOLVAR_EXTERNS example -mentioned earlier. Newline or semicolon characters do not terminate -the current command in such cases. -The Tcl interpreter supports much the same forms of backslash -substitution as other common programming languages. Some backslash -sequences such as \n will -be replaced by the appropriate character. The sequence \\ will -be replaced by a single backslash. A backslash at the very end of -a line will cause that backslash, the newline character, and any -white space at the start of the next line to be replaced by a single -space. Hence the following two Tcl commands are equivalent: -puts “Hello\nworld\n” -puts \ -“Hello -world -“ -In addition to quote and backslash characters, the Tcl interpreter -treats square brackets, the $ character, -and braces specially. Square brackets are used for command substitution, -for example: -puts “The answer is [expr 6 * 9]” -When the Tcl interpreter encounters the square brackets it -will treat the contents as another command that should be executed -first, and the result of executing that is used when continuing -to process the script. In this case the Tcl interpreter will execute -the command expr 6 * 9, -yielding a result of 54, and then the Tcl interpreter will execute -puts “The answer is 54”. It should be noted that -the interpreter contains only one level of substitution: if the -result of performing command substitution performs further special -characters such as square brackets then these will not be treated -specially. -Command line substitution is very unlikely to prove useful -in the context of an eCos savefile, but it is part of the Tcl language -and hence cannot be easily suppressed while reading in a savefile. -As a result care has to be taken when savefile data involves square -brackets. Consider the following: - - -cdl_option CYGDAT_UITRON_MEMPOOLFIXED_EXTERNS { - ... - user_value \ -“static char fpool1[ 2000 ], -fpool2[ 2000 ];” - ... -}; - -The Tcl interpreter will interpret the square brackets as -an attempt at command substitution and hence it will attempt to -execute the command 2000 with no -arguments. No such command is defined by the Tcl language or by -the savefile-related extensions provided by the configuration system, -so this will result in an error when an attempt is made to read -back the savefile. Instead it is necessary to backslash-escape the -square brackets and thus suppress command substitution: - - -cdl_option CYGDAT_UITRON_MEMPOOLFIXED_EXTERNS { - ... - user_value \ -“static char fpool1\[ 2000 \], -fpool2\[ 2000 \];” - ... -}; -Similarly the $ character -is used in Tcl scripts to perform variable substitution: -set x [expr 6 * 9] -puts “The answer is $x” -Variable substitution, like command substitution, is very -unlikely to prove useful in the context of an eCos savefile. Should -it be necessary to have a $ character -in configuration data then again a backslash escape needs to be -used. -cdl_option FOODAT_MONITOR_PROMPT { - ... - user_value “\$ “ - ... -}; -Braces are used to collect a sequence of characters into a -single argument, just like quotes. The difference is that variable, -command and backslash substitution do not occur inside braces (with -the sole exception of backslash substitution at the end of a line). -So, for example, the CYGDAT_UITRON_MEMPOOL_EXTERNFIXED_EXTERNS value -could be written as: -cdl_option CYGDAT_UITRON_MEMPOOLFIXED_EXTERNS { - ... - user_value \ -{static char fpool1[ 2000 ], -fpool2[ 2000 ];} - ... -}; -The configuration system does not use this when generating -savefiles because for simple edits of a savefile by inexperienced -users the use of brace characters is likely to be a little bit more -confusing than the use of quotes. -At this stage it is worth noting that the basic format of -each configuration option in the savefile makes use of braces: -cdl_option <name> { - ... -}; -The configuration system extends the Tcl language with a small -number of additional commands such as cdl_option. -These commands take two arguments, a name and a body, where the -body consists of all the text between the braces. First a check -is made that the specified option is actually present in the configuration. -Then the body is executed in a recursive invocation of the Tcl interpreter, -this time with additional commands such as user_value and value_source. -If, after editing, the braces are not correctly matched up then -the savefile will no longer be a valid Tcl script and errors will -be reported when the savefile is loaded again. -Comments in Tcl scripts are introduced by a hash character #. -However, a hash character only introduces a comment if it occurs -where a command is expected. Consider the following: -# This is a comment -puts “Hello” # world -The first line is a valid comment, since the hash character -occurs right at the start where a command name is expected. The -second line does not contain a comment. Instead it is an attempt -to invoke the puts command with -three arguments: Hello, # and world. -These are not valid arguments for the puts command -so an error will be raised. -If the second line was rewritten as: -puts “Hello”; # world -then this is a valid Tcl script. The semicolon identifies -the end of the current command, so the hash character occurs at -a point where the next command would start and hence it is interpreted -as the start of a comment. -This handling of comments can lead to subtle behaviour. Consider -the following: -cdl_option WHATEVER { - # This is a comment } - user_value 42 - ... -} -Consider the way the Tcl interpreter processes this. The command -name and the first argument do not pose any special difficulties. -The opening brace is interpreted as the start of the next argument, -which continues until a closing brace is encountered. In this case -the closing brace occurs on the second line, so the second argument -passed to cdl_option is \n # This is a comment . This second argument -is processed in a recursive invocation of the Tcl interpreter and -does not contain any commands, just a comment. Toplevel savefile -processing then resumes, and the next command that is encountered -is user_value. Since the -relevant savefile code is not currently processing a configuration -option this is an error. Later on the Tcl interpreter would encounter -a closing brace by itself, which is also an error. Fortunately this -sequence of events is very unlikely to occur when editing generated -savefiles. -This should be sufficient information about Tcl to allow for -safe editing of eCos savefiles. Further information is available -from a wide variety of sources, for example the book Tcl -and the Tk Toolkit by John K Ousterhout. - - - -Editing the Sources -For many users, controlling the packages and - manipulating the available configuration options will be - sufficient to create an embedded operating system that meets - the application's requirements. However, since eCos is - shipped entirely in source form, it is possible to go - further when necessary: you can edit the eCos sources themselves. This requires some - understanding of the way the eCos build system works. - -The most obvious place to edit the source code is directly -in the component repository. For example, you could -edit the file kernel/&Version;/src/sync/mutex.cxx -to change the way kernel mutexes work, or possibly just to add some -extra diagnostics or assertions. Once the file has been edited, -it is possible to invoke make at -the top level of the build tree and the target library will be rebuilt -as required. A small optimization is possible: the build tree is -largely a mirror of the component repository, so it too will contain -a subdirectory kernel/&Version;; -if make is invoked in this directory -then it will only check for changes to the kernel sources, which -is a bit more efficient than checking for changes throughout the component -repository. -Editing a file in the component repository is fine if this -tree is used for only one eCos configuration. If the repository -is used for several different configurations, however, and especially -if it is shared by multiple users, then making what may be experimental -changes to the master sources would be a bad idea. The build system provides -an alternative. It is possible to make a copy of the file in the -build tree, in other words copy mutex.cxx from -the kernel/&Version;/src/sync directory -in the component repository to kernel/&Version;/src/sync in -the build tree, and edit the file in the build tree. When make is -invoked it will pick up local copies of any of the sources in preference -to the master versions in the component repository. Once you have -finished modifying the eCos sources you can install the final version -back in the component repository. If the changes were temporary -in nature and only served to aid the debugging process, then you -can discard the modified version of the sources. -The situation is slightly more complicated for the header -files that a package may export, such as the C library’s stdio.h header -file, which can be found in the directory language/c/libc/&Version;/include. -If such a header file is changed, either directly in the component -repository or after copying it to the build tree, then make must -be invoked at the top level of the build tree. In cases like this -it is not safe to rebuild just the C library because other packages -may depend on the contents of stdio.h. - - -Modifying the Memory Layout -Each eCos platform package is supplied with linker script -fragments which describe the location of memory regions on the evaluation -board and the location of memory sections within these regions. -The correct linker script fragment is selected and included in the -eCos linker script target.ld when -eCos is built. -It is not necessary to modify the default memory -layouts in order to start development with eCos. However, it will -be necessary to edit a linker script fragment when the memory map -of the evaluation board is changed. For example, if additional memory -is added, the linker must be notified that the new memory is available -for use. As a minimum, this would involve modifying the length of -the corresponding memory region. Where the available memory is non-contiguous, -it may be necessary to declare a new memory region and reassign -certain linker output sections to the new region. -Linker script fragments and memory layout header files should -be edited within the eCos install tree. They are -located at include/pkgconf/mlt_*.*. -Where multiple start-up types are in use, it will be necessary to -edit multiple linker script fragments and header files. The information -provided in the header file and the corresponding linker script -fragment must always match. A typical linker script fragment is -shown below: - -<productname>eCos</productname> linker script fragment -MEMORY -{ - rom : ORIGIN = 0x40000000, LENGTH = 0x80000 - ram : ORIGIN = 0x48000000, LENGTH = 0x200000 -} - -SECTIONS -{ - SECTIONS_BEGIN - SECTION_rom_vectors (rom, 0x40000000, LMA_EQ_VMA) - SECTION_text (rom, ALIGN (0x1), LMA_EQ_VMA) - SECTION_fini (rom, ALIGN (0x1), LMA_EQ_VMA) - SECTION_rodata (rom, ALIGN (0x1), LMA_EQ_VMA) - SECTION_rodata1 (rom, ALIGN (0x1), LMA_EQ_VMA) - SECTION_fixup (rom, ALIGN (0x1), LMA_EQ_VMA) - SECTION_gcc_except_table (rom, ALIGN (0x1), LMA_EQ_VMA) - SECTION_data (ram, 0x48000000, FOLLOWING (.gcc_except_table)) - SECTION_bss (ram, ALIGN (0x4), LMA_EQ_VMA) - SECTIONS_END -} - -The file consists of two blocks, the MEMORY block -contains lines describing the address (ORIGIN) -and the size (LENGTH) of each memory -region. The MEMORY block is followed -by the SECTIONS block which contains -lines describing each of the linker output sections. Each section -is represented by a macro call. The arguments of these macros are -ordered as follows: - - -The memory region in which the section will finally - reside. - - -The final address ( -VMA -) of the section. This is expressed using one of the following forms: - - -n - -at the absolute address specified by the - unsigned integer n - - - -ALIGN (n) - -following the final location of the previous section - with alignment to the next n-byte - boundary - - - - - -The initial address (LMA) - of the section. This is expressed using one of the - following forms: - - -LMA_EQ_VMA - -the LMA - equals the VMA (no relocation) - - - -AT (n) - -at the absolute address specified by the - unsigned integer n - - - -FOLLOWING (.name) - -following the initial location of section - name - - - - - -In order to maintain compatibility with linker script - fragments and header files exported by the - eCos Configuration Tool, the use - of other expressions within these files is not - recommended. -Note that the names of the linker output sections will vary -between target architectures. A description of these sections can -be found in the specific GCC documentation for -your architecture. - - - -Managing the <!-- <index></index> -->Package Repository -A source distribution of eCos consists of a number of - packages, such as the kernel, the C library, and the - µITRON subsystems. These are - individually versioned in the tree structure of the source - code, to support distribution on a per-package basis and to - support third party packages whose versioning systems might be - different. The eCos Package - Administration Tool is used to manage the - installation and removal of packages from a variety of sources - with potentially multiple versions. -The presence of the version information in the source tree - structure might be a hindrance to the use of a separate source - control system such as CVS or - SourceSafe. To work - in this way, you can rename all the version components to some - common name (such as “current”) thus unifying the - structure of source trees from distinct eCos releases. -The eCos build system will treat any such name as just another -version of the package(s), and support building in exactly the same -way. However, performing this rename invalidates any existing build -trees that referred to the versioned source tree, so do the rename -first, before any other work, and do a complete rebuild afterwards. - -Package Installation -Package installation and removal is performed using the - eCos Package Administration Tool. This - tool is a Tcl script named - ecosadmin.tcl which allows - the user to add new eCos packages and new versions of - existing packages to an eCos repository. Such packages must - be distributed as a single file in the eCos package - distribution format. Unwanted packages may also be removed - from the repository using this tool. A graphical version of - the tool is provided as part of the - eCos Configuration Tool. - -Using the Administration Tool The graphical -version of the eCos Package -Administration Tool, provided as part of the -eCos Configuration -Tool, provides functions equivalent to the command-line -version for those who prefer a Windows-based interface. -It may be invoked in one of two ways: - - -from the start menu (by default - Start->Programs-> - eCos->Package Administration - Tool) - - - - -from the eCos Configuration - Tool via the - Tools->Administration - menu item - - - -The main window of the tool displays the packages which are -currently installed in the form of a tree. The installed versions -of each package may be examined by expanding the tree. -Packages may be added to the eCos repository by clicking on -the Add button. The eCos package distribution -file to be added is then selected via a File Open dialog -box. -Packages may be removed by selecting a package in the tree -and then clicking on the Remove button. If -a package node is selected, all versions of the selected package -will be removed. If a package version node is selected, only the -selected version of the package will be removed. - - -Using the command line -The ecosadmin.tcl - script is located in the base of the eCos repository. Use - a command of the following form under versions of - UNIX: -$ tclsh ecosadmin.tcl <command> -Under Windows, a command of the following form may be used -at the Cygwin command line prompt: -$ cygtclsh80 ecosadmin.tcl <command> -The following commands are available: - - -add <file> - -Adds the packages contained with the specified package distribution -file to the eCos repository and updates the package database accordingly. -By convention, eCos package distribution files are given the .epk suffix. - - - -remove <package> [ --version=<version> ] - -Removes the specified package from the eCos - repository and updates the package database - accordingly. Where the optional version qualifier is - used, only the specified version of the package is - removed. - - - -list - -Produces a list of the packages which - are currently installed and their versions. The - available templates and hardware targets are also - listed. - - - -Note that is is possible to remove critical packages - such as the common HAL package using this tool. Users - should take care to avoid such errors since core eCos - packages may only be re-installed in the context of a - complete re-installation of eCos. - - - -Package Structure -The files in an installed eCos source tree are organized in -a natural tree structure, grouping together files which work together -into Packages. For example, the kernel files -are all together in: - -BASE_DIR/kernel/&Version;/include/ - BASE_DIR/kernel/&Version;/src/ - BASE_DIR/kernel/&Version;/tests/ - -and µITRON compatibility layer files are in: - - - BASE_DIR/compat/uitron/&Version;/include/ - BASE_DIR/compat/uitron/&Version;/src/ - BASE_DIR/compat/uitron/&Version;/tests/ - -The feature of these names which is of interest here is - the &Version; near the end. It may seem odd to place a version number deep in the - path, rather than having something like - BASE_DIR/&Version;/...everything... - or leaving it up to you to choose a different - install-place when a new release of the system arrives. - -There is a rationale for this organization: as - indicated, the kernel and the - µITRON compatibility subsystem - are examples of software packages. For the first few - releases of eCos, all the packages will move along - in step, i.e. Release 1.3.x will feature Version - 1.3.x of every package, and so forth. But in future, - especially when third party packages become available, it is - intended that the package be the unit of software - distribution, so it will be possible to build a system from - a selection of packages with different version numbers, and - even differing versioning schemes. A - Tcl script ecosadmin.tcl is - provided in the eCos repository to manage the installation - and removal of packages in this way. -Many users will have their own source code control system, -version control system or equivalent, and will want to use it with -eCos sources. In that case, since a new release of eCos comes with -different pathnames for all the source files, a bit of work is necessary -to import a new release into your source repository. -One way of handling the import is to rename all the version -parts to some common name, for example “current”, -and continue to work. “current” is suggested because ecosconfig recognizes -it and places it first in any list of versions. In the future, we -may provide a tool to help with this, or an option in the install -wizard. Alternatively, in a POSIX shell environment (Linux or Cygwin -on Windows) use the following command: -find . -name &Version; -type d -printf 'mv %p %h/current\n' | sh -Having carried out such a renaming operation, your - source tree will now look like this: -BASE_DIR/kernel/current/include/ -BASE_DIR/kernel/current/src/ -BASE_DIR/kernel/current/tests/ - ... -BASE_DIR/compat/uitron/current/include/ -BASE_DIR/compat/uitron/current/src/ -BASE_DIR/compat/uitron/current/tests/ - -which is a suitable format for import into your own - source code control system. When you get a subsequent - release of eCos, do the same thing and use your own source - code control system to manage the new source base, by - importing the new version from -NEW_BASE_DIR/kernel/current/include/ -and so on. -The eCos build tool will now offer only the - “current” version of each package; select this - for the packages you wish to use. -Making such a change has implications for any build - trees you already have in use. A configured build tree - contains information about the selected packages and their - selected versions. Changing the name of the - “versioning” folder in the source tree - invalidates this information, and in consequence it also - invalidates any local configuration options you have set up - in this build tree. So if you want to change the version - information in the source tree, do it first, before - investing any serious time in configuring and building your - system. When you create a new build tree to deal with the - new source layout, it will contain default settings for all - the configuration options, just like the old build tree did - before you configured it. You will need to redo that - configuration work in the new tree. -Moving source code around also invalidates debugging information -in any programs or libraries built from the old tree; these will -need to be rebuilt. - - - - diff --git a/doc/sgml/user-guide/ecos-license.sgml b/doc/sgml/user-guide/ecos-license.sgml deleted file mode 100644 --- a/doc/sgml/user-guide/ecos-license.sgml +++ /dev/null @@ -1,382 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Version 2, June 1991 - - 1989 - 1991 - Free Software Foundation, Inc. - -
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-GNU General Public License - - Copyright (C) 1989, 1991 Free Software Foundation, Inc. - 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Library General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - <one line to give the program's name and a brief idea of what it does.> - Copyright (C) <year> <name of author> - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) year name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - <signature of Ty Coon>, 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Library General -Public License instead of this License. - -
diff --git a/doc/sgml/user-guide/installation.sgml b/doc/sgml/user-guide/installation.sgml deleted file mode 100644 --- a/doc/sgml/user-guide/installation.sgml +++ /dev/null @@ -1,250 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Installing <productname>eCos</productname> - - - - -System Requirements - - - - -Standard Intel architecture PC running - Linux (tested on recent Red Hat, SuSE and Debian distributions), - Microsoft Windows NT (no earlier than 4.0 + SP6a), Windows 2000 and - Windows XP. Linux distributions from other vendors may also work, but - are currently untested. - - - -Enough disk space for the installed -distribution. The eCos installation process -will detail the various components of eCos -and the compiler toolkit that can be installed, and their disk space -requirements. - - - -64MB of RAM and a 350MHz or faster Pentium processor. - - - - -If you are downloading the eCos -release distribution from ecos.sourceware.org, -you will also need space to store that image and to compile the -toolchain and eCos from source. - - - - - - - - -Installation on Linux - - -Full instructions for the downloading and -installation of eCos on Linux hosts are provided on the eCos -website. - - - - - - - - -Installation on Windows - - -Full instructions for the downloading and -installation of eCos on Windows hosts are provided on the -eCos website. - - - - - - - - -Target Setup - -While eCos supports a variety of -targets, communication with all the targets happens in one of four -ways. These are described in general below. Any details or variations -from these descriptions will be found in the -eCos documentation for a specific target, -in the appendix. - - -<!-- <index></index> -->Connecting Via Serial Line - -Most targets will have RedBoot or GDB Stubs installed. -These normally waits for GDB to connect at 38400 baud, using 8 data -bit, no parity bit and 1 stop-bit and no hardware flow control. Check -the documentation for your target to ensure it uses this speed. If not, -adjust the following instructions accordingly. - -The following instructions depend on your having selected -the appropriate serial port on the host. That is, the serial port -which connects to the target's (primary) serial port. On -Linux this could be /dev/ttyS0, -while the same port on Windows would be named COM1. -Substitute the proper serial port name in the below. - -Connect to the target by issuing the following commands in -GDB console mode: - - -(gdb) set remotebaud 38400 -(gdb) target remote /dev/ttyS0 - - -In Insight, connect by opening the File->Target -Settings window and enter: - - -Target: Remote/Serial -Baud Rate: 38400 -Port: /dev/ttyS0 - - -Set other options according to preference, close the window -and select -Run->Connect to target. - - - - - - - -<!-- <index></index> -->Connecting Via Ethernet - -Some targets allow GDB to connect via Ethernet - if so, it will -be mentioned in the document describing the target. Substitute the -target's assigned IP address or hostname for <hostname> in the -following. Depending on how RedBoot has been configured, it will -either have this address allocated statically, or will acquire it via -BOOTP. In both cases RedBoot will report the IP address it is -listening on in its startup message printed on the serial port. The -<port> is the TCP port which RedBoot is listening on, usually -9000. It is also listed in the target document. - -Connect to the target by issuing the following command in -GDB console mode: - - -(gdb) target remote <hostname>:<port> - - -In Insight, connect by opening the File->Target -Settings window and enter: - - -Target: Remote/TCP -Hostname: <hostname> -Port: <port> - - -Set other options according to -preference, close the window and select Run->Connect to -target. - - - - - - -<!-- <index></index> -->Using A Simulator Target - -GDB connects to all simulator targets using the same basic -command, although each simulator may require additional options. -These are listed in the document describing the target, and should -be used when connecting. - -Connect to the target by issuing the following command in -GDB console mode: - - -(gdb) target sim [target specific options] - - -In Insight, connect by opening the File->Target -Settings window and enter: - - -Target: Simulator -Options: [target specific options] - - -Set other options according to preference, close the window and -select Run->Connect to target. - - - - - - -Using A Synthetic Target - -Synthetic targets are special in that the built tests and -applications actually run as native applications on the host. This -means that there is no target to connect to. The test or application -can be run directly from the GDB console using: - - -(gdb) run - - -or from Insight by pressing the Run icon. -There is therefore no need to connect to the target or download the -application, so you should ignore GDB “target” and -“load” commands in any instructions found in other places -in the documentation. - - - - - - - - diff --git a/doc/sgml/user-guide/introduction.sgml b/doc/sgml/user-guide/introduction.sgml deleted file mode 100644 --- a/doc/sgml/user-guide/introduction.sgml +++ /dev/null @@ -1,785 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Introduction - - - - - - -Key Features - - - - -eCos is distributed under the GPL -license with an exception which permits proprietary application code -to be linked with eCos without itself being -forced to be released under the GPL. It is also royalty and buyout -free. - - - - -As an Open Source project, eCos is -under constant improvement, with an active developer community, based -around the eCos web site at http://ecos.sourceware.org/. - - - - -Powerful GUI-based configuration system allowing both large and -fine grained configuration of eCos. This -allows the functionality of eCos to be -customized to the exact requirements of the application. - - - - -Full-featured, flexible, configurable, real time embedded -kernel. The kernel provides thread scheduling, synchronization, -timer, and communication primitives. It handles hardware resources -such as interrupts, exceptions, memory and caches. - - - - -The Hardware Abstraction Layer (HAL) hides the specific features -of each supported CPU and platform, so that the kernel and other -run-time components can be implemented in a portable fashion. - - - - -Support for µITRON and POSIX Application Programmer -Interfaces (APIs). It also includes a fully featured, thread-safe ISO -standard C library and math library. - - - - -Support for a wide variety of devices including many serial -devices, ethernet controllers and FLASH memories. There is also -support for PCMCIA, USB and PCI interconnects. - - - - -A fully featured TCP/IP stack implementing IP, IPv6, ICMP, UDP -and TCP over ethernet. Support for SNMP, HTTP, TFTP and FTP are also -present. - - - - -The RedBoot ROM monitor is an application that uses the -eCos HAL for portability. It provides -serial and ethernet based booting and debug services during -development. - - - - -Many components include test programs that validate the -components behaviour. These can be used both to check that hardware is -functioning correctly, and as examples of -eCos usage. - - - - -eCos documentation included this User -Guide, the Reference Manual and the Components Writer's Guide. These -are being continually updated as the system develops. - - - - - - - - - - -<productname>eCos</productname> Overview - -eCos is an open source, configurable, - portable, and royalty-free embedded real-time operating - system. The following text expands on these core aspects that - define eCos. - -eCos is provided as an open source - runtime system supported by the GNU open source development - tools. Developers have full and unfettered access to all - aspects of the runtime system. No parts of it are proprietary - or hidden, and you are at liberty to examine, add to, and - modify the code as you deem necessary. These rights are - granted to you and protected by the GNU Public License (GPL). - An exception clause has been added to the eCos license which - limits the circumstances in which the license applies to other - code when used in conjunction with eCos. This exception grants - you the right to freely develop and distribute applications - based on eCos. You are not expected - or required to make your embedded applications or any - additional components that you develop freely available so - long as they are not derived from - eCos code. We of course welcome all - contributions back to eCos such as - board ports, device drivers and other components, as this - helps the growth and development of - eCos, and is of benefit to the - entire eCos community. See for more details. - -One of the key technological innovations in - eCos is the configuration - system. The configuration system allows the application writer - to impose their requirements on the run-time components, both - in terms of their functionality and implementation, whereas - traditionally the operating system has constrained the - application's own implementation. Essentially, this enables - eCos developers to create their own - application-specific operating system and makes - eCos suitable for a wide range of - embedded uses. Configuration also ensures that the resource - footprint of eCos is minimized as - all unnecessary functionality and features are removed. The - configuration system also presents - eCos as a component - architecture. This provides a standardized mechanism for - component suppliers to extend the functionality of - eCos and allows applications to be - built from a wide set of optional configurable run-time - components. Components can be provided from a variety of - sources including: the standard - eCos release; commercial third - party developers or open source contributors. - -The royalty-free nature of eCos means that you can develop and -deploy your application using the standard eCos release without -incurring any royalty charges. In addition, there are no up-front -license charges for the eCos runtime source code and associated -tools. We provide, without charge, everything necessary for basic -embedded applications development. - -eCos is designed to be portable to a -wide range of target architectures and target platforms including 16, -32, and 64 bit architectures, MPUs, MCUs and DSPs. The -eCos kernel, libraries and runtime -components are layered on the Hardware Abstraction Layer (HAL), and -thus will run on any target once the HAL and relevant device drivers -have been ported to the target's processor architecture and -board. Currently eCos supports a large -range of different target architectures: - - - - -ARM, Intel StrongARM and XScale - -Fujitsu FR-V - -Hitachi SH2/3/4 - -Hitachi H8/300H - -Intel x86 - -MIPS - -Matsushita AM3x - -Motorola PowerPC - -Motorola 68k/Coldfire - -NEC V850 - -Sun SPARC - - - - -including many of the popular variants of these architectures -and evaluation boards. - -eCos has been designed to support -applications with real-time requirements, providing features such as -full preemptability, minimal interrupt latencies, and all the -necessary synchronization primitives, scheduling policies, and -interrupt handling mechanisms needed for these type of -applications. eCos also provides all the -functionality required for general embedded application support -including device drivers, memory management, exception handling, C, -math libraries, etc. In addition to runtime support, the -eCos system includes all the tools -necessary to develop embedded applications, including -eCos software configuration and build -tools, and GNU based compilers, assemblers, linkers, debuggers, and -simulators. - -To get the most out of eCos you -should visit the eCos open source -developers site: http://ecos.sourceware.org/. - - -The site is dedicated to the eCos - developer community and contains a rich set of resources - including news, FAQ, online documentation, installation guide, - discussion and announcement mailing lists, and runtime and - development tools downloads. The site also supports anonymous - CVS and WEBCVS access to provide direct access to the latest - eCos source base. - -eCos is released as open source - software because we believe that this is the most effective - software development model, and that it provides the greatest - benefit to the embedded developer community as a whole. As part - of this endeavor, we seek the input and participation of - eCos developers in its continuing - evolution. Participation can take many forms including: - - -providing us with feedback on how eCos might be made more -useful to you - by taking part in the ongoing mailing list discussions -and by submitting problem reports covering bugs, documentation issues, -and missing features - - -contributing bug fixes and enhancement patches - - -contributing new code including device drivers, board -ports, libraries, and other runtime components - - - -Our long term aim is to make eCos a -rich and ubiquitous standard infrastructure for the development of -deeply embedded applications. This will be achieved with the -assistance of the eCos developer community -cooperating to improve eCos for all. We -would like to take this opportunity to extend our thanks to the many -eCos developers who have already -contributed feedback, ideas, patches, and code that have augmented and -improved this release. - - - -The eCos Maintainers - - - - - - - -<productname>eCos</productname> Licence Overview - -As of May 2002, eCos is released -under a modified version of the well known GNU General Public License -(GPL), now making it an official -GPL-compatible Free Software License. An exception clause has -been added to the eCos license which limits -the circumstances in which the license applies to other code when used -in conjunction with eCos. The exception -clause is as follows: - - - As a special exception, if other files instantiate templates or use macros - or inline functions from this file, or you compile this file and link it - with other works to produce a work based on this file, this file does not - by itself cause the resulting work to be covered by the GNU General Public - License. However the source code for this file must still be made - available in accordance with section (3) of the GNU General Public - License. - - This exception does not invalidate any other reasons why a work based on - this file might be covered by the GNU General Public License. - - -The goal of the license is to serve the -eCos user community as a whole. It allows -all eCos users to develop products without -paying anybody anything, no matter how many developers are working on -the product or how many units will be shipped. The license also -guarantees that the eCos source code will -always be freely available. This applies not only to the core -eCos code itself but also to any changes -that anybody makes to the core. In particular, it should prevent any -company or individual contributing code to the system and then later -claiming that all eCos users are now guilty -of copyright or patent infringements and have to pay royalties. It -should also prevent any company from making some small improvements, -calling the result a completely new system, and releasing this under a -new and less generous license. - -The license does not require users to -release the source code of any applications that -are developed with eCos. However, if -anybody makes any changes to code covered by the -eCos license, or writes new files derived -in any way from eCos code, then we believe -that the entire user community should have the opportunity to benefit -from this. The license stipulates that these changes must be made -available in source code form to all recipients of binaries based on -the modified code, either by including the sources along with the -binaries you deliver (or with any device containing such binaries) or -with a written offer to supply the source code to the general public -for three years. It is perhaps most practical for -eCos developers to make the source code -available online and inform those who are receiving binaries -containing eCos code, and probably also the -eCos maintainers, about the location of the -code. See the full -text of the GPL for the most authoritative definition of the -obligations. - -Although it is not strictly necessary to contribute the modified -code back to the eCos open source project, -we are always pleased to receive code contributions and hope that -developers will also be keen to give back in return for what they -received from the eCos project completely -free of charge. The eCos maintainers are -responsible for deciding whether such contributions should be applied -to the public repository. In addition, a copyright -assignment is required for any significant changes to the core -eCos packages. - -The result is a royalty-free system with minimal obligations on -the part of application developers. This has resulted in the rapid -uptake of eCos. At the same time, -eCos is fully open source with all the -benefits that implies in terms of quality and innovation. We believe -that this is a winning combination. - - -Questions and answers - -The following queries provide some clarification as to the -implications of the eCos license. They do -not consititute part of the legal meaning of the license. - -Q. What is the effect of the -eCos license? - -A. In the simplest terms, when you -distribute anything containing eCos code, -you must make the source code to eCos -available under the terms of the GPL. - -Q. What if I make changes to -eCos, or write new code based on -eCos code? - -A. Then you must make those changes -available as well. - -Q. Do I have to distribute the source -code to my application? Isn't the GPL "viral"? - -A. You do not have to distribute any -code under the terms of the GPL other than -eCos code or code derived from -eCos. For example, if you write a HAL port -based on copying an existing eCos HAL in -any way, you must make the source code available with the -binary. However you would not need to make available any other code, -such as the code of a wholly separate application linked with -eCos. - -Q. I would rather stick with the -RHEPL code, but I updated my anonymous CVS checkout. - -A. You can check out the final -version of anonymous CVS before the license change using the CVS tag -last-rhepl. See the anonymous CVS -access page -for details. - - - - -Previous License - - - -Prior to May 2002, eCos was released under -the Red -Hat eCos Public License (RHEPL). The RHEPL required any -modifications to eCos code to be made -available under preferential terms to Red Hat and was therefore -incompatible with code licensed under the GPL. The use of -eCos source code which was licensed under -the RHEPL is not affected by the switch to the modified GPL for later -revisions. - - - - - - - - - -Notation and Conventions - - -Since there are many supported target architectures, notation -conventions are used in this manual to avoid repeating instructions -that are very similar. - - - -GDB and <!-- <index></index> -->GCC Command Notation - - -Cross-development commands like gcc and -gdb will be shown with a -TARGET- prefix. You need to replace -TARGET- with the correct prefix before -using the command. Just using gcc or -gdb will use the tools for the host, which is not -(usually) what you want. - - - -For example use arm-elf-gcc and -arm-elf-gdb for ARM, Thumb, and StrongARM targets. -Use xscale-elf-gcc and -xscale-elf-gdb for Intel Xscale targets. -Use i386-elf-gcc and -i386-elf-gdb for IA32 targets. And so on, the exact -prefix to use is shown in the documentation for each target. - - -Note that some versions of the GCC cross compiler generate -executable files with the .exe suffix on Windows, -but not on Linux. The suffix .exe will be omitted -from executable file names, so you will see hello -instead of hello.exe. - - - - -Directory and File System Conventions - -The default directory for installing -eCos on Windows (usually -C:/Program Files/eCos) is different from that on -Linux (usually /opt/ecos). Since many command -line examples in the tutorials use these paths, this default (base) -directory will be cited as BASE_DIR. - -Windows and Linux have a similar file system syntax, but the -MS-DOS command interpreter on Windows uses the backslash character -(\) as a path separator, while Linux and POSIX shells (including -the Cygwin bash shell for windows) use the forward slash (/). - -This document will use the POSIX shell convention of forward -slashes throughout. - - - - - - -Version Conventions - - -This manual does not refer explicitly to any particular version of -eCos. However, version numbers form part of -many file path names. In all of these places the version number will -be shown like this: &Version;. - - - -If you have used anonymous CVS to check -eCos out of the CVS repository, the version -number will always be current, since that is the -name of the directory in the repository. When a stable release is made -this directory name is changed, in the release, to the number of the -release, for example v2_0 or -v2_1. - - - - - - - - - - -Documentation Roadmap - - -The eCos documentation is divided into a -three main parts: - - - - -User Guide - -This document. It includes the following sections: - - - - Installing eCos - - - This section describes how to install the - eCos software, how to set up your - hardware and how to test that it is all working. - - - - - - Programming Under eCos - - - This section describes how to write programs that run under - eCos by running through some examples. - - - - - - The eCos Configuration Tool - - - This section describes the eCos graphical - configuration tool and how to use it to change how - eCos behaves. - - - - - eCos Programming Concepts and Techniques - - An explanation of the eCos programming - cycle, and a description of some debugging facilities that - eCos offers. - - - - - - Configuration and the Package - Repository - - Information on how to configure eCos - manually, including a reference on the - ecosconfig command, memory layouts, - and information on how to manage a package repository - using the eCos Package Administration - Tool. - - - - - - - - - - - -Reference Guide - - -The Reference Guide provides detailed documentation on various -aspects of eCos. This document is being -constantly updated, so the following list just mentions the more -important sections, take a look at the guide itself for the full -story. - - - - - The eCos Kernel - - In-depth description of eCos"s - native C kernel API Important considerations are given - for programming the eCos - kernel. The semantics for each kernel function are - described, including how they are affected by - configuration. - - - - - POSIX and µITRON APIs - - A description of the POSIX and µITRON APIs and how they - are supported under eCos. - - - - - - The eCos Hardware Abstraction Layer (HAL) - - A description of the structure and functionality of the - eCos HAL. This section also includes a - porting guide to help moving eCos to - different platforms. - - - - - - Device Drivers - - A description of the philosophy behind - eCos device drivers, as well as a - presentation of the C language APIs for using the current - device drivers. - - Device driver support includes serial, ethernet and FLASH devices, - and support for PCI, PCMCIA and USB interconnects. - - - - - - RedBoot User's Guide - - This describes RedBoot, which provides a complete bootstrap - environment for a range of embedded operating systems, such as - embedded Linux and eCos, and - includes facilities such as network downloading and - debugging. It also provides a simple flash file system for - boot images. - - - - - - TCP/IP Stack Support - - This describes the Common Networking for - eCos package, which provides - support for a complete TCP/IP networking stack. The design - allows for the actual stack to be modular and at the current - time two different implementations, one based on OpenBSD from - 2000 and a new version based on FreeBSD, are available. - - Other components related to networking, including support for - SNMP, DNS, HTTP and FTP, are also described. - - - - - - - - - - -Component Writer's Guide - -The Component Writer's Guide is intended for developers who need -to add or modify parts of eCos itself. It -describes the following things: - - - - - Overview - - An explanation of the configuration technology used in - eCos, why it is done this way, how it - works and the terminology used. - - - - - - Package Organization - - A description of the eCos package - repository, how it is organized and how packages themselves are - organized. - - - - - - The CDL Language - - A description of the CDL language and how it is used to - control the configuration of eCos - components. The document also contains a complete specification of - the language. - - - - - - The Build Process - - A description of what happens once a configuration has been - created and must be built into a set of executables. - - - - - - - - - - - - - - diff --git a/doc/sgml/user-guide/jadetex.cfg b/doc/sgml/user-guide/jadetex.cfg deleted file mode 100644 --- a/doc/sgml/user-guide/jadetex.cfg +++ /dev/null @@ -1,1 +0,0 @@ -\hypersetup{pdfauthor=eCos (pdfjadetex) , colorlinks=true, linkcolor=blue, pdfstartview=FitH} diff --git a/doc/sgml/user-guide/makefile b/doc/sgml/user-guide/makefile deleted file mode 100644 --- a/doc/sgml/user-guide/makefile +++ /dev/null @@ -1,54 +0,0 @@ -#============================================================================= -# -# makefile -# -# For building the eCos RedBoot docs -# -#============================================================================= -#####ECOSGPLCOPYRIGHTBEGIN#### -# ------------------------------------------- -# This file is part of eCos, the Embedded Configurable Operating System. -# Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc. -# -# eCos 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. -# -# eCos 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 eCos; if not, write to the Free Software Foundation, Inc., -# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. -# -# As a special exception, if other files instantiate templates or use macros -# or inline functions from this file, or you compile this file and link it -# with other works to produce a work based on this file, this file does not -# by itself cause the resulting work to be covered by the GNU General Public -# License. However the source code for this file must still be made available -# in accordance with section (3) of the GNU General Public License. -# -# This exception does not invalidate any other reasons why a work based on -# this file might be covered by the GNU General Public License. -# ------------------------------------------- -#####ECOSGPLCOPYRIGHTEND#### -#============================================================================= -#####DESCRIPTIONBEGIN#### -# -# Author(s): bartv, jlarmour -# Date: 2001-01-11 -#####DESCRIPTIONEND#### -#============================================================================= - -TOPLEVEL := ../../../packages -MAIN_SGML := user-guide.sgml -MAIN_HTML := ecos-user-guide.html -MAIN_PDF := ecos-user-guide.pdf -OTHER_SGML := config-tool.sgml configuration.sgml ecos-license.sgml installation.sgml \ - introduction.sgml programming-concepts-techniques.sgml \ - programming.sgml real-time-characterization.sgml target-setup.sgml -PICTURES := - -include $(TOPLEVEL)/pkgconf/rules.doc diff --git a/doc/sgml/user-guide/pix/ARMStartup01.png b/doc/sgml/user-guide/pix/ARMStartup01.png deleted file mode 100644 index 3b7f13b2c9b45e967d79903d17d8b34e6579791d..0000000000000000000000000000000000000000 GIT binary patch literal 0 Hc$@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -<productname>eCos</productname> Programming Concepts and Techniques - -Programming with eCos is somewhat different from programming - in more traditional environments. eCos is a configurable open - source system, and you are able to configure and build a system - specifically to meet the needs of your application. -Various different directory hierarchies are involved in - configuring and building the system: the component - repository, the build tree, - and the install tree. These directories - exist in addition to the ones used to develop - applications. - - -CDL Concepts - -About this chapter -This chapter serves as a brief introduction to the - concepts involved in eCos (Embedded Configurable Operating - System). It describes the configuration architecture and the - underlying technology to a level required for the embedded - systems developer to configure eCos. It does not describe in - detail aspects such as how to write reusable components for - eCos: this information is given in the Component - Writer’s Guide. - -Background -Software solutions for the embedded space place - particularly stringent demands on the developer, typically - represented as requirements for small memory footprint, high - performance and robustness. These demands are addressed in - eCos by providing the ability to perform compile-time - specialization: the developer can tailor the operating - system to suit the needs of the application. In order to - make this process manageable, eCos is built in the context - of a Configuration Infrastructure: a set of tools including - a Configuration Tool and a formal - description of the process of configuration by means of a - Component Definition Language. - - -Configurations -eCos is tailored at source level (that is, before - compilation or assembly) in order to create an eCos - configuration. In concrete terms, an - eCos configuration takes the form of a configuration save - file (with extension .ecc) and set of files used to build - user applications (including, when built, a library file - against which the application is linked). - - - -Component Repository -eCos is shipped in source in the form of a - component repository - a directory - hierarchy that contains the sources and other files which - are used to build a configuration. The component repository - can be added to by, for example, downloading from the - net. - - -Component Definition Language -Part of the component repository is a set of files - containing a definition of its structure. The form used for - this purpose is the Component Definition - Language (CDL). CDL defines the relationships - between components and other information used by tools such - as the eCosConfiguration Tool. - CDL is generally formulated by the writers of components: it - is not necessary to write or understand CDL in order for the - embedded systems developer to construct an eCos - configuration. - - -Packages -The building blocks of an eCos configuration are called - packages. Packages are the units of - software distribution. A set of core packages (such as - kernel, C library and math library) is provided by Red Hat: - additional third-party packages will be available in - future. -A package may exist in one of a number of versions. - The default version is the current version. - Only one version of a given package may be present in the component -repository at any given time. -Packages are organized in a tree hierarchy. Each package -is either at the top-level or is the child of another package. -The eCos Package Administration Tool can be used to add or remove -packages from the component repository. The eCos Configuration Tool can be used to include or exclude packages from the configuration -being built. - - -Configuration Items -Configuration items are the - individual entities that form a configuration. Each item - corresponds to the setting of a C pre-processor macro (for - example, - CYGHWR_HAL_ARM_PID_GDB_BAUD). - The code of eCos itself is written to test such pre-processor - macros so as to tailor the code. User code can do - likewise. -Configuration items come in the following flavors: - - -None: such entities serve only as -place holders in the hierarchy, allowing other entities to be grouped -more easily. - - -Boolean entities are the most common -flavor; they correspond to units of functionality that can be either -enabled or disabled. If the entity is enabled then there will be -a #define; code will check the setting using, for example, #ifdef - - -Data entities encapsulate some arbitrary -data. Other properties such as a set or range of legal values can -be used to constrain the actual values, for example to an integer -or floating point value within a certain range. - - -Booldata entities combine the attributes -of Boolean and Data: they -can be enabled or disabled and, if enabled, will hold a data value. - - -Like packages, configuration items exist in a tree-based hierarchy: -each configuration item has a parent which may be another configuration -item or a package. Under some conditions (such as when packages -are added or removed from a configuration), items may be “re-parented” such -that their position in the tree changes. - -Expressions -Expressions are relationships between CDL items. There are -three types of expression in CDL: - - CDL Expressions - - - - Expression Type - Result - Common Use (see ) - - - - Ordinary - A single value - legal_values property - - - ListA range of - values (for example “1 to 10”) - legal_values property - - GoalTrue or False - requires and active_if properties - - -
-
- - Properties -Each configuration item has a set of properties. The following -table describes the most commonly used: - - Configuration properties - - - Property -Use - - - - Flavor - The “type” of the item, as - described above - - EnabledWhether - the item is enabled - - Current_value -The current value of the item - - Default_value -An ordinary expression defining the default value of the - item - - Legal_valuesA - list expression defining the values the item may hold (for example, - 1 to10) - - Active_ifA - goal expression denoting the requirement for this item to be active -(see below: Inactive Items) - -RequiresA goal -expression denoting requirements this item places on others (see -below: Conflicts) - -CalculatedWhether -the item as non-modifiable - -MacroThe corresponding -C pre-processor macro - -FileThe C header -file in which the macro is defined - -URLThe URL of -a documentation page describing the item - -HardwareIndicates -that a particular package is related to specific hardware - - -
- -A complete description of properties is contained in the Component -Writer’s Guide. -
- -Inactive Items -Descendants of an item that is disabled are inactive: their -values may not be changed. Items may also become inactive if -an active_if expression is used to make the item dependent -on an expression involving other items. - -
- -Conflicts -Not all settings of configuration items will lead to a - coherent configuration; for example, the use of a timeout - facility might require the existence of timer support, so if - the one is required the other cannot be removed. Coherence - is policed by means of consistency rules (in particular, the - goal expressions that appear as CDL items - requires and - active_if attributes [see - above]). A violation of consistency rules creates a - conflict, which must be resolved in - order to ensure a consistent configuration. Conflict - resolution can be performed manually or with the assistance - of the eCos tools. Conflicts come in the following - flavors: - - -An unresolved conflict means that -there is a reference to an entity that is not yet in the current -configuration - - -An illegal value conflict is caused -when a configuration item is set to a value that is not permitted -(that is, a legal_values goal expression -is failing) - - -An evaluation exception conflict -is caused when the evaluation of an expression would fail (for example, -because of a division by zero) - - -An unsatisfied goal conflict is caused -by a failing requires goal expression - - -A bad data conflict arises only rarely, -and corresponds to badly constructed CDL. Such a conflict can only -be resolved by reference to the CDL writer. - - - - -Templates -A template is a saved configuration - - that is, a set of packages and configuration item - settings. Templates are provided with eCos to allow you to - get started quickly by instantiating (copying) a saved - configuration corresponding to one of a number of common - scenarios; for example, a basic eCos configuration template - is supplied that contains the infrastructure, kernel, C and - math libraries, plus their support packages. - -
- -The Component Repository and Working Directories -Each of the file trees involved in eCos development has a - different role. - -Component Repository -The eCos component repository - contains directories for all the packages that are shipped - with eCos or provided by third parties. -The component repository should not be modified as part of -application development. - -
-Component repository - -
- -Purpose -The component repository is the master copy of source code -for all system and third party components. It also contains some -files needed to administer and build the system, such as ecosadmin.tcl. - - -How is it modified? -You modify it by importing new versions of packages from a -distribution or removing existing packages. These activities are -undertaken using the eCos Package Administration Tool. - - -When is it edited manually? -Files in the component repository should only be edited manually -as determined by the component maintainer. - - -User Applications -User application source code should not go -into the component repository. - - -Examples of files in this hierarchy: - - -BASE_DIR/doc/ref/ecos-ref.html - -The top level HTML file for the - eCos Reference - Manual. - - - -BASE_DIR/prebuilt/pid/tests/kernel/&Version;/tests/thread_gdb.exe - - - - - -BASE_DIR/prebuilt/linux/tests/kernel/&Version;/tests/thread_gdb.exe - -Pre-built tests for the supported platforms, and - the synthetic Linux target. - - - -BASE_DIR/examples/twothreads.c - -One of the example programs. - - - -BASE_DIR/ecosadmin.tcl - -The Tcl program which is used to import new versions of packages -from a distribution or remove existing packages. - - - -BASE_DIR/packages/language/c/libm/&Version;/src/double/portable-api/s_tanh.c - -Implementation of the hyperbolic tangent function in the standard -math library. - - - -BASE_DIR/pkgconf/rules.mak - -A file with make rules, used -by the makefile. - - - - -
- -Build Tree -The build tree is the directory - hierarchy in which all generated files - are placed. Generated files consist of the - makefile, the compiled object files, - and a dependency file (with a .d - extension) for each source file. - -Purpose -The build tree is where all intermediate object files are - placed. - - -How is it modified? -Recompiling can modify the object files. - - -User applications -User application source or binary code should - not go in the build tree. - - -Examples of files in this hierarchy - - -ecos-work/language/c/libc/&Version;/src - -The directory in which object files for - the C library are built. - - - - - - -Install Tree -The install tree is the location - for all files needed for application development. The - libtarget.a library, which contains the - custom-built eCos kernel and other components, is placed - in the install tree, along with all packages’ public - header files. If you build the tests, the test executable - programs will also be placed in the install - tree. -By default, the install tree is created by - ecosconfig in a subdirectory of the build - tree called install. This can be - modified with the option (see - ). - - -Purpose -The install tree is where the custom-built - libtarget.a library, which contains - the eCos kernel and other components, is located. The - install tree is also the location for all the header files - that are part of a published interface for their - component. - - -How is it modified? -Recompiling can replace - libtarget.a and the test - executables. - - -When is it edited manually? -Where a memory layout requires modification without - use of the eCos Configuration Tool, the memory layout - files must be edited directly in the install tree. These - files are located at - install/include/pkgconf/mlt_*.*. - Note that subsequent modification of the install tree - using the Configuration Tool will result in such manual - edits being lost. - - -User applications -User application source or binary code should - not go in the install tree. - - -Examples of files in this hierarchy - - -install/lib/libtarget.a - -The library containing the kernel and other components. - - - -install/include/cyg/kernel/kapi.h - -The header file for the kernel C language API. - - - -install/include/pkgconf/mlt_arm_pid_ram.ldi - -The linker script fragment describing the memory - layout for linking applications intended for - execution on an ARM PID development board using RAM - startup. - - - -install/include/stdio.h - -The C library header file for standard I/O. - - - - - - -Application Build Tree -This tree is not part of eCos itself: it is the - directory in which eCos end users write their own - applications. -Example applications and their - Makefile are located in the component - repository, in the directory - BASE_DIR/examples. - - -There is no imposed format on this directory, but there - are certain compiler and linker flags that must be used to - compile an eCos application. The basic set of flags is shown - in the example Makefile, and additional - details can be found in . - -
- -Compiler and Linker Options - - eCos is built using - the GNU C and C++ compilers. eCos relies on certain features of these - tools such as constructor priority ordering and selective linking - which are not part of other toolchains. - - -Some GCC options are required for eCos, -and others can be useful. This chapter gives a brief description -of the required options as well as some recommended eCos-specific options. -All other GCC options (described in the GCC manuals) -are available. - -Compiling a C Application -The following command lines demonstrate the - minimum set of options required to - compile and link an eCos program written in C. - -Remember that when this manual shows - TARGET-gcc - you should use the full name of the cross compiler, - e.g. i386-elf-gcc, - arm-elf-gcc, or - sh-elf-gcc. When compiling for the - synthetic Linux target, use the native - gcc which must have the features - required by eCos. - - -$ TARGET-gcc -c -IINSTALL_DIR/include file.c -$ TARGET-gcc -o program file.o -LINSTALL_DIR/lib -Ttarget.ld -nostdlib - - -Certain targets may require extra options, for example - the SPARClite architectures require the option - . Examine the - BASE_DIR/examples/Makefile - or the “Global compiler flags” option - (CYGBLD_GLOBAL_CFLAGS) in your generated - eCos configuration) to see if any extra options are - required, and if so, what they are. -The following command lines use some other options - which are recommended because they use the - selective linking feature: -$ TARGET-gcc -c -IINSTALL_DIR/include -I. -ffunction-sections -fdata-sections -g -O2 file.c -$ TARGET-gcc -o program file.o -ffunction-sections -fdata-sections -Wl,--gc-sections -g -O2 \ - -LINSTALL_DIR/lib -Ttarget.ld -nostdlib - - - - - -Compiling a C++ Application -The following command lines demonstrate the - minimum set of options required to - compile and link an eCos program written in C++. - - -Remember that when this manual shows - TARGET-g++ - you should use the full name of the cross compiler, - e.g. i386-elf-g++, - arm-elf-g++, or - sh-elf-g++. When compiling for the - synthetic Linux target, use the native - g++ which must have the features - required by eCos. - -$ TARGET-g++ -c -IINSTALL_DIR/include -fno-rtti -fno-exceptions file.cxx -$ TARGET-g++ -o program file.o -LINSTALL_DIR/lib -Ttarget.ld -nostdlib - - - -Certain targets may require extra options, - for example the SPARClite architectures require the option - . Examine the - BASE_DIR/packages/targets - file or BASE_DIR/examples/Makefile - or the “Global compiler flags” option - (CYGBLD_GLOBAL_CFLAGS) in your generated - eCos configuration) to see if any extra options are - required, and if so, what they are. -The following command lines use some other options - which are recommended because they use the - selective linking feature: - -$ TARGET-g++ -c -IINSTALL_DIR/include -I. -ffunction-sections -fdata-sections -fno-rtti \ - -fno-exceptions -finit-priority -g -O2 file.cxx -$ TARGET-g++ -o program file.o -W1,--gc-sections -g -O2 -LINSTALL_DIR/lib -Ttarget.ld -nostdlib - - - - - -Debugging Techniques -eCos applications and components can be debugged in - traditional ways, with printing statements and debugger - single-stepping, but there are situations in which these - techniques cannot be used. One example of this is when a - program is getting data at a high rate from a real-time - source, and cannot be slowed down or interrupted. -eCos’s infrastructure module provides a - tracing formalism, allowing the - kernel’s tracing macros to be configured in many useful - ways. eCos’s kernel provides instrumentation - buffers which also collect specific - (configurable) data about the system’s history and - performance. - -Tracing -To use eCos’s tracing facilities you must first - configure your system to use tracing. - You should enable the Asserts and Tracing component - () and the - component within it - (). These - options can be enabled with the Configuration - Tool or by editing the file - BUILD_DIR/pkgconf/infra.h - manually. -You should then examine all the tracing-related options in -the Package: Infrastructure chapter of the eCos Reference -Manual. One useful set of configuration options are: CYGDBG_INFRA_DEBUG_FUNCTION_REPORTS and CYGDBG_INFRA_DEBUG_TRACE_MESSAGE, -which are both enabled by default when tracing is enabled. -The following “Hello world with tracing” shows -the output from running the hello world program (from ) that was -built with tracing enabled: - -Hello world with tracing -$ mips-tx39-elf-run --board=jmr3904 hello -Hello, eCos world! -ASSERT FAIL: <2>cyg_trac.h [ 623] Cyg_TraceFunction_Report_::set_exitvoid() exitvoid used in typed function -TRACE: <1>mlqueue.cxx [ 395] Cyg_ThreadQueue_Implementation::enqueue() {{enter -TRACE: <1>mlqueue.cxx [ 395] Cyg_ThreadQueue_Implementation::enqueue() }}RETURNING UNSET! -TRACE: <1>mlqueue.cxx [ 126] Cyg_Scheduler_Implementation::add_thread() }}RETURNING UNSET! -TRACE: <1>thread.cxx [ 654] Cyg_Thread::resume() }}return void -TRACE: <1>cstartup.cxx [ 160] cyg_iso_c_start() }}return void -TRACE: <1>startup.cxx [ 142] cyg_package_start() }}return void -TRACE: <1>startup.cxx [ 150] cyg_user_start() {{enter -TRACE: <1>startup.cxx [ 150] cyg_user_start() (((void))) -TRACE: <1>startup.cxx [ 153] cyg_user_start() 'This is the system default cyg_user_start()' -TRACE: <1>startup.cxx [ 157] cyg_user_start() }}return void -TRACE: <1>sched.cxx [ 212] Cyg_Scheduler::start() {{enter -TRACE: <1>mlqueue.cxx [ 102] Cyg_Scheduler_Implementation::schedule() {{enter -TRACE: <1>mlqueue.cxx [ 437] Cyg_ThreadQueue_Implementation::highpri() {{enter -TRACE: <1>mlqueue.cxx [ 437] Cyg_ThreadQueue_Implementation::highpri() }}RETURNING UNSET! -TRACE: <1>mlqueue.cxx [ 102] Cyg_Scheduler_Implementation::schedule() }}RETURNING UNSET! -TRACE: <2>intr.cxx [ 450] Cyg_Interrupt::enable_interrupts() {{enter -TRACE: <2>intr.cxx [ 450] Cyg_Interrupt::enable_interrupts() }}RETURNING UNSET! -TRACE: <2>thread.cxx [ 69] Cyg_HardwareThread::thread_entry() {{enter -TRACE: <2>cstartup.cxx [ 127] invoke_main() {{enter -TRACE: <2>cstartup.cxx [ 127] invoke_main() ((argument is ignored)) -TRACE: <2>dummyxxmain.cxx [ 60] __main() {{enter -TRACE: <2>dummyxxmain.cxx [ 60] __main() (((void))) -TRACE: <2>dummyxxmain.cxx [ 63] __main() 'This is the system default __main()' -TRACE: <2>dummyxxmain.cxx [ 67] __main() }}return void -TRACE: <2>memcpy.c [ 112] _memcpy() {{enter -TRACE: <2>memcpy.c [ 112] _memcpy() ((dst=80002804, src=BFC14E58, n=19)) -TRACE: <2>memcpy.c [ 164] _memcpy() }}returning 80002804 -TRACE: <2>cstartup.cxx [ 137] invoke_main() 'main() has returned with code 0. Calling exit()' -TRACE: <2>exit.cxx [ 71] __libc_exit() {{enter -TRACE: <2>exit.cxx [ 71] __libc_exit() ((status=0 )) -TRACE: <2>atexit.cxx [ 84] cyg_libc_invoke_atexit_handlers() {{enter -TRACE: <2>atexit.cxx [ 84] cyg_libc_invoke_atexit_handlers() (((void))) - -Scheduler: - -Lock: 0 -Current Thread: <null> - -Threads: - -Idle Thread pri = 31 state = R id = 1 - stack base = 800021F0 ptr = 80002510 size = 00000400 - sleep reason NONE wake reason NONE - queue = 80000C54 wait info = 00000000 - -<null> pri = 0 state = R id = 2 - stack base = 80002A48 ptr = 8000A968 size = 00008000 - sleep reason NONE wake reason NONE - queue = 80000BD8 wait info = 00000000 - - - - -Kernel Instrumentation -Instrument buffers can be used to - find out how many events of a given type happened in the - kernel during execution of a program. -You can monitor a class of several types of events, or - you can just look at individual events. -Examples of events that can be - monitored are: - - - -scheduler events - - -thread operations - - -interrupts - - -mutex operations - - -binary semaphore operations - - -counting semaphore operations - - -clock ticks and interrupts - - -Examples of fine-grained scheduler event types are: - - -scheduler lock - - -scheduler unlock - - -rescheduling - - -time slicing - - -Information about the events is stored in an - event record. The structure that - defines this record has type struct - Instrument_Record: - -The list of records is stored in an array called instrument_buffer -which you can let the kernel provide or you can provide yourself -by setting the configuration option CYGVAR_KERNEL_INSTRUMENT_EXTERNAL_BUFFER. -To write a program that examines the instrumentation - buffers: - - -Enable instrumentation buffers in the eCos kernel configuration. -The component macro is CYGPKG_KERNEL_INSTRUMENT. - - -To allocate the buffers yourself, enable the configuration -option CYGVAR_KERNEL_INSTRUMENT_EXTERNAL_BUFFER. - - -Include the header file -cyg/kernel/instrmnt.h -. -#include <cyg/kernel/instrmnt.h> - - -The Instrumentation_Record structure -is not published in the kernel header file. In the future there -will be a cleaner mechanism to access it, but for now you should -paste into your code in the following lines: - -struct Instrument_Record -{ - CYG_WORD16 type; // record type - CYG_WORD16 thread; // current thread id - CYG_WORD timestamp; // 32 bit timestamp - CYG_WORD arg1; // first arg - CYG_WORD arg2; // second arg -}; - - -Enable the events you want to record using -cyg_instrument_enable() -, and disable them later. Look at -cyg/kernel/instrmnt.h - and the examples below to see what events can be enabled. - - -Place the code you want to debug between the matching -functions -cyg_instrument_enable() - and -cyg_instrument_disable() -. - - -Examine the buffer. For now you need to look at the data -in there (the example program below shows how to do that), and future -versions of eCos will include a host-side tool to help you understand -the data. - - - -Using instrument buffers -This program is also provided in the - examples directory. - - -/* this is a program which uses eCos instrumentation buffers; it needs - to be linked with a kernel which was compiled with support for - instrumentation */ - -#include <stdio.h> -#include <pkgconf/kernel.h> -#include <cyg/kernel/instrmnt.h> -#include <cyg/kernel/kapi.h> - -#ifndef CYGVAR_KERNEL_INSTRUMENT_EXTERNAL_BUFFER -# error You must configure eCos with CYGVAR_KERNEL_INSTRUMENT_EXTERNAL_BUFFER -#endif - -struct Instrument_Record -{ - CYG_WORD16 type; // record type - CYG_WORD16 thread; // current thread id - CYG_WORD timestamp; // 32 bit timestamp - CYG_WORD arg1; // first arg - CYG_WORD arg2; // second arg -}; - -struct Instrument_Record instrument_buffer[20]; -cyg_uint32 instrument_buffer_size = 20; - -int main(void) -{ - int i; - - cyg_instrument_enable(CYG_INSTRUMENT_CLASS_CLOCK, 0); - cyg_instrument_enable(CYG_INSTRUMENT_CLASS_THREAD, 0); - cyg_instrument_enable(CYG_INSTRUMENT_CLASS_ALARM, 0); - - printf("Program to play with instrumentation buffer\n"); - - cyg_thread_delay(2); - - cyg_instrument_disable(CYG_INSTRUMENT_CLASS_CLOCK, 0); - cyg_instrument_disable(CYG_INSTRUMENT_CLASS_THREAD, 0); - cyg_instrument_disable(CYG_INSTRUMENT_CLASS_ALARM, 0); - - for (i = 0; i < instrument_buffer_size; ++i) { - printf("Record %02d: type 0x%04x, thread %d, ", - i, instrument_buffer[i].type, instrument_buffer[i].thread); - printf("time %5d, arg1 0x%08x, arg2 0x%08x\n", - instrument_buffer[i].timestamp, instrument_buffer[i].arg1, - instrument_buffer[i].arg2); - } - return 0; -} - -Here is how you could compile and run this program in the examples directory, -using (for example) the MN10300 simulator target: - -$ make XCC=mn10300-elf-gcc INSTALL_DIR=/tmp/ecos-work-mn10300/install instrument-test -mn10300-elf-gcc -c -o instrument-test.o -g -Wall -I/tmp/ecos-work-mn10300/install/include \ - -ffunction-sections -fdata-sections instrument-test.c -mn10300-elf-gcc -nostartfiles -L/tmp/ecos-work-mn10300/install/lib -W1,--gc-sections -o \ - instrument-test instrument-test.o -Ttarget.ld -nostdlib -$ mn10300-elf-run --board=stdeval1 instrument-test - - -Instrument buffer output -Here is the output of the - instrument-test program. Notice that in - little over 2 seconds, and with very little activity, and - with few event types enabled, it gathered 17 records. In - larger programs it will be necessary to select very few - event types for debugging. -Program to play with instrumentation buffer -Record 00: type 0x0207, thread 2, time 6057, arg1 0x48001cd8, arg2 0x00000002 -Record 01: type 0x0202, thread 2, time 6153, arg1 0x48001cd8, arg2 0x00000000 -Record 02: type 0x0904, thread 2, time 6358, arg1 0x48001d24, arg2 0x00000000 -Record 03: type 0x0905, thread 2, time 6424, arg1 0x00000002, arg2 0x00000000 -Record 04: type 0x0906, thread 2, time 6490, arg1 0x00000000, arg2 0x00000000 -Record 05: type 0x0901, thread 2, time 6608, arg1 0x48009d74, arg2 0x48001d24 -Record 06: type 0x0201, thread 2, time 6804, arg1 0x48001cd8, arg2 0x480013e0 -Record 07: type 0x0803, thread 1, time 94, arg1 0x00000000, arg2 0x00000000 -Record 08: type 0x0801, thread 1, time 361, arg1 0x00000000, arg2 0x00000000 -Record 09: type 0x0802, thread 1, time 548, arg1 0x00000001, arg2 0x00000000 -Record 10: type 0x0803, thread 1, time 94, arg1 0x00000000, arg2 0x00000000 -Record 11: type 0x0801, thread 1, time 361, arg1 0x00000001, arg2 0x00000000 -Record 12: type 0x0903, thread 1, time 513, arg1 0x48009d74, arg2 0x48001d24 -Record 13: type 0x0208, thread 1, time 588, arg1 0x00000000, arg2 0x00000000 -Record 14: type 0x0203, thread 1, time 697, arg1 0x48001cd8, arg2 0x480013e0 -Record 15: type 0x0802, thread 1, time 946, arg1 0x00000002, arg2 0x00000000 -Record 16: type 0x0201, thread 1, time 1083, arg1 0x480013e0, arg2 0x48001cd8 -Record 17: type 0x0000, thread 0, time 0, arg1 0x00000000, arg2 0x00000000 -Record 18: type 0x0000, thread 0, time 0, arg1 0x00000000, arg2 0x00000000 -Record 19: type 0x0000, thread 0, time 0, arg1 0x00000000, arg2 0x00000000 - - - -
- diff --git a/doc/sgml/user-guide/programming.sgml b/doc/sgml/user-guide/programming.sgml deleted file mode 100644 --- a/doc/sgml/user-guide/programming.sgml +++ /dev/null @@ -1,1340 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Programming With <productname>eCos</productname> - - -Programming With <productname>eCos</productname> - -The following chapters of this manual comprise a simple tutorial -for configuring and building eCos, building and running eCos tests, -and finally building three stand-alone example programs which use -the eCos API to perform some simple tasks. - -You will need a properly installed eCos system, with the correct -versions of the GNU toolchain. On Windows -you will be using the bash command line interpreter that comes with -Cygwin, with the environment variables set as described in the -toolchain documentation. - - -The Development Process - -Most development projects using eCos would contain some (or -most) of the following: - - -<productname>eCos</productname> Configuration - -eCos is configured to provide the desired API (the inclusion -of libc, uitron, and the disabling of certain undesired funtions, -etc.), and semantics (selecting scheduler, mutex behavior, etc.). -See . - -It would normally make sense to enable eCos assertion checking -at this time as well, to catch as many programming errors during -the development phase as possible. - -Note that it should not be necessary to spend much time on -eCos configuration initially. It may be important to perform fine -tuning to reduce the memory footprint and to improve performance -later when the product reaches a testable state. - - - - Integrity check of the <productname>eCos</productname> configuration - -While we strive to thoroughly test eCos, the vast number -of configuration permutations mean that the particular configuration -parameters used for your project may not have been tested. Therefore, -we advise running the eCos tests after the project's -eCos configuration has been determined. See . - -Obviously, this should be repeated if the configuration changes -later on in the development process. - - - - Application Development - Target Neutral Part - -While your project is probably targeting a specific architecture -and platform, possibly custom hardware, it may be possible to perform -part of the application development using simulated or synthetic -targets. - -There are three good reasons for doing this: - - - - -It may be possible by this means to perform application -development in parallel with the design/implementation -of the target hardware, thus providing more time for developing -and testing functionality, and reducing time-to-market. - - - -The build-run-debug-cycle may be faster when the application -does not have to be downloaded to a target via a serial interface. -Debugging is also likely to be more responsive when you do not have to -to communicate with the remote GDB stubs in RedBoot via serial. It -also removes the need for manually or automatically resetting the -target hardware. - - - - -New hardware can often be buggy. Comparing the behaviour of the -program on the hardware and in the simulator or synthetic target may -allow you to identify where the problems lie. - - - - - -This approach is possible because all targets (including -simulators and synthetic ones) provide the same basic API: that -is, kernel, libc, libm, uitron, infra, and to some extent, HAL and -IO. - -Synthetic targets are especially suitable as they allow you -to construct simulations of elaborate devices by interaction with -the host system, where an IO device API can hide the details from -the application. When switching to hardware later in the development -cycle, the IO driver is properly implemented. - - - -Simulators can also do this, but it all depends on the -design and capabilities of the simulator you use. Some, like -SID or -Bochs provide -complete hardware emulation, while others just support enough of the -instruction set to run compiled code. - - -Therefore, select a simulator or synthetic target and use -it for as long as possible for application development. That is, -configure for the selected target, build eCos, build the application -and link with eCos, run and debug. Repeat the latter two steps until -you are happy with it. - -Obviously, at some time you will have to switch to the intended -target hardware, for example when adding target specific feature -support, for memory footprint/performance characterization, -and for final tuning of eCos and the application. - - - - - Application Development - Target Specific Part - -Repeat the build-run-debug-cycle while performing final tuning -and debugging of application. Remember to disable eCos assertion -checking if you are testing any performance-related aspects, it can -make a big difference. - -It may be useful to switch between this and the previous step -repeatedly through the development process; use the simulator/synthetic -target for actual development, and use the target hardware to continually -check memory footprint and performance. There should be little cost -in switching between the two targets when using two separate build -trees. - - - - - - - - - -<!-- <xref> --><!-- <index></index> -->Configuring and Building <productname>eCos</productname> from Source - -This chapter documents the configuration of eCos. The process is -the same for any of the supported targets: you may select a -hardware target (if you have a board available), any one of the -simulators, or a synthetic target (if your host platform has synthetic -target support). - - - - -<!-- <xref> --><productname>eCos</productname> Start-up Configurations - -There are various ways to download an executable image to a -target board, and these involve different ways of preparing the -executable image. In the eCos Hardware Abstraction Layer (HAL package) -there are configuration options to support the different download -methods. summarizes the -ways in which an eCos image can be prepared for different types of -download. This is not an exhaustive list, some targets define -additional start-up types of their own. Where a ROM Monitor is -mentioned, this will usually be RedBoot, although on some older, or -low resource, targets you may need to use CygMon or the GDB stubs ROM, -see the target documentation for details. - - - -Configuration for various download methods - - - -Download method -HAL configuration - - - - -Burn hardware ROM - ROM or ROMRAM start-up - - -Download to ROM emulator - ROM or ROMRAM start-up - - -Download to board with ROM Monitor - RAM start-up - - -Download to simulator without ROM Monitor - ROM start-up - - -Download to simulator with ROM Monitor - RAM start-up - - -Download to simulator ignoring devices - SIM configuration - - -Run synthetic target - RAM start-up - - - -
- - - -You cannot run an application configured for RAM start-up -on the simulator directly: it will fail during start-up. You can -only download it to the simulator if -you are already running RedBoot in the simulator, -as described in the toolchain documentation -or you load through the -SID -GDB debugging component. This is not the same as the simulated -stub, since it does not require a target program to be running to -get GDB to talk to it. It can be done before letting the simulator -run -or you use the ELF loader component to get a program into memory. - - - - -Configuring eCos' HAL package for simulation should -rarely be needed for real development; binaries built with such -a kernel will not run on target boards at all, -and the MN10300 and -TX39 simulators can run binaries built for stdeval1 and jmr3904 -target boards. -The main use for a ``simulation'' configuration -is if you are trying to work around problems with the device drivers -or with the simulator. Also note that when using a TX39 system configured -for simulator start-up you should then invoke the simulator with -the -option instead of - - - - -If your chosen architecture does not have simulator support, -then the combinations above that refer to the simulator do not apply. -Similarly, if your chosen platform does not have RedBoot -ROM support, the combinations listed above that use -RedBoot do not apply. - - -The debugging environment for most developers will be either -a hardware board or the simulator, in which case they will be able -to select a single HAL configuration. - -
- - - - -<!-- <index></index> --> -Configuration Tool on Windows and Linux Quick Start - - - -This section described the GUI based configuration tool. This -tool is probably more suited to users who prefer GUI's. The next -section describes a CLI based tool which Unix users may -prefer. - -Note that the use of the Configuration Tool -is described in detail in . - -The Configuration Tool (see ) -has five main elements: the configuration window, -the conflicts window, -the properties window, the short -description window, -and the output window. - -
-Configuration Tool - -
- -Start by opening the templates window via Build->Templates. -Select the desired target (see ). - -
-Template selection - -
- -Make sure that the configuration is correct for the target -in terms of endianness, CPU model, Startup type, etc. (see ). - -
-<!-- <conditionaltext> --><!-- <xref> -->Configuring -for the target - -
- -Next, select the Build->Library menu -item to start building eCos (see ). The -application will configure the sources, prepare a build tree, and -build the libtarget.a library, which contains the -eCos kernel and other packages. - -
-Selecting the Build Library menu item - -
- - -The Save As dialog box will appear, asking -you to specify a directory in which to place your save file. You -can use the default, but it is a good idea to make a subdirectory, -called ecos-work for example. - -
-Save file dialog - -
- -The first time you build an eCos library for a specific -architecture, the Configuration Tool may prompt -you for the location of the appropriate build tools (including -make and -TARGET-gcc) using a -Build Tools dialog box (as shown in ). You can select a location from -the drop down list, browse to the directory using the -Browse button, or type in the location of the -build tools manually. - -
-Build tools dialog - -
- -The Configuration Tool may also prompt you -for the location of the user tools (such as cat and -ls) using a User Tools dialog -box (as shown in ). As with -the Build Tools dialog, you can select a location -from the drop down list, browse to the directory using the -Browse button, or type in the location of the -user tools manually. Note that on Linux, this will often be -unnecessary as the tools will already be on your PATH. - -
-User tools dialog - -
- -When the tool locations have been entered, the Configuration -Tool will configure the sources, prepare a build tree, -and build the libtarget.a library, which contains -the eCos kernel and other packages. - -The output from the configuration process and the building -of libtarget.a will be shown in the output -window. - -Once the build process has finished you will have a kernel -with other packages in libtarget.a. You should -now build the eCos tests for your particular configuration. - -You can do this by selecting Build -> Tests. -Notice that you could have selected Tests instead -of Library in the earlier step and it would -have built both the library and the tests, -but this would increase the build time substantially, and if you -do not need to build the tests it is unnecessary. - -
-Selecting the Build Tests menu item - -
- - will guide you through running one - of the test cases you just built on the selected target, - using GDB. -
- - - - -<!-- <index></index> --> -Ecosconfig on Windows and Linux Quick Start - -As an alternative to using the graphical -Configuration Tool, it is possible to -configure and build a kernel by editing a configuration file manually -and using the ecosconfig command. Users with a Unix -background may find this tool more suitable than the GUI tool -described in the previous section. - - -Manual configuration and the ecosconfig command are -described in detail in . - - - -To use the ecosconfig command you need to start a -shell. In Windows you need to start a -CygWin bash shell, not a -DOS command line. - - - - -The following instructions assume that the -PATH and ECOS_REPOSITORY -environment variables have been setup correctly as described in . They also assume Linux -usage but equally well apply to Windows running Cygwin. - -Before invoking ecosconfig you need to -choose a directory in which to work. For the purposes of this tutorial, -the default path will be BASE_DIR/ecos-work. -Create this directory and change to it by typing: - - -$ mkdir BASE_DIR/ecos-work -$ cd BASE_DIR/ecos-work - - -To see what options can be used with ecosconfig, -type: - -$ ecosconfig --help - -The available packages, targets and templates may be listed -as follows: - - -$ ecosconfig list - - -Here is sample output from ecosconfig showing -the usage message. - - -Getting <!-- <index></index> --> help from ecosconfig - - -$ ecosconfig --help -Usage: ecosconfig [ qualifier ... ] [ command ] - commands are: - list : list repository contents - new TARGET [ TEMPLATE [ VERSION ] ] : create a configuration - target TARGET : change the target hardware - template TEMPLATE [ VERSION ] : change the template - add PACKAGE [ PACKAGE ... ] : add package(s) - remove PACKAGE [ PACKAGE ... ] : remove package(s) - version VERSION PACKAGE [ PACKAGE ... ] : change version of package(s) - export FILE : export minimal config info - import FILE : import additional config info - check : check the configuration - resolve : resolve conflicts - tree : create a build tree - qualifiers are: - --config=FILE : the configuration file - --prefix=DIRECTORY : the install prefix - --srcdir=DIRECTORY : the source repository - --no-resolve : disable conflict -resolution - --version : show version and copyright -$ - - - - - -ecosconfig output — <!-- <index></index> --> -list of available packages, targets and templates - - -$ ecosconfig list -Package CYGPKG_CYGMON (CygMon support via eCos): -aliases: cygmon -versions: &Version; -Package CYGPKG_DEVICES_WALLCLOCK_DALLAS_DS1742 (Wallclock driver for Dallas 1742): -aliases: devices_wallclock_ds1742 device_wallclock_ds1742 -versions: &Version; -Package CYGPKG_DEVICES_WALLCLOCK_SH3 (Wallclock driver for SH3 RTC module): -aliases: devices_wallclock_sh3 device_wallclock_sh3 -versions: &Version; -Package CYGPKG_DEVICES_WATCHDOG_ARM_AEB (Watchdog driver for ARM/AEB board): -aliases: devices_watchdog_aeb device_watchdog_aeb -versions: &Version; -Package CYGPKG_DEVICES_WATCHDOG_ARM_EBSA285 (Watchdog driver for ARM/EBSA285 board): -aliases: devices_watchdog_ebsa285 device_watchdog_ebsa285 -versions: &Version; -… - - - - - -Selecting a <!-- <index></index> --> Target - -To configure for a listed target, type: - - -$ ecosconfig new <target> - - -For example, to configure for the ARM PID development board, -type: - - -$ ecosconfig new pid - - -You can then edit the generated file, -ecos.ecc, setting the options as required for the -target (endianess, CPU model, Startup type, etc.). For detailed -information about how to edit the ecos.ecc file, -see the CDL Writer's Guide and . - - -Create a build tree for the configured target by typing: - - -$ ecosconfig tree - - - -If there are any problem with the configuration, -ecosconfig will tell you. The most likely cause of -this is mistakes when editing the ecos.ecc file. -You can check whether the configuration you have made is correct, -without building the tree with the following command: - - - -$ ecosconfig check - - - -If this reports any conflicts you can get -ecosconfig to try and resolve them itself by typing: - - - -$ ecosconfig resolve - - - -See for more details. - - -You can now run the command make or make -tests, after which you will be at the same point you -would be after running the Configuration Tool -— you can start developing your own applications, -following the steps in . - -The procedure shown above allows you to do very coarse-grained -configuration of the eCos kernel: you can select which packages -to include in your kernel, and give target and start-up options. -But you cannot select components within a package, or set the very -fine-grained options. - -To select fine-grained configuration options you will need to -edit the configuration file ecos.ecc in the -current directory and regenerate the build tree. - - -You should follow the manual configuration process described -above very carefully, and you should read the comments in each file -to see when one option depends on other options or packages being -enabled or disabled. If you do not, you might end up with an inconsistently -configured kernel which could fail to build or might execute -incorrectly. - - - - - -
- - - - -Running an <productname>eCos</productname> Test Case - -In or you created the eCos test cases -as part of the build process. Now it is time to try and run one. - - - - - -Using the <application>Configuration Tool</application> - -Test executables that have been linked using the -Build->Tests operation against the current -configuration can be executed by selecting Tools->Run -Tests. - -When a test run is invoked, a property sheet is displayed, see -. Press the Uncheck -All button and then find and check just one test, -bin_sem0 for example. - - -
-Run tests - -
- - -Now press the Properties button to set up -communications with the target. This will bring up a properties dialog -shown in . If you have -connected the target board via a serial cable, check the -Serial radio button, and select the serial port -and baud rate for the board. If the target is connected via the -network select the TCP/IP button and enter the IP -address that the board has been given, and the port number (usually -9000). - - -
-Properties dialog box - -
- - -Click OK on this dialog and go back to the Run -Tests dialog. Press the Run button and -the selected test will be downloaded and run. The -Output tab will show you how this is -progressing. If it seems to stop for a long time, check that the -target board is correctly connected, and that eCos has been correctly -configured -- especially the start-up type. - - - -When the program runs you should see a couple of line similar to this appear: - - - -PASS:<Binary Semaphore 0 OK> -EXIT:<done> - - - -This indicates that the test has run successfully. - - -See for -further details. - -
- - - - -Using the command line - -Start a command shell (such as a Cygwin shell window in Windows) -with the environment variables set as described in the toolchain -documentation. Change to the directory in which you set up your build -tree, and invoke GDB on the test -program. - -To run the bin_sem0 test (which will -test the kernel for the correct creation and destruction of binary -semaphores) type: - - -$ TARGET-gdb -nw install/tests/kernel/&Version;/tests/bin_sem0 - - -You should see output similar to the following in the command -window: - - -GNU gdb THIS-GDB-VERSION -Copyright 2001 Free Software Foundation, Inc. -GDB is free software, covered by the GNU General Public License, and you are -welcome to change it and/or distribute copies of it under certain conditions. -Type "show copying" to see the conditions. -There is absolutely no warranty for GDB. Type "show warranty" for details. -This GDB was configured as "--host=THIS-HOST --target=THIS-TARGET". -(gdb) - - -If you are trying to run a synthetic target test on Linux, skip the following connection and download -steps. Otherwise, connect to the target by typing: - - -(gdb) set remotebaud 38400 -(gdb) target remote /dev/ttyS0 - -on Linux or - -(gdb) set remotebaud 38400 -(gdb) target remote com1 - -on Windows or - -(gdb) target sim - -to use a simulator in either host O/S. - - -Check the documentation for the target board for the actual baud rate -to use when connecting to real targets. - - - -You will see output similar to the following: - - -Remote debugging using /dev/ttyS1 -0x0000d50c in ?? () - at BASE_DIR/kernel/&Version;/src/common/kapi.cxx:345 - -Current language: auto; currently c++ -(gdb) - - - -Or if you are using the simulator: - - - -Connected to the simulator. -(gdb) - - -Now download the program to the target with - - -(gdb) load - - -You should see output similar to the following on your screen: - - -Loading section .text, size 0x4b04 lma 0x108000 -Loading section .rodata, size 0x738 lma 0x10cb08 -Loading section .data, size 0x1c0 lma 0x10d240 -Start address 0x108000, load size 21500 -Transfer rate: 24571 bits/sec, 311 bytes/write. -(gdb) - - -You are now ready to run your program. If you type: - - -(gdb) continue - - -you will see output similar to the following: - - -Continuing. -PASS:<Binary Semaphore 0 OK> -EXIT:<done> - - - - If you are using a simulator or the synthetic target rather - than real hardware, you must use the GDB command - “run” rather than “continue” to - start your program. - - -You can terminate your GDB session with -Control+C, otherwise it will sit in the -“idle” thread and use up CPU time. This is not a problem -with real targets, but may have undesirable effects in simulated or -synthetic targets. Type quit and you are -done. - - - - - - -Testing Filters - -While most test cases today run solely in the target environment, -some packages may require external testing infrastructure and/or -feedback from the external environment to do complete testing. - -The serial package is an example of this. The network package -also contains some tests that require programs to be run on a -host. See the network Tests and Demonstrations -section in the network documentation in the eCos Reference -Guide. Here we will concentrate on the serial tests since -these are applicable to more targets. - - -Since the serial line is also used for communication with -GDB, a filter is inserted in the communication pathway between -GDB and the serial device which is connected to the hardware target. -The filter forwards all communication between the two, but also -listens for special commands embedded in the data stream from the -target. - -When such a command is seen, the filter stops forwarding data -to GDB from the target and enters a special mode. In this mode -the test case running on the target is able to control the filter, -commanding it to run various tests. While these tests run, GDB is -isolated from the target. - -As the test completes (or if the filter detects a target crash) -the communication path between GDB and the hardware target is re-established, -allowing GDB to resume control. - -In theory, it is possible to extend the filter to provide -a generic framework for other target-external testing components, -thus decoupling the testing infrastructure from the (possibly limited) -communication means provided by the target (serial, JTAG, Ethernet, -etc). - -Another advantage is that the host tools do not need to -know about the various testing environments required by the eCos -packages, since all contact with the target continues to happen -via GDB. - - - -
- - - - - -<!-- <xref> -->Building and <!-- <index></index> -->Running Sample Applications - -The example programs in this tutorial are included, along -with a Makefile, in the examples directory -of the eCos distribution. The first program you will run is a hello -world-style application, then you will run a more complex -application that demonstrates the creation of threads and the use -of cyg_thread_delay(), and finally you will run -one that uses clocks and alarm handlers. - -The Makefile depends on an externally -defined variable to find the eCos library and header files. This -variable is INSTALL_DIR and must be set to the -pathname of the install directory created in . - - - -INSTALL_DIR may be either be set in the shell -environment or may be supplied on the command line. To set it in the -shell do the following in a bash shell: - - - -$ export INSTALL_DIR=BASE_DIR/ecos-work/arm_install - - - -You can then run make without any extra parameters -to build the examples. - - - -Alternatively, if you can do the following: - - - -$ make INSTALL_DIR=BASE_DIR/ecos-work/arm_install - - - - - -<productname>eCos</productname> Hello World - -The following code is found in the file hello.c -in the examples directory: - - -<productname>eCos</productname><!-- <index></index> --> hello world program listing - - -/* this is a simple hello world program */ -#include <stdio.h> -int main(void) -{ - printf("Hello, eCos world!\n"); - return 0; -} - - -To compile this or any other program that is not part of the -eCos distribution, you can follow the procedures described below. Type -this explicit compilation command (assuming your current working -directory is also where you built the eCos kernel): - - -$ TARGET-gcc -g -IBASE_DIR/ecos-work/install/include hello.c -LBASE_DIR/ecos-work/install/lib -Ttarget.ld -nostdlib - - -The compilation command above contains some standard GCC -options (for example, enables debugging), as well -as some mention of paths -( allows files -like cyg/kernel/kapi.h to be found, and - allows the linker to -find ). - -The executable program will be called a.out. - - -Some target systems require special options to be passed to -gcc to compile correctly for that system. Please examine the Makefile -in the examples directory to see if this applies to your target. - - -You can now run the resulting program using GDB in exactly the -same the way you ran the test case before. The procedure will be the -same, but this time run -TARGET-gdb specifying - on the command line: - - -$ TARGET-gdb -nw a.out - - -For targets other than the synthetic linux target, you should -now run the usual GDB commands described earlier. Once this is done, -typing the command "continue" at the (gdb) prompt ("run" for -simulators) will allow the program to execute and print the string -"Hello, eCos world!" on your screen. - -On the synthetic linux target, you may use the "run" command -immediately - you do not need to connect to the target, nor use the -"load" command. - - - - - - - -A Sample Program with Two Threads - -Below is a program that uses some of eCos' system calls. It -creates two threads, each of which goes into an infinite loop in which -it sleeps for a while (using cyg_thread_delay()). This code is found -in the file twothreads.c -in the examples directory. - - -<productname>eCos</productname> <!-- <index></index> -->two-threaded program listing - - -#include <cyg/kernel/kapi.h> -#include <stdio.h> -#include <math.h> -#include <stdlib.h> - -/* now declare (and allocate space for) some kernel objects, - like the two threads we will use */ -cyg_thread thread_s[2]; /* space for two thread objects */ - -char stack[2][4096]; /* space for two 4K stacks */ - -/* now the handles for the threads */ -cyg_handle_t simple_threadA, simple_threadB; - -/* and now variables for the procedure which is the thread */ -cyg_thread_entry_t simple_program; - -/* and now a mutex to protect calls to the C library */ -cyg_mutex_t cliblock; - -/* we install our own startup routine which sets up threads */ -void cyg_user_start(void) -{ - printf("Entering twothreads' cyg_user_start() function\n"); - - cyg_mutex_init(&cliblock); - - cyg_thread_create(4, simple_program, (cyg_addrword_t) 0, - "Thread A", (void *) stack[0], 4096, - &simple_threadA, &thread_s[0]); - cyg_thread_create(4, simple_program, (cyg_addrword_t) 1, - "Thread B", (void *) stack[1], 4096, - &simple_threadB, &thread_s[1]); - - cyg_thread_resume(simple_threadA); - cyg_thread_resume(simple_threadB); -} - -/* this is a simple program which runs in a thread */ -void simple_program(cyg_addrword_t data) -{ - int message = (int) data; - int delay; - - printf("Beginning execution; thread data is %d\n", message); - - cyg_thread_delay(200); - - for (;;) { - delay = 200 + (rand() % 50); - - /* note: printf() must be protected by a - call to cyg_mutex_lock() */ - cyg_mutex_lock(&cliblock); { - printf("Thread %d: and now a delay of %d clock ticks\n", - message, delay); - } - cyg_mutex_unlock(&cliblock); - cyg_thread_delay(delay); - } -} - - - -When you run the program (by typing continue at -the (gdb) prompt) the output should look like -this: - - -Starting program: BASE_DIR/examples/twothreads.exe -Entering twothreads' cyg_user_start() -function -Beginning execution; thread data is 0 -Beginning execution; thread data is 1 -Thread 0: and now a delay of 240 clock ticks -Thread 1: and now a delay of 225 clock ticks -Thread 1: and now a delay of 234 clock ticks -Thread 0: and now a delay of 231 clock ticks -Thread 1: and now a delay of 224 clock ticks -Thread 0: and now a delay of 249 clock ticks -Thread 1: and now a delay of 202 clock ticks -Thread 0: and now a delay of 235 clock ticks - - - -When running in a simulator the -delays might be quite long. On a hardware board (where the clock -speed is 100 ticks/second) the delays should average to -about 2.25 seconds. In simulation, the delay will depend on the -speed of the host processor and will almost always be much slower than -the actual board. You might want to reduce the delay parameter when running -in simulation. - - - - - shows how this -multitasking program executes. Note that apart from the thread -creation system calls, this program also creates and uses a -mutex for synchronization -between the printf() calls in the two -threads. This is because the C library standard I/O (by default) is -configured not to be thread-safe, which means that if more than one -thread is using standard I/O they might corrupt each other. This is -fixed by a mutual exclusion (or mutex) lockout -mechanism: the threads do not call printf() until -cyg_mutex_lock() has returned, which only happens -when the other thread calls -cyg_mutex_unlock(). - -You could avoid using the mutex by configuring the C library to -be thread-safe (by selecting the component -CYGSEM_LIBC_STDIO_THREAD_SAFE_STREAMS). - -
Two -threads with simple print statements after random delays - -
- -
- -
- -
- - - - -More Features — <!-- <index></index> -->Clocks and Alarm -Handlers - -If a program wanted to execute a task at a given time, or -periodically, it could do it in an inefficient way by sitting in a -loop and checking the real-time clock to see if the proper amount of -time has elapsed. But operating systems usually provide system calls -which allow the program to be informed at the desired time. - -eCos provides a rich timekeeping formalism, involving -counters, clocks, -alarms, and timers. The -precise definition, relationship, and motivation of these features is -beyond the scope of this tutorial, but these examples illustrate how -to set up basic periodic tasks. - -Alarms are events that happen at -a given time, either once or periodically. A thread associates an -alarm handling function with the alarm, so that the function will -be invoked every time the alarm “goes off”. - - - - -A Sample Program with Alarms - -simple-alarm.c (in -the examples directory) is a short program that creates a thread that -creates an alarm. The alarm is handled by the function -test_alarm_func(), which sets a global -variable. When the main thread of execution sees that the variable has -changed, it prints a message. - - -A sample <!-- <index></index> -->program that creates an alarm - - -/* this is a very simple program meant to demonstrate - a basic use of time, alarms and alarm-handling functions in eCos */ - -#include <cyg/kernel/kapi.h> - -#include <stdio.h> - -#define NTHREADS 1 -#define STACKSIZE 4096 - -static cyg_handle_t thread[NTHREADS]; - -static cyg_thread thread_obj[NTHREADS]; -static char stack[NTHREADS][STACKSIZE]; - -static void alarm_prog( cyg_addrword_t data ); - -/* we install our own startup routine which sets up - threads and starts the scheduler */ -void cyg_user_start(void) -{ - cyg_thread_create(4, alarm_prog, (cyg_addrword_t) 0, - "alarm_thread", (void *) stack[0], - STACKSIZE, &thread[0], &thread_obj[0]); - cyg_thread_resume(thread[0]); -} - -/* we need to declare the alarm handling function (which is - defined below), so that we can pass it to cyg_alarm_initialize() */ -cyg_alarm_t test_alarm_func; - -/* alarm_prog() is a thread which sets up an alarm which is then - handled by test_alarm_func() */ -static void alarm_prog(cyg_addrword_t data) -{ - cyg_handle_t test_counterH, system_clockH, test_alarmH; - cyg_tick_count_t ticks; - cyg_alarm test_alarm; - unsigned how_many_alarms = 0, prev_alarms = 0, tmp_how_many; - - system_clockH = cyg_real_time_clock(); - cyg_clock_to_counter(system_clockH, &test_counterH); - cyg_alarm_create(test_counterH, test_alarm_func, - (cyg_addrword_t) &how_many_alarms, - &test_alarmH, &test_alarm); - cyg_alarm_initialize(test_alarmH, cyg_current_time()+200, 200); - - /* get in a loop in which we read the current time and - print it out, just to have something scrolling by */ - for (;;) { - ticks = cyg_current_time(); - printf("Time is %llu\n", ticks); - /* note that we must lock access to how_many_alarms, since the - alarm handler might change it. this involves using the - annoying temporary variable tmp_how_many so that I can keep the - critical region short */ - cyg_scheduler_lock(); - tmp_how_many = how_many_alarms; - cyg_scheduler_unlock(); - if (prev_alarms != tmp_how_many) { - printf(" --- alarm calls so far: %u\n", tmp_how_many); - prev_alarms = tmp_how_many; - } - cyg_thread_delay(30); - } -} - -/* test_alarm_func() is invoked as an alarm handler, so - it should be quick and simple. in this case it increments - the data that is passed to it. */ -void test_alarm_func(cyg_handle_t alarmH, cyg_addrword_t data) -{ - ++*((unsigned *) data); -} - - - -When you run this program (by typing continue at -the (gdb) prompt) the output should look like -this: - -Starting program: BASE_DIR/examples/simple-alarm.exe -Time is 0 -Time is 30 -Time is 60 -Time is 90 -Time is 120 -Time is 150 -Time is 180 -Time is 210 - --- alarm calls so far: 1 -Time is 240 -Time is 270 -Time is 300 -Time is 330 -Time is 360 -Time is 390 -Time is 420 - --- alarm calls so far: 2 -Time is 450 -Time is 480 - - - -When running in a simulator the delays -might be quite long. On a hardware board (where the clock speed is 100 -ticks/second) the delays should average to about 0.3 seconds (and 2 -seconds between alarms). In simulation, the delay will depend on the -speed of the host processor and will almost always be much slower than -the actual board. You might want to reduce the delay parameter when -running in simulation. - - -Here are a few things you might notice about this program: - - - -It used the cyg_real_time_clock() function; -this always returns a handle to the default system real-time clock. - - - -Clocks are based on counters, so the function cyg_alarm_create() -uses a counter handle. The program used the function -cyg_clock_to_counter() to strip the clock handle -to the underlying counter handle. - - - -Once the alarm is created it is -initialized with cyg_alarm_initialize(), which -sets the time at which the alarm should go off, as well as the period -for repeating alarms. It is set to go off at the current time and -then to repeat every 200 ticks. - - - -The alarm handler function -test_alarm_func() conforms to the guidelines for -writing alarm handlers and other delayed service routines: it does not invoke any -functions which might lock the scheduler. This is discussed in detail -in the eCos Reference Manual, in the chapter -The eCos Kernel. - - - -There is a critical region in this program: -the variable how_many_alarms is accessed in the -main thread of control and is also modified in the alarm handler. To -prevent a possible (though unlikely) race condition on this variable, -access to how_many_alarms in the principal thread -is protected by calls to cyg_scheduler_lock() and -cyg_scheduler_unlock(). When the scheduler is -locked, the alarm handler will not be invoked, so the problem is -averted. - - - - - -
- diff --git a/doc/sgml/user-guide/real-time-characterization.sgml b/doc/sgml/user-guide/real-time-characterization.sgml deleted file mode 100644 --- a/doc/sgml/user-guide/real-time-characterization.sgml +++ /dev/null @@ -1,3316 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Real-time characterization - -For a discussion of real-time performance measurement for eCos, see the -kernel documentation in the eCos Reference Manual. - - - - -As with the target setup descriptions in the previous appendix, this -information will eventually be merged into per-target documents. - - - - Sample numbers: - - - - - -Board: ARM AEB-1 Revision B Evaluation Board - - -Board: ARM AEB-1 Revision B Evaluation Board - -CPU : Sharp LH77790A 24MHz - - - -Startup, main stack : stack used 404 size 2400 -Startup : Interrupt stack used 128 size 2048 -Startup : Idlethread stack used 80 size 2048 - -eCos Kernel Timings -Notes: all times are in microseconds (.000001) unless otherwise stated - -Reading the hardware clock takes 13 'ticks' overhead -... this value will be factored out of all other measurements -Clock interrupt took 193.49 microseconds (290 raw clock ticks) - -Testing parameters: - Clock samples: 32 - Threads: 7 - Thread switches: 128 - Mutexes: 32 - Mailboxes: 32 - Semaphores: 32 - Scheduler operations: 128 - Counters: 32 - Alarms: 32 - - - Confidence - Ave Min Max Var Ave Min Function - ====== ====== ====== ====== ========== ======== - 110.19 104.67 116.00 3.26 42% 28% Create thread - 34.00 34.00 34.00 0.00 100% 100% Yield thread [all suspended] - 24.67 24.67 24.67 0.00 100% 100% Suspend [suspended] thread - 25.05 24.67 25.33 0.33 57% 42% Resume thread - 37.14 36.67 37.33 0.27 71% 28% Set priority - 3.81 3.33 4.00 0.27 71% 28% Get priority - 80.00 80.00 80.00 0.00 100% 100% Kill [suspended] thread - 33.90 33.33 34.00 0.16 85% 14% Yield [no other] thread - 45.90 44.00 46.67 0.54 57% 14% Resume [suspended low prio] thread - 24.57 24.00 24.67 0.16 85% 14% Resume [runnable low prio] thread - 42.29 36.67 43.33 1.61 85% 14% Suspend [runnable] thread - 33.90 33.33 34.00 0.16 85% 14% Yield [only low prio] thread - 24.67 24.67 24.67 0.00 100% 100% Suspend [runnable->not runnable] - 80.00 80.00 80.00 0.00 100% 100% Kill [runnable] thread - 43.33 43.33 43.33 0.00 100% 100% Destroy [dead] thread - 106.29 101.33 107.33 1.41 85% 14% Destroy [runnable] thread - 144.95 141.33 166.00 6.01 85% 85% Resume [high priority] thread - 78.31 76.67 254.67 2.75 99% 99% Thread switch - - 4.00 4.00 4.00 0.00 100% 100% Scheduler lock - 16.37 16.00 16.67 0.33 56% 43% Scheduler unlock [0 threads] - 16.37 16.00 16.67 0.33 56% 43% Scheduler unlock [1 suspended] - 16.37 16.00 16.67 0.33 56% 43% Scheduler unlock [many suspended] - 16.37 16.00 16.67 0.33 56% 43% Scheduler unlock [many low prio] - - 10.67 10.67 10.67 0.00 100% 100% Init mutex - 28.67 28.67 28.67 0.00 100% 100% Lock [unlocked] mutex - 30.44 30.00 31.33 0.33 59% 37% Unlock [locked] mutex - 25.42 25.33 26.00 0.15 87% 87% Trylock [unlocked] mutex - 22.50 22.00 22.67 0.25 75% 25% Trylock [locked] mutex - 5.75 5.33 6.00 0.31 62% 37% Destroy mutex - 185.33 185.33 185.33 0.00 100% 100% Unlock/Lock mutex - - 20.17 20.00 20.67 0.25 75% 75% Create mbox - 2.92 2.67 3.33 0.31 62% 62% Peek [empty] mbox - 32.42 32.00 32.67 0.31 62% 37% Put [first] mbox - 3.00 2.67 3.33 0.33 100% 50% Peek [1 msg] mbox - 32.50 32.00 32.67 0.25 75% 25% Put [second] mbox - 2.92 2.67 3.33 0.31 62% 62% Peek [2 msgs] mbox - 32.83 32.67 33.33 0.25 75% 75% Get [first] mbox - 32.67 32.67 32.67 0.00 100% 100% Get [second] mbox - 31.33 31.33 31.33 0.00 100% 100% Tryput [first] mbox - 27.58 27.33 28.00 0.31 62% 62% Peek item [non-empty] mbox - 32.83 32.67 33.33 0.25 75% 75% Tryget [non-empty] mbox - 26.50 26.00 26.67 0.25 75% 25% Peek item [empty] mbox - 28.00 28.00 28.00 0.00 100% 100% Tryget [empty] mbox - 3.25 2.67 3.33 0.15 87% 12% Waiting to get mbox - 3.25 2.67 3.33 0.15 87% 12% Waiting to put mbox - 30.83 30.67 31.33 0.25 75% 75% Delete mbox - 101.08 100.67 101.33 0.31 62% 37% Put/Get mbox - - 11.17 10.67 11.33 0.25 75% 25% Init semaphore - 24.17 24.00 24.67 0.25 75% 75% Post [0] semaphore - 27.08 26.67 27.33 0.31 62% 37% Wait [1] semaphore - 22.75 22.67 23.33 0.15 87% 87% Trywait [0] semaphore - 22.21 22.00 22.67 0.29 68% 68% Trywait [1] semaphore - 7.33 7.33 7.33 0.00 100% 100% Peek semaphore - 5.92 5.33 6.00 0.15 87% 12% Destroy semaphore - 110.04 110.00 110.67 0.08 93% 93% Post/Wait semaphore - - 9.54 9.33 10.00 0.29 68% 68% Create counter - 3.92 3.33 4.00 0.15 87% 12% Get counter value - 4.00 4.00 4.00 0.00 100% 100% Set counter value - 30.92 30.67 31.33 0.31 62% 62% Tick counter - 5.75 5.33 6.00 0.31 62% 37% Delete counter - - 13.83 13.33 14.00 0.25 75% 25% Create alarm - 46.67 46.67 46.67 0.00 100% 100% Initialize alarm - 3.67 3.33 4.00 0.33 100% 50% Disable alarm - 45.67 45.33 46.00 0.33 100% 50% Enable alarm - 8.33 8.00 8.67 0.33 100% 50% Delete alarm - 36.33 36.00 36.67 0.33 100% 50% Tick counter [1 alarm] - 214.67 214.67 214.67 0.00 100% 100% Tick counter [many alarms] - 62.67 62.67 62.67 0.00 100% 100% Tick & fire counter [1 alarm] - 1087.04 1075.33 1278.67 21.91 93% 93% Tick & fire counters [>1 together] - 246.35 240.67 412.00 10.35 96% 96% Tick & fire counters [>1 separately] - 168.01 167.33 237.33 1.08 99% 99% Alarm latency [0 threads] - 187.36 168.00 234.67 3.60 86% 1% Alarm latency [2 threads] - 187.37 167.33 235.33 3.59 85% 1% Alarm latency [many threads] - 303.12 280.00 508.67 3.21 98% 0% Alarm -> thread resume latency - - 36.65 36.00 38.67 0.00 Clock/interrupt latency - - 65.79 52.00 152.67 0.00 Clock DSR latency - - 316 316 316 (main stack: 752) Thread stack used (1120 total) -All done, main stack : stack used 752 size 2400 -All done : Interrupt stack used 280 size 2048 -All done : Idlethread stack used 268 size 2048 - -Timing complete - 30390 ms total - -PASS:<Basic timing OK> -EXIT:<done> - - - - - - - -Board: Atmel AT91/EB40 - -Board: Atmel AT91/EB40 -CPU : AT91R40807 (ARM7TDMI core), 32MHz -512KB RAM, 64K Flash - -Startup, main stack : stack used 420 size 2400 -Startup : Interrupt stack used 144 size 4096 -Startup : Idlethread stack used 84 size 2048 - -eCos Kernel Timings -Notes: all times are in microseconds (.000001) unless otherwise stated - -Reading the hardware clock takes 3 'ticks' overhead -... this value will be factored out of all other measurements -Clock interrupt took 127.53 microseconds (130 raw clock ticks) - -Testing parameters: - Clock samples: 32 - Threads: 25 - Thread switches: 128 - Mutexes: 32 - Mailboxes: 32 - Semaphores: 32 - Scheduler operations: 128 - Counters: 32 - Alarms: 32 - - - Confidence - Ave Min Max Var Ave Min Function - ====== ====== ====== ====== ========== ======== - 86.48 71.29 101.56 7.99 48% 28% Create thread - 20.70 20.51 21.48 0.31 80% 80% Yield thread [all suspended] - 17.15 16.60 17.58 0.48 56% 44% Suspend [suspended] thread - 17.07 16.60 17.58 0.49 52% 52% Resume thread - 25.51 25.39 26.37 0.21 88% 88% Set priority - 3.16 2.93 3.91 0.36 76% 76% Get priority - 52.34 51.76 52.73 0.47 60% 40% Kill [suspended] thread - 20.70 20.51 21.48 0.31 80% 80% Yield [no other] thread - 28.98 28.32 30.27 0.48 60% 36% Resume [suspended low prio] thread - 17.11 16.60 17.58 0.49 52% 48% Resume [runnable low prio] thread - 27.85 26.37 28.32 0.52 96% 4% Suspend [runnable] thread - 20.70 20.51 21.48 0.31 80% 80% Yield [only low prio] thread - 17.23 16.60 17.58 0.45 64% 36% Suspend [runnable->not runnable] - 52.34 51.76 52.73 0.47 60% 40% Kill [runnable] thread - 33.01 32.23 33.20 0.31 80% 20% Destroy [dead] thread - 72.03 70.31 72.27 0.38 80% 4% Destroy [runnable] thread - 96.99 95.70 112.30 1.22 64% 96% Resume [high priority] thread - 51.48 49.80 164.06 1.76 99% 99% Thread switch - - 2.78 1.95 2.93 0.26 84% 15% Scheduler lock - 11.81 11.72 12.70 0.17 90% 90% Scheduler unlock [0 threads] - 11.81 11.72 12.70 0.17 90% 90% Scheduler unlock [1 suspended] - 11.81 11.72 12.70 0.17 90% 90% Scheduler unlock [many suspended] - 11.81 11.72 12.70 0.17 90% 90% Scheduler unlock [many low prio] - - 5.49 4.88 5.86 0.46 62% 37% Init mutex - 20.20 19.53 20.51 0.42 68% 31% Lock [unlocked] mutex - 24.44 24.41 25.39 0.06 96% 96% Unlock [locked] mutex - 18.25 17.58 18.55 0.42 68% 31% Trylock [unlocked] mutex - 16.11 15.63 16.60 0.49 100% 50% Trylock [locked] mutex - 6.10 5.86 6.84 0.37 75% 75% Destroy mutex - 124.21 124.02 125.00 0.30 81% 81% Unlock/Lock mutex - - 9.28 8.79 9.77 0.49 100% 50% Create mbox - 2.93 2.93 2.93 0.00 100% 100% Peek [empty] mbox - 22.58 22.46 23.44 0.21 87% 87% Put [first] mbox - 2.44 1.95 2.93 0.49 100% 50% Peek [1 msg] mbox - 22.58 22.46 23.44 0.21 87% 87% Put [second] mbox - 2.44 1.95 2.93 0.49 100% 50% Peek [2 msgs] mbox - 22.71 22.46 23.44 0.37 75% 75% Get [first] mbox - 22.71 22.46 23.44 0.37 75% 75% Get [second] mbox - 21.18 20.51 21.48 0.42 68% 31% Tryput [first] mbox - 18.98 18.55 19.53 0.48 56% 56% Peek item [non-empty] mbox - 22.46 22.46 22.46 0.00 100% 100% Tryget [non-empty] mbox - 18.31 17.58 18.55 0.37 75% 25% Peek item [empty] mbox - 19.53 19.53 19.53 0.00 100% 100% Tryget [empty] mbox - 2.69 1.95 2.93 0.37 75% 25% Waiting to get mbox - 2.93 2.93 2.93 0.00 100% 100% Waiting to put mbox - 23.86 23.44 24.41 0.48 56% 56% Delete mbox - 67.60 67.38 68.36 0.33 78% 78% Put/Get mbox - - 5.37 4.88 5.86 0.49 100% 50% Init semaphore - 16.97 16.60 17.58 0.46 62% 62% Post [0] semaphore - 18.98 18.55 19.53 0.48 56% 56% Wait [1] semaphore - 15.81 15.63 16.60 0.30 81% 81% Trywait [0] semaphore - 15.29 14.65 15.63 0.44 65% 34% Trywait [1] semaphore - 5.62 4.88 5.86 0.37 75% 25% Peek semaphore - 6.35 5.86 6.84 0.49 100% 50% Destroy semaphore - 72.36 72.27 73.24 0.17 90% 90% Post/Wait semaphore - - 7.08 6.84 7.81 0.37 75% 75% Create counter - 3.17 2.93 3.91 0.37 75% 75% Get counter value - 3.05 2.93 3.91 0.21 87% 87% Set counter value - 24.11 23.44 24.41 0.42 68% 31% Tick counter - 5.49 4.88 5.86 0.46 62% 37% Delete counter - - 10.92 10.74 11.72 0.30 81% 81% Create alarm - 31.46 31.25 32.23 0.33 78% 78% Initialize alarm - 3.05 2.93 3.91 0.21 87% 87% Disable alarm - 31.49 31.25 32.23 0.37 75% 75% Enable alarm - 7.02 6.84 7.81 0.30 81% 81% Delete alarm - 31.16 30.27 31.25 0.17 90% 9% Tick counter [1 alarm] - 309.26 304.69 425.78 7.28 96% 96% Tick counter [many alarms] - 44.83 43.95 44.92 0.17 90% 9% Tick & fire counter [1 alarm] - 781.68 774.41 893.55 13.62 93% 93% Tick & fire counters [>1 together] - 324.16 320.31 433.59 6.84 96% 96% Tick & fire counters [>1 separately] - 114.26 113.28 167.97 0.84 57% 42% Alarm latency [0 threads] - 126.91 113.28 159.18 8.20 50% 31% Alarm latency [2 threads] - 127.11 113.28 158.20 8.09 51% 28% Alarm latency [many threads] - 196.49 189.45 331.05 2.10 98% 0% Alarm -> thread resume latency - - 23.50 23.44 25.39 0.00 Clock/interrupt latency - - 40.31 33.20 514.65 0.00 Clock DSR latency - - 300 271 312 (main stack: 832) Thread stack used (1120 total) -All done, main stack : stack used 832 size 2400 -All done : Interrupt stack used 288 size 4096 -All done : Idlethread stack used 272 size 2048 - -Timing complete - 30350 ms total - -PASS:<Basic timing OK> -EXIT:<done> - - - - - - -Board: Intel StrongARM EBSA-285 Evaluation Board -Board: Intel StrongARM EBSA-285 Evaluation Board - -CPU : Intel StrongARM SA-110 228MHz - - -Startup, main stack : stack used 404 size 2400 -Startup : Interrupt stack used 136 size 4096 -Startup : Idlethread stack used 80 size 2048 - -eCos Kernel Timings -Notes: all times are in microseconds (.000001) unless otherwise stated - -Reading the hardware clock takes 1 'ticks' overhead -... this value will be factored out of all other measurements -Clock interrupt took 4.61 microseconds (16 raw clock ticks) - -Testing parameters: - Clock samples: 32 - Threads: 64 - Thread switches: 128 - Mutexes: 32 - Mailboxes: 32 - Semaphores: 32 - Scheduler operations: 128 - Counters: 32 - Alarms: 32 - - - Confidence - Ave Min Max Var Ave Min Function - ====== ====== ====== ====== ========== ======== - 4.97 3.26 7.34 0.60 50% 4% Create thread - 0.73 0.54 2.17 0.14 60% 37% Yield thread [all suspended] - 0.98 0.82 2.99 0.23 81% 68% Suspend [suspended] thread - 0.54 0.27 1.63 0.03 92% 6% Resume thread - 0.83 0.54 1.90 0.10 73% 14% Set priority - 0.21 0.00 0.54 0.21 25% 48% Get priority - 2.25 1.90 10.05 0.37 96% 67% Kill [suspended] thread - 0.70 0.54 1.09 0.14 53% 45% Yield [no other] thread - 0.96 0.82 1.36 0.14 50% 48% Resume [suspended low prio] thread - 0.53 0.27 0.82 0.03 92% 6% Resume [runnable low prio] thread - 0.90 0.82 1.63 0.13 70% 70% Suspend [runnable] thread - 0.70 0.54 0.82 0.13 57% 42% Yield [only low prio] thread - 0.55 0.54 0.82 0.01 98% 98% Suspend [runnable->not runnable] - 1.64 1.63 2.17 0.02 98% 98% Kill [runnable] thread - 0.97 0.82 4.62 0.20 98% 64% Destroy [dead] thread - 2.17 1.90 2.17 0.01 98% 1% Destroy [runnable] thread - 6.06 5.16 10.60 0.53 59% 31% Resume [high priority] thread - 1.69 1.63 5.98 0.11 90% 90% Thread switch - - 0.14 0.00 1.36 0.14 99% 50% Scheduler lock - 0.37 0.27 0.54 0.13 62% 62% Scheduler unlock [0 threads] - 0.38 0.27 0.54 0.13 60% 60% Scheduler unlock [1 suspended] - 0.37 0.27 0.54 0.13 63% 63% Scheduler unlock [many suspended] - 0.37 0.27 0.54 0.13 63% 63% Scheduler unlock [many low prio] - - 0.34 0.00 1.90 0.15 78% 6% Init mutex - 0.88 0.54 4.62 0.37 93% 71% Lock [unlocked] mutex - 0.79 0.54 4.35 0.26 93% 53% Unlock [locked] mutex - 0.59 0.27 2.17 0.10 93% 3% Trylock [unlocked] mutex - 0.50 0.27 0.82 0.09 78% 18% Trylock [locked] mutex - 0.18 0.00 0.54 0.13 59% 37% Destroy mutex - 3.85 3.80 5.16 0.08 96% 96% Unlock/Lock mutex - - 0.64 0.27 3.53 0.24 81% 15% Create mbox - 0.61 0.27 2.17 0.21 68% 18% Peek [empty] mbox - 0.87 0.54 5.16 0.31 59% 87% Put [first] mbox - 0.08 0.00 0.54 0.12 71% 71% Peek [1 msg] mbox - 0.71 0.54 1.09 0.14 56% 40% Put [second] mbox - 0.08 0.00 0.27 0.12 68% 68% Peek [2 msgs] mbox - 0.89 0.54 4.89 0.31 62% 81% Get [first] mbox - 0.76 0.54 1.09 0.17 43% 37% Get [second] mbox - 0.76 0.54 3.26 0.21 96% 50% Tryput [first] mbox - 0.65 0.54 2.45 0.17 81% 81% Peek item [non-empty] mbox - 0.76 0.54 2.72 0.19 53% 43% Tryget [non-empty] mbox - 0.58 0.54 0.82 0.06 87% 87% Peek item [empty] mbox - 0.61 0.54 0.82 0.10 75% 75% Tryget [empty] mbox - 0.10 0.00 0.54 0.13 65% 65% Waiting to get mbox - 0.10 0.00 0.54 0.13 65% 65% Waiting to put mbox - 0.77 0.54 3.26 0.20 53% 43% Delete mbox - 2.10 1.90 6.25 0.30 93% 93% Put/Get mbox - - 0.34 0.27 1.09 0.11 81% 81% Init semaphore - 0.60 0.27 1.09 0.12 68% 6% Post [0] semaphore - 0.59 0.54 0.82 0.08 81% 81% Wait [1] semaphore - 0.59 0.54 2.17 0.10 96% 96% Trywait [0] semaphore - 0.48 0.27 0.82 0.11 71% 25% Trywait [1] semaphore - 0.24 0.00 0.82 0.09 78% 18% Peek semaphore - 0.19 0.00 0.54 0.13 62% 34% Destroy semaphore - 2.28 2.17 4.08 0.18 93% 90% Post/Wait semaphore - - 0.43 0.00 2.72 0.23 90% 6% Create counter - 0.40 0.00 1.63 0.25 68% 28% Get counter value - 0.13 0.00 0.82 0.15 96% 59% Set counter value - 0.71 0.54 1.63 0.16 50% 46% Tick counter - 0.16 0.00 0.54 0.14 53% 43% Delete counter - - 0.47 0.27 1.36 0.15 59% 37% Create alarm - 1.58 1.09 7.07 0.44 71% 68% Initialize alarm - 0.12 0.00 1.09 0.16 96% 65% Disable alarm - 1.01 0.82 2.45 0.17 53% 43% Enable alarm - 0.21 0.00 0.27 0.09 78% 21% Delete alarm - 0.78 0.54 1.90 0.12 71% 25% Tick counter [1 alarm] - 3.90 3.80 4.35 0.13 68% 68% Tick counter [many alarms] - 1.25 1.09 1.63 0.14 53% 43% Tick & fire counter [1 alarm] - 19.88 19.84 20.11 0.07 84% 84% Tick & fire counters [>1 together] - 4.37 4.35 4.62 0.05 90% 90% Tick & fire counters [>1 separately] - 3.83 3.80 7.61 0.06 99% 99% Alarm latency [0 threads] - 4.46 3.80 7.88 0.27 71% 24% Alarm latency [2 threads] - 16.06 13.59 26.36 1.05 54% 10% Alarm latency [many threads] - 6.67 6.52 22.83 0.29 98% 98% Alarm -> thread resume latency - - 1.89 0.82 9.78 0.00 Clock/interrupt latency - - 2.17 1.09 7.34 0.00 Clock DSR latency - - 11 0 316 (main stack: 744) Thread stack used (1120 total) -All done, main stack : stack used 744 size 2400 -All done : Interrupt stack used 288 size 4096 -All done : Idlethread stack used 268 size 2048 - -Timing complete - 30210 ms total - -PASS:<Basic timing OK> -EXIT:<done> - - - - - - -Board: Cirrus Logic EDB7111-2 Development Board - -CPU : Cirrus Logic EP7211 73MHz -Board: Cirrus Logic EDB7111-2 Development Board - -CPU : Cirrus Logic EP7211 73MHz - - - -Startup, main stack : stack used 404 size 2400 -Startup : Interrupt stack used 136 size 4096 -Startup : Idlethread stack used 88 size 2048 - -eCos Kernel Timings -Notes: all times are in microseconds (.000001) unless otherwise stated - -Reading the hardware clock takes 0 'ticks' overhead -... this value will be factored out of all other measurements -Clock interrupt took 356.69 microseconds (182 raw clock ticks) - -Testing parameters: - Clock samples: 32 - Threads: 64 - Thread switches: 128 - Mutexes: 32 - Mailboxes: 32 - Semaphores: 32 - Scheduler operations: 128 - Counters: 32 - Alarms: 32 - - - Confidence - Ave Min Max Var Ave Min Function - ====== ====== ====== ====== ========== ======== - 22.71 17.58 37.11 3.07 46% 34% Create thread - 4.36 3.91 5.86 0.70 76% 76% Yield thread [all suspended] - 4.24 3.91 7.81 0.56 84% 84% Suspend [suspended] thread - 4.09 1.95 7.81 0.45 85% 3% Resume thread - 5.31 3.91 11.72 0.92 65% 32% Set priority - 2.11 1.95 3.91 0.28 92% 92% Get priority - 11.54 9.77 25.39 0.99 62% 28% Kill [suspended] thread - 4.46 3.91 9.77 0.82 75% 75% Yield [no other] thread - 7.57 5.86 13.67 0.69 75% 20% Resume [suspended low prio] thread - 3.94 1.95 5.86 0.18 92% 3% Resume [runnable low prio] thread - 7.02 5.86 13.67 1.05 53% 45% Suspend [runnable] thread - 4.42 3.91 9.77 0.79 76% 76% Yield [only low prio] thread - 4.24 1.95 5.86 0.61 79% 1% Suspend [runnable->not runnable] - 11.29 9.77 27.34 1.14 57% 37% Kill [runnable] thread - 6.29 3.91 11.72 0.84 71% 4% Destroy [dead] thread - 13.52 11.72 31.25 0.90 70% 25% Destroy [runnable] thread - 24.50 21.48 42.97 1.69 79% 12% Resume [high priority] thread - 8.79 7.81 19.53 1.05 99% 53% Thread switch - - 1.66 0.00 3.91 0.52 83% 15% Scheduler lock - 2.59 1.95 3.91 0.86 67% 67% Scheduler unlock [0 threads] - 2.62 1.95 3.91 0.88 65% 65% Scheduler unlock [1 suspended] - 2.61 1.95 3.91 0.87 66% 66% Scheduler unlock [many suspended] - 2.58 1.95 3.91 0.85 67% 67% Scheduler unlock [many low prio] - - 2.69 1.95 5.86 0.96 65% 65% Init mutex - 4.88 3.91 9.77 1.10 96% 56% Lock [unlocked] mutex - 4.64 3.91 11.72 1.05 71% 71% Unlock [locked] mutex - 3.97 1.95 7.81 0.47 81% 9% Trylock [unlocked] mutex - 3.48 1.95 3.91 0.67 78% 21% Trylock [locked] mutex - 1.77 0.00 3.91 0.44 84% 12% Destroy mutex - 31.92 29.30 42.97 1.65 71% 18% Unlock/Lock mutex - - 4.09 3.91 9.77 0.35 96% 96% Create mbox - 1.83 0.00 3.91 0.34 87% 9% Peek [empty] mbox - 5.31 3.91 9.77 0.96 62% 34% Put [first] mbox - 1.59 0.00 1.95 0.60 81% 18% Peek [1 msg] mbox - 5.19 3.91 9.77 1.04 56% 40% Put [second] mbox - 1.65 0.00 3.91 0.62 78% 18% Peek [2 msgs] mbox - 5.43 3.91 9.77 0.86 68% 28% Get [first] mbox - 5.31 3.91 7.81 0.96 59% 34% Get [second] mbox - 4.76 3.91 9.77 1.07 62% 62% Tryput [first] mbox - 4.82 1.95 9.77 1.15 93% 3% Peek item [non-empty] mbox - 5.55 3.91 11.72 0.82 71% 25% Tryget [non-empty] mbox - 3.97 1.95 7.81 0.59 75% 12% Peek item [empty] mbox - 4.33 3.91 7.81 0.69 81% 81% Tryget [empty] mbox - 1.59 0.00 3.91 0.79 68% 25% Waiting to get mbox - 1.71 0.00 3.91 0.53 81% 15% Waiting to put mbox - 5.25 3.91 9.77 1.01 59% 37% Delete mbox - 17.82 15.63 29.30 1.14 65% 18% Put/Get mbox - - 2.69 1.95 5.86 0.96 65% 65% Init semaphore - 3.78 1.95 7.81 0.46 84% 12% Post [0] semaphore - 4.27 3.91 7.81 0.62 84% 84% Wait [1] semaphore - 3.72 1.95 7.81 0.66 75% 18% Trywait [0] semaphore - 3.29 1.95 5.86 0.92 62% 34% Trywait [1] semaphore - 2.32 1.95 3.91 0.59 81% 81% Peek semaphore - 1.89 0.00 3.91 0.24 90% 6% Destroy semaphore - 15.75 13.67 29.30 1.07 68% 21% Post/Wait semaphore - - 2.69 1.95 5.86 0.96 65% 65% Create counter - 1.83 0.00 1.95 0.23 93% 6% Get counter value - 1.53 0.00 3.91 0.76 71% 25% Set counter value - 4.82 3.91 5.86 0.97 53% 53% Tick counter - 1.89 0.00 1.95 0.12 96% 3% Delete counter - - 3.78 1.95 7.81 0.46 84% 12% Create alarm - 7.99 5.86 15.63 0.70 81% 9% Initialize alarm - 1.71 0.00 1.95 0.43 87% 12% Disable alarm - 7.14 5.86 11.72 1.04 56% 40% Enable alarm - 2.50 1.95 3.91 0.79 71% 71% Delete alarm - 4.94 3.91 7.81 1.04 96% 50% Tick counter [1 alarm] - 19.47 17.58 23.44 0.36 87% 9% Tick counter [many alarms] - 7.63 5.86 11.72 0.55 81% 15% Tick & fire counter [1 alarm] - 99.06 97.66 105.47 1.05 59% 37% Tick & fire counters [>1 together] - 22.15 21.48 27.34 0.96 71% 71% Tick & fire counters [>1 separately] - 359.16 357.42 378.91 0.87 71% 25% Alarm latency [0 threads] - 364.03 357.42 402.34 3.03 58% 15% Alarm latency [2 threads] - 408.25 402.34 416.02 2.89 53% 24% Alarm latency [many threads] - 381.16 376.95 492.19 2.48 95% 46% Alarm -> thread resume latency - - 9.79 5.86 19.53 0.00 Clock/interrupt latency - - 12.13 5.86 31.25 0.00 Clock DSR latency - - 12 0 316 (main stack: 752) Thread stack used (1120 total) -All done, main stack : stack used 752 size 2400 -All done : Interrupt stack used 288 size 4096 -All done : Idlethread stack used 276 size 2048 - -Timing complete - 30450 ms total - -PASS:<Basic timing OK> -EXIT:<done> - - - - -CPU : Cirrus Logic EP7212 73MHz -Board: Cirrus Logic EDB7111-2 Development Board - -CPU : Cirrus Logic EP7212 73MHz - - - -Startup, main stack : stack used 404 size 2400 -Startup : Interrupt stack used 136 size 4096 -Startup : Idlethread stack used 88 size 2048 - -eCos Kernel Timings -Notes: all times are in microseconds (.000001) unless otherwise stated - -Reading the hardware clock takes 0 'ticks' overhead -... this value will be factored out of all other measurements -Clock interrupt took 356.32 microseconds (182 raw clock ticks) - -Testing parameters: - Clock samples: 32 - Threads: 64 - Thread switches: 128 - Mutexes: 32 - Mailboxes: 32 - Semaphores: 32 - Scheduler operations: 128 - Counters: 32 - Alarms: 32 - - - Confidence - Ave Min Max Var Ave Min Function - ====== ====== ====== ====== ========== ======== - 22.43 15.63 33.20 3.02 68% 18% Create thread - 4.48 3.91 5.86 0.81 70% 70% Yield thread [all suspended] - 4.42 3.91 7.81 0.78 75% 75% Suspend [suspended] thread - 4.12 1.95 5.86 0.49 82% 3% Resume thread - 5.62 3.91 11.72 0.64 78% 18% Set priority - 2.17 1.95 3.91 0.38 89% 89% Get priority - 11.54 9.77 27.34 0.88 70% 25% Kill [suspended] thread - 4.64 3.91 9.77 0.96 65% 65% Yield [no other] thread - 7.51 5.86 15.63 0.72 76% 21% Resume [suspended low prio] thread - 3.88 1.95 9.77 0.42 82% 10% Resume [runnable low prio] thread - 7.14 5.86 13.67 1.00 59% 39% Suspend [runnable] thread - 4.52 3.91 7.81 0.86 70% 70% Yield [only low prio] thread - 4.15 1.95 7.81 0.49 85% 1% Suspend [runnable->not runnable] - 11.26 9.77 27.34 1.17 56% 39% Kill [runnable] thread - 6.22 3.91 13.67 0.88 70% 7% Destroy [dead] thread - 13.64 11.72 33.20 1.02 64% 26% Destroy [runnable] thread - 24.17 21.48 41.02 1.49 82% 12% Resume [high priority] thread - 8.80 7.81 21.48 1.08 98% 54% Thread switch - - 1.60 0.00 1.95 0.58 82% 17% Scheduler lock - 2.61 1.95 3.91 0.87 66% 66% Scheduler unlock [0 threads] - 2.59 1.95 3.91 0.86 67% 67% Scheduler unlock [1 suspended] - 2.61 1.95 3.91 0.87 66% 66% Scheduler unlock [many suspended] - 2.59 1.95 3.91 0.86 67% 67% Scheduler unlock [many low prio] - - 2.62 1.95 3.91 0.88 65% 65% Init mutex - 4.82 3.91 9.77 1.09 96% 59% Lock [unlocked] mutex - 4.39 3.91 9.77 0.79 81% 81% Unlock [locked] mutex - 3.84 1.95 7.81 0.36 87% 9% Trylock [unlocked] mutex - 3.54 1.95 5.86 0.69 75% 21% Trylock [locked] mutex - 1.83 0.00 3.91 0.34 87% 9% Destroy mutex - 34.61 31.25 46.88 1.68 78% 9% Unlock/Lock mutex - - 3.97 1.95 7.81 0.24 93% 3% Create mbox - 1.83 0.00 3.91 0.34 87% 9% Peek [empty] mbox - 4.76 3.91 9.77 1.07 62% 62% Put [first] mbox - 1.71 0.00 3.91 0.64 75% 18% Peek [1 msg] mbox - 5.00 3.91 9.77 1.10 96% 50% Put [second] mbox - 1.65 0.00 1.95 0.52 84% 15% Peek [2 msgs] mbox - 5.31 3.91 11.72 1.05 59% 37% Get [first] mbox - 5.13 3.91 7.81 0.99 56% 40% Get [second] mbox - 4.76 3.91 11.72 1.12 96% 65% Tryput [first] mbox - 4.46 3.91 7.81 0.82 75% 75% Peek item [non-empty] mbox - 5.55 3.91 9.77 0.82 68% 25% Tryget [non-empty] mbox - 4.03 1.95 7.81 0.58 78% 9% Peek item [empty] mbox - 4.27 3.91 5.86 0.59 81% 81% Tryget [empty] mbox - 1.77 0.00 3.91 0.44 84% 12% Waiting to get mbox - 1.59 0.00 1.95 0.60 81% 18% Waiting to put mbox - 5.37 3.91 9.77 0.91 65% 31% Delete mbox - 16.66 13.67 27.34 1.42 90% 3% Put/Get mbox - - 2.62 1.95 5.86 0.92 68% 68% Init semaphore - 3.84 1.95 7.81 0.47 81% 12% Post [0] semaphore - 4.21 3.91 7.81 0.53 87% 87% Wait [1] semaphore - 3.48 1.95 5.86 0.76 71% 25% Trywait [0] semaphore - 3.60 1.95 5.86 0.62 78% 18% Trywait [1] semaphore - 2.26 1.95 5.86 0.53 87% 87% Peek semaphore - 1.89 0.00 1.95 0.12 96% 3% Destroy semaphore - 16.05 13.67 29.30 1.40 59% 18% Post/Wait semaphore - - 2.38 1.95 3.91 0.67 78% 78% Create counter - 2.01 0.00 3.91 0.35 84% 6% Get counter value - 1.89 0.00 3.91 0.24 90% 6% Set counter value - 4.58 3.91 5.86 0.88 65% 65% Tick counter - 1.71 0.00 1.95 0.43 87% 12% Delete counter - - 3.84 1.95 7.81 0.36 87% 9% Create alarm - 7.99 5.86 15.63 0.47 93% 3% Initialize alarm - 2.01 0.00 3.91 0.35 84% 6% Disable alarm - 6.53 5.86 13.67 1.01 75% 75% Enable alarm - 2.32 1.95 3.91 0.59 81% 81% Delete alarm - 4.76 3.91 7.81 1.01 59% 59% Tick counter [1 alarm] - 19.53 17.58 23.44 0.24 90% 6% Tick counter [many alarms] - 7.57 5.86 13.67 0.75 75% 21% Tick & fire counter [1 alarm] - 98.57 97.66 105.47 1.14 96% 62% Tick & fire counters [>1 together] - 22.15 21.48 27.34 0.96 71% 71% Tick & fire counters [>1 separately] - 359.18 357.42 384.77 1.10 65% 31% Alarm latency [0 threads] - 362.63 357.42 396.48 2.55 43% 27% Alarm latency [2 threads] - 408.22 402.34 416.02 2.73 55% 21% Alarm latency [many threads] - 378.63 375.00 494.14 2.56 93% 71% Alarm -> thread resume latency - - 9.78 5.86 19.53 0.00 Clock/interrupt latency - - 12.21 5.86 31.25 0.00 Clock DSR latency - - 12 0 316 (main stack: 752) Thread stack used (1120 total) -All done, main stack : stack used 752 size 2400 -All done : Interrupt stack used 288 size 4096 -All done : Idlethread stack used 276 size 2048 - -Timing complete - 30550 ms total - -PASS:<Basic timing OK> -EXIT:<done> - - - - - - - - -Board: ARM PID Evaluation Board - -CPU : ARM 7TDMI 20 MHz -Board: ARM PID Evaluation Board - -CPU : ARM 7TDMI 20 MHz - - - -Startup, main stack : stack used 404 size 2400 -Startup : Interrupt stack used 136 size 4096 -Startup : Idlethread stack used 84 size 2048 - -eCos Kernel Timings -Notes: all times are in microseconds (.000001) unless otherwise stated - -Reading the hardware clock takes 6 'ticks' overhead -... this value will be factored out of all other measurements -Clock interrupt took 120.74 microseconds (150 raw clock ticks) - -Testing parameters: - Clock samples: 32 - Threads: 50 - Thread switches: 128 - Mutexes: 32 - Mailboxes: 32 - Semaphores: 32 - Scheduler operations: 128 - Counters: 32 - Alarms: 32 - - - Confidence - Ave Min Max Var Ave Min Function - ====== ====== ====== ====== ========== ======== - 99.01 68.00 129.60 15.62 50% 26% Create thread - 21.60 21.60 21.60 0.00 100% 100% Yield thread [all suspended] - 15.65 15.20 16.00 0.39 56% 44% Suspend [suspended] thread - 15.79 15.20 16.00 0.31 74% 26% Resume thread - 23.65 23.20 24.00 0.39 56% 44% Set priority - 2.26 1.60 2.40 0.24 82% 18% Get priority - 51.39 51.20 52.00 0.29 76% 76% Kill [suspended] thread - 21.60 21.60 21.60 0.00 100% 100% Yield [no other] thread - 29.47 28.00 29.60 0.22 86% 2% Resume [suspended low prio] thread - 15.60 15.20 16.00 0.40 100% 50% Resume [runnable low prio] thread - 27.73 24.00 28.00 0.40 74% 2% Suspend [runnable] thread - 21.60 21.60 21.60 0.00 100% 100% Yield [only low prio] thread - 15.65 15.20 16.00 0.39 56% 44% Suspend [runnable->not runnable] - 51.39 51.20 52.00 0.29 76% 76% Kill [runnable] thread - 27.66 27.20 28.80 0.41 54% 44% Destroy [dead] thread - 68.93 64.80 69.60 0.35 72% 2% Destroy [runnable] thread - 91.26 90.40 107.20 0.64 66% 32% Resume [high priority] thread - 49.14 48.80 49.60 0.39 57% 57% Thread switch - - 2.20 1.60 2.40 0.30 75% 25% Scheduler lock - 10.20 9.60 10.40 0.30 75% 25% Scheduler unlock [0 threads] - 10.20 9.60 10.40 0.30 75% 25% Scheduler unlock [1 suspended] - 10.20 9.60 10.40 0.30 75% 25% Scheduler unlock [many suspended] - 10.20 9.60 10.40 0.30 75% 25% Scheduler unlock [many low prio] - - 6.85 6.40 7.20 0.39 56% 43% Init mutex - 18.40 18.40 18.40 0.00 100% 100% Lock [unlocked] mutex - 19.57 19.20 20.00 0.40 53% 53% Unlock [locked] mutex - 16.55 16.00 16.80 0.34 68% 31% Trylock [unlocked] mutex - 14.55 14.40 15.20 0.24 81% 81% Trylock [locked] mutex - 3.55 3.20 4.00 0.39 56% 56% Destroy mutex - 119.85 119.20 120.00 0.24 81% 18% Unlock/Lock mutex - - 12.85 12.80 13.60 0.09 93% 93% Create mbox - 1.65 1.60 2.40 0.09 93% 93% Peek [empty] mbox - 20.70 20.00 20.80 0.17 87% 12% Put [first] mbox - 1.65 1.60 2.40 0.09 93% 93% Peek [1 msg] mbox - 20.70 20.00 20.80 0.17 87% 12% Put [second] mbox - 1.65 1.60 2.40 0.09 93% 93% Peek [2 msgs] mbox - 20.85 20.80 21.60 0.09 93% 93% Get [first] mbox - 20.85 20.80 21.60 0.09 93% 93% Get [second] mbox - 19.90 19.20 20.00 0.17 87% 12% Tryput [first] mbox - 17.60 17.60 17.60 0.00 100% 100% Peek item [non-empty] mbox - 20.90 20.80 21.60 0.17 87% 87% Tryget [non-empty] mbox - 16.80 16.80 16.80 0.00 100% 100% Peek item [empty] mbox - 17.65 17.60 18.40 0.09 93% 93% Tryget [empty] mbox - 1.85 1.60 2.40 0.34 68% 68% Waiting to get mbox - 1.85 1.60 2.40 0.34 68% 68% Waiting to put mbox - 19.40 19.20 20.00 0.30 75% 75% Delete mbox - 65.05 64.80 65.60 0.34 68% 68% Put/Get mbox - - 7.05 6.40 7.20 0.24 81% 18% Init semaphore - 15.55 15.20 16.00 0.39 56% 56% Post [0] semaphore - 17.35 16.80 17.60 0.34 68% 31% Wait [1] semaphore - 14.60 14.40 15.20 0.30 75% 75% Trywait [0] semaphore - 14.20 13.60 14.40 0.30 75% 25% Trywait [1] semaphore - 4.55 4.00 4.80 0.34 68% 31% Peek semaphore - 3.75 3.20 4.00 0.34 68% 31% Destroy semaphore - 70.85 70.40 71.20 0.39 56% 43% Post/Wait semaphore - - 6.05 5.60 6.40 0.39 56% 43% Create counter - 2.25 1.60 2.40 0.24 81% 18% Get counter value - 2.25 1.60 2.40 0.24 81% 18% Set counter value - 19.70 19.20 20.00 0.37 62% 37% Tick counter - 3.45 3.20 4.00 0.34 68% 68% Delete counter - - 9.05 8.80 9.60 0.34 68% 68% Create alarm - 29.60 29.60 29.60 0.00 100% 100% Initialize alarm - 2.15 1.60 2.40 0.34 68% 31% Disable alarm - 29.35 28.80 29.60 0.34 68% 31% Enable alarm - 5.10 4.80 5.60 0.37 62% 62% Delete alarm - 23.20 23.20 23.20 0.00 100% 100% Tick counter [1 alarm] - 138.00 137.60 138.40 0.40 100% 50% Tick counter [many alarms] - 40.40 40.00 40.80 0.40 100% 50% Tick & fire counter [1 alarm] - 704.25 697.60 804.00 12.47 93% 93% Tick & fire counters [>1 together] - 155.20 155.20 155.20 0.00 100% 100% Tick & fire counters [>1 separately] - 105.20 104.80 151.20 0.76 99% 94% Alarm latency [0 threads] - 117.57 104.80 149.60 7.13 57% 25% Alarm latency [2 threads] - 117.49 104.80 148.80 7.10 58% 26% Alarm latency [many threads] - 192.59 177.60 316.00 1.93 98% 0% Alarm -> thread resume latency - - 22.10 21.60 24.00 0.00 Clock/interrupt latency - - 38.69 32.80 61.60 0.00 Clock DSR latency - - 297 276 316 (main stack: 752) Thread stack used (1120 total) -All done, main stack : stack used 752 size 2400 -All done : Interrupt stack used 288 size 4096 -All done : Idlethread stack used 272 size 2048 - -Timing complete - 30350 ms total - -PASS:<Basic timing OK> -EXIT:<done> - - - - -CPU : ARM 920T 20 MHz - - -Board: ARM PID Evaluation Board - -CPU : ARM 920T 20 MHz - - -Startup, main stack : stack used 404 size 2400 -Startup : Interrupt stack used 136 size 4096 -Startup : Idlethread stack used 84 size 2048 - -eCos Kernel Timings -Notes: all times are in microseconds (.000001) unless otherwise stated - -Reading the hardware clock takes 15 'ticks' overhead -... this value will be factored out of all other measurements -Clock interrupt took 291.41 microseconds (364 raw clock ticks) - -Testing parameters: - Clock samples: 32 - Threads: 50 - Thread switches: 128 - Mutexes: 32 - Mailboxes: 32 - Semaphores: 32 - Scheduler operations: 128 - Counters: 32 - Alarms: 32 - - - Confidence - Ave Min Max Var Ave Min Function - ====== ====== ====== ====== ========== ======== - 257.78 168.00 568.00 48.70 56% 28% Create thread - 50.21 49.60 50.40 0.29 76% 24% Yield thread [all suspended] - 36.26 36.00 36.80 0.35 68% 68% Suspend [suspended] thread - 37.20 36.80 37.60 0.40 100% 50% Resume thread - 56.24 56.00 56.80 0.34 70% 70% Set priority - 5.20 4.80 5.60 0.40 100% 50% Get priority - 122.75 122.40 123.20 0.39 56% 56% Kill [suspended] thread - 50.19 49.60 50.40 0.31 74% 26% Yield [no other] thread - 69.49 66.40 69.60 0.21 92% 2% Resume [suspended low prio] thread - 37.01 36.80 37.60 0.31 74% 74% Resume [runnable low prio] thread - 64.75 55.20 65.60 0.38 80% 2% Suspend [runnable] thread - 50.19 49.60 50.40 0.31 74% 26% Yield [only low prio] thread - 36.24 36.00 36.80 0.34 70% 70% Suspend [runnable->not runnable] - 122.75 122.40 123.20 0.39 56% 56% Kill [runnable] thread - 67.76 67.20 68.00 0.34 70% 30% Destroy [dead] thread - 167.07 158.40 168.00 0.35 92% 2% Destroy [runnable] thread - 213.49 212.00 249.60 1.46 84% 90% Resume [high priority] thread - 122.81 120.00 389.60 4.17 99% 99% Thread switch - - 4.70 4.00 4.80 0.17 87% 12% Scheduler lock - 23.70 23.20 24.00 0.37 62% 37% Scheduler unlock [0 threads] - 23.60 23.20 24.00 0.40 100% 50% Scheduler unlock [1 suspended] - 23.70 23.20 24.00 0.37 62% 37% Scheduler unlock [many suspended] - 23.60 23.20 24.00 0.40 100% 50% Scheduler unlock [many low prio] - - 15.65 15.20 16.00 0.39 56% 43% Init mutex - 42.40 42.40 42.40 0.00 100% 100% Lock [unlocked] mutex - 45.37 44.80 46.40 0.36 65% 31% Unlock [locked] mutex - 39.20 39.20 39.20 0.00 100% 100% Trylock [unlocked] mutex - 34.45 34.40 35.20 0.09 93% 93% Trylock [locked] mutex - 8.00 8.00 8.00 0.00 100% 100% Destroy mutex - 284.42 284.00 284.80 0.40 53% 46% Unlock/Lock mutex - - 29.40 28.80 29.60 0.30 75% 25% Create mbox - 3.35 3.20 4.00 0.24 81% 81% Peek [empty] mbox - 49.35 48.80 49.60 0.34 68% 31% Put [first] mbox - 3.35 3.20 4.00 0.24 81% 81% Peek [1 msg] mbox - 49.35 48.80 49.60 0.34 68% 31% Put [second] mbox - 3.35 3.20 4.00 0.24 81% 81% Peek [2 msgs] mbox - 49.15 48.80 49.60 0.39 56% 56% Get [first] mbox - 49.15 48.80 49.60 0.39 56% 56% Get [second] mbox - 47.80 47.20 48.00 0.30 75% 25% Tryput [first] mbox - 41.40 40.80 41.60 0.30 75% 25% Peek item [non-empty] mbox - 49.40 48.80 49.60 0.30 75% 25% Tryget [non-empty] mbox - 40.15 40.00 40.80 0.24 81% 81% Peek item [empty] mbox - 40.95 40.80 41.60 0.24 81% 81% Tryget [empty] mbox - 4.05 4.00 4.80 0.09 93% 93% Waiting to get mbox - 4.05 4.00 4.80 0.09 93% 93% Waiting to put mbox - 45.60 45.60 45.60 0.00 100% 100% Delete mbox - 153.27 152.80 153.60 0.39 59% 40% Put/Get mbox - - 16.80 16.80 16.80 0.00 100% 100% Init semaphore - 36.60 36.00 36.80 0.30 75% 25% Post [0] semaphore - 39.60 39.20 40.00 0.40 100% 50% Wait [1] semaphore - 34.80 34.40 35.20 0.40 100% 50% Trywait [0] semaphore - 33.35 32.80 33.60 0.34 68% 31% Trywait [1] semaphore - 10.30 9.60 10.40 0.17 87% 12% Peek semaphore - 8.80 8.80 8.80 0.00 100% 100% Destroy semaphore - 166.92 166.40 167.20 0.36 65% 34% Post/Wait semaphore - - 13.60 13.60 13.60 0.00 100% 100% Create counter - 4.85 4.80 5.60 0.09 93% 93% Get counter value - 4.80 4.80 4.80 0.00 100% 100% Set counter value - 45.25 44.80 45.60 0.39 56% 43% Tick counter - 7.75 7.20 8.00 0.34 68% 31% Delete counter - - 20.80 20.80 20.80 0.00 100% 100% Create alarm - 69.30 68.80 69.60 0.37 62% 37% Initialize alarm - 4.80 4.80 4.80 0.00 100% 100% Disable alarm - 67.35 67.20 68.00 0.24 81% 81% Enable alarm - 11.80 11.20 12.00 0.30 75% 25% Delete alarm - 54.80 54.40 55.20 0.40 100% 50% Tick counter [1 alarm] - 372.35 363.20 652.80 17.53 96% 96% Tick counter [many alarms] - 95.50 95.20 96.00 0.37 62% 62% Tick & fire counter [1 alarm] - 1757.92 1707.20 1996.80 81.43 81% 81% Tick & fire counters [>1 together] - 404.37 404.00 404.80 0.40 53% 53% Tick & fire counters [>1 separately] - 256.57 254.40 395.20 2.17 98% 97% Alarm latency [0 threads] - 296.60 255.20 359.20 23.53 53% 31% Alarm latency [2 threads] - 307.49 265.60 357.60 27.52 53% 53% Alarm latency [many threads] - 467.04 432.00 788.80 5.03 97% 1% Alarm -> thread resume latency - - 55.63 54.40 60.80 0.00 Clock/interrupt latency - - 101.23 80.80 1433.60 0.00 Clock DSR latency - - 316 316 316 (main stack: 752) Thread stack used (1120 total) -All done, main stack : stack used 752 size 2400 -All done : Interrupt stack used 288 size 4096 -All done : Idlethread stack used 272 size 2048 - -Timing complete - 30780 ms total - -PASS:<Basic timing OK> -EXIT:<done> - - - - - - - -Board: Intel IQ80310 XScale Development Kit -Board: Intel IQ80310 XScale Development Kit - -CPU: Intel XScale 600MHz - - -Startup, main stack : stack used 388 size 2400 -Startup : Interrupt stack used 148 size 4096 -Startup : Idlethread stack used 76 size 1120 - -eCos Kernel Timings -Notes: all times are in microseconds (.000001) unless otherwise stated - -Reading the hardware clock takes 73 'ticks' overhead -... this value will be factored out of all other measurements -Clock interrupt took 12.11 microseconds (399 raw clock ticks) - -Testing parameters: - Clock samples: 32 - Threads: 64 - Thread switches: 128 - Mutexes: 32 - Mailboxes: 32 - Semaphores: 32 - Scheduler operations: 128 - Counters: 32 - Alarms: 32 - - - Confidence - Ave Min Max Var Ave Min Function - ====== ====== ====== ====== ========== ======== - 6.53 5.48 8.55 0.50 53% 23% Create thread - 0.37 0.03 3.24 0.18 87% 1% Yield thread [all suspended] - 0.24 0.00 2.06 0.12 87% 1% Suspend [suspended] thread - 0.25 0.00 0.73 0.06 71% 1% Resume thread - 0.36 0.09 0.82 0.10 89% 1% Set priority - 0.03 0.00 0.42 0.05 90% 90% Get priority - 1.07 0.52 6.39 0.18 92% 1% Kill [suspended] thread - 0.33 0.06 0.91 0.08 78% 3% Yield [no other] thread - 0.55 0.03 1.06 0.09 85% 1% Resume [suspended low prio] thread - 0.28 0.00 1.79 0.11 84% 4% Resume [runnable low prio] thread - 0.43 0.00 1.00 0.12 76% 1% Suspend [runnable] thread - 0.31 0.00 1.24 0.09 82% 4% Yield [only low prio] thread - 0.21 0.00 0.42 0.04 73% 1% Suspend [runnable->not runnable] - 1.00 0.88 1.45 0.04 78% 4% Kill [runnable] thread - 0.59 0.42 3.97 0.13 81% 87% Destroy [dead] thread - 1.43 1.27 1.94 0.07 78% 7% Destroy [runnable] thread - 3.12 2.58 5.09 0.33 56% 34% Resume [high priority] thread - 0.87 0.36 1.39 0.07 86% 0% Thread switch - - 0.15 0.00 1.39 0.21 81% 81% Scheduler lock - 0.16 0.00 0.64 0.08 85% 7% Scheduler unlock [0 threads] - 0.16 0.00 0.64 0.08 75% 8% Scheduler unlock [1 suspended] - 0.16 0.00 0.70 0.08 78% 6% Scheduler unlock [many suspended] - 0.16 0.00 0.64 0.07 81% 4% Scheduler unlock [many low prio] - - 0.45 0.00 1.39 0.34 56% 46% Init mutex - 0.43 0.18 3.27 0.23 87% 87% Lock [unlocked] mutex - 0.48 0.09 3.88 0.26 84% 71% Unlock [locked] mutex - 0.35 0.21 2.24 0.21 87% 84% Trylock [unlocked] mutex - 0.26 0.00 0.67 0.13 78% 9% Trylock [locked] mutex - 0.21 0.00 1.27 0.24 78% 75% Destroy mutex - 2.58 2.09 3.09 0.13 75% 9% Unlock/Lock mutex - - 0.99 0.21 2.48 0.41 65% 28% Create mbox - 0.04 0.00 0.39 0.07 90% 87% Peek [empty] mbox - 0.47 0.27 3.48 0.29 90% 78% Put [first] mbox - 0.02 0.00 0.39 0.03 90% 90% Peek [1 msg] mbox - 0.29 0.15 0.58 0.04 68% 3% Put [second] mbox - 0.02 0.00 0.45 0.04 93% 93% Peek [2 msgs] mbox - 0.48 0.21 3.67 0.26 84% 87% Get [first] mbox - 0.35 0.09 0.82 0.11 75% 3% Get [second] mbox - 0.50 0.21 3.18 0.33 90% 68% Tryput [first] mbox - 0.39 0.15 1.39 0.19 78% 68% Peek item [non-empty] mbox - 0.43 0.18 3.33 0.23 87% 90% Tryget [non-empty] mbox - 0.28 0.03 0.79 0.06 68% 3% Peek item [empty] mbox - 0.28 0.21 0.58 0.05 71% 65% Tryget [empty] mbox - 0.01 0.00 0.36 0.02 96% 90% Waiting to get mbox - 0.05 0.00 0.45 0.09 87% 84% Waiting to put mbox - 0.42 0.09 2.88 0.20 84% 12% Delete mbox - 1.39 1.27 2.39 0.14 87% 87% Put/Get mbox - - 0.35 0.00 1.36 0.45 75% 68% Init semaphore - 0.19 0.00 0.45 0.04 81% 3% Post [0] semaphore - 0.25 0.21 0.88 0.06 84% 81% Wait [1] semaphore - 0.32 0.06 1.79 0.21 78% 68% Trywait [0] semaphore - 0.20 0.00 0.52 0.06 62% 3% Trywait [1] semaphore - 0.07 0.00 0.45 0.10 84% 81% Peek semaphore - 0.06 0.00 0.52 0.06 71% 78% Destroy semaphore - 1.45 1.42 1.79 0.04 87% 87% Post/Wait semaphore - - 0.70 0.00 2.88 0.47 43% 34% Create counter - 0.05 0.00 0.42 0.09 87% 84% Get counter value - 0.02 0.00 0.45 0.04 93% 93% Set counter value - 0.38 0.12 0.58 0.06 59% 3% Tick counter - 0.03 0.00 0.48 0.05 93% 78% Delete counter - - 1.10 0.39 4.30 0.47 62% 53% Create alarm - 0.58 0.03 3.12 0.18 87% 3% Initialize alarm - 0.04 0.00 0.42 0.07 90% 90% Disable alarm - 0.54 0.36 1.36 0.12 84% 43% Enable alarm - 0.03 0.00 0.70 0.06 84% 84% Delete alarm - 0.50 0.24 0.97 0.08 84% 6% Tick counter [1 alarm] - 5.30 5.12 5.97 0.14 84% 75% Tick counter [many alarms] - 0.82 0.64 1.36 0.11 78% 43% Tick & fire counter [1 alarm] - 14.13 13.85 14.55 0.09 78% 3% Tick & fire counters [>1 together] - 5.56 5.45 6.00 0.09 78% 71% Tick & fire counters [>1 separately] - 9.69 9.45 12.52 0.22 64% 71% Alarm latency [0 threads] - 9.98 9.48 12.76 0.23 69% 14% Alarm latency [2 threads] - 10.38 9.48 24.67 0.59 74% 45% Alarm latency [many threads] - 11.72 11.30 21.33 0.32 81% 58% Alarm -> thread resume latency - - 1.87 1.82 10.42 0.00 Clock/interrupt latency - - 3.02 2.58 7.67 0.00 Clock DSR latency - - 9 0 260 (main stack: 776) Thread stack used (1120 total) -All done, main stack : stack used 776 size 2400 -All done : Interrupt stack used 268 size 4096 -All done : Idlethread stack used 244 size 1120 - -Timing complete - 30300 ms total - -PASS:<Basic timing OK> -EXIT:<done> - - - - - - - -Board: Toshiba JMR3904 Evaluation Board - - -Board: Toshiba JMR3904 Evaluation Board - -CPU : TMPR3904F 50MHz - - -eCOS Kernel Timings -Note: all times are in microseconds (.000001) unless otherwise stated - -Reading the hardware clock takes 0 'ticks' overhead -... this value will be factored out of all other measurements -Clock interrupt took 29.68 microseconds (45 raw clock ticks) - -Testing parameters: - Clock samples: 32 - Threads: 24 - Thread switches: 128 - Mutexes: 32 - Mailboxes: 32 - Semaphores: 32 - Scheduler operations: 128 - Counters: 32 - Alarms: 32 - - - Confidence - Ave Min Max Var Ave Min Function - ====== ====== ====== ====== ========== ======== - 13.62 11.72 27.99 1.51 79% 54% Create thread - 2.77 2.60 3.91 0.26 79% 79% Yield thread [all suspended] - 3.31 2.60 6.51 0.27 83% 12% Suspend [suspended] thread - 2.58 1.95 7.81 0.47 58% 37% Resume thread - 4.94 4.56 11.07 0.60 95% 79% Set priority - 0.71 0.65 1.95 0.10 95% 95% Get priority - 14.97 14.32 25.39 0.87 95% 95% Kill [suspended] thread - 2.25 1.95 9.11 0.57 95% 95% Yield [no other] thread - 7.27 6.51 12.37 0.42 79% 16% Resume [suspended low prio] thread - 2.28 1.95 7.16 0.51 95% 79% Resume [runnable low prio] thread - 4.31 3.26 12.37 0.75 87% 79% Suspend [runnable] thread - 2.17 1.95 7.16 0.42 95% 95% Yield [only low prio] thread - 2.39 1.95 6.51 0.51 95% 58% Suspend [runnable->not runnable] - 13.43 12.37 22.79 0.80 91% 91% Kill [runnable] thread - 22.30 20.83 37.76 1.76 91% 91% Resume [high priority] thread - 4.62 4.56 11.07 0.13 98% 98% Thread switch - - 1.51 1.30 2.60 0.29 68% 68% Scheduler lock - 2.36 1.95 3.26 0.31 61% 37% Scheduler unlock [0 threads] - 2.39 1.95 5.21 0.32 62% 36% Scheduler unlock [1 suspended] - 2.38 1.95 4.56 0.32 61% 37% Scheduler unlock [many suspended] - 2.38 1.95 5.21 0.32 61% 37% Scheduler unlock [many low prio] - - 0.90 0.65 3.26 0.35 71% 71% Init mutex - 2.48 1.95 8.46 0.50 50% 46% Lock [unlocked] mutex - 2.83 2.60 9.11 0.42 93% 93% Unlock [locked] mutex - 2.30 1.95 6.51 0.45 96% 65% Trylock [unlocked] mutex - 1.99 1.30 5.86 0.24 84% 12% Trylock [locked] mutex - 0.04 0.00 1.30 0.08 96% 96% Destroy mutex - 42.40 42.32 44.92 0.16 96% 96% Unlock/Lock mutex - - 1.44 1.30 5.86 0.28 96% 96% Create mbox - 0.51 0.00 1.30 0.25 71% 25% Peek [empty] mbox - 2.93 2.60 9.11 0.51 96% 78% Put [first] mbox - 0.51 0.00 1.30 0.25 71% 25% Peek [1 msg] mbox - 4.19 3.91 5.21 0.34 59% 59% Put [second] mbox - 0.45 0.00 0.65 0.28 68% 31% Peek [2 msgs] mbox - 3.28 2.60 10.42 0.45 65% 31% Get [first] mbox - 3.34 2.60 9.77 0.40 78% 18% Get [second] mbox - 2.69 1.95 9.11 0.40 78% 18% Tryput [first] mbox - 2.75 1.95 7.81 0.32 93% 3% Peek item [non-empty] mbox - 3.15 2.60 9.11 0.48 53% 43% Tryget [non-empty] mbox - 2.22 1.95 6.51 0.41 96% 78% Peek item [empty] mbox - 2.40 1.95 5.86 0.42 50% 46% Tryget [empty] mbox - 0.47 0.00 0.65 0.26 71% 28% Waiting to get mbox - 0.59 0.00 1.30 0.15 84% 12% Waiting to put mbox - 4.01 3.26 10.42 0.40 81% 15% Delete mbox - 26.18 26.04 30.60 0.28 96% 96% Put/Get mbox - - 0.92 0.65 3.91 0.38 71% 71% Init semaphore - 2.24 1.95 6.51 0.43 96% 75% Post [0] semaphore - 2.32 1.95 7.16 0.48 96% 65% Wait [1] semaphore - 2.03 1.30 5.86 0.24 90% 6% Trywait [0] semaphore - 1.91 1.30 4.56 0.23 78% 18% Trywait [1] semaphore - 0.77 0.00 1.95 0.30 65% 9% Peek semaphore - 0.61 0.00 1.95 0.15 84% 12% Destroy semaphore - 22.62 22.14 30.60 0.61 96% 62% Post/Wait semaphore - - 0.92 0.65 3.91 0.38 71% 71% Create counter - 0.69 0.65 1.95 0.08 96% 96% Get counter value - 0.41 0.00 1.30 0.33 56% 40% Set counter value - 3.21 2.60 5.86 0.27 71% 21% Tick counter - 0.65 0.00 3.26 0.16 84% 12% Delete counter - - 1.57 1.30 4.56 0.38 71% 71% Create alarm - 4.52 3.91 13.02 0.57 50% 46% Initialize alarm - 0.61 0.00 1.95 0.15 84% 12% Disable alarm - 4.43 3.91 9.11 0.43 56% 40% Enable alarm - 0.87 0.65 2.60 0.32 71% 71% Delete alarm - 2.93 2.60 6.51 0.43 96% 65% Tick counter [1 alarm] - 14.83 14.32 22.79 0.60 96% 59% Tick counter [many alarms] - 4.88 4.56 11.07 0.51 96% 78% Tick & fire counter [1 alarm] - 83.25 82.03 102.86 1.23 96% 93% Tick & fire counters [>1 together] - 17.58 16.93 27.34 0.61 50% 46% Tick & fire counters [>1 separately] - 26.18 24.74 40.36 0.30 97% 0% Alarm latency [0 threads] - 33.88 29.30 56.64 1.70 85% 6% Alarm latency [2 threads] - 36.37 29.30 61.20 3.25 53% 24% Alarm latency [many threads] - - 7.85 6.51 14.97 0.00 Clock/interrupt latency - -Timing complete - 23540 ms total - -PASS:<Basic timing OK> -EXIT:<done> - - - - - - - -Board: Toshiba REF 4955 - - -Board: Toshiba REF 4955 - -CPU : Toshiba TX4955 66MHz - -Startup, main stack : stack used 960 size 2936 -Startup : Interrupt stack used 168 size 4096 -Startup : Idlethread stack used 372 size 2048 - -eCos Kernel Timings -Notes: all times are in microseconds (.000001) unless otherwise stated - -Reading the hardware clock takes 3 `ticks' overhead -... this value will be factored out of all other measurements -Clock interrupt took 4.00 microseconds (264 raw clock ticks) - -Testing parameters: - Clock samples: 32 - Threads: 64 - Thread switches: 128 - Mutexes: 32 - Mailboxes: 32 - Semaphores: 32 - Scheduler operations: 128 - Counters: 32 - Alarms: 32 - - - Confidence - Ave Min Max Var Ave Min Function - ====== ====== ====== ====== ========== ======== - 11.21 9.58 14.11 0.95 48% 34% Create thread - 0.66 0.65 1.29 0.02 98% 98% Yield thread [all suspended] - 0.63 0.53 3.06 0.17 82% 82% Suspend [suspended] thread - 0.54 0.53 1.06 0.02 98% 98% Resume thread - 0.78 0.74 1.39 0.05 93% 93% Set priority - 0.05 0.05 0.36 0.01 98% 98% Get priority - 2.06 1.89 6.65 0.25 95% 79% Kill [suspended] thread - 0.65 0.65 0.68 0.00 98% 98% Yield [no other] thread - 1.15 1.02 3.03 0.20 81% 81% Resume [suspended low prio] thread - 0.54 0.52 1.18 0.03 96% 96% Resume [runnable low prio] thread - 0.94 0.88 1.27 0.01 95% 1% Suspend [runnable] thread - 0.65 0.65 0.68 0.00 98% 98% Yield [only low prio] thread - 0.54 0.53 0.86 0.01 98% 96% Suspend [runnable->not runnable] - 1.97 1.89 2.98 0.12 84% 84% Kill [runnable] thread - 1.03 0.92 4.94 0.17 89% 89% Destroy [dead] thread - 2.55 2.33 4.38 0.24 89% 70% Destroy [runnable] thread - 5.62 4.11 13.23 0.99 65% 40% Resume [high priority] thread - 1.84 1.83 2.79 0.02 98% 98% Thread switch - - 0.12 0.02 0.65 0.15 74% 74% Scheduler lock - 0.35 0.35 0.35 0.00 100% 100% Scheduler unlock [0 threads] - 0.35 0.35 0.35 0.00 100% 100% Scheduler unlock [1 suspended] - 0.43 0.35 1.17 0.13 78% 78% Scheduler unlock [many suspended] - 0.45 0.35 1.17 0.15 75% 75% Scheduler unlock [many low prio] - - 0.46 0.15 3.38 0.30 62% 50% Init mutex - 0.73 0.64 3.27 0.16 96% 96% Lock [unlocked] mutex - 0.77 0.65 4.50 0.23 96% 96% Unlock [locked] mutex - 0.58 0.55 1.42 0.05 96% 96% Trylock [unlocked] mutex - 0.51 0.50 0.83 0.02 96% 96% Trylock [locked] mutex - 0.12 0.11 0.41 0.02 96% 96% Destroy mutex - 4.72 4.70 5.58 0.05 96% 96% Unlock/Lock mutex - - 1.01 0.67 3.48 0.40 71% 71% Create mbox - 0.02 0.00 0.53 0.03 96% 96% Peek [empty] mbox - 0.89 0.68 4.20 0.29 96% 71% Put [first] mbox - 0.02 0.00 0.33 0.02 96% 96% Peek [1 msg] mbox - 0.69 0.68 0.76 0.01 50% 46% Put [second] mbox - 0.02 0.00 0.30 0.02 96% 96% Peek [2 msgs] mbox - 0.81 0.71 3.83 0.19 96% 96% Get [first] mbox - 0.72 0.71 1.02 0.02 96% 96% Get [second] mbox - 0.81 0.65 2.74 0.22 96% 71% Tryput [first] mbox - 0.67 0.62 2.27 0.10 96% 96% Peek item [non-empty] mbox - 0.77 0.71 2.41 0.10 96% 96% Tryget [non-empty] mbox - 0.59 0.58 0.88 0.02 96% 96% Peek item [empty] mbox - 0.62 0.62 0.67 0.00 96% 96% Tryget [empty] mbox - 0.03 0.02 0.32 0.02 96% 96% Waiting to get mbox - 0.02 0.02 0.06 0.01 50% 46% Waiting to put mbox - 0.75 0.65 3.59 0.18 96% 96% Delete mbox - 2.80 2.77 3.59 0.05 96% 96% Put/Get mbox - - 0.37 0.18 0.88 0.28 71% 71% Init semaphore - 0.48 0.47 0.80 0.02 96% 96% Post [0] semaphore - 0.60 0.59 0.67 0.01 50% 46% Wait [1] semaphore - 0.53 0.50 1.41 0.06 96% 96% Trywait [0] semaphore - 0.51 0.50 0.71 0.01 96% 50% Trywait [1] semaphore - 0.09 0.09 0.15 0.00 96% 96% Peek semaphore - 0.12 0.11 0.41 0.02 96% 96% Destroy semaphore - 3.05 3.05 3.05 0.00 100% 100% Post/Wait semaphore - - 0.57 0.17 2.76 0.24 59% 25% Create counter - 0.06 0.05 0.58 0.03 96% 96% Get counter value - 0.06 0.03 0.64 0.04 96% 96% Set counter value - 0.73 0.71 1.02 0.02 96% 96% Tick counter - 0.12 0.11 0.15 0.01 50% 46% Delete counter - - 0.89 0.64 3.15 0.34 84% 71% Create alarm - 1.00 0.95 2.41 0.09 96% 96% Initialize alarm - 0.09 0.06 0.68 0.04 96% 96% Disable alarm - 1.05 1.00 2.48 0.09 96% 96% Enable alarm - 0.18 0.17 0.50 0.02 96% 96% Delete alarm - 0.90 0.89 1.11 0.01 96% 96% Tick counter [1 alarm] - 5.60 5.59 5.88 0.02 96% 96% Tick counter [many alarms] - 1.53 1.52 2.11 0.04 96% 96% Tick & fire counter [1 alarm] - 25.48 25.47 25.76 0.02 96% 96% Tick & fire counters [>1 together] - 6.22 6.21 6.44 0.01 96% 96% Tick & fire counters [>1 separately] - 2.59 2.56 6.17 0.07 98% 98% Alarm latency [0 threads] - 4.06 3.95 6.24 0.08 78% 57% Alarm latency [2 threads] - 5.03 2.56 9.03 0.89 59% 10% Alarm latency [many threads] - 5.68 5.59 15.45 0.15 99% 99% Alarm -> thread resume latency - - 2.52 1.41 8.12 0.00 Clock/interrupt latency - - 2.05 1.17 6.00 0.00 Clock DSR latency - - 34 0 1072 (main stack: 1320) Thread stack used (1912 total) -All done, main stack : stack used 1320 size 2936 -All done : Interrupt stack used 136 size 4096 -All done : Idlethread stack used 996 size 2048 - -Timing complete - 30360 ms total - -PASS:<Basic timing OK> -EXIT:<done> - - - - - - - -Board: Matsushita STDEVAL1 Board - - -Board: Matsushita STDEVAL1 Board - -CPU : MN103002A 60MHz - -eCOS Kernel Timings -Note: all times are in microseconds (.000001) unless otherwise stated - -Reading the hardware clock takes 18 'ticks' overhead -... this value will be factored out of all other measurements -Clock interrupt took 13.73 microseconds (205 raw clock ticks) - -Testing parameters: - Clock samples: 32 - Threads: 24 - Thread switches: 128 - Mutexes: 32 - Mailboxes: 32 - Semaphores: 32 - Scheduler operations: 128 - Counters: 32 - Alarms: 32 - - - Confidence - Ave Min Max Var Ave Min Function - ====== ====== ====== ====== ========== ======== - 14.36 11.53 23.53 1.81 54% 33% Create thread - 2.64 2.53 5.07 0.20 95% 95% Yield thread [all suspended] - 2.25 1.93 4.80 0.31 45% 83% Suspend [suspended] thread - 2.19 2.00 4.93 0.28 91% 91% Resume thread - 3.42 3.00 8.40 0.47 95% 87% Set priority - 0.31 0.13 1.20 0.19 79% 58% Get priority - 8.26 7.40 18.80 0.93 95% 87% Kill [suspended] thread - 2.58 2.47 5.13 0.21 95% 95% Yield [no other] thread - 5.07 4.53 8.67 0.44 62% 50% Resume [suspended low prio] thread - 2.27 2.07 4.53 0.23 87% 87% Resume [runnable low prio] thread - 4.76 4.07 9.40 0.65 66% 75% Suspend [runnable] thread - 2.63 2.53 4.73 0.18 95% 95% Yield [only low prio] thread - 2.09 1.87 4.27 0.27 91% 79% Suspend [runnable->not runnable] - 10.79 10.00 18.20 0.81 95% 79% Kill [runnable] thread - 20.30 18.40 28.80 1.42 79% 54% Resume [high priority] thread - 5.53 5.47 12.13 0.11 98% 97% Thread switch - - 0.28 0.27 2.20 0.03 97% 97% Scheduler lock - 1.14 1.13 2.00 0.01 99% 99% Scheduler unlock [0 threads] - 1.14 1.13 2.40 0.02 99% 99% Scheduler unlock [1 suspended] - 1.16 1.13 3.33 0.06 95% 95% Scheduler unlock [many suspended] - 1.23 1.20 3.13 0.05 95% 95% Scheduler unlock [many low prio] - - 1.29 1.00 4.20 0.25 65% 50% Init mutex - 2.65 2.47 5.27 0.23 93% 87% Lock [unlocked] mutex - 3.26 3.07 6.80 0.28 93% 87% Unlock [locked] mutex - 2.48 2.33 5.07 0.21 90% 87% Trylock [unlocked] mutex - 2.20 2.07 4.67 0.21 93% 87% Trylock [locked] mutex - 0.23 0.20 1.00 0.05 96% 93% Destroy mutex - 25.11 24.73 27.53 0.21 65% 31% Unlock/Lock mutex - - 2.49 2.00 5.73 0.32 81% 37% Create mbox - 0.11 0.00 1.60 0.15 84% 81% Peek [empty] mbox - 3.01 2.60 9.47 0.52 96% 78% Put [first] mbox - 0.10 0.00 1.67 0.15 87% 81% Peek [1 msg] mbox - 3.09 2.60 8.33 0.50 93% 75% Put [second] mbox - 0.06 0.00 1.13 0.08 96% 87% Peek [2 msgs] mbox - 3.10 2.80 7.93 0.40 93% 84% Get [first] mbox - 3.13 2.80 7.53 0.43 90% 78% Get [second] mbox - 2.99 2.60 8.53 0.52 93% 75% Tryput [first] mbox - 2.65 2.33 6.80 0.42 90% 78% Peek item [non-empty] mbox - 3.05 2.73 7.60 0.42 93% 78% Tryget [non-empty] mbox - 3.16 2.93 6.27 0.31 84% 84% Peek item [empty] mbox - 2.48 2.27 5.73 0.30 84% 84% Tryget [empty] mbox - 0.23 0.13 2.07 0.14 96% 87% Waiting to get mbox - 0.22 0.13 1.93 0.13 96% 75% Waiting to put mbox - 3.08 2.80 7.93 0.42 84% 84% Delete mbox - 16.01 15.53 19.00 0.52 78% 59% Put/Get mbox - - 0.85 0.67 3.27 0.19 96% 50% Init semaphore - 2.00 1.93 3.87 0.12 96% 90% Post [0] semaphore - 2.05 2.00 3.47 0.09 96% 96% Wait [1] semaphore - 1.85 1.80 3.47 0.10 96% 96% Trywait [0] semaphore - 1.82 1.80 2.53 0.04 96% 96% Trywait [1] semaphore - 0.36 0.33 1.33 0.06 96% 96% Peek semaphore - 0.38 0.33 1.87 0.09 96% 96% Destroy semaphore - 12.38 12.20 16.27 0.30 93% 87% Post/Wait semaphore - - 1.18 0.73 4.07 0.24 78% 18% Create counter - 0.20 0.13 1.40 0.11 87% 87% Get counter value - 0.24 0.20 1.40 0.08 93% 93% Set counter value - 3.17 3.13 4.20 0.07 93% 93% Tick counter - 0.44 0.40 1.73 0.08 96% 96% Delete counter - - 2.24 1.67 5.13 0.47 68% 65% Create alarm - 3.86 3.40 9.67 0.51 90% 78% Initialize alarm - 0.15 0.07 1.60 0.12 96% 68% Disable alarm - 3.76 3.47 7.67 0.35 93% 75% Enable alarm - 0.57 0.47 2.73 0.16 96% 84% Delete alarm - 3.64 3.60 4.73 0.07 96% 96% Tick counter [1 alarm] - 21.72 21.67 23.27 0.10 96% 96% Tick counter [many alarms] - 6.13 6.07 8.07 0.12 96% 96% Tick & fire counter [1 alarm] - 101.40 99.53 132.73 2.75 93% 93% Tick & fire counters [>1 together] - 24.21 24.13 26.40 0.14 96% 96% Tick & fire counters [>1 separately] - 11.74 11.60 22.67 0.26 98% 98% Alarm latency [0 threads] - 14.58 11.73 24.93 1.59 54% 28% Alarm latency [2 threads] - 18.18 15.20 41.07 1.96 60% 43% Alarm latency [many threads] - - 3.06 2.13 10.33 0.00 Clock/interrupt latency - -Timing complete - 23480 ms total - -PASS:<Basic timing OK> -EXIT:<done> - - - - - - - -Board: Fujitsu SPARClite Evaluation Board - - -Board: Fujitsu SPARClite Evaluation Board - -CPU : Fujitsu SPARClite MB8683X 100MHz - - -eCOS Kernel Timings -Note: all times are in microseconds (.000001) unless otherwise stated - -Reading the hardware clock takes 0 'ticks' overhead -... this value will be factored out of all other measurements -Clock interrupt took 17.19 microseconds (17 raw clock ticks) - -Testing parameters: - Clock samples: 32 - Threads: 24 - Thread switches: 128 - Mutexes: 32 - Mailboxes: 32 - Semaphores: 32 - Scheduler operations: 128 - Counters: 32 - Alarms: 32 - - - Confidence - Ave Min Max Var Ave Min Function - ====== ====== ====== ====== ========== ======== - 48.59 47.00 63.01 1.41 66% 70% Create thread - 2.13 2.00 5.00 0.24 95% 95% Yield thread [all suspended] - 2.92 2.00 10.00 0.69 58% 37% Suspend [suspended] thread - 2.13 1.00 10.00 0.66 75% 20% Resume thread - 2.79 2.00 11.00 0.86 95% 54% Set priority - 1.00 0.00 5.00 0.33 79% 16% Get priority - 7.17 5.00 34.00 2.24 95% 95% Kill [suspended] thread - 2.42 2.00 12.00 0.80 95% 95% Yield [no other] thread - 3.46 2.00 14.00 1.10 75% 83% Resume [suspended low prio] thread - 2.00 1.00 9.00 0.58 66% 29% Resume [runnable low prio] thread - 4.21 3.00 20.00 1.38 95% 91% Suspend [runnable] thread - 2.33 2.00 10.00 0.64 95% 95% Yield [only low prio] thread - 2.00 1.00 9.00 0.67 58% 33% Suspend [runnable->not runnable] - 5.79 4.00 30.00 2.07 95% 95% Kill [runnable] thread - 39.34 37.00 75.01 3.36 91% 91% Resume [high priority] thread - 15.20 15.00 31.00 0.40 97% 97% Thread switch - - 1.04 1.00 4.00 0.08 97% 97% Scheduler lock - 1.42 1.00 5.00 0.51 60% 60% Scheduler unlock [0 threads] - 1.41 1.00 5.00 0.50 61% 61% Scheduler unlock [1 suspended] - 1.41 1.00 5.00 0.50 60% 60% Scheduler unlock [many suspended] - 1.40 1.00 5.00 0.50 62% 62% Scheduler unlock [many low prio] - - 1.19 1.00 6.00 0.35 93% 93% Init mutex - 2.34 2.00 12.00 0.64 93% 93% Lock [unlocked] mutex - 3.41 3.00 13.00 0.71 96% 87% Unlock [locked] mutex - 2.16 1.00 10.00 0.49 87% 9% Trylock [unlocked] mutex - 1.78 1.00 7.00 0.59 59% 37% Trylock [locked] mutex - 0.72 0.00 2.00 0.45 65% 31% Destroy mutex - 25.25 24.00 41.00 0.98 71% 25% Unlock/Lock mutex - - 1.44 1.00 9.00 0.68 96% 78% Create mbox - 0.94 0.00 3.00 0.23 84% 12% Peek [empty] mbox - 3.06 2.00 13.00 0.62 71% 25% Put [first] mbox - 0.69 0.00 3.00 0.52 59% 37% Peek [1 msg] mbox - 2.44 2.00 10.00 0.68 96% 78% Put [second] mbox - 0.78 0.00 3.00 0.44 68% 28% Peek [2 msgs] mbox - 3.78 3.00 14.00 0.83 96% 53% Get [first] mbox - 2.97 2.00 9.00 0.61 56% 31% Get [second] mbox - 2.53 2.00 12.00 0.80 96% 75% Tryput [first] mbox - 2.72 2.00 12.00 0.81 96% 56% Peek item [non-empty] mbox - 2.63 2.00 13.00 0.94 90% 75% Tryget [non-empty] mbox - 1.97 1.00 6.00 0.42 68% 21% Peek item [empty] mbox - 2.09 1.00 9.00 0.49 78% 15% Tryget [empty] mbox - 0.84 0.00 4.00 0.42 71% 25% Waiting to get mbox - 0.81 0.00 4.00 0.46 68% 28% Waiting to put mbox - 2.38 2.00 11.00 0.66 96% 87% Delete mbox - 23.41 22.00 47.00 1.47 96% 96% Put/Get mbox - - 1.03 0.00 6.00 0.31 84% 12% Init semaphore - 2.66 2.00 8.00 0.66 96% 50% Post [0] semaphore - 1.97 1.00 10.00 0.55 68% 28% Wait [1] semaphore - 1.78 1.00 8.00 0.63 56% 40% Trywait [0] semaphore - 1.84 1.00 8.00 0.58 62% 34% Trywait [1] semaphore - 1.00 0.00 5.00 0.25 84% 12% Peek semaphore - 0.81 0.00 4.00 0.46 68% 28% Destroy semaphore - 19.03 18.00 41.00 1.37 96% 96% Post/Wait semaphore - - 1.38 1.00 6.00 0.56 75% 75% Create counter - 1.09 1.00 3.00 0.18 93% 93% Get counter value - 1.00 0.00 5.00 0.31 78% 15% Set counter value - 3.09 2.00 6.00 0.35 78% 9% Tick counter - 0.91 0.00 5.00 0.40 75% 21% Delete counter - - 2.53 2.00 9.00 0.70 96% 65% Create alarm - 6.03 5.00 22.00 1.00 50% 46% Initialize alarm - 0.78 0.00 4.00 0.49 65% 31% Disable alarm - 2.91 2.00 13.00 0.91 87% 50% Enable alarm - 0.97 0.00 5.00 0.30 81% 15% Delete alarm - 2.69 2.00 9.00 0.69 96% 50% Tick counter [1 alarm] - 12.00 11.00 23.00 0.69 62% 34% Tick counter [many alarms] - 4.16 3.00 13.00 0.55 84% 12% Tick & fire counter [1 alarm] - 72.69 72.01 87.01 1.03 96% 96% Tick & fire counters [>1 together] - 13.66 13.00 23.00 0.82 96% 62% Tick & fire counters [>1 separately] - 13.26 13.00 42.00 0.51 98% 98% Alarm latency [0 threads] - 16.75 11.00 53.01 2.78 64% 16% Alarm latency [2 threads] - 24.06 18.00 58.01 3.55 67% 25% Alarm latency [many threads] - - 3.61 2.00 13.00 0.00 Clock/interrupt latency - -Timing complete - 23590 ms total - -PASS:<Basic timing OK> -EXIT:<done> - - - - - - - -Board: Cogent CMA MPC860 (PowerPC) Evaluation -Board: Cogent CMA MPC860 (PowerPC) Evaluation -CPU : MPC860, revision A3 33MHz - - -eCOS Kernel Timings -Note: all times are in microseconds (.000001) unless otherwise stated - -Reading the hardware clock takes 0 'ticks' overhead -... this value will be factored out of all other measurements -Clock interrupt took 14.46 microseconds (30 raw clock ticks) - -Testing parameters: - Clock samples: 32 - Threads: 24 - Thread switches: 128 - Mutexes: 32 - Mailboxes: 32 - Semaphores: 32 - Scheduler operations: 128 - Counters: 32 - Alarms: 32 - - - - - - Confidence - Ave Min Max Var Ave Min Function - ====== ====== ====== ====== ========== ======== - 26.78 23.52 41.76 1.97 66% 37% Create thread - 4.00 3.84 4.80 0.23 70% 70% Yield thread [all suspended] - 3.78 3.36 7.68 0.38 50% 45% Suspend [suspended] thread - 3.56 3.36 7.68 0.37 95% 91% Resume thread - 5.28 4.32 12.96 0.76 83% 66% Set priority - 0.84 0.48 3.84 0.39 91% 54% Get priority - 11.76 10.08 32.16 1.70 95% 95% Kill [suspended] thread - 4.14 3.84 8.64 0.45 95% 75% Yield [no other] thread - 7.14 5.76 17.76 1.07 79% 70% Resume [suspended low prio] thread - 3.60 3.36 8.16 0.42 95% 87% Resume [runnable low prio] thread - 6.10 5.28 14.88 0.80 62% 70% Suspend [runnable] thread - 4.00 3.84 5.76 0.25 79% 79% Yield [only low prio] thread - 3.66 3.36 8.64 0.47 95% 79% Suspend [runnable->not runnable] - 11.66 10.08 30.24 1.58 79% 91% Kill [runnable] thread - 31.12 27.84 53.28 2.35 87% 50% Resume [high priority] thread - 7.52 7.20 15.84 0.30 50% 48% Thread switch - - 1.00 0.48 2.88 0.21 63% 14% Scheduler lock - 2.57 2.40 3.84 0.23 65% 65% Scheduler unlock [0 threads] - 2.58 2.40 4.32 0.23 64% 64% Scheduler unlock [1 suspended] - 2.59 2.40 4.32 0.24 62% 62% Scheduler unlock [many suspended] - 2.59 2.40 4.32 0.24 61% 61% Scheduler unlock [many low prio] - - 1.69 1.44 5.76 0.37 96% 71% Init mutex - 4.15 3.84 10.56 0.47 96% 75% Lock [unlocked] mutex - 5.82 5.28 10.56 0.38 62% 28% Unlock [locked] mutex - 3.70 3.36 8.64 0.41 96% 59% Trylock [unlocked] mutex - 3.42 2.88 6.72 0.26 75% 15% Trylock [locked] mutex - 0.36 0.00 1.92 0.25 62% 34% Destroy mutex - 43.41 42.72 45.12 0.34 81% 3% Unlock/Lock mutex - - 3.27 2.88 8.16 0.39 96% 50% Create mbox - 0.57 0.00 2.40 0.34 50% 21% Peek [empty] mbox - 6.16 5.76 11.04 0.48 87% 87% Put [first] mbox - 0.48 0.00 1.92 0.27 50% 28% Peek [1 msg] mbox - 5.92 5.28 10.56 0.35 90% 6% Put [second] mbox - 0.60 0.00 2.40 0.30 62% 12% Peek [2 msgs] mbox - 4.69 4.32 12.00 0.54 93% 93% Get [first] mbox - 4.68 4.32 11.52 0.52 93% 93% Get [second] mbox - 5.86 5.28 11.04 0.47 62% 31% Tryput [first] mbox - 4.00 3.36 9.12 0.38 87% 9% Peek item [non-empty] mbox - 4.59 3.84 12.48 0.61 71% 75% Tryget [non-empty] mbox - 3.75 3.36 7.68 0.34 53% 43% Peek item [empty] mbox - 3.93 3.36 9.60 0.45 65% 31% Tryget [empty] mbox - 0.63 0.00 2.40 0.28 68% 6% Waiting to get mbox - 0.54 0.00 1.92 0.19 75% 9% Waiting to put mbox - 4.84 4.32 12.00 0.47 56% 40% Delete mbox - 24.18 23.52 29.76 0.66 81% 75% Put/Get mbox - - 1.72 0.96 3.84 0.33 90% 6% Init semaphore - 3.15 2.88 6.24 0.34 96% 62% Post [0] semaphore - 3.85 3.36 8.64 0.30 68% 28% Wait [1] semaphore - 3.24 2.88 6.24 0.34 46% 46% Trywait [0] semaphore - 3.22 2.88 6.24 0.32 50% 46% Trywait [1] semaphore - 0.96 0.48 2.88 0.12 84% 12% Peek semaphore - 0.99 0.96 1.92 0.06 96% 96% Destroy semaphore - 24.71 24.00 28.80 0.40 87% 6% Post/Wait semaphore - - 2.31 1.44 6.24 0.77 46% 56% Create counter - 0.45 0.00 0.96 0.08 87% 9% Get counter value - 0.42 0.00 0.96 0.16 75% 18% Set counter value - 4.14 3.84 4.80 0.26 50% 43% Tick counter - 0.91 0.48 2.40 0.19 71% 21% Delete counter - - 5.23 4.32 7.68 0.61 65% 53% Create alarm - 5.58 4.80 12.96 0.72 68% 84% Initialize alarm - 0.75 0.48 1.92 0.30 90% 56% Disable alarm - 8.02 7.20 14.40 0.53 84% 68% Enable alarm - 1.32 0.96 3.84 0.29 56% 40% Delete alarm - 4.63 4.32 6.24 0.28 53% 43% Tick counter [1 alarm] - 23.67 23.52 25.44 0.23 78% 78% Tick counter [many alarms] - 7.24 6.72 10.56 0.21 84% 12% Tick & fire counter [1 alarm] - 106.83 106.56 110.40 0.35 96% 65% Tick & fire counters [>1 together] - 26.18 25.44 29.76 0.46 81% 9% Tick & fire counters [>1 separately] - 10.79 10.08 29.28 0.66 53% 55% Alarm latency [0 threads] - 17.20 13.92 35.52 1.48 67% 21% Alarm latency [2 threads] - 29.69 22.56 47.04 3.58 57% 17% Alarm latency [many threads] - - 7.66 3.84 19.20 0.00 Clock/interrupt latency - -Timing complete - 23530 ms total - -PASS:<Basic timing OK> -EXIT:<done> - - - - - - - -Board: NEC VR4373 - - -Board: NEC VR4373 - -CPU : NEC VR4300 133MHz - - -Startup, main stack : stack used 1304 size 3576 -Startup : Interrupt stack used 980 size 4096 -Startup : Idlethread stack used 494 size 2552 - -eCos Kernel Timings -Notes: all times are in microseconds (.000001) unless otherwise stated - -Reading the hardware clock takes 3 `ticks' overhead -... this value will be factored out of all other measurements -Clock interrupt took 6.49 microseconds (431 raw clock ticks) - -Testing parameters: - Clock samples: 32 - Threads: 16 - Thread switches: 128 - Mutexes: 32 - Mailboxes: 32 - Semaphores: 32 - Scheduler operations: 128 - Counters: 32 - Alarms: 32 - - - Confidence - Ave Min Max Var Ave Min Function - ====== ====== ====== ====== ========== ======== - 17.21 16.18 22.14 0.88 75% 68% Create thread - 0.84 0.78 1.29 0.10 81% 81% Yield thread [all suspended] - 0.90 0.62 3.20 0.35 87% 87% Suspend [suspended] thread - 0.74 0.65 1.16 0.12 81% 68% Resume thread - 1.11 0.90 1.70 0.25 75% 68% Set priority - 0.11 0.05 0.35 0.09 75% 75% Get priority - 2.93 2.24 8.27 0.78 93% 75% Kill [suspended] thread - 0.88 0.78 1.92 0.16 93% 81% Yield [no other] thread - 1.82 1.20 4.71 0.62 87% 62% Resume [suspended low prio] thread - 0.70 0.63 0.86 0.09 68% 68% Resume [runnable low prio] thread - 1.21 1.07 1.61 0.13 81% 68% Suspend [runnable] thread - 0.86 0.78 1.58 0.13 81% 81% Yield [only low prio] thread - 0.69 0.62 0.84 0.09 68% 68% Suspend [runnable->not runnable] - 2.64 2.24 4.35 0.43 81% 62% Kill [runnable] thread - 1.50 1.07 5.82 0.56 93% 87% Destroy [dead] thread - 3.66 2.75 7.74 0.82 50% 56% Destroy [runnable] thread - 13.65 8.33 27.88 3.70 50% 43% Resume [high priority] thread - 2.04 1.89 3.32 0.15 46% 49% Thread switch - - 0.19 0.05 0.83 0.13 48% 44% Scheduler lock - 0.50 0.41 1.59 0.13 89% 73% Scheduler unlock [0 threads] - 0.52 0.41 1.29 0.14 89% 64% Scheduler unlock [1 suspended] - 0.56 0.41 1.49 0.15 42% 47% Scheduler unlock [many suspended] - 0.56 0.41 1.41 0.15 43% 47% Scheduler unlock [many low prio] - - 0.57 0.20 2.33 0.27 65% 50% Init mutex - 0.89 0.75 3.35 0.20 96% 75% Lock [unlocked] mutex - 0.90 0.74 4.38 0.25 96% 93% Unlock [locked] mutex - 0.77 0.65 2.63 0.17 96% 75% Trylock [unlocked] mutex - 0.66 0.59 1.16 0.10 75% 75% Trylock [locked] mutex - 0.07 0.00 0.45 0.09 75% 75% Destroy mutex - 7.95 7.71 9.49 0.19 50% 46% Unlock/Lock mutex - - 1.04 0.81 3.44 0.27 93% 68% Create mbox - 0.10 0.02 0.57 0.11 71% 68% Peek [empty] mbox - 1.15 0.83 4.71 0.31 53% 71% Put [first] mbox - 0.10 0.02 0.57 0.12 68% 68% Peek [1 msg] mbox - 1.01 0.83 3.83 0.22 93% 75% Put [second] mbox - 0.09 0.02 0.57 0.10 71% 71% Peek [2 msgs] mbox - 1.03 0.81 5.02 0.27 96% 87% Get [first] mbox - 0.93 0.81 1.61 0.14 84% 62% Get [second] mbox - 1.07 0.77 4.18 0.23 68% 50% Tryput [first] mbox - 0.89 0.72 3.49 0.21 93% 71% Peek item [non-empty] mbox - 1.04 0.83 4.09 0.26 90% 81% Tryget [non-empty] mbox - 0.79 0.68 1.97 0.15 87% 68% Peek item [empty] mbox - 0.84 0.72 2.36 0.17 93% 68% Tryget [empty] mbox - 0.13 0.02 0.59 0.13 87% 62% Waiting to get mbox - 0.13 0.02 0.90 0.13 90% 62% Waiting to put mbox - 0.93 0.77 3.23 0.21 90% 71% Delete mbox - 4.74 4.51 8.80 0.32 93% 78% Put/Get mbox - - 0.50 0.21 1.95 0.29 90% 50% Init semaphore - 0.86 0.57 2.87 0.29 93% 56% Post [0] semaphore - 1.01 0.74 3.62 0.28 93% 56% Wait [1] semaphore - 0.87 0.60 3.17 0.28 90% 59% Trywait [0] semaphore - 0.74 0.62 1.70 0.14 93% 56% Trywait [1] semaphore - 0.36 0.11 1.11 0.26 65% 56% Peek semaphore - 0.25 0.12 1.19 0.14 93% 56% Destroy semaphore - 7.85 7.52 8.93 0.21 62% 43% Post/Wait semaphore - - 0.90 0.44 3.08 0.29 65% 28% Create counter - 0.07 0.05 0.89 0.05 96% 96% Get counter value - 0.06 0.05 0.33 0.02 96% 96% Set counter value - 0.88 0.86 1.62 0.05 96% 96% Tick counter - 0.13 0.12 0.41 0.02 96% 96% Delete counter - - 1.37 0.81 2.95 0.27 62% 25% Create alarm - 1.35 1.17 6.03 0.31 96% 93% Initialize alarm - 0.11 0.08 0.65 0.05 90% 90% Disable alarm - 1.23 1.14 3.05 0.15 93% 87% Enable alarm - 0.21 0.18 0.47 0.04 90% 90% Delete alarm - 1.03 0.99 2.11 0.07 96% 96% Tick counter [1 alarm] - 4.96 4.96 4.96 0.00 100% 100% Tick counter [many alarms] - 1.70 1.67 2.51 0.05 96% 96% Tick & fire counter [1 alarm] - 26.39 26.38 26.71 0.02 96% 96% Tick & fire counters [>1 together] - 5.65 5.64 5.91 0.02 96% 96% Tick & fire counters [>1 separately] - 2.55 2.38 9.86 0.19 96% 54% Alarm latency [0 threads] - 5.37 3.80 9.73 0.95 50% 34% Alarm latency [2 threads] - 8.79 5.83 16.12 1.29 57% 14% Alarm latency [many threads] - - 5.85 2.26 16.24 0.00 Clock/interrupt latency - - 1540 1536 1544 (main stack: 1664) Thread stack used (2552 total) -All done, main stack : stack used 1664 size 3576 -All done : Interrupt stack used 312 size 4096 -All done : Idlethread stack used 1440 size 2552 - -Timing complete - 23810 ms total - -PASS:<Basic timing OK> -EXIT:<done> - - - - - - -Board: Intel SA1110 (Assabet) -Board: Intel SA1110 (Assabet) - -CPU : StrongARM 221.2 MHz - - - -Microseconds for one run through Dhrystone: 3.3 -Dhrystones per Second: 306748.5 -VAX MIPS rating = 174.586 - -Startup, main stack : stack used 420 size 2400 -Startup : Interrupt stack used 136 size 4096 -Startup : Idlethread stack used 84 size 2048 - -eCos Kernel Timings -Notes: all times are in microseconds (.000001) unless otherwise stated - -Reading the hardware clock takes 0 `ticks' overhead -... this value will be factored out of all other measurements -Clock interrupt took 3.20 microseconds (11 raw clock ticks) - -Testing parameters: - Clock samples: 32 - Threads: 64 - Thread switches: 128 - Mutexes: 32 - Mailboxes: 32 - Semaphores: 32 - Scheduler operations: 128 - Counters: 32 - Alarms: 32 - - - Confidence - Ave Min Max Var Ave Min Function - ====== ====== ====== ====== ========== ======== - 5.98 4.88 14.38 0.70 57% 35% Create thread - 0.86 0.81 1.90 0.08 87% 87% Yield thread [all suspended] - 1.05 0.81 3.53 0.19 46% 39% Suspend [suspended] thread - 1.07 0.81 3.80 0.18 48% 35% Resume thread - 1.36 1.09 5.97 0.22 45% 39% Set priority - 0.73 0.54 1.90 0.19 85% 50% Get priority - 2.93 2.44 13.56 0.39 79% 70% Kill [suspended] thread - 0.89 0.81 4.34 0.14 89% 89% Yield [no other] thread - 1.63 1.36 4.61 0.17 57% 29% Resume [suspended low prio] thread - 1.03 0.81 3.53 0.19 46% 42% Resume [runnable low prio] thread - 1.74 1.36 6.51 0.22 87% 6% Suspend [runnable] thread - 0.93 0.81 4.61 0.18 98% 78% Yield [only low prio] thread - 1.06 0.81 3.26 0.19 42% 39% Suspend [runnable->not runnable] - 2.56 1.90 13.02 0.41 87% 34% Kill [runnable] thread - 2.02 1.63 7.05 0.22 92% 3% Destroy [dead] thread - 3.09 2.44 15.19 0.51 78% 46% Destroy [runnable] thread - 6.77 5.43 13.02 0.59 75% 17% Resume [high priority] thread - 1.81 1.63 7.87 0.18 49% 49% Thread switch - - 0.25 0.00 1.36 0.05 89% 10% Scheduler lock - 0.51 0.27 1.36 0.06 85% 13% Scheduler unlock [0 threads] - 0.51 0.27 1.09 0.06 85% 13% Scheduler unlock [1 suspended] - 0.51 0.27 1.09 0.07 85% 14% Scheduler unlock [many suspended] - 0.51 0.27 1.09 0.06 85% 13% Scheduler unlock [many low prio] - - 0.52 0.27 2.17 0.15 62% 31% Init mutex - 0.97 0.54 4.34 0.28 84% 65% Lock [unlocked] mutex - 1.05 0.81 5.15 0.28 96% 96% Unlock [locked] mutex - 0.86 0.54 3.26 0.24 65% 31% Trylock [unlocked] mutex - 0.79 0.54 3.53 0.23 43% 46% Trylock [locked] mutex - 0.33 0.27 1.63 0.11 90% 90% Destroy mutex - 4.16 3.80 8.95 0.30 75% 96% Unlock/Lock mutex - - 0.70 0.54 2.98 0.21 96% 65% Create mbox - 0.59 0.27 1.63 0.14 75% 9% Peek [empty] mbox - 1.33 1.09 5.70 0.31 96% 93% Put [first] mbox - 0.61 0.27 1.63 0.13 81% 3% Peek [1 msg] mbox - 1.35 1.09 5.43 0.31 96% 87% Put [second] mbox - 0.58 0.27 1.36 0.11 78% 6% Peek [2 msgs] mbox - 1.38 1.09 4.88 0.25 59% 37% Get [first] mbox - 1.40 1.09 5.15 0.26 62% 34% Get [second] mbox - 1.27 0.81 4.88 0.28 90% 65% Tryput [first] mbox - 1.34 0.81 4.61 0.22 59% 6% Peek item [non-empty] mbox - 1.47 1.09 5.15 0.27 84% 12% Tryget [non-empty] mbox - 1.12 0.81 4.34 0.23 59% 31% Peek item [empty] mbox - 1.14 0.81 4.07 0.24 71% 25% Tryget [empty] mbox - 0.59 0.27 1.36 0.12 78% 6% Waiting to get mbox - 0.59 0.27 1.36 0.12 78% 6% Waiting to put mbox - 1.28 0.81 5.43 0.32 87% 78% Delete mbox - 2.64 2.17 10.31 0.48 96% 96% Put/Get mbox - - 0.47 0.27 2.17 0.19 46% 46% Init semaphore - 0.77 0.54 3.80 0.26 90% 56% Post [0] semaphore - 0.90 0.54 4.07 0.26 75% 21% Wait [1] semaphore - 0.85 0.54 3.26 0.21 56% 28% Trywait [0] semaphore - 0.69 0.54 2.17 0.18 96% 62% Trywait [1] semaphore - 0.44 0.27 2.17 0.19 96% 56% Peek semaphore - 0.38 0.27 1.90 0.17 96% 75% Destroy semaphore - 2.74 2.44 9.49 0.42 96% 96% Post/Wait semaphore - - 0.43 0.27 1.90 0.18 96% 56% Create counter - 0.49 0.00 2.17 0.18 56% 3% Get counter value - 0.33 0.00 1.63 0.13 78% 6% Set counter value - 1.03 0.81 2.44 0.22 84% 50% Tick counter - 0.42 0.27 1.90 0.20 90% 65% Delete counter - - 0.70 0.54 2.44 0.20 93% 62% Create alarm - 1.65 1.36 6.78 0.40 96% 81% Initialize alarm - 0.75 0.54 1.63 0.18 43% 43% Disable alarm - 1.75 1.36 7.05 0.38 65% 81% Enable alarm - 0.81 0.54 2.44 0.15 62% 28% Delete alarm - 1.01 0.81 2.17 0.16 56% 40% Tick counter [1 alarm] - 4.19 4.07 5.43 0.16 96% 68% Tick counter [many alarms] - 1.48 1.36 3.80 0.20 96% 78% Tick & fire counter [1 alarm] - 20.23 20.07 22.52 0.21 96% 65% Tick & fire counters [>1 together] - 4.70 4.61 6.78 0.16 87% 87% Tick & fire counters [>1 separately] - 2.81 2.71 14.38 0.20 98% 98% Alarm latency [0 threads] - 3.19 2.71 13.56 0.38 73% 59% Alarm latency [2 threads] - 9.71 7.87 18.17 1.25 59% 53% Alarm latency [many threads] - 5.77 5.43 45.57 0.68 97% 97% Alarm -> thread resume latency - - 2.38 0.81 9.49 0.00 Clock/interrupt latency - - 2.02 1.09 7.32 0.00 Clock DSR latency - - 11 0 316 (main stack: 764) Thread stack used (1120 total) -All done, main stack : stack used 764 size 2400 -All done : Interrupt stack used 287 size 4096 -All done : Idlethread stack used 272 size 2048 - -Timing complete - 30220 ms total - - - - - - -Board: Intel SA1100 (Brutus) -Board: Intel SA1100 (Brutus) - -CPU : StrongARM 221.2 MHz - -Microseconds for one run through Dhrystone: 3.3 -Dhrystones per Second: 306748.5 -VAX MIPS rating = 174.586 - -Startup, main stack : stack used 404 size 2400 -Startup : Interrupt stack used 136 size 4096 -Startup : Idlethread stack used 87 size 2048 - -eCos Kernel Timings -Notes: all times are in microseconds (.000001) unless otherwise stated - -Reading the hardware clock takes 0 `ticks' overhead -... this value will be factored out of all other measurements -Clock interrupt took 3.09 microseconds (11 raw clock ticks) - -Testing parameters: - Clock samples: 32 - Threads: 64 - Thread switches: 128 - Mutexes: 32 - Mailboxes: 32 - Semaphores: 32 - Scheduler operations: 128 - Counters: 32 - Alarms: 32 - - - Confidence - Ave Min Max Var Ave Min Function - ====== ====== ====== ====== ========== ======== - 6.63 5.43 18.99 0.77 70% 37% Create thread - 0.83 0.81 2.17 0.04 98% 98% Yield thread [all suspended] - 1.27 0.81 5.15 0.30 68% 73% Suspend [suspended] thread - 1.25 0.81 5.15 0.25 82% 1% Resume thread - 1.52 1.09 7.87 0.30 78% 75% Set priority - 0.97 0.54 2.71 0.28 64% 51% Get priority - 3.45 2.71 19.53 0.66 84% 76% Kill [suspended] thread - 0.90 0.81 6.24 0.17 98% 98% Yield [no other] thread - 1.86 1.36 6.24 0.33 68% 50% Resume [suspended low prio] thread - 1.25 0.81 5.15 0.25 82% 1% Resume [runnable low prio] thread - 2.01 1.63 10.04 0.32 70% 84% Suspend [runnable] thread - 0.90 0.81 6.24 0.17 98% 98% Yield [only low prio] thread - 1.25 0.81 5.15 0.24 84% 1% Suspend [runnable->not runnable] - 2.92 1.90 18.72 0.57 85% 43% Kill [runnable] thread - 2.45 1.90 10.31 0.33 95% 54% Destroy [dead] thread - 3.95 2.71 23.60 0.89 68% 54% Destroy [runnable] thread - 8.55 6.24 19.53 1.15 60% 23% Resume [high priority] thread - 1.85 1.63 11.94 0.21 49% 49% Thread switch - - 0.25 0.00 1.63 0.05 89% 10% Scheduler lock - 0.52 0.27 1.90 0.07 85% 13% Scheduler unlock [0 threads] - 0.51 0.27 1.36 0.06 85% 13% Scheduler unlock [1 suspended] - 0.51 0.27 1.36 0.06 85% 13% Scheduler unlock [many suspended] - 0.51 0.27 1.63 0.06 85% 13% Scheduler unlock [many low prio] - - 0.58 0.27 3.53 0.20 71% 21% Init mutex - 1.07 0.54 5.70 0.35 87% 59% Lock [unlocked] mutex - 1.14 0.81 6.51 0.40 96% 81% Unlock [locked] mutex - 0.96 0.54 5.15 0.34 68% 65% Trylock [unlocked] mutex - 0.94 0.54 4.88 0.34 65% 65% Trylock [locked] mutex - 0.33 0.27 2.17 0.11 96% 96% Destroy mutex - 4.21 3.80 10.85 0.41 71% 96% Unlock/Lock mutex - 0.76 0.54 4.07 0.25 96% 56% Create mbox - 0.75 0.54 1.90 0.20 84% 50% Peek [empty] mbox - 1.56 1.09 6.78 0.39 68% 59% Put [first] mbox - 0.75 0.54 1.90 0.20 84% 50% Peek [1 msg] mbox - 1.55 1.09 6.78 0.40 68% 62% Put [second] mbox - 0.77 0.54 1.63 0.17 46% 37% Peek [2 msgs] mbox - 1.67 1.09 6.24 0.31 87% 34% Get [first] mbox - 1.63 1.09 6.24 0.31 75% 34% Get [second] mbox - 1.50 1.09 6.51 0.40 56% 62% Tryput [first] mbox - 1.58 1.09 5.43 0.37 68% 53% Peek item [non-empty] mbox - 1.79 1.09 7.05 0.43 71% 25% Tryget [non-empty] mbox - 1.29 1.09 5.15 0.32 87% 87% Peek item [empty] mbox - 1.33 1.09 5.97 0.37 96% 84% Tryget [empty] mbox - 0.73 0.54 1.90 0.21 84% 56% Waiting to get mbox - 0.76 0.54 1.90 0.19 40% 43% Waiting to put mbox - 1.47 1.09 6.78 0.39 59% 84% Delete mbox - 2.70 2.17 12.75 0.63 96% 96% Put/Get mbox - - 0.47 0.27 2.71 0.20 96% 50% Init semaphore - 0.89 0.54 4.88 0.33 56% 75% Post [0] semaphore - 0.96 0.54 5.15 0.33 71% 75% Wait [1] semaphore - 0.86 0.54 4.88 0.32 96% 81% Trywait [0] semaphore - 0.69 0.54 3.26 0.22 96% 75% Trywait [1] semaphore - 0.49 0.27 3.26 0.28 84% 84% Peek semaphore - 0.39 0.27 2.44 0.19 96% 78% Destroy semaphore - 2.83 2.44 11.66 0.55 96% 96% Post/Wait semaphore - - 0.52 0.27 3.26 0.20 56% 40% Create counter - 0.59 0.00 2.71 0.34 81% 46% Get counter value - 0.36 0.00 2.44 0.21 81% 9% Set counter value - 1.13 0.81 2.98 0.26 59% 37% Tick counter - 0.39 0.27 1.90 0.19 90% 78% Delete counter - - 0.86 0.54 4.07 0.24 65% 31% Create alarm - 1.86 1.36 9.77 0.54 96% 90% Initialize alarm - 0.77 0.54 2.71 0.23 84% 50% Disable alarm - 1.86 1.36 9.22 0.51 96% 75% Enable alarm - 0.89 0.54 3.26 0.25 65% 21% Delete alarm - 0.99 0.81 3.26 0.21 96% 59% Tick counter [1 alarm] - 4.22 4.07 6.78 0.22 96% 71% Tick counter [many alarms] - 1.51 1.36 4.61 0.24 96% 78% Tick & fire counter [1 alarm] - 20.29 20.07 23.33 0.23 96% 53% Tick & fire counters [>1 together] - 4.71 4.61 7.87 0.20 96% 96% Tick & fire counters [>1 separately] - 2.88 2.71 23.87 0.33 99% 99% Alarm latency [0 threads] - 3.24 2.71 17.36 0.40 79% 58% Alarm latency [2 threads] - 15.71 12.48 27.40 1.47 53% 17% Alarm latency [many threads] - 5.95 5.43 64.56 1.02 97% 97% Alarm -> thread resume latency - - 3.25 0.81 14.11 0.00 Clock/interrupt latency - - 2.68 1.09 12.75 0.00 Clock DSR latency - - 29 0 316 (main stack: 764) Thread stack used (1120 total) -All done, main stack : stack used 764 size 2400 -All done : Interrupt stack used 288 size 4096 -All done : Idlethread stack used 260 size 2048 - - -Timing complete - 30280 ms total - - - - - - - -Board: Motorola MBX - - -Board: Motorola MBX - -CPU : Motorola MPC860 66MHZ - - -Startup, main stack : stack used 643 size 5664 -Startup : Interrupt stack used 427 size 4096 -Startup : Idlethread stack used 236 size 2048 - -eCos Kernel Timings -Notes: all times are in microseconds (.000001) unless otherwise stated - -Reading the hardware clock takes 0 `ticks' overhead -... this value will be factored out of all other measurements -Clock interrupt took 25.36 microseconds (79 raw clock ticks) - -Testing parameters: - Clock samples: 32 - Threads: 16 - Thread switches: 128 - Mutexes: 32 - Mailboxes: 32 - Semaphores: 32 - Scheduler operations: 128 - Counters: 32 - Alarms: 32 - - - Confidence - Ave Min Max Var Ave Min Function - ====== ====== ====== ====== ========== ======== - 27.58 25.60 44.16 2.07 93% 93% Create thread - 5.94 5.76 7.04 0.22 93% 62% Yield thread [all suspended] - 6.06 5.44 10.56 0.57 75% 75% Suspend [suspended] thread - 5.42 4.80 9.60 0.53 87% 81% Resume thread - 7.10 6.40 14.08 0.90 93% 87% Set priority - 0.86 0.64 1.92 0.22 93% 50% Get priority - 16.74 15.04 36.48 2.47 93% 93% Kill [suspended] thread - 6.14 5.76 10.56 0.55 93% 93% Yield [no other] thread - 9.74 8.96 18.56 1.10 93% 93% Resume [suspended low prio] thread - 5.28 4.80 9.28 0.54 93% 81% Resume [runnable low prio] thread - 9.40 8.32 18.56 1.14 93% 93% Suspend [runnable] thread - 6.04 5.76 8.96 0.38 93% 93% Yield [only low prio] thread - 5.68 5.12 9.60 0.52 68% 75% Suspend [runnable->not runnable] - 16.10 14.40 35.20 2.39 93% 93% Kill [runnable] thread - 8.54 7.68 16.00 0.94 93% 87% Destroy [dead] thread - 20.20 18.56 40.64 2.55 93% 93% Destroy [runnable] thread - 39.02 36.48 57.28 3.28 87% 87% Resume [high priority] thread - 13.13 12.80 22.08 0.15 78% 20% Thread switch - - 0.59 0.32 1.60 0.09 82% 16% Scheduler lock - 3.67 3.52 5.12 0.17 99% 54% Scheduler unlock [0 threads] - 3.67 3.52 4.80 0.17 99% 53% Scheduler unlock [1 suspended] - 3.67 3.52 4.80 0.17 54% 54% Scheduler unlock [many suspended] - 3.69 3.52 5.12 0.17 99% 50% Scheduler unlock [many low prio] - - 2.41 2.24 5.44 0.25 96% 75% Init mutex - 6.83 6.40 11.84 0.34 75% 90% Lock [unlocked] mutex - 6.74 6.40 13.12 0.40 96% 96% Unlock [locked] mutex - 5.53 5.12 9.60 0.25 84% 12% Trylock [unlocked] mutex - 4.84 4.48 7.36 0.17 78% 15% Trylock [locked] mutex - 0.34 0.00 0.96 0.06 90% 3% Destroy mutex - 56.10 55.68 59.52 0.21 93% 3% Unlock/Lock mutex - - 4.72 4.48 10.24 0.37 96% 96% Create mbox - 0.75 0.64 1.92 0.16 75% 75% Peek [empty] mbox - 6.79 6.40 12.80 0.41 96% 90% Put [first] mbox - 0.46 0.32 1.60 0.19 93% 68% Peek [1 msg] mbox - 6.68 6.40 12.16 0.37 96% 96% Put [second] mbox - 0.50 0.32 1.60 0.20 93% 56% Peek [2 msgs] mbox - 7.13 6.40 14.08 0.49 90% 46% Get [first] mbox - 6.97 6.40 13.44 0.47 84% 78% Get [second] mbox - 6.24 5.76 11.52 0.38 78% 81% Tryput [first] mbox - 5.98 5.44 11.20 0.39 78% 62% Peek item [non-empty] mbox - 6.52 6.08 13.12 0.49 93% 81% Tryget [non-empty] mbox - 5.50 5.12 10.24 0.30 68% 28% Peek item [empty] mbox - 5.76 5.44 10.88 0.32 96% 96% Tryget [empty] mbox - 0.50 0.32 1.60 0.19 96% 53% Waiting to get mbox - 0.50 0.32 1.60 0.19 96% 53% Waiting to put mbox - 7.45 7.04 15.04 0.49 96% 93% Delete mbox - 37.47 36.80 48.64 0.70 96% 96% Put/Get mbox - - 2.49 2.24 6.08 0.28 96% 56% Init semaphore - 5.09 4.80 8.64 0.27 46% 46% Post [0] semaphore - 6.25 5.76 10.88 0.32 93% 3% Wait [1] semaphore - 4.84 4.48 8.32 0.23 68% 25% Trywait [0] semaphore - 4.98 4.80 8.00 0.26 96% 71% Trywait [1] semaphore - 1.66 1.28 3.84 0.20 68% 15% Peek semaphore - 1.24 0.96 3.20 0.17 65% 31% Destroy semaphore - 40.74 40.32 49.28 0.53 96% 96% Post/Wait semaphore - - 2.65 2.24 6.08 0.23 84% 9% Create counter - 0.85 0.64 2.24 0.22 90% 53% Get counter value - 0.68 0.64 1.92 0.08 96% 96% Set counter value - 7.13 6.72 8.64 0.24 78% 18% Tick counter - 1.30 0.96 3.20 0.12 84% 12% Delete counter - - 3.69 3.52 7.68 0.29 96% 84% Create alarm - 8.98 8.32 17.60 0.61 68% 62% Initialize alarm - 0.96 0.64 2.88 0.14 71% 21% Disable alarm - 8.76 8.32 17.60 0.59 96% 87% Enable alarm - 1.99 1.60 5.12 0.21 81% 12% Delete alarm - 7.44 7.36 9.92 0.15 96% 96% Tick counter [1 alarm] - 21.68 21.44 24.64 0.25 96% 53% Tick counter [many alarms] - 10.95 10.56 15.04 0.26 78% 18% Tick & fire counter [1 alarm] - 132.79 132.48 136.32 0.23 59% 37% Tick & fire counters [>1 together] - 25.18 24.96 28.80 0.29 96% 65% Tick & fire counters [>1 separately] - 23.06 22.72 47.36 0.40 98% 98% Alarm latency [0 threads] - 31.53 27.20 56.00 0.63 96% 0% Alarm latency [2 threads] - 36.86 30.40 58.88 4.15 50% 28% Alarm latency [many threads] - - 11.41 8.96 16.32 0.00 Clock/interrupt latency - - 609 603 651 (main stack: 1059) Thread stack used (1704 total) -All done, main stack : stack used 1059 size 5664 -All done : Interrupt stack used 251 size 4096 -All done : Idlethread stack used 587 size 2048 - -Timing complete - 23690 ms total - -PASS:<Basic timing OK> -EXIT:<done> - - - - - - - -Board: Hitachi EDK7708 - - - -Board: Hitachi EDK7708 - -CPU: Hitachi SH3/7708 60MHz - - - -Startup, main stack : stack used 444 size 4112 -Startup : Interrupt stack used 76 size 4096 -Startup : Idlethread stack used 96 size 2048 - -eCos Kernel Timings -Notes: all times are in microseconds (.000001) unless otherwise stated - -Reading the hardware clock takes 2 `ticks' overhead -... this value will be factored out of all other measurements -Clock interrupt took 14.75 microseconds (55 raw clock ticks) - -Testing parameters: - Clock samples: 32 - Threads: 16 - Thread switches: 128 - Mutexes: 32 - Mailboxes: 32 - Semaphores: 32 - Scheduler operations: 128 - Counters: 32 - Alarms: 32 - - - Confidence - Ave Min Max Var Ave Min Function - ====== ====== ====== ====== ========== ======== - 15.43 13.60 24.00 1.29 62% 50% Create thread - 3.33 3.20 4.27 0.18 93% 68% Yield thread [all suspended] - 2.90 2.40 5.33 0.36 81% 62% Suspend [suspended] thread - 2.93 2.67 4.80 0.27 93% 87% Resume thread - 4.30 3.73 10.13 0.73 93% 93% Set priority - 0.65 0.27 2.13 0.28 68% 62% Get priority - 9.72 8.53 21.33 1.45 93% 93% Kill [suspended] thread - 3.33 3.20 4.53 0.20 93% 75% Yield [no other] thread - 5.30 4.80 10.13 0.65 93% 87% Resume [suspended low prio] thread - 2.80 2.40 4.53 0.27 81% 75% Resume [runnable low prio] thread - 4.82 4.00 8.27 0.49 68% 25% Suspend [runnable] thread - 3.32 3.20 4.00 0.16 93% 68% Yield [only low prio] thread - 2.82 2.40 4.27 0.25 81% 12% Suspend [runnable->not runnable] - 9.45 8.53 19.47 1.25 93% 93% Kill [runnable] thread - 5.30 4.53 11.20 0.74 87% 93% Destroy [dead] thread - 11.83 10.67 25.07 1.65 93% 93% Destroy [runnable] thread - 19.53 17.33 31.20 1.88 75% 75% Resume [high priority] thread - 6.70 6.67 11.47 0.07 99% 99% Thread switch - - 0.33 0.27 0.80 0.10 75% 75% Scheduler lock - 1.74 1.60 2.67 0.14 99% 50% Scheduler unlock [0 threads] - 1.72 1.60 3.20 0.14 99% 57% Scheduler unlock [1 suspended] - 1.81 1.60 3.20 0.10 75% 23% Scheduler unlock [many suspended] - 1.86 1.60 3.20 0.02 94% 4% Scheduler unlock [many low prio] - - 1.22 1.07 3.20 0.20 96% 65% Init mutex - 3.21 2.93 5.87 0.17 68% 28% Lock [unlocked] mutex - 3.36 2.93 7.47 0.30 84% 75% Unlock [locked] mutex - 2.83 2.67 5.33 0.22 96% 65% Trylock [unlocked] mutex - 2.53 2.40 2.93 0.14 96% 53% Trylock [locked] mutex - 0.28 0.27 0.80 0.03 96% 96% Destroy mutex - 20.09 19.73 23.20 0.23 84% 12% Unlock/Lock mutex - - 2.38 2.13 4.53 0.17 59% 34% Create mbox - 0.45 0.27 1.33 0.15 56% 40% Peek [empty] mbox - 3.70 3.20 7.20 0.29 84% 59% Put [first] mbox - 0.45 0.27 0.80 0.13 62% 34% Peek [1 msg] mbox - 3.67 3.20 5.60 0.23 81% 6% Put [second] mbox - 0.42 0.27 0.53 0.13 59% 40% Peek [2 msgs] mbox - 3.98 3.47 7.47 0.24 59% 9% Get [first] mbox - 3.97 3.47 4.80 0.24 59% 12% Get [second] mbox - 3.51 3.20 6.67 0.28 56% 78% Tryput [first] mbox - 3.29 2.93 5.60 0.29 59% 65% Peek item [non-empty] mbox - 4.06 3.47 7.20 0.26 68% 3% Tryget [non-empty] mbox - 3.03 2.67 5.33 0.19 93% 3% Peek item [empty] mbox - 3.36 3.20 4.80 0.18 96% 56% Tryget [empty] mbox - 0.57 0.27 1.33 0.09 84% 3% Waiting to get mbox - 0.52 0.27 1.07 0.11 62% 21% Waiting to put mbox - 3.88 3.47 7.47 0.30 78% 65% Delete mbox - 12.04 11.73 17.33 0.33 96% 96% Put/Get mbox - - 1.17 1.07 2.40 0.16 71% 71% Init semaphore - 2.67 2.40 4.27 0.15 62% 25% Post [0] semaphore - 3.00 2.67 4.53 0.17 65% 12% Wait [1] semaphore - 2.54 2.40 4.80 0.20 96% 71% Trywait [0] semaphore - 2.42 2.40 2.93 0.03 96% 96% Trywait [1] semaphore - 0.79 0.53 2.13 0.15 59% 28% Peek semaphore - 0.77 0.53 1.87 0.12 71% 25% Destroy semaphore - 12.64 12.27 17.07 0.28 84% 96% Post/Wait semaphore - - 1.27 1.07 2.93 0.17 53% 43% Create counter - 0.54 0.27 1.33 0.13 59% 21% Get counter value - 0.47 0.27 1.60 0.17 46% 43% Set counter value - 3.47 3.20 4.80 0.16 53% 28% Tick counter - 0.80 0.53 2.13 0.13 62% 25% Delete counter - - 1.86 1.60 4.00 0.21 43% 40% Create alarm - 5.12 4.80 9.07 0.36 93% 75% Initialize alarm - 0.44 0.27 1.33 0.19 87% 53% Disable alarm - 4.77 4.27 9.60 0.35 87% 62% Enable alarm - 1.02 0.80 2.67 0.18 53% 40% Delete alarm - 3.56 3.47 5.33 0.15 84% 84% Tick counter [1 alarm] - 15.04 14.93 16.27 0.16 71% 71% Tick counter [many alarms] - 5.75 5.60 8.00 0.21 96% 68% Tick & fire counter [1 alarm] - 79.60 79.47 81.07 0.17 96% 65% Tick & fire counters [>1 together] - 17.04 16.80 18.93 0.15 65% 31% Tick & fire counters [>1 separately] - 12.44 12.27 29.60 0.31 96% 96% Alarm latency [0 threads] - 14.06 12.27 27.20 0.53 82% 4% Alarm latency [2 threads] - 19.62 17.07 38.40 1.44 57% 34% Alarm latency [many threads] - - 2.79 2.40 6.13 0.00 Clock/interrupt latency - - 376 376 376 (main stack: 764) Thread stack used (992 total) -All done, main stack : stack used 764 size 4112 -All done : Interrupt stack used 176 size 4096 -All done : Idlethread stack used 352 size 2048 - -Timing complete - 23860 ms total - -PASS:<Basic timing OK> -EXIT:<done> - - - - - - - -Board: CQ CqREEK SH3 Evaluation Board (cq7708) - - -Board: CQ CqREEK SH3 Evaluation Board (cq7708) - -CPU: Hitachi SH3/7708 60MHz - -Startup, main stack : stack used 448 size 4112 -Startup : Interrupt stack used 80 size 4096 -Startup : Idlethread stack used 96 size 2048 - -eCos Kernel Timings -Notes: all times are in microseconds (.000001) unless otherwise stated - -Reading the hardware clock takes 2 `ticks' overhead -... this value will be factored out of all other measurements -Clock interrupt took 19.17 microseconds (71 raw clock ticks) - -Testing parameters: - Clock samples: 32 - Threads: 64 - Thread switches: 128 - Mutexes: 32 - Mailboxes: 32 - Semaphores: 32 - Scheduler operations: 128 - Counters: 32 - Alarms: 32 - - - Confidence - Ave Min Max Var Ave Min Function - ====== ====== ====== ====== ========== ======== - 20.62 14.40 26.93 3.23 48% 26% Create thread - 3.16 2.93 4.27 0.09 78% 20% Yield thread [all suspended] - 2.91 2.40 5.87 0.17 57% 1% Suspend [suspended] thread - 2.73 2.40 6.40 0.19 64% 15% Resume thread - 4.05 3.73 11.47 0.27 62% 90% Set priority - 0.82 0.27 2.67 0.17 56% 3% Get priority - 9.07 8.53 24.27 0.51 78% 71% Kill [suspended] thread - 3.19 2.93 7.20 0.14 70% 28% Yield [no other] thread - 5.45 4.53 17.87 0.49 78% 17% Resume [suspended low prio] thread - 2.67 2.40 5.07 0.15 56% 28% Resume [runnable low prio] thread - 4.95 4.27 11.47 0.28 82% 14% Suspend [runnable] thread - 3.15 2.93 4.53 0.11 73% 25% Yield [only low prio] thread - 2.82 2.40 5.60 0.21 84% 10% Suspend [runnable->not runnable] - 8.92 8.00 24.27 0.51 84% 14% Kill [runnable] thread - 5.10 4.53 12.00 0.27 59% 39% Destroy [dead] thread - 11.81 10.93 37.33 0.81 87% 95% Destroy [runnable] thread - 22.15 20.80 54.67 1.27 92% 92% Resume [high priority] thread - 6.85 6.67 13.60 0.19 99% 50% Thread switch - - 0.27 0.27 1.07 0.01 99% 99% Scheduler lock - 1.74 1.60 2.67 0.14 99% 50% Scheduler unlock [0 threads] - 1.74 1.60 2.93 0.14 99% 50% Scheduler unlock [1 suspended] - 1.81 1.60 4.27 0.11 72% 26% Scheduler unlock [many suspended] - 1.75 1.60 4.00 0.15 50% 49% Scheduler unlock [many low prio] - - 1.22 1.07 4.27 0.23 96% 78% Init mutex - 3.18 2.93 7.20 0.27 96% 53% Lock [unlocked] mutex - 3.40 3.20 8.00 0.31 96% 96% Unlock [locked] mutex - 2.77 2.40 5.87 0.22 87% 9% Trylock [unlocked] mutex - 2.35 2.13 3.47 0.14 65% 31% Trylock [locked] mutex - 0.78 0.53 2.67 0.14 68% 28% Destroy mutex - 22.80 22.40 28.80 0.51 96% 71% Unlock/Lock mutex - - 2.61 2.40 6.13 0.26 96% 62% Create mbox - 0.52 0.27 1.60 0.19 40% 37% Peek [empty] mbox - 3.54 3.20 7.73 0.35 93% 78% Put [first] mbox - 0.50 0.27 1.60 0.17 46% 37% Peek [1 msg] mbox - 3.62 3.20 6.93 0.34 59% 65% Put [second] mbox - 0.52 0.27 2.13 0.23 31% 43% Peek [2 msgs] mbox - 3.93 3.47 10.13 0.43 65% 65% Get [first] mbox - 3.92 3.47 7.47 0.40 56% 56% Get [second] mbox - 3.37 2.93 6.93 0.36 59% 68% Tryput [first] mbox - 3.30 2.67 6.93 0.38 84% 40% Peek item [non-empty] mbox - 3.93 3.47 9.33 0.44 65% 71% Tryget [non-empty] mbox - 2.94 2.67 6.13 0.25 43% 43% Peek item [empty] mbox - 3.23 2.93 6.67 0.27 56% 84% Tryget [empty] mbox - 0.58 0.27 2.67 0.20 62% 21% Waiting to get mbox - 0.55 0.27 1.87 0.14 62% 21% Waiting to put mbox - 3.82 3.47 9.87 0.39 96% 93% Delete mbox - 13.35 12.80 21.33 0.50 87% 78% Put/Get mbox - - 1.22 1.07 2.93 0.19 96% 59% Init semaphore - 2.42 2.13 4.27 0.12 81% 15% Post [0] semaphore - 2.96 2.67 5.07 0.16 68% 21% Wait [1] semaphore - 2.37 2.13 4.53 0.17 62% 34% Trywait [0] semaphore - 2.29 2.13 3.47 0.17 96% 53% Trywait [1] semaphore - 0.66 0.53 2.13 0.17 96% 68% Peek semaphore - 0.81 0.53 2.93 0.13 75% 21% Destroy semaphore - 14.47 14.13 21.33 0.43 96% 96% Post/Wait semaphore - - 1.44 1.07 3.47 0.29 56% 71% Create counter - 0.62 0.27 1.07 0.14 62% 3% Get counter value - 0.56 0.27 1.60 0.17 50% 25% Set counter value - 3.39 3.20 4.27 0.16 53% 40% Tick counter - 0.83 0.53 1.87 0.14 68% 15% Delete counter - - 2.02 1.87 4.00 0.21 93% 68% Create alarm - 5.06 4.27 11.73 0.46 78% 18% Initialize alarm - 0.73 0.27 2.40 0.22 84% 3% Disable alarm - 4.82 4.27 11.47 0.48 81% 65% Enable alarm - 1.19 0.80 3.47 0.22 87% 9% Delete alarm - 3.63 3.47 5.60 0.20 96% 59% Tick counter [1 alarm] - 15.01 14.93 16.53 0.13 87% 87% Tick counter [many alarms] - 5.50 5.33 8.00 0.22 96% 65% Tick & fire counter [1 alarm] - 74.27 74.13 76.80 0.21 96% 78% Tick & fire counters [>1 together] - 16.90 16.53 19.47 0.23 81% 15% Tick & fire counters [>1 separately] - 16.70 16.53 36.27 0.33 98% 98% Alarm latency [0 threads] - 17.85 16.53 34.40 0.47 73% 0% Alarm latency [2 threads] - 63.26 58.40 80.00 2.64 52% 32% Alarm latency [many threads] - 30.37 29.33 124.80 1.68 98% 97% Alarm -> thread resume latency - - 7.37 5.07 17.87 0.00 Clock/interrupt latency - - 9.00 4.53 26.93 0.00 Clock DSR latency - - 106 0 376 (main stack: 764) Thread stack used (992 total) -All done, main stack : stack used 764 size 4112 -All done : Interrupt stack used 176 size 4096 -All done : Idlethread stack used 352 size 2048 - -Timing complete - 30310 ms total - -PASS:<Basic timing OK> -EXIT:<done> - - - - - - - -Board: Hitachi HS7729PCI HS7729 SH3 - - -Board: Hitachi HS7729PCI HS7729 SH3 - -CPU: Hitachi SH3/7729 132MHz - - -Startup, main stack : stack used 464 size 4112 -Startup : Interrupt stack used 92 size 4096 -Startup : Idlethread stack used 94 size 2048 - -eCos Kernel Timings -Notes: all times are in microseconds (.000001) unless otherwise stated - -Reading the hardware clock takes 3 'ticks' overhead -... this value will be factored out of all other measurements -Clock interrupt took 18.10 microseconds (149 raw clock ticks) - -Testing parameters: - Clock samples: 32 - Threads: 64 - Thread switches: 128 - Mutexes: 32 - Mailboxes: 32 - Semaphores: 32 - Scheduler operations: 128 - Counters: 32 - Alarms: 32 - - - Confidence - Ave Min Max Var Ave Min Function - ====== ====== ====== ====== ========== ======== - 18.33 15.52 28.24 1.47 53% 28% Create thread - 3.08 2.91 6.79 0.13 78% 89% Yield thread [all suspended] - 3.23 3.03 6.18 0.16 59% 70% Suspend [suspended] thread - 2.70 2.55 6.18 0.15 54% 82% Resume thread - 4.12 4.00 7.52 0.16 96% 81% Set priority - 0.61 0.48 1.33 0.07 57% 28% Get priority - 9.14 8.61 18.91 0.42 85% 57% Kill [suspended] thread - 3.04 2.91 4.48 0.07 68% 20% Yield [no other] thread - 5.12 4.73 7.88 0.29 60% 53% Resume [suspended low prio] thread - 2.54 2.42 3.03 0.09 39% 40% Resume [runnable low prio] thread - 5.00 4.36 9.45 0.21 75% 1% Suspend [runnable] thread - 3.04 2.91 4.61 0.07 65% 21% Yield [only low prio] thread - 2.91 2.79 3.27 0.08 43% 31% Suspend [runnable->not runnable] - 8.82 8.12 15.39 0.36 68% 29% Kill [runnable] thread - 5.07 4.48 12.73 0.37 76% 50% Destroy [dead] thread - 11.17 10.55 22.91 0.52 78% 67% Destroy [runnable] thread - 22.43 21.45 32.73 0.61 81% 50% Resume [high priority] thread - 7.99 7.88 13.58 0.14 98% 86% Thread switch - - 0.37 0.36 1.33 0.02 97% 97% Scheduler lock - 1.74 1.70 2.06 0.06 70% 70% Scheduler unlock [0 threads] - 1.75 1.70 2.06 0.07 92% 64% Scheduler unlock [1 suspended] - 1.71 1.70 2.42 0.03 89% 89% Scheduler unlock [many suspended] - 1.76 1.70 3.64 0.08 96% 64% Scheduler unlock [many low prio] - - 4.23 3.88 10.67 0.41 96% 93% Unlock [locked] mutex - 3.12 2.91 6.91 0.29 96% 87% Trylock [unlocked] mutex - 2.54 2.42 2.91 0.11 18% 46% Trylock [locked] mutex - 0.88 0.73 3.15 0.14 65% 96% Destroy mutex - 22.33 22.06 25.94 0.23 81% 62% Unlock/Lock mutex - - 1.92 1.82 4.73 0.19 96% 93% Create mbox - 0.61 0.48 1.70 0.15 84% 75% Peek [empty] mbox - 4.00 3.64 9.45 0.36 96% 87% Put [first] mbox - 0.30 0.24 0.73 0.09 84% 75% Peek [1 msg] mbox - 3.82 3.64 6.67 0.22 90% 84% Put [second] mbox - 0.32 0.24 1.33 0.12 81% 81% Peek [2 msgs] mbox - 4.19 3.76 9.21 0.34 84% 50% Get [first] mbox - 3.91 3.76 5.21 0.16 84% 75% Get [second] mbox - 3.51 3.27 8.12 0.34 93% 87% Tryput [first] mbox - 3.25 2.91 7.15 0.30 62% 56% Peek item [non-empty] mbox - 3.86 3.52 8.73 0.37 93% 84% Tryget [non-empty] mbox - 2.87 2.79 3.76 0.12 84% 71% Peek item [empty] mbox - 3.15 3.03 4.24 0.10 46% 40% Tryget [empty] mbox - 0.34 0.24 1.33 0.10 43% 46% Waiting to get mbox - 0.36 0.24 1.45 0.09 53% 37% Waiting to put mbox - 4.49 4.24 10.91 0.41 96% 96% Delete mbox - 12.67 12.36 19.52 0.43 96% 96% Put/Get mbox - - 0.87 0.85 1.45 0.05 93% 93% Init semaphore - 2.74 2.55 4.48 0.18 50% 50% Post [0] semaphore - 3.39 3.15 4.24 0.14 78% 50% Wait [1] semaphore - 2.62 2.42 5.33 0.21 96% 65% Trywait [0] semaphore - 2.76 2.67 3.27 0.08 46% 43% Trywait [1] semaphore - 1.09 0.85 2.91 0.19 68% 56% Peek semaphore - 0.97 0.73 3.39 0.17 90% 65% Destroy semaphore - 13.09 12.85 16.12 0.19 84% 65% Post/Wait semaphore - - 1.57 1.45 3.88 0.15 96% 93% Create counter - 0.91 0.73 2.18 0.16 46% 68% Get counter value - 0.55 0.48 0.97 0.09 90% 62% Set counter value - 4.19 4.00 5.82 0.13 84% 75% Tick counter - 0.87 0.73 3.15 0.16 93% 93% Delete counter - - 2.50 2.30 5.21 0.18 81% 90% Create alarm - 6.16 5.70 12.97 0.47 96% 71% Initialize alarm - 0.50 0.36 1.70 0.11 62% 34% Disable alarm - 5.16 4.85 8.73 0.29 78% 78% Enable alarm - 1.18 1.09 2.30 0.12 84% 65% Delete alarm - 5.22 5.09 7.39 0.14 96% 93% Tick counter [1 alarm] - 52.37 52.12 52.73 0.20 37% 56% Tick counter [many alarms] - 6.73 6.55 8.24 0.13 78% 68% Tick & fire counter [1 alarm] - 108.65 108.61 109.21 0.07 87% 87% Tick & fire counters [>1 together] - 54.25 54.06 54.79 0.11 65% 18% Tick & fire counters [>1 separately] - 17.36 17.09 29.82 0.23 82% 57% Alarm latency [0 threads] - 19.75 17.09 28.00 1.65 46% 40% Alarm latency [2 threads] - 39.02 34.06 50.67 2.00 53% 15% Alarm latency [many threads] - 29.31 28.36 105.09 1.27 98% 97% Alarm -> thread resume latency - - 5.08 3.88 11.15 0.00 Clock/interrupt latency - - 7.32 5.09 16.73 0.00 Clock DSR latency - - 6 0 380 (main stack: 820) Thread stack used (992 total) -All done, main stack : stack used 820 size 4112 -All done : Interrupt stack used 196 size 4096 -All done : Idlethread stack used 360 size 2048 - -Timing complete - 29960 ms total -PASS:<Basic timing OK> -EXIT:<done> - - - - - -Board: Hitachi Solution Engine 7751 SH4 (se7751) -Board: Hitachi Solution Engine 7751 SH4 (se7751) - -CPU: Hitachi SH4/7751 162MHz - - -Startup, main stack : stack used 464 size 4112 -Startup : Interrupt stack used 92 size 4096 -Startup : Idlethread stack used 94 size 2048 - - -eCos Kernel Timings -Notes: all times are in microseconds (.000001) unless otherwise stated - - -Reading the hardware clock takes 1 `ticks' overhead -... this value will be factored out of all other measurements -Clock interrupt took 14.27 microseconds (96 raw clock ticks) - - -Testing parameters: - Clock samples: 32 - Threads: 64 - Thread switches: 128 - Mutexes: 32 - Mailboxes: 32 - Semaphores: 32 - Scheduler operations: 128 - Counters: 32 - Alarms: 32 - - Confidence - Ave Min Max Var Ave Min Function - ====== ====== ====== ====== ========== ======== - 8.06 5.63 12.15 1.37 46% 29% Create thread - 1.15 1.04 5.19 0.15 98% 98% Yield thread [all suspended] - 1.13 0.89 5.04 0.27 89% 62% Suspend [suspended] thread - 1.11 0.89 5.19 0.26 89% 71% Resume thread - 1.45 1.19 3.56 0.23 53% 53% Set priority - 0.21 0.15 1.19 0.10 90% 79% Get priority - 4.15 3.56 13.04 0.53 68% 64% Kill [suspended] thread - 1.12 1.04 3.70 0.12 98% 70% Yield [no other] thread - 1.75 1.33 8.00 0.38 59% 65% Resume [suspended low prio] thread - 1.10 0.89 4.59 0.25 87% 73% Resume [runnable low prio] thread - 1.59 1.33 5.93 0.33 81% 79% Suspend [runnable] thread - 1.13 1.04 4.30 0.13 98% 71% Yield [only low prio] thread - 1.09 0.89 3.56 0.21 89% 70% Suspend [runnable->not runnable] - 4.96 4.30 11.70 0.44 68% 39% Kill [runnable] thread - 1.95 1.48 8.00 0.34 75% 57% Destroy [dead] thread - 4.41 3.85 10.37 0.47 53% 57% Destroy [runnable] thread - 13.15 11.41 23.85 1.11 73% 39% Resume [high priority] thread - 3.10 2.96 6.22 0.11 41% 39% Thread switch - - 0.13 0.00 1.33 0.06 74% 21% Scheduler lock - 0.76 0.74 1.78 0.03 96% 96% Scheduler unlock [0 threads] - 0.76 0.74 1.78 0.03 96% 96% Scheduler unlock [1 suspended] - 0.77 0.74 2.67 0.05 95% 95% Scheduler unlock [many suspended] - 0.76 0.74 2.37 0.04 95% 95% Scheduler unlock [many low prio] - - 0.52 0.15 2.67 0.26 65% 34% Init mutex - 1.23 1.04 5.63 0.32 93% 93% Lock [unlocked] mutex - 1.45 1.19 5.33 0.31 90% 87% Unlock [locked] mutex - 1.13 0.89 4.15 0.28 90% 84% Trylock [unlocked] mutex - 1.00 0.89 2.96 0.17 87% 87% Trylock [locked] mutex - 0.37 0.30 1.78 0.13 90% 84% Destroy mutex - 9.09 8.59 12.59 0.43 71% 71% Unlock/Lock mutex - 0.93 0.59 4.30 0.40 84% 71% Create mbox - 0.26 0.00 1.19 0.17 71% 59% Peek [empty] mbox - 3.03 2.52 6.37 0.47 50% 59% Put [first] mbox - 0.23 0.00 0.74 0.14 68% 15% Peek [1 msg] mbox - 2.93 2.52 4.74 0.46 71% 59% Put [second] mbox - 0.22 0.00 0.59 0.13 68% 15% Peek [2 msgs] mbox - 2.07 1.63 5.93 0.37 84% 59% Get [first] mbox - 2.06 1.63 4.74 0.34 78% 59% Get [second] mbox - 1.48 1.04 5.48 0.37 62% 53% Tryput [first] mbox - 1.31 1.04 4.89 0.32 96% 75% Peek item [non-empty] mbox - 1.47 1.04 5.78 0.38 84% 65% Tryget [non-empty] mbox - 1.15 0.89 3.11 0.18 71% 56% Peek item [empty] mbox - 1.20 1.04 3.85 0.21 93% 84% Tryget [empty] mbox - 0.21 0.00 0.74 0.14 68% 18% Waiting to get mbox - 0.19 0.00 0.44 0.10 43% 15% Waiting to put mbox - 2.19 1.93 5.78 0.27 93% 71% Delete mbox - 10.23 9.93 11.56 0.15 53% 37% Put/Get mbox - - 0.37 0.15 1.33 0.26 71% 71% Init semaphore - 0.98 0.89 2.52 0.13 96% 68% Post [0] semaphore - 1.08 0.89 3.26 0.15 68% 93% Wait [1] semaphore - 0.98 0.89 3.41 0.16 93% 93% Trywait [0] semaphore - 0.73 0.59 1.63 0.07 71% 25% Trywait [1] semaphore - 0.33 0.30 1.33 0.07 93% 93% Peek semaphore - 0.34 0.30 1.78 0.09 96% 96% Destroy semaphore - 9.36 8.74 10.37 0.33 56% 31% Post/Wait semaphore - - 0.54 0.15 3.26 0.23 59% 37% Create counter - 0.13 0.00 0.59 0.07 68% 25% Get counter value - 0.14 0.00 0.59 0.07 68% 25% Set counter value - 3.74 3.56 5.33 0.17 53% 75% Tick counter - 0.32 0.15 2.07 0.12 71% 21% Delete counter - - 1.59 1.19 3.11 0.29 71% 43% Create alarm - 1.89 1.48 6.37 0.44 87% 78% Initialize alarm - 0.20 0.15 0.74 0.09 87% 84% Disable alarm - 1.62 1.33 5.63 0.41 87% 84% Enable alarm - 0.40 0.30 1.33 0.13 87% 62% Delete alarm - - 4.03 3.70 5.78 0.27 68% 56% Tick counter [1 alarm] - 14.18 13.93 15.70 0.27 81% 75% Tick counter [many alarms] - 4.81 4.59 5.93 0.13 81% 15% Tick & fire counter [1 alarm] - 30.77 30.52 33.63 0.20 75% 65% Tick & fire counters [>1 together] - 15.10 14.52 17.04 0.23 71% 3% Tick & fire counters [>1 separately] - 8.78 8.59 18.22 0.20 97% 89% Alarm latency [0 threads] - 11.29 9.33 17.48 1.02 56% 22% Alarm latency [2 threads] - 18.70 15.70 26.37 1.45 54% 22% Alarm latency [many threads] - 19.40 18.81 57.48 0.65 97% 97% Alarm -> thread resume latency - - 4.18 2.81 8.89 0.00 Clock/interrupt latency - - 3.98 2.52 11.56 0.00 Clock DSR latency - - 6 0 380 (main stack: 728) Thread stack used (992 total) -All done, main stack : stack used 728 size 4112 -All done : Interrupt stack used 196 size 4096 -All done : Idlethread stack used 360 size 2048 - -Timing complete - 29790 ms total - -PASS:<Basic timing OK> -EXIT:<done> - - -Board: PC -Board: PC - -CPU: 433MHz Celeron - -Startup, main stack : stack used 124 size 2912 -Startup : Interrupt stack used 280 size 4108 -Startup : Idlethread stack used 62 size 2048 - -eCos Kernel Timings -Notes: all times are in microseconds (.000001) unless otherwise stated - -Reading the hardware clock takes 8 'ticks' overhead -... this value will be factored out of all other measurements -Clock interrupt took 6.75 microseconds (8 raw clock ticks) - -Testing parameters: - Clock samples: 32 - Threads: 64 - Thread switches: 128 - Mutexes: 32 - Mailboxes: 32 - Semaphores: 32 - Scheduler operations: 128 - Counters: 32 - Alarms: 32 - - - Confidence - Ave Min Max Var Ave Min Function - ====== ====== ====== ====== ========== ======== - 3.93 1.68 8.38 0.93 68% 3% Create thread - 0.71 0.00 3.35 0.84 59% 59% Yield thread [all suspended] - 0.65 0.00 5.03 0.84 64% 64% Suspend [suspended] thread - 0.63 0.00 1.68 0.79 62% 62% Resume thread - 0.76 0.00 1.68 0.83 54% 54% Set priority - 0.39 0.00 1.68 0.60 76% 76% Get priority - 1.34 0.00 6.70 0.67 73% 25% Kill [suspended] thread - 0.68 0.00 1.68 0.81 59% 59% Yield [no other] thread - 0.92 0.00 1.68 0.83 54% 45% Resume [suspended low prio] thread - 0.63 0.00 1.68 0.79 62% 62% Resume [runnable low prio] thread - 0.84 0.00 1.68 0.84 100% 50% Suspend [runnable] thread - 0.73 0.00 1.68 0.82 56% 56% Yield [only low prio] thread - 0.58 0.00 1.68 0.76 65% 65% Suspend [runnable->not runnable] - 1.26 0.00 3.35 0.67 71% 26% Kill [runnable] thread - 0.86 0.00 3.35 0.86 98% 50% Destroy [dead] thread - 1.44 0.00 1.68 0.40 85% 14% Destroy [runnable] thread - 4.45 3.35 6.70 0.89 53% 40% Resume [high priority] thread - 1.62 0.00 1.68 0.10 96% 3% Thread switch - - 0.41 0.00 1.68 0.61 75% 75% Scheduler lock - 0.48 0.00 1.68 0.69 71% 71% Scheduler unlock [0 threads] - 0.59 0.00 1.68 0.76 64% 64% Scheduler unlock [1 suspended] - 0.45 0.00 1.68 0.65 73% 73% Scheduler unlock [many suspended] - 0.45 0.00 1.68 0.65 73% 73% Scheduler unlock [many low prio] - - 0.52 0.00 1.68 0.72 68% 68% Init mutex - 0.79 0.00 5.03 0.93 96% 59% Lock [unlocked] mutex - 0.84 0.00 5.03 0.94 96% 56% Unlock [locked] mutex - 0.63 0.00 1.68 0.79 62% 62% Trylock [unlocked] mutex - 0.52 0.00 1.68 0.72 68% 68% Trylock [locked] mutex - 0.58 0.00 1.68 0.76 65% 65% Destroy mutex - 3.40 3.35 5.03 0.10 96% 96% Unlock/Lock mutex - - 0.99 0.00 1.68 0.81 59% 40% Create mbox - 0.47 0.00 1.68 0.68 71% 71% Peek [empty] mbox - 0.79 0.00 5.03 0.93 96% 59% Put [first] mbox - 0.42 0.00 1.68 0.63 75% 75% Peek [1 msg] mbox - 0.79 0.00 1.68 0.83 53% 53% Put [second] mbox - 0.37 0.00 1.68 0.57 78% 78% Peek [2 msgs] mbox - 0.73 0.00 3.35 0.87 59% 59% Get [first] mbox - 0.73 0.00 1.68 0.82 56% 56% Get [second] mbox - 0.79 0.00 3.35 0.88 56% 56% Tryput [first] mbox - 0.68 0.00 3.35 0.85 62% 62% Peek item [non-empty] mbox - 0.73 0.00 3.35 0.87 59% 59% Tryget [non-empty] mbox - 0.63 0.00 1.68 0.79 62% 62% Peek item [empty] mbox - 0.68 0.00 1.68 0.81 59% 59% Tryget [empty] mbox - 0.26 0.00 1.68 0.44 84% 84% Waiting to get mbox - 0.63 0.00 1.68 0.79 62% 62% Waiting to put mbox - 0.73 0.00 3.35 0.87 59% 59% Delete mbox - 3.25 1.68 3.35 0.20 93% 6% Put/Get mbox - - 0.63 0.00 1.68 0.79 62% 62% Init semaphore - 0.63 0.00 1.68 0.79 62% 62% Post [0] semaphore - 0.63 0.00 1.68 0.79 62% 62% Wait [1] semaphore - 0.52 0.00 1.68 0.72 68% 68% Trywait [0] semaphore - 0.52 0.00 1.68 0.72 68% 68% Trywait [1] semaphore - 0.52 0.00 1.68 0.72 68% 68% Peek semaphore - 0.21 0.00 1.68 0.37 87% 87% Destroy semaphore - 3.30 1.68 3.35 0.10 96% 3% Post/Wait semaphore - - 0.79 0.00 3.35 0.88 56% 56% Create counter - 0.42 0.00 1.68 0.63 75% 75% Get counter value - 0.37 0.00 1.68 0.57 78% 78% Set counter value - 0.73 0.00 1.68 0.82 56% 56% Tick counter - 0.63 0.00 1.68 0.79 62% 62% Delete counter - - 0.89 0.00 3.35 0.89 96% 50% Create alarm - 0.84 0.00 1.68 0.84 100% 50% Initialize alarm - 0.52 0.00 1.68 0.72 68% 68% Disable alarm - 0.89 0.00 3.35 0.89 96% 50% Enable alarm - 0.58 0.00 1.68 0.76 65% 65% Delete alarm - 0.63 0.00 1.68 0.79 62% 62% Tick counter [1 alarm] - 5.03 3.35 6.70 0.10 93% 3% Tick counter [many alarms] - 0.94 0.00 1.68 0.82 56% 43% Tick & fire counter [1 alarm] - 11.16 10.06 11.73 0.76 65% 34% Tick & fire counters [>1 together] - 5.19 5.03 6.70 0.28 90% 90% Tick & fire counters [>1 separately] - 0.01 0.00 1.68 0.03 99% 99% Alarm latency [0 threads] - 0.13 0.00 1.68 0.24 92% 92% Alarm latency [2 threads] - 0.94 0.00 3.35 0.85 53% 45% Alarm latency [many threads] - 1.75 1.68 6.70 0.15 96% 96% Alarm -> thread resume latency - - 41 0 368 (main stack: 1036) Thread stack used (1712 total) -All done, main stack : stack used 1036 size 2912 -All done : Interrupt stack used 368 size 4108 -All done : Idlethread stack used 288 size 2048 - -Timing complete - 28520 ms total - -PASS:<Basic timing OK> -EXIT:<done> - - - - -Board: NEC V850 Cosmo Evaluation Board -Board: NEC V850 Cosmo Evaluation Board - -CPU: NEC CEB-V850/SA1 17MHz - -Startup, main stack : stack used 552 size 2936 -Startup : Interrupt stack used 120 size 4096 -Startup : Idlethread stack used 206 size 2048 - -eCos Kernel Timings -Notes: all times are in microseconds (.000001) unless otherwise stated - -Reading the hardware clock takes 27 `ticks' overhead -... this value will be factored out of all other measurements -Clock interrupt took 280.04 microseconds (1190 raw clock ticks) - -Testing parameters: - Clock samples: 32 - Threads: 7 - Thread switches: 128 - Mutexes: 32 - Mailboxes: 32 - Semaphores: 32 - Scheduler operations: 128 - Counters: 32 - Alarms: 32 - - - Confidence - Ave Min Max Var Ave Min Function - ====== ====== ====== ====== ========== ======== - 288.71 280.24 297.18 4.84 42% 28% Create thread - 70.76 70.59 70.82 0.10 71% 28% Yield thread [all suspended] - 59.06 59.06 59.06 0.00 100% 100% Suspend [suspended] thread - 60.00 60.00 60.00 0.00 100% 100% Resume thread - 77.38 77.18 77.41 0.06 85% 14% Set priority - 3.13 3.06 3.29 0.10 71% 71% Get priority - 187.46 187.29 187.53 0.10 71% 28% Kill [suspended] thread - 70.76 70.59 70.82 0.10 71% 28% Yield [no other] thread - 104.40 103.29 104.71 0.32 85% 14% Resume [suspended low prio] thread - 59.06 59.06 59.06 0.00 100% 100% Resume [runnable low prio] thread - 97.11 91.06 98.12 1.73 85% 14% Suspend [runnable] thread - 70.76 70.59 70.82 0.10 71% 28% Yield [only low prio] thread - 59.06 59.06 59.06 0.00 100% 100% Suspend [runnable->not runnable] - 187.46 187.29 187.53 0.10 71% 28% Kill [runnable] thread - 95.63 95.29 97.18 0.44 85% 85% Destroy [dead] thread - 241.28 236.94 242.12 1.24 85% 14% Destroy [runnable] thread - 378.55 370.35 427.06 13.86 85% 85% Resume [high priority] thread - 198.77 183.76 452.94 18.77 96% 96% Thread switch - - 2.59 2.59 2.59 0.00 100% 100% Scheduler lock - 41.29 41.18 41.41 0.12 100% 50% Scheduler unlock [0 threads] - 40.82 40.71 40.94 0.12 100% 50% Scheduler unlock [1 suspended] - 41.29 41.18 41.41 0.12 100% 50% Scheduler unlock [many suspended] - 41.29 41.18 41.41 0.12 100% 50% Scheduler unlock [many low prio] - - 17.94 17.88 18.12 0.09 75% 75% Init mutex - 68.71 68.71 68.71 0.00 100% 100% Lock [unlocked] mutex - 72.10 72.00 73.41 0.15 96% 71% Unlock [locked] mutex - 57.88 57.88 57.88 0.00 100% 100% Trylock [unlocked] mutex - 52.24 52.24 52.24 0.00 100% 100% Trylock [locked] mutex - 12.41 12.24 12.47 0.09 75% 25% Destroy mutex - 427.06 427.06 427.06 0.00 100% 100% Unlock/Lock mutex - - - 34.94 34.82 35.06 0.12 100% 50% Create mbox - 0.76 0.71 0.94 0.09 75% 75% Peek [empty] mbox - 75.29 75.29 75.29 0.00 100% 100% Put [first] mbox - 1.24 1.18 1.41 0.09 75% 75% Peek [1 msg] mbox - 75.76 75.76 75.76 0.00 100% 100% Put [second] mbox - 0.76 0.71 0.94 0.09 75% 75% Peek [2 msgs] mbox - 80.12 80.00 80.24 0.12 100% 50% Get [first] mbox - 79.65 79.53 79.76 0.12 100% 50% Get [second] mbox - 70.12 70.12 70.12 0.00 100% 100% Tryput [first] mbox - 65.76 65.65 65.88 0.12 100% 50% Peek item [non-empty] mbox - 78.00 77.88 78.12 0.12 100% 50% Tryget [non-empty] mbox - 63.12 63.06 63.29 0.09 75% 75% Peek item [empty] mbox - 67.82 67.76 68.00 0.09 75% 75% Tryget [empty] mbox - 1.94 1.88 2.12 0.09 75% 75% Waiting to get mbox - 1.47 1.41 1.65 0.09 75% 75% Waiting to put mbox - 75.59 75.53 75.76 0.09 75% 75% Delete mbox - 252.76 252.71 252.94 0.09 75% 75% Put/Get mbox - - 20.24 20.24 20.24 0.00 100% 100% Init semaphore - 54.35 54.35 54.35 0.00 100% 100% Post [0] semaphore - 66.59 66.59 66.59 0.00 100% 100% Wait [1] semaphore - 52.24 52.24 52.24 0.00 100% 100% Trywait [0] semaphore - 53.41 53.41 53.41 0.00 100% 100% Trywait [1] semaphore - 10.65 10.59 10.82 0.09 75% 75% Peek semaphore - 12.65 12.47 12.71 0.09 75% 25% Destroy semaphore - 276.94 276.94 276.94 0.00 100% 100% Post/Wait semaphore - - 14.94 14.82 15.06 0.12 100% 50% Create counter - 2.18 2.12 2.35 0.09 75% 75% Get counter value - 3.06 3.06 3.06 0.00 100% 100% Set counter value - 78.12 78.12 78.12 0.00 100% 100% Tick counter - 13.82 13.65 13.88 0.09 75% 25% Delete counter - - 26.94 26.82 27.06 0.12 100% 50% Create alarm - 104.18 104.00 104.24 0.09 75% 25% Initialize alarm - 7.65 7.53 7.76 0.12 100% 50% Disable alarm - 104.94 104.94 104.94 0.00 100% 100% Enable alarm - 19.47 19.29 19.53 0.09 75% 25% Delete alarm - 88.53 88.47 88.71 0.09 75% 75% Tick counter [1 alarm] - 418.61 411.29 645.41 14.17 96% 96% Tick counter [many alarms] - 139.59 139.53 139.76 0.09 75% 75% Tick & fire counter [1 alarm] - 2150.21 2096.71 2367.53 83.59 78% 78% Tick & fire counters [>1 together] - 478.15 462.35 733.41 29.61 93% 93% Tick & fire counters [>1 separately] - 219.89 218.59 369.88 2.34 99% 99% Alarm latency [0 threads] - 292.11 218.59 371.53 37.85 50% 25% Alarm latency [2 threads] - 292.96 218.59 370.59 38.12 49% 25% Alarm latency [many threads] - 540.90 495.76 1677.41 17.76 98% 0% Alarm -> thread resume latency - - 79.01 78.59 104.71 0.00 Clock/interrupt latency - - 123.41 85.88 1982.82 0.00 Clock DSR latency - - 522 516 536 (main stack: 1124) Thread stack used (1912 total) -All done, main stack : stack used 1124 size 2936 -All done : Interrupt stack used 288 size 4096 -All done : Idlethread stack used 488 size 2048 - -Timing complete - 32540 ms total - - - - -Board: NEC V850 Cosmo Evaluation Board -Board: NEC V850 Cosmo Evaluation Board - -CPU: NEC CEB-V850/SB1 16MHz (in internal Flash) - - -Startup, main stack : stack used 572 size 2936 -Startup : Interrupt stack used 132 size 4096 -Startup : Idlethread stack used 210 size 2048 - -eCos Kernel Timings -Notes: all times are in microseconds (.000001) unless otherwise stated - -Reading the hardware clock takes 8 'ticks' overhead -... this value will be factored out of all other measurements -Clock interrupt took 118.15 microseconds (472 raw clock ticks) - -Testing parameters: - Clock samples: 32 - Threads: 7 - Thread switches: 128 - Mutexes: 32 - Mailboxes: 32 - Semaphores: 32 - Scheduler operations: 128 - Counters: 32 - Alarms: 32 - - - Confidence - Ave Min Max Var Ave Min Function - ====== ====== ====== ====== ========== ======== - 113.68 111.00 116.50 1.63 42% 28% Create thread - 30.00 30.00 30.00 0.00 100% 100% Yield thread [all suspended] - 29.57 29.50 29.75 0.10 71% 71% Suspend [suspended] thread - 27.43 27.25 27.50 0.10 71% 28% Resume thread - 34.11 34.00 34.25 0.12 57% 57% Set priority - 1.57 1.50 1.75 0.10 71% 71% Get priority - 72.96 72.75 73.00 0.06 85% 14% Kill [suspended] thread - 30.00 30.00 30.00 0.00 100% 100% Yield [no other] thread - 42.75 42.75 42.75 0.00 100% 100% Resume [suspended low prio] thread - 27.00 27.00 27.00 0.00 100% 100% Resume [runnable low prio] thread - 43.64 41.25 44.25 0.68 85% 14% Suspend [runnable] thread - 30.00 30.00 30.00 0.00 100% 100% Yield [only low prio] thread - 29.57 29.50 29.75 0.10 71% 71% Suspend [runnable->not runnable] - 72.93 72.75 73.00 0.10 71% 28% Kill [runnable] thread - 44.89 44.75 45.75 0.24 85% 85% Destroy [dead] thread - 103.00 101.50 103.25 0.43 85% 14% Destroy [runnable] thread - 175.21 171.50 197.50 6.37 85% 85% Resume [high priority] thread - 84.11 79.50 197.25 1.77 98% 0% Thread switch - - 1.00 1.00 1.00 0.00 100% 100% Scheduler lock - 20.06 20.00 20.25 0.09 75% 75% Scheduler unlock [0 threads] - 20.00 20.00 20.00 0.00 100% 100% Scheduler unlock [1 suspended] - 20.06 20.00 20.25 0.09 75% 75% Scheduler unlock [many suspended] - 20.06 20.00 20.25 0.09 75% 75% Scheduler unlock [many low prio] - - 4.00 4.00 4.00 0.00 100% 100% Init mutex - 33.00 33.00 33.00 0.00 100% 100% Lock [unlocked] mutex - 36.77 36.75 37.25 0.03 96% 96% Unlock [locked] mutex - 28.13 28.00 28.25 0.13 100% 50% Trylock [unlocked] mutex - 25.13 25.00 25.25 0.13 100% 50% Trylock [locked] mutex - 4.88 4.75 5.00 0.13 100% 50% Destroy mutex - 187.00 187.00 187.00 0.00 100% 100% Unlock/Lock mutex - - 10.00 10.00 10.00 0.00 100% 100% Create mbox - 0.69 0.50 0.75 0.09 75% 25% Peek [empty] mbox - 34.75 34.75 34.75 0.00 100% 100% Put [first] mbox - 0.69 0.50 0.75 0.09 75% 25% Peek [1 msg] mbox - 35.00 35.00 35.00 0.00 100% 100% Put [second] mbox - 0.69 0.50 0.75 0.09 75% 25% Peek [2 msgs] mbox - 36.00 36.00 36.00 0.00 100% 100% Get [first] mbox - 36.00 36.00 36.00 0.00 100% 100% Get [second] mbox - 31.00 31.00 31.00 0.00 100% 100% Tryput [first] mbox - 29.50 29.50 29.50 0.00 100% 100% Peek item [non-empty] mbox - 35.25 35.25 35.25 0.00 100% 100% Tryget [non-empty] mbox - 27.69 27.50 27.75 0.09 75% 25% Peek item [empty] mbox - 31.06 31.00 31.25 0.09 75% 75% Tryget [empty] mbox - 0.94 0.75 1.00 0.09 75% 25% Waiting to get mbox - 0.94 0.75 1.00 0.09 75% 25% Waiting to put mbox - 37.81 37.75 38.00 0.09 75% 75% Delete mbox - 112.00 112.00 112.00 0.00 100% 100% Put/Get mbox - - 3.19 3.00 3.25 0.09 75% 25% Init semaphore - 25.38 25.25 25.50 0.13 100% 50% Post [0] semaphore - 32.63 32.50 32.75 0.13 100% 50% Wait [1] semaphore - 24.25 24.25 24.25 0.00 100% 100% Trywait [0] semaphore - 25.00 25.00 25.00 0.00 100% 100% Trywait [1] semaphore - 4.00 4.00 4.00 0.00 100% 100% Peek semaphore - 4.88 4.75 5.00 0.13 100% 50% Destroy semaphore - 124.50 124.50 124.50 0.00 100% 100% Post/Wait semaphore - - 6.50 6.50 6.50 0.00 100% 100% Create counter - 1.25 1.25 1.25 0.00 100% 100% Get counter value - 1.44 1.25 1.50 0.09 75% 25% Set counter value - 36.25 36.25 36.25 0.00 100% 100% Tick counter - 5.25 5.25 5.25 0.00 100% 100% Delete counter - - 12.25 12.25 12.25 0.00 100% 100% Create alarm - 49.13 49.00 49.25 0.13 100% 50% Initialize alarm - 2.81 2.75 3.00 0.09 75% 75% Disable alarm - 48.50 48.50 48.50 0.00 100% 100% Enable alarm - 8.25 8.25 8.25 0.00 100% 100% Delete alarm - 46.50 46.50 46.50 0.00 100% 100% Tick counter [1 alarm] - 485.42 482.25 580.00 5.91 96% 96% Tick counter [many alarms] - 64.00 64.00 64.00 0.00 100% 100% Tick & fire counter [1 alarm] - 1109.76 1100.50 1198.00 16.53 90% 90% Tick & fire counters [>1 together] - 505.85 502.00 621.00 7.20 96% 96% Tick & fire counters [>1 separately] - 96.26 95.75 161.25 1.02 99% 99% Alarm latency [0 threads] - 159.20 95.75 160.75 2.52 97% 0% Alarm latency [2 threads] - 159.73 110.50 161.75 1.53 97% 0% Alarm latency [many threads] - 218.45 211.25 445.75 3.55 97% 1% Alarm -> thread resume latency - - 28.24 25.25 43.25 0.00 Clock/interrupt latency - - 60.15 40.50 221.50 0.00 Clock DSR latency - - 472 424 572 (main stack: 1052) Thread stack used (1912 total) -All done, main stack : stack used 1052 size 2936 -All done : Interrupt stack used 280 size 4096 -All done : Idlethread stack used 516 size 2048 - -Timing complete - 30590 ms total - -PASS:<Basic timing OK> -EXIT:<done> - - - - - - - -Board: ARM Industrial Module AIM711 (S3C4510) - -Board: ARM Industrial Module AIM711 (S3C4510) -CPU : S3C4510B (ARM7TDMI core), 50MHz -8MB RAM, 2MB Flash - -Startup, main stack : stack used 82 size 2400 -Startup : Interrupt stack used 134 size 4096 -Startup : Idlethread stack used 91 size 2048 - -eCos Kernel Timings -Notes: all times are in microseconds (.000001) unless otherwise stated - -Reading the hardware clock takes 33 'ticks' overhead -... this value will be factored out of all other measurements -Clock interrupt took 17.68 microseconds (884 raw clock ticks) - -Testing parameters: - Clock samples: 32 - Threads: 64 - Thread switches: 128 - Mutexes: 32 - Mailboxes: 32 - Semaphores: 32 - Scheduler operations: 128 - Counters: 32 - Flags: 32 - Alarms: 32 - - - Confidence - Ave Min Max Var Ave Min Function - ====== ====== ====== ====== ========== ======== - 22.99 15.24 36.98 4.01 50% 26% Create thread - 2.96 2.88 8.30 0.17 98% 98% Yield thread [all suspended] - 3.57 3.36 8.76 0.26 93% 71% Suspend [suspended] thread - 3.64 3.00 8.74 0.33 65% 20% Resume thread - 5.44 4.78 15.10 0.42 75% 26% Set priority - 0.77 0.20 1.98 0.25 59% 17% Get priority - 14.46 12.40 33.02 1.03 85% 9% Kill [suspended] thread - 2.95 2.88 7.44 0.14 98% 98% Yield [no other] thread - 6.73 5.40 15.60 0.44 78% 6% Resume [suspended low prio] thread - 3.59 2.98 7.18 0.28 56% 21% Resume [runnable low prio] thread - 5.77 4.78 13.46 0.44 71% 18% Suspend [runnable] thread - 2.97 2.88 8.86 0.18 98% 98% Yield [only low prio] thread - 3.40 2.86 6.26 0.26 59% 17% Suspend [runnable->not runnable] - 14.15 12.08 30.54 1.09 78% 23% Kill [runnable] thread - 11.00 9.74 23.38 0.75 70% 31% Destroy [dead] thread - 20.35 17.72 43.00 1.26 73% 14% Destroy [runnable] thread - 23.77 21.02 45.38 1.59 68% 35% Resume [high priority] thread - 8.40 8.30 15.38 0.18 89% 89% Thread switch - - 0.10 0.08 1.52 0.03 92% 92% Scheduler lock - 2.01 1.98 3.80 0.06 92% 92% Scheduler unlock [0 threads] - 2.01 1.98 3.80 0.06 92% 92% Scheduler unlock [1 suspended] - 2.01 1.98 4.08 0.06 92% 92% Scheduler unlock [many suspended] - 2.01 1.98 3.68 0.05 92% 92% Scheduler unlock [many low prio] - - 0.67 0.54 3.90 0.21 96% 96% Init mutex - 4.55 4.14 12.40 0.53 96% 87% Lock [unlocked] mutex - 4.84 4.12 12.78 0.56 65% 56% Unlock [locked] mutex - 3.72 3.18 8.86 0.41 68% 56% Trylock [unlocked] mutex - 3.22 2.76 5.38 0.26 65% 28% Trylock [locked] mutex - 0.49 0.34 3.26 0.26 93% 84% Destroy mutex - 33.13 32.42 43.64 0.66 90% 81% Unlock/Lock mutex - - 1.21 1.06 5.12 0.25 96% 96% Create mbox - 0.63 0.46 2.66 0.22 96% 71% Peek [empty] mbox - 4.57 3.64 11.12 0.50 75% 18% Put [first] mbox - 0.52 0.10 2.74 0.23 62% 18% Peek [1 msg] mbox - 5.39 4.46 12.00 0.56 75% 43% Put [second] mbox - 0.51 0.10 2.38 0.22 62% 18% Peek [2 msgs] mbox - 5.06 4.00 13.86 0.60 81% 18% Get [first] mbox - 5.01 4.36 9.20 0.38 68% 25% Get [second] mbox - 5.56 4.70 11.22 0.55 75% 37% Tryput [first] mbox - 4.25 3.14 10.64 0.49 75% 9% Peek item [non-empty] mbox - 5.10 3.82 14.02 0.78 78% 40% Tryget [non-empty] mbox - 3.86 3.12 9.72 0.47 81% 21% Peek item [empty] mbox - 4.13 3.28 11.20 0.54 87% 59% Tryget [empty] mbox - 0.60 0.14 2.34 0.22 68% 9% Waiting to get mbox - 0.61 0.14 2.90 0.27 78% 15% Waiting to put mbox - 4.51 3.66 11.20 0.53 84% 50% Delete mbox - 26.55 26.00 31.46 0.37 78% 40% Put/Get mbox - - 0.53 0.44 2.68 0.15 96% 90% Init semaphore - 3.08 2.76 5.02 0.29 43% 46% Post [0] semaphore - 3.64 3.20 7.72 0.40 53% 50% Wait [1] semaphore - 3.08 2.66 7.40 0.39 50% 50% Trywait [0] semaphore - 2.72 2.62 5.88 0.20 96% 96% Trywait [1] semaphore - 0.85 0.52 3.30 0.32 50% 50% Peek semaphore - 0.80 0.34 3.74 0.39 46% 37% Destroy semaphore - 21.87 21.54 25.64 0.28 68% 65% Post/Wait semaphore - - 1.18 1.04 4.92 0.24 96% 96% Create counter - 0.69 0.52 2.84 0.24 93% 71% Get counter value - 0.26 0.14 1.76 0.18 78% 78% Set counter value - 3.73 3.24 5.62 0.14 78% 12% Tick counter - 0.79 0.36 3.58 0.19 78% 15% Delete counter - - 0.53 0.44 3.06 0.17 96% 90% Init flag - 3.49 3.02 9.28 0.45 53% 50% Destroy flag - 2.93 2.52 7.42 0.39 50% 46% Mask bits in flag - 3.58 3.12 9.38 0.46 50% 50% Set bits in flag [no waiters] - 7.48 7.22 12.90 0.35 96% 96% Wait for flag [AND] - 4.92 4.66 11.22 0.39 96% 96% Wait for flag [OR] - 4.58 4.30 11.66 0.44 96% 96% Wait for flag [AND/CLR] - 4.39 4.12 11.02 0.43 96% 96% Wait for flag [OR/CLR] - 0.06 0.00 1.40 0.11 87% 87% Peek on flag - - 1.82 1.58 8.02 0.40 96% 96% Create alarm - 7.27 6.54 17.86 0.77 93% 87% Initialize alarm - 3.30 2.58 7.28 0.60 56% 71% Disable alarm - 7.60 5.82 14.72 0.84 81% 12% Enable alarm - 3.86 3.06 9.20 0.67 53% 65% Delete alarm - 4.03 3.90 7.18 0.23 96% 90% Tick counter [1 alarm] - 25.12 24.98 28.82 0.24 96% 93% Tick counter [many alarms] - 7.92 7.64 14.00 0.40 96% 96% Tick & fire counter [1 alarm] - 155.10 154.42 161.04 0.37 90% 6% Tick & fire counters [>1 together] - 29.27 29.02 35.48 0.42 96% 93% Tick & fire counters [>1 separately] - 17.87 17.32 49.30 0.56 98% 97% Alarm latency [0 threads] - 24.39 22.02 63.60 1.43 57% 19% Alarm latency [2 threads] - 55.33 52.72 62.44 1.11 67% 20% Alarm latency [many threads] - 37.98 36.54 170.56 2.17 97% 97% Alarm -> thread resume latency - - 29 0 259 (main stack: 805) Thread stack used (1120 total) -All done, main stack : stack used 805 size 2400 -All done : Interrupt stack used 163 size 4096 -All done : Idlethread stack used 239 size 2048 - -Timing complete - 28880 ms total - -PASS:<Basic timing OK> -EXIT:<done> - - - diff --git a/doc/sgml/user-guide/target-setup.sgml b/doc/sgml/user-guide/target-setup.sgml deleted file mode 100644 --- a/doc/sgml/user-guide/target-setup.sgml +++ /dev/null @@ -1,3105 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Target Setup - - -The following sections detail the setup of many of the targets -supported by eCos. - - - - -This information is presented here only temporarily. It is intended -that there will be separate documents detailing this information for -each target in future releases. Consequently not much effort has been -put into bringing the following documentation up to date -- much of it -is obsolete, bogus or just plain wrong. - - - - - - - - -MN10300 stdeval1 Hardware Setup -The eCos Developer’s Kit package comes with a pair -of EPROMs which provide GDB support for the Matsushita MN10300 (AM31) -series evaluation board using CygMon, the Cygnus ROM monitor. Images -of these EPROMs are also provided at BASE_DIR/loaders/mn10300-stdeval1/cygmon.bin. -The LSB EPROM (LROM) is installed to socket IC8 on the board and -the MSB EPROM (UROM) is installed to socket IC9. Attention should -be paid to the correct orientation of these EPROMs during installation. -The CygMon stubs allows communication with GDB by way of the -serial port at connector CN2. The communication parameters are fixed -at 38400 baud, 8 data bits, no parity bit, and 1 stop bit (8-N-1). -No flow control is employed. Connection to the host computer should -be made using a standard RS232C serial cable (not a null modem cable). -A gender changer may also be required. - - - - - -MN10300 Architectural Simulator Setup -The MN10300 simulator is an architectural simulator for the -Matsushita MN10300 that implements all features of the microprocessor - necessary to run eCos. The current implementation provides accurate -simulation of the instruction set, interrupt controller, timers, -and serial I/O. -In this release, you can run the same eCos binaries in the -simulator that can run on target hardware, if built for ROM start-up, -with the exception of those that use the watchdog timer. -However, note that AM33 devices required to run eCos are not -simulated; therefore you cannot run eCos binaries built for the -AM33 under the simulator. For the AM33, the simulator is effectively -an instruction-set only simulator. -To simplify connection to the simulator, you are advised to -create a GDB macro by putting the following code in your personal -GDB start-up file (gdb.ini on Windows and .gdbinit on UNIX). -define msim - target sim --board=stdeval1 --memory-region 0x34004000,0x8 - - rbreak cyg_test_exit - rbreak cyg_assert_fail -end -You can then connect to the simulator by invoking the command msim on -the command line: -(gdb) msim -You can achieve the same effect by typing out the macro’s -content on the command line if necessary. - - - - - -AM33 STB Hardware Setup -The Matsushita AM33 STB System Reference Board may be used -in two modes: via a JTAG debugger, or by means of a GDB stub ROM. - -Use with GDB Stub ROM -The eCos Developer’s Kit package comes with a ROM -image which provides GDB support for -the Matsushita(R) AM33 STB System Reference Board. To install the -GDB stub ROM requires the use of the JTAG debugger and the Flash ROM -programming code available from Matsushita. An image of this ROM -is also provided at loaders/am33-stb/gdbload.bin under -the root of your eCos installation. -Ensure that there is a Flash ROM card in MAIN MEMORY SLOT <0>. -Follow the directions for programming a Flash ROM supplied with -the programming software. -The final programming of the ROM will need to be done with -a command similar to the following: -fdown "gdbload.bin",0x80000000,16,1 -Once the ROM has been programmed, close down the JTAG debugger, -turn the STB off, and disconnect the JTAG cable. Ensure that the -hardware switches are in the following configuration: -U U D D D U D D - -D = lower part of rocker switch pushed in -U = upper part of rocker switch pushed in -This is also the configuration required by the Flash programming -code, so it should not be necessary to change these. -Restart the STB and the stub ROM will now be able to communicate -with GDB. eCos programs should be built -with RAM startup. -Programs can then be downloaded via a standard RS232 null -modem serial cable connected to the SERIAL1 connector on the STB -front panel (the AM33"s serial port 0). This line is programmed -to run at 38400 baud, 8 data bits, no parity and 1 stop bit (8-N-1) -with no flow control. A gender changer may also be required. Diagnostic -output will be output to GDB using the same connection. -This procedure also applies for programming ROM startup eCos -programs into ROM, given a binary format image of the program from mn10300-elf-objcopy. - - -Use with the JTAG debugger -To use eCos from the JTAG debugger, executables must be built -with ROM startup and then downloaded via the JTAG debugger. For -this to work there must be an SDRAM memory card in SUB MEMORY SLOT <0> and -the hardware switches on the front panel set to the following: -D U D D D U D D - -D = lower part of rocker switch pushed in -U = upper part of rocker switch pushed in -Connect the JTAG unit and run the debugger as described in -the documentation that comes with it. -eCos executables should be renamed to have a “.out” extension -and may then be loaded using the debugger"s “l” or “lp” commands. -Diagnostic output generated by the program will be sent out -of the AM33"s serial port 0 which is connected to the SERIAL1 -connector on the STB front panel. This line is programmed to run -at 38400 baud, 8 data bits, no parity, and one stop bit (8-N-1) -with no flow control. Connection to the host computer should be -using a standard RS232 null modem serial cable. A gender changer -may also be required. - - -Building the GDB stub ROM image -eCos comes with a pre-built GDB stub ROM image for the AM33-STB -platform. This can be found at loaders/am33-stb/gdbload.bin relative -to the eCos installation directory. -If necessary, the ROM image can be re-built as follows: - - - On Windows hosts, open a Bash session using -Start->Programs->Red Hat eCos->eCos -Development Environment - - -Create a build directory and cd into it - - -Run (all as one line): - -cygtclsh80 BASE_DIR/packages/pkgconf.tcl \ - --target=mn10300_am33 --platform stb --startup rom \ - --disable-kernel --disable-uitron --disable-libc --disable-libm \ - --disable-io --disable-io_serial --disable-wallclock ---disable-watchdog - -where BASE_DIR is the path to the eCos installation -directory. - - -Edit the configuration file -pkgconf/hal.h - in the build directory tree by ensuring the following configuration -options are set as follows: - -#define CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS -#define CYGDBG_HAL_DEBUG_GDB_BREAK_SUPPORT -#undef CYGDBG_HAL_DEBUG_GDB_CTRLC_SUPPORT -#define CYGDBG_HAL_DEBUG_GDB_THREAD_SUPPORT -#define CYG_HAL_ROM_MONITOR - - - -Run: make - - -Run: make -C hal/common/current/current/src/stubrom - - -The file -hal/common/current/src/stubrom - will be an ELF format executable of the ROM image. Use mn10300-elf-objcopy to -convert this to the appropriate format for loading into the Matsushita -FLASH ROM programmer, mode “binary” in this case: - -$ mn10300-elf-objcopy -O binary hal/common/current/src/stubrom/ \ - stubrom stubrom.img - - - - - - - - -TX39 Hardware Setup -The eCos Developer’s Kit package comes with a pair -of ROMs that provide GDB support for -the Toshiba JMR-TX3904 RISC processor reference board by way of CygMon. -Images of these ROMs are also provided at BASE_DIR/loaders/tx39-jmr3904/cygmon50.bin and BASE_DIR/loaders/tx39-jmr3904/cygmon66.bin for -50 MHz and 66 MHz boards respectively. The ROMs are installed to -sockets IC6 and IC7 on the memory daughterboard according to their -labels. Attention should be paid to the correct orientation of these -ROMs during installation. -The GDB stub allows communication with GDB using the serial -port (channel C) at connector PJ1. The communication parameters -are fixed at 38400 baud, 8 data bits, no parity bit, and 1 stop -bit (8-N-1). No handshaking is employed. Connection to the host -computer should be made using an RS232C null modem cable. -CygMon and eCos currently provide support for a 16Mbyte 60ns -72pin DRAM SIMM fitted to the PJ21 connector. Different size DRAMs -may require changes in the value stored in the DCCR0 register. This -value may be found near line 211 in hal/mips/arch/&Version;/src/vectors.S -in eCos, and near line 99 in - libstub/mips/tx39jmr/tx39jmr-power.S in -CygMon. eCos does not currently use the DRAM for any purpose itself, -so it is entirely available for application use. - - - - - -TX39 Architectural Simulator Setup -The TX39 simulator is an architectural simulator which implements -all the features of the Toshiba TX39 needed to run eCos. The current -implementation provides accurate simulation of the instruction set, - interrupt controller, and timers, as well as having generic support -for diagnostic output, serial I/O, and exceptions. -In this release, you can run the same eCos binaries in the -simulator that can run on target hardware, if it is built for ROM -start-up. -To simplify connection to the simulator, you are advised to -create a GDB macro by putting the following code in your personal -GDB start-up file (gdb.ini on Windows and .gdbinit on UNIX). -define tsim - target sim --board=jmr3904pal --memory-region 0xffff8000,0x900 \ - --memory-region 0xffffe000,0x4 \ - --memory-region 0xb2100000,0x4 - rbreak cyg_test_exit - rbreak cyg_assert_fail -end -You can then connect to the simulator by invoking the command tsim on -the command line: -(gdb) tsim -You can achieve the same effect by typing out the macro’s -content on the command line if necessary. - - - - - -TX49 Hardware Setup -The eCos installation CD contains a copy of the eCos GDB stubs -in SREC format which must be programmed into the board’s -FLASH memory. - -Preparing the GDB stubs -These stub preparation steps are not strictly necessary as -the eCos distribution ships with pre-compiled stubs in the directory loaders/tx49-ref4955 relative -to the installation root. - -Building the GDB stub image with the eCos Configuration Tool - - - Start with a new document - selecting the -File->New - menu item if necessary to do this. - - -Choose the -Build->Templates - menu item, and then select the TX49 REF4955 hardware. - - -While still displaying the -Build->Templates - dialog box, select the stubs package template to build a GDB stub. -Click -OK. - - -Build eCos stubs using -Build->Library. - - -When the build completes, the image files can be found -in the bin/ subdirectory of the install tree. GDB stub -images have the prefix gdb_module. - - - - - Building the GDB stub image with ecosconfig - - - Make an empty directory to contain the build tree, - and cd into it. - - -To build a GDB stub ROM image, enter the command: -$ ecosconfig new ref4955 stubs - - -Enter the commands: -$ ecosconfig tree -$ make - - -When the build completes, the image files can be found -in the bin/ subdirectory of the install tree. GDB stub -images have the prefix gdb_module. - - - - - - Installing GDB stubs into FLASH -Boot into the board’s firmware in little-endian mode: -Set the switches like this: -SW1: 10000000 (first lever up, the rest down) -SW2: 10000010 -Connect serial cable on the lower connector, configure terminal -emulator for 38400, 8-N-1. -When booting the board, you should get this prompt: -HCP5 rev 0.9B . -HCP5? -Select o (option), a (FLASH) and b (boot write). You should -see this: -Boot ROM Write -ROM address-ffffffffbd000000, Boot Bus-[32bit] -ID2 0 4 ffffffffa002ad40 -zzz SS-40000 IV-1 CS-20000 CC-2 -Flash ROM-[28F640J5], [16bit chip] * 2 * 1 -Block size-00040000 count-64 -ROM adr ffffffffbd000000-ffffffffbe000000 mask-00fc0000 -Send Srecord file sa=00000000 size=ffffffffffffffff -ra=fffffffffe000000 - -Now send the stub SREC data down to the board using the terminal - emulator’s ‘send ASCII’ (or similar) -functionality. -Red Hat has experienced some sensitivity to how fast the data -is written to the board. Under Windows you should configure Minicom -to use a line delay of 100 milliseconds. Under Linux, use the slow_cat.tcl - script: -% cd BASE_DIR/packages/hal/mips/ref4955/&Version;/misc -% slow_cat.tcl < [path]/gdb_module.srec > /dev/ttyS0 -Power off the board, and change it to boot the GDB stubs in -big-endian mode by setting the switches like this: -SW1: 00000000 (all levers down) -SW2: 10001010 -The GDB stubs allow communication with GDB using the serial -port at connector PJ7A (lower connector). The communication parameters -are fixed at 38400 baud, 8 data bits, no parity bit and 1 stop -bit (8-N-1). No flow control is employed. Connection to the host -computer should be made using a straight through serial cable. - - - - - - -VR4300 Hardware Setup -The eCos Developer’s Kit package comes with an EPROM -which provides GDB support for the NEC -VRC4373 evaluation board. An image of this EPROM is also provided -at loaders/vr4300-vrc4373/gdbload.bin under -the root of your eCos installation. -The EPROM is installed to socket U12 on the board. Attention -should be paid to the correct orientation of the EPROM during installation. -Only replace the board"s existing ROM using a proper PLCC -extraction tool, as the socket would otherwise risk getting damaged. -The GDB stub in the EPROM allows communication with GDB using -the serial port at connector J1. The communication parameters are -fixed at 38400 baud, 8 data bits, no parity bit and 1 stop bit (8-N-1). -No flow control is employed. Connection to the host computer should -be made using a straight-through serial cable. - - -VRC4375 Hardware Setup -For information about setting up the VRC4375 to run with RedBoot, -consult the RedBoot User"s Guide. If using serial debugging, -the serial line runs at 38400 baud 8-N-1 and should be connected -to the debug host using the cable supplied with the board. - - -Atlas/Malta Hardware Setup -For information about setting up the Atlas and Malta boards to -run with RedBoot, consult the RedBoot User"s Guide. - - -PowerPC Cogent Hardware Setup -The eCos Developer’s Kit package comes with an EPROM -which provides GDB support for the Cogent -evaluation board. An image of this EPROM is also provided at - loaders/powerpc-cogent/gdbload.bin under -the root of your eCos installation. The same EPROM and image can -be used on all three supported daughterboards: CMA287-23 (MPC823), -CMA287-50 (MPC850), and CMA286-60 (MPC860). -The EPROM is installed to socket U4 on the board. Attention -should be paid to the correct orientation of the EPROM during installation. -If you are going to burn a new EPROM using the binary image, -be careful to get the byte order correct. It needs to be big-endian. -If the EPROM burner software has a hex-editor, check that the first -few bytes of the image look like: -00000000: 3c60 fff0 6063 2000 7c68 03a6 4e80 0020 <`..`c.|h..N.. -If the byte order is wrong you will see 603c instead of 3c60 -etc. Use the EPROM burner software to make a byte-swap before you -burn to image to the EPROM. -If the GDB stub EPROM you burn does not work, try reversing -the byte-order, even if you think you have it the right way around. -At least one DOS-based EPROM burner program is known to have the -byte-order upside down. -The GDB stub in the EPROM allows communication with GDB using -the serial port at connector P12 (CMA101) or P3 (CMA102). The communication parameters -are fixed at 38400 baud, 8 data bits, no parity bit and 1 stop bit -(8-N-1). No flow control is employed. Connection to the host computer -should be made using a dedicated serial cable as specified in the -Cogent CMA manual. - -Installing the Stubs into ROM - -Preparing the Binaries -These two binary preparation steps are not strictly necessary -as the eCos distribution ships with pre-compiled binaries in the -directory loaders/powerpc-cogent relative to the installation -root. - -Building the ROM images with the eCos Configuration Tool - - -Start with a new document - selecting the -File->New - menu item if necessary to do this. - - -Choose the -Build->Templates - menu item, and then select the PowerPC CMA28x hardware. - - -While still displaying the -Build->Templates - dialog box, select the “stubs” package template -to build a GDB stub. Click -OK. - - -Build eCos using -Build->Library. - - -When the build completes, the image files can be found -in the bin/ subdirectory of the install tree. GDB stub -ROM images have the prefix “gdb_module”. - - - - -Building the ROM images with ecosconfig - - -Make an empty directory to contain the build tree, -and cd into it. - - -To build a GDB stub ROM image, enter the command: - -$ ecosconfig new cma28x stubs - - -Enter the commands: - -$ ecosconfig tree -$ make - - - -When the build completes, the image files can be found -in the bin/ subdirectory of the install tree. GDB stub -ROM images have the prefix “gdb_module”. - - - - - - Installing the Stubs into ROM or FLASH - - -Program the binary image file gdb_module.bin -into ROM or FLASH referring to the instructions of your ROM programmer. - - - Plug the ROM/FLASH into socket U4 as described -at the beginning of this Hardware Setup section. - - - - - - -PowerPC MBX860 Hardware Setup -The eCos Developer’s Kit package comes with an EPROM -which provides GDB support for the Motorola -PowerPC MBX860 evaluation board. An image of this EPROM is also -provided at loaders/powerpc-mbx/gdbload.bin under -the root of your eCos installation. -The EPROM is installed to socket XU1 on the board. Attention -should be paid to the correct orientation of the EPROM during installation. -Only replace the board"s existing ROM using a proper PLCC -extraction tool, as the socket would otherwise risk getting damaged. -The GDB stub in the EPROM allows communication with GDB using -the serial port at connector SMC1/COM1. The communication -parameters are fixed at 38400 baud, 8 data bits, no parity bit and -1 stop bit (8-N-1). No flow control is employed. Connection to the -host computer should be made using a suitable serial cable. -In order to make the board execute the EPROM that you just -installed (rather than the on-board FLASH memory), it may be necessary -move some links on the board. Specifically, ensure that link J4 -is in position 1-2. If in doubt, refer to the MBX documentation -from Motorola, ensuring that Boot Port Size=8 Bits/ROM -for BOOT (CS#7), in their terminology. - -Installing the Stubs into FLASH - -Preparing the Binaries -These two binary preparation steps are not strictly necessary -as the eCos distribution ships with pre-compiled binaries in the -directory loaders/powerpc-mbx relative to the installation -root. - -Building the ROM images with the eCos Configuration Tool - - -Start with a new document - selecting the -File->New - menu item if necessary to do this. - - -Choose the -Build->Templates - menu item, and then select the PowerPC Motorola MBX860/821 -hardware. - - -While still displaying the -Build->Templates - dialog box, select the “stubs” package template -to build a GDB stub. Click -OK. - - -Build eCos using -Build->Library. - - -When the build completes, the image files can be found -in the bin/ subdirectory of the install tree. GDB stub -ROM images have the prefix “gdb_module”. - - - - -Building the ROM images with ecosconfig - - -Make an empty directory to contain the build tree, -and cd into it. - - -To build a GDB stub ROM image, enter the command: - -$ ecosconfig new mbx stubs - - -Enter the commands: - -$ ecosconfig tree -$ make - - -When the build completes, the image files can be found -in the bin/ subdirectory of the install tree. GDB stub -ROM images have the prefix “gdb_module”. - - - - - - Installing the Stubs into ROM - - - Program the binary image file gdb_module.bin -into ROM or FLASH referring to the instructions of your ROM programmer. - - - Plug the ROM/FLASH into socket XU1 as described -near the beginning of this Hardware Setup section. - - - - -Installing the Stubs into FLASH -This assumes you have EPPC-Bug in the on-board FLASH. This -can be determined by setting up the board according to the below -instructions and powering up the board. The EPPC-Bug prompt should -appear on the SMC1 connector at 9600 baud, 8N1. - - -Set jumper 3 to 2-3 [allow XU2 FLASH to -be programmed] - - -Set jumper 4 to 2-3 [boot EPPC-Bug] - - - - Program FLASH - - - Prepare EPPC-Bug for download: -EPPC-Bug>lo 0 -At this point the monitor is ready for input. It will not return -the prompt until the file has been downloaded. - - -Use the terminal emulator’s ASCII download feature -(or a simple clipboard copy/paste operation) to download -the gdb_module.srec data. - -Note that on Linux, Minicom’s ASCII download feature seems -to be broken. A workaround is to load the file into Emacs (or another -editor) and copy the full contents to the clipboard. Then press -the mouse paste-button (usually the middle one) over the Minicom -window. - - -Program the FLASH with the downloaded data: - -EPPC-Bug>pflash 40000 60000 fc000000 - - -Switch off the power, and change jumper 4 to 1-2. Turn -on the power again. The board should now boot using the newly programmed -stubs. - - - - - - - -PowerPC Architectural Simulator Setup -The PowerPC simulator is an architectural simulator which -implements all the features of the PowerPC needed to run eCos. The -current implementation provides accurate simulation of the instruction -set and timers, as well as having generic support for diagnostic -output and exceptions. -The simulator also allows devices to be simulated, but no -device simulation support has been defined for the serial device -drivers in this release. -To simplify connection to the simulator, you are advised to -create a GDB macro by putting the following code in your personal -GDB start-up file (gdb.ini on Windows and .gdbinit on UNIX). -define psim - target sim -o ’/iobus/pal@0xf0001000/reg 0xf0001000 32’ - rbreak cyg_test_exit - rbreak cyg_assert_fail -end -You can then connect to the simulator by invoking the command psim on -the command line: -(gdb) psim -You can achieve the same effect by typing out the macro’s -content on the command line if necessary. - -The PowerPC simulator cannot execute binaries built for any -of the supported hardware targets. You must generate a configuration -using the PowerPC simulator platform: -$ ecosconfig new psim - or some such. - - - -SPARClite Hardware Setup -The eCos Developer’s Kit package comes with a ROM -which provides GDB support for the Fujitsu SPARClite Evaluation -Board by way of CygMon. -An image of this ROM is also provided at - BASE_DIR/loaders/sparclite-sleb/cygmon.bin. The -ROM is installed in socket IC9 on the evaluation board. Attention -should be paid to the correct orientation of the ROM during installation. -The GDB stub allows communication with GDB using a TCP channel -via the ethernet port at connector J5. - -<!-- <index></index> --><!-- <xref> -->Ethernet Setup -The ethernet setup is described in the board’s manual, -but here is a recapitulation. -Set the board’s ethernet address using SW1 on the -motherboard: - SW1-4 SW1-3 SW1-2 SW1-1 Ethernet Address - ----- ----- ----- ----- ---------------- - OFF OFF OFF OFF No ethernet, use serial - OFF OFF OFF ON 00:00:0E:31:00:01 - OFF OFF ON OFF 00:00:0E:31:00:02 - OFF OFF ON ON 00:00:0E:31:00:03 - OFF ON OFF OFF 00:00:0E:31:00:04 - OFF ON OFF ON 00:00:0E:31:00:05 - OFF ON ON OFF 00:00:0E:31:00:06 - OFF ON ON ON 00:00:0E:31:00:07 - ON OFF OFF OFF 00:00:0E:31:00:08 - ON OFF OFF ON 00:00:0E:31:00:09 - ON OFF ON OFF 00:00:0E:31:00:0A - ON OFF ON ON 00:00:0E:31:00:0B - ON ON OFF OFF 00:00:0E:31:00:0C - ON ON OFF ON 00:00:0E:31:00:0D - ON ON ON OFF 00:00:0E:31:00:0E - ON ON ON ON 00:00:0E:31:00:0F - -BOOTP/DHCP service on Linux -Configure the BOOTP or DHCP server on the network to recognize -the evaluation board’s ethernet address so it can assign -the board an IP address. Below is a sample DHCP server configuration -from a Linux system (/etc/dhcpd.conf). -It shows a setup for three evaluation boards. -# -# DHCP server configuration. -# -allow bootp; - -subnet 192.168.1.0 netmask 255.255.255.0 { - host mb831evb { - hardware ethernet 00:00:0e:31:00:01; - fixed-address mb831evb; - } - host mb832evb { - hardware ethernet 00:00:0e:31:00:02; - fixed-address mb832evb; - } - host mb833evb { - hardware ethernet 00:00:0e:31:00:03; - fixed-address mb833evb; - } -} - - -BOOTP/DHCP boot process -Even when configured to use a TCP channel, CygMon will still -print a boot message to the serial channel. If the BOOTP process -was successful and an IP address was found, a message “BOOTP -found xxx.xxx.xxx.xxx” will be printed where xxx.xxx.xxx.xxx -is the IP address assigned by the BOOTP or DHCP server. If the BOOTP -process fails, a message indicating failure will be printed and -the serial port will be used as the debug channel. -Once the board finds an IP address it will respond to ICMP -echo request packets (ping). This gives a simple means to test the -health of the board. -As described in “Ethernet Setup” on page 72, -it should now be possible to connect to the SPARClite board from -within GDB by using the command: -(gdb) target remote <host>:1000 - - - -Serial Setup -The CygMon stubs also allow communication with GDB by way -of the serial port at connector CON1. The communication parameters -are fixed at 19200 baud, 8 data bits, no parity bit and 1 stop bit -(8-N-1). No flow control is employed. Connection to the host computer -should be made using a null modem cable. A gender changer may also -be required. - - - -SPARClite Architectural Simulator Setup -The ESA SPARClite simulator is an architectural simulator -which implements all the features of the SPARClite needed to run -eCos. The current implementation provides accurate simulation of -the instruction set, interrupt controller, and timers, as well as -having generic support for diagnostic output and exceptions. -Note that the ESA SPARClite simulator is unsupported, but -is included in the release as a convenience. -To simplify connection to the simulator, you are advised to -create a GDB macro by putting the following code in your personal -GDB start-up file (gdb.ini on Windows and .gdbinit on UNIX). -define ssim - target sim -nfp -sparclite -dumbio - rbreak cyg_test_exit - rbreak cyg_assert_fail -end -You can then connect to the simulator by invoking the command ssim on -the command line: -(gdb) ssim -You can achieve the same effect by typing out the macro’s -content on the command line if necessary. - - -<!-- <index></index> --><!-- <xref> -->ARM PID Hardware Setup -eCos comes with two ROM images that provide GDB support for -the ARM PID board. The first ROM image provides a port of the CygMon -ROM monitor, which includes a command-line interface and a GDB remote -stub. The second ROM image provides a remote GDB stub only, which -is a minimal environment for downloading and debugging eCos programs -solely using GDB. -eCos, CygMon and the GDB stubs all support the PID fitted -with both ARM7T and ARM9 daughterboards. CygMon and the stubs can -be programmed into either the programmable ROM (U12) or the FLASH -(U13). Pre-built forms of both ROM images are provided in the directory -loaders/arm-pid under the root of your eCos installation, -along with a tool that will program the stubs into the FLASH memory on -the board. CygMon images are prefixed with the name 'cygmon' and -GDB stub ROM images are given the prefix 'gdb_module'. -Images may be provided in a number of formats including ELF (.img -extension), binary (.bin extension) and SREC (.srec extension). -Note that some unreliability has been experienced in downloading -files using Angel 1.00. Angel 1.02 appears to be more robust in -this application. - -Installing the Stubs into FLASH - -Preparing the Binaries -These two binary preparation steps are not strictly necessary -as the eCos distribution ships with pre-compiled binaries in the -directory loaders/arm-pid relative to the installation -root. - - -Building the ROM images with the eCos Configuration Tool - - -Start with a new document - selecting the -File->New - menu item if necessary to do this. - - -Choose the -Build --> -Templates - menu item, and then select the ARM PID hardware. - - -While still displaying the -Build --> -Templates - dialog box, select either the "stubs" package template to build -a GDB stub image, or the "cygmon" template to build the CygMon ROM -Monitor. Click -OK. - - -Build eCos using -Build --> -Library - - -When the build completes, the image files can be found -in the bin/ subdirectory of the install tree. GDB stub -ROM images have the prefix "gdb_module". CygMon images -have the prefix "cygmon". - - - - -Building the ROM images with ecosconfig - - - - Make an empty directory to contain the build tree, -and cd into it. - - -To build a GDB stub ROM image, enter the command: -$ ecosconfig new pid stubs -or to build a CygMon ROM monitor image, enter the command: -$ ecosconfig new pid cygmon - - -Enter the commands: -$ ecosconfig tree -$ make - - -When the build completes, the image files can be found -in the bin/ subdirectory of the install tree. GDB stub -ROM images have the prefix "gdb_module". CygMon images -have the prefix "cygmon". - - - - -Building the FLASH Tool with the eCos Configuration Tool - - -Start with a new document - selecting the -File->New - menu item if necessary to do this. - - -Choose the -Build->Templates - menu item, and then select the ARM PID hardware. - - -Enable the "Build flash programming tool" option in the -ARM PID HAL (CYGBLD_BUILD_FLASH_TOOL) -and resolve any resulting configuration conflicts. - - -Build eCos using -Build --> -Library - - -When the build completes, the FLASH tool image file can -be found in the bin/ subdirectory of the install tree, -with the prefix "prog_flash" - - - - -Building the FLASH Tool with ecosconfig - - - - Make an empty directory to contain the build tree, -and cd into it - - - -Enter the command: -$ ecosconfig new pid - - -Edit the file ecos.ecc and enable the option CYGBLD_BUILD_FLASH_TOOL -by uncommenting its user_value property and setting it -to 1. - - -Enter the commands: -$ ecosconfig resolve -[there will be some output] -$ ecosconfig tree -$ make - - -When the build completes, the FLASH tool image file can -be found in the bin/ subdirectory of the install tree, -with the prefix "prog_flash" - - - - -Prepare the Board for FLASH Programming -Each time a new image is to be programmed in the FLASH, the -jumpers on the board must be set to allow Angel to run: - - - Set jumper 7-8 on LK6 [using the Angel code -in the 16 bit EPROM] - - -Set jumper 5-6 on LK6 [select 8bit ROM mode] - - -Set jumper LK18 [ROM remap - this is -also required for eCos] - - -Set S1 to 0-0-1-1 [20MHz operation] - - -Open jumper LK4 [enable little-endian operation] - -Attach a serial cable from Serial A on the PID board to connector -1 on the development system. This is the cable through which the -binaries will be downloaded. Attach a serial cable from Serial B -on the PID board to connector 2 on the development system (or any -system that will work as a terminal). Through this cable, the FLASH -tool will write its instructions (at 38400 baud). - - - - -Program the FLASH - - -Download the FLASH ROM image onto the PID board. For -example. for the GDB stubs image: - -bash$ arm-elf-gdb -nw gdb_module.img -GNU gdb 4.18-DEVTOOLSVERSION -Copyright 1998 Free Software Foundation, Inc. -GDB is free software, covered by the GNU General Public License, -and you are welcome to change it and/or distribute copies -of it under certain conditions. Type "show copying" to see the conditions. -There is absolutely no warranty for GDB. Type "show warranty" for details. -This GDB was configured as "--host=i586-pc-cygwin32 --target=arm-elf". -(no debugging symbols found)... -(gdb) target rdi s=com1 -Angel Debug Monitor for PID (Built with Serial(x1), Parallel, DCC) 1.00 -(Advanced RISC Machines SDT 2.10) -Angel Debug Monitor rebuilt on Jan 20 1997 at 02:33:43 -Connected to ARM RDI target. -(gdb) load -Loading section .rom_vectors, size 0x44 lma 0x60000 -Loading section .text, size 0x1f3c lma 0x60044 -Loading section .rodata, size 0x2c lma 0x61f80 -Loading section .data, size 0x124 lma 0x61fac -Start address 0x60044 , load size 8400 -Transfer rate: 5169 bits/sec. -(gdb) q -The program is running. Exit anyway? (y or n) y - - - On a UNIX or Linux system, the serial port must be - /dev/ttyS0 instead of COM1. - You need to make sure that the /dev/ttyS0 files -have the right permissions: -$ su - Password: - # chmod o+rw /dev/ttyS0* - # exit - -If you are programming the GDB stub image, it will now be located -at 0x60000..0x64000. If you are programming the Cygmon ROM Monitor, -it will be located at 0x60000..0x80000. - - - -Now download the FLASH programmer tool -bash$ arm-elf-gdb prog_flash.img -GNU gdb 4.18-DEVTOOLSVERSION -Copyright 1998 Free Software Foundation, Inc. -GDB is free software, covered by the GNU General Public License, -and you are welcome to change it and/or distribute -copies of it under certain conditions. Type "show copying" to see -the conditions. There is absolutely no warranty for GDB. Type "show -warranty" for details. -This GDB was configured as "--host=i586-pc-cygwin32 --target=arm-elf". -(gdb) target rdi s=com1 -Angel Debug Monitor for PID (Built with Serial(x1), Parallel, DCC) 1.00 -(Advanced RISC Machines SDT 2.10) -Angel Debug Monitor rebuilt on Jan 20 1997 at 02:33:43 -Connected to ARM RDI target. -(gdb) load -Loading section .rom_vectors, size 0x44 lma 0x40000 -Loading section .text, size 0x44a4 lma 0x40044 -Loading section .rodata, size 0x318 lma 0x444e8 -Loading section .data, size 0x1c8 lma 0x44800 -Start address 0x40044 , load size 18888 -Transfer rate: 5596 bits/sec. -(gdb) c - - -The FLASH tool will output some text on the board serial -port B at 38400 baud: -ARM -eCos - -FLASH here! -manuf: 8, device: 40 -Error: Wrong Manufaturer: 08 -... Please change FLASH jumper - - -This text is repeated until you remove the jumper 7-8 -on LK6. Then the output will be: -manuf: 1F, device: A4 -AT29C040A recognised -About to program FLASH using data at 60000..64000 -*** Press RESET now to abort! - - - You have about 10 seconds to abort the operation by pressing -reset. After this timeout, the FLASH programming happens: -...Programming FLASH -All done! - - -Quit/kill the GDB process, which will hang. - - -Next time you reset the board, the stub will be in control, -communicating on Serial A at 38400 baud. - - - -If you do not have two serial ports available on your host -computer, you may still verify the FLASH programming completed successfully -by quitting/killing the GDB process after running "c" in -step 2 above. Then switch the serial cable on the PID from Serial -A to Serial B and run a terminal emulator on the host computer. -In a few seconds you should see the the repeated text described -in step 2 above and you may continue the remaining steps as normal. - - - -Programming the FLASH for big-endian mode -The process is almost identical to the previous instructions -which apply to a PID board running in little-endian mode only. -The only adjustments to make are that if programming a GDB stub -ROM image (or CygMon ROM monitor image), you must enable the option "Use -Big-endian mode" in the eCos Configuration Tool (CYGHWR_HAL_ARM_BIGENDIAN -if using ecosconfig and editing ecos.ecc). -When programming the FLASH there are two options: - - -Program FLASH using the little-endian FLASH tool. After -powering off, replace the ROM controller with the special big-endian -version which can be acquired from ARM. (This has not been tested -by Red Hat). - - -Use a special big-endian version of the FLASH tool which -byte-swaps all the words as they are written to the FLASH. - - -Build this tool by enabling the "Build flash programming tool -for BE images on LE boards" option (CYGBLD_BUILD_FLASH_TOOL_BE), -resulting in a utility with the prefix "prog_flash_BE_image_LE_system" -which should be used instead of "prog_flash". -Note that there is a limitation to this method: no sub-word -data can be read from the ROM. To work around this, the .rodata -section is folded into the .data section and thus copied to RAM -before the system starts. -Given that Thumb instructions are 16 bit, it is not possible -to run ROM-startup Thumb binaries on the PID board using this method. -When the image has been programmed, power off the board, and -set jumper LK4 to enable big-endian operation. - - - -Installing the Stubs into ROM - - -Program the binary image file gdb_module.bin -into ROM referring to the instructions of your ROM programmer. - - -Plug the ROM into socket U12 and install jumper LK6 pins -7-8 to enable the ROM. - - - - - -<!-- <index></index> -->ARM AEB-1 Hardware Setup - -Overview -The ARM AEB-1 comes with tools in ROM. These include a simple -FLASH management tool and the Angel® monitor. eCos for -the ARM AEB-1 comes with GDB stubs suitable for programming into -the onboard FLASH. GDB is the preferred debug environment for GDB, -and while Angel provides a subset of the features in the eCos GDB -stub, Angel is unsupported. -Both eCos and the stubs support both Revision B and Revision -C of the AEB-1 board. Stub ROM images for both types of board can -be found in the loaders/arm-aeb directory under the root -of your eCos installation. You can select which board you are using -by selecting either the aeb or aebC platform by selecting the appropriate -platform HAL in the eCos Configuration Tool. -The GDB stub can be downloaded to the board for programming -in the FLASH using the board's on-board ROM monitor: - - -talk to the AEB-1 board with a terminal emulator (or -a real terminal!) - - -use the board's rom menu to download a UU-encoded -version of the GDB stubs which will act as a ROM monitor - - -tell the board to use this new monitor, and then hook -GDB up to it for real debugging - - - - -Talking to the Board -Connect a terminal or computer's serial port to the -ARM AEB-1. On a PC with a 9-pin serial port, you can use the cable -shipped by ARM with no modification. -Set the terminal or terminal emulator to 9600N1 (9600 baud, -no parity, 1 stop bit). -Reset the board by pressing the little reset button on the -top. You will see the following text: - ARM Evaluation Board Boot Monitor 0.01 (19 APR 1998) - Press ENTER within 2 seconds to stop autoboot -Press ENTER quickly, and you will get the boot prompt: - Boot: - - -Downloading the Stubs via the Rom Menu -Using the AEB-1 rom menu to download the GDB stubs from the -provided ".UU" file. - -This is an annotated 'terminal' session -with the AEB-1 monitor: - -+Boot: help -Module is BootStrap 1.00 (14 Aug 1998) -Help is available on: -Help Modules ROMModules UnPlug PlugIn -Kill SetEnv UnSetEnv PrintEnv DownLoad -Go GoS Boot PC FlashWrite -FlashLoad FlashErase -Boot: download c000 -Ready to download. Use 'transmit' option on terminal -emulator to download file. -... at this point, download the ASCII file "loaders/arm-aeb/ - gdb_module.img.UU". The details of this operation differ - depending on which terminal emulator is used. It may be - necessary to enter "^D" (control+D) when the download completes - to get the monitor to return to command mode. -Loaded file gdb_module.img.bin at address -0000c000, size = 19392 - - -Activating the GDB Stubs -Commit the GDB stubs module to FLASH: - Boot: flashwrite 4018000 C000 8000 - -Verify that the eCos/"GDB stubs" module is now added -in the list of modules in the board: - Boot: rommodules - -You should see output similar to the following: - Header Base Limit - 04000004 04000000 040034a8 BootStrap 1.00 (14 Aug 1998) - 04003a74 04003800 04003bc0 Production Test 1.00 (13 Aug 1998) - 0400e4f4 04004000 0400e60f Angel 1.02 (12 MAY 1998) - 0401c810 04018000 0401cbc0 eCos 1.3 (27 Jan 2000) -GDB stubs - -Now make the eCos/"GDB stubs" module be the default -monitor: - Boot: plugin eCos - - -Since the GDB stubs are always linked at the same address -(0x4018000), the operation of writing to the FLASH and selecting -the stubs as default monitor is an idempotent operation. You can -download a new set of stubs following the same procedure - you do -not have to unregister or delete anything. - - - -Building the GDB Stub FLASH ROM Images -Pre-built GDB stubs images are provided in the directory loaders/arm-aeb -relative to the root of your eCos installation, but here are instructions -on how to rebuild them if you should ever need to. - - -Building the GDB Stubs with the eCos Configuration Tool - - -Start with a new document - selecting the -File --> -New - menu item if necessary to do this. - - -Choose the -Build --> -Templates - menu item, and then select the ARM AEB-1 hardware. - - -While still displaying the -Build->Templates - dialog box, select the "stubs" package template to build a GDB -stub image. Click -OK. - - -If applicable, set the "AEB board revision" option to -"C" from "B" depending on the board revision being used. - - -Build eCos using -Build --> -Library. - - -When the build completes, the image files can be found -in the bin/ subdirectory of the install tree. The GDB stub -ROM images have the prefix "gdb_module". - - - - -Building the GDB Stub ROMs with ecosconfig - - - -Make an empty directory to contain the build tree, -and cd into it. - - -To build a GDB stub ROM image, enter the command: -$ ecosconfig new aeb stubs - - -If applicable, edit ecos.ecc and set the AEB board revision. (CYGHWR_HAL_ARM_AEB_REVISION) -from the default "B" to "C" by uncommenting the user_value -property and setting it to "C". - - -Enter the commands - -$ ecosconfig tree -$ make - - -When the build completes, the image files can be found -in the bin/ subdirectory of the install tree. The GDB stub -ROM images have the prefix "gdb_module". - - - - - -<!-- <index></index> -->ARM Cogent CMA230 Hardware Setup -The eCos Developer's Kit package comes with an EPROM -which provides GDB support for the Cogent evaluation board. An image -of this EPROM is also provided at loaders/arm-cma230/gdbload.bin -under the root of your eCos installation. -The EPROM is installed to socket U3 on the board. Attention -should be paid to the correct orientation of the EPROM during installation. -If you are going to burn a new EPROM using the binary image, -be careful to get the byte order correct. It needs to be little-endian, -which is usually the default in PC based programmer software. -If the GDB stub EPROM you burn does not work, try reversing -the byte-order, even if you think you have it the right way around. -At least one DOS-based EPROM burner program is known to have the -byte-order upside down. -The GDB stub in the EPROM allows communication with GDB using -the serial port at connector P12 (CMA101) or P3 (CMA102). The communication parameters -are fixed at 38400 baud, 8 data bits, no parity bit and 1 stop bit -(8-N-1). No flow control is employed. Connection to the host computer -should be made using a dedicated serial cable as specified in the -Cogent CMA manual. - -Building the GDB Stub FLASH ROM images -Pre-built GDB stubs images are provided in the directory loaders/arm-cma230 relative -to the root of your eCos installation, but here are instructions -on how to rebuild them if you should ever need to. -CygMon images are prefixed with the name 'cygmon' and -GDB stub ROM images -are given the prefix 'gdb_module'. -Images may be provided in a number of formats including ELF (.img -extension), binary (.bin extension) and SREC (.srec extension). - - -Building the GDB Stubs with the eCos Configuration Tool - - -1. Start with a new document - selecting the File->New -menu item if necessary to do this. - - -Choose the -Build->Templates - menu item, and then select the ARM CMA230 hardware. - - -While still displaying the -Build --> -Templates - dialog box, select the "stubs" package template to build a GDB -stub image. Click -OK. - - -Build eCos using -Build --> -Library - - -When the build completes, the image files can be found -in the bin/ subdirectory of the install tree. The GDB stub -ROM images have the prefix "gdb_module". - - - - -Building the GDB Stub ROMs with ecosconfig - - - -1. Make an empty directory to contain the build tree, -and cd into it. - - -To build a GDB stub ROM image, enter the command: -$ ecosconfig new cma230 stubs - - -Enter the commands: - -$ ecosconfig tree -$ make - - -When the build completes, the image files can be found -in the bin/ subdirectory of the install tree. The GDB stub -ROM images have the prefix "gdb_module". - - - - - -<!-- <index></index> --><!-- <xref> -->Cirrus Logic ARM EP7211 Development -Board Hardware Setup -eCos comes with two Flash ROM images that provide GDB support -for the Cirrus Logic EP7211 Development Board (also known as the -EDB7211).. Note that on some board revisions, the board is silk-screened -as EDB7111-2. The first Flash ROM image provides a port of the CygMon -ROM monitor, which includes a command-line interface and a GDB remote -stub. The second Flash ROM image provides a remote GDB stub only. -Both ROM images are provided in the directory loaders/arm-edb7211 -under the root of your eCos installation. CygMon images are prefixed -with the name 'edb7211_cygmon' and are -provided in a number of formats including binary (.bin extension) -and SREC (.srec) extension. GDB stub ROM images are given the prefix 'edb7211_gdb_module'. -The ROM images provided for the EP7211 Development Board must -be programmed into the FLASH. Please refer to the section titled -"Loading the ROM image into On-Board flash" on how to program the -ROM onto the board. -Both Cygmon and GDB Stub ROMS allow communication with GDB -via the serial connector labelled 'UART 1'. The -communication parameters are fixed at 38400 baud, 8 data bits, no -parity bit and 1 stop bit (8-N-1). No flow control is employed. -Connection to the host computer should be made using a null modem cable. -A gender changer may also be required. Note that the GDB Configuration tool -uses the serial port identifiers 0 and 1 to identify the EB7211 -serial ports UART1 and UART2 respectively. -Both eCos and the ROM images assume the core clock is generated -with a 3.6864 MHz PLL input. The CPU will be configured to run at -73.728MHz. -Note: The EP7211 CPU needs a two step RESET process. After -pressing the `URESET' pushbutton, the `WAKEUP' pushbutton -must be pressed to complete the process. - -When an eCos program is run on an EDB7211 board fitted with -either CygMon or a GDB stub ROM, then the code in ROM loses control. -This means that if you require the ability to remotely stop execution -on the target, or want thread debugging capabilities, you must include -GDB stub support when configuring eCos. - - -Building programs for programming into FLASH -If your application is to be run directly from FLASH, you -must configure eCos appropriately for "ROM" startup. This can be -done in the eCos Configuration Tool by setting -the "Startup type" HAL option to "ROM". If using the ecosconfig utility, -set the user_value of the CYG_HAL_STARTUP -option in ecos.ecc to "ROM". -When you have linked your application with eCos, you will -then have an ELF executable. To convert this into a format appropriate -for the Cirrus Logic FLASH download utility, or the dl_7xxx -utility on Linux, you can use the utility arm-elf-objcopy, as in -the following example: -$ arm-elf-objcopy -O binary helloworld.exe helloworld.bin -This will produce a binary format image helloworld.bin which -can be downloaded into FLASH. - - -Building the GDB Stub FLASH ROM images -Pre-built GDB stubs images are provided in the directory loaders/arm-edb7211 relative -to the root of your eCos installation, but here are instructions -on how to rebuild them if you should ever need to. -CygMon images are prefixed with the name 'cygmon' and -GDB stub ROM images are given the prefix 'gdb_module'. -Images may be provided in a number of formats including ELF (.img -extension), binary (.bin extension) and SREC (.srec extension). - - -Building the ROM images with the eCos Configuration Tool - - -Start with a new document - selecting the -File->New - menu item if necessary to do this. - - -Choose the -Build->Templates - menu item, and then select the "Cirrus Logic development board" -hardware. - - -While still displaying the -Build --> -Templates - dialog box, select either the "stubs" package template to build -a GDB stub image, or the "cygmon" template to build the CygMon ROM -Monitor. Click -OK. - - -Build eCos using -Build --> -Library - - -When the build completes, the image files can be found -in the bin/ subdirectory of the install tree. GDB stub -ROM images have the prefix "gdb_module". CygMon images -have the prefix "cygmon". - - - - -Building the ROM images with ecosconfig - - - -Make an empty directory to contain the build tree, -and cd into it. - - -To build a GDB stub ROM image, enter the command: -$ ecosconfig new edb7xxx stubs -or to build a CygMon ROM monitor image, enter the command: -$ ecosconfig new edb7xxx cygmon - - -Enter the commands: -$ ecosconfig tree -$ make - - -When the build completes, the image files can be found -in the bin/ subdirectory of the install tree. GDB stub -ROM images have the prefix "gdb_module". CygMon images -have the prefix "cygmon". - - - - -<!-- <xref> -->Loading the ROM Image into On-board Flash -Program images can be written into Flash memory by means of -a bootstrap program which is built into the EDB7211. This program -communicates with a support program on your host to download and -program an image into the Flash memory. -Cirrus Logic provides such a program for use with Windows/DOS. - eCos comes with a similar program which will run under Linux. The -basic operation of both programs is the same. - - -Connect a serial line to 'UART 1'. - - -Power off the EDB7211. - - -Install jumper 'PROGRAM ENABLE' which -enables this special mode for downloading Flash images. Note that -some board revisions have this jumper labelled “BOOT ENABLE”. - - -Power on the EDB7211. - - -Execute the Flash writing program on your host. On Linux, -this would be: - # dl_edb7xxx <PATH>/gdb_module.bin -where '<PATH>' is the path to -the binary format version of the ROM image you wish to load, either -as built in the previous section or the "loaders/arm-edb7211/" subdirectory -of your eCos installation. The download tool defaults to 38400 baud and -device /dev/ttyS1 for communication. To change -these, specify them as parameters, e.g. - -# dl_edb7xxx <PATH>/gdb_module.bin 9600 /dev/ttyS0 - - -The download program will indicate that it is waiting -for the board to come alive. At this point, press 'RESET' and -then 'WAKEUP' switches in order. There should be -some indication of progress, first of the code being downloaded, -then of the programming process. - - -Upon completion of the programming, power off the EDB7211. - - -Remove the 'PROGRAM ENABLE/BOOT ENABLE' jumper. - - -Power on the EDB7211, press 'RESET' and 'WAKEUP'. - The new ROM image should now be running on the board. - - -The GDB debugger will now be able to communicate with -the board to download and debug RAM based programs. - -This procedure also applies for loading ROM-startup eCos programs -into the on-board FLASH memory, given a binary format image of the -program from arm-elf-objcopy. Loading a ROM-startup eCos program -into Flash will overwrite the GDB Stub ROM/CygMon in Flash, -so you would have to reload the GDB Stub ROM/CygMon to -return to normal RAM-startup program development. - - - - -Building the Flash Downloader on Linux -eCos provides a Flash download program suitable for use with -the EP7211 Development Board which will run on Linux. Follow these -steps to build this program. Note: at the time of the writing of -these instructions, the download program is built directly within -the eCos source repository since it is -not configuration specific. - # cd <eCos install dir>/packages/hal/arm/edb7xxx/&Version;/support - # make -(where '# ' is your shell prompt) -Note: this program was adapted from the Cirrus Logic original -DOS program and still contains some vestiges of that environment. - - -Developing eCos Programs with the ARM Multi-ICE -The EP7211 Development Board supports use of the ARM - Multi-processor EmbeddedICE(tm), also known as the - Multi-ICE. Full instructions on how to install and use the - Multi-ICE in conjunction with GDB are provided in the - "GNUPro Toolkit Reference for eCos - ARM/Thumb" manual. However, the following - platform-specific details should be noted. -You will need an ARM Multi-ICE Server configuration - file for the EP7211 Development Board. Here is a suggested - configuration file to use: -======== File "720T.cfg" ======== -;Total IR length = 4 -[TITLE] -Multi-ICE configuration for EP7211 - -[TAP 0] -ARM720T - -[TAPINFO] -YES - -[Timing] -Low=0 -High=0 -Adaptive=OFF -================================== -You must ensure that the board has the appropriate soldered -connections. For the EP7211 this involves connecting TEST0 and TEST1 -of the EP7211 to ground. To do this you must solder a wire from -ground at JP33 to TP8 and TP9. -With respect to using multiple devices simultaneously, note -that the EP7211 is not ID sensitive. -If you wish to view diagnostic output from your program that -was downloaded via the Multi-ICE, you will note that by default -the output on the serial line (as viewed by a terminal such as Hyperterm -in Windows, or cu in Unix) is in the form of GDB packets. -To get legible output, the solution is to set the "GDB Serial -port" to a different device from the "Diagnostic serial port", and -you should use the Diagnostic serial port to view the diagnostic -output. -Warning: The multi-ice-gdb-server will fail on startup if -the board has not been both reset and awakened before running the -server. -To resolve this, it is necessary to free up the connection -from within the ARM Multi-ICE server itself. However when this happens, -the next time you use GDB to load the program into the board, you -will see lots of "Readback did not match original data" messages -in the output of the multi-ice-gdb-server program. This indicates -your program did not load correctly, and you should restart the -multi-ice-gdb-server program, taking care to reset the board correctly -before reconnecting. -As a reminder, you must specify --config-dialog to the - multi-ice-gdb-server program to connect to the board - correctly. If you do not, the multi-ice-gdb-server program - will not be able to connect. - - - - -<!-- <conditionaltext> -->Cirrus Logic ARM EP7212 Development Board -Hardware Setup -The Cirrus Logic EP7212 Development Board is almost identical -to the EP7211 Development Board from a hardware setup viewpoint, -and is based on the same port of eCos. Therefore the earlier documentation -for the EP7211 Development Board can be considered equivalent, but -with the following changes: - - -The first serial port is silk screened as "UART 1" on -the EP7211 Development Board, but is silk screened as "Serial Port -0" on the EP7212 Development Board. Similarly "UART 2" is silk screened -as "Serial Port 1" on the EP7212 Development Board. - - -JP2 (used to control reprogramming of the FLASH) is not -silkscreened with "Boot Enable". - - -To setup the EP7212 Development Board for use with the -ARM Multi-ICE JTAG debugging interface unit, it is necessary to -connect TEST0 and TEST1 of the EP7212 to ground. On the Development -Board, this is accomplished by placing shorting blocks on JP47 and -JP48. When the shorting blocks are fitted, the board can only be -operated through the Multi-ICE - debugging over a serial line is -not possible. - - -Pre-built GDB stubs are - provided in the directory - loaders/arm-edb7212 relative to the - root of your eCos installation - - -When rebuilding the GDB stub ROM image, change the "Cirrus -Logic processor variant" option (CYGHWR_HAL_ARM_EDB7XXX_VARIANT) -from the EP7211 to the EP7212. This can be selected in the -eCos Configuration Tool -, or if using ecosconfig, can be set by uncommenting the user_value -property of this option in ecos.ecc and setting it to "EP7212". - - - - -<!-- <conditionaltext> -->Cirrus Logic ARM EP7312 Development Board -Hardware Setup -The Cirrus Logic EP7312 Development Board is similar -to the EP7212 Development Board from a hardware setup viewpoint, -and is based on the same port of eCos. -When rebuilding the RedBoot ROM image or an eCos application, -change the "Cirrus Logic processor variant" option -(CYGHWR_HAL_ARM_EDB7XXX_VARIANT) -from the EP7211 to the EP7312. This can be selected in the -eCos Configuration Tool -, or if using ecosconfig, can be set by uncommenting the user_value -property of this option in ecos.ecc and setting it to "EP7312". - - -See the RedBoot documentation for building and installing RedBoot for this -target. Only RedBoot is supported as a boot image; ROMRAM startup is -recommended. - - -90MHz Operation - -The EP7xxx targets offer a choice of clock speeds, from 18MHz to a maximum, -normally, of 72MHz. These are described as kHz values 18432 36864 49152 -and 73728 within the configuration tool. If you have a release which -supports it, you will also see 90317 as an available option here, for 90MHz -operation. - - -This option only applies to certain EP7312 hardware, not all EP7312 boards -support it. Do not select 90MHz when building RedBoot or your eCos -application unless you are absolutely sure that your board supports it. - - -If you do have a 90MHz board and wish to execute at 90MHz, it is in fact -not necessary to build RedBoot specially, if you build your eCos -application configured for 90MHz. RedBoot will run at 72MHz and your -application will run at 90MHz. If you do install a 90MHz RedBoot, then you -must build eCos for 90MHz or timing and baud rates on serial I/O will be -wrong. - - -In other words, code (either eCos app or RedBoot) built for 90MHz will -“change up a gear” when it starts up; but code built for 72MHz, -because it needs to run correctly on boards without the -“gearbox” does not change back down, so if you mix the two, -unexpected timing can result. To run a non-eCos application without any -hardware initialization code at 90MHz, you must install a specially-built -RedBoot. - - - - -Cirrus Logic ARM EP7209 Development Board Hardware Setup -Note: At time of writing, no EP7209 Development Board is available, -and consequently eCos has not been verified for use with the EP7209 -Development Board. -The Cirrus Logic EP7209 Development Board is almost identical -to the EP7212 Board in all respects, except that it is not fitted -with DRAM, nor has it a DRAM controller. -The only valid configuration for the EDB7209 is ROM based. -The STUBS and RAM startup modes are not available as no DRAM is -fitted. - - -<!-- <index></index> -->Cirrus Logic ARM CL-PS7111 Evaluation Board Hardware Setup -The implementation of the port of eCos to the Cirrus Logic -ARM CL-PS7111 Evaluation Board (also known as EB7111) is based on -the EP7211 Development Board port. -For that reason, the setup required is identical to the EP7211 -Development Board as described above, with the following exceptions: - - -The Cygmon ROM monitor is not supported - - -The ARM Multi-ICE is not supported - - -Pre-built GDB stubs are provided in the -directory loaders/arm-eb7111 relative to the root of your -eCos installation - - -If rebuilding the GDB stub ROM image, change the "Cirrus -Logic processor variant" option (CYGHWR_HAL_ARM_EDB7XXX_VARIANT) -from the EP7211 to the CL_PS7111. This can be selected -in the -eCos Configuration Tool -, or if using ecosconfig, can be set by uncommenting the user_value -property of this option in ecos.ecc and setting it to "CL_PS7111" - - -All remote serial communication is done with the serial I/O -connector -/misc -% slow_cat.tcl < [path]/gdb_module.srec > /dev/ttyS0 -Power off the board, and change it to boot the GDB stubs in -big-endian mode by setting the switches like this: -SW1: 00000000 (all levers down) -SW2: 10001010 -The GDB stubs allow communication with GDB using the serial -port at connector PJ7A (lower connector). The communication parameters -are fixed at 38400 baud, 8 data bits, no parity bit and 1 stop -bit (8-N-1). No flow control is employed. Connection to the host -computer should be made using a straight through serial cable. - - -StrongARM EBSA-285 Hardware Setup -The eCos Developer’s Kit package comes with a ROM -image which provides GDB support for -the Intel® StrongARM® Evaluation Board EBSA-285. - Both eCos and the Stub ROM image assume the clocks are: 3.6864 -MHz PLL input for generating the core clock, and 50MHz osc input -for external clocks. An image of this ROM is also provided at loaders/arm-ebsa285/gdbload.bin under -the root of your eCos installation. -The ROM monitor image (an eCos GDB -stub) provided for the EBSA-285 board must be programmed into the -flash, replacing the Angel monitor on the board. Please refer to -the section titled "Loading the ROM Image into On-Board flash" on how -to program the ROM onto the board. -The Stub ROM allows communication with GDB via the serial -connector on the bulkhead mounting bracket COM0. The communication -parameters are fixed at 38400 baud, 8 data bits, no parity bit and -1 stop bit (8-N-1). No flow control is employed. - -Building the GDB Stub FLASH ROM images -Pre-built GDB stubs images are provided in the directory loaders/arm-ebsa285 relative -to the root of your eCos installation, but here are instructions -on how to rebuild them if you should ever need to. - - -Building the GDB Stubs with the eCos Configuration Tool - - -Start with a new document - selecting the -File --> -New - menu item if necessary to do this. - - -Choose the -Build --> -Templates - menu item, and then select the StrongARM EBSA285 hardware. - - -While still displaying the -Build --> -Templates - dialog box, select the "stubs" package template to build a GDB -stub image. Click -OK. - - -Build eCos using -Build --> -Library - - -When the build completes, the image files can be found -in the bin/ subdirectory of the install tree. The GDB stub -ROM images have the prefix "gdb_module". - - - - -Building the GDB Stub ROMs with ecosconfig -(See “Using ecosconfig on UNIX” on page 72) - - -Make an empty directory to contain the build tree, -and cd into it. - - -To build a GDB stub ROM image, enter the command: - -$ ecosconfig new ebsa285 stubs - - -Enter the commands: - -$ ecosconfig tree -$ make - - -When the build completes, the image files can be found -in the bin/ subdirectory of the install tree. The GDB stub -ROM images have the prefix "gdb_module". - - - - -Loading the ROM Image into On-board Flash -There are several ways to install the eCos gdb stub ROM image -in the EBSA board’s flash memory. Once installed, the gdb -stub ROM provides standard eCos download and debug via the EBSA -board"s serial port. The options available include the -Linux based EBSA flash upgrade utility provided by Red Hat, direct writing -of the flash via MultiICE (JTAG) hardware debugger, and other flash management -utilities from Intel (these only support DOS, and proprietary ARM tools -and image formats). Only the Red Hat flash upgrade tool is supported -and tested in this release. -The flash upgrade tool requires the EBSA board to be configured -as a PCI slave (rather than a master, its normal operating mode) -and plugged into a Linux host computer"s PCI bus. -Configuring the board for flash loading: Follow the instructions -in the EBSA-285 Reference Manual, pages A-2 and A-3 to configure -the board as an add-in card, and enable flash blank programming. - Briefly: assuming the board was in the default setting to execute -as a bus master ("Host Bridge") make jumper 9 (J9), move jumper -10 (J10) to external reset (PCI_RST), and move jumper 15 -(J15) link 4-6-5 to connect 5-6 instead of 4-6. -Configuring the board for execution of eCos programs: Follow -the instructions in the EBSA-285 Reference Manual, pages A-2 and -A-3 to configure the board as a "Host Bridge" with "Central Function". - Briefly: unset J9, move J10 to on-board reset (BRD_RST), -and set J15 to make 4-6 instead of 5-6 (see page A-8 also). Plug -the card into its own PCI bus, not the Linux PC used for the flash-programming -process. -Building the Linux software: the Linux software sources are -in directory - <BASE_DIR>/packages/hal/arm/ebsa285/v1_3/support/linux/safl_util -in the eCos source repository. There are two parts to the -system: a loadable kernel module and the flash utility. The loadable -kernel module is safl.o and the utility is sa_flash. To -build: - cd to this directory, or a copy of it. - make -This builds safl.o and sa_flash. The kernel module -must be installed, and a device file created for it. Both of these -operations require root permissions. Create the device file by: - % mknod /dev/safl c 10 178 -Programming the flash: switch off the EBSA-285, and remove -the EBSA-285 board from its PCI bus. Take appropriate anti-static -precautions. Configure it for flash loading as above, halt your -Linux system and turn it off. Install the EBSA-285 board in the -PCI bus of the Linux system and boot it up. (Single user is good enough, -assuming your image and safl_util build dir are on a local -disc partition.) Change directory to the safl_util directory, -then, to load the kernel module and flash an image onto the eval -board (as root): - % insmod safl.o - % sa_flash <image_file> -Halt and turn off the Linux machine and remove the EBSA-285 -card. Take appropriate anti-static precautions. Configure it for -execution of eCos programs as above, and plug it into its own PCI -bus. Restart the Linux machine however you wish. -This information is replicated in the README file within the -safl_util directory and its parents, and in the EBSA-285 -Reference Manual from Intel, appendix A "Configuration Guide". -If in doubt, please refer to those documents also. -This procedure also applies for loading ROM-startup eCos programs -into the on-board flash memory, given a binary format image of the -program from arm-elf-objcopy. Loading a ROM-startup eCos program -into flash will overwrite the StubROM in flash, so you would have -to reload the StubROM to return to normal RAM-startup program development. - - -Running your eCos Program Using GDB and the StubROM - -You must first load the StubROM image into the flash memory -on the EBSA-285 board before doing this. See “Loading -the ROM Image into On-board Flash”, page 93 for details. - -Connect to the StubROM in the board and run your eCos program <PROGRAM> as -follows: - $ arm-elf-gdb -nw <PROGRAM> - (gdb) set remotebaud 38400 - (gdb) target remote <DEVICE> -Where <DEVICE> is /dev/ttyS0 -or COM1: or similar, depending on your environment and how you connected -your serial line to the host computer. Expect some output here, -for example: - Remote debugging using /dev/ttyS0 - 0x410026a4 in ?? () -then, to load the program - (gdb) load - -which will report locations and sizes of sections as they -load, then begin execution using - (gdb) continue -If you have no eCos program yet, but you want to connect to -the board just to verify serial communications, tell gdb "set endian -little" before anything else, so that it understands the board (GDB -normally infers this from information within the eCos program). - -When an eCos program is run on the EBSA-285 board, the GDB -stub in ROM loses control. This means that if you require the ability -to stop execution on the target remotely, or want thread debugging -capabilities, you must include GDB stub support when configuring -eCos. - - - - -<!-- <conditionaltext> --> <!-- NOTE: could not find it --><!-- <index></index> -->Compaq iPAQ PocketPC Hardware Setup -For setting up the iPAQ to run with RedBoot, see the the RedBoot -User's Guide. Connections may be made using -the Compact Flash Ethernet interface. A serial cable may be connected -directly, or via the cradle. Serial communication uses the parameters -38400,8,N,1. The LCD/Touchscreen may also be used as an -interface to RedBoot and eCos applications. - - -Arm Industrial Module AIM 711 Hardware Setup -The Arm Industrial Module AIM 711 comes with RedBoot installed -as the default boot loader. -For developing without having a finished custom board, a -starter-kit with a minimally configured board is available. It offers all the -connectors needed for development, including serial device, Ethernet, power -supply and an extra connector for the external bus. - -Setup Hardware - -Power supply -A 6V - 7.5V power supply must be connected to J2 or TB1. At -J2 the inner pin is V+ and at TB1 it is pin 1. - - -Serial devices -The AIM 711 has 3 serial devices, which are the debug and -diagnostic channel COM0 (/dev/ser0), the high performance 16550 -UART COM1 (/dev/ser1) and the second internal device COM2 -(/dev/ser2). -To use the debug channel, which is also the default for -RedBoot, the supplied DB9-male cable must be connected to -CN4. If the also available service board is used, the above -connector must be disabled by setting JP1. -COM1 is available over the RJ45 connector CN2. This device -can be configured as a RS232, RS422, RS485 or TTL level -COM2 is only available with TTL level at CN5. - - -Ethernet -The RJ45 connector CN1 is for Ethernet. - - - -Installing RedBoot into FLASH - -Using RedBoot -In order that Redboot can overwrite itself, Redboot is built as a ROMRAM image. -Load the RedBoot binary to the next free space: -RedBoot> load -m tftp -h 192.168.1.36 -r -b 0x40000 redboot.bin -Raw file loaded 0x00040000-0x00063233, assumed entry at 0x00040000 -Store it in FLASH: -RedBoot> fis create RedBoot -An image named 'RedBoot' exists - continue (y/n)? y -... Erase from 0x02000000-0x02025000: ..................................... -... Program from 0x00040000-0x00063234 at 0x02000000: .......................... -.......... -... Erase from 0x021ff000-0x02200000: . -... Program from 0x007ff000-0x00800000 at 0x021ff000: . -Restart the AIM 711: -RedBoot> reset -... Resetting. - - - -Using JTAG -To rewrite the FLASH using JTAG the service board must be -used, which includes a JTAG connector. - - - -More documentation -For more information please look at -http://www.visionsystems.de/arm7.html. - - - -SH3/EDK7708 Hardware Setup -The eCos Developer’s Kit package comes with a ROM -which provides GDB support for the Hitachi EDK7708 board (a big-endian -and a little-endian version). Images of these ROMs are also provided -at loaders/sh-edk7708/gdbload.bin and - loaders/sh-edk7708le/gdbload.bin under -the root of your eCos installation. -The ROM is installed to socket U6 on the board. When using -the big-endian ROM, jumper 9 must be set to 2-3. When using the -little-endian ROM, jumper 9 must be set to 1-2. Attention should -be paid to the correct orientation of the ROM during installation. -Only replace the board"s existing ROM using a proper PLCC extraction -tool, as the socket would otherwise risk being damaged. -If you are going to program a new ROM or FLASH using the binary -image, you may have to experiment to get the right byte-order in -the device. Depending on the programming software you use, it might -be necessary to enable byte-swapping. If the GDB stub ROM/FLASH -you program does not work, try reversing the byte-order. -The GDB stub in the EPROM allows communication with GDB using -the serial port at connector J1. The communication parameters are -fixed at 38400 baud, 8 data bits, no parity bit and 1 stop bit (8-N-1). -No flow control is employed. Connection to the host computer should -be made using the dedicated serial cable included in the EDK package. - -Installing the Stubs into FLASH - -Preparing the Binaries -These two binary preparation steps are not strictly necessary -as the eCos distribution ships with pre-compiled binaries in the -directory loaders/sh-edk7708 and loaders/sh-edk7708le -relative to the installation root. - -Building the ROM images with the eCos Configuration Tool - - -Start with a new document - selecting the -File->New - menu item if necessary to do this. - - -Choose the -Build->Templates - menu item, and then select the SH EDK7708 hardware. - - -While still displaying the -Build->Templates - dialog box, select the “stubs” package template -to build a GDB stub. Click -OK. - - -If building a little-endian image, disable the “Use -big-endian mode” option in the SH EDK7708 HAL (CYGHWR_HAL_SH_BIGENDIAN). - - -Build eCos using -Build->Library. - - -When the build completes, the image files can be found -in the bin/ subdirectory of the install tree. GDB stub -ROM images have the prefix “gdb_module”. - - - - -Building the ROM images with ecosconfig - - -Make an empty directory to contain the build tree, -and cd into it. - - -To build a GDB stub ROM image, enter the command: - -$ ecosconfig new edk7708 stubs - - - -If building a little-endian image, uncomment the user -value in ecos.ecc for CYGHWR_HAL_SH_BIGENDIAN -and change it to 0. - - -Enter the commands: - -$ ecosconfig tree -$ make - - -When the build completes, the image files can be found -in the bin/ subdirectory of the install tree. GDB stub -ROM images have the prefix “gdb_module”. - - - - - - Installing the Stubs into ROM or FLASH - - -Program the binary image file gdb_module.bin -into ROM or FLASH referring to the instructions of your ROM programmer. - - -Plug the ROM/FLASH into socket U6. If the image -is little-endian set jumper 9 to 1-2. If the image is big-endian -set jumper 9 to 2-3. - - - - - - -SH3/CQ7708 Hardware Setup - -Preparing the board -Make sure the DIP switches on the board are set as follows: - -SW1-1 ON -SW1-2 OFF -SW1-3 ON -SW1-4 OFF -SW2-1 ON -SW2-2 ON -SW2-3 OFF -SW2-4 OFF -If you are using a straight through serial cable which has -flow control lines, you will also need to cut JP12 (5-6) as the -flow control lines can cause NMIs. - - -eCos GDB Stubs -The eCos installation CD contains a copy of the eCos GDB stubs -in binary format which must be programmed into an EPROM or FLASH -and installed on the board. - - Preparing the GDB stubs -These stub preparation steps are not strictly necessary as -the eCos distribution ships with pre-compiled stubs in the directory -loaders/sh3-cq7708 relative to the installation root. - - -Building the GDB stub image with the eCos Configuration Tool - - -Start with a new document - selecting the -File->New - menu item if necessary to do this. - - -Choose the -Build->Templates - menu item, and then select the SH3 cq7708 hardware. - - -While still displaying the -Build->Templates - dialog box, select the stubs package template to build a GDB stub. -Click -OK. - - - Build eCos stubs using -Build->Library. - - - When the build completes, the image files can be found -in the -bin/ - subdirectory of the install tree. GDB stub images have the prefix -gdb_module. - - - - - Building the GDB stub image with ecosconfig - - -Make an empty directory to contain the build tree, -and cd into it. - - - To build a GDB stub ROM image, enter the command: - -$ ecosconfig new cq7708 stubs - - - Enter the commands: - -$ ecosconfig tree -$ make - - -When the build completes, the image files can be found -in the -bin/ - subdirectory of the install tree. GDB stub images have the prefix -gdb_module. - - - - - -Programming the stubs in EPROM/FLASH -The board can use different sizes of ROMs. Use this table -to adjust the board’s jumpers to the ROM sizes you are -using. -size(kbit) JP7 JP9 JP10 JP11 -256 2-3 2-3 open open -512 1-2 2-3 open open -1000 1-2 open open 2-3 -2000 1-2 1-2 open 2-3 -4000 1-2 1-2 short 2-3 -8000 1-2 1-2 short 1-2 -There are two ways to program the stubs. We advise you to -use method 1, since it is simpler. Method 2 is unsupported and requires -a bit of fiddling. -Method 1: -Program the binary stub image into two EPROMs, E and O. EPROM -E should contain the even bytes, and O the odd bytes (your EPROM -programmer should have the ability to split the image). -EPROM E should be installed in socket IC8, and EPROM O should -be installed in socket IC4. -Set JP6 to 16 bit mode (1-2 soldered, 2-3 cut) Set SW1-4 -to ON and SW2-1 to OFF. - -Method2: -Assuming that the stub binary is smaller than 32 KB, you can -install it in a single EPROM. -Compile the mkcqrom.c program -found in the misc directory. -Use it to convert the binary image to the required format. -See the mkcqrom.c source for a -description of what is done, and why it is necessary. - % mkcqrom gdb_module.bin gdb_mangled.bin -Program the gdb_mangled.bin file -into an EPROM and install it in socket IC4 -Set JP6 to 8 bit mode (cut 1-2, solder 2-3) -The GDB stubs allow communication with GDB using the serial -port at connector CN7. The communication parameters are fixed at -38400 baud, 8 data bits, no parity bit and 1 stop bit (8-N-1). No -flow control is employed. Connection to the host computer should -be made using a straight through serial cable. - - - -SH3/HS7729PCI Hardware Setup -Please see the RedBoot manual for instructions on how to prepare -the board for use with eCos. - - -SH3/SE77x9 Hardware Setup -Please see the RedBoot manual for instructions on how to prepare -the board for use with eCos. - - -SH4/CQ7750 Hardware Setup - -Preparing the board -Make sure the DIP switches on the board are set as follows: - -SW1-1 ON -SW1-2 OFF -SW1-3 ON -SW1-4 OFF -SW2-1 ON -SW2-2 ON -SW2-3 OFF -SW2-4 OFF -If you are using a straight through serial cable which has -flow control lines, you will also need to cut JP12 (5-6) as the -flow control lines can cause NMIs. - - -eCos GDB Stubs -The eCos installation CD contains a copy of the eCos GDB stubs -in binary format which must be programmed into an EPROM or FLASH -and installed on the board. - - Preparing the GDB stubs -These stub preparation steps are not strictly necessary as -the eCos distribution ships with pre-compiled stubs in the directory -loaders/sh3-cq7708 relative to the installation root. - - -Building the GDB stub image with the eCos Configuration Tool - - -Start with a new document - selecting the -File->New - menu item if necessary to do this. - - -Choose the -Build->Templates - menu item, and then select the SH3 cq7708 hardware. - - -While still displaying the -Build->Templates - dialog box, select the stubs package template to build a GDB stub. -Click -OK. - - - Build eCos stubs using -Build->Library. - - - When the build completes, the image files can be found -in the -bin/ - subdirectory of the install tree. GDB stub images have the prefix -gdb_module. - - - - - Building the GDB stub image with ecosconfig - - -Make an empty directory to contain the build tree, -and cd into it. - - - To build a GDB stub ROM image, enter the command: - -$ ecosconfig new cq7708 stubs - - - Enter the commands: - -$ ecosconfig tree -$ make - - -When the build completes, the image files can be found -in the -bin/ - subdirectory of the install tree. GDB stub images have the prefix -gdb_module. - - - - - -Programming the stubs in EPROM/FLASH -The board can use different sizes of ROMs. Use this table -to adjust the board’s jumpers to the ROM sizes you are -using. -size(kbit) JP7 JP9 JP10 JP11 -256 2-3 2-3 open open -512 1-2 2-3 open open -1000 1-2 open open 2-3 -2000 1-2 1-2 open 2-3 -4000 1-2 1-2 short 2-3 -8000 1-2 1-2 short 1-2 -There are two ways to program the stubs. We advise you to -use method 1, since it is simpler. Method 2 is unsupported and requires -a bit of fiddling. -Method 1: -Program the binary stub image into two EPROMs, E and O. EPROM -E should contain the even bytes, and O the odd bytes (your EPROM -programmer should have the ability to split the image). -EPROM E should be installed in socket IC8, and EPROM O should -be installed in socket IC4. -Set JP6 to 16 bit mode (1-2 soldered, 2-3 cut) Set SW1-4 -to ON and SW2-1 to OFF. - -Method2: -Assuming that the stub binary is smaller than 32 KB, you can -install it in a single EPROM. -Compile the mkcqrom.c program -found in the misc directory. -Use it to convert the binary image to the required format. -See the mkcqrom.c source for a -description of what is done, and why it is necessary. - % mkcqrom gdb_module.bin gdb_mangled.bin -Program the gdb_mangled.bin file -into an EPROM and install it in socket IC4 -Set JP6 to 8 bit mode (cut 1-2, solder 2-3) -The GDB stubs allow communication with GDB using the serial -port at connector CN7. The communication parameters are fixed at -38400 baud, 8 data bits, no parity bit and 1 stop bit (8-N-1). No -flow control is employed. Connection to the host computer should -be made using a straight through serial cable. - - - -SH4/SE7751 Hardware Setup -Please see the RedBoot manual for instructions on how to prepare -the board for use with eCos. - - -NEC CEB-V850/SA1 Hardware Setup -The CEB-V850 board is fitted with a socketed EPROM. The internal -Flash of the V850 supplied with the CEB-V850 boards defaults to -vectoring into this EPROM. A GDB stub image should be programmed -into an EPROM fitted to this board, and a pre-built image is provided -at loaders/v850-ceb_v850/v850sa1/gdb_module.bin under -the root of your eCos installation. -The EPROM is installed to the socket labelled U7 on the board. -Attention should be paid to the correct orientation of the EPROM -during installation. -When programming an EPROM using the binary image, be careful -to get the byte order correct. It needs to be little-endian. If -the EPROM burner software has a hex-editor, check that the first -few bytes of the image look similar to: -00000000: 0018 8007 5e02 0000 0000 0000 0000 0000 -If the byte order is wrong you will see 1800 instead of 0018 -etc. Use the EPROM burner software to make a byte-swap before you -burn to image to the EPROM. -If the GDB stub EPROM you burn does not work, try reversing -the byte-order, even if you think you have it the right way around. -At least one DOS-based EPROM burner program is known to have the -byte-order upside down. -The GDB stub in the EPROM allows communication with GDB using -the serial port. The communication parameters are fixed at 38400 -baud, 8 data bits, no parity bit and 1 stop bit (8-N-1). No flow -control is employed. Connection to the host computer should be made -using a dedicated serial cable as specified in the CEB-V850/SA1 -manual. - -Installing the Stubs into ROM - -Preparing the Binaries -These two binary preparation steps are not strictly necessary -as the eCos distribution ships with pre-compiled binaries in the -directory loaders/v850-ceb_v850 relative to the -installation root. - -Building the ROM images with the eCos Configuration Tool - - -Start with a new document - selecting the -File->New - menu item if necessary to do this. - - -Choose the -Build->Templates - menu item, and then select the NEC CEB-V850/SA1 hardware. - - -While still displaying the -Build->Templates - dialog box, select the “stubs” package template -to build a GDB stub. Click -OK. - - -Build eCos using -Build->Library. - - -When the build completes, the image files can be found -in the bin/ subdirectory of the install tree. GDB stub -ROM images have the prefix “gdb_module”. - - - - -Building the ROM images with ecosconfig - - -Make an empty directory to contain the build tree, -and cd into it. - - -To build a GDB stub ROM image, enter the command: - -$ ecosconfig new ceb-v850 stubs - - -Enter the commands: - -$ ecosconfig tree -$ make - - - -When the build completes, the image files can be found -in the bin/ subdirectory of the install tree. GDB stub -ROM images have the prefix “gdb_module”. - - - - - - Installing the Stubs into ROM or FLASH - - - Program the binary image file gdb_module.bin -into ROM or FLASH referring to the instructions of your ROM - programmer. - - - Plug the ROM/FLASH into the socket as described -at the beginning of this section. - - - - - -Debugging with the NEC V850 I.C.E. -eCos applications may be debugged using the NEC V850 In Circuit -Emulator (I.C.E.) A PC running Microsoft Windows is required in -order to run the NEC ICE software and drivers. In addition Red Hat -have developed a “libremote” server application -named v850ice.exe which is used on the PC connected to the I.C.E. -in order to allow connections from GDB. -The I.C.E. must be physically connected to a Windows NT system -through NEC"s PCI or PC Card interface. A driver, DLLs, -and application are provided by NEC to control the I.C.E. -v850ice is a Cygwin based server that runs on the NT system -and provides an interface between the gdb client and the I.C.E. -software. v850-elf-gdb may be run on the Windows NT system or on -a remote system. v850-elf-gdb communicates with the libremote server -using the gdb remote protocol over a TCP/IP socket. v850ice -communicates with the I.C.E. by calling functions in the NECMSG.DLL provided -by NEC. - -INITIAL SETUP - - -Configure the hardware including the I.C.E., SA1 or -SB1 Option Module, and target board. Install the interface card -in the Windows NT system. Reference NEC"s documentation -for interface installation, jumper settings, etc. - - -Install the Windows NT device driver provided by NEC. - - -Copy the NEC DLLs, MDI application, and other support -files to a directory on the Windows NT system. The standard location -is C:\NecTools32. This directory will be referred to as -the "libremote server directory" in this document. v850ice.exe must -also be copied to this directory after being built. The required -files are: cpu.cfg, Nec.cfg, MDI.EXE, NECMSG.DLL, EX85032.DLL, -V850E.DLL, IE850.MON, IE850E.MON, and D3037A.800. - - -Make certain the file cpu.cfg contains the line: -CpuOption=SA1 -if using a V850/SA1 module, or: -CpuOption=SB1 -if using a V850/SB1 module. - - -Set the environment variable IEPATH to point to the libremote -server -directory. - - - - -BUILD PROCEDURES -A pre-built v850ice.exe executable is supplied in the loaders/v850-ceb_v850 directory -relative to the root of the eCos installation. However the following process -will allow the rebuilding of this executable if required: -For this example assume the v850ice libremote tree has been -copied to a directory named "server". The directory structure will -be similar to the following diagram: - server - | - devo - / \ - config libremote - / \ - lib v850ice -Build the v850ice source as follows. Be sure to use the native -Cygwin compiler tools that were supplied alongside eCos. -cd server -mkdir build -cd build -../devo/configure --target=v850-elf --host=i686-pc-cygwin -make -The resultant libremote server image (v850ice.exe) can be -found in build/libremote/v850ice. Copy v850ice.exe -to the lib remote server directory. - - -V850ICE.EXE EXECUTION -The v850ice command line syntax is: -v850ice [-d] [-t addr] [port number] -The optional -d option enables debug output. The -t option -is associated with thread debugging - see the "eCos thread debugging" -section below for details. By default v850ice listens on port 2345 -for an attach request from a gdb client. A different port number -may be specified on the command line. -To run the libremote server: - - -Power on the I.C.E. and target board. - - -Open a Cygwin window. - - -Run v850ice. - - -You will see the MDI interface window appear. In this -window you should see the "Connected to In-Circuit Emulator" message. - In the Cygwin window, the libremote server will indicate it is -ready to accept a gdb client connection with the message "v850ice: - listening on port 2345." - - - - -V850-ELF-GDB EXECUTION -Run the v850-elf-gdb client to debug the V850 target. It -is necessary to issue certain configuration commands to the I.C.E. -software. These commands may be issued directly in the MDI window -or they may be issued from the gdb client through the "monitor" -command. -On the Cosmo CEB-V850 board, on-chip Flash is mapped at address -0x0, the on-board EPROM at 0x100000 and the on-board RAM at 0xfc0000. -Since a stand alone V850 will start executing from address 0x0 on -reset, it is normal to load either an application or a bootstrap -loader for Flash at this address. eCos programs may be built to -boot from Flash or the on-board EPROM. If building for the on-board -EPROM, it would be expected that the Flash will contain the default -CEB-V850 flash contents. An ELF format version of the default contents -may be found in the eCos distribution with the name v850flash.img. -In stand alone operation, normally the code in this flash image -would have been programmed into the V850 on the Cosmo board, and -this would cause it to vector into the on-board EPROM to run the -application located there. In the case of eCos, this application -may be a GDB stub ROM application, allowing the further download -to RAM over serial of actual applications to debug. -As an example, we shall demonstrate how to use the I.C.E. -to download the v850flash.img and GDB stub EPROM image using I.C.E. -emulator memory only, and not requiring any actual programming of -devices. -v850-elf-gdb -nw -(gdb) file v850flash.img -(gdb) target remote localhost:2345 -(gdb) monitor reset -(gdb) monitor cpu r=256 a=16 -(gdb) monitor map r=0x100000-L 0x80000 -(gdb) monitor map u=0xfc0000-L 0x40000 -(gdb) monitor pinmask k -(gdb) monitor step -(gdb) monitor step -(gdb) monitor step -(gdb) monitor step -(gdb) load -(gdb) detach -(gdb) file gdb_module.img -(gdb) target remote localhost:2345 -(gdb) load -(gdb) continue -NOTE: The four "monitor step" commands are only required the -first time the board is connected to the I.C.E., otherwise the program -will fail. -This is because of a limitation of the I.C.E. hardware that -means that the first time it is used, the "map" commands are not -acted on and the addresses "0x100000" and "0xfc0000" are not mapped. -This can be observed using the command "td e-20" in the MDI application"s -console to display the trace buffer, which will show that the contents -of address 0x100000 are not valid. Subsequent runs do not require -the "monitor step" commands. -It is unusual to load two executable images to a target through -gdb. From the example above notice that this is accomplished by -attaching to the libremote server, loading the flash image, detaching, -reattaching, and loading the ROM/RAM image. It is more -normal to build an executable image that can be executed directly. -In eCos this is achieved by selecting either the ROM or ROMRAM startup -type, and optionally enable building for the internal FLASH. The -I.C.E. emulator memory can emulate both the internal FLASH and the -EPROM, so real hardware programming is not required. -Upon running this example you will notice that the libremote -server does not exit upon detecting a detach request, but simply -begins listening for the next attach request. To cause v850ice -to terminate, issue the "monitor quit" or "monitor exit" command -from the gdb client. v850ice will then terminate with the next -detach request. (You can also enter control-c in the Cygwin/DOS -window where v850ice is running.) - - -MDI INTERFACE VS. GDB INTERFACE -If a filename is referenced in an MDI command, whether the -command is entered in the MDI window or issued from the gdb client -with the monitor command, the file must reside on the Windows NT -libremote server system. When specifying a filename when entering -a command in the MDI window it is obvious that a server local file -is being referenced. When issuing an MDI command from the gdb client, the -user must remember that the command line is simply passed to the -I.C.E. software on the server system. The command is executed by -the I.C.E. software as though it were entered locally. -Executable images may be loaded into the V850 target by entering -the "load" command in the MDI window or with the gdb "load" command. - If the MDI load command is used, the executable image must be located -on the server system and must be in S Record format. If the gdb -load command is used, the executable image must be located on the -client system and must be in ELF format. -Be aware that the gdb client is not aware of debugger commands -issued from the MDI window. It is possible to cause the gdb client -and the I.C.E. software to get out of sync by issuing commands from -both interfaces during the same debugging session. - - -eCos THREAD DEBUGGING -eCos and the V850 I.C.E. libremote server have been written -to work together to allow debugging of eCos threads. This is an -optional feature, disabled by default because of the overheads trying -to detect a threaded program involves. -Obviously thread debugging is not possible for programs with -"RAM" startup type, as they are expected to operate underneath a -separate ROM monitor (such as a GDB stub ROM), that itself would -provide its own thread debugging capabilities over the serial line. -Thread debugging is relevant only for programs built for Flash, ROM, -or ROMRAM startup. -To configure the libremote server to support thread debugging, -use the command: -(gdb) monitor syscallinfo ADDRESS -at the GDB console prompt, where ADDRESS is the address of -the syscall information structure included in the applications. -In eCos this has been designed to be located at a consistent address -for each CPU model (V850/SA1 or V850/SB1). It -may be determined from an eCos executable using the following command -at a cygwin bash prompt: -v850-elf-nm EXECUTABLE | grep hal_v85x_ice_syscall_info -At the current time, this address is 0xfc0400 for a Cosmo -board fitted with a V850/SA1, or 0xfc0540 for a Cosmo board -fitted with a V850/SB1. -So for example, the GDB command for the SB1 would be: -(gdb) monitor syscallinfo 0xfc0540 -Given that the syscallinfo address is fixed over all eCos -executables for a given target, it is possible to define it on the -libremote command line as well using the "-t" option, for example: -bash$ v850ice -t 0xfc0400 -v850ice: listening on port 2345 - - - - -NEC CEB-V850/SB1 Hardware Setup -The instructions for setting up the CEB-V850/SB1 -are virtually identical to those of the CEB-V850/SA1 above. -The only significant differences are that pre-built loaders are available -at loaders/v850-ceb_v850/v850sb1 within -the eCos installation. Binaries supporting boards with both 16MHz -and 8MHz clock speeds are supplied. Also when building applications, -or rebuilding the stubs for a V850/SB1 target, then the -V850 CPU variant must be changed in the CEB-V850 HAL to the SB1. - - -i386 PC Hardware Setup - -eCos application on the PC can be run in three ways: via RedBoot, -loaded directly from a floppy disk, or loaded by the GRUB bootloader. - - -RedBoot Support -For information about setting up the PC to run with RedBoot, -consult the RedBoot User"s Guide. If using serial debugging, -the serial line runs at 38400 baud 8-N-1 and should be connected -to the debug host using a null modem cable. If ethernet debugging -is required, an i82559 compatible network interface card, such as -an Intel EtherExpress Pro 10/100, should be installed -on the target PC and connected to the development PC running GDB. -When RedBoot is configured appropriately to have an IP address set, -then GDB will be able to debug directly over TCP/IP to the -target PC. - - -Floppy Disk Support - -If an application is built with a startup type of FLOPPY, then it is -configured to be a self-booting image that must be written onto a -formatted floppy disk. This will erase any existing file system or -data that is already on the disk, so proceed -with caution. - - -To write an application to floppy disk, it must first be converted to -a pure binary format. This is done with the following command: - - -$ i386-elf-objcopy -O binary app.elf app.bin - - -Here app.elf is the final linked application -executable, in ELF format (it may not have a .elf -extension). The file app.bin is the resulting -pure binary file. This must be written to the floppy disk with the -following command: - -$ dd conv=sync if=app.bin of=/dev/fd0 - - -For NT Cygwin users, this can be done by first ensuring that the raw -floppy device is mounted as /dev/fd0. To check if this -is the case, type the command mount at the Cygwin bash -prompt. If the floppy drive is already mounted, it will be listed as something -similar to the following line: - \\.\a: /dev/fd0 user binmode -If this line is not listed, then mount the floppy drive using the command: - -$ mount -f -b //./a: /dev/fd0 -To actually install the boot image on the floppy, use the command: - -$ dd conv=sync if=app.bin of=/dev/fd0 - -Insert this floppy in the A: drive of the PC to be used as a target -and ensure that the BIOS is configured to boot from A: by default. On reset, -the PC will boot from the floppy and the eCos application will load -itself and execute immediately. -NOTE -Unreliable floppy media may cause the write to silently fail. This -can be determined if the RedBoot image does not correctly -boot. In such cases, the floppy should be (unconditionally) reformatted -using the fdformat command on Linux, or -format a: /u on DOS/Windows. If this fails, try a -different disk. - - - -GRUB Bootloader Support - -If an application is built with the GRUB startup type, it is -configured to be loaded by the GRUB bootloader. - - -GRUB is an open source boot loader that supports many different -operating systems. It is available from -http://www.gnu.org/software/grub. -The latest version of GRUB should be downloaded from there and installed. -In Red Hat Linux version 7.2 and later it is the default bootloader -for Linux and therefore is already installed. - - -To install GRUB on a floppy disk from Linux you need to execute the -following commands: - - -$ mformat a: -$ mount /mnt/floppy -$ grub-install --root-directory=/mnt/floppy '(fd0)' -Probing devices to guess BIOS drives. This may take a long time. -Installation finished. No error reported. -This is the contents of the device map /mnt/floppy/boot/grub/device.map. -Check if this is correct or not. If any of the lines is incorrect, -fix it and re-run the script `grub-install'. - -(fd0) /dev/fd0 -$ cp $ECOS_REPOSITORY/packages/hal/i386/pc/current/misc/menu.lst /mnt/floppy/boot/grub -$ umount /mnt/floppy - - -The file menu.lst is an example GRUB menu -configuration file. It contains menu items to load some of the -standard eCos tests from floppy or from partition zero of the first -hard disk. You should, of course, customize this file to load your own -application. Alternatively you can use the command-line interface of -GRUB to input commands yourself. - - -Applications can be installed, or updated simply by copying them to -the floppy disk at the location expected by the -menu.lst file. For booting from floppy disks it -is recommended that the executable be stripped of all debug and symbol -table information before copying. This reduces the size of the file -and can make booting faster. - - -To install GRUB on a hard disk, refer to the GRUB documentation. Be -warned, however, that if you get this wrong it may compromise any -existing bootloader that exists on the hard disk and may make any -other operating systems unbootable. Practice on floppy disks or -sacrificial hard disks first. On machines running Red Hat Linux -version 7.2 and later, you can just add your own menu items to the -/boot/grub/menu.lst file that already exists. - - - -Debugging FLOPPY and GRUB Applications - -When RedBoot loads an application it also provides debugging services -in the form of GDB remote protocol stubs. When an application is -loaded stand-alone from a floppy disk, or by GRUB, these services are -not present. To allow these application to be debugged, it is possible -to include GDB stubs into the application. - - -To do this, set the "Support for GDB stubs" -(CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS) configuration -option. Following this any application built will allow GDB to connect -to the debug serial port (by default serial device 0, also known as -COM1) whenever the application takes an exception, or if a Control-C -is typed to the debug port. Ethernet debugging is not supported. - - -The option "Enable initial breakpoint" -(CYGDBG_HAL_DEBUG_GDB_INITIAL_BREAK) causes the HAL -to take a breakpoint immediately before calling cyg_start(). This -gives the developer a chance to set any breakpoints or inspect the -system state before it proceeds. The configuration sets this option by -default if GDB stubs are included, and this is not a RedBoot build. To -make the application execute immediately either disable this option, -or disable CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS. - - - - -<!-- <conditionaltext> --><!-- <index></index> -->i386/Linux Synthetic Target Setup -When building for the synthetic Linux target, the resulting -binaries are native Linux applications with the HAL providing suitable -bindings between the eCos kernel and the Linux kernel. - -Please be aware that the current implementation of the Linux -synthetic target does not allow thread-aware debugging. - -These Linux applications cannot be run on a Windows system. -However, it is possible to write a similar HAL emulation for the -Windows kernel if such a testing target is desired. - -Tools - -For the synthetic target, eCos relies on features not available -in native compilers earlier than gcc-2.95.1. It also requires version -2.9.5 or later of the GNU linker. If you have gcc-2.95.1 or later -and ld version 2.9.5 or later, then you do not need to build new -tools. eCos does not support earlier versions. You can check the compiler -version using gcc -v -and the linker version using ld --v. - -If you have native tools that are sufficiently recent for -use with eCos, you should be aware that by default eCos assumes -that the tools i686-pc-linux-gnu-gcc, i686-pc-linux-gnu-ar, - i686-pc-linux-gnu-ld, and i686-pc-linux-gnu-objcopy are -on your system and are the correct versions for use with eCos. But -instead, you can tell eCos to use your native tools by editing the -configuration value "Global command prefix" (CYGBLD_GLOBAL_COMMAND_PREFIX) -in your eCos configuration. If left empty (i.e. set to the empty -string) eCos will use your native tools when building. -If you have any difficulties, it is almost certainly easiest -overall to rebuild the tools as described on: http://ecos.sourceware.org/getstart.html - - - - - diff --git a/doc/sgml/user-guide/user-guide.sgml b/doc/sgml/user-guide/user-guide.sgml deleted file mode 100644 --- a/doc/sgml/user-guide/user-guide.sgml +++ /dev/null @@ -1,141 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -"> - - - -]> - - - - eCos User Guide - 2001, 2002Red Hat, Inc. - 2003eCosCentric Ltd. - - - Documentation licensing terms -This material may be distributed only subject to the terms -and conditions set forth in the Open Publication License, v1.0 -or later (the latest version is presently available at -http://www.opencontent.org/openpub/). - - -Distribution of the work or derivative of the work in any -standard (paper) book form is prohibited unless prior -permission is obtained from the copyright holder. - - - - Trademarks -Altera® and Excalibur™ are trademarks of Altera Corporation. -AMD® is a registered trademark of Advanced Micro Devices, Inc. -ARM®, StrongARM®, Thumb®, ARM7™, ARM9™ is a registered trademark of Advanced RISC Machines, Ltd. -Cirrus Logic® and Maverick™ are registered trademarks of Cirrus Logic, Inc. -Cogent™ is a trademark of Cogent Computer Systems, Inc. -Compaq® is a registered trademark of the Compaq Computer Corporation. -Fujitsu® is a registered trademark of Fujitsu Limited. -IBM®, and PowerPC™ are trademarks of International Business Machines Corporation. -IDT® is a registered trademark of Integrated Device Technology Inc. -Intel®, i386™, Pentium®, StrataFlash® and XScale™ are trademarks of Intel Corporation. -Intrinsyc® and Cerf™ are trademarks of Intrinsyc Software, Inc. -Linux® is a registered trademark of Linus Torvalds. -Matsushita™ and Panasonic® are trademarks of the Matsushita Electric Industrial Corporation. -Microsoft®, Windows®, Windows NT® and Windows XP® are registered trademarks of Microsoft Corporation, Inc. -MIPS®, MIPS32™ MIPS64™, 4K&trade, 5K™ Atlas™ and Malta™ are trademarks of MIPS Technologies, Inc. -Motorola®, ColdFire® is a trademark of Motorola, Inc. -NEC® V800™, V850™, V850/SA1™, V850/SB1™, VR4300™, and VRC4375™ are trademarks of NEC Corporation. -PMC-Sierra® RM7000™ and Ocelot™ are trademarks of PMC-Sierra Incorporated. -Red Hat, eCos™, RedBoot™, GNUPro®, and Insight™ are trademarks of Red Hat, Inc. -Samsung® and CalmRISC™ are trademarks or registered trademarks of Samsung, Inc. -Sharp® is a registered trademark of Sharp Electronics Corp. -SPARC® is a registered trademark of SPARC International, Inc., and is used under license by Sun Microsystems, Inc. -Sun Microsystems® and Solaris® are registered trademarks of Sun Microsystems, Inc. -SuperH™ and Renesas™ are trademarks owned by Renesas Technology Corp. -Texas Instruments®, OMAP™ and Innovator™ are trademarks of Texas Instruments Incorporated. -Toshiba® is a registered trademark of the Toshiba Corporation. -UNIX® is a registered trademark of The Open Group. -All other brand and product names, trademarks, and copyrights are the -property of their respective owners. - - - - - &introduction; - &installation; - &programming; - &config-tool; - &programming-concepts-and-techniques; - &configuration; - - - Appendixes - &target-setup; - &real-time-characterization; - &ecos-license; - - - diff --git a/examples/ChangeLog b/examples/ChangeLog deleted file mode 100644 --- a/examples/ChangeLog +++ /dev/null @@ -1,8 +0,0 @@ -2003-03-03 John Dallaway - - Makefile: Rename ECOS_INSTALL -> INSTALL_DIR to match - documentation. - -2003-01-20 John Dallaway - - Makefile: Simplify by reference to ecos.mak diff --git a/examples/Makefile b/examples/Makefile deleted file mode 100644 --- a/examples/Makefile +++ /dev/null @@ -1,55 +0,0 @@ -# Mostly written by Jonathan Larmour, Red Hat, Inc. -# Reference to ecos.mak added by John Dallaway, eCosCentric Limited, 2003-01-20 -# This file is in the public domain and may be used for any purpose - -# Usage: make INSTALL_DIR=/path/to/ecos/install - -INSTALL_DIR=$$(INSTALL_DIR) # override on make command line - -include $(INSTALL_DIR)/include/pkgconf/ecos.mak - -XCC = $(ECOS_COMMAND_PREFIX)gcc -XCXX = $(XCC) -XLD = $(XCC) - -CFLAGS = -I$(INSTALL_DIR)/include -CXXFLAGS = $(CFLAGS) -LDFLAGS = -nostartfiles -L$(INSTALL_DIR)/lib -Ttarget.ld - -# RULES - -.PHONY: all clean - -all: hello twothreads simple-alarm serial - -clean: - -rm -f hello hello.o twothreads twothreads.o - -rm -f simple-alarm simple-alarm.o serial serial.o - -rm -f instrument-test instrument-test.o - -%.o: %.c - $(XCC) -c -o $*.o $(CFLAGS) $(ECOS_GLOBAL_CFLAGS) $< - -%.o: %.cxx - $(XCXX) -c -o $*.o $(CXXFLAGS) $(ECOS_GLOBAL_CFLAGS) $< - -%.o: %.C - $(XCXX) -c -o $*.o $(CXXFLAGS) $(ECOS_GLOBAL_CFLAGS) $< - -%.o: %.cc - $(XCXX) -c -o $*.o $(CXXFLAGS) $(ECOS_GLOBAL_CFLAGS) $< - -hello: hello.o - $(XLD) $(LDFLAGS) $(ECOS_GLOBAL_LDFLAGS) -o $@ $@.o - -twothreads: twothreads.o - $(XLD) $(LDFLAGS) $(ECOS_GLOBAL_LDFLAGS) -o $@ $@.o - -simple-alarm: simple-alarm.o - $(XLD) $(LDFLAGS) $(ECOS_GLOBAL_LDFLAGS) -o $@ $@.o - -serial: serial.o - $(XLD) $(LDFLAGS) $(ECOS_GLOBAL_LDFLAGS) -o $@ $@.o - -instrument-test: instrument-test.o - $(XLD) $(LDFLAGS) $(ECOS_GLOBAL_LDFLAGS) -o $@ $@.o diff --git a/examples/build_Make.params b/examples/build_Make.params deleted file mode 100644 --- a/examples/build_Make.params +++ /dev/null @@ -1,44 +0,0 @@ -#! /bin/sh - -# This script will set up a Makefile fragment with -# platform specifics. This fragement can be used by -# the automatically generated Makefile (via the script -# 'build_Makefile') - -# Copied from 'makefile' in the "install" tree - -ECOS_BUILD_DIR=${1-`pwd`} -ECOS_INSTALL_DIR=`echo ${ECOS_BUILD_DIR}/install` -if [ ! -d ${ECOS_BUILD_DIR}/install ]; then - if [ ! -d ${ECOS_BUILD_DIR}/*_build ]; then - echo "Not an eCos install tree" - echo "usage: /build_Make.params []" - echo "... where is the directory which contains" - echo " the *.ecc configuration file used to build the kernel" - exit - else - ECOS_INSTALL_DIR=`echo ${ECOS_BUILD_DIR}/*_install` - ECOS_BUILD_DIR=`echo ${ECOS_BUILD_DIR}/*_build` - fi -fi - -cat <Make.params - -# Copied from 'makefile' in the "install" tree - -EOF - -grep export ${ECOS_BUILD_DIR}/makefile >>Make.params - -cat <>Make.params - -# -# Target specific flags, etc. -# - -EOF - -cat ${ECOS_INSTALL_DIR}/include/pkgconf/ecos.mak >>Make.params - - - diff --git a/examples/build_Makefile b/examples/build_Makefile deleted file mode 100644 --- a/examples/build_Makefile +++ /dev/null @@ -1,39 +0,0 @@ -#! /bin/sh - -# This script will create a generic Makefile template -# suitable for use with an installed eCos configuration. - -# usage: /build_Makefile [] -# env: ${SRCS} - the default list of source files -# ${DST} - the default target -ECOS_DIR=${1-`pwd`} - -cat <Makefile -# -# Makefile for eCos tests -# - -# Platform specific setups -include Make.params - -# Simple build rules - -.c.o: - \$(CC) -c \$(ECOS_GLOBAL_CFLAGS) -I\$(PREFIX)/include \$*.c - -.o: - \$(CC) \$(ECOS_GLOBAL_LDFLAGS) -L\$(PREFIX)/lib -Ttarget.ld \$*.o -o \$@ - -SRCS=${SRCS-source_file.c} -OBJS=\${SRCS:%.c=%.o} -DST=${DST-result_prog} - -\${DST}: \${OBJS} - -EOF - -# Create actual parameters - -`dirname $0`/build_Make.params ${ECOS_DIR} - - diff --git a/examples/hello.c b/examples/hello.c deleted file mode 100644 --- a/examples/hello.c +++ /dev/null @@ -1,8 +0,0 @@ -/* this is a simple hello world program */ -#include - -int main(void) -{ - printf("Hello, eCos world!\n"); - return 0; -} diff --git a/examples/instrument-test.c b/examples/instrument-test.c deleted file mode 100644 --- a/examples/instrument-test.c +++ /dev/null @@ -1,50 +0,0 @@ -/* this is a program which uses eCos instrumentation buffers; it needs - to be linked with a kernel which was compiled with support for - instrumentation */ - -#include -#include -#include -#include - -#ifndef CYGVAR_KERNEL_INSTRUMENT_EXTERNAL_BUFFER -# error You must configure eCos with CYGVAR_KERNEL_INSTRUMENT_EXTERNAL_BUFFER -#endif - -struct Instrument_Record -{ - CYG_WORD16 type; // record type - CYG_WORD16 thread; // current thread id - CYG_WORD timestamp; // 32 bit timestamp - CYG_WORD arg1; // first arg - CYG_WORD arg2; // second arg -}; - -struct Instrument_Record instrument_buffer[20]; -cyg_uint32 instrument_buffer_size = 20; - -int main(void) -{ - int i; - - cyg_instrument_enable(CYG_INSTRUMENT_CLASS_CLOCK, 0); - cyg_instrument_enable(CYG_INSTRUMENT_CLASS_THREAD, 0); - cyg_instrument_enable(CYG_INSTRUMENT_CLASS_ALARM, 0); - - printf("Program to play with instrumentation buffer\n"); - - cyg_thread_delay(2); - - cyg_instrument_disable(CYG_INSTRUMENT_CLASS_CLOCK, 0); - cyg_instrument_disable(CYG_INSTRUMENT_CLASS_THREAD, 0); - cyg_instrument_disable(CYG_INSTRUMENT_CLASS_ALARM, 0); - - for (i = 0; i < instrument_buffer_size; ++i) { - printf("Record %02d: type 0x%04x, thread %d, ", - i, instrument_buffer[i].type, instrument_buffer[i].thread); - printf("time %5d, arg1 0x%08x, arg2 0x%08x\n", - instrument_buffer[i].timestamp, instrument_buffer[i].arg1, - instrument_buffer[i].arg2); - } - return 0; -} diff --git a/examples/serial.c b/examples/serial.c deleted file mode 100644 --- a/examples/serial.c +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Written 1999-03-19 by Jonathan Larmour, Cygnus Solutions - * This file is in the public domain and may be used for any purpose - */ - -/* CONFIGURATION CHECKS */ - -#include /* which packages are enabled/disabled */ -#ifdef CYGPKG_KERNEL -# include -#endif -#ifdef CYGPKG_LIBC -# include -#endif -#ifdef CYGPKG_IO_SERIAL -# include -#endif - -#ifndef CYGFUN_KERNEL_API_C -# error Kernel API must be enabled to build this example -#endif - -#ifndef CYGPKG_LIBC_STDIO -# error C library standard I/O must be enabled to build this example -#endif - -#ifndef CYGPKG_IO_SERIAL_HALDIAG -# error I/O HALDIAG pseudo-device driver must be enabled to build this example -#endif - -/* INCLUDES */ - -#include /* printf */ -#include /* strlen */ -#include /* All the kernel specific stuff */ -#include /* I/O functions */ -#include /* CYGNUM_HAL_STACK_SIZE_TYPICAL */ - - - -/* DEFINES */ - -#define NTHREADS 1 -#define STACKSIZE ( CYGNUM_HAL_STACK_SIZE_TYPICAL + 4096 ) - -/* STATICS */ - -static cyg_handle_t thread[NTHREADS]; -static cyg_thread thread_obj[NTHREADS]; -static char stack[NTHREADS][STACKSIZE]; - -/* FUNCTIONS */ - -static void simple_prog(CYG_ADDRESS data) -{ - cyg_io_handle_t handle; - Cyg_ErrNo err; - const char test_string[] = "serial example is working correctly!\n"; - cyg_uint32 len = strlen(test_string); - - printf("Starting serial example\n"); - - err = cyg_io_lookup( "/dev/haldiag", &handle ); - - if (ENOERR == err) { - printf("Found /dev/haldiag. Writing string....\n"); - err = cyg_io_write( handle, test_string, &len ); - } - - if (ENOERR == err) { - printf("I think I wrote the string. Did you see it?\n"); - } - - printf("Serial example finished\n"); - -} - -void cyg_user_start(void) -{ - cyg_thread_create(4, simple_prog, (cyg_addrword_t) 0, "serial", - (void *)stack[0], STACKSIZE, &thread[0], &thread_obj[0]); - cyg_thread_resume(thread[0]); -} diff --git a/examples/simple-alarm.c b/examples/simple-alarm.c deleted file mode 100644 --- a/examples/simple-alarm.c +++ /dev/null @@ -1,76 +0,0 @@ -/* this is a very simple program meant to demonstrate - a basic use of time, alarms and alarm-handling functions - in eCos */ - -#include - -#include - -#define NTHREADS 1 -#define STACKSIZE 4096 - -static cyg_handle_t thread[NTHREADS]; - -static cyg_thread thread_obj[NTHREADS]; -static char stack[NTHREADS][STACKSIZE]; - -static void alarm_prog( cyg_addrword_t data ); - -/* we install our own startup routine which sets up - threads and starts the scheduler */ -void cyg_user_start(void) -{ - cyg_thread_create(4, alarm_prog, (cyg_addrword_t) 0, - "alarm_thread", (void *) stack[0], - STACKSIZE, &thread[0], &thread_obj[0]); - cyg_thread_resume(thread[0]); -} - -/* we need to declare the alarm handling function (which is - defined below), so that we can pass it to - cyg_alarm_initialize() */ -cyg_alarm_t test_alarm_func; - -/* alarm_prog() is a thread which sets up an alarm which is then - handled by test_alarm_func() */ -static void alarm_prog(cyg_addrword_t data) -{ - cyg_handle_t test_counterH, system_clockH, test_alarmH; - cyg_tick_count_t ticks; - cyg_alarm test_alarm; - unsigned how_many_alarms = 0, prev_alarms = 0, tmp_how_many; - - system_clockH = cyg_real_time_clock(); - cyg_clock_to_counter(system_clockH, &test_counterH); - cyg_alarm_create(test_counterH, test_alarm_func, - (cyg_addrword_t) &how_many_alarms, - &test_alarmH, &test_alarm); - cyg_alarm_initialize(test_alarmH, cyg_current_time()+200, 200); - - /* get in a loop in which we read the current time and - print it out, just to have something scrolling by */ - for (;;) { - ticks = cyg_current_time(); - printf("Time is %llu\n", ticks); - /* note that we must lock access to how_many_alarms, since the - alarm handler might change it. this involves using the - annoying temporary variable tmp_how_many so that I can keep the - critical region short */ - cyg_scheduler_lock(); - tmp_how_many = how_many_alarms; - cyg_scheduler_unlock(); - if (prev_alarms != tmp_how_many) { - printf(" ---> alarm calls so far: %u\n", tmp_how_many); - prev_alarms = tmp_how_many; - } - cyg_thread_delay(30); - } -} - -/* test_alarm_func() is invoked as an alarm handler, so - it should be quick and simple. in this case it increments - the data that is passed to it. */ -void test_alarm_func(cyg_handle_t alarmH, cyg_addrword_t data) -{ - ++*((unsigned *) data); -} diff --git a/examples/twothreads.c b/examples/twothreads.c deleted file mode 100644 --- a/examples/twothreads.c +++ /dev/null @@ -1,62 +0,0 @@ -#include - -#include -#include -#include - -/* now declare (and allocate space for) some kernel objects, - like the two threads we will use */ -cyg_thread thread_s[2]; /* space for two thread objects */ - -char stack[2][4096]; /* space for two 4K stacks */ - -/* now the handles for the threads */ -cyg_handle_t simple_threadA, simple_threadB; - -/* and now variables for the procedure which is the thread */ -cyg_thread_entry_t simple_program; - -/* and now a mutex to protect calls to the C library */ -cyg_mutex_t cliblock; - -/* we install our own startup routine which sets up threads */ -void cyg_user_start(void) -{ - printf("Entering twothreads' cyg_user_start() function\n"); - - cyg_mutex_init(&cliblock); - - cyg_thread_create(4, simple_program, (cyg_addrword_t) 0, - "Thread A", (void *) stack[0], 4096, - &simple_threadA, &thread_s[0]); - cyg_thread_create(4, simple_program, (cyg_addrword_t) 1, - "Thread B", (void *) stack[1], 4096, - &simple_threadB, &thread_s[1]); - - cyg_thread_resume(simple_threadA); - cyg_thread_resume(simple_threadB); -} - -/* this is a simple program which runs in a thread */ -void simple_program(cyg_addrword_t data) -{ - int message = (int) data; - int delay; - - printf("Beginning execution; thread data is %d\n", message); - - cyg_thread_delay(200); - - for (;;) { - delay = 200 + (rand() % 50); - - /* note: printf() must be protected by a - call to cyg_mutex_lock() */ - cyg_mutex_lock(&cliblock); { - printf("Thread %d: and now a delay of %d clock ticks\n", - message, delay); - } - cyg_mutex_unlock(&cliblock); - cyg_thread_delay(delay); - } -} diff --git a/host/ChangeLog b/host/ChangeLog deleted file mode 100644 --- a/host/ChangeLog +++ /dev/null @@ -1,141 +0,0 @@ -2003-02-12 Bart Veer - - * Makefile.in: Regenerate after acinclude.m4 update - -2002-08-03 Bart Veer - - * acinclude.m4, configure.in, Makefile.am: - Rework host-side autoconf support - -2001-10-15 Julian Smart - - * Mounts /ecos-x now, not /x - * Fixed invocation of 'mount' when about to build - -2001-07-26 Julian Smart - - * Only use Registry functions if building a GUI Configtool. - * ecosconfig.exe doesn't now get built when building the GUI - Configtool. - -2001-07-09 Julian Smart - - * Fixed (I hope) a long-term bug in both versions of the Configtool, - whereby conflicts involving bool-data values weren't - resolved. - -2001-06-18 Julian Smart - - * Added possible fix for Tcl crash bug under Windows 9x, by - using the wxWindows Mkdir function instead of Tcl's mkdir. - -2001-06-04 Julian Smart - - * Changed cygpath in build.cxx to use /cygdrive notation, - checking in the registry first in case the user has customized - the /cygdrive mount point. - -2001-05-23 Julian Smart - - * Added Srdjan Sobajic's most excellent host/README improvements, - and listed the directories more clearly with a brief reference - to the new Configtool and its own readme. - -2001-05-16 Bart Veer - - * acinclude.m4 : - Update compiler flag handling with g++ to use -O0 rather than - -O2. The extra run-time performance is not worth the build - overheads. Also sort out the Tcl macro for VC++ builds. - - * configure.in : clean up some old cruft - - aclocal.m4, configure, Makefile.in: regenerate - -2001-01-29 Andreas Schuldei - - * acinclude.m4 (CYG_AC_PATH_TCL): Simplify Tcl installation searching - -2000-10-23 Jesper Skov - - * configure: Disable ser_filter magic for now - properly this time! - * configure.in: Ditto. - -2000-10-17 Jesper Skov - - * configure: Disable ser_filter magic for now. - * configure.in: Ditto. - -2000-09-15 Jesper Skov - - * Makefile.in: Added ser_filter rules. - * configure: Ditto. - * configure.in: Ditto. - -2000-09-12 Bart Veer - - * README - Clarify which configure script should be used. - -2000-08-18 Bart Veer - - * configure.in: - Allow cross-compilation - - * Makefile.in, configure: - Regenerate - -2000-03-13 John Dallway - - * README: - Mention use of the short form of the path to the configure - script under Windows. - -2000-03-12 Bart Veer - - * acinclude.m4, and lots of other files: - Change the CYG_AC_PATH_TCL macro to use tclConfig.sh, make - appropriate adjustments elsewhere. Also, add dependencies - such that the commands now depend on the libraries. - -2000-03-08 Bart Veer - - * README: - Updated. - - * configure.in (ECOS_DIRS): - Use the infrastructure and Tcl macros at the toplevel, so that - configure --help gives the right information. - - * configure.in (ECOS_DIRS): - Look for the file tools/ecostest/common/configure, rather than - just the directory. - -2000-03-01 Bart Veer - - * Create toplevel ChangeLog for the eCos host-side. - -//####COPYRIGHTBEGIN#### -// -// ---------------------------------------------------------------------------- -// Copyright (C) 2000, 2001 Red Hat, Inc. -// -// This file is part of the eCos host tools. -// -// This program is free software; you can redistribute it and/or modify it -// under the terms of the GNU General Public License as published by the Free -// Software Foundation; either version 2 of the License, or (at your option) -// any later version. -// -// This program is distributed in the hope that it will be useful, but WITHOUT -// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for -// more details. -// -// You should have received a copy of the GNU General Public License along with -// this program; if not, write to the Free Software Foundation, Inc., -// 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -// -// ---------------------------------------------------------------------------- -// -//####COPYRIGHTEND#### diff --git a/host/Makefile.am b/host/Makefile.am deleted file mode 100644 --- a/host/Makefile.am +++ /dev/null @@ -1,44 +0,0 @@ -## Process this file with automake to produce Makefile.in -## ===================================================================== -## -## Makefile.am -## -## eCos host-side software toplevel makefile -## -## ===================================================================== -#######ECOSHOSTGPLCOPYRIGHTBEGIN#### -## ---------------------------------------------------------------------------- -## Copyright (C) 2002 Bart Veer -## Copyright (C) 1998, 1999, 2000, 2001 Red Hat, Inc. -## -## This file is part of the eCos host tools. -## -## This program is free software; you can redistribute it and/or modify it -## under the terms of the GNU General Public License as published by the Free -## Software Foundation; either version 2 of the License, or (at your option) -## any later version. -## -## This program is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -## FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for -## more details. -## -## You should have received a copy of the GNU General Public License along with -## this program; if not, write to the Free Software Foundation, Inc., -## 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -## -## ---------------------------------------------------------------------------- -#######ECOSHOSTGPLCOPYRIGHTEND#### -## ===================================================================== -#######DESCRIPTIONBEGIN#### -## -## Author(s): bartv -## Contact(s): bartv -## Date: 1998/12/17 -## Version: 0.01 -## -######DESCRIPTIONEND#### -## ===================================================================== - -AUTOMAKE_OPTIONS = 1.3 foreign -SUBDIRS = @SUBDIRS@ diff --git a/host/Makefile.in b/host/Makefile.in deleted file mode 100644 --- a/host/Makefile.in +++ /dev/null @@ -1,345 +0,0 @@ -# Makefile.in generated automatically by automake 1.4-p5 from Makefile.am - -# Copyright (C) 1994, 1995-8, 1999, 2001 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. - -#######ECOSHOSTGPLCOPYRIGHTBEGIN#### -#######ECOSHOSTGPLCOPYRIGHTEND#### -#######DESCRIPTIONBEGIN#### -######DESCRIPTIONEND#### - - -SHELL = @SHELL@ - -srcdir = @srcdir@ -top_srcdir = @top_srcdir@ -VPATH = @srcdir@ -prefix = @prefix@ -exec_prefix = @exec_prefix@ - -bindir = @bindir@ -sbindir = @sbindir@ -libexecdir = @libexecdir@ -datadir = @datadir@ -sysconfdir = @sysconfdir@ -sharedstatedir = @sharedstatedir@ -localstatedir = @localstatedir@ -libdir = @libdir@ -infodir = @infodir@ -mandir = @mandir@ -includedir = @includedir@ -oldincludedir = /usr/include - -DESTDIR = - -pkgdatadir = $(datadir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ - -top_builddir = . - -ACLOCAL = @ACLOCAL@ -AUTOCONF = @AUTOCONF@ -AUTOMAKE = @AUTOMAKE@ -AUTOHEADER = @AUTOHEADER@ - -INSTALL = @INSTALL@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS) -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -transform = @program_transform_name@ - -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -host_alias = @host_alias@ -host_triplet = @host@ -CC = @CC@ -CXX = @CXX@ -ECOS_REPOSITORY = @ECOS_REPOSITORY@ -MAINT = @MAINT@ -MAKEINFO = @MAKEINFO@ -MSVC_SRCDIR = @MSVC_SRCDIR@ -PACKAGE = @PACKAGE@ -PACKAGE_DIR = @PACKAGE_DIR@ -PACKAGE_INSTALL = @PACKAGE_INSTALL@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -VERSION = @VERSION@ -ecos_CFLAGS = @ecos_CFLAGS@ -ecos_CXXFLAGS = @ecos_CXXFLAGS@ -ecos_INCLUDES = @ecos_INCLUDES@ -ecos_LDADD = @ecos_LDADD@ -ecos_LIBS = @ecos_LIBS@ -ecos_infra_incdir = @ecos_infra_incdir@ -ecos_infra_libdir = @ecos_infra_libdir@ -ecos_libcdl_incdir = @ecos_libcdl_incdir@ -ecos_libcdl_libdir = @ecos_libcdl_libdir@ -ecos_tk_includes = @ecos_tk_includes@ -ecos_tk_libs = @ecos_tk_libs@ - -AUTOMAKE_OPTIONS = 1.3 foreign -SUBDIRS = @SUBDIRS@ -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -mkinstalldirs = $(SHELL) $(top_srcdir)/../acsupport/mkinstalldirs -CONFIG_CLEAN_FILES = -DIST_COMMON = ChangeLog Makefile.am Makefile.in acinclude.m4 aclocal.m4 \ -configure configure.in - - -DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) - -TAR = gtar -GZIP_ENV = --best -all: all-redirect -.SUFFIXES: -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) - cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile - -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES) - cd $(top_builddir) \ - && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status - -$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ configure.in acinclude.m4 - cd $(srcdir) && $(ACLOCAL) - -config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - $(SHELL) ./config.status --recheck -$(srcdir)/configure: @MAINTAINER_MODE_TRUE@$(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES) - cd $(srcdir) && $(AUTOCONF) - -# 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. - -@SET_MAKE@ - -all-recursive install-data-recursive install-exec-recursive \ -installdirs-recursive install-recursive uninstall-recursive \ -check-recursive installcheck-recursive info-recursive dvi-recursive: - @set fnord $(MAKEFLAGS); amf=$$2; \ - dot_seen=no; \ - target=`echo $@ | sed s/-recursive//`; \ - list='$(SUBDIRS)'; for subdir in $$list; do \ - echo "Making $$target in $$subdir"; \ - if test "$$subdir" = "."; then \ - dot_seen=yes; \ - local_target="$$target-am"; \ - else \ - local_target="$$target"; \ - fi; \ - (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ - || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ - done; \ - if test "$$dot_seen" = "no"; then \ - $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ - fi; test -z "$$fail" - -mostlyclean-recursive clean-recursive distclean-recursive \ -maintainer-clean-recursive: - @set fnord $(MAKEFLAGS); amf=$$2; \ - dot_seen=no; \ - rev=''; list='$(SUBDIRS)'; for subdir in $$list; do \ - rev="$$subdir $$rev"; \ - test "$$subdir" != "." || dot_seen=yes; \ - done; \ - test "$$dot_seen" = "no" && rev=". $$rev"; \ - target=`echo $@ | sed s/-recursive//`; \ - for subdir in $$rev; do \ - echo "Making $$target in $$subdir"; \ - if test "$$subdir" = "."; then \ - local_target="$$target-am"; \ - else \ - local_target="$$target"; \ - fi; \ - (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ - || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ - done && test -z "$$fail" -tags-recursive: - list='$(SUBDIRS)'; for subdir in $$list; do \ - test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ - done - -tags: TAGS - -ID: $(HEADERS) $(SOURCES) $(LISP) - list='$(SOURCES) $(HEADERS)'; \ - unique=`for i in $$list; do echo $$i; done | \ - awk ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - here=`pwd` && cd $(srcdir) \ - && mkid -f$$here/ID $$unique $(LISP) - -TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP) - tags=; \ - here=`pwd`; \ - list='$(SUBDIRS)'; for subdir in $$list; do \ - if test "$$subdir" = .; then :; else \ - test -f $$subdir/TAGS && tags="$$tags -i $$here/$$subdir/TAGS"; \ - fi; \ - done; \ - list='$(SOURCES) $(HEADERS)'; \ - unique=`for i in $$list; do echo $$i; done | \ - awk ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \ - || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS) - -mostlyclean-tags: - -clean-tags: - -distclean-tags: - -rm -f TAGS ID - -maintainer-clean-tags: - -distdir = $(PACKAGE)-$(VERSION) -top_distdir = $(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 - -rm -rf $(distdir) - GZIP=$(GZIP_ENV) $(TAR) zxf $(distdir).tar.gz - mkdir $(distdir)/=build - mkdir $(distdir)/=inst - dc_install_base=`cd $(distdir)/=inst && pwd`; \ - cd $(distdir)/=build \ - && ../configure --srcdir=.. --prefix=$$dc_install_base \ - && $(MAKE) $(AM_MAKEFLAGS) \ - && $(MAKE) $(AM_MAKEFLAGS) dvi \ - && $(MAKE) $(AM_MAKEFLAGS) check \ - && $(MAKE) $(AM_MAKEFLAGS) install \ - && $(MAKE) $(AM_MAKEFLAGS) installcheck \ - && $(MAKE) $(AM_MAKEFLAGS) dist - -rm -rf $(distdir) - @banner="$(distdir).tar.gz is ready for distribution"; \ - dashes=`echo "$$banner" | sed s/./=/g`; \ - echo "$$dashes"; \ - echo "$$banner"; \ - echo "$$dashes" -dist: distdir - -chmod -R a+r $(distdir) - GZIP=$(GZIP_ENV) $(TAR) chozf $(distdir).tar.gz $(distdir) - -rm -rf $(distdir) -dist-all: distdir - -chmod -R a+r $(distdir) - GZIP=$(GZIP_ENV) $(TAR) chozf $(distdir).tar.gz $(distdir) - -rm -rf $(distdir) -distdir: $(DISTFILES) - -rm -rf $(distdir) - mkdir $(distdir) - -chmod 777 $(distdir) - here=`cd $(top_builddir) && pwd`; \ - top_distdir=`cd $(distdir) && pwd`; \ - distdir=`cd $(distdir) && pwd`; \ - cd $(top_srcdir) \ - && $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --foreign Makefile - @for file in $(DISTFILES); do \ - d=$(srcdir); \ - if test -d $$d/$$file; then \ - cp -pr $$d/$$file $(distdir)/$$file; \ - else \ - test -f $(distdir)/$$file \ - || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ - || cp -p $$d/$$file $(distdir)/$$file || :; \ - fi; \ - done - for subdir in $(SUBDIRS); do \ - if test "$$subdir" = .; then :; else \ - test -d $(distdir)/$$subdir \ - || mkdir $(distdir)/$$subdir \ - || exit 1; \ - chmod 777 $(distdir)/$$subdir; \ - (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir=../$(distdir) distdir=../$(distdir)/$$subdir distdir) \ - || exit 1; \ - fi; \ - done -info-am: -info: info-recursive -dvi-am: -dvi: dvi-recursive -check-am: all-am -check: check-recursive -installcheck-am: -installcheck: installcheck-recursive -install-exec-am: -install-exec: install-exec-recursive - -install-data-am: -install-data: install-data-recursive - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am -install: install-recursive -uninstall-am: -uninstall: uninstall-recursive -all-am: Makefile -all-redirect: all-recursive -install-strip: - $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install -installdirs: installdirs-recursive -installdirs-am: - - -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -rm -f Makefile $(CONFIG_CLEAN_FILES) - -rm -f config.cache config.log stamp-h stamp-h[0-9]* - -maintainer-clean-generic: -mostlyclean-am: mostlyclean-tags mostlyclean-generic - -mostlyclean: mostlyclean-recursive - -clean-am: clean-tags clean-generic mostlyclean-am - -clean: clean-recursive - -distclean-am: distclean-tags distclean-generic clean-am - -distclean: distclean-recursive - -rm -f config.status - -maintainer-clean-am: maintainer-clean-tags maintainer-clean-generic \ - distclean-am - @echo "This command is intended for maintainers to use;" - @echo "it deletes files that may require special tools to rebuild." - -maintainer-clean: maintainer-clean-recursive - -rm -f config.status - -.PHONY: install-data-recursive uninstall-data-recursive \ -install-exec-recursive uninstall-exec-recursive installdirs-recursive \ -uninstalldirs-recursive all-recursive check-recursive \ -installcheck-recursive info-recursive dvi-recursive \ -mostlyclean-recursive distclean-recursive clean-recursive \ -maintainer-clean-recursive tags tags-recursive mostlyclean-tags \ -distclean-tags clean-tags maintainer-clean-tags distdir info-am info \ -dvi-am dvi check check-am installcheck-am installcheck install-exec-am \ -install-exec install-data-am install-data install-am install \ -uninstall-am uninstall all-redirect all-am all installdirs-am \ -installdirs mostlyclean-generic distclean-generic clean-generic \ -maintainer-clean-generic clean mostlyclean distclean maintainer-clean - - -# 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/host/acinclude.m4 b/host/acinclude.m4 deleted file mode 100644 --- a/host/acinclude.m4 +++ /dev/null @@ -1,44 +0,0 @@ -dnl Process this file with aclocal to get an aclocal.m4 file. Then -dnl process that with autoconf. -dnl ==================================================================== -dnl -dnl acinclude.m4 -dnl -dnl ==================================================================== -dnl ####ECOSHOSTGPLCOPYRIGHTBEGIN#### -dnl ---------------------------------------------------------------------------- -dnl Copyright (C) 2002 Bart Veer -dnl -dnl This file is part of the eCos host tools. -dnl -dnl This program is free software; you can redistribute it and/or modify it -dnl under the terms of the GNU General Public License as published by the Free -dnl Software Foundation; either version 2 of the License, or (at your option) -dnl any later version. -dnl -dnl This program is distributed in the hope that it will be useful, but WITHOUT -dnl ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -dnl FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for -dnl more details. -dnl -dnl You should have received a copy of the GNU General Public License along with -dnl this program; if not, write to the Free Software Foundation, Inc., -dnl 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -dnl -dnl ---------------------------------------------------------------------------- -dnl ####ECOSHOSTGPLCOPYRIGHTEND#### -dnl ==================================================================== -dnl#####DESCRIPTIONBEGIN#### -dnl -dnl Author(s): bartv -dnl Contact(s): bartv -dnl Date: 2002/08/03 -dnl Version: 0.01 -dnl -dnl####DESCRIPTIONEND#### -dnl ==================================================================== - -dnl Access shared macros. -dnl AM_CONDITIONAL needs to be mentioned here or else aclocal does not -dnl incorporate the macro into aclocal.m4 -sinclude(../acsupport/acinclude.m4) diff --git a/host/aclocal.m4 b/host/aclocal.m4 deleted file mode 100644 --- a/host/aclocal.m4 +++ /dev/null @@ -1,182 +0,0 @@ -dnl aclocal.m4 generated automatically by aclocal 1.4-p5 - -dnl Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc. -dnl This file is free software; the Free Software Foundation -dnl gives unlimited permission to copy and/or distribute it, -dnl with or without modifications, as long as this notice is preserved. - -dnl This program is distributed in the hope that it will be useful, -dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without -dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A -dnl PARTICULAR PURPOSE. - -dnl Process this file with aclocal to get an aclocal.m4 file. Then -dnl process that with autoconf. -dnl ==================================================================== -dnl -dnl acinclude.m4 -dnl -dnl ==================================================================== -dnl ####ECOSHOSTGPLCOPYRIGHTBEGIN#### -dnl ---------------------------------------------------------------------------- -dnl Copyright (C) 2002 Bart Veer -dnl -dnl This file is part of the eCos host tools. -dnl -dnl This program is free software; you can redistribute it and/or modify it -dnl under the terms of the GNU General Public License as published by the Free -dnl Software Foundation; either version 2 of the License, or (at your option) -dnl any later version. -dnl -dnl This program is distributed in the hope that it will be useful, but WITHOUT -dnl ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -dnl FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for -dnl more details. -dnl -dnl You should have received a copy of the GNU General Public License along with -dnl this program; if not, write to the Free Software Foundation, Inc., -dnl 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -dnl -dnl ---------------------------------------------------------------------------- -dnl ####ECOSHOSTGPLCOPYRIGHTEND#### -dnl ==================================================================== -dnl#####DESCRIPTIONBEGIN#### -dnl -dnl Author(s): bartv -dnl Contact(s): bartv -dnl Date: 2002/08/03 -dnl Version: 0.01 -dnl -dnl####DESCRIPTIONEND#### -dnl ==================================================================== - -dnl Access shared macros. -dnl AM_CONDITIONAL needs to be mentioned here or else aclocal does not -dnl incorporate the macro into aclocal.m4 -sinclude(../acsupport/acinclude.m4) - -# Define a conditional. - -AC_DEFUN([AM_CONDITIONAL], -[AC_SUBST($1_TRUE) -AC_SUBST($1_FALSE) -if $2; then - $1_TRUE= - $1_FALSE='#' -else - $1_TRUE='#' - $1_FALSE= -fi]) - -# Do all the work for Automake. 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. - -# serial 1 - -dnl Usage: -dnl AM_INIT_AUTOMAKE(package,version, [no-define]) - -AC_DEFUN([AM_INIT_AUTOMAKE], -[AC_REQUIRE([AC_PROG_INSTALL]) -PACKAGE=[$1] -AC_SUBST(PACKAGE) -VERSION=[$2] -AC_SUBST(VERSION) -dnl test to see if srcdir already configured -if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then - AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) -fi -ifelse([$3],, -AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) -AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])) -AC_REQUIRE([AM_SANITY_CHECK]) -AC_REQUIRE([AC_ARG_PROGRAM]) -dnl FIXME This is truly gross. -missing_dir=`cd $ac_aux_dir && pwd` -AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir) -AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir) -AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir) -AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir) -AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir) -AC_REQUIRE([AC_PROG_MAKE_SET])]) - -# -# Check to make sure that the build environment is sane. -# - -AC_DEFUN([AM_SANITY_CHECK], -[AC_MSG_CHECKING([whether build environment is sane]) -# Just in case -sleep 1 -echo timestamp > conftestfile -# 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 conftestfile 2> /dev/null` - if test "[$]*" = "X"; then - # -L didn't work. - set X `ls -t $srcdir/configure conftestfile` - fi - if test "[$]*" != "X $srcdir/configure conftestfile" \ - && test "[$]*" != "X conftestfile $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" = conftestfile - ) -then - # Ok. - : -else - AC_MSG_ERROR([newly created file is older than distributed files! -Check your system clock]) -fi -rm -f conftest* -AC_MSG_RESULT(yes)]) - -dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY) -dnl The program must properly implement --version. -AC_DEFUN([AM_MISSING_PROG], -[AC_MSG_CHECKING(for working $2) -# Run test in a subshell; some versions of sh will print an error if -# an executable is not found, even if stderr is redirected. -# Redirect stdin to placate older versions of autoconf. Sigh. -if ($2 --version) < /dev/null > /dev/null 2>&1; then - $1=$2 - AC_MSG_RESULT(found) -else - $1="$3/missing $2" - AC_MSG_RESULT(missing) -fi -AC_SUBST($1)]) - -# Add --enable-maintainer-mode option to configure. -# From Jim Meyering - -# serial 1 - -AC_DEFUN([AM_MAINTAINER_MODE], -[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) - dnl maintainer-mode is disabled by default - AC_ARG_ENABLE(maintainer-mode, -[ --enable-maintainer-mode enable make rules and dependencies not useful - (and sometimes confusing) to the casual installer], - USE_MAINTAINER_MODE=$enableval, - USE_MAINTAINER_MODE=no) - AC_MSG_RESULT($USE_MAINTAINER_MODE) - AM_CONDITIONAL(MAINTAINER_MODE, test $USE_MAINTAINER_MODE = yes) - MAINT=$MAINTAINER_MODE_TRUE - AC_SUBST(MAINT)dnl -] -) - diff --git a/host/configure b/host/configure deleted file mode 100644 --- a/host/configure +++ /dev/null @@ -1,1225 +0,0 @@ -#! /bin/sh - -# Guess values for system-dependent variables and create Makefiles. -# Generated automatically using autoconf version 2.13 -# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc. -# -# This configure script is free software; the Free Software Foundation -# gives unlimited permission to copy, distribute and modify it. - -# Defaults: -ac_help= -ac_default_prefix=/usr/local -# Any additions from configure.in: -ac_help="$ac_help - --enable-maintainer-mode enable make rules and dependencies not useful - (and sometimes confusing) to the casual installer" - -# Initialize some variables set by options. -# The variables have the same names as the options, with -# dashes changed to underlines. -build=NONE -cache_file=./config.cache -exec_prefix=NONE -host=NONE -no_create= -nonopt=NONE -no_recursion= -prefix=NONE -program_prefix=NONE -program_suffix=NONE -program_transform_name=s,x,x, -silent= -site= -srcdir= -target=NONE -verbose= -x_includes=NONE -x_libraries=NONE -bindir='${exec_prefix}/bin' -sbindir='${exec_prefix}/sbin' -libexecdir='${exec_prefix}/libexec' -datadir='${prefix}/share' -sysconfdir='${prefix}/etc' -sharedstatedir='${prefix}/com' -localstatedir='${prefix}/var' -libdir='${exec_prefix}/lib' -includedir='${prefix}/include' -oldincludedir='/usr/include' -infodir='${prefix}/info' -mandir='${prefix}/man' - -# Initialize some other variables. -subdirs= -MFLAGS= MAKEFLAGS= -SHELL=${CONFIG_SHELL-/bin/sh} -# Maximum number of lines to put in a shell here document. -ac_max_here_lines=12 - -ac_prev= -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=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;; - *) ac_optarg= ;; - esac - - # Accept the important Cygnus configure options, so we can diagnose typos. - - case "$ac_option" in - - -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 ;; - -build=* | --build=* | --buil=* | --bui=* | --bu=*) - build="$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" ;; - - -datadir | --datadir | --datadi | --datad | --data | --dat | --da) - ac_prev=datadir ;; - -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ - | --da=*) - datadir="$ac_optarg" ;; - - -disable-* | --disable-*) - ac_feature=`echo $ac_option|sed -e 's/-*disable-//'` - # Reject names that are not valid shell variable names. - if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then - { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } - fi - ac_feature=`echo $ac_feature| sed 's/-/_/g'` - eval "enable_${ac_feature}=no" ;; - - -enable-* | --enable-*) - ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'` - # Reject names that are not valid shell variable names. - if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then - { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } - fi - ac_feature=`echo $ac_feature| sed 's/-/_/g'` - case "$ac_option" in - *=*) ;; - *) ac_optarg=yes ;; - esac - eval "enable_${ac_feature}='$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) - # 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 << EOF -Usage: configure [options] [host] -Options: [defaults in brackets after descriptions] -Configuration: - --cache-file=FILE cache test results in FILE - --help print this message - --no-create do not create output files - --quiet, --silent do not print \`checking...' messages - --version print the version of autoconf that created configure -Directory and file names: - --prefix=PREFIX install architecture-independent files in PREFIX - [$ac_default_prefix] - --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX - [same as prefix] - --bindir=DIR user executables in DIR [EPREFIX/bin] - --sbindir=DIR system admin executables in DIR [EPREFIX/sbin] - --libexecdir=DIR program executables in DIR [EPREFIX/libexec] - --datadir=DIR read-only architecture-independent data in DIR - [PREFIX/share] - --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc] - --sharedstatedir=DIR modifiable architecture-independent data in DIR - [PREFIX/com] - --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var] - --libdir=DIR object code libraries in DIR [EPREFIX/lib] - --includedir=DIR C header files in DIR [PREFIX/include] - --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include] - --infodir=DIR info documentation in DIR [PREFIX/info] - --mandir=DIR man documentation in DIR [PREFIX/man] - --srcdir=DIR find the sources in DIR [configure dir or ..] - --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 -EOF - cat << EOF -Host type: - --build=BUILD configure for building on BUILD [BUILD=HOST] - --host=HOST configure for HOST [guessed] - --target=TARGET configure for TARGET [TARGET=HOST] -Features and packages: - --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) - --enable-FEATURE[=ARG] include FEATURE [ARG=yes] - --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] - --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) - --x-includes=DIR X include files are in DIR - --x-libraries=DIR X library files are in DIR -EOF - if test -n "$ac_help"; then - echo "--enable and --with options recognized:$ac_help" - fi - exit 0 ;; - - -host | --host | --hos | --ho) - ac_prev=host ;; - -host=* | --host=* | --hos=* | --ho=*) - host="$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" ;; - - -localstatedir | --localstatedir | --localstatedi | --localstated \ - | --localstate | --localstat | --localsta | --localst \ - | --locals | --local | --loca | --loc | --lo) - ac_prev=localstatedir ;; - -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ - | --localstate=* | --localstat=* | --localsta=* | --localst=* \ - | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) - 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) - 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" ;; - - -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 ;; - -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) - target="$ac_optarg" ;; - - -v | -verbose | --verbose | --verbos | --verbo | --verb) - verbose=yes ;; - - -version | --version | --versio | --versi | --vers) - echo "configure generated by autoconf version 2.13" - exit 0 ;; - - -with-* | --with-*) - ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'` - # Reject names that are not valid shell variable names. - if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then - { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } - fi - ac_package=`echo $ac_package| sed 's/-/_/g'` - case "$ac_option" in - *=*) ;; - *) ac_optarg=yes ;; - esac - eval "with_${ac_package}='$ac_optarg'" ;; - - -without-* | --without-*) - ac_package=`echo $ac_option|sed -e 's/-*without-//'` - # Reject names that are not valid shell variable names. - if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then - { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } - fi - ac_package=`echo $ac_package| sed 's/-/_/g'` - eval "with_${ac_package}=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" ;; - - -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; } - ;; - - *) - if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then - echo "configure: warning: $ac_option: invalid host type" 1>&2 - fi - if test "x$nonopt" != xNONE; then - { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } - fi - nonopt="$ac_option" - ;; - - esac -done - -if test -n "$ac_prev"; then - { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; } -fi - -trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 - -# File descriptor usage: -# 0 standard input -# 1 file creation -# 2 errors and warnings -# 3 some systems may open it to /dev/tty -# 4 used on the Kubota Titan -# 6 checking for... messages and results -# 5 compiler messages saved in config.log -if test "$silent" = yes; then - exec 6>/dev/null -else - exec 6>&1 -fi -exec 5>./config.log - -echo "\ -This file contains any messages produced by compilers while -running configure, to aid debugging if configure makes a mistake. -" 1>&5 - -# Strip out --no-create and --no-recursion so they do not pile up. -# Also quote any args containing shell metacharacters. -ac_configure_args= -for ac_arg -do - case "$ac_arg" in - -no-create | --no-create | --no-creat | --no-crea | --no-cre \ - | --no-cr | --no-c) ;; - -no-recursion | --no-recursion | --no-recursio | --no-recursi \ - | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;; - *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*) - ac_configure_args="$ac_configure_args '$ac_arg'" ;; - *) ac_configure_args="$ac_configure_args $ac_arg" ;; - esac -done - -# NLS nuisances. -# Only set these to C if already set. These must not be set unconditionally -# because not all systems understand e.g. LANG=C (notably SCO). -# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'! -# Non-C LC_CTYPE values break the ctype check. -if test "${LANG+set}" = set; then LANG=C; export LANG; fi -if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi -if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi -if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi - -# confdefs.h avoids OS command line length limits that DEFS can exceed. -rm -rf conftest* confdefs.h -# AIX cpp loses on an empty file, so make sure it contains at least a newline. -echo > confdefs.h - -# A filename unique to this package, relative to the directory that -# configure is in, which we can look for to find out if srcdir is correct. -ac_unique_file=../acsupport/config.guess - -# 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 its parent. - ac_prog=$0 - ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'` - test "x$ac_confdir" = "x$ac_prog" && ac_confdir=. - 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 - if test "$ac_srcdir_defaulted" = yes; then - { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; } - else - { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; } - fi -fi -srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'` - -# Prefer explicitly selected file to automatically selected ones. -if test -z "$CONFIG_SITE"; then - if test "x$prefix" != xNONE; then - CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" - else - CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" - fi -fi -for ac_site_file in $CONFIG_SITE; do - if test -r "$ac_site_file"; then - echo "loading site script $ac_site_file" - . "$ac_site_file" - fi -done - -if test -r "$cache_file"; then - echo "loading cache $cache_file" - . $cache_file -else - echo "creating cache $cache_file" - > $cache_file -fi - -ac_ext=c -# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. -ac_cpp='$CPP $CPPFLAGS' -ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' -ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' -cross_compiling=$ac_cv_prog_cc_cross - -ac_exeext= -ac_objext=o -if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then - # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu. - if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then - ac_n= ac_c=' -' ac_t=' ' - else - ac_n=-n ac_c= ac_t= - fi -else - ac_n= ac_c='\c' ac_t= -fi - - -ac_aux_dir= -for ac_dir in ../acsupport $srcdir/../acsupport; 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 - fi -done -if test -z "$ac_aux_dir"; then - { echo "configure: error: can not find install-sh or install.sh in ../acsupport $srcdir/../acsupport" 1>&2; exit 1; } -fi -ac_config_guess=$ac_aux_dir/config.guess -ac_config_sub=$ac_aux_dir/config.sub -ac_configure=$ac_aux_dir/configure # This should be Cygnus configure. - - -# Make sure we can run config.sub. -if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then : -else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; } -fi - -echo $ac_n "checking host system type""... $ac_c" 1>&6 -echo "configure:554: checking host system type" >&5 - -host_alias=$host -case "$host_alias" in -NONE) - case $nonopt in - NONE) - if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then : - else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; } - fi ;; - *) host_alias=$nonopt ;; - esac ;; -esac - -host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias` -host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` -host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` -host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` -echo "$ac_t""$host" 1>&6 - -# 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 -# 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" -# ./install, which can be erroneously created by make from ./install.sh. -echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 -echo "configure:586: checking for a BSD compatible install" >&5 -if test -z "$INSTALL"; then -if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":" - for ac_dir in $PATH; do - # Account for people who put trailing slashes in PATH elements. - case "$ac_dir/" in - /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/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 - if test -f $ac_dir/$ac_prog; then - if test $ac_prog = install && - grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then - # AIX install. It has an incompatible calling convention. - : - else - ac_cv_path_install="$ac_dir/$ac_prog -c" - break 2 - fi - fi - done - ;; - esac - done - IFS="$ac_save_IFS" - -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. We don't cache a - # path for INSTALL within a source directory, because that will - # break other packages using the cache if that directory is - # removed, or if the path is relative. - INSTALL="$ac_install_sh" - fi -fi -echo "$ac_t""$INSTALL" 1>&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_PROGRAM}' - -test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' - -echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6 -echo "configure:639: checking whether build environment is sane" >&5 -# Just in case -sleep 1 -echo timestamp > conftestfile -# 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 conftestfile 2> /dev/null` - if test "$*" = "X"; then - # -L didn't work. - set X `ls -t $srcdir/configure conftestfile` - fi - if test "$*" != "X $srcdir/configure conftestfile" \ - && test "$*" != "X conftestfile $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". - { echo "configure: error: ls -t appears to fail. Make sure there is not a broken -alias in your environment" 1>&2; exit 1; } - fi - - test "$2" = conftestfile - ) -then - # Ok. - : -else - { echo "configure: error: newly created file is older than distributed files! -Check your system clock" 1>&2; exit 1; } -fi -rm -f conftest* -echo "$ac_t""yes" 1>&6 -if test "$program_transform_name" = s,x,x,; then - program_transform_name= -else - # Double any \ or $. echo might interpret backslashes. - cat <<\EOF_SED > conftestsed -s,\\,\\\\,g; s,\$,$$,g -EOF_SED - program_transform_name="`echo $program_transform_name|sed -f conftestsed`" - rm -f conftestsed -fi -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" - -# sed with no file args requires a program. -test "$program_transform_name" = "" && program_transform_name="s,x,x," - -echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 -echo "configure:696: checking whether ${MAKE-make} sets \${MAKE}" >&5 -set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftestmake <<\EOF -all: - @echo 'ac_maketemp="${MAKE}"' -EOF -# GNU make sometimes prints "make[1]: Entering...", which would confuse us. -eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=` -if test -n "$ac_maketemp"; then - eval ac_cv_prog_make_${ac_make}_set=yes -else - eval ac_cv_prog_make_${ac_make}_set=no -fi -rm -f conftestmake -fi -if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then - echo "$ac_t""yes" 1>&6 - SET_MAKE= -else - echo "$ac_t""no" 1>&6 - SET_MAKE="MAKE=${MAKE-make}" -fi - - -PACKAGE=eCos - -VERSION=2.0 - -if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then - { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; } -fi - - - -missing_dir=`cd $ac_aux_dir && pwd` -echo $ac_n "checking for working aclocal""... $ac_c" 1>&6 -echo "configure:735: checking for working aclocal" >&5 -# Run test in a subshell; some versions of sh will print an error if -# an executable is not found, even if stderr is redirected. -# Redirect stdin to placate older versions of autoconf. Sigh. -if (aclocal --version) < /dev/null > /dev/null 2>&1; then - ACLOCAL=aclocal - echo "$ac_t""found" 1>&6 -else - ACLOCAL="$missing_dir/missing aclocal" - echo "$ac_t""missing" 1>&6 -fi - -echo $ac_n "checking for working autoconf""... $ac_c" 1>&6 -echo "configure:748: checking for working autoconf" >&5 -# Run test in a subshell; some versions of sh will print an error if -# an executable is not found, even if stderr is redirected. -# Redirect stdin to placate older versions of autoconf. Sigh. -if (autoconf --version) < /dev/null > /dev/null 2>&1; then - AUTOCONF=autoconf - echo "$ac_t""found" 1>&6 -else - AUTOCONF="$missing_dir/missing autoconf" - echo "$ac_t""missing" 1>&6 -fi - -echo $ac_n "checking for working automake""... $ac_c" 1>&6 -echo "configure:761: checking for working automake" >&5 -# Run test in a subshell; some versions of sh will print an error if -# an executable is not found, even if stderr is redirected. -# Redirect stdin to placate older versions of autoconf. Sigh. -if (automake --version) < /dev/null > /dev/null 2>&1; then - AUTOMAKE=automake - echo "$ac_t""found" 1>&6 -else - AUTOMAKE="$missing_dir/missing automake" - echo "$ac_t""missing" 1>&6 -fi - -echo $ac_n "checking for working autoheader""... $ac_c" 1>&6 -echo "configure:774: checking for working autoheader" >&5 -# Run test in a subshell; some versions of sh will print an error if -# an executable is not found, even if stderr is redirected. -# Redirect stdin to placate older versions of autoconf. Sigh. -if (autoheader --version) < /dev/null > /dev/null 2>&1; then - AUTOHEADER=autoheader - echo "$ac_t""found" 1>&6 -else - AUTOHEADER="$missing_dir/missing autoheader" - echo "$ac_t""missing" 1>&6 -fi - -echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6 -echo "configure:787: checking for working makeinfo" >&5 -# Run test in a subshell; some versions of sh will print an error if -# an executable is not found, even if stderr is redirected. -# Redirect stdin to placate older versions of autoconf. Sigh. -if (makeinfo --version) < /dev/null > /dev/null 2>&1; then - MAKEINFO=makeinfo - echo "$ac_t""found" 1>&6 -else - MAKEINFO="$missing_dir/missing makeinfo" - echo "$ac_t""missing" 1>&6 -fi - - -echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6 -echo "configure:801: checking whether to enable maintainer-specific portions of Makefiles" >&5 - # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given. -if test "${enable_maintainer_mode+set}" = set; then - enableval="$enable_maintainer_mode" - USE_MAINTAINER_MODE=$enableval -else - USE_MAINTAINER_MODE=no -fi - - echo "$ac_t""$USE_MAINTAINER_MODE" 1>&6 - - -if test $USE_MAINTAINER_MODE = yes; then - MAINTAINER_MODE_TRUE= - MAINTAINER_MODE_FALSE='#' -else - MAINTAINER_MODE_TRUE='#' - MAINTAINER_MODE_FALSE= -fi - MAINT=$MAINTAINER_MODE_TRUE - - - - echo $ac_n "checking that a separate build tree is being used""... $ac_c" 1>&6 -echo "configure:825: checking that a separate build tree is being used" >&5 - ecos_cwd=`/bin/pwd` - if test "${srcdir}" = "." ; then - srcdir=${ecos_cwd} - fi - if test "${ecos_cwd}" = "${srcdir}" ; then - echo "$ac_t""no" 1>&6 - { echo "configure: error: This configure script should not be run inside the source tree. Instead please use a separate build tree" 1>&2; exit 1; } - else - echo "$ac_t""yes" 1>&6 - fi - - -SUBDIRS="infra libcdl tools/configtool/standalone/common" - - - - -subdirs="${SUBDIRS}" - -trap '' 1 2 15 -cat > confcache <<\EOF -# 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. It is not useful on other systems. -# If it contains results you don't want to keep, you may remove or edit it. -# -# By default, configure uses ./config.cache as the cache file, -# creating it if it does not exist already. You can give configure -# the --cache-file=FILE option to use a different cache file; that is -# what configure does when it calls configure scripts in -# subdirectories, so they share the cache. -# Giving --cache-file=/dev/null disables caching, for debugging configure. -# config.status only pays attention to the cache file if you give it the -# --recheck option to rerun configure. -# -EOF -# The following way of writing the cache mishandles newlines in values, -# but we know of no workaround that is simple, portable, and efficient. -# So, don't put newlines in cache variables' values. -# 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. -(set) 2>&1 | - case `(ac_space=' '; set | grep ac_space) 2>&1` in - *ac_space=\ *) - # `set' does not quote correctly, so add quotes (double-quote substitution - # turns \\\\ into \\, and sed turns \\ into \). - sed -n \ - -e "s/'/'\\\\''/g" \ - -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p" - ;; - *) - # `set' quotes correctly as required by POSIX, so do not add quotes. - sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p' - ;; - esac >> confcache -if cmp -s $cache_file confcache; then - : -else - if test -w $cache_file; then - echo "updating cache $cache_file" - cat confcache > $cache_file - else - echo "not updating unwritable cache $cache_file" - fi -fi -rm -f confcache - -trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 - -test "x$prefix" = xNONE && prefix=$ac_default_prefix -# Let make expand exec_prefix. -test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' - -# Any assignment to VPATH causes Sun make to only execute -# the first set of double-colon rules, so remove it if not needed. -# If there is a colon in the path, we need to keep it. -if test "x$srcdir" = x.; then - ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d' -fi - -trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15 - -# Transform confdefs.h into DEFS. -# Protect against shell expansion while executing Makefile rules. -# Protect against Makefile macro expansion. -cat > conftest.defs <<\EOF -s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%-D\1=\2%g -s%[ `~#$^&*(){}\\|;'"<>?]%\\&%g -s%\[%\\&%g -s%\]%\\&%g -s%\$%$$%g -EOF -DEFS=`sed -f conftest.defs confdefs.h | tr '\012' ' '` -rm -f conftest.defs - - -# Without the "./", some shells look in PATH for config.status. -: ${CONFIG_STATUS=./config.status} - -echo creating $CONFIG_STATUS -rm -f $CONFIG_STATUS -cat > $CONFIG_STATUS </dev/null | sed 1q`: -# -# $0 $ac_configure_args -# -# Compiler output produced by configure, useful for debugging -# configure, is in ./config.log if it exists. - -ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]" -for ac_option -do - case "\$ac_option" in - -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) - echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion" - exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;; - -version | --version | --versio | --versi | --vers | --ver | --ve | --v) - echo "$CONFIG_STATUS generated by autoconf version 2.13" - exit 0 ;; - -help | --help | --hel | --he | --h) - echo "\$ac_cs_usage"; exit 0 ;; - *) echo "\$ac_cs_usage"; exit 1 ;; - esac -done - -ac_given_srcdir=$srcdir -ac_given_INSTALL="$INSTALL" - -trap 'rm -fr `echo "Makefile" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 -EOF -cat >> $CONFIG_STATUS < conftest.subs <<\\CEOF -$ac_vpsub -$extrasub -s%@SHELL@%$SHELL%g -s%@CFLAGS@%$CFLAGS%g -s%@CPPFLAGS@%$CPPFLAGS%g -s%@CXXFLAGS@%$CXXFLAGS%g -s%@FFLAGS@%$FFLAGS%g -s%@DEFS@%$DEFS%g -s%@LDFLAGS@%$LDFLAGS%g -s%@LIBS@%$LIBS%g -s%@exec_prefix@%$exec_prefix%g -s%@prefix@%$prefix%g -s%@program_transform_name@%$program_transform_name%g -s%@bindir@%$bindir%g -s%@sbindir@%$sbindir%g -s%@libexecdir@%$libexecdir%g -s%@datadir@%$datadir%g -s%@sysconfdir@%$sysconfdir%g -s%@sharedstatedir@%$sharedstatedir%g -s%@localstatedir@%$localstatedir%g -s%@libdir@%$libdir%g -s%@includedir@%$includedir%g -s%@oldincludedir@%$oldincludedir%g -s%@infodir@%$infodir%g -s%@mandir@%$mandir%g -s%@host@%$host%g -s%@host_alias@%$host_alias%g -s%@host_cpu@%$host_cpu%g -s%@host_vendor@%$host_vendor%g -s%@host_os@%$host_os%g -s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g -s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g -s%@INSTALL_DATA@%$INSTALL_DATA%g -s%@PACKAGE@%$PACKAGE%g -s%@VERSION@%$VERSION%g -s%@ACLOCAL@%$ACLOCAL%g -s%@AUTOCONF@%$AUTOCONF%g -s%@AUTOMAKE@%$AUTOMAKE%g -s%@AUTOHEADER@%$AUTOHEADER%g -s%@MAKEINFO@%$MAKEINFO%g -s%@SET_MAKE@%$SET_MAKE%g -s%@MAINTAINER_MODE_TRUE@%$MAINTAINER_MODE_TRUE%g -s%@MAINTAINER_MODE_FALSE@%$MAINTAINER_MODE_FALSE%g -s%@MAINT@%$MAINT%g -s%@SUBDIRS@%$SUBDIRS%g -s%@subdirs@%$subdirs%g - -CEOF -EOF - -cat >> $CONFIG_STATUS <<\EOF - -# Split the substitutions into bite-sized pieces for seds with -# small command number limits, like on Digital OSF/1 and HP-UX. -ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script. -ac_file=1 # Number of current file. -ac_beg=1 # First line for current file. -ac_end=$ac_max_sed_cmds # Line after last line for current file. -ac_more_lines=: -ac_sed_cmds="" -while $ac_more_lines; do - if test $ac_beg -gt 1; then - sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file - else - sed "${ac_end}q" conftest.subs > conftest.s$ac_file - fi - if test ! -s conftest.s$ac_file; then - ac_more_lines=false - rm -f conftest.s$ac_file - else - if test -z "$ac_sed_cmds"; then - ac_sed_cmds="sed -f conftest.s$ac_file" - else - ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file" - fi - ac_file=`expr $ac_file + 1` - ac_beg=$ac_end - ac_end=`expr $ac_end + $ac_max_sed_cmds` - fi -done -if test -z "$ac_sed_cmds"; then - ac_sed_cmds=cat -fi -EOF - -cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF -for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then - # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". - case "$ac_file" in - *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` - ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; - *) ac_file_in="${ac_file}.in" ;; - esac - - # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories. - - # Remove last slash and all that follows it. Not all systems have dirname. - ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` - if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then - # The file is in a subdirectory. - test ! -d "$ac_dir" && mkdir "$ac_dir" - ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`" - # A "../" for each directory in $ac_dir_suffix. - ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'` - else - ac_dir_suffix= ac_dots= - fi - - case "$ac_given_srcdir" in - .) srcdir=. - if test -z "$ac_dots"; then top_srcdir=. - else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;; - /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;; - *) # Relative path. - srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix" - top_srcdir="$ac_dots$ac_given_srcdir" ;; - esac - - case "$ac_given_INSTALL" in - [/$]*) INSTALL="$ac_given_INSTALL" ;; - *) INSTALL="$ac_dots$ac_given_INSTALL" ;; - esac - - echo creating "$ac_file" - rm -f "$ac_file" - configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure." - case "$ac_file" in - *Makefile*) ac_comsub="1i\\ -# $configure_input" ;; - *) ac_comsub= ;; - esac - - ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` - sed -e "$ac_comsub -s%@configure_input@%$configure_input%g -s%@srcdir@%$srcdir%g -s%@top_srcdir@%$top_srcdir%g -s%@INSTALL@%$INSTALL%g -" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file -fi; done -rm -f conftest.s* - -EOF -cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF - - test -d tools || mkdir tools - test -d tools/configtool || mkdir tools/configtool - test -d tools/configtool/standalone || mkdir tools/configtool/standalone - test -d tools/configtool/standalone/common || mkdir tools/configtool/standalone/common - - -exit 0 -EOF -chmod +x $CONFIG_STATUS -rm -fr confdefs* $ac_clean_files -test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1 - -if test "$no_recursion" != yes; then - - # Remove --cache-file and --srcdir arguments so they do not pile up. - ac_sub_configure_args= - ac_prev= - for ac_arg in $ac_configure_args; do - if test -n "$ac_prev"; then - ac_prev= - continue - fi - case "$ac_arg" in - -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=*) - ;; - -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) - ac_prev=srcdir ;; - -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) - ;; - *) ac_sub_configure_args="$ac_sub_configure_args $ac_arg" ;; - esac - done - - for ac_config_dir in ${SUBDIRS}; do - - # Do not complain, so a configure script can configure whichever - # parts of a large source tree are present. - if test ! -d $srcdir/$ac_config_dir; then - continue - fi - - echo configuring in $ac_config_dir - - case "$srcdir" in - .) ;; - *) - if test -d ./$ac_config_dir || mkdir ./$ac_config_dir; then :; - else - { echo "configure: error: can not create `pwd`/$ac_config_dir" 1>&2; exit 1; } - fi - ;; - esac - - ac_popdir=`pwd` - cd $ac_config_dir - - # A "../" for each directory in /$ac_config_dir. - ac_dots=`echo $ac_config_dir|sed -e 's%^\./%%' -e 's%[^/]$%&/%' -e 's%[^/]*/%../%g'` - - case "$srcdir" in - .) # No --srcdir option. We are building in place. - ac_sub_srcdir=$srcdir ;; - /*) # Absolute path. - ac_sub_srcdir=$srcdir/$ac_config_dir ;; - *) # Relative path. - ac_sub_srcdir=$ac_dots$srcdir/$ac_config_dir ;; - esac - - # Check for guested configure; otherwise get Cygnus style configure. - if test -f $ac_sub_srcdir/configure; then - ac_sub_configure=$ac_sub_srcdir/configure - elif test -f $ac_sub_srcdir/configure.in; then - ac_sub_configure=$ac_configure - else - echo "configure: warning: no configuration information is in $ac_config_dir" 1>&2 - ac_sub_configure= - fi - - # The recursion is here. - if test -n "$ac_sub_configure"; then - - # Make the cache file name correct relative to the subdirectory. - case "$cache_file" in - /*) ac_sub_cache_file=$cache_file ;; - *) # Relative path. - ac_sub_cache_file="$ac_dots$cache_file" ;; - esac - case "$ac_given_INSTALL" in - [/$]*) INSTALL="$ac_given_INSTALL" ;; - *) INSTALL="$ac_dots$ac_given_INSTALL" ;; - esac - - echo "running ${CONFIG_SHELL-/bin/sh} $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_sub_srcdir" - # The eval makes quoting arguments work. - if eval ${CONFIG_SHELL-/bin/sh} $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_sub_srcdir - then : - else - { echo "configure: error: $ac_sub_configure failed for $ac_config_dir" 1>&2; exit 1; } - fi - fi - - cd $ac_popdir - done -fi - diff --git a/host/configure.in b/host/configure.in deleted file mode 100644 --- a/host/configure.in +++ /dev/null @@ -1,68 +0,0 @@ -dnl Process this file with autoconf to produce a configure script. -dnl ==================================================================== -dnl -dnl configure.in -dnl -dnl Top-level configure script for eCos host-side software. -dnl -dnl ==================================================================== -dnl ####ECOSHOSTGPLCOPYRIGHTBEGIN#### -dnl ---------------------------------------------------------------------------- -dnl Copyright (C) 2002 Bart Veer -dnl Copyright (C) 1998, 1999, 2000, 2001 Red Hat, Inc. -dnl -dnl This file is part of the eCos host tools. -dnl -dnl This program is free software; you can redistribute it and/or modify it -dnl under the terms of the GNU General Public License as published by the Free -dnl Software Foundation; either version 2 of the License, or (at your option) -dnl any later version. -dnl -dnl This program is distributed in the hope that it will be useful, but WITHOUT -dnl ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -dnl FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for -dnl more details. -dnl -dnl You should have received a copy of the GNU General Public License along with -dnl this program; if not, write to the Free Software Foundation, Inc., -dnl 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -dnl -dnl ---------------------------------------------------------------------------- -dnl ####ECOSHOSTGPLCOPYRIGHTEND#### -dnl ==================================================================== -dnl#####DESCRIPTIONBEGIN#### -dnl -dnl Author(s): bartv -dnl Contact(s): bartv -dnl Date: 1998/12/17 -dnl Version: 0.01 -dnl -dnl####DESCRIPTIONEND#### -dnl ==================================================================== - -dnl Generic initialization -AC_INIT(../acsupport/config.guess) -AC_CONFIG_AUX_DIR(../acsupport) -AC_CANONICAL_HOST -AM_INIT_AUTOMAKE(eCos,2.0,0) -AM_MAINTAINER_MODE -ECOS_CHECK_BUILD_ne_SRC - -dnl Nothing actually gets built in this directory, so there is no -dnl point in worrying about compiler flags etc. Instead just -dnl recurse into appropriate subdirectories. The current directory -dnl tree is rather deep, so to avoid having to create lots of intermediate -dnl configure scripts and associated files the required build tree -dnl subdirectories are created here. -SUBDIRS="infra libcdl tools/configtool/standalone/common" - -AC_OUTPUT_COMMANDS([ - test -d tools || mkdir tools - test -d tools/configtool || mkdir tools/configtool - test -d tools/configtool/standalone || mkdir tools/configtool/standalone - test -d tools/configtool/standalone/common || mkdir tools/configtool/standalone/common -]) - -AC_SUBST(SUBDIRS) -AC_CONFIG_SUBDIRS(${SUBDIRS}) -AC_OUTPUT(Makefile) diff --git a/host/infra/ChangeLog b/host/infra/ChangeLog deleted file mode 100644 --- a/host/infra/ChangeLog +++ /dev/null @@ -1,189 +0,0 @@ -2003-02-12 Bart Veer - - * Makefile.in, configure, testsuite/Makefile.in: - Regenerate after acinclude.m4 update - -2002-08-03 Bart Veer - - * acinclude.m4, configure.in, Makefile.am, testsuite/Makefile.am: - Rework host-side autoconf support - - * hosttest.exp: allow for configury changes - - * assert.cxx: use mkstemp() when available - - * cyg_trac.h, trace.cxx: use const where appropriate - -2001-05-16 Bart Veer - - * Makefile.am: use new compiler flag support - - * configure, Makefile.in, testsuite/Makefile.in: regenerate - -2001-02-26 Julian Smart - - * assert.cxx: Cygwin 00r1 needs to include for _exit. - -2000-09-15 Jesper Skov - - * assert.cxx: Include unistd.h on unix. - Oops. Forgot the C wrapper. - -2000-08-18 Bart Veer - - * acinclude.m4, configure.in: - Allow cross-compilation - - * aclocal.m4, configure, Makefile.in, testsuite/Makefile.in - Regenerate - -1999-08-12 Bart Veer - - * configure: - * stamp-h.in: - * hosttest.exp: - First attempt at autoconfiscating the configtool - -1999-07-05 Bart Veer - - * assert.cxx: - Added new function cyg_assert_quickfail(), to facilitate - generating a dump file from inside gdb. - -1999-06-03 Bart Veer - - * configure: - Regenerated after more updates to toplevel acinclude.m4 - -1999-06-02 Bart Veer - - * configure: - Updated toplevel acinclude.m4 to add --enable-debuginfo option. - -1999-04-13 Bart Veer - - * testsuite/Makefile.am: - * trace.cxx: - * infra.h: - * checkdata.cxx: - * basetype.h: - * assert.cxx: - Updated copyright banner - -1999-03-02 Bart Veer - - * testcase.cxx (cyg_test_output): - Update to match earlier testcase.h header file change - (new status codes GDBCMD and NA, change from int to enum) - -1999-01-26 Bart Veer - - * Makefile.in: - * aclocal.m4: - * configure: - * Makefile.in: - Update to use autoconf 2.13 and automake 1.4, plus to - reflect tweaks to toplevel acinclude.m4 - - * hosttest.exp: - Improve the way compiler and linker diagnostics get handled. - -1999-01-21 Jonathan Larmour - - * basetype.h: - Remove all traces of non-CYG_KERNEL_USE_INIT_PRIORITY code - -1999-01-21 Bart Veer - - * acconfig.h: - * configure.in: - * infra.h: - Use new macro CYG_AC_SUBST_VERSION to generate a version - symbol CYGNUM_INFRA_VERSION - -1999-01-19 Bart Veer - - * hosttest.exp: - Allow makefile variable assignments of the form := as well as = - - * trace.cxx (parse_msg): - Fixed off-by-one error in output formatting, and "improved" the - way function names get displayed. - -1999-01-11 Bart Veer - - * testcase.cxx (cyg_test_output): - Use const where appropriate. - -1999-01-07 Bart Veer - - * testsuite/cyginfra/trace.exp: - * testsuite/cyginfra/ttrace4.cxx: - Added new testcase - - * testsuite/cyginfra/tassert7.cxx (main): - * testsuite/cyginfra/tassert6.cxx (main): - Eliminate warning about possible setjmp() side effects. - - * trace.cxx (trace_callback): - Off by one error when dumping a trace vector. - - * hosttest.exp: - Relative paths in include and library search paths were causing - problems. - The wrong Makefile was being examined for variable settings. - -1999-01-06 Bart Veer - - * testsuite/cyginfra/trace.exp: - * testsuite/cyginfra/ttrace1.cxx: - * testsuite/cyginfra/ttrace2.cxx: - * testsuite/cyginfra/ttrace3.cxx: - New test cases - - * testsuite/config/default.exp: - There was an easier way to get hold of hosttest.exp - - * hosttest.exp: - Reordered compile and link command lines so as to pick up the - correct versions of the libraries. - Allow packages to extract information from the Makefile - - * trace.cxx: - Initialisation via static object constructors did not work, - constructor priority ordering problems. - - * assert.cxx (default_handler): - Removed spurious debugging lines. - - * Makefile.am (install-exec-local): - Tweaks needed for MSVC - -1998-12-24 Bart Veer - - * First check-in of host-side infrastructure. - -//####COPYRIGHTBEGIN#### -// -// ---------------------------------------------------------------------------- -// Copyright (C) 1998, 1999, 2000 Red Hat, Inc. -// -// This file is part of the eCos host tools. -// -// This program is free software; you can redistribute it and/or modify it -// under the terms of the GNU General Public License as published by the Free -// Software Foundation; either version 2 of the License, or (at your option) -// any later version. -// -// This program is distributed in the hope that it will be useful, but WITHOUT -// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for -// more details. -// -// You should have received a copy of the GNU General Public License along with -// this program; if not, write to the Free Software Foundation, Inc., -// 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -// -// ---------------------------------------------------------------------------- -// -//####COPYRIGHTEND#### diff --git a/host/infra/Makefile.am b/host/infra/Makefile.am deleted file mode 100644 --- a/host/infra/Makefile.am +++ /dev/null @@ -1,208 +0,0 @@ -## Process this file with automake to produce Makefile.in -## ===================================================================== -## -## Makefile.am -## -## Host side implementation of the eCos infrastructure -## -## ===================================================================== -#######ECOSHOSTGPLCOPYRIGHTBEGIN#### -## ---------------------------------------------------------------------------- -# Copyright (C) 2002 Bart Veer -# Copyright (C) 1998, 1999, 2000, 2001 Red Hat, Inc. -# -# This file is part of the eCos host tools. -# -# This program is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License as published by the Free -# Software Foundation; either version 2 of the License, or (at your option) -# any later version. -# -# This program is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for -# more details. -# -# You should have received a copy of the GNU General Public License along with -# this program; if not, write to the Free Software Foundation, Inc., -# 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -# -## ---------------------------------------------------------------------------- -#######ECOSHOSTGPLCOPYRIGHTEND#### -## ===================================================================== -#######DESCRIPTIONBEGIN#### -## -## Author(s): bartv -## Contact(s): bartv -## Date: 1998/07/13 -## Version: 0.01 -## -######DESCRIPTIONEND#### -## ===================================================================== - -AUTOMAKE_OPTIONS = 1.3 foreign -SUBDIRS = testsuite - -## The generated makefile is responsible for the following: -## -## 1) copy across the shared header files cyg_type.h, cyg_ass.h and -## cyg_trac.h from the include directory into the appropriate part -## of the build tree. -## -## 2) on the target side the infrastructure headers depend on -## the configuration system via , and on the -## HAL package via . These two files need -## to be implemented somewhat differently on the host side. -## There are usable versions in the source tree. -## -## 3) build libcyginfra.a -## -## 4) allow the whole system to be installed, and all the usual -## makefile targets. - -## The main target is a static library. The problem is naming it -## correctly. automake seems to insist on calling it libcyginfra.a, -## even when compiling it with VC++. Various attempts to use -## cyginfra.lib instead with VC++ have failed. Instead the library -## will always be built as libcyginfra.a, but it may get installed -## as cyginfra.lib. - -noinst_LIBRARIES = libcyginfra.a -libcyginfra_a_SOURCES = assert.cxx \ - trace.cxx \ - checkdata.cxx \ - testcase.cxx - -## Pick up compiler flags etc. from configury -INCLUDES = @ecos_INCLUDES@ -LIBS = @ecos_LIBS@ @ecos_LDADD@ -AM_CFLAGS = @ecos_CFLAGS@ -AM_CXXFLAGS = @ecos_CXXFLAGS@ - -if MSVC -all-local: cyginfra.lib - -cyginfra.lib: libcyginfra.a - $(INSTALL) $< $@ - -clean-local: - $(RM) cyginfra.lib - -install-exec-local: all-local - $(mkinstalldirs) $(DESTDIR)$(libdir) - $(INSTALL) cyginfra.lib $(DESTDIR)$(libdir)/cyginfra.lib - -else - -all-local: -clean-local: - -install-exec-local: libcyginfra.a - $(mkinstalldirs) $(DESTDIR)$(libdir) - $(INSTALL) libcyginfra.a $(DESTDIR)$(libdir)/libcyginfra.a - -endif - -## ---------------------------------------------------------------------------- -## The header files do not all belong in the same directory. This -## causes problems with automake. First list the header files. - -copies = cyg/infra/cyg_type.h \ - cyg/infra/cyg_ass.h \ - cyg/infra/cyg_trac.h \ - cyg/infra/testcase.h \ - cyg/hal/basetype.h \ - pkgconf/infra.h \ - pkgconf/hostinfra.h - -## The headers are not installed as part of the default install -## target, instead a data hook is used. This avoids problems when the -## appropriate directories do not yet exist in the install tree. -noinst_HEADERS = $(copies) - -install-data-local: $(copies) - $(mkinstalldirs) $(DESTDIR)$(includedir) \ - $(DESTDIR)$(includedir)/cyg \ - $(DESTDIR)$(includedir)/cyg/infra \ - $(DESTDIR)$(includedir)/cyg/hal \ - $(DESTDIR)$(includedir)/pkgconf - $(INSTALL_DATA) cyg/infra/cyg_type.h $(DESTDIR)$(includedir)/cyg/infra - $(INSTALL_DATA) cyg/infra/cyg_ass.h $(DESTDIR)$(includedir)/cyg/infra - $(INSTALL_DATA) cyg/infra/cyg_trac.h $(DESTDIR)$(includedir)/cyg/infra - $(INSTALL_DATA) cyg/infra/testcase.h $(DESTDIR)$(includedir)/cyg/infra - $(INSTALL_DATA) cyg/hal/basetype.h $(DESTDIR)$(includedir)/cyg/hal - $(INSTALL_DATA) pkgconf/infra.h $(DESTDIR)$(includedir)/pkgconf - $(INSTALL_DATA) pkgconf/hostinfra.h $(DESTDIR)$(includedir)/pkgconf - -## It is necessary to have an extra set of rules to copy the header files -## into the build tree, so that they are in a sensible location when -## building the sources in this package. There are explicit dependencies -## for all the object files on these headers. -## -## The header file copies should be part of the clean. -CLEANFILES = $(copies) - -cyg/infra/cyg_type.h: cyg_type.h - @if [ -d cyg ] ; then true ; else mkdir cyg ; fi - @if [ -d cyg/infra ] ; then true ; else mkdir cyg/infra ; fi - $(INSTALL_DATA) $(<) $(@) - -cyg/infra/cyg_ass.h: cyg_ass.h - @if [ -d cyg ] ; then true ; else mkdir cyg ; fi - @if [ -d cyg/infra ] ; then true ; else mkdir cyg/infra ; fi - $(INSTALL_DATA) $(<) $(@) - -cyg/infra/cyg_trac.h: cyg_trac.h - @if [ -d cyg ] ; then true ; else mkdir cyg ; fi - @if [ -d cyg/infra ] ; then true ; else mkdir cyg/infra ; fi - $(INSTALL_DATA) $(<) $(@) - -cyg/infra/testcase.h: testcase.h - @if [ -d cyg ] ; then true ; else mkdir cyg ; fi - @if [ -d cyg/infra ] ; then true ; else mkdir cyg/infra ; fi - $(INSTALL_DATA) $(<) $(@) - -pkgconf/infra.h : infra.h - @if [ -d pkgconf ] ; then true ; else mkdir pkgconf ; fi - $(INSTALL_DATA) $(<) $(@) - -pkgconf/hostinfra.h : hostinfra.h - @if [ -d pkgconf ] ; then true ; else mkdir pkgconf ; fi - $(INSTALL_DATA) $(<) $(@) - -cyg/hal/basetype.h : basetype.h - @if [ -d cyg ] ; then true ; else mkdir cyg ; fi - @if [ -d cyg/hal ] ; then true ; else mkdir cyg/hal ; fi - $(INSTALL_DATA) $(<) $(@) - -## ---------------------------------------------------------------------------- -## Add specific dependencies for all source files - -assert.$(OBJEXT) : Makefile \ - pkgconf/infra.h \ - pkgconf/hostinfra.h \ - cyg/infra/cyg_type.h \ - cyg/hal/basetype.h \ - cyg/infra/cyg_ass.h - -trace.$(OBJEXT) : Makefile \ - pkgconf/infra.h \ - pkgconf/hostinfra.h \ - cyg/infra/cyg_type.h \ - cyg/hal/basetype.h \ - cyg/infra/cyg_ass.h \ - cyg/infra/cyg_trac.h - -checkdata.$(OBJEXT) : Makefile \ - cyg/infra/cyg_ass.h \ - pkgconf/infra.h \ - pkgconf/hostinfra.h \ - cyg/infra/cyg_type.h \ - cyg/hal/basetype.h - -testcase.$(OBJEXT): Makefile \ - cyg/infra/testcase.h \ - cyg/infra/cyg_type.h \ - cyg/hal/basetype.h \ - pkgconf/infra.h \ - pkgconf/hostinfra.h diff --git a/host/infra/Makefile.in b/host/infra/Makefile.in deleted file mode 100644 --- a/host/infra/Makefile.in +++ /dev/null @@ -1,648 +0,0 @@ -# Makefile.in generated automatically by automake 1.4-p5 from Makefile.am - -# Copyright (C) 1994, 1995-8, 1999, 2001 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. - -#######ECOSHOSTGPLCOPYRIGHTBEGIN#### -# Copyright (C) 2002 Bart Veer -# Copyright (C) 1998, 1999, 2000, 2001 Red Hat, Inc. -# -# This file is part of the eCos host tools. -# -# This program is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License as published by the Free -# Software Foundation; either version 2 of the License, or (at your option) -# any later version. -# -# This program is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for -# more details. -# -# You should have received a copy of the GNU General Public License along with -# this program; if not, write to the Free Software Foundation, Inc., -# 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -# -#######ECOSHOSTGPLCOPYRIGHTEND#### -#######DESCRIPTIONBEGIN#### -######DESCRIPTIONEND#### - - -SHELL = @SHELL@ - -srcdir = @srcdir@ -top_srcdir = @top_srcdir@ -VPATH = @srcdir@ -prefix = @prefix@ -exec_prefix = @exec_prefix@ - -bindir = @bindir@ -sbindir = @sbindir@ -libexecdir = @libexecdir@ -datadir = @datadir@ -sysconfdir = @sysconfdir@ -sharedstatedir = @sharedstatedir@ -localstatedir = @localstatedir@ -libdir = @libdir@ -infodir = @infodir@ -mandir = @mandir@ -includedir = @includedir@ -oldincludedir = /usr/include - -DESTDIR = - -pkgdatadir = $(datadir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ - -top_builddir = . - -ACLOCAL = @ACLOCAL@ -AUTOCONF = @AUTOCONF@ -AUTOMAKE = @AUTOMAKE@ -AUTOHEADER = @AUTOHEADER@ - -INSTALL = @INSTALL@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS) -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -transform = @program_transform_name@ - -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -host_alias = @host_alias@ -host_triplet = @host@ -CC = @CC@ -CXX = @CXX@ -ECOS_REPOSITORY = @ECOS_REPOSITORY@ -EXEEXT = @EXEEXT@ -MAINT = @MAINT@ -MAKEINFO = @MAKEINFO@ -MSVC_SRCDIR = @MSVC_SRCDIR@ -OBJEXT = @OBJEXT@ -PACKAGE = @PACKAGE@ -PACKAGE_DIR = @PACKAGE_DIR@ -PACKAGE_INSTALL = @PACKAGE_INSTALL@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -RANLIB = @RANLIB@ -VERSION = @VERSION@ -ecos_CFLAGS = @ecos_CFLAGS@ -ecos_CXXFLAGS = @ecos_CXXFLAGS@ -ecos_INCLUDES = @ecos_INCLUDES@ -ecos_LDADD = @ecos_LDADD@ -ecos_LIBS = @ecos_LIBS@ -ecos_infra_incdir = @ecos_infra_incdir@ -ecos_infra_libdir = @ecos_infra_libdir@ -ecos_libcdl_incdir = @ecos_libcdl_incdir@ -ecos_libcdl_libdir = @ecos_libcdl_libdir@ -ecos_tk_includes = @ecos_tk_includes@ -ecos_tk_libs = @ecos_tk_libs@ - -AUTOMAKE_OPTIONS = 1.3 foreign -SUBDIRS = testsuite - -noinst_LIBRARIES = libcyginfra.a -libcyginfra_a_SOURCES = assert.cxx \ - trace.cxx \ - checkdata.cxx \ - testcase.cxx - - -INCLUDES = @ecos_INCLUDES@ -LIBS = @ecos_LIBS@ @ecos_LDADD@ -AM_CFLAGS = @ecos_CFLAGS@ -AM_CXXFLAGS = @ecos_CXXFLAGS@ - -copies = cyg/infra/cyg_type.h \ - cyg/infra/cyg_ass.h \ - cyg/infra/cyg_trac.h \ - cyg/infra/testcase.h \ - cyg/hal/basetype.h \ - pkgconf/infra.h \ - pkgconf/hostinfra.h - - -noinst_HEADERS = $(copies) - -CLEANFILES = $(copies) -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -mkinstalldirs = $(SHELL) $(top_srcdir)/../../acsupport/mkinstalldirs -CONFIG_HEADER = hostinfra.h -CONFIG_CLEAN_FILES = -LIBRARIES = $(noinst_LIBRARIES) - - -DEFS = @DEFS@ -I. -I$(srcdir) -I. -CPPFLAGS = @CPPFLAGS@ -LDFLAGS = @LDFLAGS@ -libcyginfra_a_LIBADD = -libcyginfra_a_OBJECTS = assert.$(OBJEXT) trace.$(OBJEXT) \ -checkdata.$(OBJEXT) testcase.$(OBJEXT) -AR = ar -CXXFLAGS = @CXXFLAGS@ -CXXCOMPILE = $(CXX) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -CXXLD = $(CXX) -CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(LDFLAGS) -o $@ -HEADERS = $(noinst_HEADERS) - -DIST_COMMON = ./stamp-h.in ChangeLog Makefile.am Makefile.in acconfig.h \ -acinclude.m4 aclocal.m4 config.h.in configure configure.in - - -DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) - -TAR = gtar -GZIP_ENV = --best -DEP_FILES = .deps/assert.P .deps/checkdata.P .deps/testcase.P \ -.deps/trace.P -SOURCES = $(libcyginfra_a_SOURCES) -OBJECTS = $(libcyginfra_a_OBJECTS) - -all: all-redirect -.SUFFIXES: -.SUFFIXES: .S .c .cxx .o .obj .s -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) - cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile - -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES) - cd $(top_builddir) \ - && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status - -$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ configure.in acinclude.m4 - cd $(srcdir) && $(ACLOCAL) - -config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - $(SHELL) ./config.status --recheck -$(srcdir)/configure: @MAINTAINER_MODE_TRUE@$(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES) - cd $(srcdir) && $(AUTOCONF) - -hostinfra.h: stamp-h - @if test ! -f $@; then \ - rm -f stamp-h; \ - $(MAKE) stamp-h; \ - else :; fi -stamp-h: $(srcdir)/config.h.in $(top_builddir)/config.status - cd $(top_builddir) \ - && CONFIG_FILES= CONFIG_HEADERS=hostinfra.h:config.h.in \ - $(SHELL) ./config.status - @echo timestamp > stamp-h 2> /dev/null -$(srcdir)/config.h.in: @MAINTAINER_MODE_TRUE@$(srcdir)/stamp-h.in - @if test ! -f $@; then \ - rm -f $(srcdir)/stamp-h.in; \ - $(MAKE) $(srcdir)/stamp-h.in; \ - else :; fi -$(srcdir)/stamp-h.in: $(top_srcdir)/configure.in $(ACLOCAL_M4) acconfig.h - cd $(top_srcdir) && $(AUTOHEADER) - @echo timestamp > $(srcdir)/stamp-h.in 2> /dev/null - -mostlyclean-hdr: - -clean-hdr: - -distclean-hdr: - -rm -f hostinfra.h - -maintainer-clean-hdr: - -mostlyclean-noinstLIBRARIES: - -clean-noinstLIBRARIES: - -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) - -distclean-noinstLIBRARIES: - -maintainer-clean-noinstLIBRARIES: - -# FIXME: We should only use cygpath when building on Windows, -# and only if it is available. -.c.obj: - $(COMPILE) -c `cygpath -w $<` - -.s.o: - $(COMPILE) -c $< - -.S.o: - $(COMPILE) -c $< - -mostlyclean-compile: - -rm -f *.o core *.core - -rm -f *.$(OBJEXT) - -clean-compile: - -distclean-compile: - -rm -f *.tab.c - -maintainer-clean-compile: - -libcyginfra.a: $(libcyginfra_a_OBJECTS) $(libcyginfra_a_DEPENDENCIES) - -rm -f libcyginfra.a - $(AR) cru libcyginfra.a $(libcyginfra_a_OBJECTS) $(libcyginfra_a_LIBADD) - $(RANLIB) libcyginfra.a -.cxx.o: - $(CXXCOMPILE) -c $< -.cxx.obj: - $(CXXCOMPILE) -c `cygpath -w $<` - -# 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. - -@SET_MAKE@ - -all-recursive install-data-recursive install-exec-recursive \ -installdirs-recursive install-recursive uninstall-recursive \ -check-recursive installcheck-recursive info-recursive dvi-recursive: - @set fnord $(MAKEFLAGS); amf=$$2; \ - dot_seen=no; \ - target=`echo $@ | sed s/-recursive//`; \ - list='$(SUBDIRS)'; for subdir in $$list; do \ - echo "Making $$target in $$subdir"; \ - if test "$$subdir" = "."; then \ - dot_seen=yes; \ - local_target="$$target-am"; \ - else \ - local_target="$$target"; \ - fi; \ - (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ - || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ - done; \ - if test "$$dot_seen" = "no"; then \ - $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ - fi; test -z "$$fail" - -mostlyclean-recursive clean-recursive distclean-recursive \ -maintainer-clean-recursive: - @set fnord $(MAKEFLAGS); amf=$$2; \ - dot_seen=no; \ - rev=''; list='$(SUBDIRS)'; for subdir in $$list; do \ - rev="$$subdir $$rev"; \ - test "$$subdir" != "." || dot_seen=yes; \ - done; \ - test "$$dot_seen" = "no" && rev=". $$rev"; \ - target=`echo $@ | sed s/-recursive//`; \ - for subdir in $$rev; do \ - echo "Making $$target in $$subdir"; \ - if test "$$subdir" = "."; then \ - local_target="$$target-am"; \ - else \ - local_target="$$target"; \ - fi; \ - (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ - || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ - done && test -z "$$fail" -tags-recursive: - list='$(SUBDIRS)'; for subdir in $$list; do \ - test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ - done - -tags: TAGS - -ID: $(HEADERS) $(SOURCES) $(LISP) - list='$(SOURCES) $(HEADERS)'; \ - unique=`for i in $$list; do echo $$i; done | \ - awk ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - here=`pwd` && cd $(srcdir) \ - && mkid -f$$here/ID $$unique $(LISP) - -TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) $(LISP) - tags=; \ - here=`pwd`; \ - list='$(SUBDIRS)'; for subdir in $$list; do \ - if test "$$subdir" = .; then :; else \ - test -f $$subdir/TAGS && tags="$$tags -i $$here/$$subdir/TAGS"; \ - fi; \ - done; \ - list='$(SOURCES) $(HEADERS)'; \ - unique=`for i in $$list; do echo $$i; done | \ - awk ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - test -z "$(ETAGS_ARGS)config.h.in$$unique$(LISP)$$tags" \ - || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags config.h.in $$unique $(LISP) -o $$here/TAGS) - -mostlyclean-tags: - -clean-tags: - -distclean-tags: - -rm -f TAGS ID - -maintainer-clean-tags: - -distdir = $(PACKAGE)-$(VERSION) -top_distdir = $(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 - -rm -rf $(distdir) - GZIP=$(GZIP_ENV) $(TAR) zxf $(distdir).tar.gz - mkdir $(distdir)/=build - mkdir $(distdir)/=inst - dc_install_base=`cd $(distdir)/=inst && pwd`; \ - cd $(distdir)/=build \ - && ../configure --srcdir=.. --prefix=$$dc_install_base \ - && $(MAKE) $(AM_MAKEFLAGS) \ - && $(MAKE) $(AM_MAKEFLAGS) dvi \ - && $(MAKE) $(AM_MAKEFLAGS) check \ - && $(MAKE) $(AM_MAKEFLAGS) install \ - && $(MAKE) $(AM_MAKEFLAGS) installcheck \ - && $(MAKE) $(AM_MAKEFLAGS) dist - -rm -rf $(distdir) - @banner="$(distdir).tar.gz is ready for distribution"; \ - dashes=`echo "$$banner" | sed s/./=/g`; \ - echo "$$dashes"; \ - echo "$$banner"; \ - echo "$$dashes" -dist: distdir - -chmod -R a+r $(distdir) - GZIP=$(GZIP_ENV) $(TAR) chozf $(distdir).tar.gz $(distdir) - -rm -rf $(distdir) -dist-all: distdir - -chmod -R a+r $(distdir) - GZIP=$(GZIP_ENV) $(TAR) chozf $(distdir).tar.gz $(distdir) - -rm -rf $(distdir) -distdir: $(DISTFILES) - -rm -rf $(distdir) - mkdir $(distdir) - -chmod 777 $(distdir) - here=`cd $(top_builddir) && pwd`; \ - top_distdir=`cd $(distdir) && pwd`; \ - distdir=`cd $(distdir) && pwd`; \ - cd $(top_srcdir) \ - && $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --foreign Makefile - @for file in $(DISTFILES); do \ - d=$(srcdir); \ - if test -d $$d/$$file; then \ - cp -pr $$d/$$file $(distdir)/$$file; \ - else \ - test -f $(distdir)/$$file \ - || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ - || cp -p $$d/$$file $(distdir)/$$file || :; \ - fi; \ - done - for subdir in $(SUBDIRS); do \ - if test "$$subdir" = .; then :; else \ - test -d $(distdir)/$$subdir \ - || mkdir $(distdir)/$$subdir \ - || exit 1; \ - chmod 777 $(distdir)/$$subdir; \ - (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir=../$(distdir) distdir=../$(distdir)/$$subdir distdir) \ - || exit 1; \ - fi; \ - done - -DEPS_MAGIC := $(shell mkdir .deps > /dev/null 2>&1 || :) - --include $(DEP_FILES) - -mostlyclean-depend: - -clean-depend: - -distclean-depend: - -rm -rf .deps - -maintainer-clean-depend: - -%.o: %.c - @echo '$(COMPILE) -c $<'; \ - $(COMPILE) -Wp,-MD,.deps/$(*F).pp -c $< - @-cp .deps/$(*F).pp .deps/$(*F).P; \ - tr ' ' '\012' < .deps/$(*F).pp \ - | sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \ - >> .deps/$(*F).P; \ - rm .deps/$(*F).pp - -%.lo: %.c - @echo '$(LTCOMPILE) -c $<'; \ - $(LTCOMPILE) -Wp,-MD,.deps/$(*F).pp -c $< - @-sed -e 's/^\([^:]*\)\.o[ ]*:/\1.lo \1.o :/' \ - < .deps/$(*F).pp > .deps/$(*F).P; \ - tr ' ' '\012' < .deps/$(*F).pp \ - | sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \ - >> .deps/$(*F).P; \ - rm -f .deps/$(*F).pp - -%.o: %.cxx - @echo '$(CXXCOMPILE) -c $<'; \ - $(CXXCOMPILE) -Wp,-MD,.deps/$(*F).pp -c $< - @-cp .deps/$(*F).pp .deps/$(*F).P; \ - tr ' ' '\012' < .deps/$(*F).pp \ - | sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \ - >> .deps/$(*F).P; \ - rm .deps/$(*F).pp - -%.lo: %.cxx - @echo '$(LTCXXCOMPILE) -c $<'; \ - $(LTCXXCOMPILE) -Wp,-MD,.deps/$(*F).pp -c $< - @-sed -e 's/^\([^:]*\)\.o[ ]*:/\1.lo \1.o :/' \ - < .deps/$(*F).pp > .deps/$(*F).P; \ - tr ' ' '\012' < .deps/$(*F).pp \ - | sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \ - >> .deps/$(*F).P; \ - rm -f .deps/$(*F).pp -info-am: -info: info-recursive -dvi-am: -dvi: dvi-recursive -check-am: all-am -check: check-recursive -installcheck-am: -installcheck: installcheck-recursive -all-recursive-am: hostinfra.h - $(MAKE) $(AM_MAKEFLAGS) all-recursive - -install-exec-am: install-exec-local -install-exec: install-exec-recursive - -install-data-am: install-data-local -install-data: install-data-recursive - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am -install: install-recursive -uninstall-am: -uninstall: uninstall-recursive -all-am: Makefile $(LIBRARIES) $(HEADERS) hostinfra.h all-local -all-redirect: all-recursive-am -install-strip: - $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install -installdirs: installdirs-recursive -installdirs-am: - - -mostlyclean-generic: - -clean-generic: - -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) - -distclean-generic: - -rm -f Makefile $(CONFIG_CLEAN_FILES) - -rm -f config.cache config.log stamp-h stamp-h[0-9]* - -maintainer-clean-generic: -mostlyclean-am: mostlyclean-hdr mostlyclean-noinstLIBRARIES \ - mostlyclean-compile mostlyclean-tags mostlyclean-depend \ - mostlyclean-generic - -mostlyclean: mostlyclean-recursive - -clean-am: clean-hdr clean-noinstLIBRARIES clean-compile clean-tags \ - clean-depend clean-generic mostlyclean-am clean-local - -clean: clean-recursive - -distclean-am: distclean-hdr distclean-noinstLIBRARIES distclean-compile \ - distclean-tags distclean-depend distclean-generic \ - clean-am - -distclean: distclean-recursive - -rm -f config.status - -maintainer-clean-am: maintainer-clean-hdr \ - maintainer-clean-noinstLIBRARIES \ - maintainer-clean-compile maintainer-clean-tags \ - maintainer-clean-depend maintainer-clean-generic \ - distclean-am - @echo "This command is intended for maintainers to use;" - @echo "it deletes files that may require special tools to rebuild." - -maintainer-clean: maintainer-clean-recursive - -rm -f config.status - -.PHONY: mostlyclean-hdr distclean-hdr clean-hdr maintainer-clean-hdr \ -mostlyclean-noinstLIBRARIES distclean-noinstLIBRARIES \ -clean-noinstLIBRARIES maintainer-clean-noinstLIBRARIES \ -mostlyclean-compile distclean-compile clean-compile \ -maintainer-clean-compile install-data-recursive \ -uninstall-data-recursive install-exec-recursive \ -uninstall-exec-recursive installdirs-recursive uninstalldirs-recursive \ -all-recursive check-recursive installcheck-recursive info-recursive \ -dvi-recursive mostlyclean-recursive distclean-recursive clean-recursive \ -maintainer-clean-recursive tags tags-recursive mostlyclean-tags \ -distclean-tags clean-tags maintainer-clean-tags distdir \ -mostlyclean-depend distclean-depend clean-depend \ -maintainer-clean-depend info-am info dvi-am dvi check check-am \ -installcheck-am installcheck all-recursive-am install-exec-local \ -install-exec-am install-exec install-data-local install-data-am \ -install-data install-am install uninstall-am uninstall all-local \ -all-redirect all-am all installdirs-am installdirs mostlyclean-generic \ -distclean-generic clean-generic maintainer-clean-generic clean \ -mostlyclean distclean maintainer-clean - - -@MSVC_TRUE@all-local: cyginfra.lib - -@MSVC_TRUE@cyginfra.lib: libcyginfra.a -@MSVC_TRUE@ $(INSTALL) $< $@ - -@MSVC_TRUE@clean-local: -@MSVC_TRUE@ $(RM) cyginfra.lib - -@MSVC_TRUE@install-exec-local: all-local -@MSVC_TRUE@ $(mkinstalldirs) $(DESTDIR)$(libdir) -@MSVC_TRUE@ $(INSTALL) cyginfra.lib $(DESTDIR)$(libdir)/cyginfra.lib - -@MSVC_FALSE@all-local: -@MSVC_FALSE@clean-local: - -@MSVC_FALSE@install-exec-local: libcyginfra.a -@MSVC_FALSE@ $(mkinstalldirs) $(DESTDIR)$(libdir) -@MSVC_FALSE@ $(INSTALL) libcyginfra.a $(DESTDIR)$(libdir)/libcyginfra.a - -install-data-local: $(copies) - $(mkinstalldirs) $(DESTDIR)$(includedir) \ - $(DESTDIR)$(includedir)/cyg \ - $(DESTDIR)$(includedir)/cyg/infra \ - $(DESTDIR)$(includedir)/cyg/hal \ - $(DESTDIR)$(includedir)/pkgconf - $(INSTALL_DATA) cyg/infra/cyg_type.h $(DESTDIR)$(includedir)/cyg/infra - $(INSTALL_DATA) cyg/infra/cyg_ass.h $(DESTDIR)$(includedir)/cyg/infra - $(INSTALL_DATA) cyg/infra/cyg_trac.h $(DESTDIR)$(includedir)/cyg/infra - $(INSTALL_DATA) cyg/infra/testcase.h $(DESTDIR)$(includedir)/cyg/infra - $(INSTALL_DATA) cyg/hal/basetype.h $(DESTDIR)$(includedir)/cyg/hal - $(INSTALL_DATA) pkgconf/infra.h $(DESTDIR)$(includedir)/pkgconf - $(INSTALL_DATA) pkgconf/hostinfra.h $(DESTDIR)$(includedir)/pkgconf - -cyg/infra/cyg_type.h: cyg_type.h - @if [ -d cyg ] ; then true ; else mkdir cyg ; fi - @if [ -d cyg/infra ] ; then true ; else mkdir cyg/infra ; fi - $(INSTALL_DATA) $(<) $(@) - -cyg/infra/cyg_ass.h: cyg_ass.h - @if [ -d cyg ] ; then true ; else mkdir cyg ; fi - @if [ -d cyg/infra ] ; then true ; else mkdir cyg/infra ; fi - $(INSTALL_DATA) $(<) $(@) - -cyg/infra/cyg_trac.h: cyg_trac.h - @if [ -d cyg ] ; then true ; else mkdir cyg ; fi - @if [ -d cyg/infra ] ; then true ; else mkdir cyg/infra ; fi - $(INSTALL_DATA) $(<) $(@) - -cyg/infra/testcase.h: testcase.h - @if [ -d cyg ] ; then true ; else mkdir cyg ; fi - @if [ -d cyg/infra ] ; then true ; else mkdir cyg/infra ; fi - $(INSTALL_DATA) $(<) $(@) - -pkgconf/infra.h : infra.h - @if [ -d pkgconf ] ; then true ; else mkdir pkgconf ; fi - $(INSTALL_DATA) $(<) $(@) - -pkgconf/hostinfra.h : hostinfra.h - @if [ -d pkgconf ] ; then true ; else mkdir pkgconf ; fi - $(INSTALL_DATA) $(<) $(@) - -cyg/hal/basetype.h : basetype.h - @if [ -d cyg ] ; then true ; else mkdir cyg ; fi - @if [ -d cyg/hal ] ; then true ; else mkdir cyg/hal ; fi - $(INSTALL_DATA) $(<) $(@) - -assert.$(OBJEXT) : Makefile \ - pkgconf/infra.h \ - pkgconf/hostinfra.h \ - cyg/infra/cyg_type.h \ - cyg/hal/basetype.h \ - cyg/infra/cyg_ass.h - -trace.$(OBJEXT) : Makefile \ - pkgconf/infra.h \ - pkgconf/hostinfra.h \ - cyg/infra/cyg_type.h \ - cyg/hal/basetype.h \ - cyg/infra/cyg_ass.h \ - cyg/infra/cyg_trac.h - -checkdata.$(OBJEXT) : Makefile \ - cyg/infra/cyg_ass.h \ - pkgconf/infra.h \ - pkgconf/hostinfra.h \ - cyg/infra/cyg_type.h \ - cyg/hal/basetype.h - -testcase.$(OBJEXT): Makefile \ - cyg/infra/testcase.h \ - cyg/infra/cyg_type.h \ - cyg/hal/basetype.h \ - pkgconf/infra.h \ - pkgconf/hostinfra.h - -# 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/host/infra/acconfig.h b/host/infra/acconfig.h deleted file mode 100644 --- a/host/infra/acconfig.h +++ /dev/null @@ -1,53 +0,0 @@ -#ifndef CYGONCE_INFRA_CONFIG_H -# define CYGONCE_INFRA_CONFIG_H - -//====================================================================== -// -// acconfig.h -// -// Configuration header for host-side infrastructure -// -//====================================================================== -//####COPYRIGHTBEGIN#### -// -// ---------------------------------------------------------------------------- -// Copyright (C) 1998, 1999, 2000 Red Hat, Inc. -// -// This file is part of the eCos host tools. -// -// This program is free software; you can redistribute it and/or modify it -// under the terms of the GNU General Public License as published by the Free -// Software Foundation; either version 2 of the License, or (at your option) -// any later version. -// -// This program is distributed in the hope that it will be useful, but WITHOUT -// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for -// more details. -// -// You should have received a copy of the GNU General Public License along with -// this program; if not, write to the Free Software Foundation, Inc., -// 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -// -// ---------------------------------------------------------------------------- -// -//####COPYRIGHTEND#### -//====================================================================== -//#####DESCRIPTIONBEGIN#### -// -// Author(s): bartv -// Contact(s): bartv -// Date: 1998/12/16 -// Version: 0.01 -// -//####DESCRIPTIONEND#### -//====================================================================== - -#undef CYGNUM_INFRA_VERSION -#undef cyg_halint64 -#undef cyg_halcount64 -#undef CYGDBG_INFRA_DEBUG_FUNCTION_PSEUDOMACRO -#undef CYGNUM_INFRA_TRACE_VECTOR_SIZE - -#endif // CYGONCE_INFRA_CONFIG_H -// End of config.h diff --git a/host/infra/acinclude.m4 b/host/infra/acinclude.m4 deleted file mode 100644 --- a/host/infra/acinclude.m4 +++ /dev/null @@ -1,47 +0,0 @@ -dnl Process this file with aclocal to get an aclocal.m4 file. Then -dnl process that with autoconf. -dnl ==================================================================== -dnl -dnl acinclude.m4 -dnl -dnl Host side implementation of the eCos infrastructure. -dnl -dnl ==================================================================== -dnl ####ECOSHOSTGPLCOPYRIGHTBEGIN#### -dnl ---------------------------------------------------------------------------- -dnl Copyright (C) 2002 Bart Veer -dnl Copyright (C) 1998, 1999, 2000, 2001 Red Hat, Inc. -dnl -dnl This file is part of the eCos host tools. -dnl -dnl This program is free software; you can redistribute it and/or modify it -dnl under the terms of the GNU General Public License as published by the Free -dnl Software Foundation; either version 2 of the License, or (at your option) -dnl any later version. -dnl -dnl This program is distributed in the hope that it will be useful, but WITHOUT -dnl ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -dnl FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for -dnl more details. -dnl -dnl You should have received a copy of the GNU General Public License along with -dnl this program; if not, write to the Free Software Foundation, Inc., -dnl 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -dnl -dnl ---------------------------------------------------------------------------- -dnl ####ECOSHOSTGPLCOPYRIGHTEND#### -dnl ==================================================================== -dnl#####DESCRIPTIONBEGIN#### -dnl -dnl Author(s): bartv -dnl Contact(s): bartv -dnl Date: 1998/07/14 -dnl Version: 0.01 -dnl -dnl####DESCRIPTIONEND#### -dnl ==================================================================== - -dnl Access shared macros. -dnl AM_CONDITIONAL needs to be mentioned here or else aclocal does not -dnl incorporate the macro into aclocal.m4 -sinclude(../../acsupport/acinclude.m4) diff --git a/host/infra/aclocal.m4 b/host/infra/aclocal.m4 deleted file mode 100644 --- a/host/infra/aclocal.m4 +++ /dev/null @@ -1,208 +0,0 @@ -dnl aclocal.m4 generated automatically by aclocal 1.4-p5 - -dnl Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc. -dnl This file is free software; the Free Software Foundation -dnl gives unlimited permission to copy and/or distribute it, -dnl with or without modifications, as long as this notice is preserved. - -dnl This program is distributed in the hope that it will be useful, -dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without -dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A -dnl PARTICULAR PURPOSE. - -dnl Process this file with aclocal to get an aclocal.m4 file. Then -dnl process that with autoconf. -dnl ==================================================================== -dnl -dnl acinclude.m4 -dnl -dnl Host side implementation of the eCos infrastructure. -dnl -dnl ==================================================================== -dnl ####ECOSHOSTGPLCOPYRIGHTBEGIN#### -dnl ---------------------------------------------------------------------------- -dnl Copyright (C) 2002 Bart Veer -dnl Copyright (C) 1998, 1999, 2000, 2001 Red Hat, Inc. -dnl -dnl This file is part of the eCos host tools. -dnl -dnl This program is free software; you can redistribute it and/or modify it -dnl under the terms of the GNU General Public License as published by the Free -dnl Software Foundation; either version 2 of the License, or (at your option) -dnl any later version. -dnl -dnl This program is distributed in the hope that it will be useful, but WITHOUT -dnl ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -dnl FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for -dnl more details. -dnl -dnl You should have received a copy of the GNU General Public License along with -dnl this program; if not, write to the Free Software Foundation, Inc., -dnl 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -dnl -dnl ---------------------------------------------------------------------------- -dnl ####ECOSHOSTGPLCOPYRIGHTEND#### -dnl ==================================================================== -dnl#####DESCRIPTIONBEGIN#### -dnl -dnl Author(s): bartv -dnl Contact(s): bartv -dnl Date: 1998/07/14 -dnl Version: 0.01 -dnl -dnl####DESCRIPTIONEND#### -dnl ==================================================================== - -dnl Access shared macros. -dnl AM_CONDITIONAL needs to be mentioned here or else aclocal does not -dnl incorporate the macro into aclocal.m4 -sinclude(../../acsupport/acinclude.m4) - -# Define a conditional. - -AC_DEFUN([AM_CONDITIONAL], -[AC_SUBST($1_TRUE) -AC_SUBST($1_FALSE) -if $2; then - $1_TRUE= - $1_FALSE='#' -else - $1_TRUE='#' - $1_FALSE= -fi]) - -# Do all the work for Automake. 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. - -# serial 1 - -dnl Usage: -dnl AM_INIT_AUTOMAKE(package,version, [no-define]) - -AC_DEFUN([AM_INIT_AUTOMAKE], -[AC_REQUIRE([AC_PROG_INSTALL]) -PACKAGE=[$1] -AC_SUBST(PACKAGE) -VERSION=[$2] -AC_SUBST(VERSION) -dnl test to see if srcdir already configured -if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then - AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) -fi -ifelse([$3],, -AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) -AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])) -AC_REQUIRE([AM_SANITY_CHECK]) -AC_REQUIRE([AC_ARG_PROGRAM]) -dnl FIXME This is truly gross. -missing_dir=`cd $ac_aux_dir && pwd` -AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir) -AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir) -AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir) -AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir) -AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir) -AC_REQUIRE([AC_PROG_MAKE_SET])]) - -# -# Check to make sure that the build environment is sane. -# - -AC_DEFUN([AM_SANITY_CHECK], -[AC_MSG_CHECKING([whether build environment is sane]) -# Just in case -sleep 1 -echo timestamp > conftestfile -# 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 conftestfile 2> /dev/null` - if test "[$]*" = "X"; then - # -L didn't work. - set X `ls -t $srcdir/configure conftestfile` - fi - if test "[$]*" != "X $srcdir/configure conftestfile" \ - && test "[$]*" != "X conftestfile $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" = conftestfile - ) -then - # Ok. - : -else - AC_MSG_ERROR([newly created file is older than distributed files! -Check your system clock]) -fi -rm -f conftest* -AC_MSG_RESULT(yes)]) - -dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY) -dnl The program must properly implement --version. -AC_DEFUN([AM_MISSING_PROG], -[AC_MSG_CHECKING(for working $2) -# Run test in a subshell; some versions of sh will print an error if -# an executable is not found, even if stderr is redirected. -# Redirect stdin to placate older versions of autoconf. Sigh. -if ($2 --version) < /dev/null > /dev/null 2>&1; then - $1=$2 - AC_MSG_RESULT(found) -else - $1="$3/missing $2" - AC_MSG_RESULT(missing) -fi -AC_SUBST($1)]) - -# Add --enable-maintainer-mode option to configure. -# From Jim Meyering - -# serial 1 - -AC_DEFUN([AM_MAINTAINER_MODE], -[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) - dnl maintainer-mode is disabled by default - AC_ARG_ENABLE(maintainer-mode, -[ --enable-maintainer-mode enable make rules and dependencies not useful - (and sometimes confusing) to the casual installer], - USE_MAINTAINER_MODE=$enableval, - USE_MAINTAINER_MODE=no) - AC_MSG_RESULT($USE_MAINTAINER_MODE) - AM_CONDITIONAL(MAINTAINER_MODE, test $USE_MAINTAINER_MODE = yes) - MAINT=$MAINTAINER_MODE_TRUE - AC_SUBST(MAINT)dnl -] -) - -# Like AC_CONFIG_HEADER, but automatically create stamp file. - -AC_DEFUN([AM_CONFIG_HEADER], -[AC_PREREQ([2.12]) -AC_CONFIG_HEADER([$1]) -dnl When config.status generates a header, we must update the stamp-h file. -dnl This file resides in the same directory as the config header -dnl that is generated. We must strip everything past the first ":", -dnl and everything past the last "/". -AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl -ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>, -<>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>, -<>; do - case " <<$>>CONFIG_HEADERS " in - *" <<$>>am_file "*<<)>> - echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx - ;; - esac - am_indx=`expr "<<$>>am_indx" + 1` -done<<>>dnl>>) -changequote([,]))]) - diff --git a/host/infra/assert.cxx b/host/infra/assert.cxx deleted file mode 100644 --- a/host/infra/assert.cxx +++ /dev/null @@ -1,329 +0,0 @@ -//{{{ Banner - -//============================================================================ -// -// assert.cxx -// -// Host side implementation of the infrastructure assertions. -// -//============================================================================ -//####COPYRIGHTBEGIN#### -// -// ---------------------------------------------------------------------------- -// Copyright (C) 2002 Bart Veer -// Copyright (C) 1998, 1999, 2000, 2001 Red Hat, Inc. -// -// This file is part of the eCos host tools. -// -// This program is free software; you can redistribute it and/or modify it -// under the terms of the GNU General Public License as published by the Free -// Software Foundation; either version 2 of the License, or (at your option) -// any later version. -// -// This program is distributed in the hope that it will be useful, but WITHOUT -// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for -// more details. -// -// You should have received a copy of the GNU General Public License along with -// this program; if not, write to the Free Software Foundation, Inc., -// 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -// -// ---------------------------------------------------------------------------- -// -//####COPYRIGHTEND#### -//============================================================================ -//#####DESCRIPTIONBEGIN#### -// -// Author(s): bartv -// Contact(s): bartv -// Date: 1998/11/27 -// Version: 0.01 -// Purpose: To provide a host-side implementation of the eCos assertion -// facilities. -// -//####DESCRIPTIONEND#### -//============================================================================ - -//}}} -//{{{ #include's - -#include "pkgconf/infra.h" -#include "cyg/infra/cyg_type.h" -// Without this symbol the header file has no effect -#define CYGDBG_USE_TRACING -// Make sure that the host-side extensions get prototyped -// as well. -#define CYG_DECLARE_HOST_ASSERTION_SUPPORT -#include "cyg/infra/cyg_ass.h" - -// STDIO is needed for the default assertion handler. -// STDLIB is needed for exit() and the status codes. -#include -#include - -#if defined(__unix__) || defined(__CYGWIN32__) -extern "C" { -#include // Needed for _exit() -} -#endif - -// These are needed for the table of callbacks. -#include -#include -#include - -//}}} - -// ------------------------------------------------------------------------- -// Statics. The host-side assertion code requires two bits of data. -// -// The first identifies the function that should actually get invoked -// when an assertion is triggered. A default implementation is defined -// in this module, but applications may install a replacement. -// -// The second is a table of callback functions that various libraries -// or bits of application code may install. Each such callback gets invoked -// when an assertion triggers. - -// VC++ bogosity. Using a full function pointer prototype in a template -// confuses the compiler. It is still possible to declare the callbacks vector, -// but not any iterators for that vector. A typedef makes the problem go -// away. -typedef void (*cyg_callback_fn)(void (*)(const char*)); - - // The current assertion handler -static bool (*current_handler)( const char*, const char*, cyg_uint32, const char*) = 0; - - // The callback table. -static std::vector > callbacks; - -// ---------------------------------------------------------------------------- -// Many applications will want to handle assertion failures differently -// from the default, for example pipe the output into an emacs buffer -// rather than just generate a file. This routine allows a suitable -// function to be installed. - -extern "C" void -cyg_assert_install_failure_handler( bool(*fn)(const char*, const char*, cyg_uint32, const char*) ) -{ - current_handler = fn; -} - -// ---------------------------------------------------------------------------- -// Various different bits of the system may want to register callback functions -// that get invoked during an assertion failure and that output useful -// data. Typically this might happen in the constructor for a static object. -// A good example of such a callback is the implementation of the trace code. -// -// The implementation requires creating a new entry in the static vector. -// A memory exhaustion exception could occur but there is no sensible way of -// handling it at this level. -// -// Multiple callbacks with the same name are legal. Multiple callbacks with -// the same function are unlikely, but it is probably not worthwhile raising -// an exception (especially since this code may be called from C). -extern "C" void -cyg_assert_install_failure_callback( const char* name, void (*fn)(void (*)(const char*)) ) -{ - callbacks.push_back(std::make_pair(name, fn)); -} - -// ------------------------------------------------------------------------- -// Once an assertion has triggered either the default handler or the -// installed handler will want to invoke all the callbacks. Rather than -// provide direct access to the callback table and require the calling -// code to be in C++, a functional interface is provided instead. -extern "C" void -cyg_assert_failure_invoke_callbacks( - void (*first_fn)(const char*), - void (*data_fn)(const char*), - void (*final_fn)(void) ) -{ - std::vector >::const_iterator i; - - for ( i = callbacks.begin(); i != callbacks.end(); i++ ) { - - if (0 != first_fn) { - (*first_fn)(i->first); - } - if (0 != data_fn) { - (*(i->second))(data_fn); - } - if (0 != final_fn) { - (*final_fn)(); - } - } -} - -// ---------------------------------------------------------------------------- -// The default assertion handler. This assumes that the application is -// a console application with a sensible stderr stream. -// -// First some initial diagnostics are output immediately, in case -// subsequent attempts to output more data cause additional failures. It -// is worthwhile detecting recursive assertion failures. -// -// Assuming the table of callbacks is not empty it is possible to -// output some more data to a file. If possible mkstemp() is used to -// create this file. If mkstemp() is not available then tmpnam() is -// used instead. That function has security problems, albeit not ones -// likely to affect dump files. Once the file is opened the callbacks -// are invoked. Three utilities have to be provided to do the real -// work, and a static is used to keep track of the FILE * pointer. -// -// The testcase tassert8, and in particular the associated Tcl proc -// tassert8_filter in testsuite/cyginfra/assert.exp, has detailed -// knowledge of the output format. Any changes here may need to be -// reflected in that test case. There are also support routines in -// hosttest.exp which may need to be updated. - -static FILE * default_handler_output_file = 0; -static bool body_contains_data = false; - - // output the callback name -static void -default_handler_first_fn(const char* name) -{ - if (0 != default_handler_output_file) { - fprintf(default_handler_output_file, "# {{{ %s\n\n", name); - } - body_contains_data = false; -} - - // output some actual text. -static void -default_handler_second_fn(const char* data) -{ - body_contains_data = true; - if (0 != default_handler_output_file) { - fputs(data, default_handler_output_file); - } -} - - // the end of a callback. -static void -default_handler_final_fn( void ) -{ - - if (0 != default_handler_output_file) { - if (body_contains_data) { - fputs("\n", default_handler_output_file); - } - fputs("# }}}\n", default_handler_output_file); - } -} - - -static void -default_handler(const char* fn, const char* file, cyg_uint32 lineno, const char* msg) -{ - static int invoke_count = 0; - if (2 == invoke_count) { - // The fprintf() immediately below causes an assertion failure - } else if (1 == invoke_count) { - invoke_count++; - fprintf(stderr, "Recursive assertion failure.\n"); - return; - } else { - invoke_count = 1; - } - - // There is an argument for using write() rather than fprintf() here, - // in case the C library has been corrupted. For now this has not been - // attempted. - if (0 == msg) - msg =""; - if (0 == file) - file = ""; - - fprintf(stderr, "Assertion failure: %s\n", msg); - fprintf(stderr, "File %s, line number %lu\n", file, (unsigned long) lineno); - if (0 != fn) - fprintf(stderr, "Function %s\n", fn); - - // Only create a logfile if more information is available. - if (0 != callbacks.size() ) { - - // Use mkstemp() if possible, but only when running on a platform where /tmp - // is likely to be available. -#if defined(HAVE_MKSTEMP) && !defined(_MSC_VER) - char filename[32]; - int fd; - strcpy(filename, "/tmp/ecosdump.XXXXXX"); - fd = mkstemp(filename); - if (-1 == fd) { - fprintf(stderr, "Unable to create a suitable output file for additional data.\n"); - } else { - default_handler_output_file = fdopen(fd, "w"); - if (0 == default_handler_output_file) { - close(fd); - } - } -#else - char filename[L_tmpnam]; - if (0 == tmpnam(filename)) { - fprintf(stderr, "Unable to create a suitable output file for additional data.\n"); - } else { - - // No attempt is made to ensure that the file does not already - // exist. This would require POSIX calls rather than ISO C ones. - // The probability of a problem is considered to be too small - // to worry about. - default_handler_output_file = fopen(filename, "w"); - } -#endif - if (0 == default_handler_output_file) { - fprintf(stderr, "Unable to open output file %s\n", filename); - fputs("No further assertion information is available.\n", stderr); - } else { - fprintf(stderr, "Writing additional output to %s\n", filename); - - // Repeat the information about the assertion itself. - fprintf(default_handler_output_file, "Assertion failure: %s\n", msg); - fprintf(default_handler_output_file, "File %s, line number %lu\n", file, (unsigned long) lineno); - if (0 != fn) - fprintf(default_handler_output_file, "Function %s\n", fn); - fputs("\n", default_handler_output_file); - - // Now for the various callbacks. - cyg_assert_failure_invoke_callbacks( &default_handler_first_fn, - &default_handler_second_fn, &default_handler_final_fn ); - - // And close the file. - fputs("\nEnd of assertion data.\n", default_handler_output_file); - fclose(default_handler_output_file); - } - } - fflush(stderr); -} - -// ---------------------------------------------------------------------------- -// The assertion handler. This is the function that gets invoked when -// an assertion triggers. If a special assertion handler has been installed -// then this gets called. If it returns false or if no special handler is -// available then the default handler gets called instead. Typically the -// user will now have a lot of information about what happened to cause the -// assertion failure. The next stage is to invoke abort() which should -// terminate the program and generate a core dump for subsequent inspection -// (unless of course the application is already running in a debugger session). -// A final call to _exit() should be completely redundant. - -extern "C" void -cyg_assert_fail( const char* fn, const char* file, cyg_uint32 lineno, const char* msg ) -{ - - if ((0 == current_handler) || !(*current_handler)(fn, file, lineno, msg)) { - default_handler(fn, file, lineno, msg); - } - abort(); - _exit(0); -} - -// ---------------------------------------------------------------------------- -// A utility function, primarily intended to be called from inside gdb. -extern "C" void -cyg_assert_quickfail(void) -{ - cyg_assert_fail("gdb", "", 0, "manual call"); -} diff --git a/host/infra/basetype.h b/host/infra/basetype.h deleted file mode 100644 --- a/host/infra/basetype.h +++ /dev/null @@ -1,98 +0,0 @@ -#ifndef CYGONCE_HAL_BASETYPE_H -# define CYGONCE_HAL_BASETYPE_H - -//====================================================================== -// -// basetype.h -// -// HAL emulation for the host-side infrastructure. -// -//====================================================================== -//####COPYRIGHTBEGIN#### -// -// ---------------------------------------------------------------------------- -// Copyright (C) 1998, 1999, 2000 Red Hat, Inc. -// -// This file is part of the eCos host tools. -// -// This program is free software; you can redistribute it and/or modify it -// under the terms of the GNU General Public License as published by the Free -// Software Foundation; either version 2 of the License, or (at your option) -// any later version. -// -// This program is distributed in the hope that it will be useful, but WITHOUT -// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for -// more details. -// -// You should have received a copy of the GNU General Public License along with -// this program; if not, write to the Free Software Foundation, Inc., -// 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -// -// ---------------------------------------------------------------------------- -// -//####COPYRIGHTEND#### -//====================================================================== -//#####DESCRIPTIONBEGIN#### -// -// Author(s): bartv -// Contact(s): bartv -// Date: 1998/07/13 -// Version: 0.01 -// -//####DESCRIPTIONEND#### -//====================================================================== - -// The purpose of this header file is to replicate the functionality -// provided by on the target side. Essentially -// this file has to define endianness. Optionally it can also define -// the correct data types for e.g. cyg_count32 etc. -// -// On the host side portability is achieved by means of autoconf and -// feature tests, as opposed to re-implementing the HAL for each -// platform. In particular there will be a generated header file -// which gets filled in during the configure -// process. -// -// It has been decided that the host side should use exactly the same -// infrastructure header files as the target side (although extra -// functionality may be defined in these header files where -// appropriate). This means that the host side needs to provide -// , even though it does not contain a HAL. -// -// This implementation of reads in the -// configuration header generated by the configure script and adapts -// this information into whatever is required by -// . - -#ifndef CYGONCE_PKGCONF_INFRA_H -# include -#endif - -// The autoconf test for endianness will result in a #define for -// LITTLE_ENDIAN_HOST on appropriate platforms. This needs to be -// converted into a definition of CYG_BYTEORDER as per the target-side -// HAL headers. - -#ifdef WORDS_BIGENDIAN -# define CYG_BYTEORDER CYG_MSBFIRST -#else -# define CYG_BYTEORDER CYG_LSBFIRST -#endif - -// The default definitions for cyg_halint8/16/32 and cyg_halcount8/16/32 -// should be fine (although eventually we may come across a platform -// where int's are 64 bit). 64 bit arithmetic is a bit more of a problem. -// on the majority of systems so there is an autoconf test which will -// generate appropriate #define's for cyg_halint64 and cyg_halcount64, -// which means this header file does not to do anything more. -// cyg_halbool and cyg_halatomic should both be ok. - - -// Any symbols defined in which have been processed -// here should no longer be of any interest, and in the interests of -// reducing name space pollution they get undef'ed here. -#undef WORDS_BIGENDIAN - -#endif // CYGONCE_HAL_BASETYPE_H -// End of basetype.h diff --git a/host/infra/checkdata.cxx b/host/infra/checkdata.cxx deleted file mode 100644 --- a/host/infra/checkdata.cxx +++ /dev/null @@ -1,74 +0,0 @@ -//{{{ Banner - -//============================================================================ -// -// checkdata.cxx -// -// Host side implementation of the check_func() and check_data() -// utilities. -// -//============================================================================ -//####COPYRIGHTBEGIN#### -// -// ---------------------------------------------------------------------------- -// Copyright (C) 1998, 1999, 2000 Red Hat, Inc. -// -// This file is part of the eCos host tools. -// -// This program is free software; you can redistribute it and/or modify it -// under the terms of the GNU General Public License as published by the Free -// Software Foundation; either version 2 of the License, or (at your option) -// any later version. -// -// This program is distributed in the hope that it will be useful, but WITHOUT -// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for -// more details. -// -// You should have received a copy of the GNU General Public License along with -// this program; if not, write to the Free Software Foundation, Inc., -// 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -// -// ---------------------------------------------------------------------------- -// -//####COPYRIGHTEND#### -//============================================================================ -//#####DESCRIPTIONBEGIN#### -// -// Author(s): bartv -// Contact(s): bartv -// Date: 1998/12/02 -// Version: 0.01 -// Purpose: To provide a host-side implementation of two of the -// eCos assertion facilities. facilities. -// -//####DESCRIPTIONEND#### -//============================================================================ - -//}}} -//{{{ #include's - -#include "cyg/infra/cyg_ass.h" - -//}}} - -// ------------------------------------------------------------------------- -// It is convenient to have cyg_check_data_ptr() and cyg_check_func_ptr() -// in a separate file from cyg_assert_fail(). That way users can override -// cyg_assert_fail() itself in application code without losing access to -// the check_data and check_func routines. -// -// The actual implementation is very limited. It might be possible to -// do better on specific platforms. - -extern "C" cyg_bool -cyg_check_data_ptr( void * ptr ) -{ - return 0 != ptr; -} - -extern "C" cyg_bool -cyg_check_func_ptr ( void (*ptr)(void) ) -{ - return 0 != ptr; -} diff --git a/host/infra/config.h.in b/host/infra/config.h.in deleted file mode 100644 --- a/host/infra/config.h.in +++ /dev/null @@ -1,20 +0,0 @@ -/* config.h.in. Generated automatically from configure.in by autoheader. */ - -/* Define if your processor stores words with the most significant - byte first (like Motorola and SPARC, unlike Intel and VAX). */ -#undef WORDS_BIGENDIAN - -#undef CYGNUM_INFRA_VERSION -#undef cyg_halint64 -#undef cyg_halcount64 -#undef CYGDBG_INFRA_DEBUG_FUNCTION_PSEUDOMACRO -#undef CYGNUM_INFRA_TRACE_VECTOR_SIZE - -/* The number of bytes in a int *. */ -#undef SIZEOF_INT_P - -/* The number of bytes in a long. */ -#undef SIZEOF_LONG - -/* Define if you have the mkstemp function. */ -#undef HAVE_MKSTEMP diff --git a/host/infra/configure b/host/infra/configure deleted file mode 100644 --- a/host/infra/configure +++ /dev/null @@ -1,2361 +0,0 @@ -#! /bin/sh - -# Guess values for system-dependent variables and create Makefiles. -# Generated automatically using autoconf version 2.13 -# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc. -# -# This configure script is free software; the Free Software Foundation -# gives unlimited permission to copy, distribute and modify it. - -# Defaults: -ac_help= -ac_default_prefix=/usr/local -# Any additions from configure.in: -ac_help="$ac_help - --enable-maintainer-mode enable make rules and dependencies not useful - (and sometimes confusing) to the casual installer" -ac_help="$ac_help - --enable-debug do a debug rather than a release build" -ac_help="$ac_help - --enable-ansi do an ANSI rather than a unicode build" -ac_help="$ac_help - --enable-tracebufsize=X size of the trace buffer" - -# Initialize some variables set by options. -# The variables have the same names as the options, with -# dashes changed to underlines. -build=NONE -cache_file=./config.cache -exec_prefix=NONE -host=NONE -no_create= -nonopt=NONE -no_recursion= -prefix=NONE -program_prefix=NONE -program_suffix=NONE -program_transform_name=s,x,x, -silent= -site= -srcdir= -target=NONE -verbose= -x_includes=NONE -x_libraries=NONE -bindir='${exec_prefix}/bin' -sbindir='${exec_prefix}/sbin' -libexecdir='${exec_prefix}/libexec' -datadir='${prefix}/share' -sysconfdir='${prefix}/etc' -sharedstatedir='${prefix}/com' -localstatedir='${prefix}/var' -libdir='${exec_prefix}/lib' -includedir='${prefix}/include' -oldincludedir='/usr/include' -infodir='${prefix}/info' -mandir='${prefix}/man' - -# Initialize some other variables. -subdirs= -MFLAGS= MAKEFLAGS= -SHELL=${CONFIG_SHELL-/bin/sh} -# Maximum number of lines to put in a shell here document. -ac_max_here_lines=12 - -ac_prev= -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=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;; - *) ac_optarg= ;; - esac - - # Accept the important Cygnus configure options, so we can diagnose typos. - - case "$ac_option" in - - -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 ;; - -build=* | --build=* | --buil=* | --bui=* | --bu=*) - build="$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" ;; - - -datadir | --datadir | --datadi | --datad | --data | --dat | --da) - ac_prev=datadir ;; - -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ - | --da=*) - datadir="$ac_optarg" ;; - - -disable-* | --disable-*) - ac_feature=`echo $ac_option|sed -e 's/-*disable-//'` - # Reject names that are not valid shell variable names. - if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then - { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } - fi - ac_feature=`echo $ac_feature| sed 's/-/_/g'` - eval "enable_${ac_feature}=no" ;; - - -enable-* | --enable-*) - ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'` - # Reject names that are not valid shell variable names. - if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then - { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } - fi - ac_feature=`echo $ac_feature| sed 's/-/_/g'` - case "$ac_option" in - *=*) ;; - *) ac_optarg=yes ;; - esac - eval "enable_${ac_feature}='$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) - # 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 << EOF -Usage: configure [options] [host] -Options: [defaults in brackets after descriptions] -Configuration: - --cache-file=FILE cache test results in FILE - --help print this message - --no-create do not create output files - --quiet, --silent do not print \`checking...' messages - --version print the version of autoconf that created configure -Directory and file names: - --prefix=PREFIX install architecture-independent files in PREFIX - [$ac_default_prefix] - --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX - [same as prefix] - --bindir=DIR user executables in DIR [EPREFIX/bin] - --sbindir=DIR system admin executables in DIR [EPREFIX/sbin] - --libexecdir=DIR program executables in DIR [EPREFIX/libexec] - --datadir=DIR read-only architecture-independent data in DIR - [PREFIX/share] - --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc] - --sharedstatedir=DIR modifiable architecture-independent data in DIR - [PREFIX/com] - --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var] - --libdir=DIR object code libraries in DIR [EPREFIX/lib] - --includedir=DIR C header files in DIR [PREFIX/include] - --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include] - --infodir=DIR info documentation in DIR [PREFIX/info] - --mandir=DIR man documentation in DIR [PREFIX/man] - --srcdir=DIR find the sources in DIR [configure dir or ..] - --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 -EOF - cat << EOF -Host type: - --build=BUILD configure for building on BUILD [BUILD=HOST] - --host=HOST configure for HOST [guessed] - --target=TARGET configure for TARGET [TARGET=HOST] -Features and packages: - --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) - --enable-FEATURE[=ARG] include FEATURE [ARG=yes] - --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] - --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) - --x-includes=DIR X include files are in DIR - --x-libraries=DIR X library files are in DIR -EOF - if test -n "$ac_help"; then - echo "--enable and --with options recognized:$ac_help" - fi - exit 0 ;; - - -host | --host | --hos | --ho) - ac_prev=host ;; - -host=* | --host=* | --hos=* | --ho=*) - host="$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" ;; - - -localstatedir | --localstatedir | --localstatedi | --localstated \ - | --localstate | --localstat | --localsta | --localst \ - | --locals | --local | --loca | --loc | --lo) - ac_prev=localstatedir ;; - -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ - | --localstate=* | --localstat=* | --localsta=* | --localst=* \ - | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) - 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) - 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" ;; - - -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 ;; - -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) - target="$ac_optarg" ;; - - -v | -verbose | --verbose | --verbos | --verbo | --verb) - verbose=yes ;; - - -version | --version | --versio | --versi | --vers) - echo "configure generated by autoconf version 2.13" - exit 0 ;; - - -with-* | --with-*) - ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'` - # Reject names that are not valid shell variable names. - if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then - { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } - fi - ac_package=`echo $ac_package| sed 's/-/_/g'` - case "$ac_option" in - *=*) ;; - *) ac_optarg=yes ;; - esac - eval "with_${ac_package}='$ac_optarg'" ;; - - -without-* | --without-*) - ac_package=`echo $ac_option|sed -e 's/-*without-//'` - # Reject names that are not valid shell variable names. - if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then - { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } - fi - ac_package=`echo $ac_package| sed 's/-/_/g'` - eval "with_${ac_package}=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" ;; - - -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; } - ;; - - *) - if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then - echo "configure: warning: $ac_option: invalid host type" 1>&2 - fi - if test "x$nonopt" != xNONE; then - { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } - fi - nonopt="$ac_option" - ;; - - esac -done - -if test -n "$ac_prev"; then - { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; } -fi - -trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 - -# File descriptor usage: -# 0 standard input -# 1 file creation -# 2 errors and warnings -# 3 some systems may open it to /dev/tty -# 4 used on the Kubota Titan -# 6 checking for... messages and results -# 5 compiler messages saved in config.log -if test "$silent" = yes; then - exec 6>/dev/null -else - exec 6>&1 -fi -exec 5>./config.log - -echo "\ -This file contains any messages produced by compilers while -running configure, to aid debugging if configure makes a mistake. -" 1>&5 - -# Strip out --no-create and --no-recursion so they do not pile up. -# Also quote any args containing shell metacharacters. -ac_configure_args= -for ac_arg -do - case "$ac_arg" in - -no-create | --no-create | --no-creat | --no-crea | --no-cre \ - | --no-cr | --no-c) ;; - -no-recursion | --no-recursion | --no-recursio | --no-recursi \ - | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;; - *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*) - ac_configure_args="$ac_configure_args '$ac_arg'" ;; - *) ac_configure_args="$ac_configure_args $ac_arg" ;; - esac -done - -# NLS nuisances. -# Only set these to C if already set. These must not be set unconditionally -# because not all systems understand e.g. LANG=C (notably SCO). -# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'! -# Non-C LC_CTYPE values break the ctype check. -if test "${LANG+set}" = set; then LANG=C; export LANG; fi -if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi -if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi -if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi - -# confdefs.h avoids OS command line length limits that DEFS can exceed. -rm -rf conftest* confdefs.h -# AIX cpp loses on an empty file, so make sure it contains at least a newline. -echo > confdefs.h - -# A filename unique to this package, relative to the directory that -# configure is in, which we can look for to find out if srcdir is correct. -ac_unique_file=assert.cxx - -# 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 its parent. - ac_prog=$0 - ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'` - test "x$ac_confdir" = "x$ac_prog" && ac_confdir=. - 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 - if test "$ac_srcdir_defaulted" = yes; then - { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; } - else - { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; } - fi -fi -srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'` - -# Prefer explicitly selected file to automatically selected ones. -if test -z "$CONFIG_SITE"; then - if test "x$prefix" != xNONE; then - CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" - else - CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" - fi -fi -for ac_site_file in $CONFIG_SITE; do - if test -r "$ac_site_file"; then - echo "loading site script $ac_site_file" - . "$ac_site_file" - fi -done - -if test -r "$cache_file"; then - echo "loading cache $cache_file" - . $cache_file -else - echo "creating cache $cache_file" - > $cache_file -fi - -ac_ext=c -# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. -ac_cpp='$CPP $CPPFLAGS' -ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' -ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' -cross_compiling=$ac_cv_prog_cc_cross - -ac_exeext= -ac_objext=o -if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then - # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu. - if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then - ac_n= ac_c=' -' ac_t=' ' - else - ac_n=-n ac_c= ac_t= - fi -else - ac_n= ac_c='\c' ac_t= -fi - - - -ac_aux_dir= -for ac_dir in ../../acsupport $srcdir/../../acsupport; 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 - fi -done -if test -z "$ac_aux_dir"; then - { echo "configure: error: can not find install-sh or install.sh in ../../acsupport $srcdir/../../acsupport" 1>&2; exit 1; } -fi -ac_config_guess=$ac_aux_dir/config.guess -ac_config_sub=$ac_aux_dir/config.sub -ac_configure=$ac_aux_dir/configure # This should be Cygnus configure. - - - - echo $ac_n "checking that a separate build tree is being used""... $ac_c" 1>&6 -echo "configure:557: checking that a separate build tree is being used" >&5 - ecos_cwd=`/bin/pwd` - if test "${srcdir}" = "." ; then - srcdir=${ecos_cwd} - fi - if test "${ecos_cwd}" = "${srcdir}" ; then - echo "$ac_t""no" 1>&6 - { echo "configure: error: This configure script should not be run inside the source tree. Instead please use a separate build tree" 1>&2; exit 1; } - else - echo "$ac_t""yes" 1>&6 - fi - - - -# Make sure we can run config.sub. -if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then : -else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; } -fi - -echo $ac_n "checking host system type""... $ac_c" 1>&6 -echo "configure:577: checking host system type" >&5 - -host_alias=$host -case "$host_alias" in -NONE) - case $nonopt in - NONE) - if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then : - else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; } - fi ;; - *) host_alias=$nonopt ;; - esac ;; -esac - -host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias` -host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` -host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` -host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` -echo "$ac_t""$host" 1>&6 - - -# 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 -# 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" -# ./install, which can be erroneously created by make from ./install.sh. -echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 -echo "configure:610: checking for a BSD compatible install" >&5 -if test -z "$INSTALL"; then -if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":" - for ac_dir in $PATH; do - # Account for people who put trailing slashes in PATH elements. - case "$ac_dir/" in - /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/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 - if test -f $ac_dir/$ac_prog; then - if test $ac_prog = install && - grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then - # AIX install. It has an incompatible calling convention. - : - else - ac_cv_path_install="$ac_dir/$ac_prog -c" - break 2 - fi - fi - done - ;; - esac - done - IFS="$ac_save_IFS" - -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. We don't cache a - # path for INSTALL within a source directory, because that will - # break other packages using the cache if that directory is - # removed, or if the path is relative. - INSTALL="$ac_install_sh" - fi -fi -echo "$ac_t""$INSTALL" 1>&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_PROGRAM}' - -test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' - -echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6 -echo "configure:663: checking whether build environment is sane" >&5 -# Just in case -sleep 1 -echo timestamp > conftestfile -# 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 conftestfile 2> /dev/null` - if test "$*" = "X"; then - # -L didn't work. - set X `ls -t $srcdir/configure conftestfile` - fi - if test "$*" != "X $srcdir/configure conftestfile" \ - && test "$*" != "X conftestfile $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". - { echo "configure: error: ls -t appears to fail. Make sure there is not a broken -alias in your environment" 1>&2; exit 1; } - fi - - test "$2" = conftestfile - ) -then - # Ok. - : -else - { echo "configure: error: newly created file is older than distributed files! -Check your system clock" 1>&2; exit 1; } -fi -rm -f conftest* -echo "$ac_t""yes" 1>&6 -if test "$program_transform_name" = s,x,x,; then - program_transform_name= -else - # Double any \ or $. echo might interpret backslashes. - cat <<\EOF_SED > conftestsed -s,\\,\\\\,g; s,\$,$$,g -EOF_SED - program_transform_name="`echo $program_transform_name|sed -f conftestsed`" - rm -f conftestsed -fi -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" - -# sed with no file args requires a program. -test "$program_transform_name" = "" && program_transform_name="s,x,x," - -echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 -echo "configure:720: checking whether ${MAKE-make} sets \${MAKE}" >&5 -set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftestmake <<\EOF -all: - @echo 'ac_maketemp="${MAKE}"' -EOF -# GNU make sometimes prints "make[1]: Entering...", which would confuse us. -eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=` -if test -n "$ac_maketemp"; then - eval ac_cv_prog_make_${ac_make}_set=yes -else - eval ac_cv_prog_make_${ac_make}_set=no -fi -rm -f conftestmake -fi -if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then - echo "$ac_t""yes" 1>&6 - SET_MAKE= -else - echo "$ac_t""no" 1>&6 - SET_MAKE="MAKE=${MAKE-make}" -fi - - -PACKAGE=cyginfra - -VERSION=0.1 - -if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then - { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; } -fi - - - -missing_dir=`cd $ac_aux_dir && pwd` -echo $ac_n "checking for working aclocal""... $ac_c" 1>&6 -echo "configure:759: checking for working aclocal" >&5 -# Run test in a subshell; some versions of sh will print an error if -# an executable is not found, even if stderr is redirected. -# Redirect stdin to placate older versions of autoconf. Sigh. -if (aclocal --version) < /dev/null > /dev/null 2>&1; then - ACLOCAL=aclocal - echo "$ac_t""found" 1>&6 -else - ACLOCAL="$missing_dir/missing aclocal" - echo "$ac_t""missing" 1>&6 -fi - -echo $ac_n "checking for working autoconf""... $ac_c" 1>&6 -echo "configure:772: checking for working autoconf" >&5 -# Run test in a subshell; some versions of sh will print an error if -# an executable is not found, even if stderr is redirected. -# Redirect stdin to placate older versions of autoconf. Sigh. -if (autoconf --version) < /dev/null > /dev/null 2>&1; then - AUTOCONF=autoconf - echo "$ac_t""found" 1>&6 -else - AUTOCONF="$missing_dir/missing autoconf" - echo "$ac_t""missing" 1>&6 -fi - -echo $ac_n "checking for working automake""... $ac_c" 1>&6 -echo "configure:785: checking for working automake" >&5 -# Run test in a subshell; some versions of sh will print an error if -# an executable is not found, even if stderr is redirected. -# Redirect stdin to placate older versions of autoconf. Sigh. -if (automake --version) < /dev/null > /dev/null 2>&1; then - AUTOMAKE=automake - echo "$ac_t""found" 1>&6 -else - AUTOMAKE="$missing_dir/missing automake" - echo "$ac_t""missing" 1>&6 -fi - -echo $ac_n "checking for working autoheader""... $ac_c" 1>&6 -echo "configure:798: checking for working autoheader" >&5 -# Run test in a subshell; some versions of sh will print an error if -# an executable is not found, even if stderr is redirected. -# Redirect stdin to placate older versions of autoconf. Sigh. -if (autoheader --version) < /dev/null > /dev/null 2>&1; then - AUTOHEADER=autoheader - echo "$ac_t""found" 1>&6 -else - AUTOHEADER="$missing_dir/missing autoheader" - echo "$ac_t""missing" 1>&6 -fi - -echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6 -echo "configure:811: checking for working makeinfo" >&5 -# Run test in a subshell; some versions of sh will print an error if -# an executable is not found, even if stderr is redirected. -# Redirect stdin to placate older versions of autoconf. Sigh. -if (makeinfo --version) < /dev/null > /dev/null 2>&1; then - MAKEINFO=makeinfo - echo "$ac_t""found" 1>&6 -else - MAKEINFO="$missing_dir/missing makeinfo" - echo "$ac_t""missing" 1>&6 -fi - - - - - - cat >> confdefs.h <&6 -echo "configure:833: checking whether to enable maintainer-specific portions of Makefiles" >&5 - # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given. -if test "${enable_maintainer_mode+set}" = set; then - enableval="$enable_maintainer_mode" - USE_MAINTAINER_MODE=$enableval -else - USE_MAINTAINER_MODE=no -fi - - echo "$ac_t""$USE_MAINTAINER_MODE" 1>&6 - - -if test $USE_MAINTAINER_MODE = yes; then - MAINTAINER_MODE_TRUE= - MAINTAINER_MODE_FALSE='#' -else - MAINTAINER_MODE_TRUE='#' - MAINTAINER_MODE_FALSE= -fi - MAINT=$MAINTAINER_MODE_TRUE - - - -# Extract the first word of "gcc", so it can be a program name with args. -set dummy gcc; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:859: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_CC="gcc" - break - fi - done - IFS="$ac_save_ifs" -fi -fi -CC="$ac_cv_prog_CC" -if test -n "$CC"; then - echo "$ac_t""$CC" 1>&6 -else - echo "$ac_t""no" 1>&6 -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 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:889: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_prog_rejected=no - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then - ac_prog_rejected=yes - continue - fi - ac_cv_prog_CC="cc" - break - fi - done - IFS="$ac_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 $# -gt 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 - set dummy "$ac_dir/$ac_word" "$@" - shift - ac_cv_prog_CC="$@" - fi -fi -fi -fi -CC="$ac_cv_prog_CC" -if test -n "$CC"; then - echo "$ac_t""$CC" 1>&6 -else - echo "$ac_t""no" 1>&6 -fi - - if test -z "$CC"; then - case "`uname -s`" in - *win32* | *WIN32*) - # Extract the first word of "cl", so it can be a program name with args. -set dummy cl; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:940: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_CC="cl" - break - fi - done - IFS="$ac_save_ifs" -fi -fi -CC="$ac_cv_prog_CC" -if test -n "$CC"; then - echo "$ac_t""$CC" 1>&6 -else - echo "$ac_t""no" 1>&6 -fi - ;; - esac - fi - test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; } -fi - -echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:972: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 - -ac_ext=c -# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. -ac_cpp='$CPP $CPPFLAGS' -ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' -ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' -cross_compiling=$ac_cv_prog_cc_cross - -cat > conftest.$ac_ext << EOF - -#line 983 "configure" -#include "confdefs.h" - -main(){return(0);} -EOF -if { (eval echo configure:988: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - ac_cv_prog_cc_works=yes - # If we can't run a trivial program, we are probably using a cross compiler. - if (./conftest; exit) 2>/dev/null; then - ac_cv_prog_cc_cross=no - else - ac_cv_prog_cc_cross=yes - fi -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - ac_cv_prog_cc_works=no -fi -rm -fr conftest* -ac_ext=c -# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. -ac_cpp='$CPP $CPPFLAGS' -ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' -ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' -cross_compiling=$ac_cv_prog_cc_cross - -echo "$ac_t""$ac_cv_prog_cc_works" 1>&6 -if test $ac_cv_prog_cc_works = no; then - { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } -fi -echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 -echo "configure:1014: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 -echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 -cross_compiling=$ac_cv_prog_cc_cross - -echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 -echo "configure:1019: checking whether we are using GNU C" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.c <&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then - ac_cv_prog_gcc=yes -else - ac_cv_prog_gcc=no -fi -fi - -echo "$ac_t""$ac_cv_prog_gcc" 1>&6 - -if test $ac_cv_prog_gcc = yes; then - GCC=yes -else - GCC= -fi - -ac_test_CFLAGS="${CFLAGS+set}" -ac_save_CFLAGS="$CFLAGS" -CFLAGS= -echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 -echo "configure:1047: checking whether ${CC-cc} accepts -g" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - echo 'void f(){}' > conftest.c -if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then - ac_cv_prog_cc_g=yes -else - ac_cv_prog_cc_g=no -fi -rm -f conftest* - -fi - -echo "$ac_t""$ac_cv_prog_cc_g" 1>&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 - -for ac_prog in $CCC c++ g++ gcc CC cxx cc++ cl -do -# Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1083: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_CXX'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - if test -n "$CXX"; then - ac_cv_prog_CXX="$CXX" # Let the user override the test. -else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_CXX="$ac_prog" - break - fi - done - IFS="$ac_save_ifs" -fi -fi -CXX="$ac_cv_prog_CXX" -if test -n "$CXX"; then - echo "$ac_t""$CXX" 1>&6 -else - echo "$ac_t""no" 1>&6 -fi - -test -n "$CXX" && break -done -test -n "$CXX" || CXX="gcc" - - -echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:1115: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works" >&5 - -ac_ext=C -# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' -ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' -cross_compiling=$ac_cv_prog_cxx_cross - -cat > conftest.$ac_ext << EOF - -#line 1126 "configure" -#include "confdefs.h" - -int main(){return(0);} -EOF -if { (eval echo configure:1131: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - ac_cv_prog_cxx_works=yes - # If we can't run a trivial program, we are probably using a cross compiler. - if (./conftest; exit) 2>/dev/null; then - ac_cv_prog_cxx_cross=no - else - ac_cv_prog_cxx_cross=yes - fi -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - ac_cv_prog_cxx_works=no -fi -rm -fr conftest* -ac_ext=c -# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. -ac_cpp='$CPP $CPPFLAGS' -ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' -ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' -cross_compiling=$ac_cv_prog_cc_cross - -echo "$ac_t""$ac_cv_prog_cxx_works" 1>&6 -if test $ac_cv_prog_cxx_works = no; then - { echo "configure: error: installation or configuration problem: C++ compiler cannot create executables." 1>&2; exit 1; } -fi -echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 -echo "configure:1157: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler" >&5 -echo "$ac_t""$ac_cv_prog_cxx_cross" 1>&6 -cross_compiling=$ac_cv_prog_cxx_cross - -echo $ac_n "checking whether we are using GNU C++""... $ac_c" 1>&6 -echo "configure:1162: checking whether we are using GNU C++" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_gxx'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.C <&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then - ac_cv_prog_gxx=yes -else - ac_cv_prog_gxx=no -fi -fi - -echo "$ac_t""$ac_cv_prog_gxx" 1>&6 - -if test $ac_cv_prog_gxx = yes; then - GXX=yes -else - GXX= -fi - -ac_test_CXXFLAGS="${CXXFLAGS+set}" -ac_save_CXXFLAGS="$CXXFLAGS" -CXXFLAGS= -echo $ac_n "checking whether ${CXX-g++} accepts -g""... $ac_c" 1>&6 -echo "configure:1190: checking whether ${CXX-g++} accepts -g" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_cxx_g'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - echo 'void f(){}' > conftest.cc -if test -z "`${CXX-g++} -g -c conftest.cc 2>&1`"; then - ac_cv_prog_cxx_g=yes -else - ac_cv_prog_cxx_g=no -fi -rm -f conftest* - -fi - -echo "$ac_t""$ac_cv_prog_cxx_g" 1>&6 -if test "$ac_test_CXXFLAGS" = set; then - CXXFLAGS="$ac_save_CXXFLAGS" -elif test $ac_cv_prog_cxx_g = yes; then - if test "$GXX" = yes; then - CXXFLAGS="-g -O2" - else - CXXFLAGS="-g" - fi -else - if test "$GXX" = yes; then - CXXFLAGS="-O2" - else - CXXFLAGS= - fi -fi - -for ac_declaration in \ - ''\ - '#include ' \ - 'extern "C" void std::exit (int) throw (); using std::exit;' \ - 'extern "C" void std::exit (int); using std::exit;' \ - 'extern "C" void exit (int) throw ();' \ - 'extern "C" void exit (int);' \ - 'void exit (int);' -do - cat > conftest.$ac_ext < -$ac_declaration -int main() { -exit (42); -; return 0; } -EOF -if { (eval echo configure:1239: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - : -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - continue -fi -rm -f conftest* - cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* - break -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 -fi -rm -f conftest* -done -if test -n "$ac_declaration"; then - echo '#ifdef __cplusplus' >>confdefs.h - echo $ac_declaration >>confdefs.h - echo '#endif' >>confdefs.h -fi - - -# Extract the first word of "ranlib", so it can be a program name with args. -set dummy ranlib; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1275: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - if test -n "$RANLIB"; then - ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. -else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_RANLIB="ranlib" - break - fi - done - IFS="$ac_save_ifs" - test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":" -fi -fi -RANLIB="$ac_cv_prog_RANLIB" -if test -n "$RANLIB"; then - echo "$ac_t""$RANLIB" 1>&6 -else - echo "$ac_t""no" 1>&6 -fi - -echo $ac_n "checking for object suffix""... $ac_c" 1>&6 -echo "configure:1303: checking for object suffix" >&5 -if eval "test \"`echo '$''{'ac_cv_objext'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - rm -f conftest* -echo 'int i = 1;' > conftest.$ac_ext -if { (eval echo configure:1309: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - for ac_file in conftest.*; do - case $ac_file in - *.c) ;; - *) ac_cv_objext=`echo $ac_file | sed -e s/conftest.//` ;; - esac - done -else - { echo "configure: error: installation or configuration problem; compiler does not work" 1>&2; exit 1; } -fi -rm -f conftest* -fi - -echo "$ac_t""$ac_cv_objext" 1>&6 -OBJEXT=$ac_cv_objext -ac_objext=$ac_cv_objext - -echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6 -echo "configure:1327: checking for Cygwin environment" >&5 -if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* - ac_cv_cygwin=yes -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - ac_cv_cygwin=no -fi -rm -f conftest* -rm -f conftest* -fi - -echo "$ac_t""$ac_cv_cygwin" 1>&6 -CYGWIN= -test "$ac_cv_cygwin" = yes && CYGWIN=yes -echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6 -echo "configure:1360: checking for mingw32 environment" >&5 -if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* - ac_cv_mingw32=yes -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - ac_cv_mingw32=no -fi -rm -f conftest* -rm -f conftest* -fi - -echo "$ac_t""$ac_cv_mingw32" 1>&6 -MINGW32= -test "$ac_cv_mingw32" = yes && MINGW32=yes - - -echo $ac_n "checking for executable suffix""... $ac_c" 1>&6 -echo "configure:1391: checking for executable suffix" >&5 -if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - if test "$CYGWIN" = yes || test "$MINGW32" = yes; then - ac_cv_exeext=.exe -else - rm -f conftest* - echo 'int main () { return 0; }' > conftest.$ac_ext - ac_cv_exeext= - if { (eval echo configure:1401: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then - for file in conftest.*; do - case $file in - *.c | *.o | *.obj) ;; - *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;; - esac - done - else - { echo "configure: error: installation or configuration problem: compiler cannot create executables." 1>&2; exit 1; } - fi - rm -f conftest* - test x"${ac_cv_exeext}" = x && ac_cv_exeext=no -fi -fi - -EXEEXT="" -test x"${ac_cv_exeext}" != xno && EXEEXT=${ac_cv_exeext} -echo "$ac_t""${ac_cv_exeext}" 1>&6 -ac_exeext=$EXEEXT - - - ecos_CFLAGS="" - ecos_CXXFLAGS="" - ecos_LDADD="" - ecos_INCLUDES="" - ecos_LIBS="" - - - - - - - - - - - - echo $ac_n "checking "for Visual C++"""... $ac_c" 1>&6 -echo "configure:1439: checking "for Visual C++"" >&5 - MSVC="no"; - if test "${CC}" = "cl" ; then - MSVC="yes" - CXX="cl" - MSVC_SRCDIR=${srcdir} - - - - if test "${MSVC}" = "yes" ; then - MSVC_SRCDIR=`cygpath -w ${MSVC_SRCDIR} | tr \\\\\\\\ /` - fi - - - ecos_INCLUDES="${ecos_INCLUDES} \"-I${MSVC_SRCDIR}\"" - ecos_LDADD="-link" - ecos_LIBS="advapi32.lib" - fi - - -if test "${MSVC}" = "yes"; then - MSVC_TRUE= - MSVC_FALSE='#' -else - MSVC_TRUE='#' - MSVC_FALSE= -fi - if test "${MSVC}" = "yes" ; then - echo "$ac_t""unfortunately yes" 1>&6 - else - echo "$ac_t""no" 1>&6 - fi - - - - - - - - echo $ac_n "checking "the default compiler flags"""... $ac_c" 1>&6 -echo "configure:1479: checking "the default compiler flags"" >&5 - - ecosflags_enable_debug="no" - # Check whether --enable-debug or --disable-debug was given. -if test "${enable_debug+set}" = set; then - enableval="$enable_debug" - case "${enableval}" in - yes) ecosflags_enable_debug="yes" ;; - *) ecosflags_enable_debug="no" ;; - esac -fi - - - ecosflags_enable_ansi="no" - if test "${MSVC}" = "yes" ; then - # Check whether --enable-ansi or --disable-ansi was given. -if test "${enable_ansi+set}" = set; then - enableval="$enable_ansi" - case "${enableval}" in - yes) ecosflags_enable_ansi="yes" ;; - *) ecosflags_enable_ansi="no" ;; - esac -fi - - fi - - if test "${GCC}" = "yes" ; then - ecos_CFLAGS="${ecos_CFLAGS} -pipe -Wall -Wpointer-arith -Wbad-function-cast -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs" - ecos_CXXFLAGS="${ecos_CXXFLAGS} -pipe -Wall -Wpointer-arith -Wbad-function-cast -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Woverloaded-virtual" - elif test "${MSVC}" = "yes" ; then - ecos_CFLAGS="${ecos_CFLAGS} -nologo -W3" - ecos_CXXFLAGS="${ecos_CXXFLAGS} -nologo -W3 -GR -GX" - else - { echo "configure: error: "default flags for ${CC} are not known"" 1>&2; exit 1; } - fi - - if test "${ecosflags_enable_debug}" = "yes" ; then - if test "${GCC}" = "yes" ; then - ecos_CFLAGS="${ecos_CFLAGS} -g -O0" - ecos_CXXFLAGS="${ecos_CXXFLAGS} -g -O0" - elif test "${MSVC}" = "yes" ; then - ecos_CFLAGS="${ecos_CFLAGS} -MDd -Zi" - ecos_CXXFLAGS="${ecos_CXXFLAGS} -MDd -Zi" - fi - else - if test "${GCC}" = "yes" ; then - ecos_CFLAGS="${ecos_CFLAGS} -O0" - ecos_CXXFLAGS="${ecos_CXXFLAGS} -O0" - elif test "${MSVC}" = "yes" ; then - ecos_CFLAGS="${ecos_CFLAGS} -MD -O2" - ecos_CXXFLAGS="${ecos_CXXFLAGS} -MD -O2" - fi - fi - - CFLAGS="${ac_save_CFLAGS}" - CXXFLAGS="${ac_save_CXXFLAGS}" - - echo "$ac_t""done" 1>&6 - - -echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6 -echo "configure:1540: checking whether byte ordering is bigendian" >&5 -if eval "test \"`echo '$''{'ac_cv_c_bigendian'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - ac_cv_c_bigendian=unknown -# See if sys/param.h defines the BYTE_ORDER macro. -cat > conftest.$ac_ext < -#include -int main() { - -#if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN - bogus endian macros -#endif -; return 0; } -EOF -if { (eval echo configure:1558: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* - # It does; now see whether it defined to BIG_ENDIAN or not. -cat > conftest.$ac_ext < -#include -int main() { - -#if BYTE_ORDER != BIG_ENDIAN - not big endian -#endif -; return 0; } -EOF -if { (eval echo configure:1573: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* - ac_cv_c_bigendian=yes -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - ac_cv_c_bigendian=no -fi -rm -f conftest* -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 -fi -rm -f conftest* -if test $ac_cv_c_bigendian = unknown; then -if test "$cross_compiling" = yes; then - { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } -else - cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -then - ac_cv_c_bigendian=no -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -fr conftest* - ac_cv_c_bigendian=yes -fi -rm -fr conftest* -fi - -fi -fi - -echo "$ac_t""$ac_cv_c_bigendian" 1>&6 -if test $ac_cv_c_bigendian = yes; then - cat >> confdefs.h <<\EOF -#define WORDS_BIGENDIAN 1 -EOF - -fi - - - - - - - echo $ac_n "checking "for a 64 bit data type"""... $ac_c" 1>&6 -echo "configure:1635: checking "for a 64 bit data type"" >&5 -if eval "test \"`echo '$''{'ecos_cv_type_64bit'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - - for type in "long" "long long" "__int64"; do - - ac_ext=c -# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. -ac_cpp='$CPP $CPPFLAGS' -ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' -ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' -cross_compiling=$ac_cv_prog_cc_cross - - if test "$cross_compiling" = yes; then - ctype_64bit="long long" -else - cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -then - ctype_64bit=$type -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -fr conftest* - ctype_64bit="unknown" -fi -rm -fr conftest* -fi - - ac_ext=C -# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' -ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' -cross_compiling=$ac_cv_prog_cxx_cross - - if test "$cross_compiling" = yes; then - cxxtype_64bit="long long" -else - cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -then - cxxtype_64bit=$type -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -fr conftest* - cxxtype_64bit="unknown" -fi -rm -fr conftest* -fi - - ac_ext=c -# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. -ac_cpp='$CPP $CPPFLAGS' -ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' -ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' -cross_compiling=$ac_cv_prog_cc_cross - - if test "${ctype_64bit}" = "${type}" -a "${cxxtype_64bit}" = "${type}"; then - ecos_cv_type_64bit="${type}" - break - fi - done - -fi - -echo "$ac_t""$ecos_cv_type_64bit" 1>&6 - if test "${ecos_cv_type_64bit}" = ""; then - { echo "configure: error: Unable to figure out how to do 64 bit arithmetic" 1>&2; exit 1; } - else - if test "${ecos_cv_type_64bit}" != "long long"; then - cat >> confdefs.h <> confdefs.h <&6 -echo "configure:1737: checking size of int *" >&5 -if eval "test \"`echo '$''{'ac_cv_sizeof_int_p'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - if test "$cross_compiling" = yes; then - { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } -else - cat > conftest.$ac_ext < -int main() -{ - FILE *f=fopen("conftestval", "w"); - if (!f) return(1); - fprintf(f, "%d\n", sizeof(int *)); - return(0); -} -EOF -if { (eval echo configure:1756: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -then - ac_cv_sizeof_int_p=`cat conftestval` -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -fr conftest* - ac_cv_sizeof_int_p=0 -fi -rm -fr conftest* -fi - -fi -echo "$ac_t""$ac_cv_sizeof_int_p" 1>&6 -cat >> confdefs.h <&6 -echo "configure:1776: checking size of long" >&5 -if eval "test \"`echo '$''{'ac_cv_sizeof_long'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - if test "$cross_compiling" = yes; then - { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } -else - cat > conftest.$ac_ext < -int main() -{ - FILE *f=fopen("conftestval", "w"); - if (!f) return(1); - fprintf(f, "%d\n", sizeof(long)); - return(0); -} -EOF -if { (eval echo configure:1795: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -then - ac_cv_sizeof_long=`cat conftestval` -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -fr conftest* - ac_cv_sizeof_long=0 -fi -rm -fr conftest* -fi - -fi -echo "$ac_t""$ac_cv_sizeof_long" 1>&6 -cat >> confdefs.h <&6 -echo "configure:1820: checking "for __PRETTY_FUNCTION__ support"" >&5 -if eval "test \"`echo '$''{'ecos_cv_c_pretty_function'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - - - ac_ext=c -# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. -ac_cpp='$CPP $CPPFLAGS' -ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' -ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' -cross_compiling=$ac_cv_prog_cc_cross - - cat > conftest.$ac_ext < -int main() { -puts(__PRETTY_FUNCTION__); -; return 0; } -EOF -if { (eval echo configure:1841: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - c_ok="yes" -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - c_ok="no" - -fi -rm -f conftest* - ac_ext=C -# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' -ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' -cross_compiling=$ac_cv_prog_cxx_cross - - cat > conftest.$ac_ext < -int main() { -puts(__PRETTY_FUNCTION__); -; return 0; } -EOF -if { (eval echo configure:1867: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - cxx_ok="yes" -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - cxx_ok="no" - -fi -rm -f conftest* - ac_ext=c -# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. -ac_cpp='$CPP $CPPFLAGS' -ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' -ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' -cross_compiling=$ac_cv_prog_cc_cross - - if test "${c_ok}" = "yes" -a "${cxx_ok}" = "yes"; then - ecos_cv_c_pretty_function="yes" - fi - -fi - -echo "$ac_t""$ecos_cv_c_pretty_function" 1>&6 - if test "${ecos_cv_c_pretty_function}" = "yes"; then - cat >> confdefs.h <<\EOF -#define CYGDBG_INFRA_DEBUG_FUNCTION_PSEUDOMACRO 1 -EOF - - fi - - -for ac_func in mkstemp -do -echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:1903: checking for $ac_func" >&5 -if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext < -/* Override any gcc2 internal prototype to avoid an error. */ -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char $ac_func(); - -int main() { - -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) -choke me -#else -$ac_func(); -#endif - -; return 0; } -EOF -if { (eval echo configure:1931: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_func_$ac_func=yes" -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_func_$ac_func=no" -fi -rm -f conftest* -fi - -if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then - echo "$ac_t""yes" 1>&6 - ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` - cat >> confdefs.h <&6 -fi -done - - - -# Check whether --enable-tracebufsize or --disable-tracebufsize was given. -if test "${enable_tracebufsize+set}" = set; then - enableval="$enable_tracebufsize" - - if test "$enableval" = "no" -o "$enableval" = "yes"; then - { echo "configure: error: "--enable-tracebufsize should be given a suitable value"" 1>&2; exit 1; } - else - cat >> confdefs.h < confcache <<\EOF -# 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. It is not useful on other systems. -# If it contains results you don't want to keep, you may remove or edit it. -# -# By default, configure uses ./config.cache as the cache file, -# creating it if it does not exist already. You can give configure -# the --cache-file=FILE option to use a different cache file; that is -# what configure does when it calls configure scripts in -# subdirectories, so they share the cache. -# Giving --cache-file=/dev/null disables caching, for debugging configure. -# config.status only pays attention to the cache file if you give it the -# --recheck option to rerun configure. -# -EOF -# The following way of writing the cache mishandles newlines in values, -# but we know of no workaround that is simple, portable, and efficient. -# So, don't put newlines in cache variables' values. -# 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. -(set) 2>&1 | - case `(ac_space=' '; set | grep ac_space) 2>&1` in - *ac_space=\ *) - # `set' does not quote correctly, so add quotes (double-quote substitution - # turns \\\\ into \\, and sed turns \\ into \). - sed -n \ - -e "s/'/'\\\\''/g" \ - -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p" - ;; - *) - # `set' quotes correctly as required by POSIX, so do not add quotes. - sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p' - ;; - esac >> confcache -if cmp -s $cache_file confcache; then - : -else - if test -w $cache_file; then - echo "updating cache $cache_file" - cat confcache > $cache_file - else - echo "not updating unwritable cache $cache_file" - fi -fi -rm -f confcache - -trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 - -test "x$prefix" = xNONE && prefix=$ac_default_prefix -# Let make expand exec_prefix. -test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' - -# Any assignment to VPATH causes Sun make to only execute -# the first set of double-colon rules, so remove it if not needed. -# If there is a colon in the path, we need to keep it. -if test "x$srcdir" = x.; then - ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d' -fi - -trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15 - -DEFS=-DHAVE_CONFIG_H - -# Without the "./", some shells look in PATH for config.status. -: ${CONFIG_STATUS=./config.status} - -echo creating $CONFIG_STATUS -rm -f $CONFIG_STATUS -cat > $CONFIG_STATUS </dev/null | sed 1q`: -# -# $0 $ac_configure_args -# -# Compiler output produced by configure, useful for debugging -# configure, is in ./config.log if it exists. - -ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]" -for ac_option -do - case "\$ac_option" in - -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) - echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion" - exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;; - -version | --version | --versio | --versi | --vers | --ver | --ve | --v) - echo "$CONFIG_STATUS generated by autoconf version 2.13" - exit 0 ;; - -help | --help | --hel | --he | --h) - echo "\$ac_cs_usage"; exit 0 ;; - *) echo "\$ac_cs_usage"; exit 1 ;; - esac -done - -ac_given_srcdir=$srcdir -ac_given_INSTALL="$INSTALL" - -trap 'rm -fr `echo "Makefile:Makefile.in testsuite/Makefile:testsuite/Makefile.in hostinfra.h:config.h.in" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 -EOF -cat >> $CONFIG_STATUS < conftest.subs <<\\CEOF -$ac_vpsub -$extrasub -s%@SHELL@%$SHELL%g -s%@CFLAGS@%$CFLAGS%g -s%@CPPFLAGS@%$CPPFLAGS%g -s%@CXXFLAGS@%$CXXFLAGS%g -s%@FFLAGS@%$FFLAGS%g -s%@DEFS@%$DEFS%g -s%@LDFLAGS@%$LDFLAGS%g -s%@LIBS@%$LIBS%g -s%@exec_prefix@%$exec_prefix%g -s%@prefix@%$prefix%g -s%@program_transform_name@%$program_transform_name%g -s%@bindir@%$bindir%g -s%@sbindir@%$sbindir%g -s%@libexecdir@%$libexecdir%g -s%@datadir@%$datadir%g -s%@sysconfdir@%$sysconfdir%g -s%@sharedstatedir@%$sharedstatedir%g -s%@localstatedir@%$localstatedir%g -s%@libdir@%$libdir%g -s%@includedir@%$includedir%g -s%@oldincludedir@%$oldincludedir%g -s%@infodir@%$infodir%g -s%@mandir@%$mandir%g -s%@host@%$host%g -s%@host_alias@%$host_alias%g -s%@host_cpu@%$host_cpu%g -s%@host_vendor@%$host_vendor%g -s%@host_os@%$host_os%g -s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g -s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g -s%@INSTALL_DATA@%$INSTALL_DATA%g -s%@PACKAGE@%$PACKAGE%g -s%@VERSION@%$VERSION%g -s%@ACLOCAL@%$ACLOCAL%g -s%@AUTOCONF@%$AUTOCONF%g -s%@AUTOMAKE@%$AUTOMAKE%g -s%@AUTOHEADER@%$AUTOHEADER%g -s%@MAKEINFO@%$MAKEINFO%g -s%@SET_MAKE@%$SET_MAKE%g -s%@MAINTAINER_MODE_TRUE@%$MAINTAINER_MODE_TRUE%g -s%@MAINTAINER_MODE_FALSE@%$MAINTAINER_MODE_FALSE%g -s%@MAINT@%$MAINT%g -s%@CC@%$CC%g -s%@CXX@%$CXX%g -s%@RANLIB@%$RANLIB%g -s%@OBJEXT@%$OBJEXT%g -s%@EXEEXT@%$EXEEXT%g -s%@ecos_CFLAGS@%$ecos_CFLAGS%g -s%@ecos_CXXFLAGS@%$ecos_CXXFLAGS%g -s%@ecos_LDADD@%$ecos_LDADD%g -s%@ecos_INCLUDES@%$ecos_INCLUDES%g -s%@ecos_LIBS@%$ecos_LIBS%g -s%@MSVC_SRCDIR@%$MSVC_SRCDIR%g -s%@MSVC_TRUE@%$MSVC_TRUE%g -s%@MSVC_FALSE@%$MSVC_FALSE%g - -CEOF -EOF - -cat >> $CONFIG_STATUS <<\EOF - -# Split the substitutions into bite-sized pieces for seds with -# small command number limits, like on Digital OSF/1 and HP-UX. -ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script. -ac_file=1 # Number of current file. -ac_beg=1 # First line for current file. -ac_end=$ac_max_sed_cmds # Line after last line for current file. -ac_more_lines=: -ac_sed_cmds="" -while $ac_more_lines; do - if test $ac_beg -gt 1; then - sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file - else - sed "${ac_end}q" conftest.subs > conftest.s$ac_file - fi - if test ! -s conftest.s$ac_file; then - ac_more_lines=false - rm -f conftest.s$ac_file - else - if test -z "$ac_sed_cmds"; then - ac_sed_cmds="sed -f conftest.s$ac_file" - else - ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file" - fi - ac_file=`expr $ac_file + 1` - ac_beg=$ac_end - ac_end=`expr $ac_end + $ac_max_sed_cmds` - fi -done -if test -z "$ac_sed_cmds"; then - ac_sed_cmds=cat -fi -EOF - -cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF -for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then - # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". - case "$ac_file" in - *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` - ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; - *) ac_file_in="${ac_file}.in" ;; - esac - - # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories. - - # Remove last slash and all that follows it. Not all systems have dirname. - ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` - if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then - # The file is in a subdirectory. - test ! -d "$ac_dir" && mkdir "$ac_dir" - ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`" - # A "../" for each directory in $ac_dir_suffix. - ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'` - else - ac_dir_suffix= ac_dots= - fi - - case "$ac_given_srcdir" in - .) srcdir=. - if test -z "$ac_dots"; then top_srcdir=. - else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;; - /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;; - *) # Relative path. - srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix" - top_srcdir="$ac_dots$ac_given_srcdir" ;; - esac - - case "$ac_given_INSTALL" in - [/$]*) INSTALL="$ac_given_INSTALL" ;; - *) INSTALL="$ac_dots$ac_given_INSTALL" ;; - esac - - echo creating "$ac_file" - rm -f "$ac_file" - configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure." - case "$ac_file" in - *Makefile*) ac_comsub="1i\\ -# $configure_input" ;; - *) ac_comsub= ;; - esac - - ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` - sed -e "$ac_comsub -s%@configure_input@%$configure_input%g -s%@srcdir@%$srcdir%g -s%@top_srcdir@%$top_srcdir%g -s%@INSTALL@%$INSTALL%g -" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file -fi; done -rm -f conftest.s* - -# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where -# NAME is the cpp macro being defined and VALUE is the value it is being given. -# -# ac_d sets the value in "#define NAME VALUE" lines. -ac_dA='s%^\([ ]*\)#\([ ]*define[ ][ ]*\)' -ac_dB='\([ ][ ]*\)[^ ]*%\1#\2' -ac_dC='\3' -ac_dD='%g' -# ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE". -ac_uA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' -ac_uB='\([ ]\)%\1#\2define\3' -ac_uC=' ' -ac_uD='\4%g' -# ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE". -ac_eA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' -ac_eB='$%\1#\2define\3' -ac_eC=' ' -ac_eD='%g' - -if test "${CONFIG_HEADERS+set}" != set; then -EOF -cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF -fi -for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then - # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". - case "$ac_file" in - *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` - ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; - *) ac_file_in="${ac_file}.in" ;; - esac - - echo creating $ac_file - - rm -f conftest.frag conftest.in conftest.out - ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` - cat $ac_file_inputs > conftest.in - -EOF - -# Transform confdefs.h into a sed script conftest.vals that substitutes -# the proper values into config.h.in to produce config.h. And first: -# Protect against being on the right side of a sed subst in config.status. -# Protect against being in an unquoted here document in config.status. -rm -f conftest.vals -cat > conftest.hdr <<\EOF -s/[\\&%]/\\&/g -s%[\\$`]%\\&%g -s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp -s%ac_d%ac_u%gp -s%ac_u%ac_e%gp -EOF -sed -n -f conftest.hdr confdefs.h > conftest.vals -rm -f conftest.hdr - -# This sed command replaces #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. -cat >> conftest.vals <<\EOF -s%^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */% -EOF - -# Break up conftest.vals because some shells have a limit on -# the size of here documents, and old seds have small limits too. - -rm -f conftest.tail -while : -do - ac_lines=`grep -c . conftest.vals` - # grep -c gives empty output for an empty file on some AIX systems. - if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi - # Write a limited-size here document to conftest.frag. - echo ' cat > conftest.frag <> $CONFIG_STATUS - sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS - echo 'CEOF - sed -f conftest.frag conftest.in > conftest.out - rm -f conftest.in - mv conftest.out conftest.in -' >> $CONFIG_STATUS - sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail - rm -f conftest.vals - mv conftest.tail conftest.vals -done -rm -f conftest.vals - -cat >> $CONFIG_STATUS <<\EOF - rm -f conftest.frag conftest.h - echo "/* $ac_file. Generated automatically by configure. */" > conftest.h - cat conftest.in >> conftest.h - rm -f conftest.in - if cmp -s $ac_file conftest.h 2>/dev/null; then - echo "$ac_file is unchanged" - rm -f conftest.h - else - # Remove last slash and all that follows it. Not all systems have dirname. - ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` - if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then - # The file is in a subdirectory. - test ! -d "$ac_dir" && mkdir "$ac_dir" - fi - rm -f $ac_file - mv conftest.h $ac_file - fi -fi; done - -EOF -cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF -test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h - -exit 0 -EOF -chmod +x $CONFIG_STATUS -rm -fr confdefs* $ac_clean_files -test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1 - diff --git a/host/infra/configure.in b/host/infra/configure.in deleted file mode 100644 --- a/host/infra/configure.in +++ /dev/null @@ -1,164 +0,0 @@ -dnl Process this file with autoconf to produce a configure script. -dnl ==================================================================== -dnl -dnl configure.in -dnl -dnl Host side implementation of the eCos infrastructure. -dnl -dnl ==================================================================== -dnl ####ECOSHOSTGPLCOPYRIGHTBEGIN#### -dnl ---------------------------------------------------------------------------- -dnl Copyright (C) 2002 Bart Veer -dnl Copyright (C) 1998, 1999, 2000, 2001 Red Hat, Inc. -dnl -dnl This file is part of the eCos host tools. -dnl -dnl This program is free software; you can redistribute it and/or modify it -dnl under the terms of the GNU General Public License as published by the Free -dnl Software Foundation; either version 2 of the License, or (at your option) -dnl any later version. -dnl -dnl This program is distributed in the hope that it will be useful, but WITHOUT -dnl ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -dnl FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for -dnl more details. -dnl -dnl You should have received a copy of the GNU General Public License along with -dnl this program; if not, write to the Free Software Foundation, Inc., -dnl 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -dnl -dnl ---------------------------------------------------------------------------- -dnl ####ECOSHOSTGPLCOPYRIGHTEND#### -dnl ==================================================================== -dnl#####DESCRIPTIONBEGIN#### -dnl -dnl Author(s): bartv -dnl Contact(s): bartv -dnl Date: 1998/07/13 -dnl Version: 0.01 -dnl -dnl####DESCRIPTIONEND#### -dnl ==================================================================== - -dnl No infrastructure is complete without assertions. -AC_INIT(assert.cxx) - -dnl Pick up the support files from the top-level acsupport directory. -AC_CONFIG_AUX_DIR(../../acsupport) - -ECOS_CHECK_BUILD_ne_SRC - -dnl Other standard options. -AC_CANONICAL_HOST - -dnl This package is called cyginfra, partly for historical reasons -dnl and partly to avoid reorganizing the testsuite subdirectory. -dnl The generated header file may get #include'd indirectly by other -dnl packages, so it is not a good idea to define package and version. -AM_INIT_AUTOMAKE(cyginfra, 0.1,0) -ECOS_SUBST_VERSION(CYGNUM_INFRA_VERSION) -AM_MAINTAINER_MODE - -dnl The package contains a library implemented in C++. It has to be -dnl buildable under NT. Only a static version of the library is -dnl of interest at the moment. -AC_PROG_CC -AC_PROG_CXX -AC_PROG_RANLIB -AC_OBJEXT -AC_EXEEXT -ECOS_PROG_MSVC -ECOS_PROG_STANDARD_COMPILER_FLAGS - -dnl Work out the endianness. The standard macro for this is used -dnl even though it will give warnings at autoconf time. -AC_C_BIGENDIAN - -dnl Work out a suitable datatype for 64 bit arithmetic. -ECOS_TYPE_64bit - -dnl Check the sizes of the pointer and long data types, so that -dnl CYG_ADDRWORD can be defined correctly. -AC_CHECK_SIZEOF(int *) -AC_CHECK_SIZEOF(long) - -dnl See whether or not the compiler provides __PRETTY_FUNCTION__ -ECOS_C_PRETTY_FUNCTION - -dnl What function should be used to create a temporary file? -dnl tmpnam() is deprecated for security reasons. -AC_CHECK_FUNCS(mkstemp) - -dnl -------------------------------------------------------------------- -dnl User-settable options. Currently these are handled via --enable -dnl command line options, in the absence of an accepted and more rational -dnl alternative. - -AC_ARG_ENABLE(tracebufsize,[ --enable-tracebufsize=X size of the trace buffer],[ - if test "$enableval" = "no" -o "$enableval" = "yes"; then - AC_MSG_ERROR("--enable-tracebufsize should be given a suitable value") - else - AC_DEFINE_UNQUOTED(CYGNUM_INFRA_TRACE_VECTOR_SIZE,$enableval) - fi -]) - -dnl -------------------------------------------------------------------- -dnl Directory structures. -dnl -dnl The purpose of this infrastructure implementation is to provide a way -dnl of giving host code access to the same set of assertions and tracing -dnl facilities as are available on the target side. The implementations -dnl of these facilities has to be rather different, for example the host -dnl side has to worry about running in both command-line and GUI tools, -dnl not to mention supporting different languages such as Tcl as well -dnl as C and C++. -dnl -dnl After a successful build there should be a library libcyginfra.a -dnl which can be linked with the application code and which can get -dnl installed. In addition there will be a set of header files. -dnl -dnl The infrastructure exports four main header files: -dnl -dnl cyg/infra/cyg_type.h data types, useful macros, and a -dnl few compiler-related odds and ends -dnl -dnl cyg/infra/cyg_ass.h lots of lovely assertion macros -dnl -dnl cyg/infra/cyg_trac.h lots of lovely trace macros -dnl -dnl cyg/infra/testcase.h routines for use in testcases -dnl -dnl These header files are shared between host and target side, to make -dnl sure that a consistent set of macros is used between the two. There -dnl are a number of host-specific extensions in the header files as -dnl well. -dnl -dnl The header files rely on a number of other header files: -dnl -dnl pkgconf/infra.h -dnl cyg/hal/basetype.h -dnl -dnl Obviously cyg/hal/basetype.h cannot be shared between host and target, -dnl instead it has to depend on autoconf information. -dnl -dnl Sharing pkgconf/infra.h between host and target is slightly more feasible, -dnl especially if we get the configuration tool to a point where it can -dnl be used for both host and target. However for now this would create a -dnl bit of confusion because two configuration systems would be in use, and -dnl it seems better to stick with just autoconf for now. Therefore -dnl pkgconf/infra.h #include's the file generated by autoconf and -dnl generates the appropriate #define's (it is not a good idea to have -dnl autoconf generate pkgconf/infra.h directly, autoconf is slightly too -dnl eager to do substitutions). -dnl -dnl The configuration header file that is normally generated is -dnl config.h. It is more in keeping with eCos conventions to have -dnl a different header file hostinfra.h instead. This can -dnl achieved using the appropriate AM_CONFIG_HEADER macro. -dnl -dnl Making the copies of cyg_type.h etc. is the responsibility of -dnl Makefile.am, configure is responsible only for the makefile and for -dnl hostinfra.h. - -AM_CONFIG_HEADER(hostinfra.h:config.h.in) -AC_OUTPUT(Makefile:Makefile.in testsuite/Makefile:testsuite/Makefile.in) diff --git a/host/infra/cyg_ass.h b/host/infra/cyg_ass.h deleted file mode 100644 --- a/host/infra/cyg_ass.h +++ /dev/null @@ -1,599 +0,0 @@ -#ifndef CYGONCE_INFRA_CYG_ASS_H -#define CYGONCE_INFRA_CYG_ASS_H - -//========================================================================== -// -// cyg_ass.h -// -// Macros and prototypes for the assert system -// -//========================================================================== -//####COPYRIGHTBEGIN#### -// -// ---------------------------------------------------------------------------- -// Copyright (C) 1997, 1998, 1999, 2000 Red Hat, Inc. -// -// This file is part of the eCos host tools. -// -// This program is free software; you can redistribute it and/or modify it -// under the terms of the GNU General Public License as published by the Free -// Software Foundation; either version 2 of the License, or (at your option) -// any later version. -// -// This program is distributed in the hope that it will be useful, but WITHOUT -// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for -// more details. -// -// You should have received a copy of the GNU General Public License along with -// this program; if not, write to the Free Software Foundation, Inc., -// 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -// -// ---------------------------------------------------------------------------- -// -//####COPYRIGHTEND#### -//========================================================================== -//#####DESCRIPTIONBEGIN#### -// -// Author(s): nickg from an original by hmt -// Contributors: nickg -// Date: 1997-09-08 -// Purpose: Use asserts to avoid writing duff code. -// Description: Runtime tests that compile to nothing in -// release versions of the code, to allow -// as-you-go testing of alternate builds. -// Usage: #include -// ... -// CYG_ASSERT( pcount > 0, "Number of probes should be > 0!" ); -// -// which can result, for example, in a message of the form: -// ASSERT FAILED: probemgr.cxx:1340, scan_probes() : -// number of probes should be > 0! -// if the boolean "pcount > 0" is false. -// -//####DESCRIPTIONEND#### -// -//========================================================================== - -#include - -#include // for CYGBLD_ATTRIB_NORET - -// ------------------------------------------------------------------------- -// If we do not have a function name macro, define it ourselves - -#ifndef CYGDBG_INFRA_DEBUG_FUNCTION_PSEUDOMACRO - // __PRETTY_FUNCTION__ does not work -# ifndef __PRETTY_FUNCTION__ // And it is not already defined -# define __PRETTY_FUNCTION__ NULL -# endif -#endif - -// ------------------------------------------------------------------------- -// this is executed to deal with failure - breakpoint it first! - -externC void -cyg_assert_fail( const char* /* psz_func */, const char* /* psz_file */, - cyg_uint32 /* linenum */, const char* /* psz_msg */ ) - CYGBLD_ATTRIB_NORET; - -// ------------------------------------------------------------------------- - -#ifdef CYGDBG_USE_ASSERTS - -// ------------------------------------------------------------------------- -// We define macros and appropriate prototypes for the assert/fail -// system. These are: -// CYG_FAIL - unconditional panic -// CYG_ASSERT - panic if boolean expression is false -// CYG_ASSERTC - compact version of CYG_ASSERT - -# ifdef CYGDBG_INFRA_DEBUG_ASSERT_MESSAGE -# define CYG_ASSERT_DOCALL( _msg_ ) \ - cyg_assert_fail( __PRETTY_FUNCTION__, __FILE__, __LINE__, _msg_ ); -# else -# define CYG_ASSERT_DOCALL( _msg_ ) \ - CYG_MACRO_START \ - const char* _tmp1_ = _msg_; \ - _tmp1_ = _tmp1_; \ - cyg_assert_fail( __PRETTY_FUNCTION__, __FILE__, __LINE__, NULL ); \ - CYG_MACRO_END -# endif - -// unconditional failure; use like panic(), coredump() &c. -# define CYG_FAIL( _msg_ ) \ - CYG_MACRO_START \ - CYG_ASSERT_DOCALL( _msg_ ); \ - CYG_MACRO_END - -// conditioned assert; if the condition is false, fail. -# define CYG_ASSERT( _bool_, _msg_ ) \ - CYG_MACRO_START \ - if ( ! ( _bool_ ) ) \ - CYG_ASSERT_DOCALL( _msg_ ); \ - CYG_MACRO_END - -# define CYG_ASSERTC( _bool_ ) \ - CYG_MACRO_START \ - if ( ! ( _bool_ ) ) \ - CYG_ASSERT_DOCALL( #_bool_ );\ - CYG_MACRO_END - -#else // ! CYGDBG_USE_ASSERTS - -// ------------------------------------------------------------------------- -// No asserts: we define empty statements for assert & fail. - -# define CYG_FAIL( _msg_ ) CYG_EMPTY_STATEMENT -# define CYG_ASSERT( _bool_, _msg_ ) CYG_EMPTY_STATEMENT -# define CYG_ASSERTC( _bool_ ) CYG_EMPTY_STATEMENT - -#endif // ! CYGDBG_USE_ASSERTS - -// ------------------------------------------------------------------------- -// Pointer integrity checks. -// These check not only for NULL pointer, but can also check for pointers -// that are outside to defined memory areas of the platform or executable. -// We differentiate between data and function pointers, so that we can cope -// with different formats, and so we can check them against different memory -// regions. - -externC cyg_bool cyg_check_data_ptr(void *ptr); -externC cyg_bool cyg_check_func_ptr(void (*ptr)(void)); - -#ifdef CYGDBG_USE_ASSERTS - -# define CYG_CHECK_DATA_PTR( _ptr_, _msg_ ) \ - CYG_MACRO_START \ - if( !cyg_check_data_ptr((void *)(_ptr_))) \ - CYG_ASSERT_DOCALL( _msg_ ); \ - CYG_MACRO_END - -# define CYG_CHECK_FUNC_PTR( _ptr_, _msg_ ) \ - CYG_MACRO_START \ - if( !cyg_check_func_ptr((void (*)(void))(_ptr_))) \ - CYG_ASSERT_DOCALL( _msg_ ); \ - CYG_MACRO_END - -# define CYG_CHECK_DATA_PTRC( _ptr_ ) \ - CYG_MACRO_START \ - if ( !cyg_check_data_ptr((void *)(_ptr_))) \ - CYG_ASSERT_DOCALL("data pointer (" #_ptr_ ") is valid");\ - CYG_MACRO_END - -# define CYG_CHECK_FUNC_PTRC( _ptr_ ) \ - CYG_MACRO_START \ - if ( !cyg_check_func_ptr((void (*)(void))(_ptr_))) \ - CYG_ASSERT_DOCALL("function pointer (" #_ptr_ ") is valid"); \ - CYG_MACRO_END - -#else // CYGDBG_USE_ASSERTS - -# define CYG_CHECK_DATA_PTR( _ptr_, _msg_ ) CYG_EMPTY_STATEMENT -# define CYG_CHECK_FUNC_PTR( _ptr_, _msg_ ) CYG_EMPTY_STATEMENT -# define CYG_CHECK_DATA_PTRC( _ptr_ ) CYG_EMPTY_STATEMENT -# define CYG_CHECK_FUNC_PTRC( _ptr_ ) CYG_EMPTY_STATEMENT - -#endif // CYGDBG_USE_ASSERTS - -// ------------------------------------------------------------------------- -// Unconditional definitions: - -// Check an object for validity by calling its own checker. -// Usage: -// ClassThing *p = &classobject; -// CYG_ASSERTCLASS( p, "Object at p is broken!" ); - -// this enum gives some options as to how keenly to test; avoids cluttering -// the member function declaration if the implementor wants to do more -// zealous tests themselves. - -enum cyg_assert_class_zeal { - cyg_system_test = -1, - cyg_none = 0, - cyg_trivial, - cyg_quick, - cyg_thorough, - cyg_extreme -}; - -// ------------------------------------------------------------------------- -// Define macros for checking classes: -// -// CYG_ASSERT_CLASS - do proforma check on a class pointer -// CYG_ASSERT_CLASSO - do proforma check on a class object -// CYG_ASSERT_ZERO_OR_CLASS- a class pointer is NULL or valid -// CYG_ASSERT_THIS - "this" is valid -// + 3 compact variants and two aliases for backwards compatibility. -// -// All of these end up going via CYG_ASSERT(), which will be an empty -// statement if CYGDBG_USE_ASSERTS is disabled. There is no need to -// test CYGDBG_USE_ASSERTS again here. -// -// The idiom required is that a class have a member function called -// "bool check_this( cyg_assert_class_zeal ) const" that returns true -// iff the object is OK. This need not be conditionally compiled against -// CYGDBG_USE_ASSERTS but it can be if only this macro is used to -// invoke it. Alternatively it can be invoked by hand with other -// choices from the above enum. - -// Assert the checker function of an object by pointer, or in hand. - -#ifdef __cplusplus - -# ifndef CYG_ASSERT_CLASS_ZEAL -# define CYG_ASSERT_CLASS_ZEAL (cyg_quick) // can be redefined locally -# endif - -# define CYG_ASSERT_CLASS( _pobj_, _msg_ ) \ - CYG_ASSERT( ((0 != (_pobj_)) && \ - (_pobj_)->check_this( CYG_ASSERT_CLASS_ZEAL )), _msg_ ) - -# define CYG_ASSERTCLASS( _pobj_,_msg_) \ - CYG_ASSERT_CLASS( (_pobj_), _msg_ ) - -# define CYG_ASSERT_CLASSO( _obj_, _msg_ ) \ - CYG_ASSERT( (_obj_).check_this( CYG_ASSERT_CLASS_ZEAL ), _msg_ ) - -# define CYG_ASSERTCLASSO( _obj_, _msg_ ) \ - CYG_ASSERT_CLASSO( (_obj_), _msg_ ) - -# define CYG_ASSERT_ZERO_OR_CLASS( _pobj_, _msg_ ) \ - CYG_ASSERT( ((0 == (_pobj_)) || \ - (_pobj_)->check_this( CYG_ASSERT_CLASS_ZEAL )), _msg_ ) - -# define CYG_ASSERT_THIS( _msg_ ) \ - CYG_ASSERT( this->check_this( CYG_ASSERT_CLASS_ZEAL ), _msg_ ) - -# define CYG_ASSERT_CLASSC( _pobj_ ) \ - CYG_ASSERT_CLASS( (_pobj_), "class pointer (" #_pobj_ ") is valid" ) - -# define CYG_ASSERT_CLASSOC( _obj_ ) \ - CYG_ASSERT_CLASSO( (_obj_), "object (" #_obj_ ") is valid" ) - -# define CYG_ASSERT_ZERO_OR_CLASSC( _pobj_ ) \ - CYG_ASSERT_ZERO_OR_CLASS((_pobj_), \ - "class pointer (" #_pobj_ ") is zero or valid") - -# define CYG_ASSERT_THISC( ) \ - CYG_ASSERT_THIS( "\"this\" pointer is valid" ) - -#define CYGDBG_DEFINE_CHECK_THIS \ - bool check_this( cyg_assert_class_zeal zeal ) const; - -#endif // __cplusplus - -// ------------------------------------------------------------------------- -// Some alternative names for basic assertions that we can disable -// individually. -// -// CYG_PRECONDITION - argument checking etc -// CYG_POSTCONDITION - results etc -// CYG_LOOP_INVARIANT - for putting in loops -// -// C++ programmers have class-related variants of all of these. - -#ifdef CYGDBG_INFRA_DEBUG_PRECONDITIONS -# define CYG_PRECONDITION( _bool_ , _msg_ ) CYG_ASSERT( _bool_, _msg_ ) -# define CYG_PRECONDITIONC( _bool_ ) \ - CYG_ASSERT( _bool_, "precondition " #_bool_) -#else -# define CYG_PRECONDITION( _bool_ , _msg_ ) CYG_EMPTY_STATEMENT -# define CYG_PRECONDITIONC( _bool_ ) CYG_EMPTY_STATEMENT -#endif - -#ifdef CYGDBG_INFRA_DEBUG_POSTCONDITIONS -# define CYG_POSTCONDITION( _bool_ , _msg_ ) CYG_ASSERT( _bool_, _msg_ ) -# define CYG_POSTCONDITIONC( _bool_ ) \ - CYG_ASSERT( _bool_, "postcondition " #_bool_) -#else -# define CYG_POSTCONDITION( _bool_ , _msg_ ) CYG_EMPTY_STATEMENT -# define CYG_POSTCONDITIONC( _bool_ ) CYG_EMPTY_STATEMENT -#endif - -#ifdef CYGDBG_INFRA_DEBUG_LOOP_INVARIANTS -# define CYG_LOOP_INVARIANT( _bool_ , _msg_ ) CYG_ASSERT( _bool_, _msg_ ) -# define CYG_LOOP_INVARIANTC( _bool_ ) \ - CYG_ASSERT( _bool_, "loop invariant " #_bool_ ) -#else -# define CYG_LOOP_INVARIANT( _bool_ , _msg_ ) CYG_EMPTY_STATEMENT -# define CYG_LOOP_INVARIANTC( _bool_ ) CYG_EMPTY_STATEMENT -#endif - -#ifdef __cplusplus - -// All variants of _CLASS -# define CYG_PRECONDITION_CLASS( _pobj_, _msg_ ) \ - CYG_PRECONDITION( ((0 != (_pobj_)) && \ - (_pobj_)->check_this(CYG_ASSERT_CLASS_ZEAL)), _msg_) - -# define CYG_PRECONDITION_CLASSC( _pobj_ ) \ - CYG_PRECONDITION_CLASS( (_pobj_), \ - "precondition, class pointer (" #_pobj_ ") is valid" ) - -# define CYG_POSTCONDITION_CLASS( _pobj_, _msg_ ) \ - CYG_POSTCONDITION( ((0 != (_pobj_)) && \ - (_pobj_)->check_this(CYG_ASSERT_CLASS_ZEAL)), _msg_) - -# define CYG_POSTCONDITION_CLASSC( _pobj_ ) \ - CYG_POSTCONDITION_CLASS( (_pobj_), \ - "postcondition, class pointer (" #_pobj_ ") is valid" ) - -# define CYG_LOOP_INVARIANT_CLASS( _pobj_, _msg_) \ - CYG_LOOP_INVARIANT( ((0 != (_pobj_)) && \ - (_pobj_)->check_this(CYG_ASSERT_CLASS_ZEAL)), _msg_) - -# define CYG_LOOP_INVARIANT_CLASSC( _pobj_ ) \ - CYG_LOOP_INVARIANT_CLASS( (_pobj_), \ - "loop invariant, class pointer (" #_pobj_ ") is valid" ) - -// All variants of _CLASSO -# define CYG_PRECONDITION_CLASSO( _obj_, _msg_ ) \ - CYG_PRECONDITION( (_obj_).check_this(CYG_ASSERT_CLASS_ZEAL), _msg_) - -# define CYG_PRECONDITION_CLASSOC( _obj_ ) \ - CYG_PRECONDITION_CLASSO( (_obj_), \ - "precondition, object (" #_obj_ ") is valid" ) - -# define CYG_POSTCONDITION_CLASSO( _obj_, _msg_ ) \ - CYG_POSTCONDITION( (_obj_).check_this(CYG_ASSERT_CLASS_ZEAL), _msg_) - -# define CYG_POSTCONDITION_CLASSOC( _obj_ ) \ - CYG_POSTCONDITION_CLASSO( (_obj_), \ - "postcondition, object (" #_obj_ ") is valid" ) - -# define CYG_LOOP_INVARIANT_CLASSO( _obj_, _msg_) \ - CYG_LOOP_INVARIANT( (_obj_).check_this(CYG_ASSERT_CLASS_ZEAL), _msg_) - -# define CYG_LOOP_INVARIANT_CLASSOC( _obj_ ) \ - CYG_LOOP_INVARIANT_CLASSO( (_obj_), \ - "loop invariant, object (" #_obj_ ") is valid" ) - -// All variants of _ZERO_OR_CLASS -# define CYG_PRECONDITION_ZERO_OR_CLASS( _pobj_, _msg_ ) \ - CYG_PRECONDITION( ((0 == (_pobj_)) || \ - (_pobj_)->check_this(CYG_ASSERT_CLASS_ZEAL)), _msg_) - -# define CYG_PRECONDITION_ZERO_OR_CLASSC( _pobj_ ) \ - CYG_PRECONDITION_ZERO_OR_CLASS( (_pobj_), \ - "precondition, class pointer (" #_pobj_ ") is zero or valid" ) - -# define CYG_POSTCONDITION_ZERO_OR_CLASS( _pobj_, _msg_ ) \ - CYG_POSTCONDITION( ((0 == (_pobj_)) || \ - (_pobj_)->check_this(CYG_ASSERT_CLASS_ZEAL)), _msg_) - -# define CYG_POSTCONDITION_ZERO_OR_CLASSC( _pobj_ ) \ - CYG_POSTCONDITION_ZERO_OR_CLASS( (_pobj_), \ - "postcondition, class pointer (" #_pobj_ ") is zero or valid" ) - -# define CYG_LOOP_INVARIANT_ZERO_OR_CLASS( _pobj_, _msg_) \ - CYG_LOOP_INVARIANT( ((0 == (_pobj_)) || \ - (_pobj_)->check_this(CYG_ASSERT_CLASS_ZEAL)), _msg_) - -# define CYG_LOOP_INVARIANT_ZERO_OR_CLASSC( _pobj_ ) \ - CYG_LOOP_INVARIANT_ZERO_OR_CLASS( (_pobj_), \ - "loop invariant, class pointer (" #_pobj_ ") is zero or valid" ) - -// All variants of _THIS -# define CYG_PRECONDITION_THIS( _msg_ ) \ - CYG_PRECONDITION( this->check_this(CYG_ASSERT_CLASS_ZEAL), _msg_) - -# define CYG_PRECONDITION_THISC() \ - CYG_PRECONDITION_THIS( "precondition, \"this\" is valid" ) - -# define CYG_POSTCONDITION_THIS( _msg_ ) \ - CYG_POSTCONDITION( this->check_this(CYG_ASSERT_CLASS_ZEAL), _msg_) - -# define CYG_POSTCONDITION_THISC() \ - CYG_POSTCONDITION_THIS( "postcondition, \"this\" is valid" ) - -# define CYG_LOOP_INVARIANT_THIS( _msg_) \ - CYG_LOOP_INVARIANT( this->check_this(CYG_ASSERT_CLASS_ZEAL), _msg_) - -# define CYG_LOOP_INVARIANT_THISC() \ - CYG_LOOP_INVARIANT_THIS( "loop invariant, \"this\" is valid" ) - -#endif // __cplusplus - -// ------------------------------------------------------------------------- -// Invariants. These are a bit more interesting. The ordinary invariants -// take an arbitrary boolean expression, and C++ does not provide any way -// of evaluating this expression automatically on entry and exit - any -// attempt to use local objects leads to trying to evaluate the expression -// when it is not in scope. This problem does not arise with objects. -// -// For C++ objects it is possible to do a bit better. A template can be -// used to create a local object whose constructor will validate the -// target object and whose destructor will validate the target object -// again. Unfortunately it is necessary to pass the type as well as -// the object: typeof() is a gcc extension, and RTTI's typeid facility -// would provide the derived class and not what we actually want. - -#ifdef CYGDBG_INFRA_DEBUG_INVARIANTS - -# define CYG_INVARIANT( _bool_, _msg_ ) \ - CYG_MACRO_START \ - if ( ! ( _bool_ ) ) \ - CYG_ASSERT_DOCALL( _msg_ ); \ - CYG_MACRO_END - -# define CYG_INVARIANTC( _bool_ ) \ - CYG_MACRO_START \ - if ( ! ( _bool_ ) ) \ - CYG_ASSERT_DOCALL( "invariant (" #_bool_ ")" ); \ - CYG_MACRO_END - -# ifdef __cplusplus -// NOTE: if the compiler does not manage to inline the appropriate -// template functions then the impact on code size and performance becomes -// rather large. But there are significant performance overheads anyway -// simply because of the call to check_this()... -// -template class __CygInvariantObject { - - const X* rep; - - private: - // Prevent access to the default constructors. - __CygInvariantObject() { } - __CygInvariantObject( const __CygInvariantObject& arg ) { } - __CygInvariantObject & operator=( const __CygInvariantObject & arg) { return *this; } - - public: - __CygInvariantObject( X* arg, const char* msg ) : rep(arg) { - if ( !rep->check_this( CYG_ASSERT_CLASS_ZEAL ) ) - CYG_ASSERT_DOCALL( msg ); - } - __CygInvariantObject( X& arg, const char* msg ) : rep(&arg) { - if ( !rep->check_this( CYG_ASSERT_CLASS_ZEAL ) ) - CYG_ASSERT_DOCALL( msg ); - } - __CygInvariantObject( const X* arg, const char* msg ) : rep(arg) { - if ( !rep->check_this( CYG_ASSERT_CLASS_ZEAL ) ) - CYG_ASSERT_DOCALL( msg ); - } - __CygInvariantObject( const X& arg, const char* msg ) : rep(&arg) { - if ( !rep->check_this( CYG_ASSERT_CLASS_ZEAL ) ) - CYG_ASSERT_DOCALL( msg ); - } - ~__CygInvariantObject( ) { - if ( !rep->check_this( CYG_ASSERT_CLASS_ZEAL ) ) - CYG_ASSERT_DOCALL( "invariant, object valid on exit" ); - rep = 0; - }; -}; - -// -// These macros provide sensible concatenation facilities at -// the C preprocessor level, getting around complications in the -// macro expansion rules related to __LINE__ and __FILE__. - -# define __CYG_INVARIANT_CLASSNAME_AUX( a, b) a ## b -# define __CYG_INVARIANT_CLASSNAME( a, b ) \ - __CYG_INVARIANT_CLASSNAME_AUX( a, b ) - - -// These macro definitions do not use CYG_MACRO_START because -// I do not want the scope of the local objects to get confused. -// -// The first line of the macro expansion specifies the type of -// the local object being created. The second line invents a -// name for this object. The third line provides command-line -// arguments. - -# define CYG_INVARIANT_CLASS( _type_, _pobj_, _msg_ ) \ - __CygInvariantObject<_type_> \ - __CYG_INVARIANT_CLASSNAME( __invariant_class_, __LINE__ ) \ - ( _pobj_, _msg_ ) - -# define CYG_INVARIANT_CLASSC( _type_, _pobj_ ) \ - __CygInvariantObject<_type_> \ - __CYG_INVARIANT_CLASSNAME( __invariant_class_, __LINE__ ) \ - ( _pobj_, "invariant, class pointer (" #_pobj_ ") is valid" ) - -# define CYG_INVARIANT_CLASSO( _type_, _obj_, _msg_ ) \ - __CygInvariantObject<_type_> \ - __CYG_INVARIANT_CLASSNAME( __invariant_class_, __LINE__ ) \ - ( _obj_, _msg_ ) - -# define CYG_INVARIANT_CLASSOC( _type_, _obj_ ) \ - __CygInvariantObject<_type_> \ - __CYG_INVARIANT_CLASSNAME( __invariant_class_, __LINE__ ) \ - ( _obj_, "invariant, object (" #_obj_ ") is valid" ) - -# define CYG_INVARIANT_THIS( _type_, _msg_ ) \ - __CygInvariantObject<_type_> \ - __CYG_INVARIANT_CLASSNAME( __invariant_class_, __LINE__ ) \ - ( this, _msg_ ) - -# define CYG_INVARIANT_THISC( _type_ ) \ - __CygInvariantObject<_type_> \ - __CYG_INVARIANT_CLASSNAME( __invariant_class_, __LINE__ ) \ - ( this, "invariant, \"this\" is valid" ) - -# endif // __cplusplus - -#else // !CYGDBG_INFRA_DEBUG_INVARIANTS - -# define CYG_INVARIANT( _bool_, _msg_ ) CYG_EMPTY_STATEMENT -# define CYG_INVARIANTC( _bool_ ) CYG_EMPTY_STATEMENT - -# ifdef __cplusplus - -# define CYG_INVARIANT_CLASS( _type_, _pobj_, _msg_ ) -# define CYG_INVARIANT_CLASSC( _type_, _pobj_ ) -# define CYG_INVARIANT_CLASSO( _type_, _obj_, _msg_ ) -# define CYG_INVARIANT_CLASSOC( _type_, _obj_ ) -# define CYG_INVARIANT_THIS( _type_, _msg_ ) -# define CYG_INVARIANT_THISC( _type_ ) - -# endif - -#endif // CYGDBG_INFRA_DEBUG_INVARIANTS - -// ------------------------------------------------------------------------- -// Compile time failure; like #error but in a macro so we can use it in -// other definitions. -// -// Usage: -// #define new CYG_COMPILETIMEFAIL( "Do NOT use new!") - -#define CYG_COMPILETIMEFAIL( _msg_ ) !!!-- _msg_ --!!! - - -// ------------------------------------------------------------------------- -// The host-side implementation of the infrastructure provides a number -// of additional functions that allow applications to provide their own -// implementation of cyg_assert_fail(). This is not strictly necessary -// since the presence of cyg_assert_fail() in the application would -// override the one in the library anyway, but it is useful to make -// certain functionality more readily available. -// -// These declarations are only available if the symbol -// CYG_DECLARE_HOST_ASSERTION_SUPPORT is defined. -#ifdef CYG_DECLARE_HOST_ASSERTION_SUPPORT - -// The default assertion handler writes its output to a file and -// if possible a suitable message to stdout. It is possible to -// install an alternative handler. If this alternative returns false -// then the default handler will be invoked instead, otherwise the -// application will exit. -externC void cyg_assert_install_failure_handler( - bool (*)(const char* /* psz_func */, - const char* /* psz_file */, - cyg_uint32 /* linenum */, - const char* /* psz_msg */) ); - -// Register a callback that should get invoked as part of handling an -// assertion failure and that will typically produce some additional -// output. For example the trace code will install a callback to output -// trace information. -// -// The first argument is a string identifying the callback. The second -// argument is a function pointer for the callback itself, whose -// argument is another function that can be invoked for output. -externC void cyg_assert_install_failure_callback( - const char* /* name */, - void (*)( void (*)(const char*) )); - -// This function can be called by assert failure handlers to invoke -// the installed callbacks. The three arguments are function pointers -// that get invoked prior to callback invocation, by the callback itself, -// and after each callback. In the first case the argument will be the -// callback name. -externC void cyg_assert_failure_invoke_callbacks( - void (*)(const char* /* name */), - void (*)(const char* /* callback data */ ), - void (*)(void) ); - -// This function is intended to be called from inside gdb instead of -// cyg_assert_fail(),, without the need to specify a filename or -// anything else. -externC void cyg_assert_quickfail(void); - -#endif // CYG_DECLARE_HOST_ASSERTION_SUPPORT - -// ------------------------------------------------------------------------- - -#endif // CYGONCE_INFRA_CYG_ASS_H multiple inclusion protection -// EOF cyg_ass.h diff --git a/host/infra/cyg_trac.h b/host/infra/cyg_trac.h deleted file mode 100644 --- a/host/infra/cyg_trac.h +++ /dev/null @@ -1,1648 +0,0 @@ -#ifndef CYGONCE_INFRA_CYG_TRAC_H -#define CYGONCE_INFRA_CYG_TRAC_H - -//========================================================================== -// -// cyg_trac.h -// -// Macros and prototypes for the tracing system -// -//========================================================================== -//####COPYRIGHTBEGIN#### -// -// ---------------------------------------------------------------------------- -// Copyright (C) 2002 Bart Veer -// Copyright (C) 1998, 1999, 2000, 2001 Red Hat, Inc. -// -// This file is part of the eCos host tools. -// -// This program is free software; you can redistribute it and/or modify it -// under the terms of the GNU General Public License as published by the Free -// Software Foundation; either version 2 of the License, or (at your option) -// any later version. -// -// This program is distributed in the hope that it will be useful, but WITHOUT -// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for -// more details. -// -// You should have received a copy of the GNU General Public License along with -// this program; if not, write to the Free Software Foundation, Inc., -// 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -// -// ---------------------------------------------------------------------------- -// -//####COPYRIGHTEND#### -//========================================================================== -//#####DESCRIPTIONBEGIN#### -// -// Author(s): nickg from an original by hmt -// Contributors: nickg -// Date: 1998-04-23 -// Purpose: Use traces to log procedure entry, and "print" stuff -// Description: Runtime logging messages that compile to nothing in -// release versions of the code, to allow -// as-you-go tracing of alternate builds. -// Usage: #include -// ... -// CYG_TRACE2( PIPE_TRACE, "pipe %x, data %d", ppipe, oword ); -// -// which can result, for example, in a message of the form: -// "TRACE: pipemgr.cxx:1340, write_pipe(): pipe 0x8004c, data 17" -// -//####DESCRIPTIONEND#### -// - -/**************************************************************************** - -Explicit tracing -================ - -CYG_TRACE0( bool, msg ); -CYG_TRACE1( bool, msg, arg1 ); -CYG_TRACE2( bool, msg, arg1, arg2 ); -.... -CYG_TRACE8( bool, msg, .... [with 8 args] ); - -In general, the bool controls whether or not the tracing occurs for a -particular invocation of the macro. The msg is a printf-style string, -though exactly which formats are supported depends on the underlying -implementation. Typically, at least %d, %x, %08x, %c and %s will be -supported. Of course a most compact implementation might print - - TRACE:z1dbuff.c[92]get_nextdata(): data pointer %x offset %d: 42BD8 1C - -or some such, leaving you to work it out for yourself. - -It is expected that the boolean would rarely actually be a complex -expression; it is more likely that it would either be "1", tracing being -controlled for the whole compilation unit or subsystem by means of the -CYGDBG_USE_TRACING symbol, or a local symbol for tracing over the whole -file, defined to 0 or to 1. For runtime control of tracing in a debugging -session, it is typical to use symbols defined to expressions such as: - - static int xxx_trace = 0; - #define TL1 (0 < xxx_trace) - #define TL2 (1 < xxx_trace) - -so you set xxx_trace to 1 to enable those messages conditioned by TL1 -(trace level 1) and so on. - - CYG_TRACE1( TL1, "Major argument is %d", zz ); - CYG_TRACE4( TL2, "...minor details %d %d %d %d", m1, m2, m3 ,m4 ); - -To assist with the case where the same symbol or expression is used -throughout a compilation unit, the programmer can define the symbol -CYG_TRACE_USER_BOOL as they choose and then use convenience macros with the -suffix 'B' in the obvious manner: - - #define CYG_TRACE_USER_BOOL (xxx_trace > 0) - CYG_TRACE2B( "Counters are %d, %d", countlo, counthi ); - -For the case where you just want to print a load of numbers in hex, or -decimal, convenience suffices X, D and Y are provided. X uses %08x, D %d -and Y an unadorned %x for each argument. - - CYG_TRACE3D( TL2, m1, m2, d ); - -If you want to do something similar but with a little more comment, the -names (strictly spellings) of the variables you are printing can be used by -appending a V to the X, D or Y. - - CYG_TRACE3DV( TL2, m1, m2, d ); - -might output: - - TRACE:z1dbuff.c[92]get_nextdata(): m1=23 m2=-4 d=55 - -These conveniences can be combined, and they apply equally to tracing with -up to 8 variables; the B for Bool goes last: - - CYG_TRACE4DVB( i, i*i, i*i*i, i*i*i*i ); - -might output: - - TRACE:table.c[12]main(): i=3 i*i=9 i*i*i=27 i*i*i*i=81 - - -Function Tracing -================ - -There are also facities for easily reporting function entry and exit, -printing the function arguments, and detecting returns without logging (or -without a value!). - -The basic facility is - - CYG_REPORT_FUNCTION(); - -In C, place this between the local variable declarations and the first -statement or errors will ensue. C++ is more flexible; place the macro as -the first line of all functions you wish to trace. The following -variations are also provided: - - CYG_REPORT_FUNCTYPE( exitmsg ) provide a printf string for the type - of the returned value - CYG_REPORT_FUNCNAME( name ) supply a function name explicitly, for - if __FUNCTION__ is not supported - CYG_REPORT_FUNCNAMETYPE( name, exitmsg ) both of the above extensions - -These are unconditional; the assumption is that if function reporting is -used at all it will be used for all functions within a compilation unit. -However, it is useful to be able to control function reporting at finer -grain without editing the source files concerned, at compile time or at -runtime. To support this, conditioned versions (with suffix 'C') are -provided for the above four macros, which only procduce trace output if the -macro CYG_REPORT_USER_BOOL evaluates true. - - CYG_REPORT_FUNCTIONC() - CYG_REPORT_FUNCNAMEC( name ) - CYG_REPORT_FUNCTYPEC( exitmsg ) - CYG_REPORT_FUNCNAMETYPEC( name, exitmsg ) - -You can define CYG_REPORT_USER_BOOL to anything you like before invoking -these macros; using a simple -DCYG_REPORT_USER_BOOL=0 or ...=1 on the -compiler command line would do the trick, but there is more flexibility to -be gained by something like: - - #define CYG_REPORT_USER_BOOL (reporting_bool_FOO) - #ifdef TRACE_FOO - int reporting_bool_FOO = 1; - #else - int reporting_bool_FOO = 0; - #endif - -where FOO relates to the module name. Thus an external symbol sets the -default, but it can be overridden in a debugging session by setting the -variable reporting_bool_FOO. - -Note that the condition applied to the initial CYG_REPORT_FUNC...() macro -controls all function-related reporting (not tracing) from that function; -the underlying mechanisms still operate even if no output is created. Thus -no conditioned variants of CYG_REPORT_FUNCARG[s] nor of CYG_REPORT_RETURN -are needed. - -Examples: - int myfunction() - { - CYG_REPORT_FUNCTYPE( "recode is %d" ); - -A function return is traced using - - CYG_REPORT_RETURN() a void return - CYG_REPORT_RETVAL( value ) returning a value - -With the CYG_REPORT_FUNCTYPE example, the latter might produce a message -like: - - TRACE:myprog.c[40]fact(): enter - TRACE:myprog.c[53]fact(): retcode is 24 - -It is also useful to trace the values of the arguments to a function: - CYG_REPORT_FUNCARGVOID confirms that the function is void - CYG_REPORT_FUNCARG1( format, arg ) printf-style - to - CYG_REPORT_FUNCARG8( format, arg1...arg8 ) printf-style - -The CYG_REPORT_FUNCARG[1-8] macros are also offered with the convenience -extensions: D, X, or Y, and V like the explicit tracing macros. For -example: - - int fact( int number ) - { - CYG_REPORT_FUNCTYPE( "recode is %d" ); - CYG_REPORT_FUNCARG1DV( number ); - int result = number; - while ( --number > 1 ) result *= number - CYG_REPORT_RETVAL( result ); - return result; - } - -might produce: - - TRACE:myprog.c[40]fact(): enter - TRACE:myprog.c[40]fact(): number=4 - TRACE:myprog.c[53]fact(): retcode is 24 - -If no exit message is provided, a default of %08x is used. - - -General Configury -================= - -If CYGDBG_INFRA_DEBUG_FUNCTION_PSEUDOMACRO is *not* defined, it is assumed -that __PRETTY_FUNCTION__ or equivalents do not exist, so no function name -tracing is possible; only file and line number. - -If CYGDBG_INFRA_DEBUG_TRACE_MESSAGE is *not* defined, the message and -arguments to all tracing macros are not used; only "execution was here" -type information, by file, function and line number, is available. This -can greatly reduce the size of an image with tracing disabled, which may be -crucial in debugging on actual shipped hardware with limited memory. - -If configured for buffered tracing then CYG_TRACE_PRINT() can be used to -output the contents of the trace buffer on demand. - -CYG_TRACE_DUMP() outputs a form of "core dump" containing info on the -scheduler and threads at the time. This information will be invalid if -the kernel is not running. - -C/C++: in C++ the function reporting is implemented using a class object -with a destructor; this allows reporting of a return which has not been -explicitly reported, and detection of accidental multiple return reports. -This helps you write the function reporting correctly. In C it is not -possible to be so sophisticated, so the implementation is not so helpful in -detecting errors in the use of the tracing system. - -Note that for all of the above variations, the internal API to the -functions which are called in consequence of tracing remains the same, so -these variations can be mixed in the same executable, by configuring the -tracing macros differently in different compilation units or subsystems. - - -Summary -======= - -Explicit tracing ----------------- - -CYG_TRACE0( bool, msg ) if bool, print msg -CYG_TRACE1( bool, msg, arg ) if bool, printf-style - to -CYG_TRACE8( bool, msg, arg1...arg8 ) if bool, printf-style - -CYG_TRACE0B( msg, args... ) to CYG_TRACE8B() use CYG_TRACE_USER_BOOL - -CYG_TRACE1X( bool, args... ) to CYG_TRACE8X() print args using %08x -CYG_TRACE1Y( bool, args... ) to CYG_TRACE8Y() print args using %x -CYG_TRACE1D( bool, args... ) to CYG_TRACE8D() print args using %d - -CYG_TRACE1XV( bool, args... ) to CYG_TRACE8XV() print args using "arg=%08x" -CYG_TRACE1YV( bool, args... ) to CYG_TRACE8YV() print args using "arg=%x" -CYG_TRACE1DV( bool, args... ) to CYG_TRACE8DV() print args using "arg=%d" - -CYG_TRACE1XB( args... ) to CYG_TRACE8XB() print using %08x, no bool -CYG_TRACE1YB( args... ) to CYG_TRACE8YB() print using %x, no bool -CYG_TRACE1DB( args... ) to CYG_TRACE8DB() print using %d, no bool - -CYG_TRACE1XVB( args... ) to CYG_TRACE8XVB() use "arg=%08x", no bool -CYG_TRACE1YVB( args... ) to CYG_TRACE8YVB() use "arg=%x", no bool -CYG_TRACE1DVB( args... ) to CYG_TRACE8DVB() use "arg=%d", no bool - -Function tracing ----------------- - -CYG_REPORT_FUNCTION() default function entry -CYG_REPORT_FUNCNAME( name ) name the function -CYG_REPORT_FUNCTYPE( exitmsg ) printf for retval -CYG_REPORT_FUNCNAMETYPE( name, exitmsg ) both - -CYG_REPORT_FUNCTIONC() as above, but conditional -CYG_REPORT_FUNCNAMEC( name ) on CYG_REPORT_USER_BOOL -CYG_REPORT_FUNCTYPEC( exitmsg ) however it is defined -CYG_REPORT_FUNCNAMETYPEC( name, exitmsg ) ... - -CYG_REPORT_RETURN() void function exit -CYG_REPORT_RETVAL( value ) returning value - -CYG_REPORT_FUNCARGVOID() void function entry -CYG_REPORT_FUNCARG1( format, arg ) printf-style - to -CYG_REPORT_FUNCARG8( format, arg1...arg8 ) printf-style - -CYG_REPORT_FUNCARG1X( arg ) - to -CYG_REPORT_FUNCARG8X( arg1...arg8 ) use %08x -CYG_REPORT_FUNCARG1Y... use %x -CYG_REPORT_FUNCARG1D... use %d - -CYG_REPORT_FUNCARG1XV... use "arg=%08x" -CYG_REPORT_FUNCARG1YV... use "arg=%x" -CYG_REPORT_FUNCARG1DV... use "arg=%d" - -Other ------ - -CYG_TRACE_DUMP() dumps kernel state -CYG_TRACE_PRINT() prints buffered tracing - - ---------------------------------------------------------------------------- - -Internal Documentation -====================== - -The required functions which are used by the tracing macros are - - externC void - cyg_tracenomsg( const char *psz_func, const char *psz_file, cyg_uint32 linenum ); - - externC void - cyg_tracemsg( cyg_uint32 what, - const char *psz_func, const char *psz_file, cyg_uint32 linenum, - const char *psz_msg ); - - externC void - cyg_tracemsg2( cyg_uint32 what, - const char *psz_func, const char *psz_file, cyg_uint32 linenum, - const char *psz_msg, - CYG_ADDRWORD arg0, CYG_ADDRWORD arg1 ); - // extended in the obvious way for 4,6,8 arguments - -These functions should expect psz_func and psz_file to possibly be NULL in -case those facilities are not available in the compilation environment, and -do something safe in such cases. A NULL message should really be dealt -with safely also, just logging "execution here" info like cyg_tracenomsg(). - -Discussion of possible underlying implementations -------------------------------------------------- - -It is intended that the functions that get called can simply print the info -they are given in as fancy a format as you like, or they could do the -printf-type formatting and log the resulting text in a buffer. They get -told the type of event (function-entry, function-arguments, function-exit -or plain tracing info) and so can perform fancy indenting, for example, to -make call stack inspection more obvious to humans. It is also intended -that a more compact logging arrangement be possible, for example one which -records, in 32-bit words (CYG_ADDRWORDs), the addresses of the file, -function and msg strings, the line number and the arguments. This has the -implication that the msg string should not be constructed dynamically but -be static ie. a plain quoted C string. The number of arguments also must -be recorded, and if it is chosen to save string arguments in the buffer -rather than just their addresses (which could be invalid by the time the -logged information is processed) some flagging of which arguments are -strings must be provided. The system could also be extended to deal with -floats of whichever size fir in a CYG_ADDRWORD; these would probably -require special treatment also. With these considerations in mind, the -maximum number of parameters in a single trace message has been set to 8, -so that a byte bitset could be used to indicate which arguments are -strings, another for those which are floats, and the count of arguments -also fits in a byte as number or a bitset. - - -****************************************************************************/ - -#include - -#include - -// ------------------------------------------------------------------------- -// CYGDBG_INFRA_DEBUG_FUNCTION_PSEUDOMACRO is dealt with in cyg_ass.h. -// ------------------------------------------------------------------------- - -#ifdef CYGDBG_USE_TRACING - -// ------------------------------------------------------------------------- -// We define macros and appropriate prototypes for the trace/fail -// system. These are: -// CYG_TRACE0..8 - trace if boolean -// CYG_TRACEPROC - default no comment proc entry -// CYG_TRACEPROCOUT - default no comment proc exit -// CYG_TRACE_DUMP - outputs a form of "core dump", including the state -// of the kernel scheduler, threads, etc. -// CYG_TRACE_PRINT - Forces manual output of any trace info that has -// been buffered up. - -// these are executed to deal with tracing - breakpoint? - -externC void -cyg_tracenomsg( const char *psz_func, const char *psz_file, cyg_uint32 linenum ); - -externC void -cyg_trace_dump(void); - -#define CYG_TRACE_DUMP() cyg_trace_dump() - -#ifdef CYGDBG_INFRA_DEBUG_TRACE_ASSERT_BUFFER - -externC void -cyg_trace_print(void); - -#define CYG_TRACE_PRINT() cyg_trace_print() - -#else -#define CYG_TRACE_PRINT() CYG_EMPTY_STATEMENT -#endif - -// provide every other one of these as a space/caller bloat compromise. - -# ifdef CYGDBG_INFRA_DEBUG_TRACE_MESSAGE - -enum cyg_trace_what{ - cyg_trace_trace = 0, - cyg_trace_enter, - cyg_trace_args, - cyg_trace_return, -// cyg_trace_, -// cyg_trace_, -}; - -externC void -cyg_tracemsg( cyg_uint32 what, - const char *psz_func, const char *psz_file, cyg_uint32 linenum, - const char *psz_msg ); - -externC void -cyg_tracemsg2( cyg_uint32 what, - const char *psz_func, const char *psz_file, cyg_uint32 linenum, - const char *psz_msg, - CYG_ADDRWORD arg0, CYG_ADDRWORD arg1 ); -externC void -cyg_tracemsg4( cyg_uint32 what, - const char *psz_func, const char *psz_file, cyg_uint32 linenum, - const char *psz_msg, - CYG_ADDRWORD arg0, CYG_ADDRWORD arg1, - CYG_ADDRWORD arg2, CYG_ADDRWORD arg3 ); -externC void -cyg_tracemsg6( cyg_uint32 what, - const char *psz_func, const char *psz_file, cyg_uint32 linenum, - const char *psz_msg, - CYG_ADDRWORD arg0, CYG_ADDRWORD arg1, - CYG_ADDRWORD arg2, CYG_ADDRWORD arg3, - CYG_ADDRWORD arg4, CYG_ADDRWORD arg5 ); -externC void -cyg_tracemsg8( cyg_uint32 what, - const char *psz_func, const char *psz_file, cyg_uint32 linenum, - const char *psz_msg, - CYG_ADDRWORD arg0, CYG_ADDRWORD arg1, - CYG_ADDRWORD arg2, CYG_ADDRWORD arg3, - CYG_ADDRWORD arg4, CYG_ADDRWORD arg5, - CYG_ADDRWORD arg6, CYG_ADDRWORD arg7 ); - -#endif // CYGDBG_INFRA_DEBUG_TRACE_MESSAGE - -// ------------------------------------------------------------------------- - -# ifdef CYGDBG_INFRA_DEBUG_TRACE_MESSAGE - -# define CYG_TRACE_docall0( _msg_ ) \ - cyg_tracemsg( cyg_trace_trace, \ - __PRETTY_FUNCTION__, __FILE__, __LINE__, _msg_ ); - -# define CYG_TRACE_docall2( _msg_, _arg0_, _arg1_ ) \ - cyg_tracemsg2( cyg_trace_trace, \ - __PRETTY_FUNCTION__, __FILE__, __LINE__, _msg_, \ - (CYG_ADDRWORD)_arg0_, (CYG_ADDRWORD)_arg1_ ); - -# define CYG_TRACE_docall4( _msg_, _arg0_, _arg1_ , _arg2_, _arg3_ ) \ - cyg_tracemsg4( cyg_trace_trace, \ - __PRETTY_FUNCTION__, __FILE__, __LINE__, _msg_, \ - (CYG_ADDRWORD)_arg0_, (CYG_ADDRWORD)_arg1_, \ - (CYG_ADDRWORD)_arg2_, (CYG_ADDRWORD)_arg3_ ); - -# define CYG_TRACE_docall6( _msg_, _arg0_, _arg1_ , _arg2_, _arg3_, \ - _arg4_, _arg5_ ) \ - cyg_tracemsg6( cyg_trace_trace, \ - __PRETTY_FUNCTION__, __FILE__, __LINE__, _msg_, \ - (CYG_ADDRWORD)_arg0_, (CYG_ADDRWORD)_arg1_, \ - (CYG_ADDRWORD)_arg2_, (CYG_ADDRWORD)_arg3_, \ - (CYG_ADDRWORD)_arg4_, (CYG_ADDRWORD)_arg5_ ); - -# define CYG_TRACE_docall8( _msg_, _arg0_, _arg1_ , _arg2_, _arg3_, \ - _arg4_, _arg5_, _arg6_, _arg7_ ) \ - cyg_tracemsg8( cyg_trace_trace, \ - __PRETTY_FUNCTION__, __FILE__, __LINE__, _msg_, \ - (CYG_ADDRWORD)_arg0_, (CYG_ADDRWORD)_arg1_, \ - (CYG_ADDRWORD)_arg2_, (CYG_ADDRWORD)_arg3_, \ - (CYG_ADDRWORD)_arg4_, (CYG_ADDRWORD)_arg5_, \ - (CYG_ADDRWORD)_arg6_, (CYG_ADDRWORD)_arg7_ ); - -# else // do not CYGDBG_INFRA_DEBUG_TRACE_MESSAGE - -# define CYG_TRACE_docall0( _msg_ ) \ - cyg_tracenomsg( __PRETTY_FUNCTION__, __FILE__, __LINE__ ); - -# define CYG_TRACE_docall2( _msg_, _arg0_, _arg1_ ) \ - cyg_tracenomsg( __PRETTY_FUNCTION__, __FILE__, __LINE__ ); - -# define CYG_TRACE_docall4( _msg_, _arg0_, _arg1_ , _arg2_, _arg3_ ) \ - cyg_tracenomsg( __PRETTY_FUNCTION__, __FILE__, __LINE__ ); - -# define CYG_TRACE_docall6( _msg_, _arg0_, _arg1_ , _arg2_, _arg3_, \ - _arg4_, _arg5_ ) \ - cyg_tracenomsg( __PRETTY_FUNCTION__, __FILE__, __LINE__ ); - -# define CYG_TRACE_docall8( _msg_, _arg0_, _arg1_, _arg2_, _arg3_, \ - _arg4_, _arg5_, _arg6_, _arg7_ ) \ - cyg_tracenomsg( __PRETTY_FUNCTION__, __FILE__, __LINE__ ); - -#endif - -// ------------------------------------------------------------------------- -// Conditioned trace; if the condition is false, fail. - -#define CYG_TRACE0( _bool_, _msg_ ) \ - CYG_MACRO_START \ - if ( ( _bool_ ) ) \ - CYG_TRACE_docall0( _msg_ ); \ - CYG_MACRO_END - -#define CYG_TRACE1( _bool_, _msg_, a ) \ - CYG_MACRO_START \ - if ( ( _bool_ ) ) \ - CYG_TRACE_docall2( _msg_, a, 0 ); \ - CYG_MACRO_END - -#define CYG_TRACE2( _bool_, _msg_, a, b ) \ - CYG_MACRO_START \ - if ( ( _bool_ ) ) \ - CYG_TRACE_docall2( _msg_, a, b ); \ - CYG_MACRO_END - -#define CYG_TRACE3( _bool_, _msg_, a, b, c ) \ - CYG_MACRO_START \ - if ( ( _bool_ ) ) \ - CYG_TRACE_docall4( _msg_, a, b, c, 0 ); \ - CYG_MACRO_END - -#define CYG_TRACE4( _bool_, _msg_, a, b, c, d ) \ - CYG_MACRO_START \ - if ( ( _bool_ ) ) \ - CYG_TRACE_docall4( _msg_, a, b, c, d ); \ - CYG_MACRO_END - -#define CYG_TRACE5( _bool_, _msg_, a, b, c, d, e ) \ - CYG_MACRO_START \ - if ( ( _bool_ ) ) \ - CYG_TRACE_docall6( _msg_, a, b, c, d, e, 0 ); \ - CYG_MACRO_END - -#define CYG_TRACE6( _bool_, _msg_, a, b, c, d, e, f ) \ - CYG_MACRO_START \ - if ( ( _bool_ ) ) \ - CYG_TRACE_docall6( _msg_, a, b, c, d, e, f ); \ - CYG_MACRO_END - -#define CYG_TRACE7( _bool_, _msg_, a, b, c, d, e, f, g ) \ - CYG_MACRO_START \ - if ( ( _bool_ ) ) \ - CYG_TRACE_docall8( _msg_, a, b, c, d, e, f, g, 0 ); \ - CYG_MACRO_END - -#define CYG_TRACE8( _bool_, _msg_, a, b, c, d, e, f, g, h ) \ - CYG_MACRO_START \ - if ( ( _bool_ ) ) \ - CYG_TRACE_docall8( _msg_, a, b, c, d, e, f, g, h ); \ - CYG_MACRO_END - -// ------------------------------------------------------------------------- -// Report function entry and exit. -// In C++ the macro CYG_REPORT_FUNCTION should appear as the first line of -// any function. It will generate a message whenever the function is entered -// and when it is exited. -// In C the macro should appear as the first statement after any local variable -// definitions. No exit message will be generated unless CYG_REPORT_RETURN is -// placed just before each return. -// Where a piece of code is to be compiled with both C and C++, the above -// rules for C should be followed. - -#ifdef CYGDBG_INFRA_DEBUG_FUNCTION_REPORTS - -#ifdef __cplusplus - -class Cyg_TraceFunction_Report_ -{ -public: - int cond; - const char *func; - const char *file; - cyg_uint32 lnum; -#ifdef CYGDBG_INFRA_DEBUG_TRACE_MESSAGE - const char *exitmsg; - CYG_ADDRWORD exitvalue; - enum { UNSET = 0, SET, VOID } exitset; -#endif - - Cyg_TraceFunction_Report_( - int condition, const char *psz_func, const char *psz_file, - cyg_uint32 linenum) - { - cond = condition; - func = psz_func; - file = psz_file; - lnum = linenum; - -#ifdef CYGDBG_INFRA_DEBUG_TRACE_MESSAGE - exitmsg = NULL; - exitset = UNSET; - if ( cond ) - cyg_tracemsg( cyg_trace_enter, func, file, lnum, "enter"); -#else - if ( cond ) - cyg_tracenomsg( func, file, lnum ); -#endif - }; - - Cyg_TraceFunction_Report_( - int condition, const char *psz_func, const char *psz_file, - cyg_uint32 linenum, const char *psz_exitmsg ) - { - cond = condition; - func = psz_func; - file = psz_file; - lnum = linenum; -#ifdef CYGDBG_INFRA_DEBUG_TRACE_MESSAGE - exitmsg = psz_exitmsg; - exitset = UNSET; - if ( cond ) - cyg_tracemsg( cyg_trace_enter, func, file, lnum, "enter"); -#else - CYG_UNUSED_PARAM( const char *, psz_exitmsg ); - if ( cond ) - cyg_tracenomsg( func, file, lnum ); -#endif - }; - - inline void set_exitvoid( cyg_uint32 linenum ) - { - lnum = linenum; -#ifdef CYGDBG_INFRA_DEBUG_TRACE_MESSAGE - CYG_ASSERT( NULL == exitmsg, "exitvoid used in typed function" ); - CYG_ASSERT( UNSET == exitset, "exitvoid used when arg already set" ); - exitset = VOID; -#endif - } - - inline void set_exitvalue( cyg_uint32 linenum, CYG_ADDRWORD retcode ) - { - lnum = linenum; -#ifdef CYGDBG_INFRA_DEBUG_TRACE_MESSAGE - CYG_ASSERT( UNSET == exitset, "exitvalue used when arg already set" ); - exitvalue = retcode; - exitset = SET; -#else - CYG_UNUSED_PARAM( CYG_ADDRWORD, retcode ); -#endif - } - - ~Cyg_TraceFunction_Report_() - { - if ( cond ) { -#ifdef CYGDBG_INFRA_DEBUG_TRACE_MESSAGE - if ( VOID == exitset ) - cyg_tracemsg( cyg_trace_return, func, file, lnum, - "return void"); - else if ( UNSET == exitset ) - cyg_tracemsg( cyg_trace_return, func, file, lnum, - "RETURNING UNSET!"); - else if ( NULL == exitmsg ) - cyg_tracemsg2( cyg_trace_return, func, file, lnum, - "return %08x", exitvalue, 0 ); - else - cyg_tracemsg2( cyg_trace_return, func, file, lnum, - exitmsg, exitvalue, 0 ); -#else - cyg_tracenomsg( func, file, lnum ); -#endif - } - } -}; - -// These have no CYG_MACRO_START,END around because it is required -// that the scope of the object be the whole function body. Get it? - -// These are the unconditional versions: -#define CYG_REPORT_FUNCTION() \ - Cyg_TraceFunction_Report_ cyg_tracefunction_report_( \ - 1, __PRETTY_FUNCTION__, \ - __FILE__, __LINE__ ) - -#define CYG_REPORT_FUNCTYPE( _exitmsg_ ) \ - Cyg_TraceFunction_Report_ cyg_tracefunction_report_( \ - 1, __PRETTY_FUNCTION__, \ - __FILE__, __LINE__, _exitmsg_ ) - -#define CYG_REPORT_FUNCNAME( _name_ ) \ - Cyg_TraceFunction_Report_ cyg_tracefunction_report_( \ - 1, _name_, \ - __FILE__, __LINE__ ) - -#define CYG_REPORT_FUNCNAMETYPE( _name_, _exitmsg_ ) \ - Cyg_TraceFunction_Report_ cyg_tracefunction_report_( \ - 1, _name_, \ - __FILE__, __LINE__, _exitmsg_ ) - -// These are conditioned on macro CYG_REPORT_USER_BOOL -// (which you better have defined) -#define CYG_REPORT_FUNCTIONC() \ - Cyg_TraceFunction_Report_ cyg_tracefunction_report_( \ - CYG_REPORT_USER_BOOL, __PRETTY_FUNCTION__, \ - __FILE__, __LINE__ ) - -#define CYG_REPORT_FUNCTYPEC( _exitmsg_ ) \ - Cyg_TraceFunction_Report_ cyg_tracefunction_report_( \ - CYG_REPORT_USER_BOOL, __PRETTY_FUNCTION__, \ - __FILE__, __LINE__, _exitmsg_ ) - -#define CYG_REPORT_FUNCNAMEC( _name_ ) \ - Cyg_TraceFunction_Report_ cyg_tracefunction_report_( \ - CYG_REPORT_USER_BOOL, _name_, \ - __FILE__, __LINE__ ) - -#define CYG_REPORT_FUNCNAMETYPEC( _name_, _exitmsg_ ) \ - Cyg_TraceFunction_Report_ cyg_tracefunction_report_( \ - CYG_REPORT_USER_BOOL, _name_, \ - __FILE__, __LINE__, _exitmsg_ ) - - -#define CYG_REPORT_RETURN() CYG_MACRO_START \ - cyg_tracefunction_report_.set_exitvoid( __LINE__ ); \ -CYG_MACRO_END - -#define CYG_REPORT_RETVAL( _value_) CYG_MACRO_START \ - cyg_tracefunction_report_.set_exitvalue( \ - __LINE__, (CYG_ADDRWORD)(_value_) ); \ -CYG_MACRO_END - - -#else // not __cplusplus - - -struct Cyg_TraceFunction_Report_ -{ - int cond; - const char *func; - const char *file; /* not strictly needed in plain 'C' */ - cyg_uint32 lnum; /* nor this */ -#ifdef CYGDBG_INFRA_DEBUG_TRACE_MESSAGE - const char *exitmsg; - CYG_ADDRWORD exitvalue; - int exitset; -#endif - -}; - -#ifdef CYGDBG_INFRA_DEBUG_TRACE_MESSAGE - -#define CYG_REPORT_FUNCTION_ENTER_INTERNAL() CYG_MACRO_START \ - if ( cyg_tracefunction_report_.cond ) \ - cyg_tracemsg( cyg_trace_enter, \ - cyg_tracefunction_report_.func, \ - cyg_tracefunction_report_.file, \ - cyg_tracefunction_report_.lnum, \ - "enter" ); \ -CYG_MACRO_END - -#define CYG_REPORT_FUNCTION_CONSTRUCT( _c_, _fn_,_fl_,_l_,_xm_,_xv_,_xs_ ) \ - { _c_, _fn_, _fl_, _l_, _xm_, _xv_, _xs_ } - -#else // do not CYGDBG_INFRA_DEBUG_TRACE_MESSAGE - -#define CYG_REPORT_FUNCTION_ENTER_INTERNAL() CYG_MACRO_START \ - if ( cyg_tracefunction_report_.cond ) \ - cyg_tracenomsg( cyg_tracefunction_report_.func, \ - cyg_tracefunction_report_.file, \ - cyg_tracefunction_report_.lnum ); \ -CYG_MACRO_END - -#define CYG_REPORT_FUNCTION_CONSTRUCT( _c_, _fn_,_fl_,_l_,_xm_,_xv_,_xs_ ) \ - { _c_, _fn_, _fl_, _l_ } - -#endif // not CYGDBG_INFRA_DEBUG_TRACE_MESSAGE - -// These have no CYG_MACRO_START,END around because it is required -// that the scope of the object be the whole function body. Get it? - -// These are the unconditional versions: -#define CYG_REPORT_FUNCTION() \ - struct Cyg_TraceFunction_Report_ cyg_tracefunction_report_ = \ - CYG_REPORT_FUNCTION_CONSTRUCT( \ - 1, __PRETTY_FUNCTION__, __FILE__, __LINE__, NULL, 0, 0 ); \ - CYG_REPORT_FUNCTION_ENTER_INTERNAL() - -#define CYG_REPORT_FUNCTYPE( _exitmsg_ ) \ - struct Cyg_TraceFunction_Report_ cyg_tracefunction_report_ = \ - CYG_REPORT_FUNCTION_CONSTRUCT( \ - 1, __PRETTY_FUNCTION__, __FILE__, __LINE__, _exitmsg_, 0, 0 ); \ - CYG_REPORT_FUNCTION_ENTER_INTERNAL() - -#define CYG_REPORT_FUNCNAME( _name_ ) \ - struct Cyg_TraceFunction_Report_ cyg_tracefunction_report_ = \ - CYG_REPORT_FUNCTION_CONSTRUCT( \ - 1, _name_, __FILE__, __LINE__, NULL, 0, 0 ); \ - CYG_REPORT_FUNCTION_ENTER_INTERNAL() - -#define CYG_REPORT_FUNCNAMETYPE( _name_, _exitmsg_ ) \ - struct Cyg_TraceFunction_Report_ cyg_tracefunction_report_ = \ - CYG_REPORT_FUNCTION_CONSTRUCT( \ - 1, _name_, __FILE__, __LINE__, _exitmsg_, 0, 0 ); \ - CYG_REPORT_FUNCTION_ENTER_INTERNAL() - -// These are conditioned on macro CYG_REPORT_USER_BOOL -// (which you better have defined) -#define CYG_REPORT_FUNCTIONC() \ - struct Cyg_TraceFunction_Report_ cyg_tracefunction_report_ = \ - CYG_REPORT_FUNCTION_CONSTRUCT( \ - CYG_REPORT_USER_BOOL, \ - __PRETTY_FUNCTION__, __FILE__, __LINE__, NULL, 0, 0 ); \ - CYG_REPORT_FUNCTION_ENTER_INTERNAL() - -#define CYG_REPORT_FUNCTYPEC( _exitmsg_ ) \ - struct Cyg_TraceFunction_Report_ cyg_tracefunction_report_ = \ - CYG_REPORT_FUNCTION_CONSTRUCT( \ - CYG_REPORT_USER_BOOL, \ - __PRETTY_FUNCTION__, __FILE__, __LINE__, _exitmsg_, 0, 0 ); \ - CYG_REPORT_FUNCTION_ENTER_INTERNAL() - -#define CYG_REPORT_FUNCNAMEC( _name_ ) \ - struct Cyg_TraceFunction_Report_ cyg_tracefunction_report_ = \ - CYG_REPORT_FUNCTION_CONSTRUCT( \ - CYG_REPORT_USER_BOOL, \ - _name_, __FILE__, __LINE__, NULL, 0, 0 ); \ - CYG_REPORT_FUNCTION_ENTER_INTERNAL() - -#define CYG_REPORT_FUNCNAMETYPEC( _name_, _exitmsg_ ) \ - struct Cyg_TraceFunction_Report_ cyg_tracefunction_report_ = \ - CYG_REPORT_FUNCTION_CONSTRUCT( \ - CYG_REPORT_USER_BOOL, \ - _name_, __FILE__, __LINE__, _exitmsg_, 0, 0 ); \ - CYG_REPORT_FUNCTION_ENTER_INTERNAL() - -#ifdef CYGDBG_INFRA_DEBUG_TRACE_MESSAGE - -#define CYG_REPORT_RETURN() CYG_MACRO_START \ - CYG_ASSERT( NULL == cyg_tracefunction_report_.exitmsg, \ - "exitvoid used in typed function" ); \ - CYG_ASSERT( 0 == cyg_tracefunction_report_.exitset, \ - "exitvoid used when arg already set" ); \ - cyg_tracefunction_report_.lnum = __LINE__; \ - cyg_tracefunction_report_.exitset = 2; \ - if ( cyg_tracefunction_report_.cond ) \ - cyg_tracemsg( cyg_trace_return, \ - cyg_tracefunction_report_.func, \ - cyg_tracefunction_report_.file, \ - cyg_tracefunction_report_.lnum, \ - "return void" ); \ -CYG_MACRO_END - -#define CYG_REPORT_RETVAL( _value_ ) CYG_MACRO_START \ - CYG_ASSERT( 0 == cyg_tracefunction_report_.exitset, \ - "exitvalue used when arg already set" ); \ - cyg_tracefunction_report_.lnum = __LINE__; \ - cyg_tracefunction_report_.exitvalue = (CYG_ADDRWORD)(_value_); \ - cyg_tracefunction_report_.exitset = 1; \ - if ( cyg_tracefunction_report_.cond ) \ - cyg_tracemsg2( cyg_trace_return, \ - cyg_tracefunction_report_.func, \ - cyg_tracefunction_report_.file, \ - cyg_tracefunction_report_.lnum, \ - cyg_tracefunction_report_.exitmsg ? \ - cyg_tracefunction_report_.exitmsg : \ - "return %08x", \ - cyg_tracefunction_report_.exitvalue, 0 ); \ -CYG_MACRO_END - -#else // do not CYGDBG_INFRA_DEBUG_TRACE_MESSAGE - -#define CYG_REPORT_RETURN() CYG_MACRO_START \ - cyg_tracefunction_report_.lnum = __LINE__; \ - if ( cyg_tracefunction_report_.cond ) \ - cyg_tracenomsg( cyg_tracefunction_report_.func, \ - cyg_tracefunction_report_.file, \ - cyg_tracefunction_report_.lnum ); \ -CYG_MACRO_END - -#define CYG_REPORT_RETVAL( _value_ ) CYG_MACRO_START \ - CYG_REPORT_RETURN(); \ -CYG_MACRO_END - -#endif // not CYGDBG_INFRA_DEBUG_TRACE_MESSAGE - -#endif // not __cplusplus - -#ifdef CYGDBG_INFRA_DEBUG_TRACE_MESSAGE - -#define CYG_REPORT_FUNCARGVOID() CYG_MACRO_START \ - if ( cyg_tracefunction_report_.cond ) \ - cyg_tracemsg( cyg_trace_args, \ - cyg_tracefunction_report_.func, \ - cyg_tracefunction_report_.file, \ - cyg_tracefunction_report_.lnum, \ - "(void)" \ - ); \ -CYG_MACRO_END - -#define CYG_REPORT_FUNCARG1( _format_, a ) CYG_MACRO_START \ - if ( cyg_tracefunction_report_.cond ) \ - cyg_tracemsg2( cyg_trace_args, \ - cyg_tracefunction_report_.func, \ - cyg_tracefunction_report_.file, \ - cyg_tracefunction_report_.lnum, \ - (_format_), \ - (CYG_ADDRWORD)a , 0 \ - ); \ -CYG_MACRO_END - -#define CYG_REPORT_FUNCARG2( _format_, a,b ) CYG_MACRO_START \ - if ( cyg_tracefunction_report_.cond ) \ - cyg_tracemsg2( cyg_trace_args, \ - cyg_tracefunction_report_.func, \ - cyg_tracefunction_report_.file, \ - cyg_tracefunction_report_.lnum, \ - (_format_), \ - (CYG_ADDRWORD)a, (CYG_ADDRWORD)b \ - ); \ -CYG_MACRO_END - -#define CYG_REPORT_FUNCARG3( _format_, a,b,c ) CYG_MACRO_START \ - if ( cyg_tracefunction_report_.cond ) \ - cyg_tracemsg4( cyg_trace_args, \ - cyg_tracefunction_report_.func, \ - cyg_tracefunction_report_.file, \ - cyg_tracefunction_report_.lnum, \ - (_format_), \ - (CYG_ADDRWORD)a, (CYG_ADDRWORD)b, \ - (CYG_ADDRWORD)c , 0 \ - ); \ -CYG_MACRO_END - -#define CYG_REPORT_FUNCARG4( _format_, a,b,c,d ) CYG_MACRO_START \ - if ( cyg_tracefunction_report_.cond ) \ - cyg_tracemsg4( cyg_trace_args, \ - cyg_tracefunction_report_.func, \ - cyg_tracefunction_report_.file, \ - cyg_tracefunction_report_.lnum, \ - (_format_), \ - (CYG_ADDRWORD)a, (CYG_ADDRWORD)b, \ - (CYG_ADDRWORD)c, (CYG_ADDRWORD)d \ - ); \ -CYG_MACRO_END - -#define CYG_REPORT_FUNCARG5( _format_, a,b,c,d,e ) CYG_MACRO_START \ - if ( cyg_tracefunction_report_.cond ) \ - cyg_tracemsg6( cyg_trace_args, \ - cyg_tracefunction_report_.func, \ - cyg_tracefunction_report_.file, \ - cyg_tracefunction_report_.lnum, \ - (_format_), \ - (CYG_ADDRWORD)a, (CYG_ADDRWORD)b, \ - (CYG_ADDRWORD)c, (CYG_ADDRWORD)d, \ - (CYG_ADDRWORD)e , 0 \ - ); \ -CYG_MACRO_END - -#define CYG_REPORT_FUNCARG6( _format_, a,b,c,d,e,f ) CYG_MACRO_START \ - if ( cyg_tracefunction_report_.cond ) \ - cyg_tracemsg6( cyg_trace_args, \ - cyg_tracefunction_report_.func, \ - cyg_tracefunction_report_.file, \ - cyg_tracefunction_report_.lnum, \ - (_format_), \ - (CYG_ADDRWORD)a, (CYG_ADDRWORD)b, \ - (CYG_ADDRWORD)c, (CYG_ADDRWORD)d, \ - (CYG_ADDRWORD)e, (CYG_ADDRWORD)f \ - ); \ -CYG_MACRO_END - -#define CYG_REPORT_FUNCARG7( _format_, a,b,c,d,e,f,g ) CYG_MACRO_START \ - if ( cyg_tracefunction_report_.cond ) \ - cyg_tracemsg8( cyg_trace_args, \ - cyg_tracefunction_report_.func, \ - cyg_tracefunction_report_.file, \ - cyg_tracefunction_report_.lnum, \ - (_format_), \ - (CYG_ADDRWORD)a, (CYG_ADDRWORD)b, \ - (CYG_ADDRWORD)c, (CYG_ADDRWORD)d, \ - (CYG_ADDRWORD)e, (CYG_ADDRWORD)f, \ - (CYG_ADDRWORD)g , 0 \ - ); \ -CYG_MACRO_END - -#define CYG_REPORT_FUNCARG8( _format_, a,b,c,d,e,f,g,h ) CYG_MACRO_START\ - if ( cyg_tracefunction_report_.cond ) \ - cyg_tracemsg8( cyg_trace_args, \ - cyg_tracefunction_report_.func, \ - cyg_tracefunction_report_.file, \ - cyg_tracefunction_report_.lnum, \ - (_format_), \ - (CYG_ADDRWORD)a, (CYG_ADDRWORD)b, \ - (CYG_ADDRWORD)c, (CYG_ADDRWORD)d, \ - (CYG_ADDRWORD)e, (CYG_ADDRWORD)f, \ - (CYG_ADDRWORD)g, (CYG_ADDRWORD)h \ - ); \ -CYG_MACRO_END - - -#else // do not CYGDBG_INFRA_DEBUG_TRACE_MESSAGE - -#define CYG_REPORT_FUNCARGVOID() CYG_EMPTY_STATEMENT -#define CYG_REPORT_FUNCARG1( _format_, a ) CYG_EMPTY_STATEMENT -#define CYG_REPORT_FUNCARG2( _format_, a,b ) CYG_EMPTY_STATEMENT -#define CYG_REPORT_FUNCARG3( _format_, a,b,c ) CYG_EMPTY_STATEMENT -#define CYG_REPORT_FUNCARG4( _format_, a,b,c,d ) CYG_EMPTY_STATEMENT -#define CYG_REPORT_FUNCARG5( _format_, a,b,c,d,e ) CYG_EMPTY_STATEMENT -#define CYG_REPORT_FUNCARG6( _format_, a,b,c,d,e,f ) CYG_EMPTY_STATEMENT -#define CYG_REPORT_FUNCARG7( _format_, a,b,c,d,e,f,g ) CYG_EMPTY_STATEMENT -#define CYG_REPORT_FUNCARG8( _format_, a,b,c,d,e,f,g,h ) CYG_EMPTY_STATEMENT - -#endif // not CYGDBG_INFRA_DEBUG_TRACE_MESSAGE - -#else // no CYGDBG_INFRA_DEBUG_FUNCTION_REPORTS - -#define CYG_REPORT_FUNCTION() CYG_EMPTY_STATEMENT -#define CYG_REPORT_FUNCTYPE( _exitmsg_ ) CYG_EMPTY_STATEMENT -#define CYG_REPORT_FUNCNAME( _name_ ) CYG_EMPTY_STATEMENT -#define CYG_REPORT_FUNCNAMETYPE( _name_, _exitmsg_ ) CYG_EMPTY_STATEMENT - -#define CYG_REPORT_FUNCTIONC() CYG_EMPTY_STATEMENT -#define CYG_REPORT_FUNCTYPEC( _exitmsg_ ) CYG_EMPTY_STATEMENT -#define CYG_REPORT_FUNCNAMEC( _name_ ) CYG_EMPTY_STATEMENT -#define CYG_REPORT_FUNCNAMETYPEC( _name_, _exitmsg_ ) CYG_EMPTY_STATEMENT - -#define CYG_REPORT_FUNCARGVOID() CYG_EMPTY_STATEMENT -#define CYG_REPORT_FUNCARG1( _format_, a ) CYG_EMPTY_STATEMENT -#define CYG_REPORT_FUNCARG2( _format_, a,b ) CYG_EMPTY_STATEMENT -#define CYG_REPORT_FUNCARG3( _format_, a,b,c ) CYG_EMPTY_STATEMENT -#define CYG_REPORT_FUNCARG4( _format_, a,b,c,d ) CYG_EMPTY_STATEMENT -#define CYG_REPORT_FUNCARG5( _format_, a,b,c,d,e ) CYG_EMPTY_STATEMENT -#define CYG_REPORT_FUNCARG6( _format_, a,b,c,d,e,f ) CYG_EMPTY_STATEMENT -#define CYG_REPORT_FUNCARG7( _format_, a,b,c,d,e,f,g ) CYG_EMPTY_STATEMENT -#define CYG_REPORT_FUNCARG8( _format_, a,b,c,d,e,f,g,h ) CYG_EMPTY_STATEMENT - -#define CYG_REPORT_RETURN() CYG_EMPTY_STATEMENT -#define CYG_REPORT_RETVAL( _value_ ) CYG_EMPTY_STATEMENT - -#endif // CYGDBG_INFRA_DEBUG_FUNCTION_REPORTS - -#else // ! CYGDBG_USE_TRACING - -// ------------------------------------------------------------------------- -// No traces: we define empty statements for trace macros. - -#define CYG_TRACE0( _bool_, _msg_ ) CYG_EMPTY_STATEMENT -#define CYG_TRACE1( _bool_, _msg_, a ) CYG_EMPTY_STATEMENT -#define CYG_TRACE2( _bool_, _msg_, a,b ) CYG_EMPTY_STATEMENT -#define CYG_TRACE3( _bool_, _msg_, a,b,c ) CYG_EMPTY_STATEMENT -#define CYG_TRACE4( _bool_, _msg_, a,b,c,d ) CYG_EMPTY_STATEMENT -#define CYG_TRACE5( _bool_, _msg_, a,b,c,d,e ) CYG_EMPTY_STATEMENT -#define CYG_TRACE6( _bool_, _msg_, a,b,c,d,e,f ) CYG_EMPTY_STATEMENT -#define CYG_TRACE7( _bool_, _msg_, a,b,c,d,e,f,g ) CYG_EMPTY_STATEMENT -#define CYG_TRACE8( _bool_, _msg_, a,b,c,d,e,f,g,h ) CYG_EMPTY_STATEMENT - -#define CYG_REPORT_FUNCTION() CYG_EMPTY_STATEMENT -#define CYG_REPORT_FUNCTYPE( _exitmsg_ ) CYG_EMPTY_STATEMENT -#define CYG_REPORT_FUNCNAME( _name_ ) CYG_EMPTY_STATEMENT -#define CYG_REPORT_FUNCNAMETYPE( _name_, _exitmsg_ ) CYG_EMPTY_STATEMENT - -#define CYG_REPORT_FUNCTIONC() CYG_EMPTY_STATEMENT -#define CYG_REPORT_FUNCTYPEC( _exitmsg_ ) CYG_EMPTY_STATEMENT -#define CYG_REPORT_FUNCNAMEC( _name_ ) CYG_EMPTY_STATEMENT -#define CYG_REPORT_FUNCNAMETYPEC( _name_, _exitmsg_ ) CYG_EMPTY_STATEMENT - -#define CYG_REPORT_FUNCARGVOID() CYG_EMPTY_STATEMENT -#define CYG_REPORT_FUNCARG1( _format_, a ) CYG_EMPTY_STATEMENT -#define CYG_REPORT_FUNCARG2( _format_, a,b ) CYG_EMPTY_STATEMENT -#define CYG_REPORT_FUNCARG3( _format_, a,b,c ) CYG_EMPTY_STATEMENT -#define CYG_REPORT_FUNCARG4( _format_, a,b,c,d ) CYG_EMPTY_STATEMENT -#define CYG_REPORT_FUNCARG5( _format_, a,b,c,d,e ) CYG_EMPTY_STATEMENT -#define CYG_REPORT_FUNCARG6( _format_, a,b,c,d,e,f ) CYG_EMPTY_STATEMENT -#define CYG_REPORT_FUNCARG7( _format_, a,b,c,d,e,f,g ) CYG_EMPTY_STATEMENT -#define CYG_REPORT_FUNCARG8( _format_, a,b,c,d,e,f,g,h ) CYG_EMPTY_STATEMENT - -#define CYG_REPORT_RETURN() CYG_EMPTY_STATEMENT -#define CYG_REPORT_RETVAL( _value_ ) CYG_EMPTY_STATEMENT - -#define CYG_TRACE_PRINT() CYG_EMPTY_STATEMENT -#define CYG_TRACE_DUMP() CYG_EMPTY_STATEMENT - -#endif // ! CYGDBG_USE_TRACING - -// ------------------------------------------------------------------------- -// -// CYG_TRACEn{[XDY]{V}}{B} -// -// Convenience macros: these fall into a few dimensions, with suffix letters: -// First option: -// X: user need not supply a format string, %08x is used -// D: ditto but signed decimal, %d -// Y: ditto but just plain %x -// Second option, only meaningful with one of XDY: -// V: " = %..." is used, by stringifying the argument -// Third option: -// B: user need not supply a bool; the symbol CYG_TRACE_USER_BOOL is -// used (which we do not define, user must do this) - -#define CYG_TRACE0B( _msg_ ) \ - CYG_TRACE0( CYG_TRACE_USER_BOOL, _msg_ ) -#define CYG_TRACE1B( _msg_, a ) \ - CYG_TRACE1( CYG_TRACE_USER_BOOL, _msg_, a ) -#define CYG_TRACE2B( _msg_, a,b ) \ - CYG_TRACE2( CYG_TRACE_USER_BOOL, _msg_, a,b ) -#define CYG_TRACE3B( _msg_, a,b,c ) \ - CYG_TRACE3( CYG_TRACE_USER_BOOL, _msg_, a,b,c ) -#define CYG_TRACE4B( _msg_, a,b,c,d ) \ - CYG_TRACE4( CYG_TRACE_USER_BOOL, _msg_, a,b,c,d ) -#define CYG_TRACE5B( _msg_, a,b,c,d,e ) \ - CYG_TRACE5( CYG_TRACE_USER_BOOL, _msg_, a,b,c,d,e ) -#define CYG_TRACE6B( _msg_, a,b,c,d,e,f ) \ - CYG_TRACE6( CYG_TRACE_USER_BOOL, _msg_, a,b,c,d,e,f ) -#define CYG_TRACE7B( _msg_, a,b,c,d,e,f,g ) \ - CYG_TRACE7( CYG_TRACE_USER_BOOL, _msg_, a,b,c,d,e,f,g ) -#define CYG_TRACE8B( _msg_, a,b,c,d,e,f,g,h ) \ - CYG_TRACE8( CYG_TRACE_USER_BOOL, _msg_, a,b,c,d,e,f,g,h ) - -// long hex versions - -#define CYG_TRACE1X( _bool_, a ) \ - CYG_TRACE1( _bool_, "%08x", a ) -#define CYG_TRACE2X( _bool_, a,b ) \ - CYG_TRACE2( _bool_, "%08x %08x", a,b ) -#define CYG_TRACE3X( _bool_, a,b,c ) \ - CYG_TRACE3( _bool_, "%08x %08x %08x", a,b,c ) -#define CYG_TRACE4X( _bool_, a,b,c,d ) \ - CYG_TRACE4( _bool_, "%08x %08x %08x %08x", a,b,c,d ) -#define CYG_TRACE5X( _bool_, a,b,c,d,e ) \ - CYG_TRACE5( _bool_, "%08x %08x %08x %08x %08x", a,b,c,d,e ) -#define CYG_TRACE6X( _bool_, a,b,c,d,e,f ) \ - CYG_TRACE6( _bool_, "%08x %08x %08x %08x %08x %08x", \ - a,b,c,d,e,f ) -#define CYG_TRACE7X( _bool_, a,b,c,d,e,f,g ) \ - CYG_TRACE7( _bool_, "%08x %08x %08x %08x %08x %08x %08x", \ - a,b,c,d,e,f,g ) -#define CYG_TRACE8X( _bool_, a,b,c,d,e,f,g,h ) \ - CYG_TRACE8( _bool_, "%08x %08x %08x %08x %08x %08x %08x %08x", \ - a,b,c,d,e,f,g,h ) - -#define CYG_TRACE1XV( _bool_, a ) \ - CYG_TRACE1( _bool_, # a "=%08x ", a ) -#define CYG_TRACE2XV( _bool_, a,b ) \ - CYG_TRACE2( _bool_, \ - # a "=%08x " # b "=%08x " , a,b ) -#define CYG_TRACE3XV( _bool_, a,b,c ) \ - CYG_TRACE3( _bool_, \ - # a "=%08x " # b "=%08x " # c "=%08x " , a,b,c ) -#define CYG_TRACE4XV( _bool_, a,b,c,d ) \ - CYG_TRACE4( _bool_, \ - # a "=%08x " # b "=%08x " # c "=%08x " # d "=%08x " \ - , a,b,c,d ) -#define CYG_TRACE5XV( _bool_, a,b,c,d,e ) \ - CYG_TRACE5( _bool_, \ - # a "=%08x " # b "=%08x " # c "=%08x " # d "=%08x " \ - # e "=%08x " \ - , a,b,c,d,e ) -#define CYG_TRACE6XV( _bool_, a,b,c,d,e,f ) \ - CYG_TRACE6( _bool_, \ - # a "=%08x " # b "=%08x " # c "=%08x " # d "=%08x " \ - # e "=%08x " # f "=%08x " \ - , a,b,c,d,e,f ) -#define CYG_TRACE7XV( _bool_, a,b,c,d,e,f,g ) \ - CYG_TRACE7( _bool_, \ - # a "=%08x " # b "=%08x " # c "=%08x " # d "=%08x " \ - # e "=%08x " # f "=%08x " # g "=%08x " \ - , a,b,c,d,e,f,g ) -#define CYG_TRACE8XV( _bool_, a,b,c,d,e,f,g,h ) \ - CYG_TRACE8( _bool_, \ - # a "=%08x " # b "=%08x " # c "=%08x " # d "=%08x " \ - # e "=%08x " # f "=%08x " # g "=%08x " # h "=%08x " \ - , a,b,c,d,e,f,g,h ) - -#define CYG_TRACE1XB( a ) \ - CYG_TRACE1( CYG_TRACE_USER_BOOL, "%08x", a ) -#define CYG_TRACE2XB( a,b ) \ - CYG_TRACE2( CYG_TRACE_USER_BOOL, "%08x %08x", a,b ) -#define CYG_TRACE3XB( a,b,c ) \ - CYG_TRACE3( CYG_TRACE_USER_BOOL, "%08x %08x %08x", a,b,c ) -#define CYG_TRACE4XB( a,b,c,d ) \ - CYG_TRACE4( CYG_TRACE_USER_BOOL, "%08x %08x %08x %08x", a,b,c,d ) -#define CYG_TRACE5XB( a,b,c,d,e ) \ - CYG_TRACE5( CYG_TRACE_USER_BOOL, "%08x %08x %08x %08x %08x", a,b,c,d,e ) -#define CYG_TRACE6XB( a,b,c,d,e,f ) \ - CYG_TRACE6( CYG_TRACE_USER_BOOL, "%08x %08x %08x %08x %08x %08x", \ - a,b,c,d,e,f ) -#define CYG_TRACE7XB( a,b,c,d,e,f,g ) \ - CYG_TRACE7( CYG_TRACE_USER_BOOL, "%08x %08x %08x %08x %08x %08x %08x", \ - a,b,c,d,e,f,g ) -#define CYG_TRACE8XB( a,b,c,d,e,f,g,h ) \ - CYG_TRACE8( CYG_TRACE_USER_BOOL, "%08x %08x %08x %08x %08x %08x %08x %08x", \ - a,b,c,d,e,f,g,h ) - -#define CYG_TRACE1XVB( a ) \ - CYG_TRACE1( CYG_TRACE_USER_BOOL, # a "=%08x ", a ) -#define CYG_TRACE2XVB( a,b ) \ - CYG_TRACE2( CYG_TRACE_USER_BOOL, \ - # a "=%08x " # b "=%08x " , a,b ) -#define CYG_TRACE3XVB( a,b,c ) \ - CYG_TRACE3( CYG_TRACE_USER_BOOL, \ - # a "=%08x " # b "=%08x " # c "=%08x " , a,b,c ) -#define CYG_TRACE4XVB( a,b,c,d ) \ - CYG_TRACE4( CYG_TRACE_USER_BOOL, \ - # a "=%08x " # b "=%08x " # c "=%08x " # d "=%08x " \ - , a,b,c,d ) -#define CYG_TRACE5XVB( a,b,c,d,e ) \ - CYG_TRACE5( CYG_TRACE_USER_BOOL, \ - # a "=%08x " # b "=%08x " # c "=%08x " # d "=%08x " \ - # e "=%08x " \ - , a,b,c,d,e ) -#define CYG_TRACE6XVB( a,b,c,d,e,f ) \ - CYG_TRACE6( CYG_TRACE_USER_BOOL, \ - # a "=%08x " # b "=%08x " # c "=%08x " # d "=%08x " \ - # e "=%08x " # f "=%08x " \ - , a,b,c,d,e,f ) -#define CYG_TRACE7XVB( a,b,c,d,e,f,g ) \ - CYG_TRACE7( CYG_TRACE_USER_BOOL, \ - # a "=%08x " # b "=%08x " # c "=%08x " # d "=%08x " \ - # e "=%08x " # f "=%08x " # g "=%08x " \ - , a,b,c,d,e,f,g ) -#define CYG_TRACE8XVB( a,b,c,d,e,f,g,h ) \ - CYG_TRACE8( CYG_TRACE_USER_BOOL, \ - # a "=%08x " # b "=%08x " # c "=%08x " # d "=%08x " \ - # e "=%08x " # f "=%08x " # g "=%08x " # h "=%08x " \ - , a,b,c,d,e,f,g,h ) - -// decimal versions - -#define CYG_TRACE1D( _bool_, a ) \ - CYG_TRACE1( _bool_, "%d", a ) -#define CYG_TRACE2D( _bool_, a,b ) \ - CYG_TRACE2( _bool_, "%d %d", a,b ) -#define CYG_TRACE3D( _bool_, a,b,c ) \ - CYG_TRACE3( _bool_, "%d %d %d", a,b,c ) -#define CYG_TRACE4D( _bool_, a,b,c,d ) \ - CYG_TRACE4( _bool_, "%d %d %d %d", a,b,c,d ) -#define CYG_TRACE5D( _bool_, a,b,c,d,e ) \ - CYG_TRACE5( _bool_, "%d %d %d %d %d", a,b,c,d,e ) -#define CYG_TRACE6D( _bool_, a,b,c,d,e,f ) \ - CYG_TRACE6( _bool_, "%d %d %d %d %d %d", \ - a,b,c,d,e,f ) -#define CYG_TRACE7D( _bool_, a,b,c,d,e,f,g ) \ - CYG_TRACE7( _bool_, "%d %d %d %d %d %d %d", \ - a,b,c,d,e,f,g ) -#define CYG_TRACE8D( _bool_, a,b,c,d,e,f,g,h ) \ - CYG_TRACE8( _bool_, "%d %d %d %d %d %d %d %d", \ - a,b,c,d,e,f,g,h ) - -#define CYG_TRACE1DV( _bool_, a ) \ - CYG_TRACE1( _bool_, # a "=%d ", a ) -#define CYG_TRACE2DV( _bool_, a,b ) \ - CYG_TRACE2( _bool_, \ - # a "=%d " # b "=%d " , a,b ) -#define CYG_TRACE3DV( _bool_, a,b,c ) \ - CYG_TRACE3( _bool_, \ - # a "=%d " # b "=%d " # c "=%d " , a,b,c ) -#define CYG_TRACE4DV( _bool_, a,b,c,d ) \ - CYG_TRACE4( _bool_, \ - # a "=%d " # b "=%d " # c "=%d " # d "=%d " \ - , a,b,c,d ) -#define CYG_TRACE5DV( _bool_, a,b,c,d,e ) \ - CYG_TRACE5( _bool_, \ - # a "=%d " # b "=%d " # c "=%d " # d "=%d " \ - # e "=%d " \ - , a,b,c,d,e ) -#define CYG_TRACE6DV( _bool_, a,b,c,d,e,f ) \ - CYG_TRACE6( _bool_, \ - # a "=%d " # b "=%d " # c "=%d " # d "=%d " \ - # e "=%d " # f "=%d " \ - , a,b,c,d,e,f ) -#define CYG_TRACE7DV( _bool_, a,b,c,d,e,f,g ) \ - CYG_TRACE7( _bool_, \ - # a "=%d " # b "=%d " # c "=%d " # d "=%d " \ - # e "=%d " # f "=%d " # g "=%d " \ - , a,b,c,d,e,f,g ) -#define CYG_TRACE8DV( _bool_, a,b,c,d,e,f,g,h ) \ - CYG_TRACE8( _bool_, \ - # a "=%d " # b "=%d " # c "=%d " # d "=%d " \ - # e "=%d " # f "=%d " # g "=%d " # h "=%d " \ - , a,b,c,d,e,f,g,h ) - -#define CYG_TRACE1DB( a ) \ - CYG_TRACE1( CYG_TRACE_USER_BOOL, "%d", a ) -#define CYG_TRACE2DB( a,b ) \ - CYG_TRACE2( CYG_TRACE_USER_BOOL, "%d %d", a,b ) -#define CYG_TRACE3DB( a,b,c ) \ - CYG_TRACE3( CYG_TRACE_USER_BOOL, "%d %d %d", a,b,c ) -#define CYG_TRACE4DB( a,b,c,d ) \ - CYG_TRACE4( CYG_TRACE_USER_BOOL, "%d %d %d %d", a,b,c,d ) -#define CYG_TRACE5DB( a,b,c,d,e ) \ - CYG_TRACE5( CYG_TRACE_USER_BOOL, "%d %d %d %d %d", a,b,c,d,e ) -#define CYG_TRACE6DB( a,b,c,d,e,f ) \ - CYG_TRACE6( CYG_TRACE_USER_BOOL, "%d %d %d %d %d %d", \ - a,b,c,d,e,f ) -#define CYG_TRACE7DB( a,b,c,d,e,f,g ) \ - CYG_TRACE7( CYG_TRACE_USER_BOOL, "%d %d %d %d %d %d %d", \ - a,b,c,d,e,f,g ) -#define CYG_TRACE8DB( a,b,c,d,e,f,g,h ) \ - CYG_TRACE8( CYG_TRACE_USER_BOOL, "%d %d %d %d %d %d %d %d", \ - a,b,c,d,e,f,g,h ) - -#define CYG_TRACE1DVB( a ) \ - CYG_TRACE1( CYG_TRACE_USER_BOOL, # a "=%d ", a ) -#define CYG_TRACE2DVB( a,b ) \ - CYG_TRACE2( CYG_TRACE_USER_BOOL, \ - # a "=%d " # b "=%d " , a,b ) -#define CYG_TRACE3DVB( a,b,c ) \ - CYG_TRACE3( CYG_TRACE_USER_BOOL, \ - # a "=%d " # b "=%d " # c "=%d " , a,b,c ) -#define CYG_TRACE4DVB( a,b,c,d ) \ - CYG_TRACE4( CYG_TRACE_USER_BOOL, \ - # a "=%d " # b "=%d " # c "=%d " # d "=%d " \ - , a,b,c,d ) -#define CYG_TRACE5DVB( a,b,c,d,e ) \ - CYG_TRACE5( CYG_TRACE_USER_BOOL, \ - # a "=%d " # b "=%d " # c "=%d " # d "=%d " \ - # e "=%d " \ - , a,b,c,d,e ) -#define CYG_TRACE6DVB( a,b,c,d,e,f ) \ - CYG_TRACE6( CYG_TRACE_USER_BOOL, \ - # a "=%d " # b "=%d " # c "=%d " # d "=%d " \ - # e "=%d " # f "=%d " \ - , a,b,c,d,e,f ) -#define CYG_TRACE7DVB( a,b,c,d,e,f,g ) \ - CYG_TRACE7( CYG_TRACE_USER_BOOL, \ - # a "=%d " # b "=%d " # c "=%d " # d "=%d " \ - # e "=%d " # f "=%d " # g "=%d " \ - , a,b,c,d,e,f,g ) -#define CYG_TRACE8DVB( a,b,c,d,e,f,g,h ) \ - CYG_TRACE8( CYG_TRACE_USER_BOOL, \ - # a "=%d " # b "=%d " # c "=%d " # d "=%d " \ - # e "=%d " # f "=%d " # g "=%d " # h "=%d " \ - , a,b,c,d,e,f,g,h ) - -// short hex versions - -#define CYG_TRACE1Y( _bool_, a ) \ - CYG_TRACE1( _bool_, "%x", a ) -#define CYG_TRACE2Y( _bool_, a,b ) \ - CYG_TRACE2( _bool_, "%x %x", a,b ) -#define CYG_TRACE3Y( _bool_, a,b,c ) \ - CYG_TRACE3( _bool_, "%x %x %x", a,b,c ) -#define CYG_TRACE4Y( _bool_, a,b,c,d ) \ - CYG_TRACE4( _bool_, "%x %x %x %x", a,b,c,d ) -#define CYG_TRACE5Y( _bool_, a,b,c,d,e ) \ - CYG_TRACE5( _bool_, "%x %x %x %x %x", a,b,c,d,e ) -#define CYG_TRACE6Y( _bool_, a,b,c,d,e,f ) \ - CYG_TRACE6( _bool_, "%x %x %x %x %x %x", \ - a,b,c,d,e,f ) -#define CYG_TRACE7Y( _bool_, a,b,c,d,e,f,g ) \ - CYG_TRACE7( _bool_, "%x %x %x %x %x %x %x", \ - a,b,c,d,e,f,g ) -#define CYG_TRACE8Y( _bool_, a,b,c,d,e,f,g,h ) \ - CYG_TRACE8( _bool_, "%x %x %x %x %x %x %x %x", \ - a,b,c,d,e,f,g,h ) - -#define CYG_TRACE1YV( _bool_, a ) \ - CYG_TRACE1( _bool_, # a "=%x ", a ) -#define CYG_TRACE2YV( _bool_, a,b ) \ - CYG_TRACE2( _bool_, \ - # a "=%x " # b "=%x " , a,b ) -#define CYG_TRACE3YV( _bool_, a,b,c ) \ - CYG_TRACE3( _bool_, \ - # a "=%x " # b "=%x " # c "=%x " , a,b,c ) -#define CYG_TRACE4YV( _bool_, a,b,c,d ) \ - CYG_TRACE4( _bool_, \ - # a "=%x " # b "=%x " # c "=%x " # d "=%x " \ - , a,b,c,d ) -#define CYG_TRACE5YV( _bool_, a,b,c,d,e ) \ - CYG_TRACE5( _bool_, \ - # a "=%x " # b "=%x " # c "=%x " # d "=%x " \ - # e "=%x " \ - , a,b,c,d,e ) -#define CYG_TRACE6YV( _bool_, a,b,c,d,e,f ) \ - CYG_TRACE6( _bool_, \ - # a "=%x " # b "=%x " # c "=%x " # d "=%x " \ - # e "=%x " # f "=%x " \ - , a,b,c,d,e,f ) -#define CYG_TRACE7YV( _bool_, a,b,c,d,e,f,g ) \ - CYG_TRACE7( _bool_, \ - # a "=%x " # b "=%x " # c "=%x " # d "=%x " \ - # e "=%x " # f "=%x " # g "=%x " \ - , a,b,c,d,e,f,g ) -#define CYG_TRACE8YV( _bool_, a,b,c,d,e,f,g,h ) \ - CYG_TRACE8( _bool_, \ - # a "=%x " # b "=%x " # c "=%x " # d "=%x " \ - # e "=%x " # f "=%x " # g "=%x " # h "=%x " \ - , a,b,c,d,e,f,g,h ) - -#define CYG_TRACE1YB( a ) \ - CYG_TRACE1( CYG_TRACE_USER_BOOL, "%x", a ) -#define CYG_TRACE2YB( a,b ) \ - CYG_TRACE2( CYG_TRACE_USER_BOOL, "%x %x", a,b ) -#define CYG_TRACE3YB( a,b,c ) \ - CYG_TRACE3( CYG_TRACE_USER_BOOL, "%x %x %x", a,b,c ) -#define CYG_TRACE4YB( a,b,c,d ) \ - CYG_TRACE4( CYG_TRACE_USER_BOOL, "%x %x %x %x", a,b,c,d ) -#define CYG_TRACE5YB( a,b,c,d,e ) \ - CYG_TRACE5( CYG_TRACE_USER_BOOL, "%x %x %x %x %x", a,b,c,d,e ) -#define CYG_TRACE6YB( a,b,c,d,e,f ) \ - CYG_TRACE6( CYG_TRACE_USER_BOOL, "%x %x %x %x %x %x", \ - a,b,c,d,e,f ) -#define CYG_TRACE7YB( a,b,c,d,e,f,g ) \ - CYG_TRACE7( CYG_TRACE_USER_BOOL, "%x %x %x %x %x %x %x", \ - a,b,c,d,e,f,g ) -#define CYG_TRACE8YB( a,b,c,d,e,f,g,h ) \ - CYG_TRACE8( CYG_TRACE_USER_BOOL, "%x %x %x %x %x %x %x %x", \ - a,b,c,d,e,f,g,h ) - -#define CYG_TRACE1YVB( a ) \ - CYG_TRACE1( CYG_TRACE_USER_BOOL, # a "=%x ", a ) -#define CYG_TRACE2YVB( a,b ) \ - CYG_TRACE2( CYG_TRACE_USER_BOOL, \ - # a "=%x " # b "=%x " , a,b ) -#define CYG_TRACE3YVB( a,b,c ) \ - CYG_TRACE3( CYG_TRACE_USER_BOOL, \ - # a "=%x " # b "=%x " # c "=%x " , a,b,c ) -#define CYG_TRACE4YVB( a,b,c,d ) \ - CYG_TRACE4( CYG_TRACE_USER_BOOL, \ - # a "=%x " # b "=%x " # c "=%x " # d "=%x " \ - , a,b,c,d ) -#define CYG_TRACE5YVB( a,b,c,d,e ) \ - CYG_TRACE5( CYG_TRACE_USER_BOOL, \ - # a "=%x " # b "=%x " # c "=%x " # d "=%x " \ - # e "=%x " \ - , a,b,c,d,e ) -#define CYG_TRACE6YVB( a,b,c,d,e,f ) \ - CYG_TRACE6( CYG_TRACE_USER_BOOL, \ - # a "=%x " # b "=%x " # c "=%x " # d "=%x " \ - # e "=%x " # f "=%x " \ - , a,b,c,d,e,f ) -#define CYG_TRACE7YVB( a,b,c,d,e,f,g ) \ - CYG_TRACE7( CYG_TRACE_USER_BOOL, \ - # a "=%x " # b "=%x " # c "=%x " # d "=%x " \ - # e "=%x " # f "=%x " # g "=%x " \ - , a,b,c,d,e,f,g ) -#define CYG_TRACE8YVB( a,b,c,d,e,f,g,h ) \ - CYG_TRACE8( CYG_TRACE_USER_BOOL, \ - # a "=%x " # b "=%x " # c "=%x " # d "=%x " \ - # e "=%x " # f "=%x " # g "=%x " # h "=%x " \ - , a,b,c,d,e,f,g,h ) - -// ------------------------------------------------------------------------- -// -// CYG_REPORT_FUNCARGn{[XDY]{V}} -// -// Convenience macros two: these fall into a few dimensions, with suffix letters: -// First option: -// X: user need not supply a format string, %08x is used -// D: ditto but signed decimal, %d -// Y: ditto but just plain %x -// Second option, only meaningful with one of XDY: -// V: " = %..." is used, by stringifying the argument - -// long hex versions - -#define CYG_REPORT_FUNCARG1X( a ) \ - CYG_REPORT_FUNCARG1( "%08x", a ) -#define CYG_REPORT_FUNCARG2X( a,b ) \ - CYG_REPORT_FUNCARG2( "%08x %08x", a,b ) -#define CYG_REPORT_FUNCARG3X( a,b,c ) \ - CYG_REPORT_FUNCARG3( "%08x %08x %08x", a,b,c ) -#define CYG_REPORT_FUNCARG4X( a,b,c,d ) \ - CYG_REPORT_FUNCARG4( "%08x %08x %08x %08x", a,b,c,d ) -#define CYG_REPORT_FUNCARG5X( a,b,c,d,e ) \ - CYG_REPORT_FUNCARG5( "%08x %08x %08x %08x %08x", a,b,c,d,e ) -#define CYG_REPORT_FUNCARG6X( a,b,c,d,e,f ) \ - CYG_REPORT_FUNCARG6( "%08x %08x %08x %08x %08x %08x", \ - a,b,c,d,e,f ) -#define CYG_REPORT_FUNCARG7X( a,b,c,d,e,f,g ) \ - CYG_REPORT_FUNCARG7( "%08x %08x %08x %08x %08x %08x %08x", \ - a,b,c,d,e,f,g ) -#define CYG_REPORT_FUNCARG8X( a,b,c,d,e,f,g,h ) \ - CYG_REPORT_FUNCARG8( "%08x %08x %08x %08x %08x %08x %08x %08x", \ - a,b,c,d,e,f,g,h ) - -#define CYG_REPORT_FUNCARG1XV( a ) \ - CYG_REPORT_FUNCARG1( # a "=%08x ", a ) -#define CYG_REPORT_FUNCARG2XV( a,b ) \ - CYG_REPORT_FUNCARG2( \ - # a "=%08x " # b "=%08x " , a,b ) -#define CYG_REPORT_FUNCARG3XV( a,b,c ) \ - CYG_REPORT_FUNCARG3( \ - # a "=%08x " # b "=%08x " # c "=%08x " , a,b,c ) -#define CYG_REPORT_FUNCARG4XV( a,b,c,d ) \ - CYG_REPORT_FUNCARG4( \ - # a "=%08x " # b "=%08x " # c "=%08x " # d "=%08x " \ - , a,b,c,d ) -#define CYG_REPORT_FUNCARG5XV( a,b,c,d,e ) \ - CYG_REPORT_FUNCARG5( \ - # a "=%08x " # b "=%08x " # c "=%08x " # d "=%08x " \ - # e "=%08x " \ - , a,b,c,d,e ) -#define CYG_REPORT_FUNCARG6XV( a,b,c,d,e,f ) \ - CYG_REPORT_FUNCARG6( \ - # a "=%08x " # b "=%08x " # c "=%08x " # d "=%08x " \ - # e "=%08x " # f "=%08x " \ - , a,b,c,d,e,f ) -#define CYG_REPORT_FUNCARG7XV( a,b,c,d,e,f,g ) \ - CYG_REPORT_FUNCARG7( \ - # a "=%08x " # b "=%08x " # c "=%08x " # d "=%08x " \ - # e "=%08x " # f "=%08x " # g "=%08x " \ - , a,b,c,d,e,f,g ) -#define CYG_REPORT_FUNCARG8XV( a,b,c,d,e,f,g,h ) \ - CYG_REPORT_FUNCARG8( \ - # a "=%08x " # b "=%08x " # c "=%08x " # d "=%08x " \ - # e "=%08x " # f "=%08x " # g "=%08x " # h "=%08x " \ - , a,b,c,d,e,f,g,h ) - -// decimal versions - - -#define CYG_REPORT_FUNCARG1D( a ) \ - CYG_REPORT_FUNCARG1( "%d", a ) -#define CYG_REPORT_FUNCARG2D( a,b ) \ - CYG_REPORT_FUNCARG2( "%d %d", a,b ) -#define CYG_REPORT_FUNCARG3D( a,b,c ) \ - CYG_REPORT_FUNCARG3( "%d %d %d", a,b,c ) -#define CYG_REPORT_FUNCARG4D( a,b,c,d ) \ - CYG_REPORT_FUNCARG4( "%d %d %d %d", a,b,c,d ) -#define CYG_REPORT_FUNCARG5D( a,b,c,d,e ) \ - CYG_REPORT_FUNCARG5( "%d %d %d %d %d", a,b,c,d,e ) -#define CYG_REPORT_FUNCARG6D( a,b,c,d,e,f ) \ - CYG_REPORT_FUNCARG6( "%d %d %d %d %d %d", \ - a,b,c,d,e,f ) -#define CYG_REPORT_FUNCARG7D( a,b,c,d,e,f,g ) \ - CYG_REPORT_FUNCARG7( "%d %d %d %d %d %d %d", \ - a,b,c,d,e,f,g ) -#define CYG_REPORT_FUNCARG8D( a,b,c,d,e,f,g,h ) \ - CYG_REPORT_FUNCARG8( "%d %d %d %d %d %d %d %d", \ - a,b,c,d,e,f,g,h ) - -#define CYG_REPORT_FUNCARG1DV( a ) \ - CYG_REPORT_FUNCARG1( # a "=%d ", a ) -#define CYG_REPORT_FUNCARG2DV( a,b ) \ - CYG_REPORT_FUNCARG2( \ - # a "=%d " # b "=%d " , a,b ) -#define CYG_REPORT_FUNCARG3DV( a,b,c ) \ - CYG_REPORT_FUNCARG3( \ - # a "=%d " # b "=%d " # c "=%d " , a,b,c ) -#define CYG_REPORT_FUNCARG4DV( a,b,c,d ) \ - CYG_REPORT_FUNCARG4( \ - # a "=%d " # b "=%d " # c "=%d " # d "=%d " \ - , a,b,c,d ) -#define CYG_REPORT_FUNCARG5DV( a,b,c,d,e ) \ - CYG_REPORT_FUNCARG5( \ - # a "=%d " # b "=%d " # c "=%d " # d "=%d " \ - # e "=%d " \ - , a,b,c,d,e ) -#define CYG_REPORT_FUNCARG6DV( a,b,c,d,e,f ) \ - CYG_REPORT_FUNCARG6( \ - # a "=%d " # b "=%d " # c "=%d " # d "=%d " \ - # e "=%d " # f "=%d " \ - , a,b,c,d,e,f ) -#define CYG_REPORT_FUNCARG7DV( a,b,c,d,e,f,g ) \ - CYG_REPORT_FUNCARG7( \ - # a "=%d " # b "=%d " # c "=%d " # d "=%d " \ - # e "=%d " # f "=%d " # g "=%d " \ - , a,b,c,d,e,f,g ) -#define CYG_REPORT_FUNCARG8DV( a,b,c,d,e,f,g,h ) \ - CYG_REPORT_FUNCARG8( \ - # a "=%d " # b "=%d " # c "=%d " # d "=%d " \ - # e "=%d " # f "=%d " # g "=%d " # h "=%d " \ - , a,b,c,d,e,f,g,h ) - -// short hex versions - -#define CYG_REPORT_FUNCARG1Y( a ) \ - CYG_REPORT_FUNCARG1( "%x", a ) -#define CYG_REPORT_FUNCARG2Y( a,b ) \ - CYG_REPORT_FUNCARG2( "%x %x", a,b ) -#define CYG_REPORT_FUNCARG3Y( a,b,c ) \ - CYG_REPORT_FUNCARG3( "%x %x %x", a,b,c ) -#define CYG_REPORT_FUNCARG4Y( a,b,c,d ) \ - CYG_REPORT_FUNCARG4( "%x %x %x %x", a,b,c,d ) -#define CYG_REPORT_FUNCARG5Y( a,b,c,d,e ) \ - CYG_REPORT_FUNCARG5( "%x %x %x %x %x", a,b,c,d,e ) -#define CYG_REPORT_FUNCARG6Y( a,b,c,d,e,f ) \ - CYG_REPORT_FUNCARG6( "%x %x %x %x %x %x", \ - a,b,c,d,e,f ) -#define CYG_REPORT_FUNCARG7Y( a,b,c,d,e,f,g ) \ - CYG_REPORT_FUNCARG7( "%x %x %x %x %x %x %x", \ - a,b,c,d,e,f,g ) -#define CYG_REPORT_FUNCARG8Y( a,b,c,d,e,f,g,h ) \ - CYG_REPORT_FUNCARG8( "%x %x %x %x %x %x %x %x", \ - a,b,c,d,e,f,g,h ) - -#define CYG_REPORT_FUNCARG1YV( a ) \ - CYG_REPORT_FUNCARG1( # a "=%x ", a ) -#define CYG_REPORT_FUNCARG2YV( a,b ) \ - CYG_REPORT_FUNCARG2( \ - # a "=%x " # b "=%x " , a,b ) -#define CYG_REPORT_FUNCARG3YV( a,b,c ) \ - CYG_REPORT_FUNCARG3( \ - # a "=%x " # b "=%x " # c "=%x " , a,b,c ) -#define CYG_REPORT_FUNCARG4YV( a,b,c,d ) \ - CYG_REPORT_FUNCARG4( \ - # a "=%x " # b "=%x " # c "=%x " # d "=%x " \ - , a,b,c,d ) -#define CYG_REPORT_FUNCARG5YV( a,b,c,d,e ) \ - CYG_REPORT_FUNCARG5( \ - # a "=%x " # b "=%x " # c "=%x " # d "=%x " \ - # e "=%x " \ - , a,b,c,d,e ) -#define CYG_REPORT_FUNCARG6YV( a,b,c,d,e,f ) \ - CYG_REPORT_FUNCARG6( \ - # a "=%x " # b "=%x " # c "=%x " # d "=%x " \ - # e "=%x " # f "=%x " \ - , a,b,c,d,e,f ) -#define CYG_REPORT_FUNCARG7YV( a,b,c,d,e,f,g ) \ - CYG_REPORT_FUNCARG7( \ - # a "=%x " # b "=%x " # c "=%x " # d "=%x " \ - # e "=%x " # f "=%x " # g "=%x " \ - , a,b,c,d,e,f,g ) -#define CYG_REPORT_FUNCARG8YV( a,b,c,d,e,f,g,h ) \ - CYG_REPORT_FUNCARG8( \ - # a "=%x " # b "=%x " # c "=%x " # d "=%x " \ - # e "=%x " # f "=%x " # g "=%x " # h "=%x " \ - , a,b,c,d,e,f,g,h ) - - -#endif // CYGONCE_INFRA_CYG_TRAC_H multiple inclusion protection -// EOF cyg_trac.h diff --git a/host/infra/cyg_type.h b/host/infra/cyg_type.h deleted file mode 100644 --- a/host/infra/cyg_type.h +++ /dev/null @@ -1,339 +0,0 @@ -#ifndef CYGONCE_INFRA_CYG_TYPE_H -#define CYGONCE_INFRA_CYG_TYPE_H - -//========================================================================== -// -// cyg_type.h -// -// Standard types, and some useful coding macros. -// -//========================================================================== -//####COPYRIGHTBEGIN#### -// -// ---------------------------------------------------------------------------- -// Copyright (C) 1997, 1998, 1999, 2000 Red Hat, Inc. -// -// This file is part of the eCos host tools. -// -// This program is free software; you can redistribute it and/or modify it -// under the terms of the GNU General Public License as published by the Free -// Software Foundation; either version 2 of the License, or (at your option) -// any later version. -// -// This program is distributed in the hope that it will be useful, but WITHOUT -// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for -// more details. -// -// You should have received a copy of the GNU General Public License along with -// this program; if not, write to the Free Software Foundation, Inc., -// 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -// -// ---------------------------------------------------------------------------- -// -//####COPYRIGHTEND#### -//========================================================================== -//#####DESCRIPTIONBEGIN#### -// -// Author(s): nickg from an original by hmt -// Contributors: nickg -// Date: 1997-09-08 -// Purpose: share unambiguously sized types. -// Description: we typedef [cyg_][u]int8,16,32 &c for general use. -// Usage: #include "cyg/infra/cyg_type.h" -// ... -// cyg_int32 my_32bit_integer; -// -//####DESCRIPTIONEND#### -// - -#include // Definition of NULL from the compiler - -// ------------------------------------------------------------------------- -// Some useful macros. These are defined here by default. - -// externC is used in mixed C/C++ headers to force C linkage on an external -// definition. It avoids having to put all sorts of ifdefs in. - -#ifdef __cplusplus -# define externC extern "C" -#else -# define externC extern -#endif - - -// ------------------------------------------------------------------------- -// The header defines the base types used here. It is -// supplied either by the target architecture HAL, or by the host -// porting kit. They are all defined as macros, and only those that -// make choices other than the defaults given below need be defined. - -#define CYG_LSBFIRST 1234 -#define CYG_MSBFIRST 4321 - -#include - -#if (CYG_BYTEORDER != CYG_LSBFIRST) && (CYG_BYTEORDER != CYG_MSBFIRST) -# error You must define CYG_BYTEORDER to equal CYG_LSBFIRST or CYG_MSBFIRST -#endif - -#ifndef CYG_DOUBLE_BYTEORDER -#define CYG_DOUBLE_BYTEORDER CYG_BYTEORDER -#endif - -#ifndef cyg_halint8 -# define cyg_halint8 char -#endif -#ifndef cyg_halint16 -# define cyg_halint16 short -#endif -#ifndef cyg_halint32 -# define cyg_halint32 int -#endif -#ifndef cyg_halint64 -# define cyg_halint64 long long -#endif - -#ifndef cyg_halcount8 -# define cyg_halcount8 int -#endif -#ifndef cyg_halcount16 -# define cyg_halcount16 int -#endif -#ifndef cyg_halcount32 -# define cyg_halcount32 int -#endif -#ifndef cyg_halcount64 -# define cyg_halcount64 long long -#endif - -#ifndef cyg_haladdress -# define cyg_haladdress cyg_uint32 -#endif -#ifndef cyg_haladdrword -# define cyg_haladdrword cyg_uint32 -#endif - -#ifndef cyg_halbool -# ifdef __cplusplus -# define cyg_halbool bool -# else -# define cyg_halbool int -# endif -#endif - -#ifndef cyg_halatomic -# define cyg_halatomic cyg_halint8 -#endif - -// ------------------------------------------------------------------------- -// The obvious few that compilers may define for you. -// But in case they don't: - -#ifndef NULL -# define NULL 0 -#endif - -#ifndef __cplusplus - -typedef cyg_halbool bool; - -# ifndef false -# define false 0 -# endif - -# ifndef true -# define true (!false) -# endif - -#endif - -// ------------------------------------------------------------------------- -// Allow creation of procedure-like macros that are a single statement, -// and must be followed by a semi-colon - -#define CYG_MACRO_START do { -#define CYG_MACRO_END } while (0) - -#define CYG_EMPTY_STATEMENT CYG_MACRO_START CYG_MACRO_END - -#define CYG_UNUSED_PARAM( _type_, _name_ ) CYG_MACRO_START \ - _type_ __tmp1 = (_name_); \ - _type_ __tmp2 = __tmp1; \ - __tmp1 = __tmp2; \ -CYG_MACRO_END - - -// ------------------------------------------------------------------------- -// Reference a symbol without explicitly making use of it. Ensures that -// the object containing the symbol will be included when linking. - -#define CYG_REFERENCE_OBJECT(__object__) \ - CYG_MACRO_START \ - static void *__cygvar_discard_me__ __attribute__ ((unused)) = \ - &(__object__); \ - CYG_MACRO_END - -// ------------------------------------------------------------------------- -// Define basic types for using integers in memory and structures; -// depends on compiler defaults and CPU type. - -typedef unsigned cyg_halint8 cyg_uint8 ; -typedef signed cyg_halint8 cyg_int8 ; - -typedef unsigned cyg_halint16 cyg_uint16 ; -typedef signed cyg_halint16 cyg_int16 ; - -typedef unsigned cyg_halint32 cyg_uint32 ; -typedef signed cyg_halint32 cyg_int32 ; - -typedef unsigned cyg_halint64 cyg_uint64 ; -typedef signed cyg_halint64 cyg_int64 ; - -typedef cyg_halbool cyg_bool ; - -// ------------------------------------------------------------------------- -// Define types for using integers in registers for looping and the like; -// depends on CPU type, choose what it is most comfortable with, with at -// least the range required. - -typedef unsigned cyg_halcount8 cyg_ucount8 ; -typedef signed cyg_halcount8 cyg_count8 ; - -typedef unsigned cyg_halcount16 cyg_ucount16 ; -typedef signed cyg_halcount16 cyg_count16 ; - -typedef unsigned cyg_halcount32 cyg_ucount32 ; -typedef signed cyg_halcount32 cyg_count32 ; - -typedef unsigned cyg_halcount64 cyg_ucount64 ; -typedef signed cyg_halcount64 cyg_count64 ; - -// ------------------------------------------------------------------------- -// Define a type to be used for atomic accesses. This type is guaranteed -// to be read or written in a single uninterruptible operation. This type -// is at least a single byte. - -typedef volatile unsigned cyg_halatomic cyg_atomic; -typedef volatile unsigned cyg_halatomic CYG_ATOMIC; - -// ------------------------------------------------------------------------- -// Define types for access plain, on-the-metal memory or devices. - -typedef cyg_uint32 CYG_WORD; -typedef cyg_uint8 CYG_BYTE; -typedef cyg_uint16 CYG_WORD16; -typedef cyg_uint32 CYG_WORD32; -typedef cyg_uint64 CYG_WORD64; - -typedef cyg_haladdress CYG_ADDRESS; -typedef cyg_haladdrword CYG_ADDRWORD; - -// ------------------------------------------------------------------------- -// Constructor ordering macros. These are added as annotations to all -// static objects to order the constuctors appropriately. - -#if defined(__cplusplus) && defined(__GNUC__) -# define CYGBLD_ATTRIB_INIT_PRI( _pri_ ) __attribute__((init_priority(_pri_))) -#else -// FIXME: should maybe just bomb out if this is attempted anywhere else? -// Not sure -# define CYGBLD_ATTRIB_INIT_PRI( _pri_ ) -#endif - -// The following will be removed eventually as it doesn't allow the use of -// e.g. pri+5 format -#define CYG_INIT_PRIORITY( _pri_ ) CYGBLD_ATTRIB_INIT_PRI( CYG_INIT_##_pri_ ) - -#define CYGBLD_ATTRIB_INIT_BEFORE( _pri_ ) CYGBLD_ATTRIB_INIT_PRI(_pri_-100) -#define CYGBLD_ATTRIB_INIT_AFTER( _pri_ ) CYGBLD_ATTRIB_INIT_PRI(_pri_+100) - -#define CYG_INIT_HAL 10000 -#define CYG_INIT_SCHEDULER 11000 -#define CYG_INIT_INTERRUPTS 12000 -#define CYG_INIT_DRIVERS 13000 -#define CYG_INIT_CLOCK 14000 -#define CYG_INIT_IDLE_THREAD 15000 -#define CYG_INIT_THREADS 16000 -#define CYG_INIT_KERNEL 40000 -#define CYG_INIT_IO 49000 -#define CYG_INIT_LIBC 50000 -#define CYG_INIT_COMPAT 55000 -#define CYG_INIT_APPLICATION 60000 -#define CYG_INIT_PREDEFAULT 65534 -#define CYG_INIT_DEFAULT 65535 - -// ------------------------------------------------------------------------- -// COMPILER-SPECIFIC STUFF - -#ifdef __GNUC__ -// Force a 'C' routine to be called like a 'C++' contructor -# define CYGBLD_ATTRIB_CONSTRUCTOR __attribute__((constructor)) - -// Define a compiler-specific rune for saying a function doesn't return -# define CYGBLD_ATTRIB_NORET __attribute__((noreturn)) - -// How to define weak symbols - this is only relevant for ELF and a.out, -// but that won't be a problem for eCos -# define CYGBLD_ATTRIB_WEAK __attribute__ ((weak)) - -// How to define alias to symbols. Just pass in the symbol itself, not -// the string name of the symbol -# define CYGBLD_ATTRIB_ALIAS(__symbol__) \ - __attribute__ ((alias (#__symbol__))) - -// This effectively does the reverse of the previous macro. It defines -// a name that the attributed variable or function will actually have -// in assembler. -# define CYGBLD_ATTRIB_ASM_ALIAS(__symbol__) \ - __asm__ ( #__symbol__ ) - -// Shows that a function returns the same value when given the same args, but -// note this can't be used if there are pointer args -# define CYGBLD_ATTRIB_CONST __attribute__((const)) - -#else // non-GNU - -# define CYGBLD_ATTRIB_CONSTRUCTOR - -# define CYGBLD_ATTRIB_NORET - // This intentionally gives an error only if we actually try to - // use it. #error would give an error if we simple can't. -# define CYGBLD_ATTRIB_WEAK !!!-- Attribute weak not defined --!!! - -# define CYGBLD_ATTRIB_ALIAS(__x__) !!!-- Attribute alias not defined --!!! - -# define CYGBLD_ATTRIB_ASM_ALIAS(__symbol__) !!!-- Asm alias not defined --!!! - -# define CYGBLD_ATTRIB_CONST - -#endif - -// How to define weak aliases. Currently this is simply a mixture of the -// above - -# define CYGBLD_ATTRIB_WEAK_ALIAS(__symbol__) \ - CYGBLD_ATTRIB_WEAK CYGBLD_ATTRIB_ALIAS(__symbol__) - -// ------------------------------------------------------------------------- -// Label name macro. Some toolsets generate labels with initial -// underscores and others don't. This macro should be used on labels -// that are defined in assembly code or linker scripts so that we can -// do the right thing. - -#ifndef CYG_LABEL_NAME - -#define CYG_LABEL_NAME(_name_) _name_ - -#endif - -// ------------------------------------------------------------------------- -// Various "flavours" of memory regions that can be described by the -// Memory Layout Tool (MLT). - -#define CYGMEM_REGION_ATTR_R 0x01 // Region can be read -#define CYGMEM_REGION_ATTR_W 0x02 // Region can be written - -// ------------------------------------------------------------------------- -#endif // CYGONCE_INFRA_CYG_TYPE_H multiple inclusion protection -// EOF cyg_type.h diff --git a/host/infra/diag.h b/host/infra/diag.h deleted file mode 100644 --- a/host/infra/diag.h +++ /dev/null @@ -1,106 +0,0 @@ -#ifndef CYGONCE_INFRA_DIAG_H -#define CYGONCE_INFRA_DIAG_H - -/*============================================================================= -// -// diag.h -// -// Diagnostic Routines for Infra Development -// -//========================================================================== -//####COPYRIGHTBEGIN#### -// -// ---------------------------------------------------------------------------- -// Copyright (C) 1998, 1999, 2000 Red Hat, Inc. -// -// This file is part of the eCos host tools. -// -// This program is free software; you can redistribute it and/or modify it -// under the terms of the GNU General Public License as published by the Free -// Software Foundation; either version 2 of the License, or (at your option) -// any later version. -// -// This program is distributed in the hope that it will be useful, but WITHOUT -// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for -// more details. -// -// You should have received a copy of the GNU General Public License along with -// this program; if not, write to the Free Software Foundation, Inc., -// 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -// -// ---------------------------------------------------------------------------- -// -//####COPYRIGHTEND#### -//========================================================================== -//#####DESCRIPTIONBEGIN#### -// -// Author(s): nickg -// Contributors: nickg -// Date: 1998-03-02 -// Purpose: Diagnostic Routines for Infra Development -// Description: Diagnostic routines for use during infra development. -// Usage: #include -// -//####DESCRIPTIONEND#### -// -//==========================================================================*/ - -#include -#include - -#ifdef CYGDBG_INFRA_DIAG_PRINTF_USE_VARARG -#include -#endif - -#ifdef CYGDBG_INFRA_DIAG_USE_DEVICE -#include -#endif - -/*---------------------------------------------------------------------------*/ -/* Diagnostic routines */ - -externC void diag_init(void); /* Initialize, call before any others*/ - -externC void diag_write_char(char c); /* Write single char to output */ - -externC void diag_write_string(const char *psz); /* Write zero terminated string */ - -externC void diag_write_dec( cyg_int32 n); /* Write decimal value */ - -externC void diag_write_hex( cyg_uint32 n); /* Write hexadecimal value */ - -externC void diag_dump_buf(void *buf, CYG_ADDRWORD len); - -#ifdef CYGDBG_INFRA_DIAG_PRINTF_USE_VARARG - -externC void diag_printf( const char *fmt, ... ); /* Formatted print */ - -#else - -// This function deliberately has a K&R prototype to avoid having to use -// varargs, or pad arglists or anything grody like that. - -#warning CYGDBG_INFRA_DIAG_PRINTF_USE_VARARG not enabled -#warning Expect a "function declaration isn't a prototype" warning - -externC void diag_printf(/* const char *fmt, CYG_ADDRWORD, CYG_ADDRWORD, - CYG_ADDRWORD, CYG_ADDRWORD, CYG_ADDRWORD, - CYG_ADDRWORD, CYG_ADDRWORD, CYG_ADDRWORD */); - -#endif - -/*---------------------------------------------------------------------------*/ -/* Internal Diagnostic MACROS */ - -#ifdef CYGDBG_INFRA_DIAG_USE_DEVICE -#define DIAG_DEVICE_START_SYNC() diag_device_start_sync() -#define DIAG_DEVICE_END_SYNC() diag_device_end_sync() -#else -#define DIAG_DEVICE_START_SYNC() -#define DIAG_DEVICE_END_SYNC() -#endif - -/*---------------------------------------------------------------------------*/ -#endif /* CYGONCE_INFRA_DIAG_H */ -/* EOF diag.h */ diff --git a/host/infra/hosttest.exp b/host/infra/hosttest.exp deleted file mode 100644 --- a/host/infra/hosttest.exp +++ /dev/null @@ -1,735 +0,0 @@ -#=============================================================================== -# -# hosttest.exp -# -# Support for host-side testing -# -#=============================================================================== -######COPYRIGHTBEGIN#### -# -# ---------------------------------------------------------------------------- -# Copyright (C) 1998, 1999, 2000, 2001 Red Hat, Inc. -# -# This file is part of the eCos host tools. -# -# This program is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License as published by the Free -# Software Foundation; either version 2 of the License, or (at your option) -# any later version. -# -# This program is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for -# more details. -# -# You should have received a copy of the GNU General Public License along with -# this program; if not, write to the Free Software Foundation, Inc., -# 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -# -# ---------------------------------------------------------------------------- -# -######COPYRIGHTEND#### -#=============================================================================== -######DESCRIPTIONBEGIN#### -# -# Author(s): bartv -# Contributors: bartv -# Date: 1998-11-25 -# Note: Arguably this should be a loadable package -# -#####DESCRIPTIONEND#### -#=============================================================================== -# - -# ---------------------------------------------------------------------------- -# This script gets loaded by host-side DejaGnu test harnesses to provide -# various utilities for testing eCos host applications. It lives in the -# host-side infrastructure directory and gets installed in -# $(PREFIX)/share/dejagnu. -# -# The script can assume that a number of globals from the site.exp -# file have been read in. These include: -# tool - name of the tool (i.e. the package) -# srcdir - location of the source directory -# objdir - location of the build tree -# host_alias - config triplet -# host_triplet - ditto -# -# The generated Makefile has some additional information that is useful. -# CC - name of the C compiler that is used -# CXX - name of the C++ compiler -# prefix - where everything gets installed -# OBJEXT - either o or obj -# EXEEXT - either nothing or .exe -# VERSION - the version number -# CFLAGS - flags to use when compiling C code -# CXXFLAGS - flags to use when compiling C++ code -# -# Some additional variables should be present in any generated -# makefiles in the eCos tree. -# INCLUDES - header file search path -# LIBS - libraries, search paths, ... -# -# hosttest_initialize -# Perform any initialization steps that are needed. Currently this -# means reading in the Makefile from the top-level of the build tree -# and figuring out the values of CC, CXX, and anything else that is -# useful. Any errors should be reported via perror and then the -# script should exit. -# -# There is an optional argument, a list of additional variables which -# should be present in the makefile and whose values are desired. - -proc hosttest_initialize { { pkg_vars {} } } { - - # First check that this script is actually running inside DejaGnu - if { [info exists ::objdir] == 0 } { - puts "Variable ::objdir is not defined, is this script really running inside DejaGnu?" - exit 1 - } - - # The information is stored in an array hosttest_data. Make sure this - # array exists. - array set ::hosttest_data {} - - # Now clear out any entries in the array - foreach entry [array names ::hosttest_data] { - unset ::hosttest_data($entry) - } - - # Now read in the build tree's Makefile (and not the testsuite's Makefile) - set filename [file join $::objdir .. Makefile] - if { [file exists $filename] == 0 } { - perror "Initialization error: the build tree's Makefile $filename does not exist." - exit 1 - } - set status [ catch { - set fd [open $filename r] - set contents [read $fd] - close $fd - } message] - if { $status != 0 } { - perror "Error reading $filename.\n$message" - exit 1 - } - - # The data is available. Search it for each of the variables of - # interest. Some variables are optional and are given default - # values. - set ::hosttest_data(CFLAGS) "" - set ::hosttest_data(CXXFLAGS) "" - - set lines [split $contents "\n"] - - foreach var [concat { CC CXX prefix OBJEXT EXEEXT VERSION CFLAGS CXXFLAGS INCLUDES LIBS } $pkg_vars] { - - set pattern "^$var\[ \t\]*:?=\[ \t\]* (.*)\$" - set dummy "" - set match "" - - foreach line $lines { - if { [regexp -- $pattern $line dummy match] == 1 } { - set ::hosttest_data($var) $match - break - } - } - if { [info exists ::hosttest_data($var)] == 0 } { - perror "Variable $var is not defined in $filename" - exit 1 - } - } - - # If compiling with VC++ remove any cygwin-isms from the prefix - if { [string match "cl*" $::hosttest_data(CC)] } { - set status [catch "exec cygpath -w $::hosttest_data(prefix)" message] - if { $status == 0 } { - regsub -all -- {\\} $message {/} ::hosttest_data(prefix) - } else { - perror "Converting cygwin pathname $::hosttest_data(prefix)\n$message" - exit 1 - } - } -} - - -# ---------------------------------------------------------------------------- -# hosttest_extract_version -# Assuming there has been a call to initialize, the required information -# should be available in the hosttest_data array. The initialize -# function should have aborted if the data is not available. - -proc hosttest_extract_version { } { - - if { [info exists ::hosttest_data(VERSION)] == 0 } { - error "No version information - host testing has not been properly initialized." - } - - if { [info exists ::objdir] == 0 } { - error "Variable ::objdir is not defined, is this script really running inside DejaGnu?" - } - return $::hosttest_data(VERSION) -} - -# ---------------------------------------------------------------------------- -# hosttest_compile -# compile and link one or more source files. The arguments are: -# 1) the name of the test case -# 2) a list of one or more source files that need to be compiled. -# Both .c and .cxx files are supported, and the appropriate -# compiler will be used. If this list is empty then the -# code will look for a .c or a .cxx file which matches the -# name of the test executable. Source files are assumed to -# be relative to $::srcdir/$::subdir -# 3) a list (possibly empty) of directories that should be in the -# include path. The build tree's directory is automatically in -# the path, as is $(PREFIX)/include. Note that the build tree -# is actually one level above objdir, on the assumption that -# objdir is the testsuite subdirectory of the real objdir. -# 4) ditto for library search paths. -# 5) and a list of additional libraries that should be linked. -# -# Currently it is not possible to pass compiler flags since those -# might need translating between gcc and VC++. This may have to be -# resolved. -# -# Currently linking is not done via libtool. This may have to change. -# -# The various object files and the executable are placed in a directory -# testcase in the build tree, to avoid the risk of name clashes. This -# directory must not exist yet. There is a separate routine hosttest_clean -# which simply expunges the entire testcase directory. -# -# The output of a succesful compile or built is reported using -# verbose at level 2. Unsuccesful compiles or builts are reported using -# level 1. - -proc hosttest_compile { name sources includes libdirs libs } { - - # Make sure that the testcase directory does not yet exist, then - # create it. This guarantees a clean system and reasonable access - # permissions. Each testcase invocation should involve a call to - # the clean function. - set dirname [file join $::objdir "testcase"] - if { [file exists $dirname] != 0 } { - # An empty directory is ok. - if { [llength [glob -nocomplain -- [file join $dirname "*"]]] != 0 } { - error "hosttest_compile: $dirname already exists" - } - } - - set status [catch { file mkdir $dirname } message] - if { $status != 0 } { - error "hosttest_compile: unable to create directory $dirname" - } - - # The only argument that must be valid is the test name. - if { $name == "" } { - error "hosttest_compile: invalid test case name" - } - - # If the list of sources is empty then look for a suitable - # file in the appropriate directory. - if { [llength $sources] == 0 } { - set filename [file join $::srcdir $::subdir "${name}.c"] - if { [file exists $filename] && [file isfile $filename] } { - lappend sources [file tail $filename] - } else { - set filename [file join $::srcdir $::subdir "${name}.cxx"] - if { [file exists $filename] && [file isfile $filename] } { - lappend sources [file tail $filename] - } else { - error "hosttest_compile: no sources listed and unable to find ${name}.c or ${name}.cxx" - } - } - } - - # For each source file, generate a compile command line and try to execute - # it. The command line takes the form: - # (CC|CXX) -c (CFLAGS|CXXFLAGS) (INCDIRS) -o xxx yyy - # - # It is also useful to produce a list of the object files that need to - # linked later on, and to work out which tool should be invoked for - # linking. - set object_files {} - set has_cxx_files 0 - - foreach source $sources { - set commandline "" - if { [file extension $source] == ".c" } { - append commandline "$::hosttest_data(CC) -c $::hosttest_data(CFLAGS) " - } elseif { [file extension $source] == ".cxx" } { - set has_cxx_files 1 - append commandline "$::hosttest_data(CXX) -c $::hosttest_data(CXXFLAGS) " - } else { - error "hosttest_compile: files of type [file extension $source] ($source) are not yet supported." - } - - # Include path: start with the source tree. Then the build tree. - # Then the makefile's INCLUDES variable. - # Then any additional directories specified explicitly by the - # testcase. Finish off with the prefix. Note that header files - # in the prefix directory may be out of date, depending on whether - # or not there has been an install recently. - append commandline "-I[file join [pwd] [file dirname $::srcdir]] " - append commandline "-I[file join [pwd] [file dirname $::objdir]] " - append commandline "$::hosttest_data(INCLUDES) " - foreach dir $includes { - append commandline "-I[file join [pwd] $dir] " - } - append commandline "-I[file join [pwd] $::hosttest_data(prefix) include] " - - # The output file must go into the testcase directory and have the right suffix - set objfile "[file root [file tail $source]].$::hosttest_data(OBJEXT)" - lappend object_files $objfile - if { [string match "cl*" $::hosttest_data(CC)] } { - append commandline "-Fo[file join $::objdir testcase $objfile] " - } else { - append commandline "-o [file join $::objdir testcase $objfile] " - } - - # Finally provide the source file. - append commandline "[file join $::srcdir $::subdir $source]" - verbose -log -- $commandline - - # Time to invoke the compiler. - set status [catch { set result [eval exec -keepnewline -- $commandline] } message] - if { $status == 0 } { - # The compile succeeded and the output is in result. Report the - # output. - verbose -log -- $result - } else { - # The compile failed and the output is in message. - verbose -log -- $message - error "hosttest_compile: failed to compile $source" - } - } - - # At this stage all the source files have been compiled, a list of - # object files has been constructed, and it is known whether or - # not any of the sources were c++. Time to construct a new command - # line. - set commandline "" - if { $has_cxx_files == 0 } { - append commandline "$::hosttest_data(CC) $::hosttest_data(CFLAGS) " - } else { - append commandline "$::hosttest_data(CXX) $::hosttest_data(CXXFLAGS) " - } - set exename [file join $::objdir "testcase" "$name$::hosttest_data(EXEEXT)"] - - # List all of the object files - foreach obj $object_files { - append commandline "[file join $::objdir "testcase" $obj] " - } - - # Now take care of libraries and search paths. This requires different - # code for gcc and VC++. - - if { [string match "cl*" $::hosttest_data(CC)] } { - append commandline "-Fe$exename " - - foreach lib $libs { - append commandline "${lib}.lib " - } - append commandline "$::hosttest_data(LIBS) " - append commandline "-libpath=[file join [pwd] [file dirname $::objdir]] " - foreach dir $libdirs { - append commandline "-libpath=[file join [pwd] $dir] " - } - append commandline "-libpath=[file join [pwd] $::hosttest_data(prefix) lib] " - } else { - append commandline "-o $exename " - append commandline "-L[file join [pwd] [file dirname $::objdir]] " - foreach dir $libdirs { - append commandline "-L[file join [pwd] $dir] " - } - append commandline "-L[file join [pwd] $::hosttest_data(prefix) lib] " - foreach lib $libs { - append commandline "-l$lib " - } - append commandline "$::hosttest_data(LIBS) " - } - - # We have a command line, go for it. - verbose -log -- $commandline - set status [catch { set result [eval exec -keepnewline -- $commandline] } message] - if { $status == 0 } { - # The link has succeeded, we have an executable. - verbose -log -- $result - } else { - # The link failed and the output is in message. - # Report things are per compilation failures - verbose -log -- $message - error "hosttest_compile: failed to link $exename" - } - - # There should be a test executable. -} - -# ---------------------------------------------------------------------------- -# hosttest_clean -# Clean up a testcase directory. - -proc hosttest_clean { } { - - set dirname [file join $::objdir "testcase"] - if { [file exists $dirname] == 0 } { - - # Something must have gone seriously wrong during the build phase, - # there is nothing there. - return - } - - if { [file isdirectory $dirname] == 0 } { - error "hosttest_clean: $dirname should be a directory" - } - - foreach entry [glob -nocomplain -- [file join $dirname "*"]] { - set filename [file join $dirname $entry] - if { [file isfile $filename] == 0 } { - error "hosttest_clean: $filename is not a file" - } - set status [catch { file delete -force -- $filename } message] - if { $status != 0 } { - error "hosttest_clean: unable to delete $filename, $message" - } - } - set status [catch { file delete -force -- $dirname } message] - if { $status != 0 } { - error "hosttest_clean: unable to delete directory $dirname, $message" - } -} - -# ---------------------------------------------------------------------------- -# Run a test executable, returning the status code and the output. -# The results are returned in variables. It is assumed that some test cases -# will fail, so raising an exception is appropriate only if something -# has gone wrong at the test harness level. The argument list -# should be the name of the test case (from which the executable file name -# can be derived) and a list of arguments. - -proc hosttest_run { result_arg output_arg test args } { - - upvar $result_arg result - upvar $output_arg output - - # Figure out the filename corresponding to the test and make - # sure it exists. - set filename [file join $::objdir "testcase" $test] - append filename $::hosttest_data(EXEEXT) - if { ([file exists $filename] == 0) || ([file isfile $filename] == 0) } { - error "hosttest_run: testcase file $filename does not exist" - } - - # There is no need to worry about interacting with the program, - # just exec it. It is a good idea to do this in the testcase directory, - # so that any core dumps get cleaned up as well. - set current_dir [pwd] - set status [ catch { cd [file join $::objdir "testcase"] } message ] - if { $status != 0 } { - error "unable to change directory to [file join $::objdir testcase]\n$message" - } - - verbose -log -- $filename $args - set status [ catch { set result [eval exec -keepnewline -- $filename $args] } output] - if { $status == 0 } { - # The command has succeeded. The exit code is 0 and the output - # was returned by the exec. - set output $result - set result 0 - } else { - # The command has failed. The exit code is 1 and the output is - # already in the right place. - verbose -log -- $output - set result 1 - } - set status [catch { cd $current_dir } message] - if { $status != 0 } { - error "unable to change directory back to $current_dir" - } -} - -# ---------------------------------------------------------------------------- -# Given some test output, look through it for pass and fail messages. -# These should result in appropriate DejaGnu pass and fail calls. -# In addition, if the program exited with a non-zero status code but -# did not report any failures then a special failure is reported. - -proc hosttest_handle_output { name result output } { - - set passes 0 - set fails 0 - - foreach line [split $output "\n"] { - - # The output should be of one of the following forms: - # PASS: - # FAIL: Line: xx File: xx - # Whatever - # - # PASS and FAIL messages will be reported via DejaGnu pass and fail - # calls. Everything else gets passed to verbose, so the user gets - # to choose how much information gets reported. - - set dummy "" - set match1 "" - set match2 "" - - if { [regexp -- {^PASS:<(.*)>.*$} $line dummy match1] == 1 } { - pass $match1 - incr passes - } elseif { [regexp -- {^FAIL:<(.*)>(.*)$} $line dummy match1 match2] == 1 } { - fail "$match1 $match2" - incr fails - } else { - verbose $line - } - } - - if { ($result != 0) && ($fails == 0) } { - fail "program terminated with non-zero exit code but did not report any failures" - } elseif { ($passes == 0) && ($fails == 0) } { - unresolved "test case $name did not report any passes or failures" - } -} - -# ---------------------------------------------------------------------------- -# hosttest_run_test_with_filter -# This routines combines the compile, run and clean operations, -# plus it invokes a supplied callback to filter the output. The -# callback is passed three arguments: the test name, the exit code, -# and all of the program output. - -proc hosttest_run_test_with_filter { name filter sources incdirs libdirs libs args } { - - set result 0 - set output "" - - set status [ catch { hosttest_compile $name $sources $incdirs $libdirs $libs } message] - if { $status != 0 } { - fail "unable to compile test case $name, $message" - hosttest_clean - return - } - set status [ catch { hosttest_run result output $name $args } message] - if { $status != 0 } { - fail "unable to run test case $name, $message" - hosttest_clean - return - } - set status [ catch { $filter $name $result $output } message] - if { $status != 0 } { - fail "unable to parse output from test case $name" - hosttest_clean - return - } - - hosttest_clean -} - -# ---------------------------------------------------------------------------- -# hosttest_run_simple_test -# This routine combines the compile, run, output, and clean operations. -# The arguments are the same as for compilation, plus an additional -# list for run-time parameters to the test case. - -proc hosttest_run_simple_test { name sources incdirs libdirs libs args } { - - - set result 0 - set output "" - - set status [ catch { hosttest_compile $name $sources $incdirs $libdirs $libs } message] - if { $status != 0 } { - fail "unable to compile test case $name, $message" - hosttest_clean - return - } - set status [ catch { hosttest_run result output $name $args } message] - if { $status != 0 } { - fail "unable to run test case $name, $message" - hosttest_clean - return - } - set status [ catch { hosttest_handle_output $name $result $output } message] - if { $status != 0 } { - fail "unable to parse output from test case $name" - hosttest_clean - return - } - - hosttest_clean -} - -# ---------------------------------------------------------------------------- -# Filename translation. A particular file has been created and must now -# be accessed from Tcl. -# -# Under Unix everything just works. -# -# Under Windows, well there is cygwin and there is the Windows world. -# A file may have come from either. cygtclsh80 and hence DejaGnu is not -# fully integrated with cygwin, for example it does not know about -# cygwin mount points. There are also complications because of -# volume-relative filenames. -# -# The code here tries a number of different ways of finding a file which -# matches the name. It is possible that the result is not actually what -# was intended, but hopefully this case will never arise. - -proc hosttest_translate_existing_filename { name } { - - if { $::tcl_platform(platform) == "unix" } { - # The file should exist. It is worth checking just in case. - if { [file exists $name] == 0 } { - return "" - } else { - return $name - } - } - - if { $::tcl_platform(platform) != "windows" } { - perror "The testing framework does not know about platform $::tcl_platform(platform)" - return "" - } - - # Always get rid of any backslashes, they just cause trouble - regsub -all -- {\\} $name {/} name - - # If the name is already valid, great. - if { [file exists $name] } { - return $name - } - - # OK, try to use cygwin's cygpath utility to convert it. - set status [catch "exec cygpath -w $name" message] - if { $status == 0 } { - set cygwin_name "" - regsub -all -- {\\} $message {/} cygwin_name - if { [file exists $cygwin_name] } { - return $cygwin_name - } - } - - # Is the name volumerelative? If so work out the current volume - # from the current directory and prepend this. - if { [file pathtype $name] == "volumerelative" } { - append fullname [string range [pwd] 0 1] $name - if { [file exists $fullname] } { - return $fullname - } - } - - # There are other possibilities, e.g. d:xxx indicating a file - # relative to the current directory on drive d:. For now such - # Lovecraftian abominations are ignored. - return "" -} - -# ---------------------------------------------------------------------------- -# Support for assertion dumps. The infrastructure allows other subsystems -# to add their own callbacks which get invoked during a panic and which -# can write additional output to the dump file. For example it would be -# possible to output full details of the current configuration. These -# routines make it easier to write test cases for such callbacks. -# -# hosttest_assert_check(result output) -# Make sure that the test case really triggered an assertion. -# -# hosttest_assert_read_dump(output) -# Identify the temporary file used for the dump, read it in, delete -# it (no point in leaving such temporaries lying around when running -# testcases) and return the contents of the file. -# -# hosttest_assert_extract_callback(dump title) -# Given a dump output as returned by read_dump, look for a section -# generated by a callback with the given title. Return the contents -# of the callback. - -proc hosttest_assert_check { result output } { - - if { $result == 0 } { - return 0 - } - - foreach line [split $output "\n"] { - if { [string match "Assertion failure*" $line] } { - return 1 - } - } - return 0 -} - -# This routine assumes that assert_check has already been called. -proc hosttest_assert_read_dump { output } { - - foreach line [split $output "\n"] { - set dummy "" - set match "" - - if { [regexp -nocase -- {^writing additional output to (.*)$} $line dummy match] } { - - # The filename is in match, but it may not be directly accessible. - set filename [hosttest_translate_existing_filename $match] - if { $filename == "" } { - return "" - } - set status [ catch { - set fd [open $filename r] - set data [read $fd] - close $fd - file delete $filename - } message] - if { $status != 0 } { - unresolved "Unable to process assertion dump file $filename" - unresolved "File $filename may have to be deleted manually" - return "" - } - return $data - } - } - return "" -} - -# Look for the appropriate markers. Also clean up blank lines -# at the start and end. -proc hosttest_assert_extract_callback { dump title } { - - set lines [split $dump "\n"] - set result "" - - while { [llength $lines] > 0 } { - set line [lindex $lines 0] - set lines [lreplace $lines 0 0] - - if { [regexp -nocase -- "^\# \{\{\{.*${title}.*\$" $line] } { - - # Skip any blank lines at the start - while { [llength $lines] > 0 } { - set line [lindex $lines 0] - if { [regexp -- {^ *$} $line] == 0} { - break - } - set lines [lreplace $lines 0 0] - } - - # Now add any lines until the close marker. - # Nested folds are not supported yet. - while { [llength $lines] > 0 } { - set line [lindex $lines 0] - set lines [lreplace $lines 0 0] - if { [regexp -nocase -- {^\# \}\}\}.*$} $line] } { - break - } - append result $line "\n" - } - - return $result - } - } - - return "" -} - - - - diff --git a/host/infra/infra.h b/host/infra/infra.h deleted file mode 100644 --- a/host/infra/infra.h +++ /dev/null @@ -1,116 +0,0 @@ -#ifndef CYGONCE_PKGCONF_INFRA_H -# define CYGONCE_PKGCONF_INFRA_H - -//====================================================================== -// -// infra.h -// -// Host side implementation of the infrastructure configuration -// header. -// -//====================================================================== -//####COPYRIGHTBEGIN#### -// -// ---------------------------------------------------------------------------- -// Copyright (C) 1998, 1999, 2000 Red Hat, Inc. -// -// This file is part of the eCos host tools. -// -// This program is free software; you can redistribute it and/or modify it -// under the terms of the GNU General Public License as published by the Free -// Software Foundation; either version 2 of the License, or (at your option) -// any later version. -// -// This program is distributed in the hope that it will be useful, but WITHOUT -// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for -// more details. -// -// You should have received a copy of the GNU General Public License along with -// this program; if not, write to the Free Software Foundation, Inc., -// 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -// -// ---------------------------------------------------------------------------- -// -//####COPYRIGHTEND#### -//====================================================================== -//#####DESCRIPTIONBEGIN#### -// -// Author(s): bartv -// Contact(s): bartv -// Date: 1998/07/13 -// Version: 0.01 -// -//####DESCRIPTIONEND#### -//====================================================================== - -// The purpose of this header file is to replicate appropriate -// functionality from the target-side header file . -// This header file is intended to contain configuration options -// related to the implementation of the infrastructure, as opposed -// to how that infrastructure gets used by other packages. A good -// example would be a configuration option to control the size -// of the circular trace buffer. -// -// On the host side these things are handled by autoconf, and in -// particular the configure.in script will offer command-line -// arguments allowing the relevant options to be controlled. -// The relevant information will end up in -# include - -// Some options should always be enabled in this header file. -#define CYGDBG_INFRA_DIAG_PRINTF_USE_VARARG -#define CYGDBG_INFRA_DEBUG_ASSERT_MESSAGE -#define CYGDBG_INFRA_DEBUG_TRACE_MESSAGE - -// Other options should be decided on a package by package basis, -// e.g. whether or not assertions are used. On the host side it is -// not appropriate to control these globally, instead the infrastructure -// always provides the necessary functionality and it is up to the -// other parts of the system to decide whether or not the facilities -// get used. - -// A third set of options deal with the environment, e.g. the sizes -// of various data types. autoconf macros take care of most of the -// work, but some translation is needed into eCos-style names to -// avoid namespace pollution. - -// Process the definitions of SIZEOF_INT_P and SIZEOF_LONG to work -// out a sensible data type for CYG_ADDRESS and CYG_ADDRWORD. - -#if (!defined(SIZEOF_INT_P) || !defined(SIZEOF_LONG)) -# error "Configure problem: data type sizes not set" -#endif - -#if (SIZEOF_INT_P == 4) - // The default, nothing needs to be done -#elif (SIZEOF_INT_P == 8) -# define cyg_haladdress cyg_halint64 -#else -# error "Only 32 and 64 bit pointers are supported" -#endif - -#if ((SIZEOF_INT_P == 4) && (SIZEOF_LONG == 4)) - // The default, nothing needs to be done -#elif ((SIZEOF_INT_P <= 8) && (SIZEOF_LONG <= 8)) - // cyg_halint64 will have been defined appropriately. -# define cyg_haladdrword cyg_halint64 -#else -# error "Only 32 and 64 bit machine word sizes are supported" -#endif - -// Any symbols defined in which have been processed -// here should no longer be of any interest, and in the interests of -// reducing name space pollution they get undef'ed here. - -// In addition there are two #define's in the config.h header file -// which are always present and which have names that are rather too -// generic. These get removed here as well. The version is worth -// preserving under a different name. -#undef SIZEOF_INT_P -#undef SIZEOF_LONG -#undef PACKAGE -#undef VERSION - -#endif // CYGONCE_PKGCONF_INFRA_H -// End of infra.h diff --git a/host/infra/stamp-h.in b/host/infra/stamp-h.in deleted file mode 100644 --- a/host/infra/stamp-h.in +++ /dev/null @@ -1,1 +0,0 @@ -timestamp diff --git a/host/infra/testcase.cxx b/host/infra/testcase.cxx deleted file mode 100644 --- a/host/infra/testcase.cxx +++ /dev/null @@ -1,92 +0,0 @@ -//========================================================================== -// -// testcase.cxx -// -// Host side implementation of the test support routines. -// -//========================================================================== -//####COPYRIGHTBEGIN#### -// -// ---------------------------------------------------------------------------- -// Copyright (C) 1998, 1999, 2000 Red Hat, Inc. -// -// This file is part of the eCos host tools. -// -// This program is free software; you can redistribute it and/or modify it -// under the terms of the GNU General Public License as published by the Free -// Software Foundation; either version 2 of the License, or (at your option) -// any later version. -// -// This program is distributed in the hope that it will be useful, but WITHOUT -// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for -// more details. -// -// You should have received a copy of the GNU General Public License along with -// this program; if not, write to the Free Software Foundation, Inc., -// 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -// -// ---------------------------------------------------------------------------- -// -//####COPYRIGHTEND#### -//========================================================================== -//#####DESCRIPTIONBEGIN#### -// -// Author(s): bartv -// Contributors: bartv -// Date: 1998-01-01 -// Purpose: -// Description: -// -//####DESCRIPTIONEND#### -//========================================================================== - -#include -#include - -#include - -// Initialization is a no-op for the host side testing infrastructure. -// Only batch programs are likely to use these testing facilities so -// it is safe to assume that stdio is available. - -externC void -cyg_test_init(void) -{ -} - -// This simply implements the current interface, warts and all. -// It is necessary to keep track of any failures or invalid -// calls. -static int failures = 0; - -externC void -cyg_test_output(Cyg_test_code status, const char* msg, int line_number, const char* file) -{ - if (CYGNUM_TEST_FAIL == status) - failures++; - - if (0 == msg) - msg = ""; - if (0 == file) - file = ""; - - if (CYGNUM_TEST_FAIL == status) { - printf("FAIL:<%s> Line: %d, File: %s\n", msg, line_number, file); - } else { - printf("%s:<%s>\n", - (CYGNUM_TEST_PASS == status) ? "PASS" : - (CYGNUM_TEST_EXIT == status) ? "EXIT" : - (CYGNUM_TEST_INFO == status) ? "INFO" : - (CYGNUM_TEST_GDBCMD == status) ? "GDBCMD" : - (CYGNUM_TEST_NA == status) ? "NA" : "UNKNOWN STATUS", - msg); - } - -} - -externC void -cyg_test_exit(void) -{ - exit( (0 < failures) ? EXIT_FAILURE : EXIT_SUCCESS ); -} diff --git a/host/infra/testcase.h b/host/infra/testcase.h deleted file mode 100644 --- a/host/infra/testcase.h +++ /dev/null @@ -1,191 +0,0 @@ -#ifndef CYGONCE_INFRA_TESTCASE_H -#define CYGONCE_INFRA_TESTCASE_H -//========================================================================== -// -// testcase.h -// -// Target side interface for tests -// -//========================================================================== -//####COPYRIGHTBEGIN#### -// -// ---------------------------------------------------------------------------- -// Copyright (C) 1998, 1999, 2000 Red Hat, Inc. -// -// This file is part of the eCos host tools. -// -// This program is free software; you can redistribute it and/or modify it -// under the terms of the GNU General Public License as published by the Free -// Software Foundation; either version 2 of the License, or (at your option) -// any later version. -// -// This program is distributed in the hope that it will be useful, but WITHOUT -// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for -// more details. -// -// You should have received a copy of the GNU General Public License along with -// this program; if not, write to the Free Software Foundation, Inc., -// 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -// -// ---------------------------------------------------------------------------- -// -//####COPYRIGHTEND#### -//========================================================================== -//#####DESCRIPTIONBEGIN#### -// -// Author(s): ctarpy -// Contributors: ctarpy, jlarmour -// Date: 1999-02-16 -// -// -//####DESCRIPTIONEND#### - -#include // Common type definitions and support - - -// CONSTANTS - -// Status codes - -typedef enum { - CYGNUM_TEST_FAIL, - CYGNUM_TEST_PASS, - CYGNUM_TEST_EXIT, - CYGNUM_TEST_INFO, - CYGNUM_TEST_GDBCMD, - CYGNUM_TEST_NA -} Cyg_test_code; - -// FUNCTION PROTOTYPES - -externC void -cyg_test_output(Cyg_test_code _status_, const char* _msg_, int _line_number_, - const char* _file_); - -// This should be called at the start of each test file -externC void -cyg_test_init(void); - -// This causes the test to exit -externC void -cyg_test_exit(void) CYGBLD_ATTRIB_NORET; - -// GLOBALS - -externC int cyg_test_is_simulator; // infrastructure changes as necessary - -// MACROS - -// ----------- Info ----------- -// -// Any macro with EXIT in it should only be used in a panic situation. It -// is synonymous with assert. If the test behaves as expected, it -// should call one of the FINISH macros. -// -// - Compound testcases -// If a testcase is capable of being part of a compound, then the following -// rules apply: -// - The testcase must only ever call one of the EXIT macros if it decides -// the state of the system is such that further testing is meaningless; -// such a call would prevent subsequent tests in the compound from being -// run. -// - In order to terminate the test, the testcase should call one of the -// FINISH macros. This must be done from within main(). - - - - -// The following is the testcase API to be used by testcases. - -#define CYG_TEST_INIT() cyg_test_init() - -#define CYG_TEST_INFO( _msg_ ) \ - cyg_test_output(CYGNUM_TEST_INFO, _msg_, __LINE__, __FILE__) - -#define CYG_TEST_PASS( _msg_ ) \ - cyg_test_output(CYGNUM_TEST_PASS, _msg_, __LINE__, __FILE__) - -#define CYG_TEST_FAIL( _msg_ ) \ - cyg_test_output(CYGNUM_TEST_FAIL, _msg_, __LINE__, __FILE__) - -#define CYG_TEST_EXIT( _msg_ ) \ - (cyg_test_output(CYGNUM_TEST_EXIT, _msg_, __LINE__, __FILE__), \ - cyg_test_exit()) - -// Use the following macro to instruct GDB to run a command when using -// the automatic testing infrastructure. This must be used *before* -// CYG_TEST_INIT() is called - -#define CYG_TEST_GDBCMD( _command_ ) \ - CYG_MACRO_START \ - cyg_test_output(CYGNUM_TEST_GDBCMD, _command_, __LINE__, __FILE__); \ - CYG_MACRO_END - -// Use the following macro to declare that a test is not applicable for -// some reason - perhaps not appropriate due to chosen hardware, -// configuration options governing the presence of a tested feature, or -// even configuration options governing the presence of a feature the -// test relies on _in_order_ to test the feature (despite being -// unrelated!) - -#define CYG_TEST_NA( _msg_ ) \ - CYG_MACRO_START \ - cyg_test_output(CYGNUM_TEST_NA, _msg_, __LINE__, __FILE__); \ - cyg_test_exit(); \ - CYG_MACRO_END - -#ifdef CYG_COMPOUND_TEST -# define CYG_TEST_FINISH( _msg_ ) \ - CYG_MACRO_START \ - cyg_test_output(CYGNUM_TEST_EXIT, _msg_, __LINE__, __FILE__); \ - return 0; \ - CYG_MACRO_END -#else -# define CYG_TEST_FINISH( _msg_ ) CYG_TEST_EXIT( _msg_ ) -#endif - -#define CYG_TEST_STILL_ALIVE( _ctr_ , _msg_ ) CYG_TEST_INFO( _msg_ ) - - -// ----- The following are convenience functions - -#define CYG_TEST_PASS_FINISH( _msg_ ) \ - CYG_MACRO_START \ - CYG_TEST_PASS( _msg_ ); \ - CYG_TEST_FINISH("done"); \ - CYG_MACRO_END - -#define CYG_TEST_FAIL_FINISH( _msg_ ) \ - CYG_MACRO_START \ - CYG_TEST_FAIL( _msg_ ); \ - CYG_TEST_FINISH("done"); \ - CYG_MACRO_END - - -#define CYG_TEST_CHECK( _chk_ , _msg_) \ - CYG_MACRO_START \ - (void)(( _chk_ ) || ( CYG_TEST_FAIL( _msg_ ) , cyg_test_exit(), 1)); \ - CYG_MACRO_END - -#define CYG_TEST_PASS_FAIL( _cdn_, _msg_ ) \ - CYG_MACRO_START \ - if ( _cdn_ ) CYG_TEST_PASS( _msg_ ); else CYG_TEST_FAIL( _msg_ ); \ - CYG_MACRO_END - - -// CYG_TEST_PASS_EXIT and CYG_TEST_FAIL_EXIT are now obscelete, -// but are here for now -// to avoid breaking testcases which still use them. They will -// soon go away. -#define CYG_TEST_PASS_EXIT( _msg_ ) \ - (cyg_test_output(CYGNUM_TEST_PASS, _msg_, __LINE__, __FILE__), \ - CYG_TEST_EXIT("done")) - -#define CYG_TEST_FAIL_EXIT( _msg_ ) \ - (cyg_test_output(CYGNUM_TEST_FAIL, _msg_, __LINE__, __FILE__), \ - CYG_TEST_EXIT("done")) - - -#endif // CYGONCE_INFRA_TESTCASE_H -// EOF testcase.h diff --git a/host/infra/testsuite/Makefile.am b/host/infra/testsuite/Makefile.am deleted file mode 100644 --- a/host/infra/testsuite/Makefile.am +++ /dev/null @@ -1,42 +0,0 @@ -## Process this file with automake to produce Makefile.in -## ===================================================================== -## -## Makefile.am -## -## Host side implementation of the eCos infrastructure assertions. -## -## ===================================================================== -#######ECOSHOSTGPLCOPYRIGHTBEGIN#### -## ---------------------------------------------------------------------------- -# Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc. -# -# This file is part of the eCos host tools. -# -# This program is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License as published by the Free -# Software Foundation; either version 2 of the License, or (at your option) -# any later version. -# -# This program is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for -# more details. -# -# You should have received a copy of the GNU General Public License along with -# this program; if not, write to the Free Software Foundation, Inc., -# 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -# -## ---------------------------------------------------------------------------- -#######ECOSHOSTGPLCOPYRIGHTEND#### -## ===================================================================== -#######DESCRIPTIONBEGIN#### -## -## Author(s): bartv -## Contact(s): bartv -## Date: 1998/07/13 -## Version: 0.01 -## -######DESCRIPTIONEND#### -## ===================================================================== - -AUTOMAKE_OPTIONS = 1.3 foreign dejagnu diff --git a/host/infra/testsuite/Makefile.in b/host/infra/testsuite/Makefile.in deleted file mode 100644 --- a/host/infra/testsuite/Makefile.in +++ /dev/null @@ -1,251 +0,0 @@ -# Makefile.in generated automatically by automake 1.4-p5 from Makefile.am - -# Copyright (C) 1994, 1995-8, 1999, 2001 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. - -#######ECOSHOSTGPLCOPYRIGHTBEGIN#### -# Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc. -# -# This file is part of the eCos host tools. -# -# This program is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License as published by the Free -# Software Foundation; either version 2 of the License, or (at your option) -# any later version. -# -# This program is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for -# more details. -# -# You should have received a copy of the GNU General Public License along with -# this program; if not, write to the Free Software Foundation, Inc., -# 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -# -#######ECOSHOSTGPLCOPYRIGHTEND#### -#######DESCRIPTIONBEGIN#### -######DESCRIPTIONEND#### - - -SHELL = @SHELL@ - -srcdir = @srcdir@ -top_srcdir = @top_srcdir@ -VPATH = @srcdir@ -prefix = @prefix@ -exec_prefix = @exec_prefix@ - -bindir = @bindir@ -sbindir = @sbindir@ -libexecdir = @libexecdir@ -datadir = @datadir@ -sysconfdir = @sysconfdir@ -sharedstatedir = @sharedstatedir@ -localstatedir = @localstatedir@ -libdir = @libdir@ -infodir = @infodir@ -mandir = @mandir@ -includedir = @includedir@ -oldincludedir = /usr/include - -DESTDIR = - -pkgdatadir = $(datadir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ - -top_builddir = .. - -ACLOCAL = @ACLOCAL@ -AUTOCONF = @AUTOCONF@ -AUTOMAKE = @AUTOMAKE@ -AUTOHEADER = @AUTOHEADER@ - -INSTALL = @INSTALL@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS) -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -transform = @program_transform_name@ - -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -host_alias = @host_alias@ -host_triplet = @host@ -CC = @CC@ -CXX = @CXX@ -ECOS_REPOSITORY = @ECOS_REPOSITORY@ -EXEEXT = @EXEEXT@ -MAINT = @MAINT@ -MAKEINFO = @MAKEINFO@ -MSVC_SRCDIR = @MSVC_SRCDIR@ -OBJEXT = @OBJEXT@ -PACKAGE = @PACKAGE@ -PACKAGE_DIR = @PACKAGE_DIR@ -PACKAGE_INSTALL = @PACKAGE_INSTALL@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -RANLIB = @RANLIB@ -VERSION = @VERSION@ -ecos_CFLAGS = @ecos_CFLAGS@ -ecos_CXXFLAGS = @ecos_CXXFLAGS@ -ecos_INCLUDES = @ecos_INCLUDES@ -ecos_LDADD = @ecos_LDADD@ -ecos_LIBS = @ecos_LIBS@ -ecos_infra_incdir = @ecos_infra_incdir@ -ecos_infra_libdir = @ecos_infra_libdir@ -ecos_libcdl_incdir = @ecos_libcdl_incdir@ -ecos_libcdl_libdir = @ecos_libcdl_libdir@ -ecos_tk_includes = @ecos_tk_includes@ -ecos_tk_libs = @ecos_tk_libs@ - -AUTOMAKE_OPTIONS = 1.3 foreign dejagnu -mkinstalldirs = $(SHELL) $(top_srcdir)/../../acsupport/mkinstalldirs -CONFIG_HEADER = ../hostinfra.h -CONFIG_CLEAN_FILES = -DIST_COMMON = Makefile.am Makefile.in - - -DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) - -TAR = gtar -GZIP_ENV = --best -EXPECT = expect -RUNTEST = runtest -all: all-redirect -.SUFFIXES: -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) - cd $(top_srcdir) && $(AUTOMAKE) --foreign testsuite/Makefile - -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES) - cd $(top_builddir) \ - && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status - -tags: TAGS -TAGS: - - -distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) - -subdir = testsuite - -distdir: $(DISTFILES) - here=`cd $(top_builddir) && pwd`; \ - top_distdir=`cd $(top_distdir) && pwd`; \ - distdir=`cd $(distdir) && pwd`; \ - cd $(top_srcdir) \ - && $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --foreign testsuite/Makefile - @for file in $(DISTFILES); do \ - d=$(srcdir); \ - if test -d $$d/$$file; then \ - cp -pr $$d/$$file $(distdir)/$$file; \ - else \ - test -f $(distdir)/$$file \ - || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ - || cp -p $$d/$$file $(distdir)/$$file || :; \ - fi; \ - done - -RUNTESTFLAGS = - -DEJATOOL = $(PACKAGE) - -RUNTESTDEFAULTFLAGS = --tool $(DEJATOOL) --srcdir $$srcdir - -check-DEJAGNU: site.exp - srcdir=`cd $(srcdir) && pwd`; export srcdir; \ - EXPECT=$(EXPECT); export EXPECT; \ - runtest=$(RUNTEST); \ - if $(SHELL) -c "$$runtest --version" > /dev/null 2>&1; then \ - $$runtest $(RUNTESTDEFAULTFLAGS) $(RUNTESTFLAGS); \ - else echo "WARNING: could not find \`runtest'" 1>&2; :;\ - fi -site.exp: Makefile - @echo 'Making a new site.exp file...' - @test ! -f site.bak || rm -f site.bak - @echo '## these variables are automatically generated by make ##' > $@-t - @echo '# Do not edit here. If you wish to override these values' >> $@-t - @echo '# edit the last section' >> $@-t - @echo 'set tool $(DEJATOOL)' >> $@-t - @echo 'set srcdir $(srcdir)' >> $@-t - @echo 'set objdir' `pwd` >> $@-t - @echo 'set host_alias $(host_alias)' >> $@-t - @echo 'set host_triplet $(host_triplet)' >> $@-t - @echo '## All variables above are generated by configure. Do Not Edit ##' >> $@-t - @test ! -f site.exp || sed '1,/^## All variables above are.*##/ d' site.exp >> $@-t - @test ! -f site.exp || mv site.exp site.bak - @mv $@-t site.exp -info-am: -info: info-am -dvi-am: -dvi: dvi-am -check-am: all-am - $(MAKE) $(AM_MAKEFLAGS) check-DEJAGNU -check: check-am -installcheck-am: -installcheck: installcheck-am -install-exec-am: -install-exec: install-exec-am - -install-data-am: -install-data: install-data-am - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am -install: install-am -uninstall-am: -uninstall: uninstall-am -all-am: Makefile -all-redirect: all-am -install-strip: - $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install -installdirs: - - -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -rm -f Makefile $(CONFIG_CLEAN_FILES) - -rm -f config.cache config.log stamp-h stamp-h[0-9]* - -maintainer-clean-generic: -mostlyclean-am: mostlyclean-generic - -mostlyclean: mostlyclean-am - -clean-am: clean-generic mostlyclean-am - -clean: clean-am - -distclean-am: distclean-generic clean-am - -distclean: distclean-am - -maintainer-clean-am: maintainer-clean-generic distclean-am - @echo "This command is intended for maintainers to use;" - @echo "it deletes files that may require special tools to rebuild." - -maintainer-clean: maintainer-clean-am - -.PHONY: tags distdir check-DEJAGNU info-am info dvi-am dvi check \ -check-am installcheck-am installcheck install-exec-am install-exec \ -install-data-am install-data install-am install uninstall-am uninstall \ -all-redirect all-am all installdirs mostlyclean-generic \ -distclean-generic clean-generic maintainer-clean-generic clean \ -mostlyclean distclean maintainer-clean - - -# 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/host/infra/testsuite/config/default.exp b/host/infra/testsuite/config/default.exp deleted file mode 100644 --- a/host/infra/testsuite/config/default.exp +++ /dev/null @@ -1,116 +0,0 @@ -#=============================================================================== -# -# default.exp -# -# Support for host-side testing -# -#=============================================================================== -######COPYRIGHTBEGIN#### -# -# ---------------------------------------------------------------------------- -# Copyright (C) 1998, 1999, 2000 Red Hat, Inc. -# -# This file is part of the eCos host tools. -# -# This program is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License as published by the Free -# Software Foundation; either version 2 of the License, or (at your option) -# any later version. -# -# This program is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for -# more details. -# -# You should have received a copy of the GNU General Public License along with -# this program; if not, write to the Free Software Foundation, Inc., -# 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -# -# ---------------------------------------------------------------------------- -# -######COPYRIGHTEND#### -#=============================================================================== -######DESCRIPTIONBEGIN#### -# -# Author(s): bartv -# Contributors: bartv -# Date: 1998-11-24 -# -#####DESCRIPTIONEND#### -#=============================================================================== -# - -# The host-side infrastructure tests will only run on the hosts, i.e. -# only native testing is possible. -if { [isnative] != 1 } { - perror "Only native testing is supported." - exit 1 -} - -# Most of the test harness lives in a file hosttest.exp. This is part -# of the host-side infrastructure and gets installed in the directory -# $(PREFIX)/share/dejagnu. Other packages have to locate the file -# the hard way since the PREFIX is not provided automatically in -# the site.exp file, instead it is necessary to search through the -# build tree's Makefile. In the case of the infrastructure itself -# a shortcut is both possible and desirable because the script may -# not have been installed yet. -# -# Note that srcdir actually points at the testsuite subdirectory, not -# at the real srcdir. -set filename [file join $::srcdir .. hosttest.exp] -set status [ catch { source $filename } message] -if { $status != 0 } { - perror ("Unexpected error while reading in the support script $filename\n$message" -} - -# Now that the hosttest.exp utilities are available it is possible to do -# a bit more initialization. In particular it is possible to read in the -# build tree's Makefile and look for definitions of CC, CXX, and any -# other information from the Makefile that may prove useful. -hosttest_initialize - -# There are standard routines ${tool}_start, ${tool}_load, ${tool}_exit -# and ${tool}_version which test harnesses should normally implement. -# In practice runtest only invokes ${tool}_exit and ${tool}_version -# directly, the rest may or may not be invoked from inside the individual -# test scripts. -# -# ${tool}_version is relatively straightforward. The master version -# number is maintained in the configure.in script and is exported to -# the build tree's Makefile. There is a hosttest routine which does the -# hard work because getting the information is common to all host -# packages. The _version routine itself cannot be made completely generic -# because the first output is package-specific. - -proc ${tool}_version { } { - - set status [ catch { hosttest_extract_version } message] - if { $status != 0 } { - perror $message - return - } - clone_output "[file join $::objdir libcyginfra.a] $message" -} - -# ${tool}_start does not serve any useful purpose when it comes to -# testing libcyginfra.a - there is no tool which can be started up. -# Therefore none of the individual test scripts will invoke this -# routine. - -proc ${tool}_start { } { - perror "Cyginfra is a library, not a tool, and cannot be started." -} - -# ${tool}_load is used to load a test case into the tool. The exact -# meaning is not applicable. However it makes sense to have this -# routine provide an alias for hosttest_run_simple_test which provides -# all the libraries etc. that are going to be needed. - -proc ${tool}_load { program { args ""} } { - hosttest_run_simple_test $program {} {} {} cyginfra $args -} - -# ${tool}_exit does not serve any useful purpose here. -proc ${tool}_exit { } { -} diff --git a/host/infra/testsuite/cyginfra/assert.exp b/host/infra/testsuite/cyginfra/assert.exp deleted file mode 100644 --- a/host/infra/testsuite/cyginfra/assert.exp +++ /dev/null @@ -1,341 +0,0 @@ -#=============================================================================== -# -# assert.exp -# -# Assertion test cases -# -#=============================================================================== -######COPYRIGHTBEGIN#### -# -# ---------------------------------------------------------------------------- -# Copyright (C) 1998, 1999, 2000 Red Hat, Inc. -# -# This file is part of the eCos host tools. -# -# This program is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License as published by the Free -# Software Foundation; either version 2 of the License, or (at your option) -# any later version. -# -# This program is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for -# more details. -# -# You should have received a copy of the GNU General Public License along with -# this program; if not, write to the Free Software Foundation, Inc., -# 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -# -# ---------------------------------------------------------------------------- -# -######COPYRIGHTEND#### -#=============================================================================== -######DESCRIPTIONBEGIN#### -# -# Author(s): bartv -# Contributors: bartv -# Date: 1998-11-25 -# -#####DESCRIPTIONEND#### -#=============================================================================== - -# ---------------------------------------------------------------------------- -# Start with the simple tests. -${tool}_load tassert1 -${tool}_load tassert2 -${tool}_load tassert3 -${tool}_load tassert4 - -# tassert5 is not buildable under Linux. It is a C program linked with -# a C++ library, and there are dependencies on the default new and -# delete operators which are not satisfied. - -if { [string match "cl*" $::hosttest_data(CC)] } { - ${tool}_load tassert5 -} else { - unsupported "using the infrastructure from C code" -} - -${tool}_load tassert6 -${tool}_load tassert7 - -# ---------------------------------------------------------------------------- -# tassert8 is a bit more complicated. It involves an assertion which -# is not caught in any way by the application code. Therefore the -# output of the program has to be analysed to make sure it is -# reasonable. There is also going to be a dump file that needs -# to be analysed and cleaned up. - -proc tassert8_filter { name result output } { - - set all_ok 1 - - if { $result == 0 } { - fail "testcase $name should have a non-zero exit code" - set all_ok 0 - } - - # Convert the output to a list of lines. - set lines [split $output "\n"] - - # The first line of interest should contain the phrase - # "Assertion failure" and the string embedded in tassert8.cxx - while { 1 } { - if { [llength $lines] == 0 } { - set all_ok 0 - fail "No \"Assertion failure\" message detected in program output" - break - } - set line [lindex $lines 0] - set lines [lreplace $lines 0 0] - if { [regexp -nocase -- {^assertion failure.*it seemed like a good idea at the time$} $line] } { - break - } - } - - # The next line should indicate the file and the line number - if { [llength $lines] == 0 } { - set all_ok 0 - fail "No file name or line number information" - } else { - set line [lindex $lines 0] - set lines [lreplace $lines 0 0] - if { [regexp -nocase -- {^file .*tassert8.cxx.*line number [0-9]+$} $line] == 0} { - fail "Output did not contain the expected filename and linenumber" - } - } - # There may or may not be a line containing the function name. - # This should not be checked, it depends on compiler support - # for __PRETTY_FUNCTION__. The next line of interest is - # "Writing additional output to xxx", where xxx is a filename. - while { 1 } { - if { [llength $lines] == 0 } { - set all_ok 0 - fail "Output did not specify where the dump information was stored" - break - } else { - set line [lindex $lines 0] - set lines [lreplace $lines 0 0] - set dummy "" - set match "" - if { [regexp -- {^Writing additional output to (.*)$} $line dummy match] } { - tassert8_process_dump $match all_ok - break - } - } - } - - if { $all_ok } { - pass "Assertions generate sensible output" - } - - return 0 -} - -proc tassert8_process_dump { filename all_ok_arg } { - - upvar $all_ok_arg all_ok - set realname [hosttest_translate_existing_filename $filename] - if { $realname == "" } { - set all_ok 0 - fail "Unable to find assertion dump file $filename" - return - } - set lines {} - set status [ catch { - set fd [open $realname r] - set data [read $fd] - close $fd - set lines [split $data "\n"] - if { [llength $lines] == 0 } { - set all_ok 0 - fail "The assertion dump file $realname contains no data" - } - } message ] - if { $status != 0 } { - set all_ok 0 - fail "Unable to open assertion output file $realname, $message" - } - set status [ catch { file delete $realname } message ] - if { $status != 0 } { - warning "Unable to delete assertion dump file $realname, $message" 0 - } - if { [llength $lines] == 0 } { - return - } - - # We have some data to process. The information should include - # the following: - # 1) a line Assertion failure msg - # 2) a line with the filename and the linenumber - # 3) optionally a line with the function name. This depends on - # compiler support. - # 4) information from callback1 - # 5) information from callback2 - # - # The relative order of (4) and (5) is not defined. - while { 1 } { - if { [llength $lines] == 0 } { - set all_ok 0 - fail "No \"Assertion failure\" message detected in output file" - break - } - set line [lindex $lines 0] - set lines [lreplace $lines 0 0] - if { [regexp -nocase -- {^assertion failure.*it seemed like a good idea at the time$} $line] } { - break - } - } - - if { [llength $lines] == 0 } { - set all_ok 0 - fail "No file name or line number information" - } else { - set line [lindex $lines 0] - set lines [lreplace $lines 0 0] - if { [regexp -nocase -- {^file .*tassert8.cxx.*line number [0-9]+$} $line] == 0} { - set all_ok 0 - fail "Output did not contain the expected filename and linenumber" - } - } - - set seen_callback1 0 - set seen_callback2 0 - while { [llength $lines] > 0 } { - - set line [lindex $lines 0] - set lines [lreplace $lines 0 0] - - if { [regexp -nocase -- {^\# \{\{\{.*callback1.*$} $line] } { - if { $seen_callback1 != 0 } { - set all_ok 0 - fail "Output contains multiple occurrences of callback1" - continue - } - set seen_callback1 1 - - while { [llength $lines] > 0 } { - set line [lindex $lines 0] - set lines [lreplace $lines 0 0] - - if { [regexp -nocase -- {^\# \}\}\}.*$} $line] } { - break - } - - # callback1 should not generate any output so only blank lines - # are acceptable - if { [regexp -nocase -- {^ *$} $line] != 1} { - set all_ok 0 - fail "Unexpected data in callback1 output: $line" - # Do not repeat this failure message. This break will - # do near enough the right thing. - break - } - } - - } elseif { [regexp -nocase -- {^\# \{\{\{.*callback2.*$} $line] } { - if { $seen_callback2 != 0 } { - set all_ok 0 - fail "Output contains multiple occurrences of callback2" - } - set seen_callback2 1 - - while { [llength $lines] > 0 } { - set line [lindex $lines 0] - set lines [lreplace $lines 0 0] - - if { [regexp -nocase -- {^\# \}\}\}.*$} $line] } { - break - } - - # callback2 is allowed to generate blank lines and - # fixed lines. - if { [regexp -nocase -- {^ *$} $line] == 1 } { - continue - } - if { $line == "callback2 output" } { - continue - } - set all_ok 0 - fail "Unexpected data in callback2 output: $line" - } - - } - } - if { ($seen_callback1 == 0) || ($seen_callback2 == 0) } { - set all_ok 0 - fail "Output did not contain all the callback information" - } -} - -hosttest_run_test_with_filter tassert8 tassert8_filter {} {} {} cyginfra {} - -# ---------------------------------------------------------------------------- -# Strictly speaking this is not an assertion test. However there are some -# support routines in hosttest.exp which are tried closely to the -# implementation of the assertion code, and it is worthwhile checking -# these. The tassert8 testcase can be reused for this. - -proc tassert9_filter { name result output } { - - if { [hosttest_assert_check $result $output] == 0 } { - fail "testcase did not generate a recognised assertion" - return - } - - set output [hosttest_assert_read_dump $output] - if { $output == "" } { - fail "testcase did not generate a recognised assertion dump" - return - } - - set all_ok 1 - - set callback1_output [hosttest_assert_extract_callback $output "callback1"] - set callback2_output [hosttest_assert_extract_callback $output "callback2"] - - # Callback1 output should be empty, all blank lines should have been filtered - # out. - if { $callback1_output != "" } { - set all_ok 0 - fail "callback1 output should be empty" - } - set lines [split $callback2_output "\n"] - if { [llength $lines] == 0 } { - set all_ok 0 - fail "callback2 should have produced some output" - } elseif { [llength $lines] < 10} { - set all_ok 0 - fail "callback2 is supposted to have at least ten lines of output" - } else { - # There should be ten lines of output, possibly followed by - # some blanks. - for { set i 0 } { $i < 10 } { incr i } { - set line [lindex $lines 0] - set lines [lreplace $lines 0 0] - if { $line != "callback2 output" } { - set all_ok 0 - fail "incorrect output from callback2" - break - } - } - - while { [llength $lines] > 0 } { - set line [lindex $lines 0] - set lines [lreplace $lines 0 0] - if { [regexp -- {^ *$} $line] != 1 } { - set all_ok 0 - fail "callback2 output contains unexpected data" - break - } - } - } - - if { $all_ok } { - pass "assertion output and dump file format match test harness expectations" - } - return 0 -} - -hosttest_run_test_with_filter tassert9 tassert9_filter tassert8.cxx {} {} cyginfra {} - diff --git a/host/infra/testsuite/cyginfra/regress.exp b/host/infra/testsuite/cyginfra/regress.exp deleted file mode 100644 --- a/host/infra/testsuite/cyginfra/regress.exp +++ /dev/null @@ -1,40 +0,0 @@ -#=============================================================================== -# -# regress.exp -# -# Regression test cases -# -#=============================================================================== -######COPYRIGHTBEGIN#### -# -# ---------------------------------------------------------------------------- -# Copyright (C) 1998, 1999, 2000 Red Hat, Inc. -# -# This file is part of the eCos host tools. -# -# This program is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License as published by the Free -# Software Foundation; either version 2 of the License, or (at your option) -# any later version. -# -# This program is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for -# more details. -# -# You should have received a copy of the GNU General Public License along with -# this program; if not, write to the Free Software Foundation, Inc., -# 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -# -# ---------------------------------------------------------------------------- -# -######COPYRIGHTEND#### -#=============================================================================== -######DESCRIPTIONBEGIN#### -# -# Author(s): bartv -# Contributors: bartv -# Date: 1998-12-23 -# -#####DESCRIPTIONEND#### -#=============================================================================== diff --git a/host/infra/testsuite/cyginfra/tassert1.cxx b/host/infra/testsuite/cyginfra/tassert1.cxx deleted file mode 100644 --- a/host/infra/testsuite/cyginfra/tassert1.cxx +++ /dev/null @@ -1,197 +0,0 @@ -//========================================================================== -// -// tassert1.cxx -// -// Assertion test case -// -//========================================================================== -//####COPYRIGHTBEGIN#### -// -// ---------------------------------------------------------------------------- -// Copyright (C) 1998, 1999, 2000 Red Hat, Inc. -// -// This file is part of the eCos host tools. -// -// This program is free software; you can redistribute it and/or modify it -// under the terms of the GNU General Public License as published by the Free -// Software Foundation; either version 2 of the License, or (at your option) -// any later version. -// -// This program is distributed in the hope that it will be useful, but WITHOUT -// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for -// more details. -// -// You should have received a copy of the GNU General Public License along with -// this program; if not, write to the Free Software Foundation, Inc., -// 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -// -// ---------------------------------------------------------------------------- -// -//####COPYRIGHTEND#### -//========================================================================== -//#####DESCRIPTIONBEGIN#### -// -// Author(s): bartv -// Contributors: bartv -// Date: 1998-11-27 -// Purpose: -// Description: By default all assertions should be disabled, but -// they should compile just fine. This module uses all -// assertions except CYGFAIL. As a fringe benefit, all -// of the macros get checked for correct argument usage. -// -//####DESCRIPTIONEND#### -//========================================================================== - - -#include -#include -#include - -#ifdef CYGDBG_USE_ASSERTS -# error Assertions should not be enabled by default. -#endif - -static const char message[] = "This should never be seen."; - -class dummy { - private: - int random; - public: - dummy() { - random = rand(); - } - ~dummy() { - random = 0; - } - void assertions(); - static void extern_assertions(dummy*); - bool check_this(cyg_assert_class_zeal) const; -}; - -int main(int argc, char** argv) -{ - dummy object; - - CYG_ASSERT( true, message); - CYG_ASSERT( false, message); - CYG_ASSERTC(true); - CYG_ASSERTC(false); - - CYG_FAIL(message); - - CYG_CHECK_DATA_PTR( &argc, message); - CYG_CHECK_DATA_PTR( 0, message); - CYG_CHECK_FUNC_PTR( &main, message); - CYG_CHECK_FUNC_PTR( 0, message); - CYG_CHECK_DATA_PTRC(&argc); - CYG_CHECK_DATA_PTRC(0); - CYG_CHECK_FUNC_PTRC(&main); - CYG_CHECK_FUNC_PTRC(0); - - CYG_ASSERT_CLASS( &object, message); - CYG_ASSERT_CLASSC( &object); - CYG_ASSERT_CLASSO( object, message); - CYG_ASSERT_CLASSOC( object); - CYG_ASSERTCLASS( &object, message); - CYG_ASSERTCLASSO( object, message); - - CYG_PRECONDITION(true, message); - CYG_PRECONDITION(false, message); - CYG_PRECONDITIONC(true); - CYG_PRECONDITIONC(false); - CYG_PRECONDITION_CLASS(&object, message); - CYG_PRECONDITION_CLASSC(&object); - CYG_PRECONDITION_CLASSO(object, message); - CYG_PRECONDITION_CLASSOC(object); - - CYG_POSTCONDITION(true, message); - CYG_POSTCONDITION(false, message); - CYG_POSTCONDITIONC(true); - CYG_POSTCONDITIONC(false); - CYG_POSTCONDITION_CLASS(&object, message); - CYG_POSTCONDITION_CLASSC(&object); - CYG_POSTCONDITION_CLASSO(object, message); - CYG_POSTCONDITION_CLASSOC(object); - - CYG_LOOP_INVARIANT(true, message); - CYG_LOOP_INVARIANT(false, message); - CYG_LOOP_INVARIANTC(true); - CYG_LOOP_INVARIANTC(false); - CYG_LOOP_INVARIANT_CLASS(&object, message); - CYG_LOOP_INVARIANT_CLASSC(&object); - CYG_LOOP_INVARIANT_CLASSO(object, message); - CYG_LOOP_INVARIANT_CLASSOC(object); - - CYG_INVARIANT(true, message); - CYG_INVARIANT(false, message); - CYG_INVARIANTC(true); - CYG_INVARIANTC(false); - - dummy::extern_assertions( &object); - dummy::extern_assertions( 0); - object.assertions( ); - - CYG_TEST_PASS_FINISH("disabled assertions do nothing"); - return 0; -} - -// A utility routine which performs assertions on this. -void -dummy::assertions() -{ - CYG_INVARIANT_THIS(dummy, message); - CYG_INVARIANT_THISC(dummy); - - CYG_ASSERT_THIS(message); - CYG_ASSERT_THISC(); - CYG_PRECONDITION_THIS(message); - CYG_PRECONDITION_THISC(); - CYG_POSTCONDITION_THIS(message); - CYG_POSTCONDITION_THISC(); - CYG_LOOP_INVARIANT_THIS(message); - CYG_LOOP_INVARIANT_THISC(); -} - -// Another utility which gets passed an object pointer. -// This is useful for the ZERO_OR_CLASS() variants. -void -dummy::extern_assertions(dummy* obj) -{ - dummy obj2; - CYG_INVARIANT_CLASSO(dummy, obj2, message); - CYG_INVARIANT_CLASSOC(dummy, obj2); - CYG_INVARIANT_CLASS(dummy, obj, message); - CYG_INVARIANT_CLASSC(dummy, obj); - CYG_ASSERT_ZERO_OR_CLASS(obj, message); - CYG_ASSERT_ZERO_OR_CLASSC(obj); - CYG_PRECONDITION_ZERO_OR_CLASS(obj, message); - CYG_PRECONDITION_ZERO_OR_CLASSC(obj); - CYG_POSTCONDITION_ZERO_OR_CLASS(obj, message); - CYG_POSTCONDITION_ZERO_OR_CLASSC(obj); - CYG_LOOP_INVARIANT_ZERO_OR_CLASS(obj, message); - CYG_LOOP_INVARIANT_ZERO_OR_CLASSC(obj); -} - -bool -dummy::check_this(cyg_assert_class_zeal zeal) const -{ - // The default zeal should be cyg_quick. - switch(zeal) { - case cyg_quick: - return true; - - case cyg_system_test: - case cyg_extreme: - case cyg_thorough: - case cyg_trivial: - case cyg_none: - CYG_TEST_FAIL_FINISH("incorrect default zeal passed to check_this() member function"); - - default: - CYG_TEST_FAIL_FINISH("invalid zeal passed to check_this() member function"); - } - return false; -} - diff --git a/host/infra/testsuite/cyginfra/tassert2.cxx b/host/infra/testsuite/cyginfra/tassert2.cxx deleted file mode 100644 --- a/host/infra/testsuite/cyginfra/tassert2.cxx +++ /dev/null @@ -1,195 +0,0 @@ -//========================================================================== -// -// tassert2.cxx -// -// Assertion test case -// -//========================================================================== -//####COPYRIGHTBEGIN#### -// -// ---------------------------------------------------------------------------- -// Copyright (C) 1998, 1999, 2000 Red Hat, Inc. -// -// This file is part of the eCos host tools. -// -// This program is free software; you can redistribute it and/or modify it -// under the terms of the GNU General Public License as published by the Free -// Software Foundation; either version 2 of the License, or (at your option) -// any later version. -// -// This program is distributed in the hope that it will be useful, but WITHOUT -// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for -// more details. -// -// You should have received a copy of the GNU General Public License along with -// this program; if not, write to the Free Software Foundation, Inc., -// 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -// -// ---------------------------------------------------------------------------- -// -//####COPYRIGHTEND#### -//========================================================================== -//#####DESCRIPTIONBEGIN#### -// -// Author(s): bartv -// Contributors: bartv -// Date: 1998-12-21 -// Purpose: -// Description: All assertions are enabled but should pass. -// -//####DESCRIPTIONEND#### -//========================================================================== - -#define CYGDBG_USE_ASSERTS -#define CYGDBG_INFRA_DEBUG_PRECONDITIONS -#define CYGDBG_INFRA_DEBUG_POSTCONDITIONS -#define CYGDBG_INFRA_DEBUG_LOOP_INVARIANTS -#define CYGDBG_INFRA_DEBUG_INVARIANTS - -#include -#include -#include - - -static const char message[] = "This should never be seen."; - -class dummy { - private: - int random; - public: - dummy() { - random = rand(); - } - ~dummy() { - random = 0; - } - void assertions(); - void zero_assertions(); - static void extern_assertions(dummy*); - static void zero_assertions(dummy*); - bool check_this(cyg_assert_class_zeal) const; -}; - -int main(int argc, char** argv) -{ - dummy object; - - CYG_ASSERT( true, message); - CYG_ASSERTC(true); - - CYG_CHECK_DATA_PTR( &argc, message); - CYG_CHECK_FUNC_PTR( &main, message); - CYG_CHECK_DATA_PTRC(&argc); - CYG_CHECK_FUNC_PTRC(&main); - - CYG_ASSERT_CLASS( &object, message); - CYG_ASSERT_CLASSC( &object); - CYG_ASSERT_CLASSO( object, message); - CYG_ASSERT_CLASSOC( object); - CYG_ASSERTCLASS( &object, message); - CYG_ASSERTCLASSO( object, message); - - CYG_PRECONDITION(true, message); - CYG_PRECONDITIONC(true); - CYG_PRECONDITION_CLASS(&object, message); - CYG_PRECONDITION_CLASSC(&object); - CYG_PRECONDITION_CLASSO(object, message); - CYG_PRECONDITION_CLASSOC(object); - - CYG_POSTCONDITION(true, message); - CYG_POSTCONDITIONC(true); - CYG_POSTCONDITION_CLASS(&object, message); - CYG_POSTCONDITION_CLASSC(&object); - CYG_POSTCONDITION_CLASSO(object, message); - CYG_POSTCONDITION_CLASSOC(object); - - CYG_LOOP_INVARIANT(true, message); - CYG_LOOP_INVARIANTC(true); - CYG_LOOP_INVARIANT_CLASS(&object, message); - CYG_LOOP_INVARIANT_CLASSC(&object); - CYG_LOOP_INVARIANT_CLASSO(object, message); - CYG_LOOP_INVARIANT_CLASSOC(object); - - CYG_INVARIANT(true, message); - CYG_INVARIANTC(true); - - dummy::extern_assertions( &object); - dummy::zero_assertions( &object); - object.assertions( ); - - CYG_TEST_PASS_FINISH("true assertions do nothing"); - return 0; -} - -// A utility routine which performs assertions on this. -void -dummy::assertions() -{ - CYG_INVARIANT_THIS(dummy, message); - CYG_INVARIANT_THISC(dummy); - - CYG_ASSERT_THIS(message); - CYG_ASSERT_THISC(); - CYG_PRECONDITION_THIS(message); - CYG_PRECONDITION_THISC(); - CYG_POSTCONDITION_THIS(message); - CYG_POSTCONDITION_THISC(); - CYG_LOOP_INVARIANT_THIS(message); - CYG_LOOP_INVARIANT_THISC(); -} - -// Another utility which gets passed an object pointer. -// This is useful for the ZERO_OR_CLASS() variants. -void -dummy::extern_assertions(dummy* obj) -{ - dummy obj2; - CYG_INVARIANT_CLASSO(dummy, obj2, message); - CYG_INVARIANT_CLASSOC(dummy, obj2); - CYG_INVARIANT_CLASS(dummy, obj, message); - CYG_INVARIANT_CLASSC(dummy, obj); - - CYG_ASSERT_ZERO_OR_CLASS(obj, message); - CYG_ASSERT_ZERO_OR_CLASSC(obj); - CYG_PRECONDITION_ZERO_OR_CLASS(obj, message); - CYG_PRECONDITION_ZERO_OR_CLASSC(obj); - CYG_POSTCONDITION_ZERO_OR_CLASS(obj, message); - CYG_POSTCONDITION_ZERO_OR_CLASSC(obj); - CYG_LOOP_INVARIANT_ZERO_OR_CLASS(obj, message); - CYG_LOOP_INVARIANT_ZERO_OR_CLASSC(obj); -} - -void -dummy::zero_assertions(dummy* obj) -{ - CYG_ASSERT_ZERO_OR_CLASS(obj, message); - CYG_ASSERT_ZERO_OR_CLASSC(obj); - CYG_PRECONDITION_ZERO_OR_CLASS(obj, message); - CYG_PRECONDITION_ZERO_OR_CLASSC(obj); - CYG_POSTCONDITION_ZERO_OR_CLASS(obj, message); - CYG_POSTCONDITION_ZERO_OR_CLASSC(obj); - CYG_LOOP_INVARIANT_ZERO_OR_CLASS(obj, message); - CYG_LOOP_INVARIANT_ZERO_OR_CLASSC(obj); -} - -bool -dummy::check_this(cyg_assert_class_zeal zeal) const -{ - // The default zeal should be cyg_quick. - switch(zeal) { - case cyg_quick: - return true; - - case cyg_system_test: - case cyg_extreme: - case cyg_thorough: - case cyg_trivial: - case cyg_none: - CYG_TEST_FAIL_FINISH("incorrect default zeal passed to check_this() member function"); - - default: - CYG_TEST_FAIL_FINISH("invalid zeal passed to check_this() member function"); - } - return false; -} diff --git a/host/infra/testsuite/cyginfra/tassert3.cxx b/host/infra/testsuite/cyginfra/tassert3.cxx deleted file mode 100644 --- a/host/infra/testsuite/cyginfra/tassert3.cxx +++ /dev/null @@ -1,345 +0,0 @@ -//========================================================================== -// -// tassert3.cxx -// -// Assertion test case -// -//========================================================================== -//####COPYRIGHTBEGIN#### -// -// ---------------------------------------------------------------------------- -// Copyright (C) 1998, 1999, 2000 Red Hat, Inc. -// -// This file is part of the eCos host tools. -// -// This program is free software; you can redistribute it and/or modify it -// under the terms of the GNU General Public License as published by the Free -// Software Foundation; either version 2 of the License, or (at your option) -// any later version. -// -// This program is distributed in the hope that it will be useful, but WITHOUT -// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for -// more details. -// -// You should have received a copy of the GNU General Public License along with -// this program; if not, write to the Free Software Foundation, Inc., -// 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -// -// ---------------------------------------------------------------------------- -// -//####COPYRIGHTEND#### -//========================================================================== -//#####DESCRIPTIONBEGIN#### -// -// Author(s): bartv -// Contributors: bartv -// Date: 1998-12-21 -// Purpose: -// Description: Check the host extensions. -// -//####DESCRIPTIONEND#### -//========================================================================== - -// ------------------------------------------------------------------------- -// The host-side assertion support has three extensions to the generic -// assertion support: -// -// 1) cyg_assert_install_failure_handler() -// Provide an alternative handler that gets invoked when an -// assertion fails. -// -// 2) cyg_assert_install_failure_callback() -// Provide an additional callback that should get invoked when an -// assertion triggers to provide additional information. -// -// 3) cyg_assert_failure_invoke_callbacks() -// Used by (1) to call the functions installed via (2). -// -// The tests make use of setjmp()/longjmp() buffer to avoid having to -// do lots of output parsing in the DejaGnu driver. - -#define CYG_DECLARE_HOST_ASSERTION_SUPPORT -#define CYGDBG_USE_ASSERTS -#define CYGDBG_INFRA_DEBUG_PRECONDITIONS -#define CYGDBG_INFRA_DEBUG_POSTCONDITIONS -#define CYGDBG_INFRA_DEBUG_LOOP_INVARIANTS -#define CYGDBG_INFRA_DEBUG_INVARIANTS - -#include -#include -#include -#include -#include - -// Forward declarations of some integers to allow the line number to be -// checked. -extern cyg_uint32 main_start, main_end; - -// This is used to "recover" from an assertion failure -static jmp_buf setjmp_buffer; - -// A constant string useful for comparisons. -static const char message[] = "fail"; - -// Some state information to make sure that the world is in the expected -// state -bool expecting_failure1 = false; -bool expecting_failure2 = false; -bool expecting_failure3 = false; - -// ------------------------------------------------------------------------- -// The first assertion handler. This is used to check that the arguments -// make sense. - -extern "C" -bool -failure_handler1(const char* fn, const char* file, cyg_uint32 line, const char* msg) -{ - if (!expecting_failure1) { - CYG_TEST_FAIL("assertion failure handler1 invoked unexpectedly"); - } - expecting_failure1 = false; - // The function should be 0 or contain main - if (0 != fn) { - if (0 == strstr(fn, "main")) { - CYG_TEST_FAIL("invalid function name passed to assertion failure handler"); - } - } - // The file name should always be valid and contain tassert3.cxx. - // It may contain path information as well. - if ( (0 == file) || (0 == strstr(file, "tassert3.cxx"))) { - CYG_TEST_FAIL("invalid file name passed to assertion failure handler"); - } - // The line number can be validated against some globals. - if ((line <= main_start) || (line >= main_end)) { - CYG_TEST_FAIL("invalid line number passed to assertion failure handler"); - } - // The message passed is known. - if (0 != strcmp(msg, message)) { - CYG_TEST_FAIL("invalid message passed to assertion failure handler"); - } - CYG_TEST_PASS("application-specific assertion failure handler"); - - // Everything OK, back to main() - longjmp(setjmp_buffer, 1); - CYG_TEST_FAIL_FINISH("longjmp() is not functional"); - return false; -} - -// ------------------------------------------------------------------------- -// A second assertion handler. This is used to make sure that assertion -// failure handlers can be overwritten. - -extern "C" -bool -failure_handler2(const char* fn, const char* file, cyg_uint32 line, const char* msg) -{ - if (!expecting_failure2) { - CYG_TEST_FAIL("assertion failure handler2 invoked incorrectly"); - } - expecting_failure2 = false; - CYG_TEST_PASS("assertion failure handlers can be replaced"); - longjmp(setjmp_buffer, 1); - CYG_TEST_FAIL_FINISH("longjmp() is not functional"); - return false; -} -// ------------------------------------------------------------------------- -// The third assertion handler. This time a couple of output callbacks are -// installed and the main failure handler has to invoke the output callbacks. -// A number of statics are used to make sure everything works ok. - -static const char callback1_title[] = "callback1_header"; -static const char callback2_title[] = "callback2_header"; -static const char callback2_data[] = "callback2 data\n"; -static bool seen_callback1_title = false; -static bool seen_callback2_title = false; -static bool callback1_done = false; -static bool callback2_done = false; -static int number_of_headers = 0; -static bool callback1_invoked = false; -static bool callback2_invoked = false; -static int number_of_lines_seen = 0; -const int callback2_lines = 16; -static int callback2_lines_seen = 0; -static int number_of_trailers = 0; - -extern "C" -void -callback1(void (*outputfn)(const char*)) -{ - if (callback1_invoked) { - CYG_TEST_FAIL("callback1 invoked multiple times"); - } - callback1_invoked = true; - - // This callback does nothing. -} - -extern "C" -void -callback2(void (*outputfn)(const char*)) -{ - if (callback2_invoked) { - CYG_TEST_FAIL("callback2 invoked multiple times"); - } - callback2_invoked = true; - for (int i = 0; i < callback2_lines; i++) { - (*outputfn)(callback2_data); - } -} - -// handle_callback_header() should be invoked at least twice, -// once with callback1_header and once with callback2_header -extern "C" -void -handle_callback_header(const char* name) -{ - number_of_headers++; - if (0 == strcmp(name, callback1_title)) { - if (seen_callback1_title) { - CYG_TEST_FAIL("callback1 title seen multiple times"); - } else { - seen_callback1_title = true; - } - } - if (0 == strcmp(name, callback2_title)) { - if (seen_callback2_title) { - CYG_TEST_FAIL("callback2 title seen multiple times"); - } else { - seen_callback2_title = true; - } - } -} - -// The body output function should be invoked zero times for -// callback1 and a fixed number of times for callback2. -extern "C" -void -handle_callback_body(const char* data) -{ - number_of_lines_seen++; - - if (seen_callback1_title && !callback1_done) { - CYG_TEST_FAIL("callback1 should not perform any output"); - } - if (seen_callback2_title && !callback2_done) { - callback2_lines_seen++; - if (0 != strcmp(data, callback2_data)) { - CYG_TEST_FAIL("callback2 has generated incorrect data"); - } - } -} - -// The trailer output function should be invoked at least twice, once -// for each callback. -extern "C" -void -handle_callback_trailer(void) -{ - if (0 == number_of_headers) { - CYG_TEST_FAIL("callback trailer seen before header"); - } - number_of_trailers++; - if (seen_callback1_title && !callback1_done) { - callback1_done = true; - } - if (seen_callback2_title && !callback2_done) { - callback2_done = true; - } -} - -// This is the failure handler. It causes the various callbacks to run, then -// checks the resulting values of the statics. -extern "C" -bool -failure_handler3(const char* fn, const char* file, cyg_uint32 line, const char* msg) -{ - if (!expecting_failure3) { - CYG_TEST_FAIL("assertion failure handler3 invoked incorrectly"); - } - expecting_failure3 = false; - - cyg_assert_failure_invoke_callbacks( - &handle_callback_header, - &handle_callback_body, - &handle_callback_trailer); - - bool all_ok = true; - if (!seen_callback1_title) { - CYG_TEST_FAIL("callback1's title not seen"); - all_ok = false; - } - if (!seen_callback2_title) { - CYG_TEST_FAIL("callback2's title not seen"); - all_ok = false; - } - if (number_of_headers != number_of_trailers) { - CYG_TEST_FAIL("headers and trailers do not match up"); - all_ok = false; - } - if (!callback1_done) { - CYG_TEST_FAIL("callback1 did not finish"); - all_ok = false; - } - if (!callback2_done) { - CYG_TEST_FAIL("callback2 did not finish"); - all_ok = false; - } - if (number_of_lines_seen < callback2_lines) { - CYG_TEST_FAIL("total number of output lines is less than expected"); - all_ok = false; - } - if (callback2_lines_seen != callback2_lines) { - CYG_TEST_FAIL("callback2 generated the wrong number of lines"); - all_ok = false; - } - - if (all_ok) { - CYG_TEST_PASS("assertion callbacks"); - } - - longjmp(setjmp_buffer, 1); - CYG_TEST_FAIL_FINISH("longjmp() is not functional"); - return false; -} - -// ---------------------------------------------------------------------------- -// main(). Perform the various assertion tests in order. - -cyg_uint32 main_start = (cyg_uint32) __LINE__; -int -main(int argc, char** argv) -{ - expecting_failure1 = true; - // First check, a very basic assertion invocation. - if (setjmp(setjmp_buffer) == 0) { - cyg_assert_install_failure_handler(&failure_handler1); - CYG_FAIL(message); - CYG_TEST_FAIL("assertion did not trigger"); - } - expecting_failure1 = false; - expecting_failure2 = true; - - // Now try installing a different assertion handler. - if (setjmp(setjmp_buffer) == 0) { - cyg_assert_install_failure_handler(&failure_handler2); - CYG_FAIL(message); - CYG_TEST_FAIL("assertion did not trigger"); - } - expecting_failure2 = false; - expecting_failure3 = true; - - if (setjmp(setjmp_buffer) == 0) { - cyg_assert_install_failure_callback(callback1_title, &callback1); - cyg_assert_install_failure_callback(callback2_title, &callback2); - cyg_assert_install_failure_handler(&failure_handler3); - CYG_FAIL(message); - CYG_TEST_FAIL("assertion did not trigger"); - } - expecting_failure3 = false; - - return 0; -} -cyg_uint32 main_end = (cyg_uint32) __LINE__; - diff --git a/host/infra/testsuite/cyginfra/tassert4.c b/host/infra/testsuite/cyginfra/tassert4.c deleted file mode 100644 --- a/host/infra/testsuite/cyginfra/tassert4.c +++ /dev/null @@ -1,220 +0,0 @@ -/* ========================================================================== - * - * tassert4.c - * - * Assertion test case - * - *========================================================================== - *####COPYRIGHTBEGIN#### - * - * ---------------------------------------------------------------------------- - * Copyright (C) 1998, 1999, 2000 Red Hat, Inc. - * - * This file is part of the eCos host tools. - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the Free - * Software Foundation; either version 2 of the License, or (at your option) - * any later version. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along with - * this program; if not, write to the Free Software Foundation, Inc., - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * ---------------------------------------------------------------------------- - * - *####COPYRIGHTEND#### - *========================================================================== - *#####DESCRIPTIONBEGIN#### - * - * Author(s): bartv - * Contributors: bartv - * Date: 1998-11-27 - * Purpose: - * Description: A C equivalent of tassert1.cxx - * - *####DESCRIPTIONEND#### - *========================================================================== - */ - -#include -#include -#include - -#ifdef CYGDBG_USE_ASSERTS -# error Assertions should not be enabled by default. -#endif - -static const char message[] = "This should never be seen."; - -int main(int argc, char** argv) -{ - CYG_ASSERT( true, message); - CYG_ASSERT( false, message); - CYG_ASSERTC(true); - CYG_ASSERTC(false); - - CYG_FAIL(message); - - CYG_CHECK_DATA_PTR( &argc, message); - CYG_CHECK_DATA_PTR( 0, message); - CYG_CHECK_FUNC_PTR( &main, message); - CYG_CHECK_FUNC_PTR( 0, message); - CYG_CHECK_DATA_PTRC(&argc); - CYG_CHECK_DATA_PTRC(0); - CYG_CHECK_FUNC_PTRC(&main); - CYG_CHECK_FUNC_PTRC(0); - - CYG_PRECONDITION(true, message); - CYG_PRECONDITION(false, message); - CYG_PRECONDITIONC(true); - CYG_PRECONDITIONC(false); - - CYG_POSTCONDITION(true, message); - CYG_POSTCONDITION(false, message); - CYG_POSTCONDITIONC(true); - CYG_POSTCONDITIONC(false); - - CYG_LOOP_INVARIANT(true, message); - CYG_LOOP_INVARIANT(false, message); - CYG_LOOP_INVARIANTC(true); - CYG_LOOP_INVARIANTC(false); - - CYG_INVARIANT(true, message); - CYG_INVARIANT(false, message); - CYG_INVARIANTC(true); - CYG_INVARIANTC(false); - - CYG_TEST_PASS_FINISH("disabled assertions in C code do nothing"); - return 0; -} - -#ifdef CYG_ASSERT_CLASS -# error CYG_ASSERT_CLASS macro should not be defined in C code -#endif -#ifdef CYG_ASSERT_CLASSC -# error CYG_ASSERT_CLASSC macro should not be defined in C code -#endif -#ifdef CYG_ASSERT_CLASSO -# error CYG_ASSERT_CLASSO macro should not be defined in C code -#endif -#ifdef CYG_ASSERT_CLASSOC -# error CYG_ASSERT_CLASSOC macro should not be defined in C code -#endif -#ifdef CYG_ASSERT_ZERO_OR_CLASS -# error CYG_ASSERT_ZERO_OR_CLASS macro should not be defined in C code -#endif -#ifdef CYG_ASSERT_ZERO_OR_CLASSC -# error CYG_ASSERT_ZERO_OR_CLASSC macro should not be defined in C code -#endif -#ifdef CYG_ASSERT_THIS -# error CYG_ASSERT_THIS macro should not be defined in C code -#endif -#ifdef CYG_ASSERT_THISC -# error CYG_ASSERT_THISC macro should not be defined in C code -#endif -#ifdef CYGDBG_DEFINE_CHECK_THIS -# error CYGDBG_DEFINE_CHECK_THIS macro should not be defined in C code -#endif - -#ifdef CYG_PRECONDITION_CLASS -# error CYG_PRECONDITION_CLASS macro should not be defined in C code -#endif -#ifdef CYG_PRECONDITION_CLASSC -# error CYG_PRECONDITION_CLASSC macro should not be defined in C code -#endif -#ifdef CYG_PRECONDITION_CLASSO -# error CYG_PRECONDITION_CLASSO macro should not be defined in C code -#endif -#ifdef CYG_PRECONDITION_CLASSOC -# error CYG_PRECONDITION_CLASSOC macro should not be defined in C code -#endif -#ifdef CYG_PRECONDITION_ZERO_OR_CLASS -# error CYG_PRECONDITION_ZERO_OR_CLASS macro should not be defined in C code -#endif -#ifdef CYG_PRECONDITION_ZERO_OR_CLASSC -# error CYG_PRECONDITION_ZERO_OR_CLASSC macro should not be defined in C code -#endif -#ifdef CYG_PRECONDITION_THIS -# error CYG_PRECONDITION_THIS macro should not be defined in C code -#endif -#ifdef CYG_PRECONDITION_THISC -# error CYG_PRECONDITION_THISC macro should not be defined in C code -#endif - -#ifdef CYG_POSTCONDITION_CLASS -# error CYG_POSTCONDITION_CLASS macro should not be defined in C code -#endif -#ifdef CYG_POSTCONDITION_CLASSC -# error CYG_POSTCONDITION_CLASSC macro should not be defined in C code -#endif -#ifdef CYG_POSTCONDITION_CLASSO -# error CYG_POSTCONDITION_CLASSO macro should not be defined in C code -#endif -#ifdef CYG_POSTCONDITION_CLASSOC -# error CYG_POSTCONDITION_CLASSOC macro should not be defined in C code -#endif -#ifdef CYG_POSTCONDITION_ZERO_OR_CLASS -# error CYG_POSTCONDITION_ZERO_OR_CLASS macro should not be defined in C code -#endif -#ifdef CYG_POSTCONDITION_ZERO_OR_CLASSC -# error CYG_POSTCONDITION_ZERO_OR_CLASSC macro should not be defined in C code -#endif -#ifdef CYG_POSTCONDITION_THIS -# error CYG_POSTCONDITION_THIS macro should not be defined in C code -#endif -#ifdef CYG_POSTCONDITION_THISC -# error CYG_POSTCONDITION_THISC macro should not be defined in C code -#endif - -#ifdef CYG_LOOP_INVARIANT_CLASS -# error CYG_LOOP_INVARIANT_CLASS macro should not be defined in C code -#endif -#ifdef CYG_LOOP_INVARIANT_CLASSC -# error CYG_LOOP_INVARIANT_CLASSC macro should not be defined in C code -#endif -#ifdef CYG_LOOP_INVARIANT_CLASSO -# error CYG_LOOP_INVARIANT_CLASSO macro should not be defined in C code -#endif -#ifdef CYG_LOOP_INVARIANT_CLASSOC -# error CYG_LOOP_INVARIANT_CLASSOC macro should not be defined in C code -#endif -#ifdef CYG_LOOP_INVARIANT_ZERO_OR_CLASS -# error CYG_LOOP_INVARIANT_ZERO_OR_CLASS macro should not be defined in C code -#endif -#ifdef CYG_LOOP_INVARIANT_ZERO_OR_CLASSC -# error CYG_LOOP_INVARIANT_ZERO_OR_CLASSC macro should not be defined in C code -#endif -#ifdef CYG_LOOP_INVARIANT_THIS -# error CYG_LOOP_INVARIANT_THIS macro should not be defined in C code -#endif -#ifdef CYG_LOOP_INVARIANT_THISC -# error CYG_LOOP_INVARIANT_THISC macro should not be defined in C code -#endif - -#ifdef CYG_INVARIANT_CLASS -# error CYG_INVARIANT_CLASS macro should not be defined in C code -#endif -#ifdef CYG_INVARIANT_CLASSC -# error CYG_INVARIANT_CLASSC macro should not be defined in C code -#endif -#ifdef CYG_INVARIANT_CLASSO -# error CYG_INVARIANT_CLASSO macro should not be defined in C code -#endif -#ifdef CYG_INVARIANT_CLASSOC -# error CYG_INVARIANT_CLASSOC macro should not be defined in C code -#endif -#ifdef CYG_INVARIANT_THIS -# error CYG_INVARIANT_THIS macro should not be defined in C code -#endif -#ifdef CYG_INVARIANT_THISC -# error CYG_INVARIANT_THISC macro should not be defined in C code -#endif - - - diff --git a/host/infra/testsuite/cyginfra/tassert5.c b/host/infra/testsuite/cyginfra/tassert5.c deleted file mode 100644 --- a/host/infra/testsuite/cyginfra/tassert5.c +++ /dev/null @@ -1,83 +0,0 @@ -/* ========================================================================== - * - * tassert5.c - * - * Assertion test case - * - *========================================================================== - *####COPYRIGHTBEGIN#### - * - * ---------------------------------------------------------------------------- - * Copyright (C) 1998, 1999, 2000 Red Hat, Inc. - * - * This file is part of the eCos host tools. - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the Free - * Software Foundation; either version 2 of the License, or (at your option) - * any later version. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along with - * this program; if not, write to the Free Software Foundation, Inc., - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * ---------------------------------------------------------------------------- - * - *####COPYRIGHTEND#### - *========================================================================== - *#####DESCRIPTIONBEGIN#### - * - * Author(s): bartv - * Contributors: bartv - * Date: 1998-11-27 - * Purpose: - * Description: A C equivalent of tassert2.cxx - * - *####DESCRIPTIONEND#### - *========================================================================== - */ - -#define CYGDBG_USE_ASSERTS -#define CYGDBG_INFRA_DEBUG_PRECONDITIONS -#define CYGDBG_INFRA_DEBUG_POSTCONDITIONS -#define CYGDBG_INFRA_DEBUG_LOOP_INVARIANTS -#define CYGDBG_INFRA_DEBUG_INVARIANTS - -#include -#include -#include - - -static const char message[] = "This should never be seen."; - -int main(int argc, char** argv) -{ - CYG_ASSERT( true, message); - CYG_ASSERTC(true); - - CYG_CHECK_DATA_PTR( &argc, message); - CYG_CHECK_FUNC_PTR( &main, message); - CYG_CHECK_DATA_PTRC(&argc); - CYG_CHECK_FUNC_PTRC(&main); - - CYG_PRECONDITION(true, message); - CYG_PRECONDITIONC(true); - - CYG_POSTCONDITION(true, message); - CYG_POSTCONDITIONC(true); - - CYG_LOOP_INVARIANT(true, message); - CYG_LOOP_INVARIANTC(true); - - CYG_INVARIANT(true, message); - CYG_INVARIANTC(true); - - CYG_TEST_PASS_FINISH("true assertions do nothing"); - return 0; -} - diff --git a/host/infra/testsuite/cyginfra/tassert6.cxx b/host/infra/testsuite/cyginfra/tassert6.cxx deleted file mode 100644 --- a/host/infra/testsuite/cyginfra/tassert6.cxx +++ /dev/null @@ -1,501 +0,0 @@ -//========================================================================== -// -// tassert6.cxx -// -// Assertion test case -// -//========================================================================== -//####COPYRIGHTBEGIN#### -// -// ---------------------------------------------------------------------------- -// Copyright (C) 1998, 1999, 2000 Red Hat, Inc. -// -// This file is part of the eCos host tools. -// -// This program is free software; you can redistribute it and/or modify it -// under the terms of the GNU General Public License as published by the Free -// Software Foundation; either version 2 of the License, or (at your option) -// any later version. -// -// This program is distributed in the hope that it will be useful, but WITHOUT -// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for -// more details. -// -// You should have received a copy of the GNU General Public License along with -// this program; if not, write to the Free Software Foundation, Inc., -// 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -// -// ---------------------------------------------------------------------------- -// -//####COPYRIGHTEND#### -//========================================================================== -//#####DESCRIPTIONBEGIN#### -// -// Author(s): bartv -// Contributors: bartv -// Date: 1998-12-22 -// Purpose: -// Description: This routine checks that all the assertions can -// be triggered. -// -//####DESCRIPTIONEND#### -//========================================================================== - - -#define CYG_DECLARE_HOST_ASSERTION_SUPPORT -#define CYGDBG_USE_ASSERTS -#define CYGDBG_INFRA_DEBUG_PRECONDITIONS -#define CYGDBG_INFRA_DEBUG_POSTCONDITIONS -#define CYGDBG_INFRA_DEBUG_LOOP_INVARIANTS -#define CYGDBG_INFRA_DEBUG_INVARIANTS - -// Also redefine the zeal -#define CYG_ASSERT_CLASS_ZEAL (cyg_extreme) - -#include -#include -#include -#include -#include - - -// This is used to "recover" from an assertion failure -static jmp_buf setjmp_buffer; - -// The number of assertions that have triggered. -static int failed_assertions = 0; - -// The number of assertions that have been triggered. -static int counter = 0; - -static const char message[] = "beware of the leopard"; - -// A dummy class is needed for some of the assertions. -class dummy { - private: - int random; - public: - dummy() { - random = rand(); - } - ~dummy() { - random = 0; - } - void assertions(); - void invariant1(); - void invariant2(); - static void invariant3(dummy&); - static void invariant4(dummy&); - static void invariant5(dummy*); - static void invariant6(dummy*); - static void extern_assertions(dummy*); - bool check_this(cyg_assert_class_zeal) const; -}; - -bool -dummy::check_this(cyg_assert_class_zeal zeal) const -{ - // The default zeal should be cyg_quick. - switch(zeal) { - case cyg_extreme: - return false; - case cyg_system_test: - case cyg_thorough: - case cyg_quick: - case cyg_trivial: - case cyg_none: - CYG_TEST_FAIL_FINISH("incorrect default zeal passed to check_this() member function"); - break; - default: - CYG_TEST_FAIL_FINISH("invalid zeal passed to check_this() member function"); - break; - } - return false; -} - -void -dummy::invariant1(void) -{ - CYG_INVARIANT_THIS(dummy, message); - CYG_TEST_FAIL("CYG_INVARIANT_THIS() did not trigger"); -} - -void -dummy::invariant2(void) -{ - CYG_INVARIANT_THISC(dummy); - CYG_TEST_FAIL("CYG_INVARIANT_THISC() did not trigger"); -} - -void -dummy::invariant3(dummy& obj) -{ - CYG_INVARIANT_CLASSO(dummy, obj, message); - CYG_TEST_FAIL("CYG_INVARIANT_CLASSO() did not trigger"); -} - -void -dummy::invariant4(dummy& obj) -{ - CYG_INVARIANT_CLASSOC(dummy, obj); - CYG_TEST_FAIL("CYG_INVARIANT_CLASSOC() did not trigger"); -} - -void -dummy::invariant5(dummy* obj) -{ - CYG_INVARIANT_CLASS(dummy, obj, message); - CYG_TEST_FAIL("CYG_INVARIANT_CLASS() did not trigger"); -} - -void -dummy::invariant6(dummy* obj) -{ - CYG_INVARIANT_CLASSC(dummy, obj); - CYG_TEST_FAIL("CYG_INVARIANT_CLASSC() did not trigger"); -} - -void -dummy::assertions(void) -{ - switch(counter) { - - case 33: - CYG_ASSERT_THIS(message); - CYG_TEST_FAIL("CYG_ASSERT_THIS() did not trigger"); - break; - - case 34: - CYG_ASSERT_THISC(); - CYG_TEST_FAIL("CYG_ASSERT_THISC() did not trigger"); - break; - - case 35: - CYG_PRECONDITION_THIS(message); - CYG_TEST_FAIL("CYG_PRECONDITION_THIS() did not trigger"); - break; - - case 36: - CYG_PRECONDITION_THISC(); - CYG_TEST_FAIL("CYG_PRECONDITION_THISC() did not trigger"); - break; - - case 37: - CYG_POSTCONDITION_THIS(message); - CYG_TEST_FAIL("CYG_POSTCONDITION_THIS() did not trigger"); - break; - - case 38: - CYG_POSTCONDITION_THISC(); - CYG_TEST_FAIL("CYG_POSTCONDITION_THISC() did not trigger"); - break; - - case 39: - CYG_LOOP_INVARIANT_THIS(message); - CYG_TEST_FAIL("CYG_LOOP_INVARIANT_THIS() did not trigger"); - break; - - case 40: - CYG_LOOP_INVARIANT_THISC(); - CYG_TEST_FAIL("CYG_LOOP_INVARIANT_THISC() did not trigger"); - break; - - default: - CYG_TEST_FAIL("dummy::assertions() invoked for no reason"); - break; - } -} - -void -dummy::extern_assertions(dummy* obj) -{ - switch(counter) { - case 41: - CYG_ASSERT_ZERO_OR_CLASS(obj, message); - CYG_TEST_FAIL("CYG_ASSERT_ZERO_OR_CLASS() did not trigger"); - break; - - case 42: - CYG_ASSERT_ZERO_OR_CLASSC(obj); - CYG_TEST_FAIL("CYG_ASSERT_ZERO_OR_CLASSC() did not trigger"); - break; - - case 43: - CYG_PRECONDITION_ZERO_OR_CLASS(obj, message); - CYG_TEST_FAIL("CYG_PRECONDITION_ZERO_OR_CLASS() did not trigger"); - break; - - case 44: - CYG_PRECONDITION_ZERO_OR_CLASSC(obj); - CYG_TEST_FAIL("CYG_PRECONDITION_ZERO_OR_CLASSC() did not trigger"); - break; - - case 45: - CYG_POSTCONDITION_ZERO_OR_CLASS(obj, message); - CYG_TEST_FAIL("CYG_POSTCONDITION_ZERO_OR_CLASS() did not trigger"); - break; - - case 46: - CYG_POSTCONDITION_ZERO_OR_CLASSC(obj); - CYG_TEST_FAIL("CYG_POSTCONDITION_ZERO_OR_CLASSC() did not trigger"); - break; - - case 47: - CYG_LOOP_INVARIANT_ZERO_OR_CLASS(obj, message); - CYG_TEST_FAIL("CYG_LOOP_INVARIANT_ZERO_OR_CLASS() did not trigger"); - break; - - case 48: - CYG_LOOP_INVARIANT_ZERO_OR_CLASSC(obj); - CYG_TEST_FAIL("CYG_LOOP_INVARIANT_ZERO_OR_CLASSC() did not trigger"); - break; - - default: - CYG_TEST_FAIL("dummy::extern_assertions() invoked for no reason"); - break; - } - -} - -extern "C" -bool -failure_handler(const char* fn, const char* file, cyg_uint32 line, const char* msg) -{ - failed_assertions++; - counter++; - longjmp(setjmp_buffer, 1); - return true; -} - -int -main(int argc, char** argv) -{ - dummy object; - - cyg_assert_install_failure_handler(&failure_handler); - setjmp(setjmp_buffer); - - for ( bool done = false; !done; counter++ ) { - switch(counter) { - case 0: - CYG_ASSERT(false, message); - CYG_TEST_FAIL("CYG_ASSERT() did not trigger"); - break; - - case 1: - CYG_ASSERTC(false); - CYG_TEST_FAIL("CYG_ASSERTC() did not trigger"); - break; - - case 2: - CYG_FAIL(message); - CYG_TEST_FAIL("CYG_FAIL() did not trigger"); - break; - - case 3: - CYG_CHECK_DATA_PTR(0, message); - CYG_TEST_FAIL("CHECK_CHECK_DATA_PTR() did not trigger"); - break; - - case 4: - CYG_CHECK_DATA_PTRC(0); - CYG_TEST_FAIL("CHECK_CHECK_DATA_PTRC() did not trigger"); - break; - - case 5: - CYG_CHECK_FUNC_PTR(0, message); - CYG_TEST_FAIL("CHECK_CHECK_FUNC_PTR() did not trigger"); - break; - - case 6: - CYG_CHECK_DATA_PTRC(0); - CYG_TEST_FAIL("CHECK_CHECK_FUNC_PTRC() did not trigger"); - break; - - case 7: - CYG_ASSERT_CLASS(&object, message); - CYG_TEST_FAIL("CYG_ASSERT_CLASS() did not trigger"); - break; - - case 8: - CYG_ASSERT_CLASSC(&object); - CYG_TEST_FAIL("CYG_ASSERT_CLASSC() did not trigger"); - break; - - case 9: - CYG_ASSERT_CLASSO(object, message); - CYG_TEST_FAIL("CYG_ASSERT_CLASSO() did not trigger"); - break; - - case 10: - CYG_ASSERT_CLASSOC(object); - CYG_TEST_FAIL("CYG_ASSERT_CLASSOC() did not trigger"); - break; - - case 11: - CYG_PRECONDITION(false, message); - CYG_TEST_FAIL("CYG_PRECONDITION() did not trigger"); - break; - - case 12: - CYG_PRECONDITIONC(false); - CYG_TEST_FAIL("CYG_PRECONDITIONC() did not trigger"); - break; - - case 13: - CYG_PRECONDITION_CLASS(&object, message); - CYG_TEST_FAIL("CYG_PRECONDITION_CLASS() did not trigger"); - break; - - case 14: - CYG_PRECONDITION_CLASSC(&object); - CYG_TEST_FAIL("CYG_PRECONDITION_CLASSC() did not trigger"); - break; - - case 15: - CYG_PRECONDITION_CLASSO(object, message); - CYG_TEST_FAIL("CYG_PRECONDITION_CLASSO() did not trigger"); - break; - - case 16: - CYG_PRECONDITION_CLASSOC(object); - CYG_TEST_FAIL("CYG_PRECONDITION_CLASSOC() did not trigger"); - break; - - case 17: - CYG_POSTCONDITION(false, message); - CYG_TEST_FAIL("CYG_POSTCONDITION() did not trigger"); - break; - - case 18: - CYG_POSTCONDITIONC(false); - CYG_TEST_FAIL("CYG_POSTCONDITIONC() did not trigger"); - break; - - case 19: - CYG_POSTCONDITION_CLASS(&object, message); - CYG_TEST_FAIL("CYG_POSTCONDITION_CLASS() did not trigger"); - break; - - case 20: - CYG_POSTCONDITION_CLASSC(&object); - CYG_TEST_FAIL("CYG_POSTCONDITION_CLASSC() did not trigger"); - break; - - case 21: - CYG_POSTCONDITION_CLASSO(object, message); - CYG_TEST_FAIL("CYG_POSTCONDITION_CLASSO() did not trigger"); - break; - - case 22: - CYG_POSTCONDITION_CLASSOC(object); - CYG_TEST_FAIL("CYG_POSTCONDITION_CLASSOC() did not trigger"); - break; - - case 23: - CYG_LOOP_INVARIANT(false, message); - CYG_TEST_FAIL("CYG_LOOP_INVARIANT() did not trigger"); - break; - - case 24: - CYG_LOOP_INVARIANTC(false); - CYG_TEST_FAIL("CYG_LOOP_INVARIANTC() did not trigger"); - break; - - case 25: - CYG_LOOP_INVARIANT_CLASS(&object, message); - CYG_TEST_FAIL("CYG_LOOP_INVARIANT_CLASS() did not trigger"); - break; - - case 26: - CYG_LOOP_INVARIANT_CLASSC(&object); - CYG_TEST_FAIL("CYG_LOOP_INVARIANT_CLASSC() did not trigger"); - break; - - case 27: - CYG_LOOP_INVARIANT_CLASSO(object, message); - CYG_TEST_FAIL("CYG_LOOP_INVARIANT_CLASSO() did not trigger"); - break; - - case 28: - CYG_LOOP_INVARIANT_CLASSOC(object); - CYG_TEST_FAIL("CYG_LOOP_INVARIANT_CLASSOC() did not trigger"); - break; - - case 29: - CYG_INVARIANT(false, message); - CYG_TEST_FAIL("CYG_INVARIANT() did not trigger"); - break; - - case 30: - CYG_INVARIANTC(false); - CYG_TEST_FAIL("CYG_INVARIANTC() did not trigger"); - break; - - case 31: - object.invariant1(); - break; - - case 32: - object.invariant2(); - break; - - case 33: - case 34: - case 35: - case 36: - case 37: - case 38: - case 39: - case 40: - object.assertions(); - break; - - case 41: - case 42: - case 43: - case 44: - case 45: - case 46: - case 47: - case 48: - dummy::extern_assertions(&object); - break; - - case 49: - dummy::invariant3(object); - break; - - case 50: - dummy::invariant4(object); - break; - - case 51: - dummy::invariant5(&object); - break; - - case 52: - dummy::invariant6(&object); - break; - - default: - done = true; - counter--; // About to get incremented again... - break; - } - } - - if (failed_assertions != 53) { - CYG_TEST_FAIL("Broken test case, not all assertions have been tried"); - } - - if (failed_assertions == counter) { - CYG_TEST_PASS("All assertions trigger successfully"); - } else { - CYG_TEST_FAIL("Not all assertions trigger"); - } - - return 0; -} - diff --git a/host/infra/testsuite/cyginfra/tassert7.cxx b/host/infra/testsuite/cyginfra/tassert7.cxx deleted file mode 100644 --- a/host/infra/testsuite/cyginfra/tassert7.cxx +++ /dev/null @@ -1,232 +0,0 @@ -//========================================================================== -// -// tassert7.cxx -// -// Assertion test case -// -//========================================================================== -//####COPYRIGHTBEGIN#### -// -// ---------------------------------------------------------------------------- -// Copyright (C) 1998, 1999, 2000 Red Hat, Inc. -// -// This file is part of the eCos host tools. -// -// This program is free software; you can redistribute it and/or modify it -// under the terms of the GNU General Public License as published by the Free -// Software Foundation; either version 2 of the License, or (at your option) -// any later version. -// -// This program is distributed in the hope that it will be useful, but WITHOUT -// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for -// more details. -// -// You should have received a copy of the GNU General Public License along with -// this program; if not, write to the Free Software Foundation, Inc., -// 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -// -// ---------------------------------------------------------------------------- -// -//####COPYRIGHTEND#### -//========================================================================== -//#####DESCRIPTIONBEGIN#### -// -// Author(s): bartv -// Contributors: bartv -// Date: 1998-12-23 -// Purpose: -// Description: This routine checks the invariant assertions. -// The entry tests will have been taken care of by -// tassert6.cxx, but it is also necessary to check -// the exit tests. -// -//####DESCRIPTIONEND#### -//========================================================================== - - -#define CYG_DECLARE_HOST_ASSERTION_SUPPORT -#define CYGDBG_USE_ASSERTS -#define CYGDBG_INFRA_DEBUG_PRECONDITIONS -#define CYGDBG_INFRA_DEBUG_POSTCONDITIONS -#define CYGDBG_INFRA_DEBUG_LOOP_INVARIANTS -#define CYGDBG_INFRA_DEBUG_INVARIANTS - -#include -#include -#include -#include -#include - -// This is used to "recover" from an assertion failure -static jmp_buf setjmp_buffer; - -// The number of assertions that have triggered. -static int failed_assertions = 0; - -// The number of assertions that have been triggered. -static int counter = 0; - -// Are objects currently valid? -static bool check_this_should_fail = false; - -static const char message[] = "so long and thanks for all the fish"; - -class dummy { - private: - int random; - - public: - dummy() { - random = rand(); - } - ~dummy() { - random = 0; - } - - void invariant1(); - void invariant2(); - static void invariant3(dummy&); - static void invariant4(dummy&); - static void invariant5(dummy*); - static void invariant6(dummy*); - bool check_this(cyg_assert_class_zeal) const; -}; - -bool -dummy::check_this(cyg_assert_class_zeal zeal) const -{ - // The default zeal should be cyg_quick. - switch(zeal) { - case cyg_quick: - return !check_this_should_fail; - - case cyg_system_test: - case cyg_extreme: - case cyg_thorough: - case cyg_trivial: - case cyg_none: - CYG_TEST_FAIL_FINISH("incorrect default zeal passed to check_this() member function"); - break; - default: - CYG_TEST_FAIL_FINISH("invalid zeal passed to check_this() member function"); - break; - } - return false; -} - -void -dummy::invariant1(void) -{ - CYG_INVARIANT_THIS(dummy, message); - check_this_should_fail = true; -} - -void -dummy::invariant2(void) -{ - CYG_INVARIANT_THISC(dummy); - check_this_should_fail = true; -} - -void -dummy::invariant3(dummy& obj) -{ - CYG_INVARIANT_CLASSO(dummy, obj, message); - check_this_should_fail = true; -} - -void -dummy::invariant4(dummy& obj) -{ - CYG_INVARIANT_CLASSOC(dummy, obj); - check_this_should_fail = true; -} - -void -dummy::invariant5(dummy* obj) -{ - CYG_INVARIANT_CLASS(dummy, obj, message); - check_this_should_fail = true; -} - -void -dummy::invariant6(dummy* obj) -{ - CYG_INVARIANT_CLASSC(dummy, obj); - check_this_should_fail = true; -} - -extern "C" -bool -failure_handler(const char* fn, const char* file, cyg_uint32 line, const char* msg) -{ - if (false == check_this_should_fail) { - CYG_TEST_FAIL("assertion triggered when everything should be ok"); - } - failed_assertions++; - counter++; - longjmp(setjmp_buffer, 1); - return true; -} - -int -main(int argc, char **argv) -{ - dummy object; - - cyg_assert_install_failure_handler(&failure_handler); - setjmp(setjmp_buffer); - - for ( bool done = false; !done; counter++ ) { - check_this_should_fail = false; - - switch(counter) { - case 0: - object.invariant1(); - CYG_TEST_FAIL("CYG_INVARIANT_THIS() test should not have returned"); - break; - - case 1: - object.invariant2(); - CYG_TEST_FAIL("CYG_INVARIANT_THISC() test should not have returned"); - break; - - case 2: - dummy::invariant3(object); - CYG_TEST_FAIL("CYG_INVARIANT_CLASSO() test should not have returned"); - break; - - case 3: - dummy::invariant4(object); - CYG_TEST_FAIL("CYG_INVARIANT_CLASSOC() test should not have returned"); - break; - - case 4: - dummy::invariant5(&object); - CYG_TEST_FAIL("CYG_INVARIANT_CLASS() test should not have returned"); - break; - - case 5: - dummy::invariant6(&object); - CYG_TEST_FAIL("CYG_INVARIANT_CLASSC() test should not have returned"); - break; - - default: - done = true; - counter--; // About to get incremented again... - break; - } - } - - if (failed_assertions != 6) { - CYG_TEST_FAIL("Broken test case, not all assertions have been tried"); - } - - if (failed_assertions == counter) { - CYG_TEST_PASS("All assertions trigger successfully"); - } else { - CYG_TEST_FAIL("Not all assertions trigger"); - } - return 0; -} diff --git a/host/infra/testsuite/cyginfra/tassert8.cxx b/host/infra/testsuite/cyginfra/tassert8.cxx deleted file mode 100644 --- a/host/infra/testsuite/cyginfra/tassert8.cxx +++ /dev/null @@ -1,81 +0,0 @@ -//========================================================================== -// -// tassert8.cxx -// -// Assertion test case -// -//========================================================================== -//####COPYRIGHTBEGIN#### -// -// ---------------------------------------------------------------------------- -// Copyright (C) 1998, 1999, 2000 Red Hat, Inc. -// -// This file is part of the eCos host tools. -// -// This program is free software; you can redistribute it and/or modify it -// under the terms of the GNU General Public License as published by the Free -// Software Foundation; either version 2 of the License, or (at your option) -// any later version. -// -// This program is distributed in the hope that it will be useful, but WITHOUT -// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for -// more details. -// -// You should have received a copy of the GNU General Public License along with -// this program; if not, write to the Free Software Foundation, Inc., -// 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -// -// ---------------------------------------------------------------------------- -// -//####COPYRIGHTEND#### -//========================================================================== -//#####DESCRIPTIONBEGIN#### -// -// Author(s): bartv -// Contributors: bartv -// Date: 1998-12-23 -// Purpose: -// Description: This routine causes a basic assertion, including a -// number of callbacks. It is up to the test driver -// to analyse the results of this and take appropriate -// action. -// -//####DESCRIPTIONEND#### -//========================================================================== - -#define CYG_DECLARE_HOST_ASSERTION_SUPPORT -#define CYGDBG_USE_ASSERTS -#define CYGDBG_INFRA_DEBUG_PRECONDITIONS -#define CYGDBG_INFRA_DEBUG_POSTCONDITIONS -#define CYGDBG_INFRA_DEBUG_LOOP_INVARIANTS -#define CYGDBG_INFRA_DEBUG_INVARIANTS - -#include -#include - -extern "C" -void -callback1(void (*outputfn)(const char*)) -{ - // This callback does nothing -} - -extern "C" -void -callback2(void (*outputfn)(const char*)) -{ - // This callback outputs a number of lines of data. - for (int i = 0; i < 10; i++) { - (*outputfn)("callback2 output\n"); - } -} - -int -main(int argc, char** argv) -{ - cyg_assert_install_failure_callback("callback1", &callback1); - cyg_assert_install_failure_callback("callback2", &callback2); - CYG_FAIL("it seemed like a good idea at the time"); -} - diff --git a/host/infra/testsuite/cyginfra/trace.exp b/host/infra/testsuite/cyginfra/trace.exp deleted file mode 100644 --- a/host/infra/testsuite/cyginfra/trace.exp +++ /dev/null @@ -1,90 +0,0 @@ -#=============================================================================== -# -# trace.exp -# -# Tracing test cases -# -#=============================================================================== -######COPYRIGHTBEGIN#### -# -# ---------------------------------------------------------------------------- -# Copyright (C) 1998, 1999, 2000 Red Hat, Inc. -# -# This file is part of the eCos host tools. -# -# This program is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License as published by the Free -# Software Foundation; either version 2 of the License, or (at your option) -# any later version. -# -# This program is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for -# more details. -# -# You should have received a copy of the GNU General Public License along with -# this program; if not, write to the Free Software Foundation, Inc., -# 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -# -# ---------------------------------------------------------------------------- -# -######COPYRIGHTEND#### -#=============================================================================== -######DESCRIPTIONBEGIN#### -# -# Author(s): bartv -# Contributors: bartv -# Date: 1998-12-23 -# -#####DESCRIPTIONEND#### -#=============================================================================== - -${tool}_load ttrace1 -${tool}_load ttrace2 -${tool}_load ttrace3 - -# ---------------------------------------------------------------------------- -# The test ttrace4 does lots of tracing and then generates a dump. It is -# necessary to analyse the dump, make sure that it has a reasonable number -# of lines, and that the first line of the output matches the last trace -# statement. - -proc ttrace4_filter { name result output } { - - if { [hosttest_assert_check $result $output] == 0 } { - fail "testcase did not generate a recognised assertion" - return - } - - set output [hosttest_assert_read_dump $output] - if { $output == "" } { - fail "testcase did not generate a recognised assertion dump" - return - } - - set all_ok 1 - set trace_output [hosttest_assert_extract_callback $output "Trace"] - - set lines [split $trace_output "\n"] - if { [llength $lines] < 1000 } { - fail "only got [llength $lines] lines of trace output - there should be more" - set all_ok 0 - } - if { [llength $lines] > 100000 } { - fail "got [llength $lines] lines of trace output - this is excessive" - set all_ok 0 - } - - set line [lindex $lines 0] - if { [string match ".*Goodbye and thanks for all the fish.*" $line] } { - fail "first line of trace output does not correspond to last trace statement:\n$trace_output" - set all_ok 0 - } - if { $all_ok } { - pass "amount of trace output is satisfactory" - } - return 0 -} - -hosttest_run_test_with_filter ttrace4 ttrace4_filter {} {} {} cyginfra {} - diff --git a/host/infra/testsuite/cyginfra/ttrace1.cxx b/host/infra/testsuite/cyginfra/ttrace1.cxx deleted file mode 100644 --- a/host/infra/testsuite/cyginfra/ttrace1.cxx +++ /dev/null @@ -1,724 +0,0 @@ -//========================================================================== -// -// ttrace1.cxx -// -// Trace test case -// -//========================================================================== -//####COPYRIGHTBEGIN#### -// -// ---------------------------------------------------------------------------- -// Copyright (C) 1999, 2000 Red Hat, Inc. -// -// This file is part of the eCos host tools. -// -// This program is free software; you can redistribute it and/or modify it -// under the terms of the GNU General Public License as published by the Free -// Software Foundation; either version 2 of the License, or (at your option) -// any later version. -// -// This program is distributed in the hope that it will be useful, but WITHOUT -// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for -// more details. -// -// You should have received a copy of the GNU General Public License along with -// this program; if not, write to the Free Software Foundation, Inc., -// 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -// -// ---------------------------------------------------------------------------- -// -//####COPYRIGHTEND#### -//========================================================================== -//#####DESCRIPTIONBEGIN#### -// -// Author(s): bartv -// Contributors: bartv -// Date: 1999-01-06 -// Purpose: -// Description: By default all tracing should be disabled, but -// they should compile just fine. This module uses all -// of the trace macros. As a fringe benefit, all -// of the macros get checked for correct argument usage. -// -//####DESCRIPTIONEND#### -//========================================================================== - - -#include -#include -#include - -#ifdef CYGDBG_USE_TRACING -# error Tracing should not be enabled by default. -#endif -#ifdef CYGDBG_INFRA_DEBUG_FUNCTION_REPORTS -# error Function reporting should not be enabled by default. -#endif - -#define CYG_TRACE_USER_BOOL (invalid_expression) -#define CYG_REPORT_USER_BOOL (invalid_expression) - -void -fn1(void) -{ - CYG_REPORT_FUNCTION(); -} - -void -fn2(void) -{ - CYG_REPORT_FUNCTYPE("printf-style format string"); -} - -void -fn3(void) -{ - CYG_REPORT_FUNCNAME("fn3"); -} - -void -fn4(void) -{ - CYG_REPORT_FUNCNAMETYPE("fn4", "printf-style format string"); -} - -void -fn5(void) -{ - CYG_REPORT_FUNCTIONC(); -} - -void -fn6(void) -{ - CYG_REPORT_FUNCTYPEC("printf-style format string"); -} - -void -fn7(void) -{ - CYG_REPORT_FUNCNAMEC("fn7"); -} - -void -fn8(void) -{ - CYG_REPORT_FUNCNAMETYPEC("fn8", "printf-style format string"); -} - -void -fn9(void) -{ - CYG_REPORT_FUNCTION(); - CYG_REPORT_RETURN(); -} - -void -fn10(void) -{ - CYG_REPORT_FUNCTYPE("result is %d"); - CYG_REPORT_RETVAL(42); -} - -void -fn11(void) -{ - CYG_REPORT_FUNCTION(); - CYG_REPORT_FUNCARGVOID(); -} - -void -fn12(int now) -{ - CYG_REPORT_FUNCTION(); - CYG_REPORT_FUNCARG1(fmt, now); -} - -void -fn13(int now, int is) -{ - CYG_REPORT_FUNCTION(); - CYG_REPORT_FUNCARG2(fmt, now, is); -} - -void -fn14(int now, int is, int the) -{ - CYG_REPORT_FUNCTION(); - CYG_REPORT_FUNCARG3(fmt, now, is, the); -} - -void -fn15(int now, int is, int the, int winter) -{ - CYG_REPORT_FUNCTION(); - CYG_REPORT_FUNCARG4(fmt, now, is, the, winter); -} - -void -fn16(int now, int is, int the, int winter, int of) -{ - CYG_REPORT_FUNCTION(); - CYG_REPORT_FUNCARG5(fmt, now, is, the, winter, of); -} - -void -fn17(int now, int is, int the, int winter, int of, int our) -{ - CYG_REPORT_FUNCTION(); - CYG_REPORT_FUNCARG6(fmt, now, is, the, winter, of, our); -} - -void -fn18(int now, int is, int the, int winter, int of, int our, int discontent) -{ - CYG_REPORT_FUNCTION(); - CYG_REPORT_FUNCARG7(fmt, now, is, the, winter, of, our, discontent); -} - -void -fn19(int now, int is, int the, int winter, int of, int our, int discontent, int made) -{ - CYG_REPORT_FUNCTION(); - CYG_REPORT_FUNCARG8(fmt, now, is, the, winter, of, our, discontent, made); -} - -void -fn20(int now) -{ - CYG_REPORT_FUNCTION(); - CYG_REPORT_FUNCARG1X(now); -} - -void -fn21(int now, int is) -{ - CYG_REPORT_FUNCTION(); - CYG_REPORT_FUNCARG2X(now, is); -} - -void -fn22(int now, int is, int the) -{ - CYG_REPORT_FUNCTION(); - CYG_REPORT_FUNCARG3X(now, is, the); -} - -void -fn23(int now, int is, int the, int winter) -{ - CYG_REPORT_FUNCTION(); - CYG_REPORT_FUNCARG4X(now, is, the, winter); -} - -void -fn24(int now, int is, int the, int winter, int of) -{ - CYG_REPORT_FUNCTION(); - CYG_REPORT_FUNCARG5X(now, is, the, winter, of); -} - -void -fn25(int now, int is, int the, int winter, int of, int our) -{ - CYG_REPORT_FUNCTION(); - CYG_REPORT_FUNCARG6X(now, is, the, winter, of, our); -} - -void -fn26(int now, int is, int the, int winter, int of, int our, int discontent) -{ - CYG_REPORT_FUNCTION(); - CYG_REPORT_FUNCARG7X(now, is, the, winter, of, our, discontent); -} - -void -fn27(int now, int is, int the, int winter, int of, int our, int discontent, int made) -{ - CYG_REPORT_FUNCTION(); - CYG_REPORT_FUNCARG8X(now, is, the, winter, of, our, discontent, made); -} - -void -fn28(int now) -{ - CYG_REPORT_FUNCTION(); - CYG_REPORT_FUNCARG1Y(now); -} - -void -fn29(int now, int is) -{ - CYG_REPORT_FUNCTION(); - CYG_REPORT_FUNCARG2Y(now, is); -} - -void -fn30(int now, int is, int the) -{ - CYG_REPORT_FUNCTION(); - CYG_REPORT_FUNCARG3Y(now, is, the); -} - -void -fn31(int now, int is, int the, int winter) -{ - CYG_REPORT_FUNCTION(); - CYG_REPORT_FUNCARG4Y(now, is, the, winter); -} - -void -fn32(int now, int is, int the, int winter, int of) -{ - CYG_REPORT_FUNCTION(); - CYG_REPORT_FUNCARG5Y(now, is, the, winter, of); -} - -void -fn33(int now, int is, int the, int winter, int of, int our) -{ - CYG_REPORT_FUNCTION(); - CYG_REPORT_FUNCARG6Y(now, is, the, winter, of, our); -} - -void -fn34(int now, int is, int the, int winter, int of, int our, int discontent) -{ - CYG_REPORT_FUNCTION(); - CYG_REPORT_FUNCARG7Y(now, is, the, winter, of, our, discontent); -} - -void -fn35(int now, int is, int the, int winter, int of, int our, int discontent, int made) -{ - CYG_REPORT_FUNCTION(); - CYG_REPORT_FUNCARG8D(now, is, the, winter, of, our, discontent, made); -} - -void -fn36(int now) -{ - CYG_REPORT_FUNCTION(); - CYG_REPORT_FUNCARG1D(now); -} - -void -fn37(int now, int is) -{ - CYG_REPORT_FUNCTION(); - CYG_REPORT_FUNCARG2D(now, is); -} - -void -fn38(int now, int is, int the) -{ - CYG_REPORT_FUNCTION(); - CYG_REPORT_FUNCARG3D(now, is, the); -} - -void -fn39(int now, int is, int the, int winter) -{ - CYG_REPORT_FUNCTION(); - CYG_REPORT_FUNCARG4D(now, is, the, winter); -} - -void -fn40(int now, int is, int the, int winter, int of) -{ - CYG_REPORT_FUNCTION(); - CYG_REPORT_FUNCARG5D(now, is, the, winter, of); -} - -void -fn41(int now, int is, int the, int winter, int of, int our) -{ - CYG_REPORT_FUNCTION(); - CYG_REPORT_FUNCARG6D(now, is, the, winter, of, our); -} - -void -fn42(int now, int is, int the, int winter, int of, int our, int discontent) -{ - CYG_REPORT_FUNCTION(); - CYG_REPORT_FUNCARG7D(now, is, the, winter, of, our, discontent); -} - -void -fn43(int now, int is, int the, int winter, int of, int our, int discontent, int made) -{ - CYG_REPORT_FUNCTION(); - CYG_REPORT_FUNCARG8D(now, is, the, winter, of, our, discontent, made); -} - -void -fn44(int now) -{ - CYG_REPORT_FUNCTION(); - CYG_REPORT_FUNCARG1XV(now); -} - -void -fn45(int now, int is) -{ - CYG_REPORT_FUNCTION(); - CYG_REPORT_FUNCARG2XV(now, is); -} - -void -fn46(int now, int is, int the) -{ - CYG_REPORT_FUNCTION(); - CYG_REPORT_FUNCARG3XV(now, is, the); -} - -void -fn47(int now, int is, int the, int winter) -{ - CYG_REPORT_FUNCTION(); - CYG_REPORT_FUNCARG4XV(now, is, the, winter); -} - -void -fn48(int now, int is, int the, int winter, int of) -{ - CYG_REPORT_FUNCTION(); - CYG_REPORT_FUNCARG5XV(now, is, the, winter, of); -} - -void -fn49(int now, int is, int the, int winter, int of, int our) -{ - CYG_REPORT_FUNCTION(); - CYG_REPORT_FUNCARG6XV(now, is, the, winter, of, our); -} - -void -fn50(int now, int is, int the, int winter, int of, int our, int discontent) -{ - CYG_REPORT_FUNCTION(); - CYG_REPORT_FUNCARG7XV(now, is, the, winter, of, our, discontent); -} - -void -fn51(int now, int is, int the, int winter, int of, int our, int discontent, int made) -{ - CYG_REPORT_FUNCTION(); - CYG_REPORT_FUNCARG8XV(now, is, the, winter, of, our, discontent, made); -} - -void -fn52(int now) -{ - CYG_REPORT_FUNCTION(); - CYG_REPORT_FUNCARG1YV(now); -} - -void -fn53(int now, int is) -{ - CYG_REPORT_FUNCTION(); - CYG_REPORT_FUNCARG2YV(now, is); -} - -void -fn54(int now, int is, int the) -{ - CYG_REPORT_FUNCTION(); - CYG_REPORT_FUNCARG3YV(now, is, the); -} - -void -fn55(int now, int is, int the, int winter) -{ - CYG_REPORT_FUNCTION(); - CYG_REPORT_FUNCARG4YV(now, is, the, winter); -} - -void -fn56(int now, int is, int the, int winter, int of) -{ - CYG_REPORT_FUNCTION(); - CYG_REPORT_FUNCARG5YV(now, is, the, winter, of); -} - -void -fn57(int now, int is, int the, int winter, int of, int our) -{ - CYG_REPORT_FUNCTION(); - CYG_REPORT_FUNCARG6YV(now, is, the, winter, of, our); -} - -void -fn58(int now, int is, int the, int winter, int of, int our, int discontent) -{ - CYG_REPORT_FUNCTION(); - CYG_REPORT_FUNCARG7YV(now, is, the, winter, of, our, discontent); -} - -void -fn59(int now, int is, int the, int winter, int of, int our, int discontent, int made) -{ - CYG_REPORT_FUNCTION(); - CYG_REPORT_FUNCARG8YV(now, is, the, winter, of, our, discontent, made); -} - -void -fn60(int now) -{ - CYG_REPORT_FUNCTION(); - CYG_REPORT_FUNCARG1DV(now); -} - -void -fn61(int now, int is) -{ - CYG_REPORT_FUNCTION(); - CYG_REPORT_FUNCARG2DV(now, is); -} - -void -fn62(int now, int is, int the) -{ - CYG_REPORT_FUNCTION(); - CYG_REPORT_FUNCARG3DV(now, is, the); -} - -void -fn63(int now, int is, int the, int winter) -{ - CYG_REPORT_FUNCTION(); - CYG_REPORT_FUNCARG4DV(now, is, the, winter); -} - -void -fn64(int now, int is, int the, int winter, int of) -{ - CYG_REPORT_FUNCTION(); - CYG_REPORT_FUNCARG5DV(now, is, the, winter, of); -} - -void -fn65(int now, int is, int the, int winter, int of, int our) -{ - CYG_REPORT_FUNCTION(); - CYG_REPORT_FUNCARG6DV(now, is, the, winter, of, our); -} - -void -fn66(int now, int is, int the, int winter, int of, int our, int discontent) -{ - CYG_REPORT_FUNCTION(); - CYG_REPORT_FUNCARG7DV(now, is, the, winter, of, our, discontent); -} - -void -fn67(int now, int is, int the, int winter, int of, int our, int discontent, int made) -{ - CYG_REPORT_FUNCTION(); - CYG_REPORT_FUNCARG8DV(now, is, the, winter, of, our, discontent, made); -} - -int -main(int argc, char** argv) -{ - CYG_TRACE0(junk, fmt); - CYG_TRACE1(junk, fmt, now); - CYG_TRACE2(junk, fmt, now, is); - CYG_TRACE3(junk, fmt, now, is, the); - CYG_TRACE4(junk, fmt, now, is, the, winter); - CYG_TRACE5(junk, fmt, now, is, the, winter, of); - CYG_TRACE6(junk, fmt, now, is, the, winter, of, our); - CYG_TRACE7(junk, fmt, now, is, the, winter, of, our, discontent); - CYG_TRACE8(junk, fmt, now, is, the, winter, of, our, discontent, made); - - CYG_TRACE0B(fmt); - CYG_TRACE1B(fmt, now); - CYG_TRACE2B(fmt, now, is); - CYG_TRACE3B(fmt, now, is, the); - CYG_TRACE4B(fmt, now, is, the, winter); - CYG_TRACE5B(fmt, now, is, the, winter, of); - CYG_TRACE6B(fmt, now, is, the, winter, of, our); - CYG_TRACE7B(fmt, now, is, the, winter, of, our, discontent); - CYG_TRACE8B(fmt, now, is, the, winter, of, our, discontent, made); - - CYG_TRACE1X(junk, now); - CYG_TRACE2X(junk, now, is); - CYG_TRACE3X(junk, now, is, the); - CYG_TRACE4X(junk, now, is, the, winter); - CYG_TRACE5X(junk, now, is, the, winter, of); - CYG_TRACE6X(junk, now, is, the, winter, of, our); - CYG_TRACE7X(junk, now, is, the, winter, of, our, discontent); - CYG_TRACE8X(junk, now, is, the, winter, of, our, discontent, made); - - CYG_TRACE1Y(junk, now); - CYG_TRACE2Y(junk, now, is); - CYG_TRACE3Y(junk, now, is, the); - CYG_TRACE4Y(junk, now, is, the, winter); - CYG_TRACE5Y(junk, now, is, the, winter, of); - CYG_TRACE6Y(junk, now, is, the, winter, of, our); - CYG_TRACE7Y(junk, now, is, the, winter, of, our, discontent); - CYG_TRACE8Y(junk, now, is, the, winter, of, our, discontent, made); - - CYG_TRACE1D(junk, now); - CYG_TRACE2D(junk, now, is); - CYG_TRACE3D(junk, now, is, the); - CYG_TRACE4D(junk, now, is, the, winter); - CYG_TRACE5D(junk, now, is, the, winter, of); - CYG_TRACE6D(junk, now, is, the, winter, of, our); - CYG_TRACE7D(junk, now, is, the, winter, of, our, discontent); - CYG_TRACE8D(junk, now, is, the, winter, of, our, discontent, made); - - CYG_TRACE1XV(junk, now); - CYG_TRACE2XV(junk, now, is); - CYG_TRACE3XV(junk, now, is, the); - CYG_TRACE4XV(junk, now, is, the, winter); - CYG_TRACE5XV(junk, now, is, the, winter, of); - CYG_TRACE6XV(junk, now, is, the, winter, of, our); - CYG_TRACE7XV(junk, now, is, the, winter, of, our, discontent); - CYG_TRACE8XV(junk, now, is, the, winter, of, our, discontent, made); - - CYG_TRACE1YV(junk, now); - CYG_TRACE2YV(junk, now, is); - CYG_TRACE3YV(junk, now, is, the); - CYG_TRACE4YV(junk, now, is, the, winter); - CYG_TRACE5YV(junk, now, is, the, winter, of); - CYG_TRACE6YV(junk, now, is, the, winter, of, our); - CYG_TRACE7YV(junk, now, is, the, winter, of, our, discontent); - CYG_TRACE8YV(junk, now, is, the, winter, of, our, discontent, made); - - CYG_TRACE1DV(junk, now); - CYG_TRACE2DV(junk, now, is); - CYG_TRACE3DV(junk, now, is, the); - CYG_TRACE4DV(junk, now, is, the, winter); - CYG_TRACE5DV(junk, now, is, the, winter, of); - CYG_TRACE6DV(junk, now, is, the, winter, of, our); - CYG_TRACE7DV(junk, now, is, the, winter, of, our, discontent); - CYG_TRACE8DV(junk, now, is, the, winter, of, our, discontent, made); - - CYG_TRACE1XB(now); - CYG_TRACE2XB(now, is); - CYG_TRACE3XB(now, is, the); - CYG_TRACE4XB(now, is, the, winter); - CYG_TRACE5XB(now, is, the, winter, of); - CYG_TRACE6XB(now, is, the, winter, of, our); - CYG_TRACE7XB(now, is, the, winter, of, our, discontent); - CYG_TRACE8XB(now, is, the, winter, of, our, discontent, made); - - CYG_TRACE1YB(now); - CYG_TRACE2YB(now, is); - CYG_TRACE3YB(now, is, the); - CYG_TRACE4YB(now, is, the, winter); - CYG_TRACE5YB(now, is, the, winter, of); - CYG_TRACE6YB(now, is, the, winter, of, our); - CYG_TRACE7YB(now, is, the, winter, of, our, discontent); - CYG_TRACE8YB(now, is, the, winter, of, our, discontent, made); - - CYG_TRACE1DB(now); - CYG_TRACE2DB(now, is); - CYG_TRACE3DB(now, is, the); - CYG_TRACE4DB(now, is, the, winter); - CYG_TRACE5DB(now, is, the, winter, of); - CYG_TRACE6DB(now, is, the, winter, of, our); - CYG_TRACE7DB(now, is, the, winter, of, our, discontent); - CYG_TRACE8DB(now, is, the, winter, of, our, discontent, made); - - CYG_TRACE1XVB(now); - CYG_TRACE2XVB(now, is); - CYG_TRACE3XVB(now, is, the); - CYG_TRACE4XVB(now, is, the, winter); - CYG_TRACE5XVB(now, is, the, winter, of); - CYG_TRACE6XVB(now, is, the, winter, of, our); - CYG_TRACE7XVB(now, is, the, winter, of, our, discontent); - CYG_TRACE8XVB(now, is, the, winter, of, our, discontent, made); - - CYG_TRACE1YVB(now); - CYG_TRACE2YVB(now, is); - CYG_TRACE3YVB(now, is, the); - CYG_TRACE4YVB(now, is, the, winter); - CYG_TRACE5YVB(now, is, the, winter, of); - CYG_TRACE6YVB(now, is, the, winter, of, our); - CYG_TRACE7YVB(now, is, the, winter, of, our, discontent); - CYG_TRACE8YVB(now, is, the, winter, of, our, discontent, made); - - CYG_TRACE1DVB(now); - CYG_TRACE2DVB(now, is); - CYG_TRACE3DVB(now, is, the); - CYG_TRACE4DVB(now, is, the, winter); - CYG_TRACE5DVB(now, is, the, winter, of); - CYG_TRACE6DVB(now, is, the, winter, of, our); - CYG_TRACE7DVB(now, is, the, winter, of, our, discontent); - CYG_TRACE8DVB(now, is, the, winter, of, our, discontent, made); - - fn1(); - fn2(); - fn3(); - fn4(); - fn5(); - fn6(); - fn7(); - fn8(); - fn9(); - fn10(); - fn11(); - fn12(1); - fn13(2, 3); - fn14(4, 5, 6); - fn15(7, 8, 9, 10); - fn16(11, 12, 13, 14, 15); - fn17(16, 17, 18, 19, 20, 21); - fn18(22, 23, 24, 25, 26, 27, 28); - fn19(29, 30, 31, 32, 33, 34, 35, 36); - fn20(1); - fn21(2, 3); - fn22(4, 5, 6); - fn23(7, 8, 9, 10); - fn24(11, 12, 13, 14, 15); - fn25(16, 17, 18, 19, 20, 21); - fn26(22, 23, 24, 25, 26, 27, 28); - fn27(29, 30, 31, 32, 33, 34, 35, 36); - fn28(1); - fn29(2, 3); - fn30(4, 5, 6); - fn31(7, 8, 9, 10); - fn32(11, 12, 13, 14, 15); - fn33(16, 17, 18, 19, 20, 21); - fn34(22, 23, 24, 25, 26, 27, 28); - fn35(29, 30, 31, 32, 33, 34, 35, 36); - fn36(1); - fn37(2, 3); - fn38(4, 5, 6); - fn39(7, 8, 9, 10); - fn40(11, 12, 13, 14, 15); - fn41(16, 17, 18, 19, 20, 21); - fn42(22, 23, 24, 25, 26, 27, 28); - fn43(29, 30, 31, 32, 33, 34, 35, 36); - fn44(1); - fn45(2, 3); - fn46(4, 5, 6); - fn47(7, 8, 9, 10); - fn48(11, 12, 13, 14, 15); - fn49(16, 17, 18, 19, 20, 21); - fn50(22, 23, 24, 25, 26, 27, 28); - fn51(29, 30, 31, 32, 33, 34, 35, 36); - fn52(1); - fn53(2, 3); - fn54(4, 5, 6); - fn55(7, 8, 9, 10); - fn56(11, 12, 13, 14, 15); - fn57(16, 17, 18, 19, 20, 21); - fn58(22, 23, 24, 25, 26, 27, 28); - fn59(29, 30, 31, 32, 33, 34, 35, 36); - fn60(1); - fn61(2, 3); - fn62(4, 5, 6); - fn63(7, 8, 9, 10); - fn64(11, 12, 13, 14, 15); - fn65(16, 17, 18, 19, 20, 21); - fn66(22, 23, 24, 25, 26, 27, 28); - fn67(29, 30, 31, 32, 33, 34, 35, 36); - - CYG_TEST_PASS_FINISH("disabled tracing does nothing"); - return 0; -} diff --git a/host/infra/testsuite/cyginfra/ttrace2.cxx b/host/infra/testsuite/cyginfra/ttrace2.cxx deleted file mode 100644 --- a/host/infra/testsuite/cyginfra/ttrace2.cxx +++ /dev/null @@ -1,809 +0,0 @@ -//========================================================================== -// -// ttrace2.cxx -// -// Trace test case -// -//========================================================================== -//####COPYRIGHTBEGIN#### -// -// ---------------------------------------------------------------------------- -// Copyright (C) 1999, 2000 Red Hat, Inc. -// -// This file is part of the eCos host tools. -// -// This program is free software; you can redistribute it and/or modify it -// under the terms of the GNU General Public License as published by the Free -// Software Foundation; either version 2 of the License, or (at your option) -// any later version. -// -// This program is distributed in the hope that it will be useful, but WITHOUT -// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for -// more details. -// -// You should have received a copy of the GNU General Public License along with -// this program; if not, write to the Free Software Foundation, Inc., -// 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -// -// ---------------------------------------------------------------------------- -// -//####COPYRIGHTEND#### -//========================================================================== -//#####DESCRIPTIONBEGIN#### -// -// Author(s): bartv -// Contributors: bartv -// Date: 1999-01-06 -// Purpose: -// Description: This file tests all the trace macros for the case -// where tracing and function reporting are enabled. -// -//####DESCRIPTIONEND#### -//========================================================================== - - -#define CYGDBG_USE_TRACING -#define CYGDBG_INFRA_DEBUG_FUNCTION_REPORTS -#include -#include -#include - -bool tracing_is_enabled(void); -bool reporting_is_enabled(void); - -#define CYG_TRACE_USER_BOOL (tracing_is_enabled()) -#define CYG_REPORT_USER_BOOL (reporting_is_enabled()) - - -void -fn1(void) -{ - CYG_REPORT_FUNCTION(); -} - -void -fn2(void) -{ - CYG_REPORT_FUNCTYPE("printf-style format string"); -} - -void -fn3(void) -{ - CYG_REPORT_FUNCNAME("fn3"); -} - -void -fn4(void) -{ - CYG_REPORT_FUNCNAMETYPE("fn4", "printf-style format string"); -} - -void -fn5(void) -{ - CYG_REPORT_FUNCTIONC(); -} - -void -fn6(void) -{ - CYG_REPORT_FUNCTYPEC("printf-style format string"); -} - -void -fn7(void) -{ - CYG_REPORT_FUNCNAMEC("fn7"); -} - -void -fn8(void) -{ - CYG_REPORT_FUNCNAMETYPEC("fn8", "printf-style format string"); -} - -void -fn9(void) -{ - CYG_REPORT_FUNCTION(); - CYG_REPORT_RETURN(); -} - -void -fn10(void) -{ - CYG_REPORT_FUNCTYPE("result is %d"); - CYG_REPORT_RETVAL(42); -} - -void -fn11(void) -{ - CYG_REPORT_FUNCTION(); - CYG_REPORT_FUNCARGVOID(); -} - -void -fn12(int glorious) -{ - CYG_REPORT_FUNCTION(); - CYG_REPORT_FUNCARG1("%d", glorious); -} - -void -fn13(int glorious, int summer) -{ - CYG_REPORT_FUNCTION(); - CYG_REPORT_FUNCARG2("%d %d", glorious, summer); -} - -void -fn14(int glorious, int summer, int by) -{ - CYG_REPORT_FUNCTION(); - CYG_REPORT_FUNCARG3("%d %d %d", glorious, summer, by); -} - -void -fn15(int glorious, int summer, int by, int thisse) -{ - CYG_REPORT_FUNCTION(); - CYG_REPORT_FUNCARG4("%d %d %d %d", glorious, summer, by, thisse); -} - -void -fn16(int glorious, int summer, int by, int thisse, int son) -{ - CYG_REPORT_FUNCTION(); - CYG_REPORT_FUNCARG5("%d %d %d %d %d", glorious, summer, by, thisse, son); -} - -void -fn17(int glorious, int summer, int by, int thisse, int son, int of) -{ - CYG_REPORT_FUNCTION(); - CYG_REPORT_FUNCARG6("%d %d %d %d %d %d", glorious, summer, by, thisse, son, of); -} - -void -fn18(int glorious, int summer, int by, int thisse, int son, int of, int york) -{ - CYG_REPORT_FUNCTION(); - CYG_REPORT_FUNCARG7("%d %d %d %d %d %d %d", glorious, summer, by, thisse, son, of, york); -} - -void -fn19(int glorious, int summer, int by, int thisse, int son, int of, int york, int stop) -{ - CYG_REPORT_FUNCTION(); - CYG_REPORT_FUNCARG8("%d %d %d %d %d %d %d %d", glorious, summer, by, thisse, son, of, york, stop); -} - -void -fn20(int glorious) -{ - CYG_REPORT_FUNCTION(); - CYG_REPORT_FUNCARG1X(glorious); -} - -void -fn21(int glorious, int summer) -{ - CYG_REPORT_FUNCTION(); - CYG_REPORT_FUNCARG2X(glorious, summer); -} - -void -fn22(int glorious, int summer, int by) -{ - CYG_REPORT_FUNCTION(); - CYG_REPORT_FUNCARG3X(glorious, summer, by); -} - -void -fn23(int glorious, int summer, int by, int thisse) -{ - CYG_REPORT_FUNCTION(); - CYG_REPORT_FUNCARG4X(glorious, summer, by, thisse); -} - -void -fn24(int glorious, int summer, int by, int thisse, int son) -{ - CYG_REPORT_FUNCTION(); - CYG_REPORT_FUNCARG5X(glorious, summer, by, thisse, son); -} - -void -fn25(int glorious, int summer, int by, int thisse, int son, int of) -{ - CYG_REPORT_FUNCTION(); - CYG_REPORT_FUNCARG6X(glorious, summer, by, thisse, son, of); -} - -void -fn26(int glorious, int summer, int by, int thisse, int son, int of, int york) -{ - CYG_REPORT_FUNCTION(); - CYG_REPORT_FUNCARG7X(glorious, summer, by, thisse, son, of, york); -} - -void -fn27(int glorious, int summer, int by, int thisse, int son, int of, int york, int stop) -{ - CYG_REPORT_FUNCTION(); - CYG_REPORT_FUNCARG8X(glorious, summer, by, thisse, son, of, york, stop); -} - -void -fn28(int glorious) -{ - CYG_REPORT_FUNCTION(); - CYG_REPORT_FUNCARG1Y(glorious); -} - -void -fn29(int glorious, int summer) -{ - CYG_REPORT_FUNCTION(); - CYG_REPORT_FUNCARG2Y(glorious, summer); -} - -void -fn30(int glorious, int summer, int by) -{ - CYG_REPORT_FUNCTION(); - CYG_REPORT_FUNCARG3Y(glorious, summer, by); -} - -void -fn31(int glorious, int summer, int by, int thisse) -{ - CYG_REPORT_FUNCTION(); - CYG_REPORT_FUNCARG4Y(glorious, summer, by, thisse); -} - -void -fn32(int glorious, int summer, int by, int thisse, int son) -{ - CYG_REPORT_FUNCTION(); - CYG_REPORT_FUNCARG5Y(glorious, summer, by, thisse, son); -} - -void -fn33(int glorious, int summer, int by, int thisse, int son, int of) -{ - CYG_REPORT_FUNCTION(); - CYG_REPORT_FUNCARG6Y(glorious, summer, by, thisse, son, of); -} - -void -fn34(int glorious, int summer, int by, int thisse, int son, int of, int york) -{ - CYG_REPORT_FUNCTION(); - CYG_REPORT_FUNCARG7Y(glorious, summer, by, thisse, son, of, york); -} - -void -fn35(int glorious, int summer, int by, int thisse, int son, int of, int york, int stop) -{ - CYG_REPORT_FUNCTION(); - CYG_REPORT_FUNCARG8D(glorious, summer, by, thisse, son, of, york, stop); -} - -void -fn36(int glorious) -{ - CYG_REPORT_FUNCTION(); - CYG_REPORT_FUNCARG1D(glorious); -} - -void -fn37(int glorious, int summer) -{ - CYG_REPORT_FUNCTION(); - CYG_REPORT_FUNCARG2D(glorious, summer); -} - -void -fn38(int glorious, int summer, int by) -{ - CYG_REPORT_FUNCTION(); - CYG_REPORT_FUNCARG3D(glorious, summer, by); -} - -void -fn39(int glorious, int summer, int by, int thisse) -{ - CYG_REPORT_FUNCTION(); - CYG_REPORT_FUNCARG4D(glorious, summer, by, thisse); -} - -void -fn40(int glorious, int summer, int by, int thisse, int son) -{ - CYG_REPORT_FUNCTION(); - CYG_REPORT_FUNCARG5D(glorious, summer, by, thisse, son); -} - -void -fn41(int glorious, int summer, int by, int thisse, int son, int of) -{ - CYG_REPORT_FUNCTION(); - CYG_REPORT_FUNCARG6D(glorious, summer, by, thisse, son, of); -} - -void -fn42(int glorious, int summer, int by, int thisse, int son, int of, int york) -{ - CYG_REPORT_FUNCTION(); - CYG_REPORT_FUNCARG7D(glorious, summer, by, thisse, son, of, york); -} - -void -fn43(int glorious, int summer, int by, int thisse, int son, int of, int york, int stop) -{ - CYG_REPORT_FUNCTION(); - CYG_REPORT_FUNCARG8D(glorious, summer, by, thisse, son, of, york, stop); -} - -void -fn44(int glorious) -{ - CYG_REPORT_FUNCTION(); - CYG_REPORT_FUNCARG1XV(glorious); -} - -void -fn45(int glorious, int summer) -{ - CYG_REPORT_FUNCTION(); - CYG_REPORT_FUNCARG2XV(glorious, summer); -} - -void -fn46(int glorious, int summer, int by) -{ - CYG_REPORT_FUNCTION(); - CYG_REPORT_FUNCARG3XV(glorious, summer, by); -} - -void -fn47(int glorious, int summer, int by, int thisse) -{ - CYG_REPORT_FUNCTION(); - CYG_REPORT_FUNCARG4XV(glorious, summer, by, thisse); -} - -void -fn48(int glorious, int summer, int by, int thisse, int son) -{ - CYG_REPORT_FUNCTION(); - CYG_REPORT_FUNCARG5XV(glorious, summer, by, thisse, son); -} - -void -fn49(int glorious, int summer, int by, int thisse, int son, int of) -{ - CYG_REPORT_FUNCTION(); - CYG_REPORT_FUNCARG6XV(glorious, summer, by, thisse, son, of); -} - -void -fn50(int glorious, int summer, int by, int thisse, int son, int of, int york) -{ - CYG_REPORT_FUNCTION(); - CYG_REPORT_FUNCARG7XV(glorious, summer, by, thisse, son, of, york); -} - -void -fn51(int glorious, int summer, int by, int thisse, int son, int of, int york, int stop) -{ - CYG_REPORT_FUNCTION(); - CYG_REPORT_FUNCARG8XV(glorious, summer, by, thisse, son, of, york, stop); -} - -void -fn52(int glorious) -{ - CYG_REPORT_FUNCTION(); - CYG_REPORT_FUNCARG1YV(glorious); -} - -void -fn53(int glorious, int summer) -{ - CYG_REPORT_FUNCTION(); - CYG_REPORT_FUNCARG2YV(glorious, summer); -} - -void -fn54(int glorious, int summer, int by) -{ - CYG_REPORT_FUNCTION(); - CYG_REPORT_FUNCARG3YV(glorious, summer, by); -} - -void -fn55(int glorious, int summer, int by, int thisse) -{ - CYG_REPORT_FUNCTION(); - CYG_REPORT_FUNCARG4YV(glorious, summer, by, thisse); -} - -void -fn56(int glorious, int summer, int by, int thisse, int son) -{ - CYG_REPORT_FUNCTION(); - CYG_REPORT_FUNCARG5YV(glorious, summer, by, thisse, son); -} - -void -fn57(int glorious, int summer, int by, int thisse, int son, int of) -{ - CYG_REPORT_FUNCTION(); - CYG_REPORT_FUNCARG6YV(glorious, summer, by, thisse, son, of); -} - -void -fn58(int glorious, int summer, int by, int thisse, int son, int of, int york) -{ - CYG_REPORT_FUNCTION(); - CYG_REPORT_FUNCARG7YV(glorious, summer, by, thisse, son, of, york); -} - -void -fn59(int glorious, int summer, int by, int thisse, int son, int of, int york, int stop) -{ - CYG_REPORT_FUNCTION(); - CYG_REPORT_FUNCARG8YV(glorious, summer, by, thisse, son, of, york, stop); -} - -void -fn60(int glorious) -{ - CYG_REPORT_FUNCTION(); - CYG_REPORT_FUNCARG1DV(glorious); -} - -void -fn61(int glorious, int summer) -{ - CYG_REPORT_FUNCTION(); - CYG_REPORT_FUNCARG2DV(glorious, summer); -} - -void -fn62(int glorious, int summer, int by) -{ - CYG_REPORT_FUNCTION(); - CYG_REPORT_FUNCARG3DV(glorious, summer, by); -} - -void -fn63(int glorious, int summer, int by, int thisse) -{ - CYG_REPORT_FUNCTION(); - CYG_REPORT_FUNCARG4DV(glorious, summer, by, thisse); -} - -void -fn64(int glorious, int summer, int by, int thisse, int son) -{ - CYG_REPORT_FUNCTION(); - CYG_REPORT_FUNCARG5DV(glorious, summer, by, thisse, son); -} - -void -fn65(int glorious, int summer, int by, int thisse, int son, int of) -{ - CYG_REPORT_FUNCTION(); - CYG_REPORT_FUNCARG6DV(glorious, summer, by, thisse, son, of); -} - -void -fn66(int glorious, int summer, int by, int thisse, int son, int of, int york) -{ - CYG_REPORT_FUNCTION(); - CYG_REPORT_FUNCARG7DV(glorious, summer, by, thisse, son, of, york); -} - -void -fn67(int glorious, int summer, int by, int thisse, int son, int of, int york, int stop) -{ - CYG_REPORT_FUNCTION(); - CYG_REPORT_FUNCARG8DV(glorious, summer, by, thisse, son, of, york, stop); -} - -int -main(int argc, char** argv) -{ - int glorious = 0; - int summer = 1; - int by = 2; - int thisse = 4; - int son = 5; - int of = 6; - int york = 7; - int stop = 8; - - CYG_TRACE0(true, "no argument here"); - CYG_TRACE1(true, "%d", glorious); - CYG_TRACE2(true, "%d %d", glorious, summer); - CYG_TRACE3(true, "%d %d %d", glorious, summer, by); - CYG_TRACE4(true, "%d %d %d %d", glorious, summer, by, thisse); - CYG_TRACE5(true, "%d %d %d %d %d", glorious, summer, by, thisse, son); - CYG_TRACE6(true, "%d %d %d %d %d %d", glorious, summer, by, thisse, son, of); - CYG_TRACE7(true, "%d %d %d %d %d %d %d", glorious, summer, by, thisse, son, of, york); - CYG_TRACE8(true, "%d %d %d %d %d %d %d %d", glorious, summer, by, thisse, son, of, york, stop); - - CYG_TRACE0(false, "no argument here"); - CYG_TRACE1(false, "%d", glorious); - CYG_TRACE2(false, "%d %d", glorious, summer); - CYG_TRACE3(false, "%d %d %d", glorious, summer, by); - CYG_TRACE4(false, "%d %d %d %d", glorious, summer, by, thisse); - CYG_TRACE5(false, "%d %d %d %d %d", glorious, summer, by, thisse, son); - CYG_TRACE6(false, "%d %d %d %d %d %d", glorious, summer, by, thisse, son, of); - CYG_TRACE7(false, "%d %d %d %d %d %d %d", glorious, summer, by, thisse, son, of, york); - CYG_TRACE8(false, "%d %d %d %d %d %d %d %d", glorious, summer, by, thisse, son, of, york, stop); - - CYG_TRACE0B("no argument here"); - CYG_TRACE1B("%d", glorious); - CYG_TRACE2B("%d %d", glorious, summer); - CYG_TRACE3B("%d %d %d", glorious, summer, by); - CYG_TRACE4B("%d %d %d %d", glorious, summer, by, thisse); - CYG_TRACE5B("%d %d %d %d %d", glorious, summer, by, thisse, son); - CYG_TRACE6B("%d %d %d %d %d %d", glorious, summer, by, thisse, son, of); - CYG_TRACE7B("%d %d %d %d %d %d %d", glorious, summer, by, thisse, son, of, york); - CYG_TRACE8B("%d %d %d %d %d %d %d %d", glorious, summer, by, thisse, son, of, york, stop); - - CYG_TRACE1X(true, glorious); - CYG_TRACE2X(true, glorious, summer); - CYG_TRACE3X(true, glorious, summer, by); - CYG_TRACE4X(true, glorious, summer, by, thisse); - CYG_TRACE5X(true, glorious, summer, by, thisse, son); - CYG_TRACE6X(true, glorious, summer, by, thisse, son, of); - CYG_TRACE7X(true, glorious, summer, by, thisse, son, of, york); - CYG_TRACE8X(true, glorious, summer, by, thisse, son, of, york, stop); - - CYG_TRACE1Y(true, glorious); - CYG_TRACE2Y(true, glorious, summer); - CYG_TRACE3Y(true, glorious, summer, by); - CYG_TRACE4Y(true, glorious, summer, by, thisse); - CYG_TRACE5Y(true, glorious, summer, by, thisse, son); - CYG_TRACE6Y(true, glorious, summer, by, thisse, son, of); - CYG_TRACE7Y(true, glorious, summer, by, thisse, son, of, york); - CYG_TRACE8Y(true, glorious, summer, by, thisse, son, of, york, stop); - - CYG_TRACE1D(true, glorious); - CYG_TRACE2D(true, glorious, summer); - CYG_TRACE3D(true, glorious, summer, by); - CYG_TRACE4D(true, glorious, summer, by, thisse); - CYG_TRACE5D(true, glorious, summer, by, thisse, son); - CYG_TRACE6D(true, glorious, summer, by, thisse, son, of); - CYG_TRACE7D(true, glorious, summer, by, thisse, son, of, york); - CYG_TRACE8D(true, glorious, summer, by, thisse, son, of, york, stop); - - CYG_TRACE1XV(true, glorious); - CYG_TRACE2XV(true, glorious, summer); - CYG_TRACE3XV(true, glorious, summer, by); - CYG_TRACE4XV(true, glorious, summer, by, thisse); - CYG_TRACE5XV(true, glorious, summer, by, thisse, son); - CYG_TRACE6XV(true, glorious, summer, by, thisse, son, of); - CYG_TRACE7XV(true, glorious, summer, by, thisse, son, of, york); - CYG_TRACE8XV(true, glorious, summer, by, thisse, son, of, york, stop); - - CYG_TRACE1YV(true, glorious); - CYG_TRACE2YV(true, glorious, summer); - CYG_TRACE3YV(true, glorious, summer, by); - CYG_TRACE4YV(true, glorious, summer, by, thisse); - CYG_TRACE5YV(true, glorious, summer, by, thisse, son); - CYG_TRACE6YV(true, glorious, summer, by, thisse, son, of); - CYG_TRACE7YV(true, glorious, summer, by, thisse, son, of, york); - CYG_TRACE8YV(true, glorious, summer, by, thisse, son, of, york, stop); - - CYG_TRACE1DV(true, glorious); - CYG_TRACE2DV(true, glorious, summer); - CYG_TRACE3DV(true, glorious, summer, by); - CYG_TRACE4DV(true, glorious, summer, by, thisse); - CYG_TRACE5DV(true, glorious, summer, by, thisse, son); - CYG_TRACE6DV(true, glorious, summer, by, thisse, son, of); - CYG_TRACE7DV(true, glorious, summer, by, thisse, son, of, york); - CYG_TRACE8DV(true, glorious, summer, by, thisse, son, of, york, stop); - - CYG_TRACE1X(false, glorious); - CYG_TRACE2X(false, glorious, summer); - CYG_TRACE3X(false, glorious, summer, by); - CYG_TRACE4X(false, glorious, summer, by, thisse); - CYG_TRACE5X(false, glorious, summer, by, thisse, son); - CYG_TRACE6X(false, glorious, summer, by, thisse, son, of); - CYG_TRACE7X(false, glorious, summer, by, thisse, son, of, york); - CYG_TRACE8X(false, glorious, summer, by, thisse, son, of, york, stop); - - CYG_TRACE1Y(false, glorious); - CYG_TRACE2Y(false, glorious, summer); - CYG_TRACE3Y(false, glorious, summer, by); - CYG_TRACE4Y(false, glorious, summer, by, thisse); - CYG_TRACE5Y(false, glorious, summer, by, thisse, son); - CYG_TRACE6Y(false, glorious, summer, by, thisse, son, of); - CYG_TRACE7Y(false, glorious, summer, by, thisse, son, of, york); - CYG_TRACE8Y(false, glorious, summer, by, thisse, son, of, york, stop); - - CYG_TRACE1D(false, glorious); - CYG_TRACE2D(false, glorious, summer); - CYG_TRACE3D(false, glorious, summer, by); - CYG_TRACE4D(false, glorious, summer, by, thisse); - CYG_TRACE5D(false, glorious, summer, by, thisse, son); - CYG_TRACE6D(false, glorious, summer, by, thisse, son, of); - CYG_TRACE7D(false, glorious, summer, by, thisse, son, of, york); - CYG_TRACE8D(false, glorious, summer, by, thisse, son, of, york, stop); - - CYG_TRACE1XV(false, glorious); - CYG_TRACE2XV(false, glorious, summer); - CYG_TRACE3XV(false, glorious, summer, by); - CYG_TRACE4XV(false, glorious, summer, by, thisse); - CYG_TRACE5XV(false, glorious, summer, by, thisse, son); - CYG_TRACE6XV(false, glorious, summer, by, thisse, son, of); - CYG_TRACE7XV(false, glorious, summer, by, thisse, son, of, york); - CYG_TRACE8XV(false, glorious, summer, by, thisse, son, of, york, stop); - - CYG_TRACE1YV(false, glorious); - CYG_TRACE2YV(false, glorious, summer); - CYG_TRACE3YV(false, glorious, summer, by); - CYG_TRACE4YV(false, glorious, summer, by, thisse); - CYG_TRACE5YV(false, glorious, summer, by, thisse, son); - CYG_TRACE6YV(false, glorious, summer, by, thisse, son, of); - CYG_TRACE7YV(false, glorious, summer, by, thisse, son, of, york); - CYG_TRACE8YV(false, glorious, summer, by, thisse, son, of, york, stop); - - CYG_TRACE1DV(false, glorious); - CYG_TRACE2DV(false, glorious, summer); - CYG_TRACE3DV(false, glorious, summer, by); - CYG_TRACE4DV(false, glorious, summer, by, thisse); - CYG_TRACE5DV(false, glorious, summer, by, thisse, son); - CYG_TRACE6DV(false, glorious, summer, by, thisse, son, of); - CYG_TRACE7DV(false, glorious, summer, by, thisse, son, of, york); - CYG_TRACE8DV(false, glorious, summer, by, thisse, son, of, york, stop); - - CYG_TRACE1XB(glorious); - CYG_TRACE2XB(glorious, summer); - CYG_TRACE3XB(glorious, summer, by); - CYG_TRACE4XB(glorious, summer, by, thisse); - CYG_TRACE5XB(glorious, summer, by, thisse, son); - CYG_TRACE6XB(glorious, summer, by, thisse, son, of); - CYG_TRACE7XB(glorious, summer, by, thisse, son, of, york); - CYG_TRACE8XB(glorious, summer, by, thisse, son, of, york, stop); - - CYG_TRACE1YB(glorious); - CYG_TRACE2YB(glorious, summer); - CYG_TRACE3YB(glorious, summer, by); - CYG_TRACE4YB(glorious, summer, by, thisse); - CYG_TRACE5YB(glorious, summer, by, thisse, son); - CYG_TRACE6YB(glorious, summer, by, thisse, son, of); - CYG_TRACE7YB(glorious, summer, by, thisse, son, of, york); - CYG_TRACE8YB(glorious, summer, by, thisse, son, of, york, stop); - - CYG_TRACE1DB(glorious); - CYG_TRACE2DB(glorious, summer); - CYG_TRACE3DB(glorious, summer, by); - CYG_TRACE4DB(glorious, summer, by, thisse); - CYG_TRACE5DB(glorious, summer, by, thisse, son); - CYG_TRACE6DB(glorious, summer, by, thisse, son, of); - CYG_TRACE7DB(glorious, summer, by, thisse, son, of, york); - CYG_TRACE8DB(glorious, summer, by, thisse, son, of, york, stop); - - CYG_TRACE1XVB(glorious); - CYG_TRACE2XVB(glorious, summer); - CYG_TRACE3XVB(glorious, summer, by); - CYG_TRACE4XVB(glorious, summer, by, thisse); - CYG_TRACE5XVB(glorious, summer, by, thisse, son); - CYG_TRACE6XVB(glorious, summer, by, thisse, son, of); - CYG_TRACE7XVB(glorious, summer, by, thisse, son, of, york); - CYG_TRACE8XVB(glorious, summer, by, thisse, son, of, york, stop); - - CYG_TRACE1YVB(glorious); - CYG_TRACE2YVB(glorious, summer); - CYG_TRACE3YVB(glorious, summer, by); - CYG_TRACE4YVB(glorious, summer, by, thisse); - CYG_TRACE5YVB(glorious, summer, by, thisse, son); - CYG_TRACE6YVB(glorious, summer, by, thisse, son, of); - CYG_TRACE7YVB(glorious, summer, by, thisse, son, of, york); - CYG_TRACE8YVB(glorious, summer, by, thisse, son, of, york, stop); - - CYG_TRACE1DVB(glorious); - CYG_TRACE2DVB(glorious, summer); - CYG_TRACE3DVB(glorious, summer, by); - CYG_TRACE4DVB(glorious, summer, by, thisse); - CYG_TRACE5DVB(glorious, summer, by, thisse, son); - CYG_TRACE6DVB(glorious, summer, by, thisse, son, of); - CYG_TRACE7DVB(glorious, summer, by, thisse, son, of, york); - CYG_TRACE8DVB(glorious, summer, by, thisse, son, of, york, stop); - - fn1(); - fn2(); - fn3(); - fn4(); - fn5(); - fn6(); - fn7(); - fn8(); - fn9(); - fn10(); - fn11(); - fn12(1); - fn13(2, 3); - fn14(4, 5, 6); - fn15(7, 8, 9, 10); - fn16(11, 12, 13, 14, 15); - fn17(16, 17, 18, 19, 20, 21); - fn18(22, 23, 24, 25, 26, 27, 28); - fn19(29, 30, 31, 32, 33, 34, 35, 36); - fn20(1); - fn21(2, 3); - fn22(4, 5, 6); - fn23(7, 8, 9, 10); - fn24(11, 12, 13, 14, 15); - fn25(16, 17, 18, 19, 20, 21); - fn26(22, 23, 24, 25, 26, 27, 28); - fn27(29, 30, 31, 32, 33, 34, 35, 36); - fn28(1); - fn29(2, 3); - fn30(4, 5, 6); - fn31(7, 8, 9, 10); - fn32(11, 12, 13, 14, 15); - fn33(16, 17, 18, 19, 20, 21); - fn34(22, 23, 24, 25, 26, 27, 28); - fn35(29, 30, 31, 32, 33, 34, 35, 36); - fn36(1); - fn37(2, 3); - fn38(4, 5, 6); - fn39(7, 8, 9, 10); - fn40(11, 12, 13, 14, 15); - fn41(16, 17, 18, 19, 20, 21); - fn42(22, 23, 24, 25, 26, 27, 28); - fn43(29, 30, 31, 32, 33, 34, 35, 36); - fn44(1); - fn45(2, 3); - fn46(4, 5, 6); - fn47(7, 8, 9, 10); - fn48(11, 12, 13, 14, 15); - fn49(16, 17, 18, 19, 20, 21); - fn50(22, 23, 24, 25, 26, 27, 28); - fn51(29, 30, 31, 32, 33, 34, 35, 36); - fn52(1); - fn53(2, 3); - fn54(4, 5, 6); - fn55(7, 8, 9, 10); - fn56(11, 12, 13, 14, 15); - fn57(16, 17, 18, 19, 20, 21); - fn58(22, 23, 24, 25, 26, 27, 28); - fn59(29, 30, 31, 32, 33, 34, 35, 36); - fn60(1); - fn61(2, 3); - fn62(4, 5, 6); - fn63(7, 8, 9, 10); - fn64(11, 12, 13, 14, 15); - fn65(16, 17, 18, 19, 20, 21); - fn66(22, 23, 24, 25, 26, 27, 28); - fn67(29, 30, 31, 32, 33, 34, 35, 36); - - CYG_TEST_PASS_FINISH("enabled tracing only slows things down"); - return 0; -} -// ---------------------------------------------------------------------------- -// These functions allow "dynamic" control over tracing and reporting. -// The assumption is that the compiler does not know enough about rand() -// to be able to optimise this away. -bool -tracing_is_enabled(void) -{ - return rand() >= 0; -} - -bool -reporting_is_enabled(void) -{ - return rand() >= 0; -} diff --git a/host/infra/testsuite/cyginfra/ttrace3.cxx b/host/infra/testsuite/cyginfra/ttrace3.cxx deleted file mode 100644 --- a/host/infra/testsuite/cyginfra/ttrace3.cxx +++ /dev/null @@ -1,70 +0,0 @@ -//========================================================================== -// -// ttrace3.cxx -// -// Trace test case -// -//========================================================================== -//####COPYRIGHTBEGIN#### -// -// ---------------------------------------------------------------------------- -// Copyright (C) 1999, 2000 Red Hat, Inc. -// -// This file is part of the eCos host tools. -// -// This program is free software; you can redistribute it and/or modify it -// under the terms of the GNU General Public License as published by the Free -// Software Foundation; either version 2 of the License, or (at your option) -// any later version. -// -// This program is distributed in the hope that it will be useful, but WITHOUT -// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for -// more details. -// -// You should have received a copy of the GNU General Public License along with -// this program; if not, write to the Free Software Foundation, Inc., -// 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -// -// ---------------------------------------------------------------------------- -// -//####COPYRIGHTEND#### -//========================================================================== -//#####DESCRIPTIONBEGIN#### -// -// Author(s): bartv -// Contributors: bartv -// Date: 1999-01-06 -// Purpose: -// Description: Do an awful lot of tracing, to make sure that the -// circular buffer is circular. -// -//####DESCRIPTIONEND#### -//========================================================================== - - -#define CYGDBG_USE_TRACING -#define CYGDBG_INFRA_DEBUG_FUNCTION_REPORTS -#include -#include -#include - -void -dummy(void) -{ - CYG_REPORT_FUNCNAME("dummy"); - CYG_REPORT_RETURN(); -} - -int -main(int argc, char** argv) -{ - for (int i = 0; i < 1000000; i++) { - CYG_TRACE0(true, "no argument here"); - dummy(); - } - - CYG_TEST_PASS_FINISH("Lots of tracing is possible"); -} - - diff --git a/host/infra/testsuite/cyginfra/ttrace4.cxx b/host/infra/testsuite/cyginfra/ttrace4.cxx deleted file mode 100644 --- a/host/infra/testsuite/cyginfra/ttrace4.cxx +++ /dev/null @@ -1,71 +0,0 @@ -//========================================================================== -// -// ttrace4.cxx -// -// Trace test case -// -//========================================================================== -//####COPYRIGHTBEGIN#### -// -// ---------------------------------------------------------------------------- -// Copyright (C) 1999, 2000 Red Hat, Inc. -// -// This file is part of the eCos host tools. -// -// This program is free software; you can redistribute it and/or modify it -// under the terms of the GNU General Public License as published by the Free -// Software Foundation; either version 2 of the License, or (at your option) -// any later version. -// -// This program is distributed in the hope that it will be useful, but WITHOUT -// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for -// more details. -// -// You should have received a copy of the GNU General Public License along with -// this program; if not, write to the Free Software Foundation, Inc., -// 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -// -// ---------------------------------------------------------------------------- -// -//####COPYRIGHTEND#### -//========================================================================== -//#####DESCRIPTIONBEGIN#### -// -// Author(s): bartv -// Contributors: bartv -// Date: 1999-01-06 -// Purpose: -// Description: Do lots of tracing and generate a dump. The test -// harness checks that there is lots of output and -// that the first line matches expectations. -// -//####DESCRIPTIONEND#### -//========================================================================== - - -#define CYGDBG_USE_ASSERTS -#define CYGDBG_USE_TRACING -#define CYGDBG_INFRA_DEBUG_FUNCTION_REPORTS -#include -#include -#include -#include - -void -dummy(void) -{ - CYG_REPORT_FUNCNAME("dummy"); - CYG_REPORT_RETURN(); -} - -int -main(int argc, char** argv) -{ - for (int i = 0; i < 100000; i++) { - CYG_TRACE0(true, "no argument here"); - dummy(); - } - CYG_TRACE0(true, "Goodbye and thanks for all the fish"); - CYG_FAIL("intentional"); -} diff --git a/host/infra/testsuite/lib/cyginfra.exp b/host/infra/testsuite/lib/cyginfra.exp deleted file mode 100644 --- a/host/infra/testsuite/lib/cyginfra.exp +++ /dev/null @@ -1,43 +0,0 @@ -#=============================================================================== -# -# cyginfra.exp -# -# Support for host-side testing -# -#=============================================================================== -######COPYRIGHTBEGIN#### -# -# ---------------------------------------------------------------------------- -# Copyright (C) 1998, 1999, 2000 Red Hat, Inc. -# -# This file is part of the eCos host tools. -# -# This program is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License as published by the Free -# Software Foundation; either version 2 of the License, or (at your option) -# any later version. -# -# This program is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for -# more details. -# -# You should have received a copy of the GNU General Public License along with -# this program; if not, write to the Free Software Foundation, Inc., -# 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -# -# ---------------------------------------------------------------------------- -# -######COPYRIGHTEND#### -#=============================================================================== -######DESCRIPTIONBEGIN#### -# -# Author(s): bartv -# Contributors: bartv -# Date: 1998-11-24 -# -#####DESCRIPTIONEND#### -#=============================================================================== - -# At this stage there is nothing useful for this file to do. However its -# existence prevents DejaGnu from issuing a warning. diff --git a/host/infra/trace.cxx b/host/infra/trace.cxx deleted file mode 100644 --- a/host/infra/trace.cxx +++ /dev/null @@ -1,684 +0,0 @@ -//{{{ Banner - -//============================================================================ -// -// trace.cxx -// -// Host side implementation of the infrastructure trace facilities. -// -//============================================================================ -//####COPYRIGHTBEGIN#### -// -// ---------------------------------------------------------------------------- -// Copyright (C) 2002 Bart Veer -// Copyright (C) 1998, 1999, 2000, 2001 Red Hat, Inc. -// -// This file is part of the eCos host tools. -// -// This program is free software; you can redistribute it and/or modify it -// under the terms of the GNU General Public License as published by the Free -// Software Foundation; either version 2 of the License, or (at your option) -// any later version. -// -// This program is distributed in the hope that it will be useful, but WITHOUT -// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for -// more details. -// -// You should have received a copy of the GNU General Public License along with -// this program; if not, write to the Free Software Foundation, Inc., -// 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -// -// ---------------------------------------------------------------------------- -// -//####COPYRIGHTEND#### -//============================================================================ -//#####DESCRIPTIONBEGIN#### -// -// Author(s): bartv -// Contact(s): bartv -// Date: 1998/12/07 -// Version: 0.01 -// Purpose: To provide a host-side implementation of the eCos tracing -// facilities. -// -//####DESCRIPTIONEND#### -//============================================================================ - -//}}} -//{{{ #include's - -// Make sure that the host-side extensions get prototyped -// as well. Note that the tracing code needs to interact -// with the assertion facilities to set up an appropriate -// callback. -#define CYG_DECLARE_HOST_ASSERTION_SUPPORT -#include "pkgconf/infra.h" -#include "cyg/infra/cyg_type.h" -#include "cyg/infra/cyg_ass.h" - -// Without this #define the tracing enums and prototypes are -// not visible. -#define CYGDBG_USE_TRACING -#include "cyg/infra/cyg_trac.h" - -// The standard C++ string class is used extensively -#include - -// Add a few C headers -#include -#include -#include - -//}}} - -//{{{ Description - -// ------------------------------------------------------------------------- -// The tracing macros end up calling one of the following routines: -// -// void cyg_tracenomsg(cyg_uint32 what, const char* fn, const char* file, cyg_uint32 line) -// void cyg_tracemsg( ..., const char* msg) -// void cyg_tracemsg2( ..., CYG_ADDRWORD arg0, CYG_ADDRWORD arg1 ) -// void cyg_tracemsg4( ..., CYG_ADDRWORD arg0, CYG_ADDRWORD arg1, ... ) -// void cyg_tracemsg6( ..., CYG_ADDRWORD arg0, CYG_ADDRWORD arg1, ... ) -// void cyg_tracemsg8( ..., CYG_ADDRWORD arg0, CYG_ADDRWORD arg1, ... ) -// -// For the 2/4/6/8 variants the msg argument is essentially a printf() -// style format string. However the intention is that the implementation -// of the trace code can delay doing the formatting until the trace -// information is actually needed (with obvious consequences for -// generated strings). Such an implementation would significantly -// reduce the overheads associated with tracing, and is what is implemented -// here. -// -// CYG_ADDRWORD is likely to be either "int" or the platform-specific -// 64 bit data type: it should be big enough to hold either a pointer -// or any normal integral type. This causes problems on machines which -// have e.g. 32 bit int and 64 bit long: any 32 bit quantities will -// have been converted to 64 bit quantities in the calling code, and -// it is no longer possible to just pass the format string to sprintf(). -// Instead what amounts to a re-implementation of sprintf() is needed -// here. -// -// The basic implementation of this trace code is as follows: -// -// 1) a static array of data structures to hold the trace data. The -// size can be configured. There is a current index into this -// array. -// -// 2) the various trace functions simply update this array and the -// counter. -// -// 3) all of the trace functions also check a static to see whether -// or not it is necessary to install a trace handler. This cannot -// be done by means of a static object due to constructor priority -// ordering problems. -// -// 4) the callback function does all the hardware of the formatting -// etc. - -//}}} -//{{{ Types and statics - -// ---------------------------------------------------------------------------- -// A data structure rather than a class is used to hold the trace data. -// This guarantees that the array gets put in the bss section and is properly -// zeroed. A "valid" field in the structure can be checked when dumping the -// array. - -typedef struct trace_entry { - bool valid; - cyg_uint32 what; - cyg_uint32 line; - const char* fn; - const char* file; - const char* msg; - CYG_ADDRWORD data[8]; -} trace_entry; - -#ifndef CYGNUM_INFRA_TRACE_VECTOR_SIZE -# define CYGNUM_INFRA_TRACE_VECTOR_SIZE 2048 -#endif - -static trace_entry tracevec[CYGNUM_INFRA_TRACE_VECTOR_SIZE]; -static volatile int trace_index = 0; - -// Forward declaration of the callback function, for convenience. -static void trace_callback(void (*)(const char*)); - -// Has the callback been installed yet? -static bool callback_installed = false; - -//}}} -//{{{ The trace functions themselves - -// ---------------------------------------------------------------------------- -// The functions that get called by the trace macros. Typically these work -// as follows: -// -// 1) read and increment the trace index. This makes tracing marginally usable -// in multi-threaded systems. -// -// 2) invalidate the entry that is about to be updated. Again this helps a bit -// with multi-threaded systems. -// -// 3) fill in all the fields as per the command-line arguments, zeroing -// unused fields. -// -// 4) set the valid flag to true, which means the contents can now be output. -// -// This is by no means sufficient to guarantee that a call to dump the trace -// vector in some other thread can work safely, but it may help a little bit. - -extern "C" void -cyg_tracenomsg(const char* fn, const char* file, cyg_uint32 line) -{ - int i = trace_index; - tracevec[i].valid = false; - trace_index = (trace_index + 1) % CYGNUM_INFRA_TRACE_VECTOR_SIZE; - - tracevec[i].what = cyg_trace_trace; - tracevec[i].fn = fn; - tracevec[i].file = file; - tracevec[i].line = line; - tracevec[i].msg = 0; - tracevec[i].data[0] = 0; - tracevec[i].data[1] = 0; - tracevec[i].data[2] = 0; - tracevec[i].data[3] = 0; - tracevec[i].data[4] = 0; - tracevec[i].data[5] = 0; - tracevec[i].data[6] = 0; - tracevec[i].data[7] = 0; - tracevec[i].valid = true; - - if (!callback_installed) { - cyg_assert_install_failure_callback("Trace", &trace_callback); - callback_installed = true; - } -} - -extern "C" void -cyg_tracemsg(cyg_uint32 what, const char* fn, const char* file, cyg_uint32 line, const char* msg) -{ - int i = trace_index; - tracevec[i].valid = false; - trace_index = (trace_index + 1) % CYGNUM_INFRA_TRACE_VECTOR_SIZE; - - tracevec[i].what = what; - tracevec[i].fn = fn; - tracevec[i].file = file; - tracevec[i].line = line; - tracevec[i].msg = msg; - tracevec[i].data[0] = 0; - tracevec[i].data[1] = 0; - tracevec[i].data[2] = 0; - tracevec[i].data[3] = 0; - tracevec[i].data[4] = 0; - tracevec[i].data[5] = 0; - tracevec[i].data[6] = 0; - tracevec[i].data[7] = 0; - tracevec[i].valid = true; - - if (!callback_installed) { - cyg_assert_install_failure_callback("Trace", &trace_callback); - callback_installed = true; - } -} - -extern "C" void -cyg_tracemsg2(cyg_uint32 what, const char* fn, const char* file, cyg_uint32 line, const char *msg, - CYG_ADDRWORD arg0, CYG_ADDRWORD arg1) -{ - int i = trace_index; - tracevec[i].valid = false; - trace_index = (trace_index + 1) % CYGNUM_INFRA_TRACE_VECTOR_SIZE; - - tracevec[i].what = what; - tracevec[i].fn = fn; - tracevec[i].file = file; - tracevec[i].line = line; - tracevec[i].msg = msg; - tracevec[i].data[0] = arg0; - tracevec[i].data[1] = arg1; - tracevec[i].data[2] = 0; - tracevec[i].data[3] = 0; - tracevec[i].data[4] = 0; - tracevec[i].data[5] = 0; - tracevec[i].data[6] = 0; - tracevec[i].data[7] = 0; - tracevec[i].valid = true; - - if (!callback_installed) { - cyg_assert_install_failure_callback("Trace", &trace_callback); - callback_installed = true; - } -} - -extern "C" void -cyg_tracemsg4(cyg_uint32 what, const char *fn, const char* file, cyg_uint32 line, const char *msg, - CYG_ADDRWORD arg0, CYG_ADDRWORD arg1, - CYG_ADDRWORD arg2, CYG_ADDRWORD arg3) -{ - int i = trace_index; - tracevec[i].valid = false; - trace_index = (trace_index + 1) % CYGNUM_INFRA_TRACE_VECTOR_SIZE; - - tracevec[i].what = what; - tracevec[i].fn = fn; - tracevec[i].file = file; - tracevec[i].line = line; - tracevec[i].msg = msg; - tracevec[i].data[0] = arg0; - tracevec[i].data[1] = arg1; - tracevec[i].data[2] = arg2; - tracevec[i].data[3] = arg3; - tracevec[i].data[4] = 0; - tracevec[i].data[5] = 0; - tracevec[i].data[6] = 0; - tracevec[i].data[7] = 0; - tracevec[i].valid = true; - - if (!callback_installed) { - cyg_assert_install_failure_callback("Trace", &trace_callback); - callback_installed = true; - } -} - -extern "C" void -cyg_tracemsg6(cyg_uint32 what, const char *fn, const char* file, cyg_uint32 line, const char *msg, - CYG_ADDRWORD arg0, CYG_ADDRWORD arg1, - CYG_ADDRWORD arg2, CYG_ADDRWORD arg3, - CYG_ADDRWORD arg4, CYG_ADDRWORD arg5) -{ - int i = trace_index; - tracevec[i].valid = false; - trace_index = (trace_index + 1) % CYGNUM_INFRA_TRACE_VECTOR_SIZE; - - tracevec[i].what = what; - tracevec[i].fn = fn; - tracevec[i].file = file; - tracevec[i].line = line; - tracevec[i].msg = msg; - tracevec[i].data[0] = arg0; - tracevec[i].data[1] = arg1; - tracevec[i].data[2] = arg2; - tracevec[i].data[3] = arg3; - tracevec[i].data[4] = arg4; - tracevec[i].data[5] = arg5; - tracevec[i].data[6] = 0; - tracevec[i].data[7] = 0; - tracevec[i].valid = true; - - if (!callback_installed) { - cyg_assert_install_failure_callback("Trace", &trace_callback); - callback_installed = true; - } -} - -extern "C" void -cyg_tracemsg8(cyg_uint32 what, const char* fn, const char* file, cyg_uint32 line, const char *msg, - CYG_ADDRWORD arg0, CYG_ADDRWORD arg1, - CYG_ADDRWORD arg2, CYG_ADDRWORD arg3, - CYG_ADDRWORD arg4, CYG_ADDRWORD arg5, - CYG_ADDRWORD arg6, CYG_ADDRWORD arg7) -{ - int i = trace_index; - tracevec[i].valid = false; - trace_index = (trace_index + 1) % CYGNUM_INFRA_TRACE_VECTOR_SIZE; - - tracevec[i].what = what; - tracevec[i].fn = fn; - tracevec[i].file = file; - tracevec[i].line = line; - tracevec[i].msg = msg; - tracevec[i].data[0] = arg0; - tracevec[i].data[1] = arg1; - tracevec[i].data[2] = arg2; - tracevec[i].data[3] = arg3; - tracevec[i].data[4] = arg4; - tracevec[i].data[5] = arg5; - tracevec[i].data[6] = arg6; - tracevec[i].data[7] = arg7; - tracevec[i].valid = true; - - if (!callback_installed) { - cyg_assert_install_failure_callback("Trace", &trace_callback); - callback_installed = true; - } -} - -//}}} -//{{{ Output callback - -// ---------------------------------------------------------------------------- -// Dumping the output. The assertion code will invoke a single callback -// function, cyg_trace_dummy::trace_callback(), with a function pointer -// that can be used for the actual output. -// -// The trace_callback() function loops through the various entries in the -// vector, ignoring invalid ones, and invoking output_entry() for the -// valid ones. -// -// There are a number of utility routines: -// -// trim_file() is used to take a full pathname and return just the -// final part of it as a C++ string. There is an upper bound on the -// length of this string. -// -// trim_linenum() formats the linenumber sensibly. -// -// trim_function() is used to parse a __PRETTY_FUNCTION__ value -// and produce something more manageable. -// -// parse_msg() is used to construct the full trace message. -// Because of possible 32/64 bit confusion it is not possible -// to just use sprintf() for this. - -static std::string -trim_file(const char* file) -{ - // If the output is to look reasonable then the result should be a - // fixed length. 20 characters is reasonable for now. - const int max_filename_len = 20; - - if (0 == file) { - return std::string(max_filename_len, ' '); - } - - // Move to the end of the string, and then back again until - // a directory separator is found. Given the number of levels - // in a typical eCos directory hierarchy it is probably not - // worthwhile outputting any of that information. - const char * pEnd = file + strlen(file); - while ((pEnd > file) && ('/' != *pEnd) && ('\\' != *pEnd)) { - pEnd--; - } - if (pEnd != file) - pEnd++; - - std::string result = ""; - int i = 0; - for ( ;(*pEnd != '\0') && (i < max_filename_len); i++, pEnd++) { - result += *pEnd; - } - for ( ; i < max_filename_len; i++) { - result += ' '; - } - - return result; -} - -// The linenumber output should be up to four digits, right-padded -// with spaces. sprintf() will do the trick nicely. - -static std::string -trim_linenum(cyg_uint32 line) -{ - char buf[32]; - sprintf(buf, "%-4d", (int) line); - return buf; -} - -// Extract a function name. On the target side function names -// are usually obtained via __PRETTY_FUNCTION__, and the resulting -// output is a bit on the large side: return value, arguments, etc -// are all included. On the host side the function name is normally -// supplied explicitly and should not be trimmed at all. -// -// Padding is not appropriate since the function name is likely -// to be followed immediately by the argument list. No maximum -// length is imposed - arguably that is a bad idea. -static std::string -trim_function(const char* fn) -{ - if (0 == fn) { - return ""; - } - -#if 1 - return fn; -#else - // This implements the target-side behaviour. - // - // First locate the opening bracket. The function name can - // be identified by walking backwards from that. - const char *s; - for (s = fn; ('\0' != *s) && ('(' != *s); s++); - for ( ; (s > fn) && (*s != ' '); s--); - if ( s > fn) s++; - - std::string result = ""; - while ( ('\0' != *s) && ('(' != *s) ) - result += *s++; - - return result; -#endif -} - -// The trace format string contained a %s. It is necessary to check -// whether the argument is still valid, and return a suitable -// approximation to the actual data. -static std::string -trim_string(const char * arg) -{ - const int max_string_len = 20; - - std::string result = ""; - if (0 == arg) { - return result; - } - int i; - for ( i = 0; (i < max_string_len) && ('\0' != *arg) && isprint(*arg); i++, arg++) { - result += *arg; - } - return result; -} - -// ---------------------------------------------------------------------------- -// Parse a printf() style format string and do the appropriate expansions. -// Because of possible confusion between 32 and 64 bit integers it is not -// possible to use sprintf() itself. -// -// It is assumed that the format string is valid, as are most of the -// arguments. The possible exception is %s arguments where a little bit of -// checking happens first. - -static std::string -parse_msg(const char* msg, trace_entry& entry) -{ - if (0 == msg) { - return ""; - } - // Keep track of the number of arguments in the trace_entry - // that have been processed. - int args_index = 0; - - // A utility buffer for sprintf(), e.g. for integer-> string conversions. - char util_buf[64]; - - std::string result = ""; - for ( ; '\0' != *msg; msg++) { - - if ('%' != *msg) { - result += *msg; - continue; - } - - // We have a format string. Extract all of it. - std::string format = "%"; - msg++; - - // The first part of the format string may be one or more flags. - while ( ('-' == *msg) || ('+' == *msg) || (' ' == *msg) || - ('#' == *msg) || ('0' == *msg) ) { - format += *msg++; - } - - // Next comes the width. If this is an asterix it is necessary to - // substitute in an actual argument. - if ('*' == *msg) { - int width = (args_index < 8) ? (int) entry.data[args_index++] : 0; - sprintf(util_buf, "%d", width); - format += util_buf; - msg++; - } else { - // Otherwise the width should be one or more digits - while( isdigit(*msg) ) { - format += *msg++; - } - } - - // Look for a precision, again coping with an asterix. - if ('.' == *msg) { - format += *msg++; - if ('*' == *msg) { - int precision = (args_index < 8) ? (int) entry.data[args_index++] : 0; - sprintf(util_buf, "%d", precision); - format += util_buf; - msg++; - } else { - // The precision should be one or more digits, with an optional - - if ('-' == *msg) { - format += *msg++; - } - while (isdigit(*msg)) { - format += *msg++; - } - } - } - - // Now look for h,l and L. These have to be remembered. - bool short_version = false; - bool long_version = false; - if ('h' == *msg) { - format += *msg++; - short_version = true; - } else if (('l' == *msg) || ('L' == *msg)) { - format += *msg++; - long_version = true; - } - - // The end of the format string has been reached. - int format_ch = *msg; - format += *msg; - - // If we have already formatted too many arguments, there is no point - // in trying to do the actual formatting. - if ( 8 <= args_index ) { - continue; - } - CYG_ADDRWORD val = entry.data[args_index++]; - - switch( format_ch ) { - case '%' : - result += '%'; - break; - - case 'd' : - case 'i' : - case 'o' : - case 'u' : - case 'x' : - case 'X' : - // "format" contains the appropriate format string. - // Invoke sprintf() using util_buf, doing the - // appropriate cast, and then append the output - // of util_buf. - // - // This is not totally robust. If a ridiculous - // precision has been specified then util_buf may - // overflow. - if (long_version) { - sprintf(util_buf, format.c_str(), (long) val); - } else { - // The implicit cast rules mean that shorts do not - // require any special attention. - sprintf(util_buf, format.c_str(), (int) val); - } - result += util_buf; - break; - - case 'c' : - sprintf(util_buf, format.c_str(), (int) val); - result += util_buf; - break; - - case 'p' : - sprintf(util_buf, format.c_str(), (void *) val); - result += util_buf; - break; - - case 's' : - { - std::string data = trim_string((char *) val); - sprintf(util_buf, format.c_str(), data.c_str()); - result += util_buf; - break; - } - - default : - // Any attempt to do floating point conversions would be - // rather tricky given the casts that have been applied. - // There is no point in doing anything for unrecognised - // sequences. - break; - } - } - return result; -} - -// ---------------------------------------------------------------------------- - - -static void -output_entry(void (*pOutputFn)(const char*), trace_entry& entry) -{ - std::string output = trim_file(entry.file) + " " + - trim_linenum(entry.line) + " " + - trim_function(entry.fn) + " "; - if (0 != entry.msg) { - - switch( entry.what) { - case cyg_trace_trace : output += " '"; break; - case cyg_trace_enter : output += "{{"; break; - case cyg_trace_args : output += "(("; break; - case cyg_trace_return : output += "}}"; break; - default : output += " ?"; - } - output += parse_msg(entry.msg, entry); - switch( entry.what) { - case cyg_trace_trace : output += "' "; break; - case cyg_trace_enter : break; - case cyg_trace_args : output += "))"; break; - case cyg_trace_return : break; - default : output += "? "; - } - } - output += "\n"; - (*pOutputFn)(output.c_str()); -} - -static void -trace_callback( void (*pOutputFn)(const char*)) -{ - if ((trace_index < 0) || (trace_index >= CYGNUM_INFRA_TRACE_VECTOR_SIZE)) - return; - - // Start at the last entry and work back down to zero, skipping - // invalid ones. Then go to the top and work back to the current index. - int i; - for (i = trace_index - 1; i >= 0; i--) { - if (tracevec[i].valid) { - output_entry(pOutputFn, tracevec[i]); - } - } - for (i = (CYGNUM_INFRA_TRACE_VECTOR_SIZE - 1); i >= trace_index; i--) { - if (tracevec[i].valid) { - output_entry(pOutputFn, tracevec[i]); - } - } -} - -//}}} diff --git a/host/libcdl/ChangeLog b/host/libcdl/ChangeLog deleted file mode 100644 --- a/host/libcdl/ChangeLog +++ /dev/null @@ -1,992 +0,0 @@ -2004-06-23 John Dallaway - - * interp.cxx (locate_subdirs): Avoid use of a trailing period in - the file path. This causes problems for Cygwin 1.5.10. - [ Bugzilla 1000095 ] - -2003-08-19 Bart Veer - - * config.cxx (savefile_package_command): - If no version is specified, silently default to the most recent. - That can avoid problems with templates specifying particular versions - and then providing an update epk. - -2003-05-01 Jonathan Larmour - - * doc/package.sgml: Use PNGs instead of GIFs. - * doc/jadetex.cfg: Add this to configure PDF output nicely with index - and coloured links. - -2003-03-26 Bart Veer - - * cdl.hxx, config.cxx.cxx, package.cxx: - Update derived classes now that the repository is per-loadable - rather than per-toplevel. Also turn ECOS_REPOSITORY into a - path rather than a single directory, updating all affected - database and config code. - - * base.cxx, build.cxx, cdlcore.hxx: make the repository a - characteristic of each loadable rather than of the toplevel - -2003-02-12 Bart Veer - - * Makefile.in, configure, testsuite/Makefile.in: - Regenerate after acinclude.m4 update - -2003-02-11 Bart Veer - - * build.cxx (compare_and_copy): - Work around problem with cygwin tclsh84 - "file rename" may - spuriously report failure. - -2003-02-03 John Dallaway - - * cdl.dsp: Call tclsh rather than cygtclsh80 in custom build rule. - -2002-12-22 Nick Garnett - - * doc/.cvsignore: Added this file to ignore generated HTML files. - -2002-09-21 Bart Veer - - * cdlcore.hxx, cdl.hxx, build.cxx, component.cxx, config.cxx, - database.cxx, dialog.cxx, interface.cxx, interp.cxx, - option.cxx, package.cxx, parse.cxx, property.cxx, - value.cxx, wizards.cxx - Avoid const compatibility problems with Tcl 8.4 - -2002-08-03 Bart Veer - - * acinclude.m4, configure.in, Makefile.am, testsuite/Makefile.am, - testsuite/config/default.exp: - Rework host-side autoconf support - -2002-03-04 Gary Thomas - - * build.cxx (update_header_file_info): - Suppress include files which and in "~" - these are backup - files and are transient. Keeping them can break a build - tree if the backup files are removed. - -2002-02-18 Bart Veer - - * transact.cxx (user_confirmation_required): - Making a valuable with a user_value inactive requires - user confirmation, it should not be done automatically - by the inference engine. - -2001-12-07 Bart Veer - - * doc/language.sgml, doc/*.html: - Add a footnote clarifying a particular Tcl expression - (bug 57097). Regenerate html. - - * doc/fixhtml.tcl - Removed, the master copy now lives in pkgconf - -2001-12-06 Bart Veer - - * cdlcore.hxx, build.cxx, interp.cxx: - Move #include of to common header rather than to - individual source files, avoiding build problems with - newer compilers. Reported by Jeff Law. - - * infer.cxx (inner_resolve): - CdlTransaction::is_preferable_to() is not symmetric. Rearrange - some expressions so that disabling options or making them - inactive is subtly discouraged rather than encouraged. - -2001-07-20 Bart Veer - - * value.cxx (save): - Complicated "requires" expressions spread over multiple lines - were not being turned into multiline comments, leading to - illegal savefiles. - -2001-07-11 Bart Veer - - * transact.cxx (is_preferable_to): - Consider active changes as well as value changes. - -2001-07-10 Bart Veer - - * transact.cxx (is_preferable_to): - Fine-tune the determination of which of two transactions has less - impact on the system. - - * infer.cxx (infer_handle_interface_value): - Add inference engine support for constraints of the form - (xxx == 0) and (xxx = 1), where xxx is an interface. - -2001-07-08 Jonathan Larmour - - * interp.cxx: include as isspace() is used. - -2001-06-21 Bart Veer - - - * base.cxx, cdlcore.hxx, property.cxx, parse.cxx, value.cxx, refer.cxx: - Allow an empty string to be used for parent properties, implying - reparenting below the root - - * expr.cxx, cdlcore.hxx, infer.cxx: - Add support for new operators implies, xor and eqv - - * func.cxx: - Add new function is_xsubstr(), is_loaded(), is_active(), - is_enabled(), get_data() and version_cmp() - - * doc/main.sgml: - Add 2001 to copyright year. - - * doc/language.sgml, doc/reference.sgml: - Document the above changes - - * doc/*.html: - Regenerate following above changes, and using newer stylesheets - etc. - -2001-06-20 Bart Veer - - * database.cxx, cdl.hxx: - - Add a verbosity flag to control whether or not certain warnings - are issued. The main warnings of interest are inconsistencies - between the database and the repository, e.g. packages listed - but not actually installed, as can happen in anoncvs checkouts. - -2001-05-16 Bart Veer - - * Makefile.am: use new compiler flag support - - * configure, Makefile.in, testsuite/Makefile.in: regenerate - -2001-05-14 Bart Veer - - * func.cxx (get_args_count): Avoid compiler warning. - * func.cxx (is_substr_find): fix VC++ build problem (patch - provided by Julian) - -2001-04-27 Bart Veer - - * doc/language.sgml: - Added documentation on functions - - * func.cxx, Makefile.am, Makefile.in: - New module for function support inside expressions - - * expr.cxx - Add support for functions and the string concatenation operator. - - * infer.cxx - Clean-up, add support for functions, and implement more inference - functionalitity generally. - -2001-04-19 Bart Veer - - * doc/*.sgml, *.html: - Update as per current corporate doc conventions. - -2001-02-27 Jonathan Larmour - - * interp.cxx (locate_subdirs): Accept "cvs" as a synonym for "CVS" - * database.cxx (new_package): Ditto. - -2000-08-18 Bart Veer - - * configure.in: - Allow cross-compilation. - - * configure, Makefile.in, testsuite/Makefile.in: - Regenerate. - - * base.cxx, build.cxx, cdl.hxx, cdlcore.hxx, component.cxx, - config.cxx, database.cxx, dialog.cxx, expr.cxx, interface.cxx, - interp.cxx, option.cxx, package.cxx, parse.cxx, value.cxx, - wizard.cxx - Remove C++ exception specifications, because they cause problems - with some versions of the tools. - -2000-07-06 Bart Veer - - * conflict.cxx (get_explanation): - Put quotes around "requires" in the conflict explanation. - Requested by the eCos team. - -2000-07-04 Bart Veer - - * value.cxx (save): - The comment "# This value cannot be modified here." was being - added even for modifiable options, courtesy of some earlier - code rearrangement. - - * config.cxx (change_package_version): - Prevent assertion failure/crash when changing the version of a - package that has not been loaded (not uncommon when using - ecosconfig and confusing the order of the version and the - package(s)). - -2000-06-28 Bart Veer - - * transact.cxx, cdlcore.hxx: - Add details of the current transaction to the transaction callback - class. Previously there was no way of getting hold of the current - transaction and hence the toplevel from inside the callback - without using statics. - - * value.cxx (set_flavor): - Temporarily undo some of the previous value clean-ups, they were - causing problems at the application level. The API needs to be - changed to eliminate confusion between value and the data part - of a bool/value pair. - -2000-06-22 Bart Veer - - * value.cxx, interface.cxx: - Allow the flavor property to be used on interfaces. booldata - interfaces allow the use of #ifdef to determine whether or not - a feature is available. Clean up some of the value stuff to match, - especially when it comes to savefiles. - - * build.cxx, cdlmisc.cxx, cdlcore.hxx: - Add version #define support. - -2000-06-15 John Dallaway - - * cdl.dsp: - Build libCDL to v:\cdl rather than v:\ide. Build debug versions - against tcl82d.lib rather than tcl82.lib. - -2000-06-02 Bart Veer - - * config.cxx (load_package): - Diagnostic function pointers were not being installed at the - package level, so error messages due to invalid CDL were - disappearing. - -2000-05-11 Bart Veer - - * value.cxx (implements_update_handler): - Cope gracefully with implements properties where the destination - is not an interface. - - * transact.cxx (clear_structural_conflicts): - Prevent a structural conflict from being destroyed twice (only - likely to happen during a major delete operation). - -2000-04-14 Bart Veer - - * infer.cxx (infer_set_valuable_value): - Extend the == operator inference support to cope with bool and - booldata options. - -2000-04-11 Bart Veer - - * infer.cxx (infer_make_active): - Fix infinite recursion. Naughty inference engine. - - * interp.cxx (eval): - Diagnostics enhancement tweak. - - * build.cxx (generate_config_header): - Add a context when generating header files. - - * base.cxx (CdlLoadableBody): - Add a context to the CdlInterpreter on creation, for better - diagnostics. - Do not raise errors in the internal Tcl scripts, since those - may now get reported. - - * database.cxx (new_package): - A single spurious subdirectory in a package should not invalidate - the entire package. - -2000-04-10 Bart Veer - - * base.cxx, build.cxx, cdl.hxx, cdlcore.hxx, cdlmisc.cxx, - component.cxx, config.cxx, database.cxx, dialog.cxx, expr.cxx, - interface.cxx, interp.cxx, option.cxx, package.cxx, parse.cxx, - property.cxx, value.cxx, wizard.cxx - Improved diagnostics support. - - * build.cxx, property.cxx, parse.cxx: - Allow for string vector properties with no elements. Use this - for the include_files property. - -2000-03-13 John Dallaway - - * cdl.dsp: - Modify libCDL custom build step to calculate the short form - of the host tools root directory to allow rebuilding using an - eCos installation in its default location (containing spaces). - - Use the presence of the last file generated by the - configure phase (the ecosconfig makefile) to determine whether - to invoke configure. This provides some further robustness - against failed or interrupted builds. - -2000-03-08 Simon FitzMaurice - * cdl.dsp : Modify libCDL custom build step to add --enable-maintainer-mode - -2000-03-08 John Dallaway - - * cdl.dsp: - Modify libCDL custom build step to configure in the host tools - directory rather than the root of the eCos repository. - -2000-03-08 Simon FitzMaurice - * cdl.dsp : Modify libCDL custom build step to avoid running configure every time. - -2000-03-07 John Dallaway - - * cdl.dsp: - Modify libCDL custom build step to accommodate the migration - if libCDL sources. - -2000-03-01 Bart Veer - - * expr.cxx (eval_internal): - If there is an eval exception, only manipulate conflicts if we are - in a transaction. - - * value.cxx: - Make the code more robust against eval exceptions - -2000-02-15 Bart Veer - - * build.cxx (generate_config_header): - Fix the symbol that gets used for define properties. - - * package.cxx (get_config_header): - Completely suppress the generation of until - further notice. Allow active_if properties in packages. - Comment a need for default_value properties. - -2000-02-11 John Dallaway - - * cdl.dsp - Configure and make 'quietly' for release builds to help contain - the length of the release logs. - - * cdl.mak: - Remove this obsolete file. - -2000-02-10 Bart Veer - - * package.cxx (parse_package): - Allow packages to have active_if properties. - Add a comment that default_value in a package should be allowed as - a way of controlling enabled/disabled state. - -2000-02-03 Bart Veer - - * infer.cxx (infer_handle_reference_bool): - Earlier fix missed yet more sub-transactions that should have been - cancelled. - -2000-02-02 Bart Veer - - * infer.cxx (infer_make_inactive): - Earlier fix missed a sub-transaction that should have been - cancelled. - - * value.cxx (implements_update_handler): - Also recalculate an interface if the destination is created. - Otherwise an interface will have the wrong value if it is loaded - after all its implementors. - - * infer.cxx, transact.cxx: - Make sure that sub-transactions are either cancelled or committed - before they get deleted. - -2000-01-26 Bart Veer - - * config.cxx (save): - Always output the description field for a standard savefile. - - * base.cxx (save_conflicts): - Add missing newline - - * infer.cxx (infer_subexpr_bool): - Fix the handling of && and || - - * infer.cxx (infer_handle_reference_value): - Do not try modifying inactive data items, there is no point - and it could cause an assertion failure - -2000-01-25 Bart Veer - - * config.cxx: - Extend the savefile support to remember which packages - belong to the hardware and which ones belong to the - template. - -2000-01-24 Bart Veer - - * cdlcore.hxx, parse.cxx, wizard.cxx (parse_screen): - Change parse_property_options() to parse_options() so that it can - be used for more than just properties - - * cdlcore.hxx, config.cxx: - Make sure that a LocalTransaction always gets cancelled if - things go wrong and an exception is thrown, prior to the - transaction being deleted. - - * base.cxx, interp.cxx, value.cxx: - Savefile format tweaks. - -2000-01-21 Bart Veer - - * base.cxx (add_node_to_toplevel): - When a loadable was re-added to the toplevel after an unload was - cancelled, its parent was not set correctly. - - * infer.cxx: - Add partial support for dependencies of the form X==Y - -2000-01-20 Bart Veer - - * Makefile.am, Makefile.in: - Fix dependencies for interface.cxx and transact.cxx, these - were sometimes rebuilt unnecessarily - - * cdlcore.hxx, base.cxx, transact.cxx, config.cxx, package.cxx: - All file I/O related operations now happen in the context - of a transaction. - -1999-12-17 Bart Veer - - * cdl.hxx, config.cxx, database.cxx: - Add support for set_value commands in ecos.db target entries. - - * database.cxx: - Remove old support for template definitions in ecos.db - -1999-12-16 Bart Veer - - * nearly all files: - Add support for memory leak detection, by maintaining per-class - object counts via the appropriate constructors and destructors. - - * database.cxx: - Plug a one-off memory leak. - -1999-12-14 John Dallaway - - * interp.cxx: - Modify CdlInterpreterBody::locate_subdirs(), - CdlInterpreterBody::locate_files(), - CdlInterpreterBody::is_directory() and - CdlInterpreterBody::is_file() to accommodate - spaces in paths. - -1999-12-13 Bart Veer - - * cdlcore.hxx, interface.cxx, transact.cxx, value.cxx: - Calculate values for interfaces. - - * base.cxx, cdl.hxx, cdlcore.hxx, component.cxx, config.cxx, - database.cxx, dialog.cxx, interface.cxx, interp.cxx, option.cxx, - package.cxx, value.cxx, wizard.cxx: - Implementation of templates in the form of the partial savefiles. - -1999-12-10 John Dallaway - - * cdlcore.hxx: - Use '#pragma warning()' under VC++ only. - -1999-12-09 Bart Veer - - * cdlmisc.cxx (compare_versions): - V1.3.1 and V1.3B6 were not compared correctly. - -1999-12-03 Bart Veer - - * build.cxx (update_header_file_info): - If a package has no include subdirectory and no include_files - property, search the package directory tree for anything - resembling a header file and install that. - -1999-11-30 Bart Veer - - * base.cxx: - Made the multiple conflict solution code more robust when side - effects occur. - - * transact.cxx: - When a new conflict is committed and becomes global its solution - must be cleared, since no attempt is made to preserve the validity - of global solutions. - - * transact.cxx (resolve): - Try to make sure that the inference callback gets invoked whenever - appropriate. - - * base.cxx: - When resolving multiple global conflicts, fixing the first one may - have the side effect of fixing subsequent ones as well, resulting - in an assertion failure because the inference engine reported a - success with no changes being required. This situation is now - checked for. - - * parse.cxx (parse_property_options): - Allow for a NULL options descriptor - -1999-11-28 Bart Veer - - * transact.cxx: - Global conflict resolution support - - * infer.cxx: - Clean-up for resolving global conflicts - Cancel undesirable transactions before they are deleted - - * conflict.cxx: - Add support for resolving global conflicts - Implement get_transaction() member - - * cdlcore.hxx: - Add support for resolving global conflicts - Tidy up the transaction and transaction callback classes a bit. - - * base.cxx: - Add support for resolving global conflicts - -1999-11-26 John Dallaway - - * build.cxx: - Modify CdlToplevelBody::generate_config_headers() and - compare_and_copy() to accommodate spaces in the path to the - headers directory. - -1999-11-23 Bart Veer - - * database.cxx (new_target): - command_prefix is no longer compulsory for ecos.db target entries, - since this is now handled in the config data. command_prefix and - cflags are still allowed in ecos.db for now, but will be removed - in future. - -1999-11-22 Bart Veer - - * base.cxx: - During an unload operation a conflict may be cleared for multiple - reasons: the requires condition may now be satisfied, e.g - "requires !xxx" where "xxx" is also being unloaded; and the - node containing the requires property may be disappearing as well. - - * transact.cxx (save_solution): - If any parts of a solution involve calculated options then there - is no point in exposing this to the user. The re-calculation will - happen automatically during the next propagation. - - * base.cxx: - * config.cxx: - Stop the inference engine from running when packages are loaded or - unloaded. The user has no opportunity to cancel or undo the - operation, and there may be unexpected behaviour because the - inference engine has no clear view of what the overall - configuration is going to be. - - * transact.cxx (resolve): - Resolving one conflict may affect others in the new_conflicts - list. Using an iterator to examine all conflicts is a bad idea. - Instead each loop needs to search for a conflict that may - have a solution. - - * base.cxx: - * config.cxx: - * cdlcore.hxx: - Rearrange how a CdlConfiguration gets destroyed, to allow dynamic - casts to be used on the toplevel as packages are unloaded. - -1999-11-22 John Dallaway - - * config.cxx: - Modify CdlConfigurationBody::load_package() to accommodate - spaces in the path to the eCos repository. - -1999-11-21 Bart Veer - - * infer.cxx: - * transact.cxx: - * cdlcore.hxx: - First implementation of inference code - - * conflict.cxx: - Added missing is_structural() member - -1999-11-18 Bart Veer - - * value.cxx: - Created a CdlSimpleValue constructor for booleans, to match the - assignment operator. - - * expr.cxx : - Modify list expression evaluation code so that any terms which - evaluate to empty strings are discarded. - -1999-11-08 Bart Veer - - * database.cxx: - Switched to ECOS_REPOSITORY environment variable. - - * transact.cxx: - * cdlcore.hxx: - Separated out normal and structural conflicts in the transaction - callback class. - - * value.cxx: - * interp.cxx: - * cdlcore.hxx: - Added new member CdlInterpreterBody::extend_comment(), for better - support of multiline comments in savefiles. - -1999-11-03 Bart Veer - - * cdlcore.hxx, base.cxx, transact.cxx, value.cxx: - Newly loaded nodes were starting out as active, and were not being - turned inactive if the parent was disabled. By default nodes are - now inactive and there is explicit code in the transaction - propagate member function to check whether or not each node should - be active. - - * Most files - Install the new transaction model - -1999-11-03 John Dallaway - - * value.cxx: - Apply patch to correct the omission of a comment char from - continuation lines of calculated value comments in - configuration save files. - -1999-10-25 Simon FitzMaurice - * value.cxx: - Apply fix (supplied by Bart) to correct omission of comment symbol - from start of second and subsequent lines of split statement. - -1999-10-14 Bart Veer - - * database.cxx: - * cdl.hxx: - Add support for new per-target commands enable and disable, - which provide limited control over hardware-related configuration - options. - - * config.cxx (set_hardware): - Process per-target enable/disable commands from the database - -1999-10-12 John Dallaway - - * build.cxx (generate_config_headers): - - Workaround problem with assignment of standard channels - which was causing system.h to not be generated. - -1999-10-08 John Dallaway - - * cdl.dsp, cdl.mak: - - Link against Tcl 8.2.1. - -1999-10-07 Bart Veer - - * value.cxx (get_widget_hint): - For some expressions this was corrupting the expression data, - because of the use of a reference rather than a pointer. - -1999-10-06 Bart Veer - - * cdlcore.hxx, database.cxx, expr.cxx, interface.cxx, value.cxx - Partial implementations of interfaces and get_widget_hint() - -1999-09-28 Bart Veer - - * interp.cxx: - Fix use of an uninitialized variable. - - * config.cxx: - Fix the handling of package versions in save files. - -1999-09-15 Bart Veer - - * value.cxx - Fix output of multiline legal_values expressions - - * value.cxx - Fix variable that might be used uninitialized. - - * all files - First implementation of the savefile support - -1999-09-07 John Dallaway - - * cdl.dsp, cdl.mak: - - Add ANSI build configurations. - -1999-09-07 John Dallaway - - * cdl.dsp, cdl.mak: - - Update libCDL project file and VC++ makefile to use current - configure switches. - -1999-08-12 Bart Veer - - * configure.in: - * configure: - * stamp-h.in: - First attempt at autoconfiscating the configtool - -1999-08-10 Bart Veer - - * expr.cxx, value.cxx: - Fixed some problems related to double precision numbers. - -1999-08-03 Bart Veer - - * parse.cxx: - Added an implementation of the "unknown" command which - goes via the normal diagnostics routines. - -1999-07-22 Bart Veer - - * cdlcore.hxx, value.cxx, expr.cxx, cdlmisc.cxx: - Try to preserve some input data formatting information, such as - whether a number appeared as decimal or hexadecimal. - -1999-07-21 Bart Veer - - * value.cxx: - Added some assertions to make sure that entities with a - "calculated" property cannot be modified. - -1999-07-20 Bart Veer - - * value.cxx, transact.cxx: - Fixed some value propagation problems. - - * cdlcore.hxx, value.cxx, expr.cxx: - Detect invalid numbers in expressions. - A CdlListValue object now contains a single vector of - CdlSimpleValue objects, not separate vectors of strings, integers - and doubles. This allows ordering to be preserved. - - * most files: - Sync development version with repository, there is now - full value support. - -1999-07-13 Bart Veer - - * expr.cxx: - Implement operator precedence - Fix parsing of conditional expressions. - -1999-07-12 Bart Veer - - * most files: - Sync development version with repository, there is now partial - expression support. - -1999-07-05 Bart Veer - - * all files: - Merge development work from the libcdl branch. - - -1999-06-10 John Dallaway - - * cdl.dsp: - Convert to a Visual C++ utility project. - -1999-06-08 John Dallaway - - * cdl.dsp: - Project file outputs libCDL to the project-specified output - directory rather than the intermediate directory - -1999-06-07 John Dallaway - - * cdl.dsp: - Project file is no-longer dependent on the ECOSHOME environment - variable - -1999-06-07 John Dallaway - - * cdl.dsp: - New Visual C++ 6.0 project file for libCDL - -1999-06-03 Bart Veer - - * configure: - Regenerated again after further updates to toplevel acinclude.m4 - -1999-06-02 Bart Veer - - * configure: - Regenerated after updating toplevel acinclude.m4, new - --enable-debuginfo option. - - * libcdl.hxx: - CdlBaseBody is now an ordinary base class for CdlContainerBody, - not a virtual base class, allowing old-style casts inside the - config tool to work. There is no need for virtual inheritance just - yet. - The CdlGoalExpressionBody copy constructor is now public, not - protected, for use by the config tool. - -1999-05-24 Bart Veer - - * package.cxx: - * component.cxx: - * option.cxx: - * base.cxx: - * libcdl.hxx: - Allow target and platform properties inside components and - options, and startup properties inside packages and components, - for continued compatibility with libnotcdl. - -1999-03-10 Bart Veer - - * option.cxx (parse_option): - * component.cxx (parse_component): - Fixed the handling of container inheritance for full libnotcdl - compatibility. - -1999-03-09 Bart Veer - - * parse.cxx (parse_...expression_property): - Do not try to parse options just yet, there is confusion if - the expression begins with a negative number. - -1999-03-08 Bart Veer - - * interp.cxx (eval): - Make sure that C strings passed to the Tcl interpreter - are properly terminated. - - * property.cxx: - Remove strict checking of property id's, so that the library - code can be re-used for other purposes e.g. hardware CDL. - - * expr.cxx: - Added temporary parsers for libnotcdl compatibility. - - * cdlmisc.cxx: - Added routines to convert between strings and flavors. - Added routines to validate CDL names. - Minor layout tweaks. - - * README: - Examples now refer to Tcl8.1b1 instead of 8.1a2, the alpha - version caused problems. - - -1999-02-02 Bart Veer - - * testsuite/libcdl/cdl1.cxx (test_double_to_string): - * cdlmisc.cxx (string_to_double): - Added double conversion support, needed for the CdlResult class - - * testsuite/libcdl/cdl5.cxx (main): - * database.cxx: - Change CdlInputOutputError to CdlInputOutputException in the - interests of a more consistent naming convention. - -1999-01-29 Bart Veer - - * interp.cxx (eval): - Add new member function to evaluate Tcl code embedded in - CDL data. - - * cdlmisc.cxx (is_valid_property_id): - Added the properties IncludeDir and ExportTo, and the flavor "dummy" - - -1999-01-26 Bart Veer - - * testsuite/libcdl/cdl4.cxx: - * testsuite/libcdl/cdl1.cxx (test_string_to_integer): - Change array initializers to avoid having to supply a constructor. - - * aclocal.m4: - * config.h.in: - * configure: - * stamp-h.in: - * testsuite/Makefile.in: - Updated to use autoconf 2.13 and automake 1.4, plus to reflect - tweaks to toplevel acinclude.m4 and local configure.in - - * configure.in: - No longer insist on the infra having been built already. This - allows a configure from the top-level to work. - - * testsuite/libcdl/cdl4.cxx: - Changed the initializer for a static array of structures to work - around compiler problems. - - * testsuite/libcdl/cdl3.cxx (main): - Changed the way inline Tcl scripts are defined to avoid compiler - problems. - - * testsuite/libcdl/cdl2.cxx (main): - Added missing return statement to avoid compiler warning. - - * testsuite/config/default.exp: - Use new variable cyg_ac_tcl_libs - - * interp.cxx (eval): - Do not distinguish between TCL_OK and TCL_RETURN return codes, - clients are unlikely to be interested. - Fix definition of set_assoc_data(). - - * cdlmisc.cxx (compare_versions): - Fix syntax problem in while loop. - -1999-01-22 Bart Veer - - * interp.cxx - (set_assoc_data): added new functions so that clients can - associate arbitrary data with interpreters - (set_variable) : and to provide access to Tcl global variables. - (make_safe) : also, the ability to make an interpreter safe. - (set_result) : not to mention, controlling the result field. - - * cdlmisc.cxx (compare_versions): - Added new function Cdl::compare_versions() - -1999-01-21 Bart Veer - - * cdlmisc.cxx - Added routines get_library_version(), set_interactive() and - get_interactive(). - -//=========================================================================== -//####COPYRIGHTBEGIN#### -// -// ---------------------------------------------------------------------------- -// Copyright (C) 1999, 2000, 2001 Red Hat, Inc. -// Copyright (C) 2004 eCosCentric Limited -// -// This file is part of the eCos host tools. -// -// This program is free software; you can redistribute it and/or modify it -// under the terms of the GNU General Public License as published by the Free -// Software Foundation; either version 2 of the License, or (at your option) -// any later version. -// -// This program is distributed in the hope that it will be useful, but WITHOUT -// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for -// more details. -// -// You should have received a copy of the GNU General Public License along with -// this program; if not, write to the Free Software Foundation, Inc., -// 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -// -// ---------------------------------------------------------------------------- -// -//####COPYRIGHTEND#### -//=========================================================================== diff --git a/host/libcdl/Makefile.am b/host/libcdl/Makefile.am deleted file mode 100644 --- a/host/libcdl/Makefile.am +++ /dev/null @@ -1,167 +0,0 @@ -## Process this file with automake to produce Makefile.in -## ===================================================================== -## -## Makefile.am -## -## libcdl.a -## -## ===================================================================== -#######ECOSHOSTGPLCOPYRIGHTBEGIN#### -## ---------------------------------------------------------------------------- -# Copyright (C) 2002 Bart Veer -# Copyright (C) 1998, 1999, 2000, 2001 Red Hat, Inc. -# -# This file is part of the eCos host tools. -# -# This program is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License as published by the Free -# Software Foundation; either version 2 of the License, or (at your option) -# any later version. -# -# This program is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for -# more details. -# -# You should have received a copy of the GNU General Public License along with -# this program; if not, write to the Free Software Foundation, Inc., -# 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -# -## ---------------------------------------------------------------------------- -#######ECOSHOSTGPLCOPYRIGHTEND#### -## ===================================================================== -#######DESCRIPTIONBEGIN#### -## -## Author(s): bartv -## Contact(s): bartv -## Date: 1998/12/16 -## Version: 0.01 -## -######DESCRIPTIONEND#### -## ===================================================================== - -AUTOMAKE_OPTIONS = 1.3 foreign -SUBDIRS = testsuite - -## Pick up compiler flags etc. from configury -INCLUDES = @ecos_INCLUDES@ -LIBS = @ecos_LIBS@ @ecos_LDADD@ -AM_CFLAGS = @ecos_CFLAGS@ -AM_CXXFLAGS = @ecos_CXXFLAGS@ -ecos_infra_incdir = @ecos_infra_incdir@ - -## This package exports its interface via cdl.hxx -include_HEADERS = cdlcore.hxx cdl.hxx - -## The main target is a static library. The problem is naming it -## correctly. automake seems to insist on calling it libcdl.a, -## even when compiling it with VC++. Various attempts to use -## cdl.lib instead with VC++ have failed. Instead the library -## will always be built as libcdl.a, but gets copied to cdl.lib -## when necessary. - -sources := interp.cxx \ - expr.cxx \ - func.cxx \ - refer.cxx \ - cdlmisc.cxx \ - conflict.cxx \ - property.cxx \ - parse.cxx \ - base.cxx \ - value.cxx \ - build.cxx \ - dialog.cxx \ - wizard.cxx \ - interface.cxx \ - transact.cxx \ - infer.cxx \ - database.cxx \ - config.cxx \ - package.cxx \ - component.cxx \ - option.cxx - -noinst_LIBRARIES = libcdl.a -libcdl_a_SOURCES = $(sources) - -if MSVC -all-local: cdl.lib - -cdl.lib: libcdl.a - $(INSTALL) $< $@ - -clean-local: - $(RM) cdl.lib - -install-exec-local: all-local - $(mkinstalldirs) $(DESTDIR)$(libdir) - $(INSTALL) cdl.lib $(DESTDIR)$(libdir)/cdl.lib - -else - -all-local: -clean-local: -install-exec-local: libcdl.a - $(mkinstalldirs) $(DESTDIR)$(libdir) - $(INSTALL) libcdl.a $(DESTDIR)$(libdir)/libcdl.a -endif - - -## Add specific dependencies for all source files. -## Every module in libcdl uses assertions and tracing. -## These pull in the others. -infra_headers := $(ecos_infra_incdir)/cyg/infra/cyg_ass.h \ - $(ecos_infra_incdir)/cyg/infra/cyg_trac.h \ - $(ecos_infra_incdir)/pkgconf/infra.h \ - $(ecos_infra_incdir)/pkgconf/hostinfra.h \ - $(ecos_infra_incdir)/cyg/infra/cyg_type.h - -## Depending on the flavor of CDL being implemented, different -## headers will get included. -cdlcore_headers := cdlconfig.h cdlcore.hxx -cdl_headers := $(cdlcore_headers) cdl.hxx - -interp.$(OBJEXT) : Makefile $(cdlcore_headers) $(infra_headers) - -expr.$(OBJEXT) : Makefile $(cdlcore_headers) $(infra_headers) - -infer.$(OBJEXT) : Makefile $(cdlcore_headers) $(infra_headers) - -func.$(OBJEXT) : Makefile $(cdlcore_headers) $(infra_headers) - -refer.$(OBJEXT) : Makefile $(cdlcore_headers) $(infra_headers) - -cdlmisc.$(OBJEXT) : Makefile $(cdlcore_headers) $(infra_headers) - -conflict.$(OBJEXT) : Makefile $(cdlcore_headers) $(infra_headers) - -property.$(OBJEXT) : Makefile $(cdlcore_headers) $(infra_headers) - -parse.$(OBJEXT) : Makefile $(cdlcore_headers) $(infra_headers) - -base.$(OBJEXT) : Makefile $(cdlcore_headers) $(infra_headers) - -value.$(OBJEXT) : Makefile $(cdlcore_headers) $(infra_headers) - -build.$(OBJEXT) : Makefile $(cdlcore_headers) $(infra_headers) - -dialog.$(OBJEXT) : Makefile $(cdlcore_headers) $(infra_headers) - -wizard.$(OBJEXT) : Makefile $(cdlcore_headers) $(infra_headers) - -interface.$(OBJEXT) : Makefile $(cdlcore_headers) $(infra_headers) - -transact.$(OBJEXT) : Makefile $(cdlcore_headers) $(infra_headers) - -database.$(OBJEXT) : Makefile $(cdl_headers) $(infra_headers) - -config.$(OBJEXT) : Makefile $(cdl_headers) $(infra_headers) - -package.$(OBJEXT) : Makefile $(cdl_headers) $(infra_headers) - -component.$(OBJEXT) : Makefile $(cdl_headers) $(infra_headers) - -option.$(OBJEXT) : Makefile $(cdl_headers) $(infra_headers) - - diff --git a/host/libcdl/Makefile.in b/host/libcdl/Makefile.in deleted file mode 100644 --- a/host/libcdl/Makefile.in +++ /dev/null @@ -1,655 +0,0 @@ -# Makefile.in generated automatically by automake 1.4-p5 from Makefile.am - -# Copyright (C) 1994, 1995-8, 1999, 2001 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. - -#######ECOSHOSTGPLCOPYRIGHTBEGIN#### -# Copyright (C) 2002 Bart Veer -# Copyright (C) 1998, 1999, 2000, 2001 Red Hat, Inc. -# -# This file is part of the eCos host tools. -# -# This program is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License as published by the Free -# Software Foundation; either version 2 of the License, or (at your option) -# any later version. -# -# This program is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for -# more details. -# -# You should have received a copy of the GNU General Public License along with -# this program; if not, write to the Free Software Foundation, Inc., -# 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -# -#######ECOSHOSTGPLCOPYRIGHTEND#### -#######DESCRIPTIONBEGIN#### -######DESCRIPTIONEND#### - - -SHELL = @SHELL@ - -srcdir = @srcdir@ -top_srcdir = @top_srcdir@ -VPATH = @srcdir@ -prefix = @prefix@ -exec_prefix = @exec_prefix@ - -bindir = @bindir@ -sbindir = @sbindir@ -libexecdir = @libexecdir@ -datadir = @datadir@ -sysconfdir = @sysconfdir@ -sharedstatedir = @sharedstatedir@ -localstatedir = @localstatedir@ -libdir = @libdir@ -infodir = @infodir@ -mandir = @mandir@ -includedir = @includedir@ -oldincludedir = /usr/include - -DESTDIR = - -pkgdatadir = $(datadir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ - -top_builddir = . - -ACLOCAL = @ACLOCAL@ -AUTOCONF = @AUTOCONF@ -AUTOMAKE = @AUTOMAKE@ -AUTOHEADER = @AUTOHEADER@ - -INSTALL = @INSTALL@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS) -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -transform = @program_transform_name@ - -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -host_alias = @host_alias@ -host_triplet = @host@ -CC = @CC@ -CXX = @CXX@ -ECOS_REPOSITORY = @ECOS_REPOSITORY@ -EXEEXT = @EXEEXT@ -MAINT = @MAINT@ -MAKEINFO = @MAKEINFO@ -MSVC_SRCDIR = @MSVC_SRCDIR@ -OBJEXT = @OBJEXT@ -PACKAGE = @PACKAGE@ -PACKAGE_DIR = @PACKAGE_DIR@ -PACKAGE_INSTALL = @PACKAGE_INSTALL@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -RANLIB = @RANLIB@ -VERSION = @VERSION@ -ecos_CFLAGS = @ecos_CFLAGS@ -ecos_CXXFLAGS = @ecos_CXXFLAGS@ -ecos_INCLUDES = @ecos_INCLUDES@ -ecos_LDADD = @ecos_LDADD@ -ecos_LIBS = @ecos_LIBS@ -ecos_infra_libdir = @ecos_infra_libdir@ -ecos_libcdl_incdir = @ecos_libcdl_incdir@ -ecos_libcdl_libdir = @ecos_libcdl_libdir@ -ecos_tk_includes = @ecos_tk_includes@ -ecos_tk_libs = @ecos_tk_libs@ - -AUTOMAKE_OPTIONS = 1.3 foreign -SUBDIRS = testsuite - -INCLUDES = @ecos_INCLUDES@ -LIBS = @ecos_LIBS@ @ecos_LDADD@ -AM_CFLAGS = @ecos_CFLAGS@ -AM_CXXFLAGS = @ecos_CXXFLAGS@ -ecos_infra_incdir = @ecos_infra_incdir@ - -include_HEADERS = cdlcore.hxx cdl.hxx - -sources := interp.cxx \ - expr.cxx \ - func.cxx \ - refer.cxx \ - cdlmisc.cxx \ - conflict.cxx \ - property.cxx \ - parse.cxx \ - base.cxx \ - value.cxx \ - build.cxx \ - dialog.cxx \ - wizard.cxx \ - interface.cxx \ - transact.cxx \ - infer.cxx \ - database.cxx \ - config.cxx \ - package.cxx \ - component.cxx \ - option.cxx - - -noinst_LIBRARIES = libcdl.a -libcdl_a_SOURCES = $(sources) - -infra_headers := $(ecos_infra_incdir)/cyg/infra/cyg_ass.h \ - $(ecos_infra_incdir)/cyg/infra/cyg_trac.h \ - $(ecos_infra_incdir)/pkgconf/infra.h \ - $(ecos_infra_incdir)/pkgconf/hostinfra.h \ - $(ecos_infra_incdir)/cyg/infra/cyg_type.h - - -cdlcore_headers := cdlconfig.h cdlcore.hxx -cdl_headers := $(cdlcore_headers) cdl.hxx -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -mkinstalldirs = $(SHELL) $(top_srcdir)/../../acsupport/mkinstalldirs -CONFIG_HEADER = cdlconfig.h -CONFIG_CLEAN_FILES = -LIBRARIES = $(noinst_LIBRARIES) - - -DEFS = @DEFS@ -I. -I$(srcdir) -I. -CPPFLAGS = @CPPFLAGS@ -LDFLAGS = @LDFLAGS@ -libcdl_a_LIBADD = -libcdl_a_OBJECTS = interp.$(OBJEXT) expr.$(OBJEXT) func.$(OBJEXT) \ -refer.$(OBJEXT) cdlmisc.$(OBJEXT) conflict.$(OBJEXT) property.$(OBJEXT) \ -parse.$(OBJEXT) base.$(OBJEXT) value.$(OBJEXT) build.$(OBJEXT) \ -dialog.$(OBJEXT) wizard.$(OBJEXT) interface.$(OBJEXT) \ -transact.$(OBJEXT) infer.$(OBJEXT) database.$(OBJEXT) config.$(OBJEXT) \ -package.$(OBJEXT) component.$(OBJEXT) option.$(OBJEXT) -AR = ar -CXXFLAGS = @CXXFLAGS@ -CXXCOMPILE = $(CXX) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -CXXLD = $(CXX) -CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(LDFLAGS) -o $@ -HEADERS = $(include_HEADERS) - -DIST_COMMON = ./stamp-h.in ChangeLog Makefile.am Makefile.in TODO \ -acconfig.h acinclude.m4 aclocal.m4 config.h.in configure configure.in - - -DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) - -TAR = gtar -GZIP_ENV = --best -DEP_FILES = .deps/base.P .deps/build.P .deps/cdlmisc.P \ -.deps/component.P .deps/config.P .deps/conflict.P .deps/database.P \ -.deps/dialog.P .deps/expr.P .deps/func.P .deps/infer.P \ -.deps/interface.P .deps/interp.P .deps/option.P .deps/package.P \ -.deps/parse.P .deps/property.P .deps/refer.P .deps/transact.P \ -.deps/value.P .deps/wizard.P -SOURCES = $(libcdl_a_SOURCES) -OBJECTS = $(libcdl_a_OBJECTS) - -all: all-redirect -.SUFFIXES: -.SUFFIXES: .S .c .cxx .o .obj .s -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) - cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile - -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES) - cd $(top_builddir) \ - && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status - -$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ configure.in acinclude.m4 - cd $(srcdir) && $(ACLOCAL) - -config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - $(SHELL) ./config.status --recheck -$(srcdir)/configure: @MAINTAINER_MODE_TRUE@$(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES) - cd $(srcdir) && $(AUTOCONF) - -cdlconfig.h: stamp-h - @if test ! -f $@; then \ - rm -f stamp-h; \ - $(MAKE) stamp-h; \ - else :; fi -stamp-h: $(srcdir)/config.h.in $(top_builddir)/config.status - cd $(top_builddir) \ - && CONFIG_FILES= CONFIG_HEADERS=cdlconfig.h:config.h.in \ - $(SHELL) ./config.status - @echo timestamp > stamp-h 2> /dev/null -$(srcdir)/config.h.in: @MAINTAINER_MODE_TRUE@$(srcdir)/stamp-h.in - @if test ! -f $@; then \ - rm -f $(srcdir)/stamp-h.in; \ - $(MAKE) $(srcdir)/stamp-h.in; \ - else :; fi -$(srcdir)/stamp-h.in: $(top_srcdir)/configure.in $(ACLOCAL_M4) acconfig.h - cd $(top_srcdir) && $(AUTOHEADER) - @echo timestamp > $(srcdir)/stamp-h.in 2> /dev/null - -mostlyclean-hdr: - -clean-hdr: - -distclean-hdr: - -rm -f cdlconfig.h - -maintainer-clean-hdr: - -mostlyclean-noinstLIBRARIES: - -clean-noinstLIBRARIES: - -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) - -distclean-noinstLIBRARIES: - -maintainer-clean-noinstLIBRARIES: - -# FIXME: We should only use cygpath when building on Windows, -# and only if it is available. -.c.obj: - $(COMPILE) -c `cygpath -w $<` - -.s.o: - $(COMPILE) -c $< - -.S.o: - $(COMPILE) -c $< - -mostlyclean-compile: - -rm -f *.o core *.core - -rm -f *.$(OBJEXT) - -clean-compile: - -distclean-compile: - -rm -f *.tab.c - -maintainer-clean-compile: - -libcdl.a: $(libcdl_a_OBJECTS) $(libcdl_a_DEPENDENCIES) - -rm -f libcdl.a - $(AR) cru libcdl.a $(libcdl_a_OBJECTS) $(libcdl_a_LIBADD) - $(RANLIB) libcdl.a -.cxx.o: - $(CXXCOMPILE) -c $< -.cxx.obj: - $(CXXCOMPILE) -c `cygpath -w $<` - -install-includeHEADERS: $(include_HEADERS) - @$(NORMAL_INSTALL) - $(mkinstalldirs) $(DESTDIR)$(includedir) - @list='$(include_HEADERS)'; for p in $$list; do \ - if test -f "$$p"; then d= ; else d="$(srcdir)/"; fi; \ - echo " $(INSTALL_DATA) $$d$$p $(DESTDIR)$(includedir)/$$p"; \ - $(INSTALL_DATA) $$d$$p $(DESTDIR)$(includedir)/$$p; \ - done - -uninstall-includeHEADERS: - @$(NORMAL_UNINSTALL) - list='$(include_HEADERS)'; for p in $$list; do \ - rm -f $(DESTDIR)$(includedir)/$$p; \ - done - -# This directory's subdirectories are mostly independent; you can cd -# into them and run `make' without going through this Makefile. -# To change the values of `make' variables: instead of editing Makefiles, -# (1) if the variable is set in `config.status', edit `config.status' -# (which will cause the Makefiles to be regenerated when you run `make'); -# (2) otherwise, pass the desired values on the `make' command line. - -@SET_MAKE@ - -all-recursive install-data-recursive install-exec-recursive \ -installdirs-recursive install-recursive uninstall-recursive \ -check-recursive installcheck-recursive info-recursive dvi-recursive: - @set fnord $(MAKEFLAGS); amf=$$2; \ - dot_seen=no; \ - target=`echo $@ | sed s/-recursive//`; \ - list='$(SUBDIRS)'; for subdir in $$list; do \ - echo "Making $$target in $$subdir"; \ - if test "$$subdir" = "."; then \ - dot_seen=yes; \ - local_target="$$target-am"; \ - else \ - local_target="$$target"; \ - fi; \ - (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ - || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ - done; \ - if test "$$dot_seen" = "no"; then \ - $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ - fi; test -z "$$fail" - -mostlyclean-recursive clean-recursive distclean-recursive \ -maintainer-clean-recursive: - @set fnord $(MAKEFLAGS); amf=$$2; \ - dot_seen=no; \ - rev=''; list='$(SUBDIRS)'; for subdir in $$list; do \ - rev="$$subdir $$rev"; \ - test "$$subdir" != "." || dot_seen=yes; \ - done; \ - test "$$dot_seen" = "no" && rev=". $$rev"; \ - target=`echo $@ | sed s/-recursive//`; \ - for subdir in $$rev; do \ - echo "Making $$target in $$subdir"; \ - if test "$$subdir" = "."; then \ - local_target="$$target-am"; \ - else \ - local_target="$$target"; \ - fi; \ - (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ - || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ - done && test -z "$$fail" -tags-recursive: - list='$(SUBDIRS)'; for subdir in $$list; do \ - test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ - done - -tags: TAGS - -ID: $(HEADERS) $(SOURCES) $(LISP) - list='$(SOURCES) $(HEADERS)'; \ - unique=`for i in $$list; do echo $$i; done | \ - awk ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - here=`pwd` && cd $(srcdir) \ - && mkid -f$$here/ID $$unique $(LISP) - -TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) $(LISP) - tags=; \ - here=`pwd`; \ - list='$(SUBDIRS)'; for subdir in $$list; do \ - if test "$$subdir" = .; then :; else \ - test -f $$subdir/TAGS && tags="$$tags -i $$here/$$subdir/TAGS"; \ - fi; \ - done; \ - list='$(SOURCES) $(HEADERS)'; \ - unique=`for i in $$list; do echo $$i; done | \ - awk ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - test -z "$(ETAGS_ARGS)config.h.in$$unique$(LISP)$$tags" \ - || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags config.h.in $$unique $(LISP) -o $$here/TAGS) - -mostlyclean-tags: - -clean-tags: - -distclean-tags: - -rm -f TAGS ID - -maintainer-clean-tags: - -distdir = $(PACKAGE)-$(VERSION) -top_distdir = $(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 - -rm -rf $(distdir) - GZIP=$(GZIP_ENV) $(TAR) zxf $(distdir).tar.gz - mkdir $(distdir)/=build - mkdir $(distdir)/=inst - dc_install_base=`cd $(distdir)/=inst && pwd`; \ - cd $(distdir)/=build \ - && ../configure --srcdir=.. --prefix=$$dc_install_base \ - && $(MAKE) $(AM_MAKEFLAGS) \ - && $(MAKE) $(AM_MAKEFLAGS) dvi \ - && $(MAKE) $(AM_MAKEFLAGS) check \ - && $(MAKE) $(AM_MAKEFLAGS) install \ - && $(MAKE) $(AM_MAKEFLAGS) installcheck \ - && $(MAKE) $(AM_MAKEFLAGS) dist - -rm -rf $(distdir) - @banner="$(distdir).tar.gz is ready for distribution"; \ - dashes=`echo "$$banner" | sed s/./=/g`; \ - echo "$$dashes"; \ - echo "$$banner"; \ - echo "$$dashes" -dist: distdir - -chmod -R a+r $(distdir) - GZIP=$(GZIP_ENV) $(TAR) chozf $(distdir).tar.gz $(distdir) - -rm -rf $(distdir) -dist-all: distdir - -chmod -R a+r $(distdir) - GZIP=$(GZIP_ENV) $(TAR) chozf $(distdir).tar.gz $(distdir) - -rm -rf $(distdir) -distdir: $(DISTFILES) - -rm -rf $(distdir) - mkdir $(distdir) - -chmod 777 $(distdir) - here=`cd $(top_builddir) && pwd`; \ - top_distdir=`cd $(distdir) && pwd`; \ - distdir=`cd $(distdir) && pwd`; \ - cd $(top_srcdir) \ - && $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --foreign Makefile - @for file in $(DISTFILES); do \ - d=$(srcdir); \ - if test -d $$d/$$file; then \ - cp -pr $$d/$$file $(distdir)/$$file; \ - else \ - test -f $(distdir)/$$file \ - || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ - || cp -p $$d/$$file $(distdir)/$$file || :; \ - fi; \ - done - for subdir in $(SUBDIRS); do \ - if test "$$subdir" = .; then :; else \ - test -d $(distdir)/$$subdir \ - || mkdir $(distdir)/$$subdir \ - || exit 1; \ - chmod 777 $(distdir)/$$subdir; \ - (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir=../$(distdir) distdir=../$(distdir)/$$subdir distdir) \ - || exit 1; \ - fi; \ - done - -DEPS_MAGIC := $(shell mkdir .deps > /dev/null 2>&1 || :) - --include $(DEP_FILES) - -mostlyclean-depend: - -clean-depend: - -distclean-depend: - -rm -rf .deps - -maintainer-clean-depend: - -%.o: %.c - @echo '$(COMPILE) -c $<'; \ - $(COMPILE) -Wp,-MD,.deps/$(*F).pp -c $< - @-cp .deps/$(*F).pp .deps/$(*F).P; \ - tr ' ' '\012' < .deps/$(*F).pp \ - | sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \ - >> .deps/$(*F).P; \ - rm .deps/$(*F).pp - -%.lo: %.c - @echo '$(LTCOMPILE) -c $<'; \ - $(LTCOMPILE) -Wp,-MD,.deps/$(*F).pp -c $< - @-sed -e 's/^\([^:]*\)\.o[ ]*:/\1.lo \1.o :/' \ - < .deps/$(*F).pp > .deps/$(*F).P; \ - tr ' ' '\012' < .deps/$(*F).pp \ - | sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \ - >> .deps/$(*F).P; \ - rm -f .deps/$(*F).pp - -%.o: %.cxx - @echo '$(CXXCOMPILE) -c $<'; \ - $(CXXCOMPILE) -Wp,-MD,.deps/$(*F).pp -c $< - @-cp .deps/$(*F).pp .deps/$(*F).P; \ - tr ' ' '\012' < .deps/$(*F).pp \ - | sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \ - >> .deps/$(*F).P; \ - rm .deps/$(*F).pp - -%.lo: %.cxx - @echo '$(LTCXXCOMPILE) -c $<'; \ - $(LTCXXCOMPILE) -Wp,-MD,.deps/$(*F).pp -c $< - @-sed -e 's/^\([^:]*\)\.o[ ]*:/\1.lo \1.o :/' \ - < .deps/$(*F).pp > .deps/$(*F).P; \ - tr ' ' '\012' < .deps/$(*F).pp \ - | sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \ - >> .deps/$(*F).P; \ - rm -f .deps/$(*F).pp -info-am: -info: info-recursive -dvi-am: -dvi: dvi-recursive -check-am: all-am -check: check-recursive -installcheck-am: -installcheck: installcheck-recursive -all-recursive-am: cdlconfig.h - $(MAKE) $(AM_MAKEFLAGS) all-recursive - -install-exec-am: install-exec-local -install-exec: install-exec-recursive - -install-data-am: install-includeHEADERS -install-data: install-data-recursive - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am -install: install-recursive -uninstall-am: uninstall-includeHEADERS -uninstall: uninstall-recursive -all-am: Makefile $(LIBRARIES) $(HEADERS) cdlconfig.h all-local -all-redirect: all-recursive-am -install-strip: - $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install -installdirs: installdirs-recursive -installdirs-am: - $(mkinstalldirs) $(DESTDIR)$(includedir) - - -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -rm -f Makefile $(CONFIG_CLEAN_FILES) - -rm -f config.cache config.log stamp-h stamp-h[0-9]* - -maintainer-clean-generic: -mostlyclean-am: mostlyclean-hdr mostlyclean-noinstLIBRARIES \ - mostlyclean-compile mostlyclean-tags mostlyclean-depend \ - mostlyclean-generic - -mostlyclean: mostlyclean-recursive - -clean-am: clean-hdr clean-noinstLIBRARIES clean-compile clean-tags \ - clean-depend clean-generic mostlyclean-am clean-local - -clean: clean-recursive - -distclean-am: distclean-hdr distclean-noinstLIBRARIES distclean-compile \ - distclean-tags distclean-depend distclean-generic \ - clean-am - -distclean: distclean-recursive - -rm -f config.status - -maintainer-clean-am: maintainer-clean-hdr \ - maintainer-clean-noinstLIBRARIES \ - maintainer-clean-compile maintainer-clean-tags \ - maintainer-clean-depend maintainer-clean-generic \ - distclean-am - @echo "This command is intended for maintainers to use;" - @echo "it deletes files that may require special tools to rebuild." - -maintainer-clean: maintainer-clean-recursive - -rm -f config.status - -.PHONY: mostlyclean-hdr distclean-hdr clean-hdr maintainer-clean-hdr \ -mostlyclean-noinstLIBRARIES distclean-noinstLIBRARIES \ -clean-noinstLIBRARIES maintainer-clean-noinstLIBRARIES \ -mostlyclean-compile distclean-compile clean-compile \ -maintainer-clean-compile uninstall-includeHEADERS \ -install-includeHEADERS install-data-recursive uninstall-data-recursive \ -install-exec-recursive uninstall-exec-recursive installdirs-recursive \ -uninstalldirs-recursive all-recursive check-recursive \ -installcheck-recursive info-recursive dvi-recursive \ -mostlyclean-recursive distclean-recursive clean-recursive \ -maintainer-clean-recursive tags tags-recursive mostlyclean-tags \ -distclean-tags clean-tags maintainer-clean-tags distdir \ -mostlyclean-depend distclean-depend clean-depend \ -maintainer-clean-depend info-am info dvi-am dvi check check-am \ -installcheck-am installcheck all-recursive-am install-exec-local \ -install-exec-am install-exec install-data-am install-data install-am \ -install uninstall-am uninstall all-local all-redirect all-am all \ -installdirs-am installdirs mostlyclean-generic distclean-generic \ -clean-generic maintainer-clean-generic clean mostlyclean distclean \ -maintainer-clean - - -@MSVC_TRUE@all-local: cdl.lib - -@MSVC_TRUE@cdl.lib: libcdl.a -@MSVC_TRUE@ $(INSTALL) $< $@ - -@MSVC_TRUE@clean-local: -@MSVC_TRUE@ $(RM) cdl.lib - -@MSVC_TRUE@install-exec-local: all-local -@MSVC_TRUE@ $(mkinstalldirs) $(DESTDIR)$(libdir) -@MSVC_TRUE@ $(INSTALL) cdl.lib $(DESTDIR)$(libdir)/cdl.lib - -@MSVC_FALSE@all-local: -@MSVC_FALSE@clean-local: -@MSVC_FALSE@install-exec-local: libcdl.a -@MSVC_FALSE@ $(mkinstalldirs) $(DESTDIR)$(libdir) -@MSVC_FALSE@ $(INSTALL) libcdl.a $(DESTDIR)$(libdir)/libcdl.a - -interp.$(OBJEXT) : Makefile $(cdlcore_headers) $(infra_headers) - -expr.$(OBJEXT) : Makefile $(cdlcore_headers) $(infra_headers) - -infer.$(OBJEXT) : Makefile $(cdlcore_headers) $(infra_headers) - -func.$(OBJEXT) : Makefile $(cdlcore_headers) $(infra_headers) - -refer.$(OBJEXT) : Makefile $(cdlcore_headers) $(infra_headers) - -cdlmisc.$(OBJEXT) : Makefile $(cdlcore_headers) $(infra_headers) - -conflict.$(OBJEXT) : Makefile $(cdlcore_headers) $(infra_headers) - -property.$(OBJEXT) : Makefile $(cdlcore_headers) $(infra_headers) - -parse.$(OBJEXT) : Makefile $(cdlcore_headers) $(infra_headers) - -base.$(OBJEXT) : Makefile $(cdlcore_headers) $(infra_headers) - -value.$(OBJEXT) : Makefile $(cdlcore_headers) $(infra_headers) - -build.$(OBJEXT) : Makefile $(cdlcore_headers) $(infra_headers) - -dialog.$(OBJEXT) : Makefile $(cdlcore_headers) $(infra_headers) - -wizard.$(OBJEXT) : Makefile $(cdlcore_headers) $(infra_headers) - -interface.$(OBJEXT) : Makefile $(cdlcore_headers) $(infra_headers) - -transact.$(OBJEXT) : Makefile $(cdlcore_headers) $(infra_headers) - -database.$(OBJEXT) : Makefile $(cdl_headers) $(infra_headers) - -config.$(OBJEXT) : Makefile $(cdl_headers) $(infra_headers) - -package.$(OBJEXT) : Makefile $(cdl_headers) $(infra_headers) - -component.$(OBJEXT) : Makefile $(cdl_headers) $(infra_headers) - -option.$(OBJEXT) : Makefile $(cdl_headers) $(infra_headers) - -# 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/host/libcdl/TODO b/host/libcdl/TODO deleted file mode 100644 --- a/host/libcdl/TODO +++ /dev/null @@ -1,235 +0,0 @@ - TODO List - --------- - -Minor ------ - -1) savefile support. Add option handling to the remaining savefile - commands, even if no options are currently defined. - -2) remember unrecognised options so that they can be written back - when the savefile is regenerated. Perhaps add option details - to the header? - -3) allow re-parenting below "". Make the orphans container disabled? - -4) get limbo working - -5) make cdl_interfaces into containers? How about cdl_options as well, - to avoid reparenting problems? - - cdl_interfaces as containers is actually a problem because interfaces - are part of the core, and hence do not know about the existence of - options and components. - -6) allow components and options to be used interchangeably in savefiles. - -7) ecosconfig, create a paths file with details of the source tree - location etc? How about reporting the paths? - - > Huge> How about: put information about the source tree into the savefile BUT you - > Huge> can put - > Huge> ecosconfig --srcdir=/home/hmt/work/ecc/net/ecc/ecc - > Huge> and it'll say "Oi! You've changed the repository! Override [y/n]?" - > Huge> That lets you move them 'round. - > - > That is a possibility, but I am reluctant to add any interactive - > facilities to ecosconfig just yet - - OK, instead: - % ecosconfig --srcdir=/home/hmt/work/ecc/net/ecc/ - ecosconfig: Oi! You've changed the repository! Quitting. - ecosconfig: [Hint: Use --new-srcdir to override.] - % ecosconfig --new-srcdir=/home/hmt/work/ecc/net/ecc/ - ecosconfig: new repository selected: /home/hmt/work/ecc/net/ecc/ - % _ - There's interactive and interactive... ;-) - [*enable anyone? ;-)] - -8) savefiles, if an interface has no implementors then say so. - -9) CDL filenames in the savefile? This might be useful for people - wanting to look at the CDL sources, although all the interesting - information should already be in the savefile. - -10) what happens if a source file is listed for two separate options? - -11) define -format="\\\"%s\\\"" XYZ - This seems to do the wrong thing. Consider: - - cdl_option CYGNUM_LIBC_MAX_LOCALE_NAME_SIZE { - define -format="\\\"%s\\\"" XYZ - ... - } - - The output is: - - #define CYGNUM_LIBC_MAX_LOCALE_NAME_SIZE "16" - #define XYZ_16 - - BLV - may have been fixed on Feb 14th - -12) define -format="\"%s\"" XYZ - - This gives an internal error. Should it? - -13) make-object, check for priorities less than 200. It is not - sensible to build an object after the library has been - constructed. Also check that the target is a .o file. - -14) exported header files. Suppress obvious problems such as - CVS subdirectories and files ending with ~. See pkgconf::locate_files. - -15) diagnostics for inappropriate templates, e.g. the stubs template on simulators. - -16) custom build steps and generating exported header files. - - Priorities of custom build steps that should go before header file - generation? - Use of include_files property. - -17) what happens when several packages specify the same define_header? - -18) evalexception conflicts. What should happen if the node is disabled or inactive? - Especially if it is the default_value expression that is causing the problem. - -19) add diagnostic callback support to the inference engine so that I - can figure out what is going on. - -20) make version comparison completely case insensitive, to avoid - problems on some file systems. - -21) configure magic to cope with Debian TCL organization. - See http://sourceware.cygnus.com/ml/ecos-discuss/2000-06/msg00094.html - -22) add version number #define's to pkgconf/system.h, to allow - application code to adapt to different versions of a package. - http://sourceware.cygnus.com/ml/ecos-discuss/2000-06/msg00140.html - -Intermediate ------------- - -1) integrate the makefile generation support into libcdl. - -2) implement the Tcl interface to the CDL data, especially tcl_get - and the appropriate Tcl variables. - -3) full definition of custom build steps and the build procedure - generally, including working out what should happen for - compiler flags. - - Dependency analysis in custom build steps. - -4) get safe interpreters working, and make sure that only safe - file I/O operations are permitted. - -5) Improve diagnostic messages, including line numbers. - -6) extend the inference engine to support more operators. - -7) support disabled conflicts. - -8) full implementation of interfaces, including automatic creation. - -9) text aliases for legal_values lists? - -10) savefiles do not list `implements' properties - -11) ecosconfig verbosity. Add --silent and --verbose modes? - -12) header file dependencies. From Jesper and others: - - One alternative way of handling this is the way it's done in Linux - (which happened around 2.2.?, I think, and made for some - phenomenal build speedups): - - grep each source file foo.c for use of CYGxxx_ macros. Cat this list - into .foo.c.config_deps (or similar) with proper mangling so it - becomes a GCC dependency file (for foo.c) on "option files". - - Each option, opt_name, thus adds a dependency on - $build/config_deps/CYGxxx_opt_name. Whenever changing the config, - touch the relevant config_deps/ files. - - In short: when making general source file dependencies, exclude any - dependencies on $install/include/pkgconf/* and replace with - appropriate $build/config_deps/* dependencies. That makes for one - smoooking fast dependency system. It doesn't get finer-grained than - this. - -13) friend packages, allowing one package to see the implementation - details of another. Also, handle documentation links between these. - -14) API clean-up. Eliminate the confusion between "value" and the data part of - a bool/data pair. - -Major ------ - -1) implement and integrate a proper infrastructure. Generally sort out - the host-side build tree, including making libcdl into a Tcl - package. - -2) sort out the test suites. - -3) std::bad_alloc exceptions. These can happen just about anywhere. - Lots of places need to be hardened against this to avoid memory - leaks. A completely robust system is probably not possible - because cancelling a transaction may involve memory allocation. - -4) general code walk through to look for obvious inefficiencies, e.g. - passing things by value rather than by reference. - -5) generalise the build support for other languages such as Java. - -6) implement a proper database and associated admin tool. - -7) improved autoconfiscation support, in particular finding the - appropriate platform-specific library support. - -8) a suitable naming convention for data members and for arguments to - inline functions should be adopted, to prevent collisions with - #define'd symbols in application land. Possibilities include - _X_ and __X. - -9) work out how to extend Tcl to provide line number information. - -10) i18n support. - -11) currently the data type cdl_int is defined to be 64 bits. This should - probably be changed to arbitrary precision, so that e.g. processors - which can perform 128 bit arithmetic can be adequately supported. - -12) extend the CDL expression syntax with e.g. string operators. This - will impact the inference engine. - -13) add an interactive mode to ecosconfig resolve, allowing users to - confirm or cancel solutions? - -//=========================================================================== -//####COPYRIGHTBEGIN#### -// -// ---------------------------------------------------------------------------- -// Copyright (C) 1999, 2000 Red Hat, Inc. -// -// This file is part of the eCos host tools. -// -// This program is free software; you can redistribute it and/or modify it -// under the terms of the GNU General Public License as published by the Free -// Software Foundation; either version 2 of the License, or (at your option) -// any later version. -// -// This program is distributed in the hope that it will be useful, but WITHOUT -// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for -// more details. -// -// You should have received a copy of the GNU General Public License along with -// this program; if not, write to the Free Software Foundation, Inc., -// 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -// -// ---------------------------------------------------------------------------- -// -//####COPYRIGHTEND#### -//=========================================================================== - diff --git a/host/libcdl/acconfig.h b/host/libcdl/acconfig.h deleted file mode 100644 --- a/host/libcdl/acconfig.h +++ /dev/null @@ -1,60 +0,0 @@ -#ifndef CYGONCE_LIBCDL_CONFIG_H -# define CYGONCE_LIBCDL_CONFIG_H - -//====================================================================== -// -// acconfig.h -// -// Configuration header for libcdl -// -//====================================================================== -//####COPYRIGHTBEGIN#### -// -// ---------------------------------------------------------------------------- -// Copyright (C) 1998, 1999, 2000 Red Hat, Inc. -// -// This file is part of the eCos host tools. -// -// This program is free software; you can redistribute it and/or modify it -// under the terms of the GNU General Public License as published by the Free -// Software Foundation; either version 2 of the License, or (at your option) -// any later version. -// -// This program is distributed in the hope that it will be useful, but WITHOUT -// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for -// more details. -// -// You should have received a copy of the GNU General Public License along with -// this program; if not, write to the Free Software Foundation, Inc., -// 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -// -// ---------------------------------------------------------------------------- -// -//####COPYRIGHTEND#### -//====================================================================== -//#####DESCRIPTIONBEGIN#### -// -// Author(s): bartv -// Contact(s): bartv -// Date: 1998/12/17 -// Version: 0.01 -// -//####DESCRIPTIONEND#### -//====================================================================== - -#undef PACKAGE -#undef VERSION -#undef CYGNUM_LIBCDL_VERSION - -#undef CYGDBG_USE_ASSERTS -#undef CYGDBG_INFRA_DEBUG_PRECONDITIONS -#undef CYGDBG_INFRA_DEBUG_POSTCONDITIONS -#undef CYGDBG_INFRA_DEBUG_INVARIANTS -#undef CYGDBG_INFRA_DEBUG_LOOP_INVARIANTS - -#undef CYGDBG_USE_TRACING -#undef CYGDBG_INFRA_DEBUG_FUNCTION_REPORTS - -#endif // CYGONCE_LIBCDL_CONFIG_H -// End of config.h diff --git a/host/libcdl/acinclude.m4 b/host/libcdl/acinclude.m4 deleted file mode 100644 --- a/host/libcdl/acinclude.m4 +++ /dev/null @@ -1,44 +0,0 @@ -dnl Process this file with aclocal to get an aclocal.m4 file. Then -dnl process that with autoconf. -dnl ==================================================================== -dnl -dnl acinclude.m4 -dnl -dnl ==================================================================== -dnl ####ECOSHOSTGPLCOPYRIGHTBEGIN#### -dnl ---------------------------------------------------------------------------- -dnl Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc. -dnl -dnl This file is part of the eCos host tools. -dnl -dnl This program is free software; you can redistribute it and/or modify it -dnl under the terms of the GNU General Public License as published by the Free -dnl Software Foundation; either version 2 of the License, or (at your option) -dnl any later version. -dnl -dnl This program is distributed in the hope that it will be useful, but WITHOUT -dnl ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -dnl FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for -dnl more details. -dnl -dnl You should have received a copy of the GNU General Public License along with -dnl this program; if not, write to the Free Software Foundation, Inc., -dnl 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -dnl -dnl ---------------------------------------------------------------------------- -dnl ####ECOSHOSTGPLCOPYRIGHTEND#### -dnl ==================================================================== -dnl#####DESCRIPTIONBEGIN#### -dnl -dnl Author(s): bartv -dnl Contact(s): bartv -dnl Date: 1998/12/16 -dnl Version: 0.01 -dnl -dnl####DESCRIPTIONEND#### -dnl ==================================================================== - -dnl Access shared macros. -dnl AM_CONDITIONAL needs to be mentioned here or else aclocal does not -dnl incorporate the macro into aclocal.m4 -sinclude(../../acsupport/acinclude.m4) diff --git a/host/libcdl/aclocal.m4 b/host/libcdl/aclocal.m4 deleted file mode 100644 --- a/host/libcdl/aclocal.m4 +++ /dev/null @@ -1,205 +0,0 @@ -dnl aclocal.m4 generated automatically by aclocal 1.4-p5 - -dnl Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc. -dnl This file is free software; the Free Software Foundation -dnl gives unlimited permission to copy and/or distribute it, -dnl with or without modifications, as long as this notice is preserved. - -dnl This program is distributed in the hope that it will be useful, -dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without -dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A -dnl PARTICULAR PURPOSE. - -dnl Process this file with aclocal to get an aclocal.m4 file. Then -dnl process that with autoconf. -dnl ==================================================================== -dnl -dnl acinclude.m4 -dnl -dnl ==================================================================== -dnl ####ECOSHOSTGPLCOPYRIGHTBEGIN#### -dnl ---------------------------------------------------------------------------- -dnl Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc. -dnl -dnl This file is part of the eCos host tools. -dnl -dnl This program is free software; you can redistribute it and/or modify it -dnl under the terms of the GNU General Public License as published by the Free -dnl Software Foundation; either version 2 of the License, or (at your option) -dnl any later version. -dnl -dnl This program is distributed in the hope that it will be useful, but WITHOUT -dnl ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -dnl FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for -dnl more details. -dnl -dnl You should have received a copy of the GNU General Public License along with -dnl this program; if not, write to the Free Software Foundation, Inc., -dnl 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -dnl -dnl ---------------------------------------------------------------------------- -dnl ####ECOSHOSTGPLCOPYRIGHTEND#### -dnl ==================================================================== -dnl#####DESCRIPTIONBEGIN#### -dnl -dnl Author(s): bartv -dnl Contact(s): bartv -dnl Date: 1998/12/16 -dnl Version: 0.01 -dnl -dnl####DESCRIPTIONEND#### -dnl ==================================================================== - -dnl Access shared macros. -dnl AM_CONDITIONAL needs to be mentioned here or else aclocal does not -dnl incorporate the macro into aclocal.m4 -sinclude(../../acsupport/acinclude.m4) - -# Define a conditional. - -AC_DEFUN([AM_CONDITIONAL], -[AC_SUBST($1_TRUE) -AC_SUBST($1_FALSE) -if $2; then - $1_TRUE= - $1_FALSE='#' -else - $1_TRUE='#' - $1_FALSE= -fi]) - -# Do all the work for Automake. 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. - -# serial 1 - -dnl Usage: -dnl AM_INIT_AUTOMAKE(package,version, [no-define]) - -AC_DEFUN([AM_INIT_AUTOMAKE], -[AC_REQUIRE([AC_PROG_INSTALL]) -PACKAGE=[$1] -AC_SUBST(PACKAGE) -VERSION=[$2] -AC_SUBST(VERSION) -dnl test to see if srcdir already configured -if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then - AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) -fi -ifelse([$3],, -AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) -AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])) -AC_REQUIRE([AM_SANITY_CHECK]) -AC_REQUIRE([AC_ARG_PROGRAM]) -dnl FIXME This is truly gross. -missing_dir=`cd $ac_aux_dir && pwd` -AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir) -AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir) -AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir) -AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir) -AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir) -AC_REQUIRE([AC_PROG_MAKE_SET])]) - -# -# Check to make sure that the build environment is sane. -# - -AC_DEFUN([AM_SANITY_CHECK], -[AC_MSG_CHECKING([whether build environment is sane]) -# Just in case -sleep 1 -echo timestamp > conftestfile -# 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 conftestfile 2> /dev/null` - if test "[$]*" = "X"; then - # -L didn't work. - set X `ls -t $srcdir/configure conftestfile` - fi - if test "[$]*" != "X $srcdir/configure conftestfile" \ - && test "[$]*" != "X conftestfile $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" = conftestfile - ) -then - # Ok. - : -else - AC_MSG_ERROR([newly created file is older than distributed files! -Check your system clock]) -fi -rm -f conftest* -AC_MSG_RESULT(yes)]) - -dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY) -dnl The program must properly implement --version. -AC_DEFUN([AM_MISSING_PROG], -[AC_MSG_CHECKING(for working $2) -# Run test in a subshell; some versions of sh will print an error if -# an executable is not found, even if stderr is redirected. -# Redirect stdin to placate older versions of autoconf. Sigh. -if ($2 --version) < /dev/null > /dev/null 2>&1; then - $1=$2 - AC_MSG_RESULT(found) -else - $1="$3/missing $2" - AC_MSG_RESULT(missing) -fi -AC_SUBST($1)]) - -# Add --enable-maintainer-mode option to configure. -# From Jim Meyering - -# serial 1 - -AC_DEFUN([AM_MAINTAINER_MODE], -[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) - dnl maintainer-mode is disabled by default - AC_ARG_ENABLE(maintainer-mode, -[ --enable-maintainer-mode enable make rules and dependencies not useful - (and sometimes confusing) to the casual installer], - USE_MAINTAINER_MODE=$enableval, - USE_MAINTAINER_MODE=no) - AC_MSG_RESULT($USE_MAINTAINER_MODE) - AM_CONDITIONAL(MAINTAINER_MODE, test $USE_MAINTAINER_MODE = yes) - MAINT=$MAINTAINER_MODE_TRUE - AC_SUBST(MAINT)dnl -] -) - -# Like AC_CONFIG_HEADER, but automatically create stamp file. - -AC_DEFUN([AM_CONFIG_HEADER], -[AC_PREREQ([2.12]) -AC_CONFIG_HEADER([$1]) -dnl When config.status generates a header, we must update the stamp-h file. -dnl This file resides in the same directory as the config header -dnl that is generated. We must strip everything past the first ":", -dnl and everything past the last "/". -AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl -ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>, -<>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>, -<>; do - case " <<$>>CONFIG_HEADERS " in - *" <<$>>am_file "*<<)>> - echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx - ;; - esac - am_indx=`expr "<<$>>am_indx" + 1` -done<<>>dnl>>) -changequote([,]))]) - diff --git a/host/libcdl/base.cxx b/host/libcdl/base.cxx deleted file mode 100644 --- a/host/libcdl/base.cxx +++ /dev/null @@ -1,3709 +0,0 @@ -//{{{ Banner - -//============================================================================ -// -// base.cxx -// -// Implementations of the various base classes -// -//============================================================================ -//####COPYRIGHTBEGIN#### -// -// ---------------------------------------------------------------------------- -// Copyright (C) 2002, 2003 Bart Veer -// Copyright (C) 1999, 2000 Red Hat, Inc. -// -// This file is part of the eCos host tools. -// -// This program is free software; you can redistribute it and/or modify it -// under the terms of the GNU General Public License as published by the Free -// Software Foundation; either version 2 of the License, or (at your option) -// any later version. -// -// This program is distributed in the hope that it will be useful, but WITHOUT -// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for -// more details. -// -// You should have received a copy of the GNU General Public License along with -// this program; if not, write to the Free Software Foundation, Inc., -// 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -// -// ---------------------------------------------------------------------------- -// -//####COPYRIGHTEND#### -//============================================================================ -//#####DESCRIPTIONBEGIN#### -// -// Author(s): bartv -// Contact(s): bartv -// Date: 1999/02/18 -// Version: 0.02 -// Description: libcdl defines a hierarchy of base classes, used for -// constructing higher-level entities such as options -// and packages. -// -//####DESCRIPTIONEND#### -//============================================================================ - -//}}} -//{{{ #include's - -// ---------------------------------------------------------------------------- -#include "cdlconfig.h" - -// Get the infrastructure types, assertions, tracing and similar -// facilities. -#include -#include - -// defines everything implemented in this module. -// It implicitly supplies , and because -// the class definitions rely on these headers. -#include - -//}}} - -//{{{ Statics - -// ---------------------------------------------------------------------------- -CYGDBG_DEFINE_MEMLEAK_COUNTER(CdlNodeBody); -CYGDBG_DEFINE_MEMLEAK_COUNTER(CdlContainerBody); -CYGDBG_DEFINE_MEMLEAK_COUNTER(CdlLoadableBody); -CYGDBG_DEFINE_MEMLEAK_COUNTER(CdlToplevelBody); -CYGDBG_DEFINE_MEMLEAK_COUNTER(CdlUserVisibleBody); -CYGDBG_DEFINE_MEMLEAK_COUNTER(CdlParentableBody); - -//}}} -//{{{ CdlNodeBody - -//{{{ Construction - -// ---------------------------------------------------------------------------- -// The real constructor takes a string argument and should get invoked first. -// Because of the way virtual inheritance is used it is also necessary to have -// a default constructor, but that need not do anything. A newly constructed -// object does not yet live in the hierarchy. - -CdlNodeBody::CdlNodeBody(std::string name_arg) -{ - CYG_REPORT_FUNCNAME("CdlNode:: constructor"); - CYG_REPORT_FUNCARG1XV(this); - CYG_PRECONDITIONC("" != name_arg); - - name = name_arg; - parent = 0; - owner = 0; - toplevel = 0; - active = false; - remove_node_container_position = -1; - - // The STL containers will take care of themselves. - - cdlnodebody_cookie = CdlNodeBody_Magic; - CYGDBG_MEMLEAK_CONSTRUCTOR(); - - CYG_POSTCONDITION_THISC(); - CYG_REPORT_RETURN(); -} - -CdlNodeBody::CdlNodeBody() -{ - CYG_PRECONDITION_THISC(); -} - -//}}} -//{{{ Destructor - -// ---------------------------------------------------------------------------- -// By the time the destructor gets invoked the node should already -// have been unbound and removed from the hierarchy. - -CdlNodeBody::~CdlNodeBody() -{ - CYG_REPORT_FUNCNAME("CdlNode:: destructor"); - CYG_REPORT_FUNCARG1XV(this); - CYG_PRECONDITION_THISC(); - - // Make sure that the node is unbound: all references to and from - // this node should have been destroyed already inside a - // transaction. - CYG_PRECONDITIONC(0 == referrers.size()); - - // Make sure that the node has been removed from the hierarchy - CYG_PRECONDITIONC(0 == toplevel); - CYG_PRECONDITIONC(0 == owner); - CYG_PRECONDITIONC(0 == parent); - - // Destroy all properties associated with this object. - std::vector::iterator prop_i; - for (prop_i= properties.begin(); prop_i != properties.end(); prop_i++) { - delete *prop_i; - *prop_i = 0; - } - properties.clear(); - - cdlnodebody_cookie = CdlNodeBody_Invalid; - name = ""; - active = false; - unsupported_savefile_strings.clear(); - - CYGDBG_MEMLEAK_DESTRUCTOR(); - - CYG_REPORT_RETURN(); -} - -//}}} -//{{{ Trivial data access - -// ---------------------------------------------------------------------------- - -std::string -CdlNodeBody::get_name() const -{ - CYG_REPORT_FUNCNAME("CdlNode::get_name"); - CYG_REPORT_FUNCARG1XV(this); - CYG_PRECONDITION_THISC(); - - CYG_REPORT_RETURN(); - return name; -} - -void -CdlNodeBody::set_name(std::string name_arg) -{ - CYG_REPORT_FUNCNAME("CdlNode::set_name"); - CYG_REPORT_FUNCARG1XV(this); - CYG_PRECONDITION_THISC(); - - name = name_arg; - - CYG_REPORT_RETURN(); -} - -CdlContainer -CdlNodeBody::get_parent() const -{ - CYG_REPORT_FUNCNAMETYPE("CdlNode::get_parent", "parent %p"); - CYG_REPORT_FUNCARG1XV(this); - CYG_PRECONDITION_THISC(); - - CdlContainer result = parent; - CYG_REPORT_RETVAL(result); - return result; -} - -CdlLoadable -CdlNodeBody::get_owner() const -{ - CYG_REPORT_FUNCNAMETYPE("CdlNode::get_owner", "owner %p"); - CYG_REPORT_FUNCARG1XV(this); - CYG_PRECONDITION_THISC(); - - CdlLoadable result = owner; - CYG_REPORT_RETVAL(result); - return result; -} - -CdlToplevel -CdlNodeBody::get_toplevel() const -{ - CYG_REPORT_FUNCNAMETYPE("CdlNode::get_toplevel", "toplevel %p"); - CYG_REPORT_FUNCARG1XV(this); - CYG_PRECONDITION_THISC(); - - CdlToplevel result = toplevel; - CYG_REPORT_RETVAL(result); - return result; -} - -std::string -CdlNodeBody::get_class_name() const -{ - CYG_REPORT_FUNCNAME("CdlNode::get_class_name"); - CYG_PRECONDITION_THISC(); - CYG_REPORT_RETURN(); - return "node"; -} - -//}}} -//{{{ The properties vector - -// ---------------------------------------------------------------------------- -// Trivial manipulation of the properties vector. - -const std::vector& -CdlNodeBody::get_properties() const -{ - CYG_REPORT_FUNCNAME("CdlNode::get_properties"); - CYG_REPORT_FUNCARG1XV(this); - CYG_PRECONDITION_THISC(); - - CYG_REPORT_RETURN(); - return properties; -} - -CdlProperty -CdlNodeBody::get_property(std::string id) const -{ - CYG_REPORT_FUNCNAMETYPE("CdlNode::get_property", "result %p"); - CYG_REPORT_FUNCARG1XV(this); - CYG_PRECONDITION_THISC(); - - CdlProperty result = 0; - std::vector::const_iterator prop_i; - for (prop_i = properties.begin(); prop_i != properties.end(); prop_i++) { - if ((*prop_i)->get_property_name() == id) { - result = *prop_i; - break; - } - } - - CYG_REPORT_RETVAL(result); - return result; -} - -void -CdlNodeBody::get_properties(std::string id, std::vector& result) const -{ - CYG_REPORT_FUNCNAME("CdlNode::get_properties"); - CYG_REPORT_FUNCARG1XV(this); - CYG_PRECONDITION_THISC(); - - std::vector::const_iterator prop_i; - for (prop_i = properties.begin(); prop_i != properties.end(); prop_i++) { - if ((*prop_i)->get_property_name() == id) { - result.push_back(*prop_i); - } - } - - CYG_REPORT_RETURN(); -} - -std::vector -CdlNodeBody::get_properties(std::string id) const -{ - CYG_REPORT_FUNCNAME("CdlNode::get_properties"); - CYG_REPORT_FUNCARG1XV(this); - CYG_PRECONDITION_THISC(); - - std::vector result; - std::vector::const_iterator prop_i; - for (prop_i = properties.begin(); prop_i != properties.end(); prop_i++) { - if ((*prop_i)->get_property_name() == id) { - result.push_back(*prop_i); - } - } - - CYG_REPORT_RETURN(); - return result; -} - -bool -CdlNodeBody::has_property(std::string id) const -{ - CYG_REPORT_FUNCNAMETYPE("CdlNode::has_property", "result %d"); - CYG_REPORT_FUNCARG1XV(this); - CYG_PRECONDITION_THISC(); - - bool result = false; - std::vector::const_iterator prop_i; - for (prop_i = properties.begin(); prop_i != properties.end(); prop_i++) { - if ((*prop_i)->get_property_name() == id) { - result = true; - break; - } - } - - CYG_REPORT_RETVAL(result); - return result; -} - -int -CdlNodeBody::count_properties(std::string id) const -{ - CYG_REPORT_FUNCNAMETYPE("CdlNode::count_properties", "result %d"); - CYG_REPORT_FUNCARG1XV(this); - CYG_PRECONDITION_THISC(); - - int result = 0; - std::vector::const_iterator prop_i; - for (prop_i = properties.begin(); prop_i != properties.end(); prop_i++) { - if ((*prop_i)->get_property_name() == id) { - result++; - } - } - - CYG_REPORT_RETVAL(result); - return result; -} - -//}}} -//{{{ Conflicts - -// ---------------------------------------------------------------------------- -// Provide access to the current set of conflicts. This operates on the global -// state, more commonly these changes happen in the context of a transaction. - -void -CdlNodeBody::get_conflicts(std::vector& result) const -{ - CYG_REPORT_FUNCNAME("CdlNode::get_conflicts"); - CYG_REPORT_FUNCARG1XV(this); - CYG_PRECONDITION_THISC(); - - const std::list& conflicts = toplevel->get_all_conflicts(); - std::list::const_iterator conf_i; - for (conf_i = conflicts.begin(); conf_i != conflicts.end(); conf_i++) { - if ((*conf_i)->get_node() == this) { - result.push_back(*conf_i); - } - } - - CYG_REPORT_RETURN(); -} - -void -CdlNodeBody::get_conflicts(bool (*fn)(CdlConflict), std::vector& result) const -{ - CYG_REPORT_FUNCNAME("CdlNode::get_conflicts"); - CYG_REPORT_FUNCARG2XV(this, fn); - CYG_PRECONDITION_THISC(); - CYG_CHECK_FUNC_PTRC(fn); - - const std::list& conflicts = toplevel->get_all_conflicts(); - std::list::const_iterator conf_i; - for (conf_i = conflicts.begin(); conf_i != conflicts.end(); conf_i++) { - if (((*conf_i)->get_node() == this) && ((*fn)(*conf_i))) { - result.push_back(*conf_i); - } - } - - CYG_REPORT_RETURN(); -} - -void -CdlNodeBody::get_structural_conflicts(std::vector& result) const -{ - CYG_REPORT_FUNCNAME("CdlNode::get_structural_conflicts"); - CYG_REPORT_FUNCARG1XV(this); - CYG_PRECONDITION_THISC(); - - const std::list& conflicts = toplevel->get_all_structural_conflicts(); - std::list::const_iterator conf_i; - for (conf_i = conflicts.begin(); conf_i != conflicts.end(); conf_i++) { - if ((*conf_i)->get_node() == this) { - result.push_back(*conf_i); - } - } - - CYG_REPORT_RETURN(); -} - -void -CdlNodeBody::get_structural_conflicts(bool (*fn)(CdlConflict), std::vector& result) const -{ - CYG_REPORT_FUNCNAME("CdlNode::get_conflicts"); - CYG_REPORT_FUNCARG2XV(this, fn); - CYG_PRECONDITION_THISC(); - CYG_CHECK_FUNC_PTRC(fn); - - const std::list& conflicts = toplevel->get_all_structural_conflicts(); - std::list::const_iterator conf_i; - for (conf_i = conflicts.begin(); conf_i != conflicts.end(); conf_i++) { - if (((*conf_i)->get_node() == this) && ((*fn)(*conf_i))) { - result.push_back(*conf_i); - } - } - - CYG_REPORT_RETURN(); -} - -//}}} -//{{{ Referrers - -// ---------------------------------------------------------------------------- -// And access to the referrers vector. -const std::vector& -CdlNodeBody::get_referrers() const -{ - CYG_REPORT_FUNCNAME("CdlNode::get_referrers"); - CYG_REPORT_FUNCARG1XV(this); - CYG_PRECONDITION_THISC(); - - CYG_REPORT_RETURN(); - return referrers; -} - -//}}} -//{{{ Property parsers - -// ---------------------------------------------------------------------------- -// Property parsing. For now there are now properties guaranteed to be -// associated with every node. This may change in future, e.g. -// internal debugging-related properties. -void -CdlNodeBody::add_property_parsers(std::vector& parsers) -{ - CYG_REPORT_FUNCNAME("CdlNode::add_property_parsers"); - CYG_REPORT_RETURN(); -} - -void -CdlNodeBody::check_properties(CdlInterpreter interp) -{ - CYG_REPORT_FUNCNAME("CdlNode::check_properties"); - CYG_REPORT_FUNCARG2XV(this, interp); - CYG_PRECONDITION_THISC(); - CYG_PRECONDITION_CLASSC(interp); - - CYG_REPORT_RETURN(); -} - -//}}} -//{{{ is_active() etc. - -// ---------------------------------------------------------------------------- -// Associated with every node is a boolean that holds the current -// "active" state. Changes to this happen only at transaction -// commit time. - -bool -CdlNodeBody::is_active() const -{ - CYG_REPORT_FUNCNAMETYPE("CdlNode::is_active", "result %d"); - CYG_REPORT_FUNCARG1XV(this); - CYG_PRECONDITION_THISC(); - - bool result = active; - CYG_REPORT_RETVAL(result); - return result; -} - -bool -CdlNodeBody::is_active(CdlTransaction transaction) -{ - CYG_REPORT_FUNCNAMETYPE("CdlNode::is_active", "result %d"); - CYG_REPORT_FUNCARG2XV(this, transaction); - CYG_PRECONDITION_THISC(); - CYG_PRECONDITION_ZERO_OR_CLASSC(transaction); - - bool result; - if (0 != transaction) { - result = transaction->is_active(this); - } else { - result = active; - } - CYG_REPORT_RETVAL(result); - return result; -} - -// This virtual member function allows nodes to check whether or not -// they should be active. Derived classes may impose additional -// constraints. -bool -CdlNodeBody::test_active(CdlTransaction transaction) -{ - CYG_REPORT_FUNCNAMETYPE("CdlNode::test_active", "result %d"); - CYG_PRECONDITION_THISC(); - CYG_PRECONDITION_CLASSC(transaction); - - bool result = false; - if ((0 != parent) && (transaction->is_active(parent))) { - CdlValuable valuable = dynamic_cast(parent); - if (0 == valuable) { - result = true; - } else if (valuable->is_enabled(transaction)) { - result = true; - } - } - - CYG_REPORT_RETVAL(result); - return result; -} - -//}}} -//{{{ Propagation support - -// ---------------------------------------------------------------------------- -// In the base class nothing needs doing for propagation. -void -CdlNodeBody::update(CdlTransaction transaction, CdlUpdate change) -{ - CYG_REPORT_FUNCNAME("CdlNode::update"); - CYG_REPORT_FUNCARG1XV(this); - CYG_PRECONDITION_THISC(); - CYG_PRECONDITION_CLASSC(transaction); - - CYG_REPORT_RETURN(); -} - -//}}} -//{{{ Persistence support - -// ---------------------------------------------------------------------------- -// The CdlNode::save() member should never get invoked directly, it should -// get invoked indirectly from e.g. CdlOption::save(). Normally there is -// no information associated with a node that ends up in a save file -// (the calling code will have take care of the name etc.). However there -// is support in the library for storing application-specific data in the -// save file, for example GUI information, and this information must be -// preserved even if it is not recognised. Savefiles are self-describing, -// they contain details of all the commands that are applicable. -// CdlNode::save() is responsible for outputting the unrecognised strings -// to the save file. - -void -CdlNodeBody::save(CdlInterpreter interp, Tcl_Channel chan, int indentation, bool minimal) -{ - CYG_REPORT_FUNCNAME("CdlNode::save"); - CYG_REPORT_FUNCARG5XV(this, interp, chan, indentation, minimal); - - if (unsupported_savefile_strings.size() != 0) { - // We should already be inside the body of a suitable command, - // e.g. cdl_option xyz { ... } - // CdlToplevel::savefile_handle_unsupported() is responsible for - // putting suitably formatted strings into the - // unsupported_savefile_strings vector, so all that is needed here - // is to dump those strings to the channel. - std::string data = "\n"; - std::vector::const_iterator str_i; - for (str_i = unsupported_savefile_strings.begin(); str_i != unsupported_savefile_strings.end(); str_i++) { - data += std::string(indentation, ' ') + *str_i + " ;\n"; - } - interp->write_data(chan, data); - } - - CYG_UNUSED_PARAM(bool, minimal); - CYG_REPORT_RETURN(); -} - -bool -CdlNodeBody::has_additional_savefile_information() const -{ - CYG_REPORT_FUNCNAMETYPE("CdlNode::has_additional_savefile_information", "result %d"); - CYG_REPORT_FUNCARG1XV(this); - CYG_PRECONDITION_THISC(); - - bool result = (0 != unsupported_savefile_strings.size()); - CYG_REPORT_RETVAL(result); - return result; -} - -//}}} -//{{{ check_this() - -// ---------------------------------------------------------------------------- -// Because of multiple and virtual inheritance, check_this() may -// get called rather a lot. Unfortunately all of the checks are -// useful. - -bool -CdlNodeBody::check_this(cyg_assert_class_zeal zeal) const -{ - if (CdlNodeBody_Magic != cdlnodebody_cookie) { - return false; - } - CYGDBG_MEMLEAK_CHECKTHIS(); - - if ("" == name) { - return false; - } - - // It is hard to validate the toplevel, owner, and parent - // fields. - // - // 1) when a node is newly created all three fields will - // be null. - // 2) the toplevel may be null if the node is in the process - // of being removed, e.g. during an unload operation. - // The node should still have a valid owner, and will - // have a parent unless the node is also the loadable. - // 3) some nodes are special, e.g. the orphans container, - // and do not have an owner. - // - // So the following combinations can occur: - // Toplevel Owner Parent - // 0 0 0 Creation & toplevel - // 0 Valid 0 Loadable being unloaded - // 0 Valid Valid Node being unloaded - // Valid 0 Valid Orphans container - // Valid Valid Valid Any node - if (0 != toplevel) { - if (0 == parent) { - return false; - } - } - - switch(zeal) { - case cyg_system_test : - case cyg_extreme : - { - if ((0 != toplevel) && (toplevel != this)) { - if (!toplevel->check_this(cyg_quick)) { - return false; - } - if (toplevel->lookup_table.find(name) == toplevel->lookup_table.end()) { - return false; - } - } - if (0 != parent) { - if (!parent->check_this(cyg_quick)) { - return false; - } - if (std::find(parent->contents.begin(), parent->contents.end(), this) == parent->contents.end()) { - return false; - } - } - if (0 != owner) { - if (!owner->check_this(cyg_quick)) { - return false; - } - if (std::find(owner->owned.begin(), owner->owned.end(), this) == owner->owned.end()) { - return false; - } - } - std::vector::const_iterator prop_i; - for (prop_i = properties.begin(); prop_i != properties.end(); prop_i++) { - if (!(*prop_i)->check_this(cyg_quick)) { - return false; - } - } - std::vector::const_iterator ref_i; - for (ref_i = referrers.begin(); ref_i != referrers.end(); ref_i++) { - if (!ref_i->check_this(cyg_quick)) { - return false; - } - } - } - case cyg_thorough : - case cyg_quick : - case cyg_trivial : - case cyg_none : - default : - break; - } - - return true; -} - -//}}} - -//}}} -//{{{ CdlContainerBody - -//{{{ Constructors - -// ---------------------------------------------------------------------------- -// A container simply holds other nodes in a hierarchy. Most -// containers correspond to data in CDL scripts, but there are -// exceptions. For example, if an option is reparented below some -// package or component that is not yet known then it can instead be -// reparented into an "orphans" container immediately below the -// toplevel. -// -// Adding and removing entries to a container is done inside the -// CdlToplevel add_node() and remove_node() members. These will update -// all the fields needed to keep the hierarchy consistent. This -// means that the CdlContainer class itself provides only limited -// functionality. - -CdlContainerBody::CdlContainerBody() -{ - CYG_REPORT_FUNCNAME("CdlContainer:: default constructor"); - CYG_REPORT_FUNCARG1XV(this); - - cdlcontainerbody_cookie = CdlContainerBody_Magic; - CYGDBG_MEMLEAK_CONSTRUCTOR(); - - CYG_POSTCONDITION_THISC(); - CYG_REPORT_RETURN(); -} - -// This variant is for internal use, to allow the library to create -// containers that do not correspond to CDL entities such as -// the orphans container. -CdlContainerBody::CdlContainerBody(std::string name_arg) - : CdlNodeBody(name_arg) -{ - CYG_REPORT_FUNCNAME("CdlContainerBody:: constructor (name)"); - CYG_REPORT_FUNCARG1XV(this); - - cdlcontainerbody_cookie = CdlContainerBody_Magic; - CYGDBG_MEMLEAK_CONSTRUCTOR(); - - CYG_POSTCONDITION_THISC(); - CYG_REPORT_RETURN(); -} - -//}}} -//{{{ Destructor - -// ---------------------------------------------------------------------------- - -CdlContainerBody::~CdlContainerBody() -{ - CYG_REPORT_FUNCNAME("CdlContainer:: destructor"); - CYG_REPORT_FUNCARG1XV(this); - CYG_PRECONDITION_THISC(); - - // Containers should always be empty by the time they - // get deleted. The toplevel and loadable destructors should - // guarantee this. - CYG_ASSERTC(0 == contents.size()); - - cdlcontainerbody_cookie = CdlContainerBody_Invalid; - CYGDBG_MEMLEAK_DESTRUCTOR(); - - CYG_REPORT_RETURN(); -} - -//}}} -//{{{ Accessing the contents - -// ---------------------------------------------------------------------------- -// Simple contents access facilities, including searching. Note that -// the toplevel class maintains a map, which will usually -// be more efficient. - -const std::vector& -CdlContainerBody::get_contents() const -{ - CYG_REPORT_FUNCNAME("CdlContainer::get_contents"); - CYG_REPORT_FUNCARG1XV(this); - CYG_PRECONDITION_THISC(); - - CYG_REPORT_RETURN(); - return contents; -} - -bool -CdlContainerBody::contains(CdlConstNode node, bool recurse) const -{ - CYG_REPORT_FUNCNAMETYPE("CdlContainer::contains (node)", "result %d"); - CYG_REPORT_FUNCARG3XV(this, node, recurse); - CYG_PRECONDITION_THISC(); - CYG_PRECONDITION_CLASSC(node); - - bool result = false; - std::vector::const_iterator node_i; - for (node_i = contents.begin(); node_i != contents.end(); node_i++) { - if (node == *node_i) { - result = true; - break; - } - if (recurse) { - CdlConstContainer child = dynamic_cast(*node_i); - if ((0 != child) && child->contains(node, true)) { - result = true; - break; - } - } - } - - CYG_REPORT_RETVAL(result); - return result; -} - -bool -CdlContainerBody::contains(const std::string name, bool recurse) const -{ - CYG_REPORT_FUNCNAMETYPE("CdlContainer::contains (name)", "result %d"); - CYG_REPORT_FUNCARG2XV(this, recurse); - CYG_PRECONDITION_THISC(); - CYG_PRECONDITIONC("" != name); - - bool result = false; - std::vector::const_iterator node_i; - for (node_i = contents.begin(); node_i != contents.end(); node_i++) { - if ((*node_i)->get_name() == name) { - result = true; - break; - } - if (recurse) { - CdlConstContainer child = dynamic_cast(*node_i); - if ((0 != child) && child->contains(name, true)) { - result = true; - break; - } - } - } - - CYG_REPORT_RETVAL(result); - return result; -} - -CdlNode -CdlContainerBody::find_node(const std::string name, bool recurse) const -{ - CYG_REPORT_FUNCNAMETYPE("CdlContainer::find_node", "result %p"); - CYG_REPORT_FUNCARG2XV(this, recurse); - CYG_PRECONDITION_THISC(); - CYG_PRECONDITIONC("" != name); - - CdlNode result = 0; - std::vector::const_iterator node_i; - for (node_i = contents.begin(); node_i != contents.end(); node_i++) { - if ((*node_i)->get_name() == name) { - result = *node_i; - break; - } - if (recurse) { - CdlConstContainer child = dynamic_cast(*node_i); - if (0 != child) { - result = child->find_node(name, true); - if (0 != result) { - break; - } - } - } - } - - CYG_REPORT_RETVAL(result); - return result; -} - -//}}} -//{{{ Misc - -// ---------------------------------------------------------------------------- - -std::string -CdlContainerBody::get_class_name() const -{ - CYG_REPORT_FUNCNAME("CdlContainer::get_class_name"); - CYG_PRECONDITION_THISC(); - CYG_REPORT_RETURN(); - return "container"; -} - -//}}} -//{{{ Propagation - -// ---------------------------------------------------------------------------- -// If a container becomes active and is enabled then it is necessary -// to check all the children in case they want to become active as well. - -void -CdlContainerBody::update(CdlTransaction transaction, CdlUpdate change) -{ - CYG_REPORT_FUNCNAME("CdlContainer::update"); - CYG_REPORT_FUNCARG1XV(this); - CYG_PRECONDITION_THISC(); - CYG_PRECONDITION_CLASSC(transaction); - - if ((CdlUpdate_ActiveChange != change) && (CdlUpdate_ValueChange != change)) { - CYG_REPORT_RETURN(); - return; - } - - if (transaction->is_active(this)) { - // The container has become active. It is necessary to check - // all the children. If any of them should be active as well - // but are not then this needs to change. - std::vector::iterator node_i; - - for (node_i = contents.begin(); node_i != contents.end(); node_i++) { - bool old_state = transaction->is_active(*node_i); - bool new_state = (*node_i)->test_active(transaction); - if (old_state != new_state) { - transaction->set_active(*node_i, new_state); - } - } - } else { - // The container has become inactive. Any children that were - // active should also become inactive. - std::vector::iterator node_i; - for (node_i = contents.begin(); node_i != contents.end(); node_i++) { - if (transaction->is_active(*node_i)) { - transaction->set_active(*node_i, false); - } - } - } - - CYG_REPORT_RETURN(); -} - -//}}} -//{{{ Persistence - -// ---------------------------------------------------------------------------- -// This member function is invoked while traversing the hierarchy. -// The container itself will have been saved already, this member -// is responsible only for the contents. There are marker comments -// in the output file to indicate a new level in the hierarchy. -// -// Note that this member can also be invoked for the "orphans" container. -// That container will not appear in the save file, but its contents -// will. - -void -CdlContainerBody::save(CdlInterpreter interp, Tcl_Channel chan, int indentation, bool minimal) -{ - CYG_REPORT_FUNCNAME("CdlContainer::save"); - CYG_REPORT_FUNCARG4XV(this, interp, chan, indentation); - CYG_PRECONDITION_THISC(); - CYG_PRECONDITION_CLASSC(interp); - CYG_PRECONDITIONC(0 == indentation); - - if (0 != contents.size()) { - if (!minimal) { - interp->write_data(chan, "# >\n"); - } - std::vector::const_iterator node_i; - for (node_i = contents.begin(); node_i != contents.end(); node_i++) { - (*node_i)->save(interp, chan, indentation, minimal); - } - if (!minimal) { - interp->write_data(chan, "# <\n"); - } - } - - CYG_REPORT_RETURN(); -} - -//}}} -//{{{ check_this() - -// ---------------------------------------------------------------------------- -bool -CdlContainerBody::check_this(cyg_assert_class_zeal zeal) const -{ - if (CdlContainerBody_Magic != cdlcontainerbody_cookie) { - return false; - } - CYGDBG_MEMLEAK_CHECKTHIS(); - - if (cyg_extreme == zeal) { - std::vector::const_iterator node_i; - for (node_i = contents.begin(); node_i != contents.end(); node_i++) { - if (!((*node_i)->check_this(cyg_quick))) { - return false; - } - } - } - return CdlNodeBody::check_this(zeal); -} - -//}}} - -//}}} -//{{{ CdlLoadableBody - -//{{{ Constructor - -// ---------------------------------------------------------------------------- -// A loadable object keeps track of all the nodes read in from a -// particular script, in an "owned" vector. Simply keeping things in a -// hierarchy is not enough because of possible re-parenting. Actual -// updates of the owned vector happen inside the CdlToplevel -// add_node() and remove_node() family. - -CdlLoadableBody::CdlLoadableBody(CdlToplevel toplevel, std::string repo, std::string dir) - : CdlContainerBody() -{ - CYG_REPORT_FUNCNAME("CdlLoadable:: constructor"); - CYG_REPORT_FUNCARG1XV(this); - CYG_PRECONDITION_CLASSC(toplevel); - - // Initialize enough of the object to support check_this() - repository = repo; - directory = dir; - interp = 0; - remove_node_loadables_position = -1; - cdlloadablebody_cookie = CdlLoadableBody_Magic; - - // The owned vector takes care of itself. It is necessary - // to create a new slave interpreter, using the master - // interpreter from the toplevel. - CdlInterpreter master = toplevel->get_interpreter(); - CYG_ASSERTC(0 != master); - interp = master->create_slave(this, false); - interp->push_context(this->get_name()); - CYGDBG_MEMLEAK_CONSTRUCTOR(); - - CYG_POSTCONDITION_THISC(); - CYG_REPORT_RETURN(); -} - -// Needed by derived classes, but should never actually be used. -CdlLoadableBody::CdlLoadableBody() -{ - CYG_FAIL("CdlLoadable default constructor should never get invoked"); -} - -//}}} -//{{{ Destructor - -// ---------------------------------------------------------------------------- -// The loadable destructor. This gets invoked from two places: after an -// unsuccessful load operation, and from inside the transaction commit -// code. Either way most of the clean-up will have happened already: -// all the nodes will have been removed from the toplevel's hierarchy, -// and all property references to and from this loadable will have been -// unbound. -// -// Since all nodes belonging to the loadable are also present in -// the owned vector, they must be destroyed before this destructor -// completes. Hence clearing out the contents cannot be left to -// the base CdlContainer destructor. - -CdlLoadableBody::~CdlLoadableBody() -{ - CYG_REPORT_FUNCNAME("CdlLoadable:: destructor"); - CYG_REPORT_FUNCARG1XV(this); - CYG_PRECONDITION_THISC(); - - // Make sure that the loadable has already been removed from the - // hierarchy: it should not have a toplevel or a parent. - CYG_PRECONDITIONC(0 == toplevel); - CYG_PRECONDITIONC(0 == parent); - - // Containers must have been created before any of their contents. - // The only way to reverse this involves a parent property, but - // all such properties will have been unbound already such that - // the nodes can be safely deleted. The only worry is that - // loadables own themselves. - int i; - for (i = owned.size() - 1; i >= 0; i--) { - CdlNode node = owned[i]; - CYG_LOOP_INVARIANT_CLASSC(node); - - if (node != this) { - CdlToplevelBody::remove_node(this, node->parent, node); - delete node; - } - } - - // Now there should be exactly one entry in the owned vector, - // the loadable itself. We already know that this is no longer - // part of the toplevel and it does not have a parent, so - // the only field we need to worry about is the owner. - CYG_ASSERTC(1 == owned.size()); - CYG_ASSERTC(this == owned[0]); - this->owner = 0; - - // Strictly speaking the owned vector should be clear by now, - // but remove_node() does not actually bother to clear it. - owned.clear(); - - // The loadable should now be empty. It remains to clean up - // a few odds and ends. - cdlloadablebody_cookie = CdlLoadableBody_Invalid; - CYG_ASSERTC(0 == owned.size()); - delete interp; - interp = 0; - repository = ""; - directory = ""; - - CYGDBG_MEMLEAK_DESTRUCTOR(); - - CYG_REPORT_RETURN(); -} - -//}}} -//{{{ Simple information access - -// ---------------------------------------------------------------------------- - -const std::vector& -CdlLoadableBody::get_owned() const -{ - CYG_REPORT_FUNCNAME("CdlLoadable::get_owned"); - CYG_REPORT_FUNCARG1XV(this); - CYG_PRECONDITION_THISC(); - - CYG_REPORT_RETURN(); - return owned; -} - -bool -CdlLoadableBody::owns(CdlConstNode node) const -{ - CYG_REPORT_FUNCNAMETYPE("CdlLoadable::owns", "result %d"); - CYG_REPORT_FUNCARG2XV(this, node); - CYG_PRECONDITION_THISC(); - CYG_PRECONDITION_CLASSC(node); - - bool result = false; - std::vector::const_iterator i = std::find(owned.begin(), owned.end(), node); - if (i != owned.end()) { - result = true; - } - - CYG_REPORT_RETVAL(result); - return result; -} - -CdlInterpreter -CdlLoadableBody::get_interpreter() const -{ - CYG_REPORT_FUNCNAMETYPE("CdlLoadable::get_interpreter", "result %p"); - CYG_REPORT_FUNCARG1XV(this); - CYG_PRECONDITION_THISC(); - - CdlInterpreter result = interp; - CYG_REPORT_RETVAL(result); - return result; -} - -std::string -CdlLoadableBody::get_repository() const -{ - CYG_REPORT_FUNCNAME("CdlLoadable::get_repository"); - CYG_REPORT_FUNCARG1XV(this); - CYG_PRECONDITION_THISC(); - - CYG_REPORT_RETURN(); - return repository; -} - -std::string -CdlLoadableBody::get_directory() const -{ - CYG_REPORT_FUNCNAME("CdlLoadable::get_directory"); - CYG_REPORT_FUNCARG1XV(this); - CYG_PRECONDITION_THISC(); - - CYG_REPORT_RETURN(); - return directory; -} - -//}}} -//{{{ Bind/unbind support - -// ---------------------------------------------------------------------------- -// Binding a loadable. This involves checking every property of every node -// in the loadable, which the properties do themselves by a suitable -// update() virtual function. Next, there may be properties in the -// existing configuration which could not previously be bound: there -// will be structural conflicts for all of these. Once all the pointers -// go to the right places it is possible to calculate the default values -// and generally process the properties. Finally each node's active -// state is checked - the default inactive state will be inappropriate -// in many cases. -// -// FIXME: error recovery? - -void -CdlLoadableBody::bind(CdlTransaction transaction) -{ - CYG_REPORT_FUNCNAME("CdlLoadable::bind"); - CYG_REPORT_FUNCARG2XV(this, transaction); - CYG_INVARIANT_THISC(CdlLoadableBody); - CYG_INVARIANT_CLASSC(CdlTransactionBody, transaction); - - // The loadable must already be part of the hierarchy. - CdlToplevel toplevel = this->get_toplevel(); - CYG_ASSERT_CLASSC(toplevel); - - // As a first step, bind all references in this loadable. - // This is achieved via a Loaded update. - const std::vector& nodes = this->get_owned(); - std::vector::const_iterator node_i; - for (node_i = nodes.begin(); node_i != nodes.end(); node_i++) { - const std::vector& properties = (*node_i)->get_properties(); - std::vector::const_iterator prop_i; - for (prop_i = properties.begin(); prop_i != properties.end(); prop_i++) { - (*prop_i)->update(transaction, *node_i, 0, CdlUpdate_Loaded); - } - } - - // Next, look for all structural conflicts which are unresolved - // references and which can now be resolved. It is necessary - // to check per-transaction structural conflicts, plus those - // in any parent transactions, plus the global ones. - std::list::const_iterator conf_i; - CdlTransaction current_transaction = transaction; - do { - CYG_ASSERT_CLASSC(current_transaction); - const std::list& new_structural_conflicts = current_transaction->get_new_structural_conflicts(); - - for (conf_i = new_structural_conflicts.begin(); conf_i != new_structural_conflicts.end(); ) { - - CdlConflict conflict = *conf_i++; - CYG_LOOP_INVARIANT_CLASSC(conflict); - - CdlConflict_Unresolved unresolved_conflict = dynamic_cast(conflict); - if ((0 != unresolved_conflict) && !transaction->has_conflict_been_cleared(conflict)) { - CdlNode dest = toplevel->lookup(unresolved_conflict->get_target_name()); - if (0 != dest) { - CdlNode node = unresolved_conflict->get_node(); - CdlProperty prop = unresolved_conflict->get_property(); - prop->update(transaction, node, dest, CdlUpdate_Created); - } - } - } - current_transaction = current_transaction->get_parent(); - } while (0 != current_transaction); - - const std::list& structural_conflicts = toplevel->get_all_structural_conflicts(); - for (conf_i = structural_conflicts.begin(); conf_i != structural_conflicts.end(); ) { - - CdlConflict conflict = *conf_i++; - CYG_LOOP_INVARIANT_CLASSC(conflict); - - CdlConflict_Unresolved this_conflict = dynamic_cast(conflict); - if ((0 != this_conflict) && !transaction->has_conflict_been_cleared(conflict)) { - CdlNode dest = toplevel->lookup(this_conflict->get_target_name()); - if (0 != dest) { - CdlNode node = this_conflict->get_node(); - CdlProperty prop = this_conflict->get_property(); - prop->update(transaction, node, dest, CdlUpdate_Created); - } - } - } - - // Conflict resolution has happened. Next it is time - // to evaluate default_value expressions and the like - // in the new loadable. - for (node_i = nodes.begin(); node_i != nodes.end(); node_i++) { - const std::vector& properties = (*node_i)->get_properties(); - std::vector::const_iterator prop_i; - for (prop_i = properties.begin(); prop_i != properties.end(); prop_i++) { - (*prop_i)->update(transaction, *node_i, 0, CdlUpdate_Init); - } - } - - // Nodes start off inactive. Check each one whether or not it - // should be active. - // NOTE: possibly this should be done via a per-node init - // update instead. - for (node_i = nodes.begin(); node_i != nodes.end(); node_i++) { - bool current_state = transaction->is_active(*node_i); - bool new_state = (*node_i)->test_active(transaction); - if (current_state != new_state) { - transaction->set_active(*node_i, new_state); - } - } - - CYG_REPORT_RETURN(); -} - -// ---------------------------------------------------------------------------- - -void -CdlLoadableBody::unbind(CdlTransaction transaction) -{ - CYG_REPORT_FUNCNAME("CdlLoadable::unbind"); - CYG_REPORT_FUNCARG2XV(this, transaction); - CYG_PRECONDITION_THISC(); - CYG_PRECONDITION_CLASSC(transaction); - - // First take care of all references to nodes in the loadable - // that is disappearing. This involves a Destroyed update. - const std::vector& nodes = this->get_owned(); - std::vector::const_iterator node_i; - for (node_i = nodes.begin(); node_i != nodes.end(); node_i++) { - // The update will remove referrer objects, so it is best - // to work from the back. - std::vector& referrers = (*node_i)->referrers; - std::vector::reverse_iterator ref_i; - for (ref_i = referrers.rbegin(); ref_i != referrers.rend(); ref_i = referrers.rbegin()) { - ref_i->update(transaction, *node_i, CdlUpdate_Destroyed); - CYG_LOOP_INVARIANT(ref_i != referrers.rbegin(), "the vector should have shrunk"); - } - } - - // Now repeat the loop, but unbind references from the unloaded objects - // to ones which are going to stay loaded. This will not cause - // the properties to disappear. - for (node_i = nodes.begin(); node_i != nodes.end(); node_i++) { - const std::vector& properties = (*node_i)->get_properties(); - std::vector::const_iterator prop_i; - for (prop_i = properties.begin(); prop_i != properties.end(); prop_i++) { - (*prop_i)->update(transaction, *node_i, 0, CdlUpdate_Unloading); - } - } - - // Eliminate any conflicts that belong to this loadable. - // FIXME: why is his necessary? Should these conflicts not get - // eliminated by the above property iterations? - std::list::const_iterator conf_i; - const std::list& global_conflicts = toplevel->get_all_conflicts(); - for (conf_i = global_conflicts.begin(); conf_i != global_conflicts.end(); ) { - CdlConflict conflict = *conf_i++; - CYG_LOOP_INVARIANT_CLASSC(conflict); - CdlNode node = conflict->get_node(); - if ((node->get_owner() == this) && !transaction->has_conflict_been_cleared(conflict)) { - transaction->clear_conflict(conflict); - } - } - const std::list& global_structural_conflicts = toplevel->get_all_structural_conflicts(); - for (conf_i = global_structural_conflicts.begin(); conf_i != global_structural_conflicts.end(); ) { - CdlConflict conflict = *conf_i++; - CYG_LOOP_INVARIANT_CLASSC(conflict); - CdlNode node = conflict->get_node(); - if ((node->get_owner() == this) && !transaction->has_conflict_been_cleared(conflict)) { - transaction->clear_conflict(conflict); - } - } - const std::list& transaction_conflicts = transaction->get_new_conflicts(); - for (conf_i = transaction_conflicts.begin(); conf_i != transaction_conflicts.end(); ) { - CdlConflict conflict = *conf_i++; - CYG_LOOP_INVARIANT_CLASSC(conflict); - CdlNode node = conflict->get_node(); - if (node->get_owner() == this) { - transaction->clear_conflict(conflict); - } - } - const std::list& transaction_structural_conflicts = transaction->get_new_structural_conflicts(); - for (conf_i = transaction_structural_conflicts.begin(); conf_i != transaction_structural_conflicts.end(); ) { - CdlConflict conflict = *conf_i++; - CYG_LOOP_INVARIANT_CLASSC(conflict); - CdlNode node = conflict->get_node(); - if (node->get_owner() == this) { - transaction->clear_conflict(conflict); - } - } - - // FIXME: how about cleanup_orphans() - - CYG_REPORT_RETURN(); -} - -// ---------------------------------------------------------------------------- -// These members are invoked for load and unload operations. -// -// Committing a load does not require anything, the loadable has -// already been fully bound and all propagation has happened. - -void -CdlLoadableBody::transaction_commit_load(CdlTransaction transaction, CdlLoadable loadable) -{ - CYG_REPORT_FUNCNAME("CdlLoadable::transaction_commit_load"); - CYG_REPORT_FUNCARG2XV(transaction, loadable); - CYG_PRECONDITION_CLASSC(transaction); - CYG_PRECONDITION_CLASSC(loadable); - - CYG_UNUSED_PARAM(CdlTransaction, transaction); - CYG_UNUSED_PARAM(CdlLoadable, loadable); - - CYG_REPORT_RETURN(); -} - -// Cancelling a load is more difficult. The loadable has to be -// unbound, removed from the toplevel, and deleted. If any of -// this fails then we are in trouble, there is no easy way to -// recover. -void -CdlLoadableBody::transaction_cancel_load(CdlTransaction transaction, CdlLoadable loadable) -{ - CYG_REPORT_FUNCNAME("CdlLoadable::transaction_cancel_load"); - CYG_REPORT_FUNCARG2XV(transaction, loadable); - CYG_PRECONDITION_CLASSC(transaction); - CYG_PRECONDITION_CLASSC(loadable); - - CdlToplevel toplevel = transaction->get_toplevel(); - CYG_PRECONDITION_CLASSC(toplevel); - CYG_ASSERTC(toplevel == loadable->get_toplevel()); - - loadable->unbind(transaction); - toplevel->remove_loadable_from_toplevel(loadable); - delete loadable; - - CYG_REPORT_RETURN(); -} - -// Committing an unload means that the loadable can now be deleted. -// It should already be unbound and removed from the toplevel. -void -CdlLoadableBody::transaction_commit_unload(CdlTransaction transaction, CdlLoadable loadable) -{ - CYG_REPORT_FUNCNAME("CdlLoadable::transaction_commit_unload"); - CYG_REPORT_FUNCARG2XV(transaction, loadable); - CYG_PRECONDITION_CLASSC(transaction); - CYG_PRECONDITION_CLASSC(loadable); - - CYG_UNUSED_PARAM(CdlTransaction, transaction); - delete loadable; - - CYG_REPORT_RETURN(); -} - -// Cancelling an unload means that the loadable has to be re-added -// to the hierarchy and then rebound. This implies that value -// propagation needs to happen. However, since all value changes -// since the very start of the transaction are held inside the -// transaction and will be eliminated, the original state will -// be restored anyway so the propagation is not actually required. -void -CdlLoadableBody::transaction_cancel_unload(CdlTransaction transaction, CdlLoadable loadable) -{ - CYG_REPORT_FUNCNAME("CdlLoadable::transaction_cancel_unload"); - CYG_REPORT_FUNCARG2XV(transaction, loadable); - CYG_PRECONDITION_CLASSC(transaction); - CYG_PRECONDITION_CLASSC(loadable); - - CdlToplevel toplevel = transaction->get_toplevel(); - CYG_PRECONDITION_CLASSC(toplevel); - toplevel->add_loadable_to_toplevel(loadable); - CYG_ASSERT_CLASSC(loadable); - loadable->bind(transaction); - - CYG_REPORT_RETURN(); -} - -//}}} -//{{{ File search facilities - -// ---------------------------------------------------------------------------- -// File search facilities. Given a file name such as hello.cxx from a compile -// property, or doc.html from a doc property, find the corresponding filename, -// for example /usr/local/eCos/kernel/v1_3/doc/threads.html#create -// -// The second argument (default value "") indicates a preferred directory -// where searching should begin. This would be src for a source file, -// doc for a URL, etc. -// -// For some properties the data may refer to a URL rather than to a local -// filename. This is controlled by the third argument, allow_urls. -// If false then only local filenames will be considered. allow_urls -// also controls whether or not anchor processing is performed. -// -// RFC1807: a URL consists of :, where can be -// any sequence of lower-case letters, digits, plus, dot or hyphen. It -// is recommended that upper-case letters should be accepted as well. -// -// RFC1807: an anchor is everything after the first # in the URL. - -static char find_absolute_file_script[] = " \n\ -set cdl_anchor \"\" \n\ -if {$::cdl_allow_urls} { \n\ - if { [regexp -- {^[a-zA-Z+.-]*:.*$} $::cdl_target] } { \n\ - return $::cdl_target \n\ - } \n\ - set tmp \"\" \n\ - set non_anchor \"\" \n\ - if { [regexp -- {^([^#])(#.*$)} $::cdl_target tmp non_anchor cdl_anchor] } { \n\ - set ::cdl_target $non_anchor \n\ - } \n\ -} \n\ -if {$::cdl_prefdir != \"\"} { \n\ - set filename [file join $::cdl_topdir $::cdl_pkgdir $::cdl_prefdir $::cdl_target] \n\ - if {[file exists $filename]} { \n\ - return \"[set filename][set cdl_anchor]\" \n\ - } \n\ -} \n\ -set filename [file join $::cdl_topdir $::cdl_pkgdir $::cdl_target] \n\ -if {[file exists $filename]} { \n\ - return \"[set filename][set cdl_anchor]\" \n\ -} \n\ -return \"\" \n\ -"; - -std::string -CdlLoadableBody::find_absolute_file(std::string filename, std::string dirname, bool allow_urls) const -{ - CYG_REPORT_FUNCNAME("CdlLoadable::find_absolute_file"); - CYG_REPORT_FUNCARG1XV(this); - CYG_PRECONDITION_THISC(); - CYG_PRECONDITIONC("" != filename); - - // These variable names should be kept in step with CdlBuildable::update_all_build_info() - interp->set_variable("::cdl_topdir", repository); - interp->set_variable("::cdl_pkgdir", directory); - interp->set_variable("::cdl_prefdir", dirname); - interp->set_variable("::cdl_target", filename); - interp->set_variable("::cdl_allow_urls", allow_urls ? "1" : "0"); - - std::string result; - int tmp = interp->eval(find_absolute_file_script, result); - if (tmp != TCL_OK) { - result = ""; - } - - // Replace any backslashes in the repository with forward slashes. - // The latter are used throughout the library - // NOTE: this is not i18n-friendly. - for (unsigned int i = 0; i < result.size(); i++) { - if ('\\' == result[i]) { - result[i] = '/'; - } - } - - CYG_REPORT_RETURN(); - return result; -} - -static char find_relative_file_script[] = " \n\ -if {$::cdl_prefdir != \"\"} { \n\ - set filename [file join $::cdl_prefdir $::cdl_target] \n\ - if {[file exists [file join $::cdl_topdir $::cdl_pkgdir $filename]]} { \n\ - return $filename \n\ - } \n\ -} \n\ -set filename $::cdl_target \n\ -if {[file exists [file join $::cdl_topdir $::cdl_pkgdir $filename]]} { \n\ - return \"[set filename][set cdl_anchor]\" \n\ -} \n\ -return \"\" \n\ -"; - -std::string -CdlLoadableBody::find_relative_file(std::string filename, std::string dirname) const -{ - CYG_REPORT_FUNCNAME("CdlLoadable::find_relative_file"); - CYG_REPORT_FUNCARG1XV(this); - CYG_PRECONDITION_THISC(); - CYG_PRECONDITIONC("" != filename); - - // These variable names should be kept in step with CdlBuildable::update_all_build_info() - interp->set_variable("::cdl_topdir", repository); - interp->set_variable("::cdl_pkgdir", directory); - interp->set_variable("::cdl_prefdir", dirname); - interp->set_variable("::cdl_target", filename); - - std::string result; - int tmp = interp->eval(find_relative_file_script, result); - if (tmp != TCL_OK) { - result = ""; - } - - // Replace any backslashes in the repository with forward slashes. - // The latter are used throughout the library - // NOTE: this is not i18n-friendly. - for (unsigned int i = 0; i < result.size(); i++) { - if ('\\' == result[i]) { - result[i] = '/'; - } - } - - CYG_REPORT_RETURN(); - return result; -} - -static char has_subdirectory_script[] = " \n\ -set dirname [file join $::cdl_topdir $::cdl_pkgdir $::cdl_target] \n\ -if {[file isdirectory $dirname] == 0} { \n\ - return 0 \n\ -} \n\ -return 1 \n\ -"; - -bool -CdlLoadableBody::has_subdirectory(std::string name) const -{ - CYG_REPORT_FUNCNAMETYPE("CdlLoadable::has_subdirectory", "result %d"); - CYG_REPORT_FUNCARG1XV(this); - CYG_PRECONDITION_THISC(); - CYG_PRECONDITIONC("" != name); - - bool result = false; - - interp->set_variable("::cdl_topdir", repository); - interp->set_variable("::cdl_pkgdir", directory); - interp->set_variable("::cdl_target", name); - - std::string tcl_result; - int tmp = interp->eval(has_subdirectory_script, tcl_result); - if ((TCL_OK == tmp) && ("1" == tcl_result)) { - result = true; - } - - CYG_REPORT_RETVAL(result); - return result; -} - -//}}} -//{{{ Misc - -// ---------------------------------------------------------------------------- - -std::string -CdlLoadableBody::get_class_name() const -{ - CYG_REPORT_FUNCNAME("CdlLoadable::get_class_name"); - CYG_PRECONDITION_THISC(); - CYG_REPORT_RETURN(); - return "loadable"; -} - -//}}} -//{{{ check_this() - -// ---------------------------------------------------------------------------- -bool -CdlLoadableBody::check_this(cyg_assert_class_zeal zeal) const -{ - if (CdlLoadableBody_Magic != cdlloadablebody_cookie) { - return false; - } - CYGDBG_MEMLEAK_CHECKTHIS(); - - if ((zeal == cyg_extreme) || (zeal == cyg_thorough)) { - std::vector::const_iterator node_i; - for (node_i = owned.begin(); node_i != owned.end(); node_i++) { - if ((!(*node_i)->check_this(cyg_quick)) || ((*node_i)->get_owner() != this)) { - return false; - } - } - } - return CdlContainerBody::check_this(zeal); -} - -//}}} - -//}}} -//{{{ CdlToplevelBody - -//{{{ Constructor - -// ---------------------------------------------------------------------------- -// A toplevel is a container without a parent or owner. It keeps track -// of all the names in the hierarchy, thus guaranteeing uniqueness and -// providing a quick lookup facility. -// -// The member functions add_node() and remove_node() are the only -// way of modifying the hierarchy. Adding a node with a zero parent -// means adding it to a special container, Orphans. -// -// An interpreter object must be created explicitly, preventing -// toplevel objects from being statically allocated (although -// it is possible to play tricks with utility classes...) -// There are too many possible error conditions when creating -// an interpreter, so this should not happen until the world -// is ready to deal with such errors. - -CdlToplevelBody::CdlToplevelBody(CdlInterpreter interp_arg) - : CdlContainerBody() -{ - CYG_REPORT_FUNCNAME("CdlToplevel:: constructor"); - CYG_REPORT_FUNCARG2XV(this, interp_arg); - CYG_PRECONDITION_CLASSC(interp_arg); - - // The STL containers will take care of themselves. - interp = interp_arg; - transaction = 0; - - // A toplevel is always active, override the default setting for a node - active = true; - - // Make the object valid before creating the orphans container. - orphans = 0; - description = ""; - cdltoplevelbody_cookie = CdlToplevelBody_Magic; - - // Arguably creating the orphans container should be left until - // it is actually needed. The advantage of creating it at the - // start is that it will appear in a fixed location in the contents, - // right at the start. Arguably the end would be better, but the - // end can move as loadables get added and removed. - // - // The GUI code will probably want to ignore any empty - // containers that are not valuables and not user-visible. - orphans = new CdlContainerBody("orphans"); - add_node(0, this, orphans); - - // Let the interpreter know about its owning toplevel, as well as - // vice versa. - interp->set_toplevel(this); - - // The orphans container needs to be active as well. - orphans->active = true; - - CYGDBG_MEMLEAK_CONSTRUCTOR(); - - CYG_POSTCONDITION_THISC(); - CYG_REPORT_RETURN(); -} - -//}}} -//{{{ Destructor - -// ---------------------------------------------------------------------------- -// The toplevel should have been mostly cleared already, by the -// appropriate derived class. Without any loadables there should not -// be any conflicts. It is necessary to clean up the orphans -// container, since that was created by the CdlToplevel constructor. -// If there are any other special nodes then these should have been -// cleared by higher level code. - -CdlToplevelBody::~CdlToplevelBody() -{ - CYG_REPORT_FUNCNAME("CdlToplevel:: destructor"); - CYG_REPORT_FUNCARG1XV(this); - CYG_PRECONDITION_THISC(); - - CYG_PRECONDITIONC(0 == loadables.size()); - CYG_PRECONDITIONC(0 == conflicts.size()); - CYG_PRECONDITIONC(0 == structural_conflicts.size()); - CYG_PRECONDITIONC(0 == transaction); - - CYG_PRECONDITIONC(0 != orphans); - this->remove_node_from_toplevel(orphans); - CdlToplevelBody::remove_node(0, this, orphans); - delete orphans; - orphans = 0; - - CYG_PRECONDITIONC(0 == contents.size()); - - cdltoplevelbody_cookie = CdlToplevelBody_Magic; - description = ""; - limbo.clear(); - unsupported_savefile_toplevel_strings.clear(); - unsupported_savefile_commands.clear(); - unsupported_savefile_subcommands.clear(); - - // Since the interpreter is not created by the toplevel, it is - // not destroyed with the toplevel either. This leaves a potential - // big memory leak in application code. - interp = 0; - - CYGDBG_MEMLEAK_DESTRUCTOR(); - - CYG_REPORT_RETURN(); -} - -//}}} -//{{{ Adding and removing nodes - -// ---------------------------------------------------------------------------- -// Adding and removing a node, and changing a parent. -// -// These routines allow the hierarchy to be manipulated. All nodes should -// exist in a hierarchy below a toplevel, except for brief periods after -// construction and during destruction. -// -// Most nodes will belong to a loadable. An owner of 0 is allowed, for -// objects internal to the library such as the orphans container. -// Everything else must have an owner, and specifically a loadable owns -// itself. - -void -CdlToplevelBody::add_node(CdlLoadable owner, CdlContainer parent, CdlNode node) -{ - CYG_REPORT_FUNCNAME("CdlToplevel::add_node"); - CYG_REPORT_FUNCARG4XV(this, owner, parent, node); - CYG_PRECONDITION_THISC(); - CYG_PRECONDITION_ZERO_OR_CLASSC(owner); - CYG_PRECONDITION_CLASSC(parent); - CYG_PRECONDITION_CLASSC(node); - - // The node must not be in the hierarchy already. - CYG_ASSERTC(0 == node->toplevel); - CYG_ASSERTC(0 == node->owner); - CYG_ASSERTC(0 == node->parent); - - // The node's name should be unique. Checks for that should have happened - // in higher-level code. - CYG_ASSERTC(lookup_table.find(node->name) == lookup_table.end()); - node->toplevel = this; - lookup_table[node->name] = node; - - node->owner = owner; - if (0 != owner) { - owner->owned.push_back(node); - } - - // If the node is in fact a loadable, it should own itself and - // in addition the toplevel class keeps track of its loadables - // in a separate vector. - if (0 != dynamic_cast(node)) { - CYG_ASSERTC(owner == dynamic_cast(node)); - this->loadables.push_back(owner); - } - - if (0 == parent) { - parent = orphans; - } - node->parent = parent; - parent->contents.push_back(node); - - CYG_REPORT_RETURN(); -} - -// Removing a node from a toplevel. This is the first step in deleting -// a node: the step may be undone by a call to add_node_to_toplevel(), -// or completed by a call to remove_node(). Removing a node from the -// toplevel involves undoing the name->node mapping. In the case -// of loadables, it also involves removing the node from the toplevel's -// contents and loadables containers. - -void -CdlToplevelBody::remove_node_from_toplevel(CdlNode node) -{ - CYG_REPORT_FUNCNAME("CdlToplevel::remove_node_from_toplevel"); - CYG_REPORT_FUNCARG2XV(this, node); - CYG_PRECONDITION_THISC(); - CYG_PRECONDITION_CLASSC(node); - CYG_ASSERTC(this == node->toplevel); - CYG_ASSERTC(lookup_table[node->name] == node); - - node->toplevel = 0; - lookup_table.erase(node->name); - - CdlLoadable loadable = dynamic_cast(node); - if (0 != loadable) { - CYG_ASSERTC(loadable == node->owner); - CYG_ASSERTC(this == node->parent); - - // Because remove_node_from_toplevel() is reversible, the - // loadable should reappear in its old position. Hence we - // had better keep track of that position. Note that - // this code assumed that the remove_node and add_node - // calls are exactly reversed. - int i; - for (i = 0; i < (int) this->contents.size(); i++) { - if (this->contents[i] == node) { - break; - } - } - CYG_ASSERTC(i < (int) this->contents.size()); - node->remove_node_container_position = i; - this->contents.erase(this->contents.begin() + i); - node->parent = 0; - - // It is not clear that preserving the order of the loadables - // in the toplevel is useful, but it is harmless. - for (i = 0; i < (int) this->loadables.size(); i++) { - if (this->loadables[i] == loadable) { - break; - } - } - CYG_ASSERTC(i < (int) this->loadables.size()); - loadable->remove_node_loadables_position = i; - this->loadables.erase(this->loadables.begin() + i); - } - - CYG_REPORT_RETURN(); -} - -void -CdlToplevelBody::remove_loadable_from_toplevel(CdlLoadable loadable) -{ - CYG_REPORT_FUNCNAME("CdlToplevel::remove_loadable_from_toplevel"); - CYG_REPORT_FUNCARG2XV(this, loadable); - CYG_PRECONDITION_THISC(); - CYG_PRECONDITION_CLASSC(loadable); - - const std::vector& contents = loadable->get_owned(); - for (int i = contents.size() - 1; i >= 0; i--) { - CdlToplevel toplevel = contents[i]->get_toplevel(); - CYG_LOOP_INVARIANT_ZERO_OR_CLASSC(toplevel); - if (0 != toplevel) { - CYG_LOOP_INVARIANTC(this == toplevel); - this->remove_node_from_toplevel(contents[i]); - } - } - - CYG_REPORT_RETURN(); -} - -// Re-adding a node to a toplevel. This needs to undo all of the changes -// that may have been done by remove_node_from_toplevel() above. -void -CdlToplevelBody::add_node_to_toplevel(CdlNode node) -{ - CYG_REPORT_FUNCNAME("CdlToplevel::add_node_to_toplevel"); - CYG_REPORT_FUNCARG2XV(this, node); - CYG_PRECONDITION_THISC(); - CYG_PRECONDITION_CLASSC(node); - CYG_ASSERTC(0 == node->toplevel); - CYG_ASSERTC(0 != node->owner); - - CYG_ASSERTC(lookup_table.find(node->name) == lookup_table.end()); - node->toplevel = this; - lookup_table[node->name] = node; - - CdlLoadable loadable = dynamic_cast(node); - if (0 != loadable) { - CYG_ASSERTC(loadable == node->owner); - CYG_ASSERTC(0 == node->parent); - CYG_ASSERTC(-1 != node->remove_node_container_position); - CYG_ASSERTC(node->remove_node_container_position <= (int) this->contents.size()); - - this->contents.insert(this->contents.begin() + node->remove_node_container_position, node); - node->remove_node_container_position = -1; - node->parent = this; - - CYG_ASSERTC(-1 != loadable->remove_node_loadables_position); - this->loadables.insert(this->loadables.begin() + loadable->remove_node_loadables_position, loadable); - loadable->remove_node_loadables_position = -1; - } - - CYG_REPORT_RETURN(); -} - -void -CdlToplevelBody::add_loadable_to_toplevel(CdlLoadable loadable) -{ - CYG_REPORT_FUNCNAME("CdlToplevel::add_loadable_to_toplevel"); - CYG_REPORT_FUNCARG2XV(this, loadable); - CYG_PRECONDITION_THISC(); - CYG_PRECONDITION_CLASSC(loadable); - - const std::vector& contents = loadable->get_owned(); - for (int i = 0; i < (int) contents.size(); i++) { - this->add_node_to_toplevel(contents[i]); - } - - CYG_REPORT_RETURN(); -} - -// ---------------------------------------------------------------------------- -// The second stage remove operation. This cannot be undone, and -// happens just before the node gets deleted and after a succesful -// remove_node_from_toplevel(). -void -CdlToplevelBody::remove_node(CdlLoadable owner, CdlContainer parent, CdlNode node) -{ - CYG_REPORT_FUNCNAME("CdlToplevel::remove_node"); - CYG_REPORT_FUNCARG3XV(owner, parent, node); - CYG_PRECONDITION_CLASSC(node); - CYG_PRECONDITION_ZERO_OR_CLASSC(owner); - CYG_PRECONDITION_ZERO_OR_CLASSC(parent); - CYG_PRECONDITIONC(node->owner == owner); - CYG_PRECONDITIONC(node->parent == parent); - CYG_PRECONDITIONC(0 == node->toplevel); - - if (0 != owner) { - node->owner = 0; - owner->owned.erase(std::find(owner->owned.begin(), owner->owned.end(), node)); - } - if (0 != parent) { - node->parent = 0; - parent->contents.erase(std::find(parent->contents.begin(), parent->contents.end(), node)); - } - - CYG_REPORT_RETURN(); -} - -// Changing a parent does not affect the node's standing in terms of the -// overall hierarchy or its owner, only the parent field. -void -CdlToplevelBody::change_parent(CdlLoadable owner, CdlContainer old_parent, CdlContainer new_parent, CdlNode node, int pos) -{ - CYG_REPORT_FUNCNAME("CdlToplevel::change_parent"); - CYG_REPORT_FUNCARG6XV(this, owner, parent, new_parent, node, pos); - CYG_PRECONDITION_THISC(); - CYG_PRECONDITION_CLASSC(old_parent); - CYG_PRECONDITION_ZERO_OR_CLASSC(new_parent); - CYG_PRECONDITION_CLASSC(node); - CYG_PRECONDITIONC(node->owner == owner); - CYG_PRECONDITIONC(node->parent == old_parent); - CYG_PRECONDITIONC(this == node->toplevel); - CYG_PRECONDITIONC(lookup_table[node->name] == node); - - if (0 == new_parent) { - new_parent = orphans; - } - old_parent->contents.erase(std::find(old_parent->contents.begin(), old_parent->contents.end(), node)); - node->parent = 0; - - if (-1 == pos) { - new_parent->contents.push_back(node); - } else { - CYG_ASSERTC(pos <= (int) new_parent->contents.size()); - new_parent->contents.insert(new_parent->contents.begin() + pos, node); - } - node->parent = new_parent; - - CYG_REPORT_RETURN(); -} - -// Cleaning up orphans. -// -// Right now this is only relevant for interfaces. Consider the case -// where a loadable is being removed and that loadable defines an -// interface. There may be other loadables which still have -// "implements" properties affecting that interface, so instead of -// deleting the cdl_interface object it is necessary to turn it into -// an auto-generated orphan. At some stage there may no longer be -// any references to an interface, in which case it can be removed -// safely. -// -// In practice it is quite hard to do a clean-up purely on the basis -// of implements properties, for example there may be an external -// "requires" property as well which would need to have its references -// cleaned up, then the expression needs to get re-evaluated, etc. -// The transaction class does not currently provide a clean way -// in which a single object can be destroyed. Instead the code below -// checks for any references whose source is not the interface itself. - -void -CdlToplevelBody::cleanup_orphans() -{ - CYG_REPORT_FUNCNAME("CdlToplevel::cleanup_orphans"); - CYG_REPORT_FUNCARG1XV(this); - CYG_PRECONDITION_THISC(); - - // First figure out whether or not there are any interfaces along - // these lines. - std::vector interfaces; - const std::vector& contents = orphans->get_contents(); - std::vector::const_iterator node_i; - - for (node_i = contents.begin(); node_i != contents.end(); node_i++) { - CdlInterface intface = dynamic_cast(*node_i); - if (0 == intface) { - continue; - } - const std::vector& referrers = intface->get_referrers(); - std::vector::const_iterator ref_i; - for (ref_i = referrers.begin(); ref_i != referrers.end(); ref_i++) { - if (ref_i->get_source() != intface) { - break; - } - } - if (ref_i == referrers.end()) { - // None of the existing references involve an "implements" property, so - // this interface can be deleted. - interfaces.push_back(intface); - } - } - - if (0 != interfaces.size()) { - CYG_FAIL("Not yet implemented"); - } -} - -//}}} -//{{{ Basic information - -// ---------------------------------------------------------------------------- - -const std::vector& -CdlToplevelBody::get_loadables() const -{ - CYG_REPORT_FUNCNAMETYPE("CdlToplevel::get_loadables", "result %p"); - CYG_REPORT_FUNCARG1XV(this); - CYG_PRECONDITION_THISC(); - - const std::vector& result = loadables; - CYG_REPORT_RETVAL(&result); - return result; -} - - -CdlNode -CdlToplevelBody::lookup(const std::string name) const -{ - CYG_REPORT_FUNCNAMETYPE("CdlToplevel::lookup", "result %p"); - CYG_REPORT_FUNCARG1XV(this); - CYG_PRECONDITION_THISC(); - CYG_PRECONDITIONC("" != name); - - CdlNode result = 0; - std::map::const_iterator i = lookup_table.find(name); - if (i != lookup_table.end()) { - result = i->second; - } - - CYG_REPORT_RETVAL(result); - return result; -} - -CdlInterpreter -CdlToplevelBody::get_interpreter() const -{ - CYG_REPORT_FUNCNAMETYPE("CdlToplevel::get_interpreter", "result %p"); - CYG_REPORT_FUNCARG1XV(this); - CYG_PRECONDITION_THISC(); - - CdlInterpreter result = interp; - CYG_REPORT_RETVAL(result); - return result; -} - -std::string -CdlToplevelBody::get_description() const -{ - CYG_REPORT_FUNCNAME("CdlToplevel::get_description"); - CYG_REPORT_FUNCARG1XV(this); - CYG_PRECONDITION_THISC(); - - CYG_REPORT_RETURN(); - return description; -} - -void -CdlToplevelBody::set_description(std::string new_description) -{ - CYG_REPORT_FUNCNAME("CdlToplevel::set_description"); - CYG_REPORT_FUNCARG1XV(this); - CYG_PRECONDITION_THISC(); - - description = new_description; - - CYG_REPORT_RETURN(); -} - -std::string -CdlToplevelBody::get_class_name() const -{ - CYG_REPORT_FUNCNAME("CdlToplevel::get_class_name"); - CYG_PRECONDITION_THISC(); - CYG_REPORT_RETURN(); - return "toplevel"; -} - -CdlTransaction -CdlToplevelBody::get_active_transaction() const -{ - CYG_REPORT_FUNCNAMETYPE("CdlToplevel::get_active_transaction", "result %p"); - CYG_REPORT_FUNCARG1XV(this); - CYG_PRECONDITION_THISC(); - - CdlTransaction result = transaction; - CYG_REPORT_RETVAL(result); - return result; -} - -//}}} -//{{{ Conflict support - -// ---------------------------------------------------------------------------- -const std::list& -CdlToplevelBody::get_all_conflicts() const -{ - CYG_REPORT_FUNCNAME("CdlToplevel::get_all_conflicts"); - CYG_REPORT_FUNCARG1XV(this); - CYG_PRECONDITION_THISC(); - - const std::list& result = conflicts; - - CYG_REPORT_RETURN(); - return result; -} - -const std::list& -CdlToplevelBody::get_all_structural_conflicts() const -{ - CYG_REPORT_FUNCNAME("CdlToplevel::get_all_structural_conflicts"); - CYG_REPORT_FUNCARG1XV(this); - CYG_PRECONDITION_THISC(); - - const std::list& result = structural_conflicts; - - CYG_REPORT_RETURN(); - return result; -} - -// ---------------------------------------------------------------------------- -// Resolve one or more conflicts. This involves creating a new transaction, -// invoking the per-transaction resolve code, and then CdlTransaction::body() -// takes care of everything else like propagation, further inference, -// callbacks, committing, ... -void -CdlToplevelBody::resolve_conflicts(const std::vector& conflicts_arg) -{ - CYG_REPORT_FUNCNAME("CdlToplevel::resolve_conflicts"); - CYG_REPORT_FUNCARG1XV(this); - CYG_PRECONDITION_THISC(); - - CdlTransaction transact = CdlTransactionBody::make(this); - - std::vector::const_iterator conf_i; - for (conf_i = conflicts_arg.begin(); conf_i != conflicts_arg.end(); conf_i++) { - CYG_LOOP_INVARIANT_CLASSC(*conf_i); - CYG_LOOP_INVARIANTC(0 == (*conf_i)->get_transaction()); - - if (((*conf_i)->resolution_implemented()) && - !transact->has_conflict_been_cleared(*conf_i) && - !(*conf_i)->has_known_solution() && - !(*conf_i)->has_no_solution() ) { - transact->resolve(*conf_i); - } - } - transact->body(); - delete transact; - - CYG_REPORT_RETURN(); -} - -void -CdlToplevelBody::resolve_all_conflicts() -{ - CYG_REPORT_FUNCNAME("CdlToplevel::resolve_all_conflicts"); - CYG_REPORT_FUNCARG1XV(this); - CYG_PRECONDITION_THISC(); - - CdlTransaction transact = CdlTransactionBody::make(this); - std::list::const_iterator conf_i; - - for (conf_i = conflicts.begin(); conf_i != conflicts.end(); conf_i++) { - CYG_LOOP_INVARIANT_CLASSC(*conf_i); - CYG_LOOP_INVARIANTC(0 == (*conf_i)->get_transaction()); - if ((*conf_i)->resolution_implemented() && - !transact->has_conflict_been_cleared(*conf_i) && - !(*conf_i)->has_known_solution() && - !(*conf_i)->has_no_solution() ) { - transact->resolve(*conf_i); - } - } - for (conf_i = structural_conflicts.begin(); conf_i != structural_conflicts.end(); conf_i++) { - CYG_LOOP_INVARIANT_CLASSC(*conf_i); - CYG_LOOP_INVARIANTC(0 == (*conf_i)->get_transaction()); - if (((*conf_i)->resolution_implemented()) && - !transact->has_conflict_been_cleared(*conf_i) && - !(*conf_i)->has_known_solution() && - !(*conf_i)->has_no_solution() ) { - transact->resolve(*conf_i); - } - } - - transact->body(); - delete transact; - - CYG_REPORT_RETURN(); -} - -//}}} -//{{{ Limbo support - -// ---------------------------------------------------------------------------- -// Limbo support. This is basically trivial, an STL map does all the -// right things. -void -CdlToplevelBody::set_limbo_value(CdlValuable valuable) -{ - CYG_REPORT_FUNCNAME("CdlToplevel::set_limbo_value"); - CYG_REPORT_FUNCARG2XV(this, valuable); - CYG_PRECONDITION_THISC(); - CYG_PRECONDITION_CLASSC(valuable); - - limbo[valuable->get_name()] = valuable->get_whole_value(); - - CYG_REPORT_RETURN(); -} - -bool -CdlToplevelBody::has_limbo_value(std::string name) const -{ - CYG_REPORT_FUNCNAMETYPE("CdlToplevel::has_limbo_value", "result %d"); - CYG_REPORT_FUNCARG1XV(this); - CYG_PRECONDITION_THISC(); - CYG_PRECONDITIONC("" != name); - - bool result = false; - if (limbo.find(name) != limbo.end()) { - result = true; - } - - CYG_REPORT_RETVAL(result); - return result; -} - -CdlValue -CdlToplevelBody::get_limbo_value(std::string name) const -{ - CYG_REPORT_FUNCNAME("CdlToplevel::get_limbo_value"); - CYG_REPORT_FUNCARG1XV(this); - CYG_PRECONDITION_THISC(); - CYG_PRECONDITIONC("" != name); - - std::map::const_iterator limbo_i = limbo.find(name); - CYG_ASSERTC(limbo_i != limbo.end()); - - CYG_REPORT_RETURN(); - return limbo_i->second; -} - -CdlValue -CdlToplevelBody::get_and_remove_limbo_value(std::string name) -{ - CYG_REPORT_FUNCNAME("CdlToplevel::get_and_remove_limbo_value"); - CYG_REPORT_FUNCARG1XV(this); - CYG_PRECONDITION_THISC(); - CYG_PRECONDITIONC("" != name); - - std::map::iterator limbo_i = limbo.find(name); - CYG_ASSERTC(limbo_i != limbo.end()); - - CdlValue local_copy = limbo_i->second; - limbo.erase(limbo_i); - - CYG_REPORT_RETURN(); - return local_copy; -} - -void -CdlToplevelBody::clear_limbo() -{ - CYG_REPORT_FUNCNAME("CdlToplevel::clear_limbo"); - CYG_REPORT_FUNCARG1XV(this); - CYG_PRECONDITION_THISC(); - - limbo.clear(); - - CYG_REPORT_RETURN(); -} - -//}}} -//{{{ Persistence support - -//{{{ Description - -// ---------------------------------------------------------------------------- -// Toplevels do not have any data specifically associated with them which -// should go into savefiles (not quite true, there is a description field, -// but that can be handled easily by the derived classes). -// -// However there is a need in the library for some generic savefile support: -// -// 1) it is an important goal that savefiles should be self-describing. -// This is handled by having a header section at the start of each -// savefile which describes what commands will appear in the savefile -// (note that savefiles are actually just Tcl scripts). In addition -// each savefile contains a version number so that individual commands -// can detect and adapt to older versions of the library. -// -// 2) savefiles should also be extensible, so for example a GUI tool should -// be able to add its own information. This can be toplevel information, -// i.e. a new command that gets executed at the savefile's toplevel, -// or it can be a subcommand extending an existing command such as -// cdl_option. Right now only one level of nesting is available, but -// this should suffice. -// -// 3) extensibility means that the application reading in a savefile may -// not support the same set of commands as the application that generated -// the savefile. Care is taken to avoid loss of data. However exact -// ordering is not guaranteed to be preserved, and neither is formatting. -// -// These needs are interrelated, and supported by the CdlToplevelBody -// class. The functions of interest are: -// -// virtual void initialize_savefile_support() -// This should be called from higher-level code such as -// CdlConfiguration::initialize_savefile_support() at the start of -// any savefile-related operation. -// -// The support operates on a per-application basis rather than a -// per-toplevel basis, in spite of being a virtual member function -// rather than a static. A virtual member function facilitates -// automatic initialization. This causes some problems if you need -// to load in toplevels with different application-specific -// extensions, but it makes life a lot simpler for the application. -// -// static bool savefile_support_initialized() -// Has there been a call to initialize_savefile_support() yet? -// -// virtual void add_savefile_command(std::string, CdlSaveCallback, CdlInterpreterCommand) -// Register a new savefile toplevel command. The string must be a -// valid command name. The callback function will be 0 for savedata -// supported directly by the library, non-zero for application-specific -// data, and is invoked during a save operation to allow application -// code to add extra data to the savefile. The command procedure must -// be provided and is registered with the Tcl interpreter. -// -// virtual void add_savefile_subcommand(std::string cmd, std::string subcommand, CdlSaveCallback, CdlInterpreterCommand) -// Typically savefile commands take the form , -// where contains a set of subcommands. This function is used -// to register a new subcommand. -// -// void save_command_details(CdlInterpreter, Tcl_Channel, int) -// This should be invoked early on when generating a savefile. Its -// purpose is to store information about the current set of savefile -// commands in the savefile, thus making savefiles self-describing. -// This command acts on a per-toplevel basis, since each toplevel -// may have been created via a load operation and hence may contain -// unrecognised commands. -// -// static void get_savefile_commands(std::vector&) -// Work out the set of commands that should be supported by the -// interpreter used to process a savefile. Note that this set gets -// updated magically by savefile_handle_command(). -// -// static void get_savefile_subcommands(std::string, std::vector&) -// Ditto for subcommands. -// -// static int savefile_handle_command(CdlInterpreter, int, char**) -// This implements cdl_savefile_command, and makes sure that -// all of the commands that may be present in the savefile will -// be processed. -// -// static int savefile_handle_unsupported(CdlInterpreter, int, char**) -// This takes care of commands present in the savefile which are -// not supported by the current application. -// -// static int savefile_handle_unknown(CdlInterpreter, int, char**) -// This is an implementation of "unknown" suitable for savefiles. -// All commands that may get used in a savefile should be specified -// via cdl_savefile_command, so an unknown command is an error. -// -// cdl_int get_library_savefile_version() -// Savefiles contain a format version number. This function can be used -// to determine the current version used in the library. -// -// int savefile_handle_version(CdlInterpreter, int, char**) -// This is the implementation of the cdl_savefile_version command. It -// stores the version information in the interpreter, allowing it -// to be retrieved by other commands. -// -// cdl_int get_savefile_version(CdlInterpreter) -// This can be used to retrieve the version number that was present -// in the current savefile. -// -// The version number should not be used for application-specific -// commands. It is possible for a savefile to be read in by a -// different program and then updated: the updated savefile will -// contain the unrecognised commands unchanged, but it will also -// have the version number corresponding to that program rather -// than to the original savefile. -// -// void save_conflicts(CdlInterpreter, Tcl_Channel, int) -// Output details of all the conflicts in the current configuration -// -// void save_separator(CdlInterpreter, Tcl_Channel, int) -// A utility to add a separator line to a savefile. This has to -// go somewhere.... -// -// FIXME: add limbo support - -//}}} -//{{{ Statics and initialization - -// ---------------------------------------------------------------------------- -bool CdlToplevelBody::savefile_commands_initialized = false; -std::vector CdlToplevelBody::savefile_commands; -std::map > CdlToplevelBody::savefile_subcommands; - -void -CdlToplevelBody::initialize_savefile_support() -{ - CYG_REPORT_FUNCNAME("CdlToplevel::initialize_savefile_support"); - CYG_REPORT_FUNCARG1XV(this); - CYG_PRECONDITION_THISC(); - - // This assignment avoids circular dependencies. It is not - // completely accurate but close enough - the full set of - // commands will be initialised shortly. - savefile_commands_initialized = true; - - // The commands cdl_savefile_version and cdl_command are a core - // part of the CDL savefile support. - add_savefile_command("cdl_savefile_version", 0, &savefile_handle_version); - add_savefile_command("cdl_savefile_command", 0, &savefile_handle_command); - - CYG_REPORT_RETURN(); -} - -bool -CdlToplevelBody::savefile_support_initialized() -{ - CYG_REPORT_FUNCNAMETYPE("CdlToplevel::check_savefile_support_initialized", "result %d"); - - bool result = savefile_commands_initialized; - CYG_REPORT_RETVAL(result); - return result; -} - -//}}} -//{{{ Command details - -// ---------------------------------------------------------------------------- -// These routines are used to keep track of the savefile commands that -// are understood by the current application. There may have been -// additional per-toplevel commands when a savefile was read in, but -// these are stored separately. -// -// Currently there is only support for toplevel savefile commands -// and for one level of subcommands. Multiple levels can probably -// be accommodated by using the equivalent of a directory separator -// in the savefile_subcommands map key. - -void -CdlToplevelBody::add_savefile_command(std::string name, CdlSaveCallback save_callback, CdlInterpreterCommand load_command) -{ - CYG_REPORT_FUNCNAME("CdlToplevel::add_savefile_command"); - CYG_REPORT_FUNCARG3XV(this, save_callback, load_command); - CYG_PRECONDITION_THISC(); - CYG_PRECONDITIONC("" != name); - - if (!savefile_commands_initialized) { - this->initialize_savefile_support(); - } - - std::vector::const_iterator cmd_i; - for (cmd_i = savefile_commands.begin(); cmd_i != savefile_commands.end(); cmd_i++) { - if (cmd_i->name == name) { - if ((cmd_i->save_callback != save_callback) || (cmd_i->load_command != load_command)) { - CYG_FAIL("Internal error: attempt to define two toplevel savefile commands with the same name."); - } - break; - } - } - if (cmd_i == savefile_commands.end()) { - CdlSavefileCommand cmd; - cmd.name = name; - cmd.save_callback = save_callback; - cmd.load_command = load_command; - savefile_commands.push_back(cmd); - - std::vector subcommands; - savefile_subcommands[name] = subcommands; - } - - CYG_REPORT_RETURN(); -} - -// Add a new subcommand for a given command. The command should have been -// defined already. -void -CdlToplevelBody::add_savefile_subcommand(std::string cmd, std::string subcommand, CdlSaveCallback save_callback, - CdlInterpreterCommand load_command) -{ - CYG_REPORT_FUNCNAME("CdlToplevel::add_savefile_subcommand"); - CYG_REPORT_FUNCARG3XV(this, save_callback, load_command); - CYG_PRECONDITION_THISC(); - - if (!savefile_commands_initialized) { - this->initialize_savefile_support(); - } - - std::vector::iterator cmd_i; - for (cmd_i = savefile_commands.begin(); cmd_i != savefile_commands.end(); cmd_i++) { - if (cmd_i->name == cmd) { - break; - } - } - CYG_ASSERTC(cmd_i != savefile_commands.end()); - - for (cmd_i = savefile_subcommands[cmd].begin(); cmd_i != savefile_subcommands[cmd].end(); cmd_i++) { - if (cmd_i->name == subcommand) { - if ((cmd_i->save_callback != save_callback) || (cmd_i->load_command != load_command)) { - CYG_FAIL("Internal error: attempt to define two subcommands with the same name."); - } - } - } - if (cmd_i == savefile_subcommands[cmd].end()) { - CdlSavefileCommand new_subcommand; - new_subcommand.name = subcommand; - new_subcommand.save_callback = save_callback; - new_subcommand.load_command = load_command; - savefile_subcommands[cmd].push_back(new_subcommand); - } - - CYG_REPORT_RETURN(); -} - -// ---------------------------------------------------------------------------- -// This member function is invoked by e.g. CdlConfiguraton::save() to -// take care of the generic savefile information, specifically the -// savefile format version number and the various commands and subcommands -// Note that it has to cope with per-toplevel commands from the original -// savefile, as well as the global set. - -void -CdlToplevelBody::save_command_details(CdlInterpreter interp, Tcl_Channel chan, int indentation, bool minimal) -{ - CYG_REPORT_FUNCNAME("CdlToplevel::save_command_details"); - CYG_REPORT_FUNCARG4XV(this, interp, chan, indentation); - CYG_PRECONDITION_THISC(); - CYG_PRECONDITION_CLASSC(interp); - CYG_ASSERTC(0 == indentation); - - // The parent code should have provided the first couple of lines, - // identifying whether this is an eCos configuration or some other - // CDL-based entity. - // - // Immediately after these lines we want a nice big comment - // telling people that they can edit bits of this file, but - // that other bits are automatically generated and will - // be overwritten. - - if (!minimal) { - interp->write_data(chan, -"# This section contains information about the savefile format.\n\ -# It should not be edited. Any modifications made to this section\n\ -# may make it impossible for the configuration tools to read\n\ -# the savefile.\n\ -\n"); - } - - // Next output details of the savefile format version. This allows - // all other code to adapt to the version. - std::string savefile_data; - Cdl::integer_to_string(savefile_version, savefile_data); - savefile_data = "cdl_savefile_version " + savefile_data + ";\n"; - - std::vector::const_iterator cmd_i, cmd_j; - std::vector::const_iterator cmd_k, cmd_l; - - for (cmd_i = savefile_commands.begin(); cmd_i != savefile_commands.end(); cmd_i++) { - savefile_data += "cdl_savefile_command " + cmd_i->name + " "; - - if ((0 == savefile_subcommands[cmd_i->name].size()) && - (0 == this->unsupported_savefile_subcommands[cmd_i->name].size())) { - - savefile_data += "{};\n"; - - } else { - - savefile_data += "{"; - for (cmd_j = savefile_subcommands[cmd_i->name].begin(); - cmd_j != savefile_subcommands[cmd_i->name].end(); - cmd_j++) { - - savefile_data += " " + cmd_j->name; - } - for (cmd_l = this->unsupported_savefile_subcommands[cmd_i->name].begin(); - cmd_l != this->unsupported_savefile_subcommands[cmd_i->name].end(); - cmd_l++) { - - savefile_data += " " + *cmd_l; - } - savefile_data += " };\n"; - } - } - for (cmd_k = this->unsupported_savefile_commands.begin(); - cmd_k != this->unsupported_savefile_commands.end(); - cmd_k++) { - savefile_data += "cdl_savefile_command " + *cmd_k + " "; - if (0 == this->unsupported_savefile_subcommands[*cmd_k].size()) { - - savefile_data += "{};\n"; - - } else { - - savefile_data += "{"; - for (cmd_l = this->unsupported_savefile_subcommands[*cmd_k].begin(); - cmd_l != this->unsupported_savefile_subcommands[*cmd_k].end(); - cmd_l++) { - - savefile_data += " " + *cmd_l; - } - savefile_data += " };\n"; - } - } - savefile_data += "\n"; - - interp->write_data(chan, savefile_data); - - CYG_REPORT_RETURN(); -} - -// ---------------------------------------------------------------------------- -// Get hold of the commands that should be added to the interpreter for -// processing a savefile. Note that this will only deal with commands -// supported by the library or the application, not any additional -// unsupported commands specified in the savefile itself. The latter -// will be taken care of magically by savefile_handle_command(). - -void -CdlToplevelBody::get_savefile_commands(std::vector& cmds) -{ - CYG_REPORT_FUNCNAME("CdlToplevel::get_savefile_commands"); - CYG_REPORT_FUNCARG1XV(this); - CYG_PRECONDITION_THISC(); - - CdlInterpreterCommandEntry local_cmd; - std::vector::const_iterator cmd_i; - for (cmd_i = savefile_commands.begin(); cmd_i != savefile_commands.end(); cmd_i++) { - // NOTE: this use of c_str() is somewhat dubious, but the string should not - // change so the c_str() array should remain ok as well. - local_cmd.name = cmd_i->name; - local_cmd.command = cmd_i->load_command; - cmds.push_back(local_cmd); - } - - // There is no point in iterating over this->unsupported_savefile_commands, - // that vector should be empty since we have not actually started - // processing the savefile yet. - CYG_ASSERTC(0 == this->unsupported_savefile_commands.size()); - - // Add an implementation of the "unknown" command. - local_cmd.name = "unknown"; - local_cmd.command = &CdlToplevelBody::savefile_handle_unknown; - cmds.push_back(local_cmd); - - CYG_REPORT_RETURN(); -} - -// Having repeated calls of this for e.g. every cdl_option statement in -// a savefile is expensive. Some sort of caching mechanism should be -// used to avoid unnecessary overheads. -void -CdlToplevelBody::get_savefile_subcommands(std::string main_command, std::vector& cmds) -{ - CYG_REPORT_FUNCNAME("CdlToplevel::get_savefile_subcommands"); - CYG_REPORT_FUNCARG1XV(this); - CYG_PRECONDITION_THISC(); - - CdlInterpreterCommandEntry local_cmd; - std::vector::const_iterator cmd_i; - for (cmd_i = savefile_subcommands[main_command].begin(); - cmd_i != savefile_subcommands[main_command].end(); - cmd_i++) { - - local_cmd.name = cmd_i->name.c_str(); - local_cmd.command = cmd_i->load_command; - cmds.push_back(local_cmd); - } - - std::vector::const_iterator cmd_j; - for (cmd_j = this->unsupported_savefile_subcommands[main_command].begin(); - cmd_j != this->unsupported_savefile_subcommands[main_command].end(); - cmd_j++) { - - local_cmd.name = cmd_j->c_str(); - local_cmd.command = &savefile_handle_unsupported; - cmds.push_back(local_cmd); - } - - CYG_REPORT_RETURN(); -} - -// ---------------------------------------------------------------------------- -// This implements cdl_savefile_command which should appear near the -// start of savefiles. The command takes two arguments, a primary -// command name and a set of subcommand names. -int -CdlToplevelBody::savefile_handle_command(CdlInterpreter interp, int argc, const char* argv[]) -{ - CYG_REPORT_FUNCNAME("CdlToplevel::savefile_handle_command"); - CYG_REPORT_FUNCARG2XV(interp, argc); - CYG_PRECONDITION_CLASSC(interp); - - CdlToplevel toplevel = interp->get_toplevel(); - CYG_ASSERT_CLASSC(toplevel); - CYG_ASSERTC(toplevel->savefile_commands_initialized); - - if (1 == argc) { - CdlParse::report_error(interp, "", "Expecting at least one argument to cdl_savefile_command"); - } else if (2 == argc) { - CdlParse::report_warning(interp, "", - std::string("Missing third argument to `cdl_savefile_command ") + argv[1] + - "'\n.Expecting an additional list of subcommands."); - } else if (3 != argc) { - CdlParse::report_warning(interp, "", std::string("Unexpected additional arguments to `cdl_savefile_command ") + - argv[1] + " { " + argv[2] + " }"); - } - - // Is the primary command one of the known ones? - bool known_command = false; - std::vector::const_iterator cmd_i; - std::vector::const_iterator cmd_j; - - if (1 != argc) { - // Make sure that the primary command is known. - for (cmd_i = savefile_commands.begin(); cmd_i != savefile_commands.end(); cmd_i++) { - if (cmd_i->name == argv[1]) { - known_command = true; - break; - } - } - if (!known_command) { - // Detect duplicate definitions, just in case. - for (cmd_j = toplevel->unsupported_savefile_commands.begin(); - cmd_j != toplevel->unsupported_savefile_commands.end(); - cmd_j++) { - if (*cmd_j == argv[1]) { - break; - } - } - if (cmd_j == toplevel->unsupported_savefile_commands.end()) { - toplevel->unsupported_savefile_commands.push_back(argv[1]); - } - } - } - - // Now take care of all the subcommands. - if (2 != argc) { - - int list_count = 0; - const char** list_entries = 0; - - try { - Tcl_Interp* tcl_interp = interp->get_tcl_interpreter(); - if (TCL_OK != Tcl_SplitList(tcl_interp, CDL_TCL_CONST_CAST(char*, argv[2]), &list_count, CDL_TCL_CONST_CAST(char***, &list_entries))) { - CdlParse::report_error(interp, "", std::string("Invalid subcommand list for `cdl_command ") + argv[1] + "'."); - } - - for (int i = 0; i < list_count; i++) { - bool known_subcommand = false; - if (known_command) { - for (cmd_i = savefile_subcommands[argv[1]].begin(); - cmd_i != savefile_subcommands[argv[1]].end(); - cmd_i++) { - - if (cmd_i->name == list_entries[i]) { - known_subcommand = true; - } - } - } - if (!known_subcommand) { - for (cmd_j = toplevel->unsupported_savefile_subcommands[argv[1]].begin(); - cmd_j != toplevel->unsupported_savefile_subcommands[argv[1]].end(); - cmd_j++) { - - if (*cmd_j == list_entries[i]) { - known_subcommand = true; - break; - } - } - } - if (!known_subcommand) { - toplevel->unsupported_savefile_subcommands[argv[1]].push_back(list_entries[i]); - } - - } - - if (0 != list_entries) { - Tcl_Free((char *)list_entries); - } - - } catch(...) { - if (0 != list_entries) { - Tcl_Free((char *)list_entries); - } - throw; - } - } - - return TCL_OK; -} - -//}}} -//{{{ handle_unsupported() - -// ---------------------------------------------------------------------------- -// This function is invoked when an unsupported command is detected in -// a savefile. It turns the data back into a string which can go back -// into the next savefile, thus avoiding loss of data. -// -// It is possible that the savefile contents involved variable or -// command substitution. If so then this information will have been -// lost, there is no simple way of retrieving this from the interpreter. -// Care has to be taken when generating the new command string to -// perform appropriate quoting. -// -// Ideally the original data could be extracted from the Tcl -// interpreter somehow. Currently this data is not readily available, -// and the resulting string may not match the original data exactly. -int -CdlToplevelBody::savefile_handle_unsupported(CdlInterpreter interp, int argc, const char* argv[]) -{ - CYG_REPORT_FUNCNAME("CdlNode::savefile_handle_unsupported"); - CYG_REPORT_FUNCARG2XV(interp, argc); - CYG_ASSERT_CLASSC(interp); - - CdlToplevel toplevel = interp->get_toplevel(); - CYG_ASSERT_CLASSC(toplevel); - CdlNode node = interp->get_node(); - CYG_ASSERT_ZERO_OR_CLASSC(node); - - std::string tmp = CdlInterpreterBody::quote(argv[0]); - for (int i = 1; i < argc; i++) { - tmp = tmp + " " + CdlInterpreterBody::quote(argv[i]); - } - // Unknown commands may occur at the toplevel or inside - // e.g. a cdl_option body. Toplevels are also nodes. - if (0 == node) { - toplevel->unsupported_savefile_toplevel_strings.push_back(tmp); - } else { - node->unsupported_savefile_strings.push_back(tmp); - } - - return TCL_OK; -} - -//}}} -//{{{ save_unsupported() - -// ---------------------------------------------------------------------------- -// This code deals with any toplevel data present in the original save -// file that was not recognised. -void -CdlToplevelBody::save_unsupported_commands(CdlInterpreter interp, Tcl_Channel chan, int indentation, bool minimal) -{ - CYG_REPORT_FUNCNAME("CdlToplevelBody::save_unsupported_commands"); - CYG_REPORT_FUNCARG3XV(this, interp, chan); - CYG_PRECONDITION_THISC(); - CYG_PRECONDITION_CLASSC(interp); - CYG_PRECONDITIONC(0 == indentation); - - std::string data = "\n"; - std::vector::const_iterator str_i; - for (str_i = unsupported_savefile_toplevel_strings.begin(); - str_i != unsupported_savefile_toplevel_strings.end(); - str_i++) { - data += *str_i + " ;\n"; - } - interp->write_data(chan, data); - - CYG_UNUSED_PARAM(bool, minimal); - CYG_REPORT_RETURN(); -} - -//}}} -//{{{ handle_unknown() - -// ---------------------------------------------------------------------------- - -int -CdlToplevelBody::savefile_handle_unknown(CdlInterpreter interp, int argc, const char* argv[]) -{ - CYG_REPORT_FUNCNAME("CdlToplevel::savefile_handle_unknown"); - CYG_REPORT_FUNCARG2XV(interp, argc); - CYG_PRECONDITION_CLASSC(interp); - - CdlParse::report_error(interp, "", std::string("Unknown command `") + argv[1] + "'."); - - CYG_UNUSED_PARAM(int, argc); - return TCL_OK; -} - -//}}} -//{{{ versioning - -// ---------------------------------------------------------------------------- -// Savefiles include a version number that can be used by library -// commands to cope with old and incompatible savefiles. This -// version number should be changed only very rarely, hopefully never. -cdl_int CdlToplevelBody::savefile_version = 1; - -cdl_int -CdlToplevelBody::get_library_savefile_version() -{ - CYG_REPORT_FUNCNAMETYPE("CdlToplevel::get_library_savefile_version", "result %ld"); - - cdl_int result = savefile_version; - CYG_REPORT_RETVAL((long) result); - return result; -} - -// This implements the cdl_savefile_version command. It stores the -// version number with the interpreter, allowing it to be retrieved -// by other commands. -int -CdlToplevelBody::savefile_handle_version(CdlInterpreter interp, int argc, const char* argv[]) -{ - CYG_REPORT_FUNCNAME("CdlToplevel::savefile_handle_version"); - CYG_REPORT_FUNCARG2XV(interp, argc); - CYG_PRECONDITION_CLASSC(interp); - - if (1 == argc) { - CdlParse::report_warning(interp, "", "Expecting one argument to cdl_savefile_version"); - } else { - if (2 != argc) { - CdlParse::report_warning(interp, "", - std::string("Unexpected number of arguments to cdl_savefile_version\n") + - "There should be exactly one argument, the savefile format version number."); - } - cdl_int tmp; - if (!Cdl::string_to_integer(argv[1], tmp)) { - CdlParse::report_error(interp, "", - std::string("Invalid version number `") + argv[1] + "' for cdl_savefile_version"); - } else { - // Store the data in a Tcl variable. This is at least as convenient - // as assoc data. - interp->set_variable("cdl_savefile_version", argv[1]); - } - } - - return TCL_OK; -} - -cdl_int -CdlToplevelBody::get_savefile_version(CdlInterpreter interp) -{ - CYG_REPORT_FUNCNAMETYPE("CdlToplevel::get_savefile_version", "result %ld"); - CYG_REPORT_FUNCARG1XV(interp); - CYG_PRECONDITION_CLASSC(interp); - - cdl_int result = 0; - std::string version = interp->get_variable("cdl_savefile_version"); - if ("" != version) { - if (!Cdl::string_to_integer(version, result)) { - CdlParse::report_error(interp, "", std::string("Invalid cdl_savefile_version number `") + version + "'"); - } - } - - CYG_REPORT_RETVAL((long) result); - return result; -} - -//}}} -//{{{ conflicts - -// ---------------------------------------------------------------------------- -void -CdlToplevelBody::save_conflicts(CdlInterpreter interp, Tcl_Channel chan, int indentation, bool minimal) -{ - CYG_REPORT_FUNCNAME("CdlToplevel::save_conflicts"); - CYG_REPORT_FUNCARG4XV(this, interp, chan, indentation); - CYG_PRECONDITION_THISC(); - CYG_PRECONDITION_CLASSC(interp); - CYG_PRECONDITIONC(0 == indentation); - - // For now only comments are generated here, so in a minimal save - // there is no need for any of this data - if (!minimal) { - std::string data = ""; - if (0 == conflicts.size()) { - data += "# There are no conflicts.\n"; - } else { - std::string tmp; - Cdl::integer_to_string((cdl_int) this->conflicts.size(), tmp); - data += "# There are " + tmp + " conflicts.\n"; - - std::list::const_iterator conf_i; - for (conf_i = this->conflicts.begin(); conf_i != this->conflicts.end(); conf_i++) { - data += "#\n"; - - CdlNode node = (*conf_i)->get_node(); - CdlProperty prop = (*conf_i)->get_property(); - std::string description = (*conf_i)->get_explanation(); - data += "# " + node->get_class_name() + " " + node->get_name() + "\n"; - data += "# Property " + prop->get_property_name() + "\n"; - data += CdlInterpreterBody::multiline_comment(description, 0, 2) + "\n"; - } - data += '\n'; - } - data += '\n'; - - interp->write_data(chan, data); - } - - CYG_REPORT_RETURN(); -} - -//}}} -//{{{ save_separator() - -// ---------------------------------------------------------------------------- -void -CdlToplevelBody::save_separator(CdlInterpreter interp, Tcl_Channel chan, std::string msg, bool minimal) -{ - CYG_REPORT_FUNCNAME("CdlToplevel::save_separator"); - CYG_REPORT_FUNCARG1XV(interp); - CYG_PRECONDITION_CLASSC(interp); - - if (!minimal) { - std::string data = "# ---- " + msg + ' '; - if (72 > data.size()) { - data += std::string(72 - data.size(), '-'); - } - data += '\n'; - interp->write_data(chan, data); - } - - CYG_REPORT_RETURN(); -} - -//}}} - -//}}} -//{{{ check_this() - -// ---------------------------------------------------------------------------- -bool -CdlToplevelBody::check_this(cyg_assert_class_zeal zeal) const -{ - if (CdlToplevelBody_Magic != cdltoplevelbody_cookie) { - return false; - } - CYGDBG_MEMLEAK_CHECKTHIS(); - - if ((zeal == cyg_extreme) || (zeal == cyg_thorough)) { - if (!interp->check_this(cyg_quick)) { - return false; - } - if ((0 == orphans) || !orphans->check_this(cyg_quick)) { - return false; - } - if (orphans != *contents.begin()) { - return false; - } - if ((0 != transaction) && !transaction->check_this(cyg_quick)) { - return false; - } - } - - return CdlContainerBody::check_this(zeal); -} - -//}}} - -//}}} -//{{{ CdlUserVisiblebody - -//{{{ Basics - -// ---------------------------------------------------------------------------- -// All user-visible object can have (and usually should have) three -// properties: display (originally known as alias), description, and -// doc. There is no additional data associated with a user-visible -// object, everything is handled via the properties. - -CdlUserVisibleBody::CdlUserVisibleBody() -{ - CYG_REPORT_FUNCNAME("CdlUserVisible:: default constructor"); - CYG_REPORT_FUNCARG1XV(this); - - cdluservisiblebody_cookie = CdlUserVisibleBody_Magic; - CYGDBG_MEMLEAK_CONSTRUCTOR(); - - CYG_POSTCONDITION_THISC(); - CYG_REPORT_RETURN(); -} - -CdlUserVisibleBody::~CdlUserVisibleBody() -{ - CYG_REPORT_FUNCNAME("CdlUserVisible:: destructor"); - CYG_REPORT_FUNCARG1XV(this); - CYG_PRECONDITION_THISC(); - - cdluservisiblebody_cookie = CdlUserVisibleBody_Invalid; - CYGDBG_MEMLEAK_DESTRUCTOR(); - - CYG_REPORT_RETURN(); -} - -std::string -CdlUserVisibleBody::get_class_name() const -{ - CYG_REPORT_FUNCNAME("CdlUserVisible::get_class_name"); - CYG_PRECONDITION_THISC(); - CYG_REPORT_RETURN(); - return "uservisible"; -} - -bool -CdlUserVisibleBody::check_this(cyg_assert_class_zeal zeal) const -{ - if (CdlUserVisibleBody_Magic != cdluservisiblebody_cookie) { - return false; - } - CYGDBG_MEMLEAK_CHECKTHIS(); - return CdlNodeBody::check_this(zeal); -} - -//}}} -//{{{ Extracting information - -// ---------------------------------------------------------------------------- -// Extracting the information. - -std::string -CdlUserVisibleBody::get_display() const -{ - CYG_REPORT_FUNCNAME("CdlUserVisible::get_display"); - CYG_REPORT_FUNCARG1XV(this); - CYG_PRECONDITION_THISC(); - - std::string result = ""; - CdlProperty property = get_property(CdlPropertyId_Display); - if (0 != property) { - - CdlProperty_String string_property = dynamic_cast(property); - CYG_ASSERTC(0 != string_property); - - result = string_property->get_string(); - } - - CYG_REPORT_RETURN(); - return result; -} - -std::string -CdlUserVisibleBody::get_description() const -{ - CYG_REPORT_FUNCNAME("CdlUserVisible::get_description"); - CYG_REPORT_FUNCARG1XV(this); - CYG_PRECONDITION_THISC(); - - std::string result = ""; - CdlProperty property = get_property(CdlPropertyId_Description); - if (0 != property) { - - CdlProperty_String string_property = dynamic_cast(property); - CYG_ASSERTC(0 != string_property); - - result = string_property->get_string(); - } - - CYG_REPORT_RETURN(); - return result; -} - -std::string -CdlUserVisibleBody::get_doc() const -{ - CYG_REPORT_FUNCNAME("CdlUserVisible::get_doc"); - CYG_REPORT_FUNCARG1XV(this); - CYG_PRECONDITION_THISC(); - - std::string result = ""; - CdlProperty property = get_property(CdlPropertyId_Doc); - if (0 != property) { - - CdlProperty_String string_property = dynamic_cast(property); - CYG_ASSERTC(0 != string_property); - - result = string_property->get_string(); - } - - CYG_REPORT_RETURN(); - return result; -} - -std::string -CdlUserVisibleBody::get_doc_url() const -{ - CYG_REPORT_FUNCNAME("CdlUserVisible::get_doc_url"); - CYG_REPORT_FUNCARG1XV(this); - CYG_PRECONDITION_THISC(); - - std::string result = ""; - std::string doc_property = get_doc(); - if ("" != doc_property) { - CdlLoadable owner = get_owner(); - CYG_ASSERTC(0 != owner); - result = owner->find_absolute_file(doc_property, "doc", true); - } - - CYG_REPORT_RETURN(); - return result; -} - -//}}} -//{{{ Parsing - -// ---------------------------------------------------------------------------- -// Parsing support. There are three property parsers to be added to -// the current set. The checking code should make sure that at most -// one of each property has been specified. In addition it is -// necessary to recurse into the base class. - -void -CdlUserVisibleBody::add_property_parsers(std::vector& parsers) -{ - CYG_REPORT_FUNCNAME("CdlUserVisible::add_property_parsers"); - - static CdlInterpreterCommandEntry commands[] = - { - CdlInterpreterCommandEntry("display", &parse_display), - CdlInterpreterCommandEntry("description", &parse_description), - CdlInterpreterCommandEntry("doc", &parse_doc), - CdlInterpreterCommandEntry("", 0) - }; - - for (int i = 0; commands[i].command != 0; i++) { - std::vector::const_iterator j; - for (j = parsers.begin(); j != parsers.end(); j++) { - if (commands[i].name == j->name) { - if (commands[i].command != j->command) { - CYG_FAIL("Property names are being re-used"); - } - break; - } - } - if (j == parsers.end()) { - parsers.push_back(commands[i]); - } - } - CdlNodeBody::add_property_parsers(parsers); - - CYG_REPORT_RETURN(); -} - -void -CdlUserVisibleBody::check_properties(CdlInterpreter interp) -{ - CYG_REPORT_FUNCNAME("CdlUserVisible::check_properties"); - CYG_REPORT_FUNCARG2XV(this, interp); - CYG_PRECONDITION_THISC(); - CYG_PRECONDITION_CLASSC(interp); - - if (count_properties(CdlPropertyId_Display) > 1) { - CdlParse::report_error(interp, "", "There should be at most one display property."); - } - if (count_properties(CdlPropertyId_Description) > 1) { - CdlParse::report_error(interp, "", "There should be at most one description property."); - } - if (count_properties(CdlPropertyId_Doc) > 1) { - CdlParse::report_error(interp, "", "There should be at most one doc property."); - } - - // FIXME: more validation of the doc property, in particular check that - // the resulting URL would be either remote or to an existing file. - - CdlNodeBody::check_properties(interp); - - CYG_REPORT_RETURN(); -} - -// ---------------------------------------------------------------------------- -// Syntax: description - -int -CdlUserVisibleBody::parse_description(CdlInterpreter interp, int argc, const char* argv[]) -{ - CYG_REPORT_FUNCNAMETYPE("parse_description", "result %d"); - - int result = CdlParse::parse_string_property(interp, argc, argv, CdlPropertyId_Description, 0, 0); - - CYG_REPORT_RETVAL(result); - return result; -} - - -// ---------------------------------------------------------------------------- -// Syntax: display - -int -CdlUserVisibleBody::parse_display(CdlInterpreter interp, int argc, const char* argv[]) -{ - CYG_REPORT_FUNCNAMETYPE("parse_display", "result %d"); - - int result = CdlParse::parse_string_property(interp, argc, argv, CdlPropertyId_Display, 0, 0); - - CYG_REPORT_RETVAL(result); - return result; -} - -// ---------------------------------------------------------------------------- -// Syntax: doc - -int -CdlUserVisibleBody::parse_doc(CdlInterpreter interp, int argc, const char* argv[]) -{ - CYG_REPORT_FUNCNAMETYPE("parse_doc", "result %d"); - - int result = CdlParse::parse_string_property(interp, argc, argv, CdlPropertyId_Doc, 0, 0); - - CYG_REPORT_RETVAL(result); - return result; -} - -//}}} -//{{{ Persistence - -// ---------------------------------------------------------------------------- -// There is no data in a user visible object that users will want to edit, -// but the display string, the documentation, and the description are all -// useful and should be present in the savefile as comments. -// -// The intention is that the UserVisible information appears immediately -// above the option/component/whatever definition, e.g.: -// # -// # -// # - -void -CdlUserVisibleBody::save(CdlInterpreter interp, Tcl_Channel chan, int indentation, bool minimal) -{ - CYG_REPORT_FUNCNAME("CdlUserVisible::save"); - CYG_REPORT_FUNCARG5XV(this, interp, chan, indentation, minimal); - CYG_PRECONDITION_THISC(); - CYG_PRECONDITION_CLASSC(interp); - CYG_ASSERTC(0 == indentation); - - if (!minimal) { - std::string data = ""; - std::string display = get_display(); - if ("" != display) { - data = std::string("# ") + display + "\n"; - } - // Note that this uses get_doc(), not get_doc_url(). The latter - // would give an absolute pathname that is applicable to the - // current user, but it would change if a different user loaded - // and saved the file. This is a bad idea in terms of version - // control. - std::string doc = get_doc(); - if ("" != doc) { - data += "# doc: " + doc + "\n"; - } - std::string description = get_description(); - if ("" != description) { - unsigned int i = 0; - while (i < description.size()) { - data += "# "; - while ((i < description.size()) && isspace(description[i])) { - i++; - } - while ((i < description.size()) && ('\n' != description[i])) { - data += description[i++]; - } - data += '\n'; - } - } - data += "#\n"; - - interp->write_data(chan, data); - } - - CYG_REPORT_RETURN(); -} - -//}}} - -//}}} -//{{{ CdlParentableBody - -// ---------------------------------------------------------------------------- -// A parentable object can have the parent property, i.e. it can be -// positioned anywhere in the hierarchy. There is no data associated -// with such an object. - -CdlParentableBody::CdlParentableBody() -{ - CYG_REPORT_FUNCNAME("CdlParentable:: default constructor"); - CYG_REPORT_FUNCARG1XV(this); - - change_parent_save_position = -1; - cdlparentablebody_cookie = CdlParentableBody_Magic; - CYGDBG_MEMLEAK_CONSTRUCTOR(); - - CYG_POSTCONDITION_THISC(); - CYG_REPORT_RETURN(); -} - -CdlParentableBody::~CdlParentableBody() -{ - CYG_REPORT_FUNCNAME("CdlParentable:: destructor"); - CYG_REPORT_FUNCARG1XV(this); - CYG_PRECONDITION_THISC(); - - cdlparentablebody_cookie = CdlParentableBody_Invalid; - CYGDBG_MEMLEAK_DESTRUCTOR(); - - CYG_REPORT_RETURN(); -} - -// ---------------------------------------------------------------------------- - -std::string -CdlParentableBody::get_class_name() const -{ - CYG_REPORT_FUNCNAME("CdlParentable::get_class_name"); - CYG_PRECONDITION_THISC(); - CYG_REPORT_RETURN(); - return "parentable"; -} - -// ---------------------------------------------------------------------------- - -bool -CdlParentableBody::check_this(cyg_assert_class_zeal zeal) const -{ - if (CdlParentableBody_Magic != cdlparentablebody_cookie) { - return false; - } - CYGDBG_MEMLEAK_CHECKTHIS(); - return CdlNodeBody::check_this(zeal); -} - -// ---------------------------------------------------------------------------- -// Parsing support. There is just one property parser to be added. - -void -CdlParentableBody::add_property_parsers(std::vector& parsers) -{ - CYG_REPORT_FUNCNAME("CdlParentable::add_property_parsers"); - - static CdlInterpreterCommandEntry commands[] = - { - CdlInterpreterCommandEntry("parent", &CdlParentableBody::parse_parent), - CdlInterpreterCommandEntry("", 0) - }; - - for (int i = 0; commands[i].command != 0; i++) { - std::vector::const_iterator j; - for (j = parsers.begin(); j != parsers.end(); j++) { - if (commands[i].name == j->name) { - if (commands[i].command != j->command) { - CYG_FAIL("Property names are being re-used"); - } - break; - } - } - if (j == parsers.end()) { - parsers.push_back(commands[i]); - } - } - CdlNodeBody::add_property_parsers(parsers); - - CYG_REPORT_RETURN(); -} - -void -CdlParentableBody::check_properties(CdlInterpreter interp) -{ - CYG_REPORT_FUNCNAME("CdlParentable::check_properties"); - CYG_REPORT_FUNCARG2XV(this, interp); - CYG_PRECONDITION_THISC(); - CYG_PRECONDITION_CLASSC(interp); - - if (has_property(CdlPropertyId_Parent)) { - if (count_properties(CdlPropertyId_Parent) > 1) { - CdlParse::report_error(interp, "", "There should be at most one `parent' property."); - } - CdlProperty_Reference refprop = dynamic_cast(get_property(CdlPropertyId_Parent)); - CYG_ASSERT_CLASSC(this); - if (get_name() == refprop->get_destination_name()) { - CdlParse::report_error(interp, "", std::string("Node ") + get_name() + " cannot be its own parent."); - } - } - - CdlNodeBody::check_properties(interp); - - CYG_REPORT_RETURN(); -} - -// ---------------------------------------------------------------------------- -// Syntax:: parent - -void -CdlParentableBody::update_handler(CdlTransaction transaction, CdlNode source, CdlProperty prop, CdlNode dest, CdlUpdate change) -{ - CYG_REPORT_FUNCNAME("CdlParentable::update_handler"); - CYG_PRECONDITION_CLASSC(source); - CYG_PRECONDITION_ZERO_OR_CLASSC(dest); - - // Value and activity updates are of no interest. - if ((CdlUpdate_ValueChange == change) || (CdlUpdate_ActiveChange == change)) { - CYG_REPORT_RETURN(); - return; - } - - // Ditto for the second stage Init. - if (CdlUpdate_Init == change) { - CYG_REPORT_RETURN(); - return; - } - - // If this object is being unloaded then we need to clean up the hierarchy. - // Ordinary nodes must be re-parented below the owning loadable. The - // loadable itself must be re-parented below the toplevel. A subsequent - // calls to remove_loadable_from_toplevel() will ensure that the loadable - // is now completely isolated from the remaining configuration, but can - // still be put back. - if (CdlUpdate_Unloading == change) { - CdlToplevel toplevel = source->get_toplevel(); - CYG_ASSERT_CLASSC(toplevel); - CdlLoadable owner = source->get_owner(); - CYG_ASSERT_CLASSC(owner); - CdlLoadable loadable = dynamic_cast(source); - CYG_ASSERT_ZERO_OR_CLASSC(loadable); - - if (0 != loadable) { - toplevel->change_parent(owner, source->get_parent(), toplevel, source); - } else { - toplevel->change_parent(owner, source->get_parent(), owner, source); - } - - CYG_REPORT_RETURN(); - return; - } - - // We should have: - // 1) change == Loaded, dest == (0 | valid) - // 2) change == Created, dest == valid - // 3) change == Destroyed, dest == valid (still) - CYG_ASSERTC((CdlUpdate_Loaded == change) || (CdlUpdate_Created == change) || (CdlUpdate_Destroyed == change)); - CYG_ASSERTC((CdlUpdate_Created != change) || (0 != dest)); - CYG_ASSERTC((CdlUpdate_Destroyed != change) || (0 != dest)); - - if (CdlUpdate_Destroyed == change) { - dest = 0; - } - - // Now either dest is valid or it is not. If it is then we need to - // reparent below the destination. Otherwise if the specified - // parent is "" then we need to reparent below the root. Otherwise - // the node ends up in the orphans container. There are a few - // nasty special cases to consider like reparenting below - // something that is not a container. - if (0 == dest) { - CdlToplevel toplevel = source->get_toplevel(); - - CdlProperty_Reference refprop = dynamic_cast(prop); - if ("" == refprop->get_destination_name()) { - dest = toplevel; - // Now to find the correct insertion point. Nodes which should be - // reparented below the root should come first, ahead of any nodes - // which are not specifically reparented. - const std::vector& contents = toplevel->get_contents(); - unsigned int index; - for (index = 0; index < contents.size(); index++) { - if (!contents[index]->has_property(CdlPropertyId_Parent)) { - break; - } - } - toplevel->change_parent(source->get_owner(), source->get_parent(), toplevel, source, index); - - } else { - // Orphan the node. It still has a parent, either as a - // consequence of the loading process or because of a previous - // binding operation. - toplevel->change_parent(source->get_owner(), source->get_parent(), 0, source); - } - - // The Unresolved conflict is handled by - // CdlProperty_Reference::update(). The "else" code below may - // have created some additional data conflicts. - transaction->clear_structural_conflicts(source, prop, &CdlConflict_DataBody::test); - - // Changing the parent may affect the "active" status. - bool old_state = transaction->is_active(source); - bool new_state = source->test_active(transaction); - if (old_state != new_state) { - transaction->set_active(source, new_state); - } - - } else { - // The node should no longer be an orphan - probably. - - // Check that the destination is actually a container. If it is, - // reparenting is possible. - CdlContainer dest_container = dynamic_cast(dest); - if (0 == dest_container) { - - // The reference might be resolved, but reparenting is still not possible. - // Leave the object orphaned as at present, and create a suitable conflict - // object. - std::string msg = source->get_class_name() + " " + source->get_name() + " cannot be reparented below " + - dest->get_class_name() + " " + dest->get_name() + "\n The latter is not a container."; - CdlConflict_DataBody::make(transaction, source, prop, msg); - - } else { - - CdlContainer tmp = dynamic_cast(source); - if ((0 != tmp) && tmp->contains(dest_container, true)) { - - // Somebody trying to be clever and reparent an object - // below one of its existing children? Note that with - // sufficiently careful use of parent statements this - // might actually be legal, but for now treat it as - // too dangerous. - std::string msg = source->get_class_name() + " " + source->get_name() + " cannot be reparented below " + - dest->get_class_name() + " " + dest->get_name() + "\n This would introduce a cycle."; - CdlConflict_DataBody::make(transaction, source, prop, msg); - - } else { - - // It is possible to reparent the object to its correct location - CdlToplevel toplevel = source->get_toplevel(); - CYG_ASSERTC(toplevel == dest->get_toplevel()); - toplevel->change_parent(source->get_owner(), source->get_parent(), dest_container, source); - - bool old_state = transaction->is_active(source); - bool new_state = source->test_active(transaction); - if (old_state != new_state) { - transaction->set_active(source, new_state); - } - } - } - } - - CYG_REPORT_RETURN(); -} - -int -CdlParentableBody::parse_parent(CdlInterpreter interp, int argc, const char* argv[]) -{ - CYG_REPORT_FUNCNAMETYPE("parse_parent", "result %d"); - - int result = CdlParse::parse_reference_property(interp, argc, argv, CdlPropertyId_Parent, 0, 0, true, &update_handler); - - CYG_REPORT_RETVAL(result); - return result; -} - -//}}} diff --git a/host/libcdl/build.cxx b/host/libcdl/build.cxx deleted file mode 100644 --- a/host/libcdl/build.cxx +++ /dev/null @@ -1,2238 +0,0 @@ -//{{{ Banner - -//========================================================================== -// -// build.cxx -// -// libcdl support for building and for header file generation -// -//========================================================================== -//####COPYRIGHTBEGIN#### -// -// ---------------------------------------------------------------------------- -// Copyright (C) 2002, 2003 Bart Veer -// Copyright (C) 1999, 2000, 2001 Red Hat, Inc. -// -// This file is part of the eCos host tools. -// -// This program is free software; you can redistribute it and/or modify it -// under the terms of the GNU General Public License as published by the Free -// Software Foundation; either version 2 of the License, or (at your option) -// any later version. -// -// This program is distributed in the hope that it will be useful, but WITHOUT -// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for -// more details. -// -// You should have received a copy of the GNU General Public License along with -// this program; if not, write to the Free Software Foundation, Inc., -// 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -// -// ---------------------------------------------------------------------------- -// -//####COPYRIGHTEND#### -//========================================================================== -//#####DESCRIPTIONBEGIN#### -// -// Author(s): bartv -// Contributors: bartv -// Date: 1999-06-018 -// -//####DESCRIPTIONEND#### -//========================================================================== - -//}}} -//{{{ #include's - -// ---------------------------------------------------------------------------- -#include "cdlconfig.h" - -// Get the infrastructure types, assertions, tracing and similar -// facilities. -#include -#include - -// defines everything implemented in this module. -// It implicitly supplies , and because -// the class definitions rely on these headers. -#include - -//}}} - -//{{{ Statics - -// ---------------------------------------------------------------------------- -CYGDBG_DEFINE_MEMLEAK_COUNTER(CdlBuildLoadableBody); -CYGDBG_DEFINE_MEMLEAK_COUNTER(CdlBuildableBody); -CYGDBG_DEFINE_MEMLEAK_COUNTER(CdlDefineLoadableBody); -CYGDBG_DEFINE_MEMLEAK_COUNTER(CdlDefinableBody); - -//}}} -//{{{ CdlBuildableBody - -//{{{ Basics - -// ---------------------------------------------------------------------------- -// There is little data specific to a buildable. The only distinguishing -// feature is the set of properties that are supported, plus a handful -// of functions to extract that information. - -CdlBuildableBody::CdlBuildableBody() -{ - CYG_REPORT_FUNCNAME("CdlBuildable:: default constructor"); - CYG_REPORT_FUNCARG1XV(this); - - // There is no data to initialize yet - cdlbuildablebody_cookie = CdlBuildableBody_Magic; - CYGDBG_MEMLEAK_CONSTRUCTOR(); - - CYG_POSTCONDITION_THISC(); - CYG_REPORT_RETURN(); -} - -CdlBuildableBody::~CdlBuildableBody() -{ - CYG_REPORT_FUNCNAME("CdlBuildable:: destructor"); - CYG_REPORT_FUNCARG1XV(this); - CYG_PRECONDITION_THISC(); - - cdlbuildablebody_cookie = CdlBuildableBody_Invalid; - CYGDBG_MEMLEAK_DESTRUCTOR(); - - CYG_REPORT_RETURN(); -} - -// ---------------------------------------------------------------------------- - -std::string -CdlBuildableBody::get_class_name() const -{ - CYG_REPORT_FUNCNAME("CdlBuildable::get_class_name"); - CYG_PRECONDITION_THISC(); - CYG_REPORT_RETURN(); - return "buildable"; -} - -// ---------------------------------------------------------------------------- - -bool -CdlBuildableBody::check_this(cyg_assert_class_zeal zeal) const -{ - if (CdlBuildableBody_Magic != cdlbuildablebody_cookie) { - return false; - } - CYGDBG_MEMLEAK_CHECKTHIS(); - return CdlNodeBody::check_this(zeal); -} - -//}}} -//{{{ Add and check property parsers - -// ---------------------------------------------------------------------------- - -void -CdlBuildableBody::add_property_parsers(std::vector& parsers) -{ - CYG_REPORT_FUNCNAME("CdlBuildable::add_property_parsers"); - - static CdlInterpreterCommandEntry commands[] = - { - CdlInterpreterCommandEntry("compile", &CdlBuildableBody::parse_compile ), - CdlInterpreterCommandEntry("object", &CdlBuildableBody::parse_object ), - CdlInterpreterCommandEntry("make_object", &CdlBuildableBody::parse_make_object), - CdlInterpreterCommandEntry("make", &CdlBuildableBody::parse_make ), - CdlInterpreterCommandEntry("build_proc", &CdlBuildableBody::parse_build_proc ), - CdlInterpreterCommandEntry("", 0 ), - }; - - for (int i = 0; commands[i].command != 0; i++) { - std::vector::const_iterator j; - for (j = parsers.begin(); j != parsers.end(); j++) { - if (commands[i].name == j->name) { - if (commands[i].command != j->command) { - CYG_FAIL("Property names are being re-used"); - } - break; - } - } - if (j == parsers.end()) { - parsers.push_back(commands[i]); - } - } - CdlNodeBody::add_property_parsers(parsers); - - CYG_REPORT_RETURN(); -} - -void -CdlBuildableBody::check_properties(CdlInterpreter interp) -{ - CYG_REPORT_FUNCNAME("CdlBuildable::check_properties"); - CYG_REPORT_FUNCARG2XV(this, interp); - CYG_PRECONDITION_THISC(); - CYG_PRECONDITION_CLASSC(interp); - - // There are no real constraints on the number of compile - // properties etc. - // TODO: check that the relevant sources files exist, - // unless marked appropriately (build_proc can create - // new source files). - - CdlNodeBody::check_properties(interp); - - CYG_REPORT_RETURN(); -} - -//}}} -//{{{ Property parsers - -// ---------------------------------------------------------------------------- -// Syntax: compile -// -// There are a couple of checks that could be performed here: -// -// 1) does each listed file actually exist? Unfortunately that approach -// falls foul of build_proc, which is allowed to generate source files -// on the fly. -// -// 2) does the file have a recognised suffix such as .c or .cxx. This -// relies libcdl having some way of knowing how to treat different -// files. -// -// For now there are no validity checks. -// -// A future extension may allow dependencies to be listed, as an -// option. This would allow component vendors to specify that -// particular custom build steps should happen before particular -// compilations, a more robust approach than the current priority -// scheme. - -int -CdlBuildableBody::parse_compile(CdlInterpreter interp, int argc, const char* argv[]) -{ - CYG_REPORT_FUNCNAMETYPE("parse_compile", "result %d"); - static char* options[] = { - "library:", - 0 - }; - - int result = CdlParse::parse_stringvector_property(interp, argc, argv, CdlPropertyId_Compile, options, 0, true); - - CYG_REPORT_RETVAL(result); - return result; -} - -// ---------------------------------------------------------------------------- -// A utility to break a custom build step down into its three components. -// -// A custom build step takes the form: -// target : deps -// rules -// -// This utility function takes a single string of this form and breaks -// it down into its constituent parts. -// -// NOTE: this will need lots of extra code in future to allow for -// escaped characters, spaces in filenames, etc. For now just keep -// things simple. - -bool -CdlBuildableBody::split_custom_build_step(std::string str_data, std::string& target, std::string& deps, std::string& rules, - std::string& error_msg) -{ - CYG_REPORT_FUNCNAMETYPE("CdlBuildable::split_custom_build_step", "result %d"); - - target = ""; - deps = ""; - rules = ""; - error_msg = ""; - - const char* data = str_data.c_str(); - - // Skip any leading white space, and make sure that this leaves some real data. - while (('\0' != *data) && isspace(*data)) { - data++; - } - if ('\0' == *data) { - error_msg = "no data in custom build_step"; - CYG_REPORT_RETVAL(false); - return false; - } - - // Now extract the target. This consists of any sequence of characters - // upto space, tab, colon. - for ( ; ('\0' != *data) && (':' != *data) && (' ' != *data) && ('\t' != *data); data++) { - target += *data; - } - // Discard any spaces or tabs, they are of no interest - while ((' ' == *data) || ('\t' == *data)) { - data++; - } - // The current character should be a colon - if (':' != *data) { - error_msg = "expecting a colon `;' after the target `" + target + "'"; - CYG_REPORT_RETVAL(false); - return false; - } - - // Move past the colon, and skip any further spaces or tabs - data++; - while (('\0' != *data) && ((' ' == *data) || ('\t' == *data))) { - data++; - } - - // Everything from here until the end of line should be part of the deps field, - // including white space. - while (('\0' != *data) && ('\n' != *data) && (';' != *data)) { - deps += *data++; - } - - if ("" == deps) { - error_msg = "expecting dependency list after `" + target + ":'"; - CYG_REPORT_RETVAL(false); - return false; - } - - // Having some rules is compulsory. - if ('\0' == *data) { - error_msg = "expecting one or more rules after the dependency list"; - CYG_REPORT_RETVAL(false); - return false; - } else { - // We are currently at \n or ;, move on to the actual rules - data++; - } - - // Rules consist of one or more lines. Any leading white space on a given - // line should be discarded. - while ('\0' != *data) { - // Processing the current rule. Skip leading spaces and tabs - while ((' ' == *data) || ('\t' == *data)) { - data++; - } - // Now add everything up to the next newline or EOD to the rules. - while (('\0' != *data) && ('\n' != *data)) { - rules += *data++; - } - - // Terminate this line of the rules with a newline, even if that - // character is absent from the raw data. - rules += '\n'; - - // And ignore the newline in the raw data itself - if ('\n' == *data) { - data++; - } - } - - // Better make sure that there are some rules. All of the looping above - // may just have left white space - if ("" == rules) { - error_msg = "no rules provided"; - CYG_REPORT_RETVAL(false); - return false; - } - - // Everything is ok. - - CYG_REPORT_RETVAL(true); - return true; -} - - -// ---------------------------------------------------------------------------- -// syntax: make -// -// There is rather a lot of checking to be done. -// -// 1) the priority should be valid. In particular it should be a number -// within a reasonable range. -// -// 2) the rules should take the form: -// : ;|\n rules -// -// Where the target should be a single file, identical to the -// first property argument. - -static void -parse_make_final_check(CdlInterpreter interp, CdlProperty_String prop) -{ - CYG_REPORT_FUNCNAME("parse_make_final_check"); - CYG_PRECONDITION_CLASSC(interp); - CYG_PRECONDITION_CLASSC(prop); - - std::string prio_string = prop->get_option("priority"); - if ("" != prio_string) { - cdl_int tmp = 1; - if (!Cdl::string_to_integer(prio_string, tmp)) { - CdlParse::report_property_parse_error(interp, prop, - "Invalid priority option, priorities should be simple numbers."); - } else { - if ((tmp < 1) || (tmp > 1024)) { - CdlParse::report_property_parse_error(interp, prop, - "Invalid priority value, priorities should be in the range 1 to 1024."); - } - } - } - - std::string data = prop->get_string(); - std::string target; - std::string deps; - std::string rules; - std::string error_msg; - - if (!CdlBuildableBody::split_custom_build_step(data, target, deps, rules, error_msg)) { - CdlParse::report_property_parse_error(interp, prop, "Invalid custom build step, " + error_msg); - } -} - -int -CdlBuildableBody::parse_make(CdlInterpreter interp, int argc, const char* argv[]) -{ - CYG_REPORT_FUNCNAMETYPE("parse_make", "result %d"); - static char* options[] = { - "priority:", - 0 - }; - - int result = CdlParse::parse_string_property(interp, argc, argv, CdlPropertyId_Make, options, &parse_make_final_check); - - CYG_REPORT_RETVAL(result); - return result; -} - - -// ---------------------------------------------------------------------------- -// syntax: make_object -// -// The rules here are much the same as for the "make" property. - -static void -parse_make_object_final_check(CdlInterpreter interp, CdlProperty_String prop) -{ - CYG_REPORT_FUNCNAME("parse_make_object_final_check"); - CYG_PRECONDITION_CLASSC(interp); - CYG_PRECONDITION_CLASSC(prop); - - - std::string prio_string = prop->get_option("priority"); - if ("" != prio_string) { - cdl_int tmp = 1; - if (!Cdl::string_to_integer(prio_string, tmp)) { - CdlParse::report_property_parse_error(interp, prop, - "Invalid priority option, priorities should be simple numbers."); - } else { - if ((tmp < 1) || (tmp > 1024)) { - CdlParse::report_property_parse_error(interp, prop, - "Invalid priority value, priorities should be in the range 1 to 1024."); - } - } - } - - std::string data = prop->get_string(); - std::string target; - std::string deps; - std::string rules; - std::string error_msg; - - if (!CdlBuildableBody::split_custom_build_step(data, target, deps, rules, error_msg)) { - CdlParse::report_property_parse_error(interp, prop, "Invalid custom build step, " + error_msg); - } -} - -int -CdlBuildableBody::parse_make_object(CdlInterpreter interp, int argc, const char* argv[]) -{ - CYG_REPORT_FUNCNAMETYPE("parse_make_object", "result %d"); - static char* options[] = { - "library:", - "priority:", - 0 - }; - - int result = CdlParse::parse_string_property(interp, argc, argv, CdlPropertyId_MakeObject, options, - &parse_make_object_final_check); - - CYG_REPORT_RETVAL(result); - return result; -} - - -// ---------------------------------------------------------------------------- -// Syntax: object ... - -int -CdlBuildableBody::parse_object(CdlInterpreter interp, int argc, const char* argv[]) -{ - CYG_REPORT_FUNCNAMETYPE("parse_object", "result %d"); - static char* options[] = { - "library:", - 0 - }; - - int result = CdlParse::parse_stringvector_property(interp, argc, argv, CdlPropertyId_Object, options, 0, true); - - CYG_REPORT_RETVAL(result); - return result; -} - -// ---------------------------------------------------------------------------- -// Syntax: build_proc { tcl code } - -int -CdlBuildableBody::parse_build_proc(CdlInterpreter interp, int argc, const char* argv[]) -{ - CYG_REPORT_FUNCNAMETYPE("parse_build_proc", "result %d"); - - int result = CdlParse::parse_tclcode_property(interp, argc, argv, CdlPropertyId_BuildProc, 0, 0); - - CYG_REPORT_RETVAL(result); - return result; -} - -//}}} -//{{{ update_build_info() - -// ---------------------------------------------------------------------------- -// Most of the work is done in update_all_build_info(). The update_build_info() -// merely checks the active and enabled state first. -void -CdlBuildableBody::update_build_info(CdlBuildInfo_Loadable& build_info, std::string library) const -{ - CYG_REPORT_FUNCNAME("CdlBuildable::update_build_info"); - CYG_REPORT_FUNCARG2XV(this, &build_info); - CYG_PRECONDITION_THISC(); - CYG_PRECONDITIONC("" != library); - - if (!is_active()) { - CYG_REPORT_RETURN(); - return; - } - - CdlConstValuable valuable = dynamic_cast(this); - if (0 != valuable) { - if (!valuable->is_enabled()) { - CYG_REPORT_RETURN(); - return; - } - } - - update_all_build_info(build_info, library); - - CYG_REPORT_RETURN(); -} - -//}}} -//{{{ update_all_build_info() - -// ---------------------------------------------------------------------------- -// There are four properties to be considered, each of which may occur -// multiple times: "compile", "object", "make_object", and "make". -// Each of these will result in separate additions to the build_info -// structure. - -void -CdlBuildableBody::update_all_build_info(CdlBuildInfo_Loadable& build_info, std::string package_library) const -{ - CYG_REPORT_FUNCNAME("CdlBuildable::update_all_build_info"); - CYG_REPORT_FUNCARG2XV(this, &build_info); - CYG_PRECONDITION_THISC(); - CYG_PRECONDITIONC("" != package_library); - - // Get some information about the owning loadable first. - CdlLoadable loadable = get_owner(); - CYG_ASSERT_CLASSC(loadable); - std::string directory = loadable->get_directory(); - std::string repository = loadable->get_repository(); - CYG_ASSERTC("" != directory); - CYG_ASSERTC("" != repository); - CdlInterpreter interp = loadable->get_interpreter(); - CYG_ASSERT_CLASSC(interp); - - // The interpreter needs some information about the locations - // of various things. This code has to be kept in step with - // CdlLoadable::find_relative_file() - interp->set_variable("::cdl_topdir", repository); - interp->set_variable("::cdl_pkgdir", directory); - - // For many packages the sources will reside in a src subdirectory. - // For simple packages the sources may live directly at the toplevel - bool has_src_subdir = loadable->has_subdirectory("src"); - - // NOTE: the object property is not yet supported - std::vector compile_properties; - get_properties(CdlPropertyId_Compile, compile_properties); - std::vector makeobject_properties; - get_properties(CdlPropertyId_MakeObject, makeobject_properties); - std::vector make_properties; - get_properties(CdlPropertyId_Make, make_properties); - std::vector::const_iterator prop_i; - - for (prop_i = compile_properties.begin(); prop_i != compile_properties.end(); prop_i++) { - CdlProperty_StringVector compile_prop = dynamic_cast(*prop_i); - CYG_LOOP_INVARIANT_CLASSC(compile_prop); - - // Does this property have a library option? - std::string current_library = compile_prop->get_option("library"); - if ("" == current_library) { - current_library = package_library; - } - - const std::vector& files = compile_prop->get_strings(); - std::vector::const_iterator file_i; - - for (file_i = files.begin(); file_i != files.end(); file_i++) { - - // For each listed file, try to find it. If this is unsuccessful - // then assume that the file will be generated later on. - std::string path = loadable->find_relative_file(*file_i, "src"); - if ("" == path) { - if (has_src_subdir) { - path = "src/" + *file_i; - } else { - path = *file_i; - } - } - - // Now check whether or not the specified file is already present. - std::vector::const_iterator info_i; - for (info_i = build_info.compiles.begin(); info_i != build_info.compiles.end(); info_i++) { - if ((current_library == info_i->library) && (path == info_i->source)) { - break; - } - } - if (info_i == build_info.compiles.end()) { - CdlBuildInfo_Compile new_info; - new_info.library = current_library; - new_info.source = path; - build_info.compiles.push_back(new_info); - } - } - } - - for (prop_i = makeobject_properties.begin(); prop_i != makeobject_properties.end(); prop_i++) { - CdlProperty_String prop = dynamic_cast(*prop_i); - CYG_LOOP_INVARIANT_CLASSC(prop); - - // Does thie property have a library option? - std::string current_library = prop->get_option("library"); - if ("" == current_library) { - current_library = package_library; - } - - // How about a priority field? The default priority for make_object is 100 - // We can rely on the validation done during the parsing process - cdl_int priority = 100; - std::string priority_option = prop->get_option("priority"); - if ("" != priority_option) { - Cdl::string_to_integer(priority_option, priority); - } - - // What we need now is the separate target, deps, and rules. These - // can be obtained via a utility. The raw data will have been validated - // already. - std::string raw_data = prop->get_string(); - std::string target; - std::string deps; - std::string rules; - std::string error_msg; - bool result; - - result = CdlBuildableBody::split_custom_build_step(raw_data, target, deps, rules, error_msg); - CYG_ASSERTC(true == result); - - // Construct a local object, then copy it into the vector - CdlBuildInfo_MakeObject local_copy; - local_copy.priority = priority; - local_copy.library = current_library; - local_copy.object = target; - local_copy.deps = deps; - local_copy.rules = rules; - - build_info.make_objects.push_back(local_copy); - } - - for (prop_i = make_properties.begin(); prop_i != make_properties.end(); prop_i++) { - CdlProperty_String prop = dynamic_cast(*prop_i); - CYG_LOOP_INVARIANT_CLASSC(prop); - - // Is there a priority field? The default priority for make is - // 300 We can rely on the validation done during the parsing - // process - cdl_int priority = 300; - std::string priority_option = prop->get_option("priority"); - if ("" != priority_option) { - Cdl::string_to_integer(priority_option, priority); - } - - // What we need now is the separate target, deps, and rules. These - // can be obtained via a utility. The raw data will have been validated - // already. - std::string raw_data = prop->get_string(); - std::string target; - std::string deps; - std::string rules; - std::string error_msg; - bool result; - - result = CdlBuildableBody::split_custom_build_step(raw_data, target, deps, rules, error_msg); - CYG_ASSERTC(true == result); - - // Construct a local object, then copy it into the vector - CdlBuildInfo_Make local_copy; - local_copy.priority = priority; - local_copy.target = target; - local_copy.deps = deps; - local_copy.rules = rules; - - build_info.makes.push_back(local_copy); - } - - CYG_REPORT_RETURN(); -} - -//}}} - -//}}} -//{{{ CdlBuildLoadableBody - -//{{{ Class variables - -// ---------------------------------------------------------------------------- -// This variable controls the default library that should be generated. -// Some applications may wish to override this. -char* CdlBuildLoadableBody::default_library_name = "libtarget.a"; - -// The pattern that should be used to identify header files. -// FIXME: this information should come out of a data file -char* CdlBuildLoadableBody::default_headers_glob_pattern = "*.h *.hxx *.inl *.si *.inc"; - -//}}} -//{{{ The simple stuff - -// ---------------------------------------------------------------------------- - -CdlBuildLoadableBody::CdlBuildLoadableBody() - : CdlLoadableBody() -{ - CYG_REPORT_FUNCNAME("CdlBuildLoadable:: default constructor"); - CYG_REPORT_FUNCARG1XV(this); - - // There is no data to initialize - cdlbuildloadablebody_cookie = CdlBuildLoadableBody_Magic; - CYGDBG_MEMLEAK_CONSTRUCTOR(); - - CYG_POSTCONDITION_THISC(); - CYG_REPORT_RETURN(); -} - -CdlBuildLoadableBody::~CdlBuildLoadableBody() -{ - CYG_REPORT_FUNCNAME("CdlBuildLoadable:: destructor"); - CYG_REPORT_FUNCARG1XV(this); - CYG_PRECONDITION_THISC(); - - cdlbuildloadablebody_cookie = CdlBuildLoadableBody_Invalid; - CYGDBG_MEMLEAK_DESTRUCTOR(); - - CYG_REPORT_RETURN(); -} - -// ---------------------------------------------------------------------------- - -std::string -CdlBuildLoadableBody::get_class_name() const -{ - CYG_REPORT_FUNCNAME("CdlBuildLoadable::get_class_name"); - CYG_PRECONDITION_THISC(); - CYG_REPORT_RETURN(); - return "build_loadable"; -} - -// ---------------------------------------------------------------------------- - -bool -CdlBuildLoadableBody::check_this(cyg_assert_class_zeal zeal) const -{ - if (CdlBuildLoadableBody_Magic != cdlbuildloadablebody_cookie) { - return false; - } - CYGDBG_MEMLEAK_CHECKTHIS(); - return CdlContainerBody::check_this(zeal) && CdlNodeBody::check_this(zeal); -} - -//}}} -//{{{ Property parsers - -// ---------------------------------------------------------------------------- - -void -CdlBuildLoadableBody::add_property_parsers(std::vector& parsers) -{ - CYG_REPORT_FUNCNAME("CdlBuildLoadable::add_property_parsers"); - - static CdlInterpreterCommandEntry commands[] = - { - CdlInterpreterCommandEntry("library", &CdlBuildLoadableBody::parse_library ), - CdlInterpreterCommandEntry("makefile", &CdlBuildLoadableBody::parse_makefile ), - CdlInterpreterCommandEntry("include_dir", &CdlBuildLoadableBody::parse_include_dir ), - CdlInterpreterCommandEntry("include_files", &CdlBuildLoadableBody::parse_include_files ), - CdlInterpreterCommandEntry("", 0 ) - }; - - for (int i = 0; commands[i].command != 0; i++) { - std::vector::const_iterator j; - for (j = parsers.begin(); j != parsers.end(); j++) { - if (commands[i].name == j->name) { - if (commands[i].command != j->command) { - CYG_FAIL("Property names are being re-used"); - } - break; - } - } - if (j == parsers.end()) { - parsers.push_back(commands[i]); - } - } - - CYG_REPORT_RETURN(); -} - -void -CdlBuildLoadableBody::check_properties(CdlInterpreter interp) -{ - CYG_REPORT_FUNCNAME("CdlBuildLoadable::check_properties"); - CYG_REPORT_FUNCARG2XV(this, interp); - CYG_PRECONDITION_THISC(); - CYG_PRECONDITION_CLASSC(interp); - - CdlNodeBody::check_properties(interp); - - CYG_REPORT_RETURN(); -} - -// ---------------------------------------------------------------------------- -// syntax: library -// -// NOTE: there should probably be a check that the library name is in -// a valid format, i.e. libxxx.a - -int -CdlBuildLoadableBody::parse_library(CdlInterpreter interp, int argc, const char* argv[]) -{ - CYG_REPORT_FUNCNAMETYPE("parse_library", "result %d"); - - int result = CdlParse::parse_string_property(interp, argc, argv, CdlPropertyId_Library, 0, 0); - - CYG_REPORT_RETVAL(result); - return result; -} - -// ---------------------------------------------------------------------------- -// syntax: makefile -// -// NOTE: possibly there should be a check that the makefile exists. -// Do we want to allow build_proc's to generate makefiles? -int -CdlBuildLoadableBody::parse_makefile(CdlInterpreter interp, int argc, const char* argv[]) -{ - CYG_REPORT_FUNCNAMETYPE("parse_makefile", "result %d"); - - int result = CdlParse::parse_string_property(interp, argc, argv, CdlPropertyId_Makefile, 0, 0); - - CYG_REPORT_RETVAL(result); - return result; -} - -// ---------------------------------------------------------------------------- -// syntax: include_dir -int -CdlBuildLoadableBody::parse_include_dir(CdlInterpreter interp, int argc, const char* argv[]) -{ - CYG_REPORT_FUNCNAMETYPE("parse_include_dir", "result %d"); - - int result = CdlParse::parse_string_property(interp, argc, argv, CdlPropertyId_IncludeDir, 0, 0); - - CYG_REPORT_RETVAL(result); - return result; -} - -// ---------------------------------------------------------------------------- -// Syntax: include_files -// -// This lists the header files that should be copied into the install tree -// as part of the build operation. In the absence of an include_files property -// there should be an include subdirectory, and all files in that subdirectory -// are assumed to be exportable headers. -// -// NOTE: add a finalizer to check that the files exist or get created. - -int -CdlBuildLoadableBody::parse_include_files(CdlInterpreter interp, int argc, const char* argv[]) -{ - CYG_REPORT_FUNCNAMETYPE("parse_include_files", "result %d"); - - int result = CdlParse::parse_stringvector_property(interp, argc, argv, CdlPropertyId_IncludeFiles, 0, 0, true); - - CYG_REPORT_RETVAL(result); - return result; -} - -//}}} -//{{{ update_build_info() - -// ---------------------------------------------------------------------------- -// This utility routine takes care of filling in a Buildinfo_Loadable -// structure with the appropriate header file information. This involves -// the following: -// -// 1) there may be an include_dir property. This affects the destination -// of any header files that are listed. -// -// 2) the loadable may or may not have an include subdirectory. For -// non-trivial packages the include subdirectory provides a clean -// way of separating interface and implementation. For simple -// packages it is too heavyweight. -// -// 3) there may be one or more include_files property. If so then these -// specify all the files that should be exported. -// -// 4) otherwise if there is an include subdirectory then we need to -// know all the header files in that subdirectory. A Tcl script is -// used for this. -// -// 5) otherwise all the header files below the package directory itself -// are of interest. - -static void -update_header_file_info(CdlConstBuildLoadable loadable, CdlBuildInfo_Loadable& build_info) -{ - CYG_REPORT_FUNCNAME("update_header_file_info"); - CYG_REPORT_FUNCARG2XV(loadable, &build_info); - CYG_PRECONDITION_CLASSC(loadable); - - std::string dest_dir = ""; - CdlProperty include_dir_prop = loadable->get_property(CdlPropertyId_IncludeDir); - if (0 != include_dir_prop) { - CdlProperty_String strprop = dynamic_cast(include_dir_prop); - CYG_ASSERT_CLASSC(strprop); - dest_dir = strprop->get_string(); - } - - bool has_include_subdir = loadable->has_subdirectory("include"); - - std::vector include_file_properties; - loadable->get_properties(CdlPropertyId_IncludeFiles, include_file_properties); - if (include_file_properties.size() > 0) { - std::vector::const_iterator prop_i; - for (prop_i = include_file_properties.begin(); prop_i != include_file_properties.end(); prop_i++) { - - CdlProperty_StringVector strvprop = dynamic_cast(*prop_i); - CYG_ASSERT_CLASSC(strvprop); - - const std::vector& filenames = strvprop->get_strings(); - std::vector::const_iterator file_i; - for (file_i = filenames.begin(); file_i != filenames.end(); file_i++) { - std::string path = loadable->find_relative_file(*file_i, "include"); - // Assume that the header file will be generated by a build_proc - if ("" == path) { - if (has_include_subdir) { - path = "include/" + *file_i; - } else { - path = *file_i; - } - } - CdlBuildInfo_Header local_copy; - local_copy.source = path; - local_copy.destination = ""; - if ("" != dest_dir) { - local_copy.destination = dest_dir + "/"; - } - // At this stage "path" may begin with "include/", which should not - // be present in the destination. - const char* tmp = path.c_str(); - if (0 == strncmp("include/", tmp, 8)) { - local_copy.destination += &(tmp[8]); - } else { - local_copy.destination += path; - } - build_info.headers.push_back(local_copy); - } - } - CYG_REPORT_RETURN(); - return; - } - - // It is necessary to search for the appropriate files. - CdlInterpreter interp = loadable->get_interpreter(); - std::string path = loadable->get_repository() + "/" + loadable->get_directory(); - if (has_include_subdir) { - std::vector files; - std::vector::const_iterator file_i; - interp->locate_all_files(path + "/include", files); - for (file_i = files.begin(); file_i != files.end(); file_i++) { - // NOTE: for now discard any header files in the pkgconf subdirectory - if (0 == strncmp("pkgconf/", file_i->c_str(), 8)) { - continue; - } - if ('~' == *(file_i->rbegin())) { - continue; - } - CdlBuildInfo_Header local_copy; - local_copy.source = "include/" + *file_i; - local_copy.destination = ""; - if ("" != dest_dir) { - local_copy.destination = dest_dir + "/"; - } - local_copy.destination += *file_i; - build_info.headers.push_back(local_copy); - } - } else { - // Look for all header files, which for now means files with - // a .h, .hxx, .inl or .inc extension. - // FIXME: the definition of what constitutes a header file - // should not be hard-wired here. - std::vector files; - std::vector::const_iterator file_i; - interp->locate_all_files(path, files); - for (file_i = files.begin(); file_i != files.end(); file_i++) { - - // Problems with libstdc++ versions, use C comparisons instead. - const char* c_string = file_i->c_str(); - unsigned int len = strlen(c_string); - if (((len >= 2) && (0 == strncmp(c_string + len - 2, ".h", 2))) || - ((len >= 4) && (0 == strncmp(c_string + len - 4, ".hxx", 4))) || - ((len >= 4) && (0 == strncmp(c_string + len - 4, ".inl", 4))) || - ((len >= 4) && (0 == strncmp(c_string + len - 4, ".inc", 4)))) { - - CdlBuildInfo_Header local_copy; - local_copy.source = *file_i; - local_copy.destination = ""; - if ("" != dest_dir) { - local_copy.destination = dest_dir + "/"; - } - local_copy.destination += *file_i; - build_info.headers.push_back(local_copy); - } - } - } - - CYG_REPORT_RETURN(); - return; -} - -// ---------------------------------------------------------------------------- -// Updating a loadable build's info involves two steps. First, there -// is some information associated with the loadable as a whole such as -// header files. Second, each buildable in the loadable (including itself) -// may contain properties such as compile etc. This is all handled via -// a CdlBuildable member function. - -void -CdlBuildLoadableBody::update_build_info(CdlBuildInfo& build_info) const -{ - CYG_REPORT_FUNCNAME("CdlBuildLoadable::update_build_info"); - CYG_REPORT_FUNCARG2XV(this, &build_info); - CYG_PRECONDITION_THISC(); - - // It is not possible to disable a loadable itself: either the - // loadable is present or it is not (although in some cases users - // may be able to change versions). However, because of reparenting - // it is possible for a loadable to be below a disabled container, - // and hence it is still necessary to check whether or not the - // loadable is active. - if (!is_active()) { - CYG_REPORT_RETURN(); - return; - } - - // Time to add a new CdlBuildInfo_Loadable object to the current - // vector. The name and directory can be filled in straightaway, - // the vectors will all be initialized to empty. - CdlBuildInfo_Loadable tmp_info; - build_info.entries.push_back(tmp_info); - CdlBuildInfo_Loadable& this_info = *(build_info.entries.rbegin()); - this_info.name = get_name(); - this_info.repository = get_repository(); - this_info.directory = get_directory(); - - // Take care of the header files - update_header_file_info(this, this_info); - - // Work out the library name appropriate for this loadable. - // There may be a library property, otherwise the global default - // should be used. - std::string loadable_library = default_library_name; - if (has_property(CdlPropertyId_Library)) { - CdlProperty_String strprop = dynamic_cast(get_property(CdlPropertyId_Library)); - loadable_library = strprop->get_string(); - } - - const std::vector& contents = get_owned(); - std::vector::const_iterator node_i; - for (node_i = contents.begin(); node_i != contents.end(); node_i++) { - CdlBuildable buildable = dynamic_cast(*node_i); - if (0 != buildable) { - buildable->update_build_info(this_info, loadable_library); - } - } - - CYG_REPORT_RETURN(); -} - -// This is much the same as the above, but there is no test for -// active either at the loadable level or for the individual buildables. -void -CdlBuildLoadableBody::update_all_build_info(CdlBuildInfo& build_info) const -{ - CYG_REPORT_FUNCNAME("CdlBuildLoadable::update_all_build_info"); - CYG_REPORT_FUNCARG2XV(this, &build_info); - CYG_PRECONDITION_THISC(); - - CdlBuildInfo_Loadable tmp_info; - build_info.entries.push_back(tmp_info); - CdlBuildInfo_Loadable& this_info = *(build_info.entries.rbegin()); - this_info.name = get_name(); - this_info.directory = get_directory(); - - std::string loadable_library = default_library_name; - if (has_property(CdlPropertyId_Library)) { - CdlProperty_String strprop = dynamic_cast(get_property(CdlPropertyId_Library)); - loadable_library = strprop->get_string(); - } - - const std::vector& contents = get_owned(); - std::vector::const_iterator node_i; - for (node_i = contents.begin(); node_i != contents.end(); node_i++) { - CdlBuildable buildable = dynamic_cast(*node_i); - if (0 != buildable) { - buildable->update_build_info(this_info, loadable_library); - } - } - - CYG_REPORT_RETURN(); - CYG_REPORT_RETURN(); -} - -//}}} - -//}}} -//{{{ Version number #define's - -// ---------------------------------------------------------------------------- -// Given a package xxxPKG_A_B_C with a version V1_2_3, generate additional -// #define's of the form: -// -// #define xxxNUM_A_B_C_VERSION_MAJOR 1 -// #define xxxNUM_A_B_C_VERSION_MINOR 2 -// #define xxxNUM_A_B_C_VERSION_RELEASE 3 -// -// The goal here is to allow application code to cope with API -// changes (which of course should be a rare event but cannot be -// eliminated completely). C preprocessor #if statements are -// essentially limited to numerical values, so there is no easy -// way of coping with V1_2_3 at the preprocessor level. However it -// is possible to cope with VERSION_NUMBER #define's. -// -// Note that only application code and third party packages are -// affected. -// -// These #define's go into system.h, alongside the main definition of -// the package. There seems to be little point in putting them in the -// package's own configuration header. -// -// There are three problems. First, what should be done for packages -// which do not follow the naming conventions? Given a completely -// random package rather than something like xxxPKG_..., what symbol -// names should be used? Basically, if the package does not follow the -// naming convention then there is no safe way of generating new -// symbols. Any names that are chosen might clash. Of course even for -// packages that do follow the naming convention a clash is still -// possible, just a lot less likely. -// -// Conclusion: if a package does not follow the naming convention, do -// not generate version #define's for it. -// -// Second, what happens if a different version numbering scheme is -// used? For example the release number might be absent. Version -// numbering schemes might change between releases, but application -// code may still check the #define's. -// -// Third and related, what should happen for "current" and anoncvs? Do -// we want to look at what other versions are installed and bump one -// of the numbers? -// -// Conclusion: the version #define's always have to be generated, -// even if they are not present in the version string, to allow -// application code to test these symbols anyway. A safe default is -// necessary, and -1 is probably the best bet. For example, if -// the version is bumped from 1.3.287 to 1.4 then the release number -// for the latter is set to -1. Another possible default would be -// 0, but that could cause problems for packages that start counting -// from 0 (not a common practice, but...) -// -// This leaves the question of what to do about "current". Chances are -// that "current" comes from anoncvs and is always more recent than -// any official release, so when comparing versions "current" should -// always be greater than anything else. This can be achieved by using -// a sufficiently large number for the major version. In practice -// it is cleaner to have another #define to indicate the current -// version, and then define package versions to match, i.e.: -// -// #define CYGNUM_VERSION_CURRENT 0x7fffff00 -// ... -// #define xxxNUM_A_B_C_VERSION_MAJOR CYGNUM_VERSION_CURRENT -// #define xxxNUM_A_B_C_VERSION_MINOR -1 -// #define xxxNUM_A_B_C_VERSION_RELEASE -1 -// -// All comparisons should now work sensibly. Leaving a little bit -// of slack for VERSION_CURRENT seems like a good precaution. - -static void -system_h_add_version_header(Tcl_Channel system_h) -{ - CYG_REPORT_FUNCNAME("system_h_add_version_header"); - Tcl_Write(system_h, "#define CYGNUM_VERSION_CURRENT 0x7fffff00\n", -1); - CYG_REPORT_RETURN(); -} - -static void -system_h_add_package_versioning(Tcl_Channel system_h, std::string name, std::string value) -{ - CYG_REPORT_FUNCNAME("system_h_add_package_versioning"); - - char name_buf[256]; - char line_buf[512]; - - // The first thing to check is that the package name can be used - // as the basis for the version symbols. - bool ok = false; - unsigned int i; - for (i = 0; i < name.size(); i++) { - if ('_' == name[i]) { - if (3 < i) { - if ((name[i-3] == 'P') && (name[i-2] == 'K') && (name[i-1] == 'G')) { - ok = true; - } - } - break; - } - } - if (name.size() >= 256) { - ok = false; - } - if (!ok) { - CYG_REPORT_RETURN(); - return; - } - - strcpy(name_buf, name.c_str()); - - // Change from xxxPKG to xxxNUM - name_buf[i - 3] = 'N'; - name_buf[i - 2] = 'U'; - name_buf[i - 1] = 'M'; - - // Now determine the version strings. - std::string major = "-1"; - std::string minor = "-1"; - std::string release = "-1"; - if ("current" == value) { - major = "CYGNUM_VERSION_CURRENT"; - } else { - Cdl::split_version_string(value, major, minor, release); - } - - sprintf(line_buf, "#define %s_VERSION_MAJOR %s\n", name_buf, major.c_str()); - Tcl_Write(system_h, line_buf, -1); - sprintf(line_buf, "#define %s_VERSION_MINOR %s\n", name_buf, minor.c_str()); - Tcl_Write(system_h, line_buf, -1); - sprintf(line_buf, "#define %s_VERSION_RELEASE %s\n", name_buf, release.c_str()); - Tcl_Write(system_h, line_buf, -1); - - CYG_REPORT_RETURN(); -} - -//}}} -//{{{ CdlDefinableBody - -//{{{ Basics - -// ---------------------------------------------------------------------------- - -CdlDefinableBody::CdlDefinableBody() -{ - CYG_REPORT_FUNCNAME("CdlDefinable:: default constructor"); - CYG_REPORT_FUNCARG1XV(this); - - // There is no data to initialize - cdldefinablebody_cookie = CdlDefinableBody_Magic; - CYGDBG_MEMLEAK_CONSTRUCTOR(); - - CYG_POSTCONDITION_THISC(); - CYG_REPORT_RETURN(); -} - -CdlDefinableBody::~CdlDefinableBody() -{ - CYG_REPORT_FUNCNAME("CdlDefinable:: destructor"); - CYG_REPORT_FUNCARG1XV(this); - CYG_PRECONDITION_THISC(); - - cdldefinablebody_cookie = CdlDefinableBody_Invalid; - CYGDBG_MEMLEAK_DESTRUCTOR(); - - CYG_REPORT_RETURN(); -} - -// ---------------------------------------------------------------------------- - -std::string -CdlDefinableBody::get_class_name() const -{ - CYG_REPORT_FUNCNAME("CdlDefinable::get_class_name"); - CYG_PRECONDITION_THISC(); - CYG_REPORT_RETURN(); - return "definable"; -} - -// ---------------------------------------------------------------------------- - -bool -CdlDefinableBody::check_this(cyg_assert_class_zeal zeal) const -{ - if (CdlDefinableBody_Magic != cdldefinablebody_cookie) { - return false; - } - CYGDBG_MEMLEAK_CHECKTHIS(); - return CdlNodeBody::check_this(zeal); -} - -//}}} -//{{{ add_property_parser() and check_properties() - -// ---------------------------------------------------------------------------- - -void -CdlDefinableBody::add_property_parsers(std::vector& parsers) -{ - CYG_REPORT_FUNCNAME("CdlDefinable::add_property_parsers"); - - static CdlInterpreterCommandEntry commands[] = - { - CdlInterpreterCommandEntry("no_define", &parse_no_define ), - CdlInterpreterCommandEntry("define", &parse_define ), - CdlInterpreterCommandEntry("define_format", &parse_define_format ), - CdlInterpreterCommandEntry("define_proc", &parse_define_proc ), - CdlInterpreterCommandEntry("if_define", &parse_if_define ), - CdlInterpreterCommandEntry("", 0 ) - }; - - for (int i = 0; commands[i].command != 0; i++) { - std::vector::const_iterator j; - for (j = parsers.begin(); j != parsers.end(); j++) { - if (commands[i].name == j->name) { - if (commands[i].command != j->command) { - CYG_FAIL("Property names are being re-used"); - } - break; - } - } - if (j == parsers.end()) { - parsers.push_back(commands[i]); - } - } - CdlNodeBody::add_property_parsers(parsers); - - CYG_REPORT_RETURN(); -} - -void -CdlDefinableBody::check_properties(CdlInterpreter interp) -{ - CYG_REPORT_FUNCNAME("CdlDefinable::check_properties"); - CYG_REPORT_FUNCARG2XV(this, interp); - CYG_PRECONDITION_THISC(); - CYG_PRECONDITION_CLASSC(interp); - - // There should be at most one each of no_define and define_format. - if (count_properties(CdlPropertyId_NoDefine) > 1) { - CdlParse::report_error(interp, "", "There should be at most one no_define property."); - } - if (count_properties(CdlPropertyId_DefineFormat) > 1) { - CdlParse::report_error(interp, "", "There should be at most one define_format property."); - } - if (has_property(CdlPropertyId_NoDefine) && has_property(CdlPropertyId_DefineFormat)) { - CdlParse::report_error(interp, "", "The no_define and define_format properties are mutually exclusive."); - } - // FIXME: the define_format property only makes sense for certain - // flavors. However the flavor property may not have been processed yet. - - CdlNodeBody::check_properties(interp); - - CYG_REPORT_RETURN(); -} - -//}}} -//{{{ Definable properties - -// ---------------------------------------------------------------------------- -// Syntax: no_define -int -CdlDefinableBody::parse_no_define(CdlInterpreter interp, int argc, const char* argv[]) -{ - CYG_REPORT_FUNCNAMETYPE("parse_no_define", "result %d"); - - int result = CdlParse::parse_minimal_property(interp, argc, argv, CdlPropertyId_NoDefine, 0, 0); - - CYG_REPORT_RETVAL(result); - return result; -} - -// ---------------------------------------------------------------------------- -// syntax: define - -// The argument to "define" should be a valid C preprocessor symbol. -static void -parse_define_final_check(CdlInterpreter interp, CdlProperty_String prop) -{ - CYG_REPORT_FUNCNAME("parse_define_final_check"); - CYG_PRECONDITION_CLASSC(prop); - CYG_PRECONDITION_CLASSC(interp); - - const std::string& str = prop->get_string(); - - if (!Cdl::is_valid_c_preprocessor_symbol(str)) { - CdlParse::report_property_parse_error(interp, prop, str + " is not a valid C preprocessor symbol"); - } - - // There may be a file option. At this stage the only valid filename - // that can be used here is system.h - std::string file_option = prop->get_option("file"); - if (("" != file_option) && ("system.h" != file_option)) { - CdlParse::report_property_parse_error(interp, prop, "Invalid -file option " + file_option); - } - - // FIXME: validate the format string - - CYG_REPORT_RETURN(); -} - -int -CdlDefinableBody::parse_define(CdlInterpreter interp, int argc, const char* argv[]) -{ - CYG_REPORT_FUNCNAMETYPE("parse_define", "result %d"); - - static char* options[] = { - "file:", - "format:", - 0 - }; - int result = CdlParse::parse_string_property(interp, argc, argv, CdlPropertyId_Define, options, &parse_define_final_check); - - CYG_REPORT_RETVAL(result); - return result; -} - - -// ---------------------------------------------------------------------------- -// syntax: define_format -// -// FIXME: it is possible to apply some checks to the string, e.g. that there -// is only one conversion operation. -// -// FIXME: also check that the flavor is sensible, define_format has no effect -// for none or bool -// -// FIXME: enforce mutual exclusion with no_define - -int -CdlDefinableBody::parse_define_format(CdlInterpreter interp, int argc, const char* argv[]) -{ - CYG_REPORT_FUNCNAMETYPE("parse_format", "result %d"); - - int result = CdlParse::parse_string_property(interp, argc, argv, CdlPropertyId_DefineFormat, 0, 0); - - CYG_REPORT_RETVAL(result); - return result; -} -// ---------------------------------------------------------------------------- -// syntax: define_proc -int -CdlDefinableBody::parse_define_proc(CdlInterpreter interp, int argc, const char* argv[]) -{ - CYG_REPORT_FUNCNAMETYPE("parse_define_proc", "result %d"); - - int result = CdlParse::parse_tclcode_property(interp, argc, argv, CdlPropertyId_DefineProc, 0, 0); - - CYG_REPORT_RETVAL(result); - return result; -} - -// ---------------------------------------------------------------------------- -// Syntax: if_define sym1 sym2 - -static void -parse_if_define_final_check(CdlInterpreter interp, CdlProperty_StringVector prop) -{ - CYG_REPORT_FUNCNAME("parse_if_define_final_check"); - CYG_PRECONDITION_CLASSC(interp); - CYG_PRECONDITION_CLASSC(prop); - - // There should be exactly two entries in the vector, and both of them should be - // valid preprocessor symbols. - const std::vector& strings = prop->get_strings(); - - if (2 != strings.size()) { - CdlParse::report_property_parse_error(interp, prop, "There should be exactly two arguments."); - } - if (!Cdl::is_valid_c_preprocessor_symbol(strings[0])) { - CdlParse::report_property_parse_error(interp, prop, strings[0] + " is not a valid C preprocessor symbol."); - } - if (!Cdl::is_valid_c_preprocessor_symbol(strings[1])) { - CdlParse::report_property_parse_error(interp, prop, strings[1] + " is not a valid C preprocessor symbol."); - } - - // There may be a file option. At this stage the only valid filename - // that can be used here is system.h - std::string file_option = prop->get_option("file"); - if (("" != file_option) && ("system.h" != file_option)) { - CdlParse::report_property_parse_error(interp, prop, "Invalid -file option " + file_option); - } -} - -int -CdlDefinableBody::parse_if_define(CdlInterpreter interp, int argc, const char* argv[]) -{ - CYG_REPORT_FUNCNAMETYPE("parse_if_define", "result %d"); - - char* options[] = { - "file:", - 0 - }; - int result = CdlParse::parse_stringvector_property(interp, argc, argv, CdlPropertyId_IfDefine, options, - &parse_if_define_final_check, false); - - CYG_REPORT_RETVAL(result); - return result; -} - -//}}} -//{{{ generate_config_header() - -// ---------------------------------------------------------------------------- -// This code needs to allow for the following properties. -// -// 1) no_define. This suppresses the default #define generation. -// -// 2) define_format ][-format ] symbol -// -// 4) define_proc -// -// 5) if_define - -void -CdlDefinableBody::generate_config_header(Tcl_Channel this_hdr, Tcl_Channel system_h) const -{ - CYG_REPORT_FUNCNAME("CdlDefinable::generate_config_header"); - CYG_REPORT_FUNCARG1XV(this); - CYG_PRECONDITION_THISC(); - - CdlLoadable loadable = get_owner(); - CdlInterpreter interp = loadable->get_interpreter(); - - // This definable is known to be active. However it may or may not be enabled. - CYG_PRECONDITIONC(is_active()); - - std::string name = get_name(); - CdlValueFlavor flavor = CdlValueFlavor_Bool; - std::string value = "1"; - CdlConstValuable valuable = dynamic_cast(this); - if (0 != valuable) { - // It is always possible to check the enabled() flag. - if (!valuable->is_enabled()) { - CYG_REPORT_RETURN(); - return; - } - // The value is only valid for BoolData and Data flavors, and may - // not have been provided. If there is no value then this option - // should not generate a #define - flavor = valuable->get_flavor(); - if ((CdlValueFlavor_BoolData == flavor) || (CdlValueFlavor_Data == flavor)) { - value = valuable->get_value(); - } - } - - // Flavor and value are now both set to sensible strings. - // First, check the no_define property. If this is present then the default - // #define generation should be suppressed. - if (!has_property(CdlPropertyId_NoDefine)) { - - // OK, it is necessary to generate at least one #define. - // If this node is actually a loadable then the #define should go - // into system.h, otherwise into the current header - Tcl_Channel chan = this_hdr; - if (dynamic_cast((CdlConstNode)this) == loadable) { - chan = system_h; - } - - // For flavors None and Bool, there should be just one #define - if ((CdlValueFlavor_None == flavor) || (CdlValueFlavor_Bool == flavor)) { - std::string define = "#define " + name + " 1\n"; - Tcl_Write(chan, const_cast(define.c_str()), -1); - } else { - // If there is a format string then that controls the default - // value display. - if (!has_property(CdlPropertyId_DefineFormat)) { - std::string define = "#define " + name + " " + value + "\n"; - Tcl_Write(chan, const_cast(define.c_str()), -1); - } else { - CdlProperty_String strprop = dynamic_cast(get_property(CdlPropertyId_DefineFormat)); - CYG_ASSERT_CLASSC(strprop); - std::string format = strprop->get_string(); - std::string cmd = "return \"#define " + name + " [format " + format + " " + value + "]\n\""; - std::string define; - if (TCL_OK != interp->eval(cmd, define)) { - throw CdlInputOutputException("Internal error executing tcl fragment to process define_format property"); - } - Tcl_Write(chan, const_cast(define.c_str()), -1); - } - - // There may also be a separate #define of the form _, - // if that is a valid preprocessor symbol. - std::string tmp = name + "_" + value; - if (Cdl::is_valid_c_preprocessor_symbol(tmp)) { - tmp = "#define "+ tmp + "\n"; - Tcl_Write(chan, const_cast(tmp.c_str()), -1); - } - - // For loadables, add additional version information to system_h - if (dynamic_cast((CdlConstNode)this) == loadable) { - system_h_add_package_versioning(system_h, name, value); - } - } - } - - // Next, check for any additional define properties - std::vector define_props; - get_properties(CdlPropertyId_Define, define_props); - std::vector::const_iterator prop_i; - for (prop_i = define_props.begin(); prop_i != define_props.end(); prop_i++) { - CdlProperty_String strprop = dynamic_cast(*prop_i); - CYG_ASSERT_CLASSC(strprop); - std::string symbol = strprop->get_string(); - - std::string file = strprop->get_option("file"); - Tcl_Channel chan = this_hdr; - if (("" != file) && ("system.h" == file)) { - chan = system_h; - } - - if ((CdlValueFlavor_None == flavor) || (CdlValueFlavor_Bool == flavor)) { - std::string define = "#define " + symbol + " 1\n"; - Tcl_Write(chan, const_cast(define.c_str()), -1); - } else { - std::string format = strprop->get_option("format"); - if ("" == format) { - std::string define = "#define " + symbol + " " + value + "\n"; - Tcl_Write(chan, const_cast(define.c_str()), -1); - } else { - std::string cmd = "return \"#define " + symbol + " [format " + format + " " + value + "]\n\""; - std::string define; - if (TCL_OK != interp->eval(cmd, define)) { - throw CdlInputOutputException("Internal error executing tcl fragment to process format option"); - } - Tcl_Write(chan, const_cast(define.c_str()), -1); - } - - std::string tmp = symbol + "_" + value; - if (Cdl::is_valid_c_preprocessor_symbol(tmp)) { - tmp = "#define " + tmp + "\n"; - Tcl_Write(chan, const_cast(tmp.c_str()), -1); - } - } - } - - // Now check for if_define properties - std::vector if_define_props; - get_properties(CdlPropertyId_IfDefine, if_define_props); - for (prop_i = if_define_props.begin(); prop_i != if_define_props.end(); prop_i++) { - CdlProperty_StringVector strprop = dynamic_cast(*prop_i); - CYG_ASSERT_CLASSC(strprop); - CYG_ASSERTC(2 == strprop->get_number_of_strings()); - - std::string sym1 = strprop->get_string(0); - std::string sym2 = strprop->get_string(1); - - Tcl_Channel chan = this_hdr; - std::string file = strprop->get_option("file"); - if (("" != file) && ("system.h" == file)) { - chan = system_h; - } - std::string data = "#ifdef " + sym1 + "\n# define " + sym2 + " 1\n#endif\n"; - Tcl_Write(chan, const_cast(data.c_str()), -1); - } - - // And define_proc properties - std::vector define_proc_props; - get_properties(CdlPropertyId_DefineProc, define_proc_props); - for (prop_i = define_proc_props.begin(); prop_i != define_proc_props.end(); prop_i++) { - CdlProperty_TclCode codeprop = dynamic_cast(*prop_i); - CYG_ASSERT_CLASSC(codeprop); - - cdl_tcl_code code = codeprop->get_code(); - std::string result; - if (TCL_OK != interp->eval(code, result)) { - throw CdlInputOutputException("Error evaluating define_proc property for " + name + "\n" + result); - } - } - - - CYG_REPORT_RETURN(); -} - -//}}} - -//}}} -//{{{ CdlDefineLoadableBody - -//{{{ Basics - -// ---------------------------------------------------------------------------- - -CdlDefineLoadableBody::CdlDefineLoadableBody() -{ - CYG_REPORT_FUNCNAME("CdlDefineLoadable:: default constructor"); - CYG_REPORT_FUNCARG1XV(this); - - cdldefineloadablebody_cookie = CdlDefineLoadableBody_Magic; - CYGDBG_MEMLEAK_CONSTRUCTOR(); - - CYG_POSTCONDITION_THISC(); - CYG_REPORT_RETURN(); -} - -CdlDefineLoadableBody::~CdlDefineLoadableBody() -{ - CYG_REPORT_FUNCNAME("CdlDefineLoadable:: destructor"); - CYG_REPORT_FUNCARG1XV(this); - CYG_PRECONDITION_THISC(); - - cdldefineloadablebody_cookie = CdlDefineLoadableBody_Invalid; - CYGDBG_MEMLEAK_DESTRUCTOR(); - - CYG_REPORT_RETURN(); -} - -// ---------------------------------------------------------------------------- - -std::string -CdlDefineLoadableBody::get_class_name() const -{ - CYG_REPORT_FUNCNAME("CdlDefineLoadable::get_class_name"); - CYG_PRECONDITION_THISC(); - CYG_REPORT_RETURN(); - return "define_loadable"; -} - -// ---------------------------------------------------------------------------- - -bool -CdlDefineLoadableBody::check_this(cyg_assert_class_zeal zeal) const -{ - if (CdlDefineLoadableBody_Magic != cdldefineloadablebody_cookie) { - return false; - } - CYGDBG_MEMLEAK_CHECKTHIS(); - return CdlLoadableBody::check_this(zeal) && CdlNodeBody::check_this(zeal); -} - -//}}} -//{{{ Property parsing - -// ---------------------------------------------------------------------------- - -void -CdlDefineLoadableBody::add_property_parsers(std::vector& parsers) -{ - CYG_REPORT_FUNCNAME("CdlDefineLoadable::add_property_parsers"); - - static CdlInterpreterCommandEntry commands[] = - { - CdlInterpreterCommandEntry("define_header", &parse_define_header), - CdlInterpreterCommandEntry("", 0 ) - }; - - for (int i = 0; commands[i].command != 0; i++) { - std::vector::const_iterator j; - for (j = parsers.begin(); j != parsers.end(); j++) { - if (commands[i].name == j->name) { - if (commands[i].command != j->command) { - CYG_FAIL("Property names are being re-used"); - } - break; - } - } - if (j == parsers.end()) { - parsers.push_back(commands[i]); - } - } - CdlNodeBody::add_property_parsers(parsers); - - CYG_REPORT_RETURN(); -} - -void -CdlDefineLoadableBody::check_properties(CdlInterpreter interp) -{ - CYG_REPORT_FUNCNAME("CdlDefineLoadable::check_properties"); - CYG_REPORT_FUNCARG2XV(this, interp); - CYG_PRECONDITION_THISC(); - CYG_PRECONDITION_CLASSC(interp); - - // There should be at most one define_header property - int count = count_properties(CdlPropertyId_DefineHeader); - if (count> 1) { - CdlParse::report_error(interp, "", "There should be at most one define_header property."); - } - // FIXME: filename validation - - CdlNodeBody::check_properties(interp); - - CYG_REPORT_RETURN(); -} - -// ---------------------------------------------------------------------------- -// syntax: define_header
-int -CdlDefineLoadableBody::parse_define_header(CdlInterpreter interp, int argc, const char* argv[]) -{ - CYG_REPORT_FUNCNAMETYPE("parse_define_header", "result %d"); - - int result = CdlParse::parse_string_property(interp, argc, argv, CdlPropertyId_DefineHeader, 0, 0); - - CYG_REPORT_RETVAL(result); - return result; -} - -//}}} -//{{{ generate_config_header() - -// ---------------------------------------------------------------------------- -void -CdlDefineLoadableBody::generate_config_header(Tcl_Channel this_hdr, Tcl_Channel system_h) const -{ - CYG_REPORT_FUNCNAME("CdlDefineLoadable::generate_config_header"); - CYG_REPORT_FUNCARG1XV(this); - CYG_PRECONDITION_THISC(); - - CdlInterpreter interp = get_interpreter(); - Tcl_RegisterChannel(interp->get_tcl_interpreter(), this_hdr); - Tcl_RegisterChannel(interp->get_tcl_interpreter(), system_h); - - CdlInterpreterBody::ContextSupport(interp, std::string("Package ") + this->get_name() + ", header file generation"); - - try { - interp->set_variable("::cdl_header", Tcl_GetChannelName(this_hdr)); - interp->set_variable("::cdl_system_header", Tcl_GetChannelName(system_h)); - - const std::vector& contents = get_owned(); - std::vector::const_iterator node_i; - for (node_i = contents.begin(); node_i != contents.end(); node_i++) { - CdlDefinable definable = dynamic_cast(*node_i); - if (0 == definable) { - continue; - } - if (!definable->is_active()) { - continue; - } - definable->generate_config_header(this_hdr, system_h); - } - - interp->unset_variable("::cdl_header"); - interp->unset_variable("::cdl_system_header"); - } catch(...) { - Tcl_UnregisterChannel(interp->get_tcl_interpreter(), this_hdr); - Tcl_UnregisterChannel(interp->get_tcl_interpreter(), system_h); - throw; - } - - Tcl_UnregisterChannel(interp->get_tcl_interpreter(), this_hdr); - Tcl_UnregisterChannel(interp->get_tcl_interpreter(), system_h); - - CYG_REPORT_RETURN(); -} - -//}}} -//{{{ get_config_headers() - -// ---------------------------------------------------------------------------- -// What header file should be generated for this loadable? -// -// If there is a define_header property then this should be used. -// Otherwise a filename is constructed from the loadable's name. - -std::string -CdlDefineLoadableBody::get_config_header() const -{ - CYG_REPORT_FUNCNAME("CdlDefineLoadable::get_config_headers"); - CYG_REPORT_FUNCARG1XV(this); - CYG_PRECONDITION_THISC(); - - std::string result = ""; - CdlProperty prop = get_property(CdlPropertyId_DefineHeader); - if (0 != prop) { - CdlProperty_String string_prop = dynamic_cast(prop); - CYG_ASSERT_CLASSC(string_prop); - result = string_prop->get_string(); - } else { - std::string tmp = get_name(); - result = Cdl::get_short_form(tmp); - result += ".h"; - } - CYG_REPORT_RETURN(); - return result; -} - -//}}} - -//}}} -//{{{ CdlToplevel - -//{{{ CdlToplevel::get_build_info() - -// ---------------------------------------------------------------------------- -// Essentially this code involves iterating over the loadables vector, -// looking for BuildLoadables and invoking their update_build_info() -// member function. In addition, if there is currently some data in -// the build_info vector (probably from a previous call) then that -// must be cleared. - -void -CdlToplevelBody::get_build_info(CdlBuildInfo& build_info) -{ - CYG_REPORT_FUNCNAME("CdlToplevel::get_build_info"); - CYG_REPORT_FUNCARG2XV(this, &build_info); - CYG_PRECONDITION_THISC(); - - if (0 != build_info.entries.size()) { - build_info.entries.clear(); - } - - const std::vector& loadables = get_loadables(); - std::vector::const_iterator load_i; - for (load_i = loadables.begin(); load_i != loadables.end(); load_i++) { - CdlConstBuildLoadable bl = dynamic_cast(*load_i); - if (0 != bl) { - bl->update_build_info(build_info); - } - } - - CYG_REPORT_RETURN(); -} - -//}}} -//{{{ CdlToplevel::get_all_build_info() - -// ---------------------------------------------------------------------------- -// This is just like get_build_info(), but calls a different -// BuildLoadable member. - -void -CdlToplevelBody::get_all_build_info(CdlBuildInfo& build_info) -{ - CYG_REPORT_FUNCNAME("CdlToplevel::get_all_build_info"); - CYG_REPORT_FUNCARG2XV(this, &build_info); - CYG_PRECONDITION_THISC(); - - if (0 != build_info.entries.size()) { - build_info.entries.clear(); - } - - const std::vector& loadables = get_loadables(); - std::vector::const_iterator load_i; - for (load_i = loadables.begin(); load_i != loadables.end(); load_i++) { - CdlConstBuildLoadable bl = dynamic_cast(*load_i); - if (0 != bl) { - bl->update_all_build_info(build_info); - } - } - - CYG_REPORT_RETURN(); -} - -//}}} -//{{{ CdlToplevel::generate_config_headers() - -// ---------------------------------------------------------------------------- -// Generating the config headers. This involves the following steps: -// -// 1) for every DefineLoadable, find out what header file should -// be generated. Note that some loadables may share a header file. -// -// 2) create a temporary version of system.h. Note that it is not -// a good idea to just overwrite an existing system.h, chances -// are pretty good that the file will not have changed, and -// updating it unnecessarily will result in unnecessary rebuilds -// due to header file dependencies. -// -// 3) for each file that should be generated, create a temporary -// version and allow all applicable loadables to update it. - -// A utility to compare two files and do the right thing. -// This requires some simple Tcl code. -static void -compare_and_copy(CdlInterpreter interp, std::string file1, std::string file2) -{ - CYG_REPORT_FUNCNAME("compare_and_copy"); - CYG_PRECONDITION_CLASSC(interp); - CYG_PRECONDITIONC("" != file1); - CYG_PRECONDITIONC("" != file2); - CYG_PRECONDITIONC(file1 != file2); - - static char compare_and_copy_script[] = "\ -if {[file exists \"$::cdl_compare_and_copy_file2\"] == 0} { \n\ - catch { file rename -- $::cdl_compare_and_copy_file1 $::cdl_compare_and_copy_file2} \n\ - return \n\ -} \n\ -set fd [open \"$::cdl_compare_and_copy_file1\" r] \n\ -set data1 [read $fd] \n\ -close $fd \n\ -set fd [open \"$::cdl_compare_and_copy_file2\" r] \n\ -set data2 [read $fd] \n\ -close $fd \n\ -if {$data1 == $data2} { \n\ - file delete \"$::cdl_compare_and_copy_file1\" \n\ -} else { \n\ - catch { file rename -force -- $::cdl_compare_and_copy_file1 $::cdl_compare_and_copy_file2 } \n\ -} \n\ -"; - - interp->set_variable("::cdl_compare_and_copy_file1", file1); - interp->set_variable("::cdl_compare_and_copy_file2", file2); - std::string tcl_result; - if (TCL_OK != interp->eval(compare_and_copy_script, tcl_result)) { - throw CdlInputOutputException("internal error manipulating temporary header " + file1 + " and target " + file2 + - "\n" + tcl_result); - } -} - -void -CdlToplevelBody::generate_config_headers(std::string directory) -{ - CYG_REPORT_FUNCNAME("CdlToplevel::generate_config_headers"); - CYG_REPORT_FUNCARG1XV(this); - CYG_PRECONDITION_THISC(); - CYG_ASSERTC("" != directory); - - // Replace any backslashes in the path with forward slashes. The - // latter are used throughout the library - // NOTE: this is not i18n-friendly. - for (unsigned int i = 0; i < directory.size(); i++) { - if ('\\' == directory[i]) { - directory[i] = '/'; - } - } - - CdlInterpreter interp = get_interpreter(); - std::string tcl_result; - if ((TCL_OK != interp->eval("file isdirectory \"" + directory + "\"", tcl_result)) || - (tcl_result != "1")) { - throw CdlInputOutputException("target " + directory + " is not a valid existing directory."); - } - - std::vector > headers; - const std::vector& loadables = get_loadables(); - std::vector::const_iterator load_i; - for (load_i = loadables.begin(); load_i != loadables.end(); load_i++) { - CdlDefineLoadable tmp = dynamic_cast(*load_i); - if (0 != tmp) { - std::string hdr = tmp->get_config_header(); - headers.push_back(std::make_pair(tmp, hdr)); - } - } - - static char banner_format[] = -"#ifndef CYGONCE_PKGCONF_%s\n\ -#define CYGONCE_PKGCONF_%s\n\ -/*\n\ - * File \n\ - *\n\ - * This file is generated automatically by the configuration\n\ - * system. It should not be edited. Any changes to this file\n\ - * may be overwritten.\n\ - */\n\ -\n"; -#ifdef _WIN32 - // Create three channels which Tcl will use for standard streams - // if these streams do not already exist. This avoids a Tcl - // problem which can prevent closure of system.h. (FIXME) - Tcl_Channel stdin_chan = Tcl_OpenFileChannel(interp->get_tcl_interpreter(), "nul", "w", 0666); - Tcl_Channel stdout_chan = Tcl_OpenFileChannel(interp->get_tcl_interpreter(), "nul", "w", 0666); - Tcl_Channel stderr_chan = Tcl_OpenFileChannel(interp->get_tcl_interpreter(), "nul", "w", 0666); - Tcl_RegisterChannel(0, stdin_chan); - Tcl_RegisterChannel(0, stdout_chan); - Tcl_RegisterChannel(0, stderr_chan); -#endif - // Assume for now that files __libcdl_file1 and __libcdl_file2 are - // legal on all platforms of interest, and that nobody is going to - // export to these. - std::string system_h_name = directory + "/__libcdl_file1"; - Tcl_Channel system_h = Tcl_OpenFileChannel(interp->get_tcl_interpreter(), - const_cast(system_h_name.c_str()), "w", 0666); - if (0 == system_h) { - throw CdlInputOutputException("Unable to open file " + system_h_name + "\n" + - interp->get_result()); - } - // The channel will be registered and unregistered in several - // different interpreters. This call prevents the channel from - // disappearing prematurely. - Tcl_RegisterChannel(0, system_h); - - // Make sure that this operation is undone if necessary. - try { - // Now fill in system.h with the appropriate data. Start with the banner. - char local_buf[512]; - sprintf(local_buf, banner_format, "SYSTEM_H", "SYSTEM_H", "system.h"); - Tcl_Write(system_h, local_buf, -1); - - // Add generic version information - system_h_add_version_header(system_h); - - // The rest of system.h will be filled in by the following loop. - // - // Walk down the previously constructed headers vector, create - // appropriate files, and let each DefineLoadable fill in the - // file for itself. - std::vector >::iterator outer_i; - std::vector >::iterator inner_i; - for (outer_i = headers.begin(); outer_i != headers.end(); outer_i++) { - if ("" == outer_i->second) { - continue; - } - std::string target_name = outer_i->second; - std::string header_name = directory + "/__libcdl_file2"; - Tcl_Channel header_h = Tcl_OpenFileChannel(interp->get_tcl_interpreter(), - const_cast(header_name.c_str()), "w", 0666); - if (0 == header_h) { - throw CdlInputOutputException("Unable to open file " + header_name + "\n" + - interp->get_result()); - } - // The channel may be used in several different interpreters, so - // do an extra register operation - Tcl_RegisterChannel(0, header_h); - - try { - // Output the banner. This requires an all-upper-case version of the - // header name. - std::string upper_case; - for (unsigned int i = 0; i < target_name.size(); i++) { - if (islower(target_name[i])) { - upper_case += toupper(target_name[i]); - } else if ('.' == target_name[i]) { - upper_case += '_'; - } else { - upper_case += target_name[i]; - } - } - sprintf(local_buf, banner_format, upper_case.c_str(), upper_case.c_str(), target_name.c_str()); - Tcl_Write(header_h, local_buf, -1); - - // Now iterate over all the loadables looking for ones which - // should generate #define's for this header, and invoke the - // appropriate member function. - for (inner_i = outer_i; inner_i != headers.end(); inner_i++) { - if (inner_i->second == target_name) { - inner_i->first->generate_config_header(header_h, system_h); - inner_i->second = ""; - } - } - - // The header file has now been updated. Close it and decide whether - // or not to replace the old version - Tcl_Write(header_h, "\n#endif\n", -1); - } catch(...) { - Tcl_UnregisterChannel(0, header_h); - throw; - } - Tcl_UnregisterChannel(0, header_h); - compare_and_copy(interp, header_name, directory + "/" + target_name); - } - - Tcl_Write(system_h, "\n#endif\n", -1); - } catch(...) { - Tcl_UnregisterChannel(0, system_h); - throw; - } - - // This call to UnregisterChannel automatically closes the - // channel, there is no need for an explicit Tcl_Close() call. - Tcl_UnregisterChannel(0, system_h); -#ifdef _WIN32 - Tcl_UnregisterChannel(0, stderr_chan); - Tcl_UnregisterChannel(0, stdout_chan); - Tcl_UnregisterChannel(0, stdin_chan); -#endif - compare_and_copy(interp, system_h_name, directory +"/system.h"); -} - -//}}} -//{{{ CdlToplevel::get_config_headers() - -// ---------------------------------------------------------------------------- -// Return details of the header files that should be generated. This -// allows higher-level code to detect files that should no longer -// be present, amongst other uses. -// -// The main complication is that some packages may wish to share the -// same header file, especially hardware packages. - -void -CdlToplevelBody::get_config_headers(std::vector& headers) -{ - CYG_REPORT_FUNCNAME("CdlToplevelBody::get_config_headers"); - CYG_REPORT_FUNCARG2XV(this, &headers); - CYG_PRECONDITION_THISC(); - - // Allow the vector argument to be re-used in multiple calls. - // Strictly speaking this is better done at the application - // level, but the behaviour is consistent with get_build_info(); - headers.clear(); - - // There will always be a system.h header file with details - // of the loadables. - // FIXME: the name of this file should probably be controllable - headers.push_back("system.h"); - - // Now check each loadable and adds its header file, assuming - // this is unique. - const std::vector& loadables = get_loadables(); - std::vector::const_iterator i; - for (i = loadables.begin(); i != loadables.end(); i++) { - CdlDefineLoadable current = dynamic_cast(*i); - if (0 != current) { - std::string its_file = current->get_config_header(); - CYG_LOOP_INVARIANTC("" != its_file); - if (std::find(headers.begin(), headers.end(), its_file) == headers.end()) { - headers.push_back(its_file); - } - } - } - - CYG_REPORT_RETURN(); -} - -//}}} -//{{{ CdlToplevel::generate_build_tree() - -void -CdlToplevelBody::generate_build_tree(std::string build_tree, std::string install_tree) -{ -} - -//}}} - -//}}} diff --git a/host/libcdl/cdl.dsp b/host/libcdl/cdl.dsp deleted file mode 100644 --- a/host/libcdl/cdl.dsp +++ /dev/null @@ -1,269 +0,0 @@ -# Microsoft Developer Studio Project File - Name="cdl" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Generic Project" 0x010a - -CFG=cdl - Win32 ANSI Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "cdl.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "cdl.mak" CFG="cdl - Win32 ANSI Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "cdl - Win32 Release" (based on "Win32 (x86) Generic Project") -!MESSAGE "cdl - Win32 Debug" (based on "Win32 (x86) Generic Project") -!MESSAGE "cdl - Win32 ANSI Debug" (based on "Win32 (x86) Generic Project") -!MESSAGE "cdl - Win32 ANSI Release" (based on "Win32 (x86) Generic Project") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -MTL=midl.exe - -!IF "$(CFG)" == "cdl - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "V:\cdl\Release" -# PROP Intermediate_Dir "V:\cdl\Release\build" -# PROP Target_Dir "" - -!ELSEIF "$(CFG)" == "cdl - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "cdl___Win32_Debug" -# PROP BASE Intermediate_Dir "cdl___Win32_Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "V:\cdl\Debug" -# PROP Intermediate_Dir "V:\cdl\Debug\build" -# PROP Target_Dir "" - -!ELSEIF "$(CFG)" == "cdl - Win32 ANSI Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "cdl___Win32_ANSI_Debug" -# PROP BASE Intermediate_Dir "cdl___Win32_ANSI_Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "v:\cdl\Debug" -# PROP Intermediate_Dir "v:\cdl\Debug\build" -# PROP Target_Dir "" - -!ELSEIF "$(CFG)" == "cdl - Win32 ANSI Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "cdl___Win32_ANSI_Release" -# PROP BASE Intermediate_Dir "cdl___Win32_ANSI_Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "V:\cdl\Release" -# PROP Intermediate_Dir "V:\cdl\Release\build" -# PROP Target_Dir "" - -!ENDIF - -# Begin Target - -# Name "cdl - Win32 Release" -# Name "cdl - Win32 Debug" -# Name "cdl - Win32 ANSI Debug" -# Name "cdl - Win32 ANSI Release" -# Begin Source File - -SOURCE=.\base.cxx -# End Source File -# Begin Source File - -SOURCE=.\build.cxx -# End Source File -# Begin Source File - -SOURCE=.\cdl.hxx -# End Source File -# Begin Source File - -SOURCE=.\cdlcore.hxx -# End Source File -# Begin Source File - -SOURCE=.\cdlmisc.cxx -# End Source File -# Begin Source File - -SOURCE=.\ChangeLog - -!IF "$(CFG)" == "cdl - Win32 Release" - -# Begin Custom Build - Performing Custom Build Step for libCDL -IntDir=V:\cdl\Release\build -OutDir=V:\cdl\Release -InputPath=.\ChangeLog - -BuildCmds= \ - if not exist $(IntDir)\tools\configtool\standalone\common\Makefile sh -c "ECOSHOST=`echo ""puts [ file attributes [ pwd ] -shortname ]"" | tclsh`/.. ; echo ""ECOSHOST=$ECOSHOST"" ; echo ""TCLHOME=$TCLHOME"" ; mkdir -p `cygpath -u ""$(IntDir)""` ; cd `cygpath -u ""$(IntDir)""` && CC=cl CXX=cl `cygpath -u ""$ECOSHOST""`/configure --prefix=`cygpath -u ""$(OutDir)""` --with-tcl=`cygpath -u ""$TCLHOME""` --with-tcl_version=82" \ - cd $(IntDir) \ - v: \ - make --unix install \ - - -"$(OutDir)\lib\cdl.lib" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - $(BuildCmds) - -"$(OutDir)\lib\cyginfra.lib" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - $(BuildCmds) -# End Custom Build - -!ELSEIF "$(CFG)" == "cdl - Win32 Debug" - -# Begin Custom Build - Performing Custom Build Step for libCDL -IntDir=V:\cdl\Debug\build -OutDir=V:\cdl\Debug -InputPath=.\ChangeLog - -BuildCmds= \ - if not exist $(IntDir)\tools\configtool\standalone\common\Makefile sh -c "ECOSHOST=`echo ""puts [ file attributes [ pwd ] -shortname ]"" | tclsh`/.. ; echo ""ECOSHOST=$ECOSHOST"" ; echo ""TCLHOME=$TCLHOME"" ; mkdir -p `cygpath -u ""$(IntDir)""` ; cd `cygpath -u ""$(IntDir)""` && CC=cl CXX=cl `cygpath -u ""$ECOSHOST""`/configure --prefix=`cygpath -u ""$(OutDir)""` --with-tcl=`cygpath -u ""$TCLHOME""` --with-tcl_version=82d --enable-debug --enable-maintainer-mode" \ - cd $(IntDir) \ - v: \ - make --unix install \ - - -"$(OutDir)\lib\cdl.lib" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - $(BuildCmds) - -"$(OutDir)\lib\cyginfra.lib" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - $(BuildCmds) -# End Custom Build - -!ELSEIF "$(CFG)" == "cdl - Win32 ANSI Debug" - -# Begin Custom Build - Performing Custom Build Step for libCDL -IntDir=v:\cdl\Debug\build -OutDir=v:\cdl\Debug -InputPath=.\ChangeLog - -BuildCmds= \ - if not exist $(IntDir)\tools\configtool\standalone\common\Makefile sh -c "ECOSHOST=`echo ""puts [ file attributes [ pwd ] -shortname ]"" | tclsh`/.. ; echo ""ECOSHOST=$ECOSHOST"" ; echo ""TCLHOME=$TCLHOME"" ; mkdir -p `cygpath -u ""$(IntDir)""` ; cd `cygpath -u ""$(IntDir)""` && CC=cl CXX=cl `cygpath -u ""$ECOSHOST""`/configure --prefix=`cygpath -u ""$(OutDir)""` --with-tcl=`cygpath -u ""$TCLHOME""` --with-tcl_version=82d --enable-debug --enable-maintainer-mode" \ - cd $(IntDir) \ - v: \ - make --unix install \ - - -"$(OutDir)\lib\cdl.lib" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - $(BuildCmds) - -"$(OutDir)\lib\cyginfra.lib" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - $(BuildCmds) -# End Custom Build - -!ELSEIF "$(CFG)" == "cdl - Win32 ANSI Release" - -# Begin Custom Build - Performing Custom Build Step for libCDL -IntDir=V:\cdl\Release\build -OutDir=V:\cdl\Release -InputPath=.\ChangeLog - -BuildCmds= \ - echo $(PATH) \ - if not exist $(IntDir)\tools\configtool\standalone\common\Makefile sh -c "ECOSHOST=`echo ""puts [ file attributes [ pwd ] -shortname ]"" | tclsh`/.. ; echo ""ECOSHOST=$ECOSHOST"" ; echo ""TCLHOME=$TCLHOME"" ; mkdir -p `cygpath -u ""$(IntDir)""` ; cd `cygpath -u ""$(IntDir)""` && CC=cl CXX=cl `cygpath -u ""$ECOSHOST""`/configure --prefix=`cygpath -u ""$(OutDir)""` --with-tcl=`cygpath -u ""$TCLHOME""` --with-tcl_version=82" \ - cd $(IntDir) \ - v: \ - make --unix install \ - - -"$(OutDir)\lib\cdl.lib" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - $(BuildCmds) - -"$(OutDir)\lib\cyginfra.lib" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - $(BuildCmds) -# End Custom Build - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\component.cxx -# End Source File -# Begin Source File - -SOURCE=.\config.cxx -# End Source File -# Begin Source File - -SOURCE=.\conflict.cxx -# End Source File -# Begin Source File - -SOURCE=.\database.cxx -# End Source File -# Begin Source File - -SOURCE=.\dialog.cxx -# End Source File -# Begin Source File - -SOURCE=.\expr.cxx -# End Source File -# Begin Source File - -SOURCE=.\interface.cxx -# End Source File -# Begin Source File - -SOURCE=.\interp.cxx -# End Source File -# Begin Source File - -SOURCE=.\option.cxx -# End Source File -# Begin Source File - -SOURCE=.\package.cxx -# End Source File -# Begin Source File - -SOURCE=.\parse.cxx -# End Source File -# Begin Source File - -SOURCE=.\property.cxx -# End Source File -# Begin Source File - -SOURCE=.\refer.cxx -# End Source File -# Begin Source File - -SOURCE=.\transact.cxx -# End Source File -# Begin Source File - -SOURCE=.\value.cxx -# End Source File -# Begin Source File - -SOURCE=.\wizard.cxx -# End Source File -# End Target -# End Project diff --git a/host/libcdl/cdl.hxx b/host/libcdl/cdl.hxx deleted file mode 100644 --- a/host/libcdl/cdl.hxx +++ /dev/null @@ -1,601 +0,0 @@ -#ifndef __CDL_HXX -# define __CDL_HXX -//{{{ Banner - -//============================================================================ -// -// cdl.hxx -// -// This header file declares the classes related to software -// configuration. -// -//============================================================================ -//####COPYRIGHTBEGIN#### -// -// ---------------------------------------------------------------------------- -// Copyright (C) 2002, 2003 Bart Veer -// Copyright (C) 1998, 1999, 2000, 2001 Red Hat, Inc. -// -// This file is part of the eCos host tools. -// -// This program is free software; you can redistribute it and/or modify it -// under the terms of the GNU General Public License as published by the Free -// Software Foundation; either version 2 of the License, or (at your option) -// any later version. -// -// This program is distributed in the hope that it will be useful, but WITHOUT -// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for -// more details. -// -// You should have received a copy of the GNU General Public License along with -// this program; if not, write to the Free Software Foundation, Inc., -// 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -// -// ---------------------------------------------------------------------------- -// -//####COPYRIGHTEND#### -//============================================================================ -//#####DESCRIPTIONBEGIN#### -// -// Author(s): bartv -// Contact(s): bartv -// Date: 1998/02/09 -// Version: 0.02 -// Requires: cdlcore.hxx -// Usage: #include -// -//####DESCRIPTIONEND#### -//============================================================================ - -//}}} -//{{{ nested #include's - -// ---------------------------------------------------------------------------- -// Software CDL depends on the core but adds no new system requirements. - -#ifndef __CDLCORE_HXX -# include -#endif - -//}}} - -//{{{ Forward declarations of the body classes - -// ---------------------------------------------------------------------------- -// This section provides forward declarations of the main classes used -// for software configuration. - -class CdlConfigurationBody; -class CdlPackageBody; -class CdlComponentBody; -class CdlOptionBody; -class CdlPackagesDatabaseBody; - -typedef CdlConfigurationBody* CdlConfiguration; -typedef CdlPackageBody* CdlPackage; -typedef CdlComponentBody* CdlComponent; -typedef CdlOptionBody* CdlOption; -typedef CdlPackagesDatabaseBody* CdlPackagesDatabase; - -typedef const CdlConfigurationBody* CdlConstConfiguration; -typedef const CdlPackageBody* CdlConstPackage; -typedef const CdlComponentBody* CdlConstComponent; -typedef const CdlOptionBody* CdlConstOption; -typedef const CdlPackagesDatabaseBody* CdlConstPackagesDatabase; - -//}}} -//{{{ CdlPackagesDatabase class - -// ---------------------------------------------------------------------------- -// An eCos component repository can get to be quite complicated. There will -// be a number of core packages supplied by Red Hat. There may also be some -// number of third party and unsupported packages. Each package may come in -// several different versions. Keeping track of everything that has been -// installed should involve a separate administration tool, and there should -// be some sort of database of all this information. -// -// At the time of writing there is no such administration tool and there is -// no database with details of the various packages. Instead there is a -// static file "packages" at the top level of the component repository, -// containing some of the desired information. -// -// For now a temporary CdlPackagesDatabase class is provided. -// Essentially this provides C++ access to the packages file. In the -// long term this class will be replaced completely by a full and more -// rational implementation. -// -// The packages database class also, temporarily, provides information about -// targets and templates. This will change in future. A target will be specified -// by a save file, the output from Hardy. A template will also be specified by -// a save file, a partial software configuration. - -class CdlPackagesDatabaseBody { - - friend class CdlTest; - friend class CdlDbParser; - - public: - - static CdlPackagesDatabase make(std::string = "", CdlDiagnosticFnPtr /* error */ = 0, - CdlDiagnosticFnPtr /* warn */ = 0); - bool update(void); - ~CdlPackagesDatabaseBody(); - - std::string get_component_repository() const; - - const std::vector& get_packages(void) const; - bool is_known_package(std::string) const; - const std::string& get_package_description(std::string) const; - const std::vector& get_package_aliases(std::string) const; - const std::vector& get_package_versions(std::string) const; - const std::string& get_package_directory(std::string) const; - const std::string& get_package_repository(std::string, std::string /* version */ = "") const; - const std::string& get_package_script(std::string) const; - bool is_hardware_package(std::string) const; - - const std::vector& get_targets(void) const; - bool is_known_target(std::string) const; - const std::string& get_target_description(std::string) const; - const std::vector& get_target_aliases(std::string) const; - const std::vector& get_target_packages(std::string) const; - const std::vector& get_target_enables(std::string) const; - const std::vector& get_target_disables(std::string) const; - const std::vector >& get_target_set_values(std::string) const; - - const std::vector& get_templates(void) const; - bool is_known_template(std::string) const; - std::string get_template_filename(std::string, std::string = "") const; - const std::vector& get_template_versions(std::string) const; - const std::string get_template_description(std::string, std::string = ""); - const std::vector& get_template_packages(std::string, std::string = ""); - static void extract_template_details(std::string /* filename */, std::string& /* description */, - std::vector& /* packages */); - - // What are the valid compiler flag variables (ARCHFLAGS, ERRFLAGS, ...)? - // For now the library provides a static vector of these things, but - // this area is likely to change in future - static const std::vector& get_valid_cflags(); - - // Control verbosity when reading in a database - static void set_verbose(bool); - - bool check_this(cyg_assert_class_zeal = cyg_quick) const; - CYGDBG_DECLARE_MEMLEAK_COUNTER(); - - private: - // The only valid constructor gets invoked from the make() member function. - // The argument should be a pathname for the component repository. The - // constructor is responsible for reading in the whole packages file. - CdlPackagesDatabaseBody(std::string, CdlDiagnosticFnPtr, CdlDiagnosticFnPtr); - - std::string component_repository; - std::vector package_names; - struct package_data { - public: - std::string description; - std::vector aliases; - std::vector versions; - std::map repositories; /* one entry per version */ - std::string directory; - std::string script; - bool hardware; - }; - std::map packages; - - std::vector target_names; - struct target_data { - public: - std::string description; - std::vector aliases; - std::vector packages; - std::vector enable; - std::vector disable; - std::vector > set_values; - }; - std::map targets; - - std::vector template_names; - struct template_version_data { - public: - std::string description; - std::vector packages; - }; - struct template_data { - public: - std::vector versions; - std::map files; - std::map version_details; - }; - std::map templates; - - enum { - CdlPackagesDatabaseBody_Invalid = 0, - CdlPackagesDatabaseBody_Magic = 0x50896acb - } cdlpackagesdatabasebody_cookie; - - // This allows test cases to overwrite the name of the file - // containing the database information. - static char* database_name; - - // Control whether or not minor problems with the database should be - // reported. - static bool verbose_mode; - - // The default constructor, copy constructor and assignment operator are illegal. - CdlPackagesDatabaseBody(); - CdlPackagesDatabaseBody(const CdlPackagesDatabaseBody&); - CdlPackagesDatabaseBody& operator=(const CdlPackagesDatabaseBody&); - -}; - -//}}} -//{{{ CdlConfiguration class - -// ---------------------------------------------------------------------------- -// The CdlConfiguration class is the toplevel used for mainpulating -// software configurations. It consists of a number of loaded packages, -// each of which consists of some hierarchy of components and options, -// plus dialogs, wizards, and interfaces from the core. -// -// Typically an application will deal with only one configuration at a -// time. There will be exceptions. The most obvious example would be -// some sort of diff utility, but there may well be times when a user -// wants to edit multiple configurations. One example would be a board -// containing two separate processors, e.g. a conventional one coupled -// with a separate DSP, and eCos is supposed to run on both: the two -// chips will need to interact, and hence there may well be -// configurability dependencies between them. -// -// A configuration object does not exist in isolation. It must be tied -// to an eCos component repository via a database objects. It must -// also be supplied with a suitable Tcl interpreter. - -class CdlConfigurationBody : public virtual CdlToplevelBody -{ - friend class CdlTest; - - public: - - // ---------------------------------------------------------------------------- - // Create a new configuration. - // Currently this requires a name, a database and a master interpreter. - // The name is not used very much, but does appear in savefiles. - // The packages database and the interpreter must be created before - // any configuration object. - static CdlConfiguration make(std::string /* name */, CdlPackagesDatabase, CdlInterpreter); - CdlPackagesDatabase get_database() const; - - // Loading and unloading packages. This can happen in a number - // of different ways: - // - // 1) explicitly adding or removing a single package - // 2) changing the version of a package, which means unloading - // the old version and reloading the new one. Generally - // user settings should be preserved where possible. - // 3) loading in a full or minimal savefile. The library - // does not actually distinguish between the two when - // loading, only when saving. - // 4) adding a full or minimal savefile. - // 5) setting a template for the first time. This is much the - // same as adding a minimal savefile. However the library - // keeps track of the "current" template and only one - // can be loaded at a time. The library does not keep - // track of which savefile(s) have been added. - // 6) changing a template. This means unloading the packages - // that were loaded for the old template, then loading in - // the new one. - // 7) unsetting the template. This just involves an unload. - // 8) setting the hardware. Currently the database defines - // each supported target, listing the packages that should - // be loaded and possibly some option details. This is - // subject to change in future. - // 9) changing the hardware. This is much the same as changing - // the template. - // 10) unsetting the hardware. - // - // The unload operations are comparatively safe, although - // they can result in new conflicts and the user may well want - // to cancel the operation after discovering how many new - // problems there would be. The load operations are a bit more - // dangerous since they depend on external data and hence can - // fail for a variety of reasons: missing files, corrupt files, - // clashes with existing data, ... Changing e.g. a template - // is especially dangerous because of the number of things - // that can go wrong. All of these operations need to happen - // in a transaction which the user can cancel. There are two - // versions of all the relevant routines, one which operates - // in an existing transaction and one which creates a new - // one. - // - // Any operation that involves loading CDL data takes two - // CdlDiagnosticFnPtr arguments, one for errors and one for - // warnings. These should report the message to the user by - // some suitable means. The error fnptr may throw a - // CdlParseException to abort the current load immediately, - // otherwise the load operation will be aborted at the end - // if any errors were detected. New conflicts are not - // handled by these diagnostic functions, instead they - // are handled by the normal transaction methods. - - // A version argument of "" implies the most recent version. - void load_package(std::string /* name */, std::string /* version */, - CdlDiagnosticFnPtr /* error */, CdlDiagnosticFnPtr /* warn */, bool /* limbo */ = true); - void load_package(CdlTransaction, std::string /* name */, std::string /* version */, - CdlDiagnosticFnPtr /* error */, CdlDiagnosticFnPtr /* warn */, bool /* limbo */ = true); - - void unload_package(std::string /* name */, bool /* limbo */ = true); - void unload_package(CdlPackage, bool /* limbo */ = true); - void unload_package(CdlTransaction, std::string /* name */, bool /* limbo */ = true); - void unload_package(CdlTransaction, CdlPackage, bool /* limbo */ = true); - - void change_package_version(std::string /*name*/, std::string /*version*/, - CdlDiagnosticFnPtr /* error */, CdlDiagnosticFnPtr /* warn */, bool /* limbo */ = true); - void change_package_version(CdlPackage, std::string /*version*/, CdlDiagnosticFnPtr /* error */, - CdlDiagnosticFnPtr /* warn */, bool /* limbo */ = true); - - void change_package_version(CdlTransaction, std::string /*name*/, std::string /*version*/, - CdlDiagnosticFnPtr /* error */, CdlDiagnosticFnPtr /* warn */, bool /* limbo */ = true); - void change_package_version(CdlTransaction, CdlPackage, std::string /*version*/, CdlDiagnosticFnPtr /* error */, - CdlDiagnosticFnPtr /* warn */, bool /* limbo */ = true); - - // Loading a savefile is different in that it creates a new - // toplevel. Since transactions can only be created if the - // toplevel already exists, it is not possible to have a - // per-transaction load() operation. It is possible to have - // a per-transaction add() operation. - static CdlConfiguration load(std::string /* filename */, CdlPackagesDatabase, CdlInterpreter, - CdlDiagnosticFnPtr /* error */, CdlDiagnosticFnPtr /* warn */); - - void add(std::string /* filename */, - CdlDiagnosticFnPtr /* error */, CdlDiagnosticFnPtr /* warn */); - void add(CdlTransaction, std::string /* filename */, - CdlDiagnosticFnPtr /* error */, CdlDiagnosticFnPtr /* warn */); - - // As with packages, a version of "" implies the most recent. - void set_template(std::string, std::string /* version */, - CdlDiagnosticFnPtr, CdlDiagnosticFnPtr /* warn */,bool /* limbo */ = true); - void set_template_file(std::string, - CdlDiagnosticFnPtr /* error */, CdlDiagnosticFnPtr /* warn */, bool /* limbo */ = true); - void set_template(CdlTransaction, std::string, std::string /* version */, - CdlDiagnosticFnPtr, CdlDiagnosticFnPtr /* warn */, bool /* limbo */ = true); - void set_template_file(CdlTransaction, std::string, - CdlDiagnosticFnPtr /* error */, CdlDiagnosticFnPtr /* warn */, bool /* limbo */ = true); - void unload_template(bool /* limbo */ = true); - void unload_template(CdlTransaction, bool /* limbo */ = true); - std::string get_template() const; - void set_template_name(std::string); // Intended for library use only - - void set_hardware(std::string, - CdlDiagnosticFnPtr /* error */, CdlDiagnosticFnPtr /* warn */, bool /* limbo */ = true); - void set_hardware(CdlTransaction, std::string, - CdlDiagnosticFnPtr /* error */, CdlDiagnosticFnPtr /* warn */, bool /* limbo */ = true); - void unload_hardware(bool /* limbo */ = true); - void unload_hardware(CdlTransaction, bool /* limbo */ = true); - std::string get_hardware() const; - void set_hardware_name(std::string); // Intended for library use only - - // ---------------------------------------------------------------------------- - // Save a configuration to a file - void save(std::string, bool /* minimal */ = false); - void initialize_savefile_support(); - std::string get_save_file() const; - - // ---------------------------------------------------------------------------- - // Get rid of a configuration. - ~CdlConfigurationBody(); - - virtual std::string get_class_name() const; - bool check_this(cyg_assert_class_zeal = cyg_quick) const; - CYGDBG_DECLARE_MEMLEAK_COUNTER(); - - private: - - // The only legal constructor, invoked from make() and load() - CdlConfigurationBody(std::string, CdlPackagesDatabase, CdlInterpreter); - - // The internal implementation of the persistence support - virtual void save(CdlInterpreter, Tcl_Channel, int, bool); - static int savefile_configuration_command(CdlInterpreter, int, const char*[]); - static int savefile_description_command(CdlInterpreter, int, const char*[]); - static int savefile_hardware_command(CdlInterpreter, int, const char*[]); - static int savefile_template_command(CdlInterpreter, int, const char*[]); - static int savefile_package_command(CdlInterpreter, int, const char*[]); - - std::string current_hardware; - std::string current_template; - std::string description; - CdlPackagesDatabase database; - std::string save_file; - enum { - CdlConfigurationBody_Invalid = 0, - CdlConfigurationBody_Magic = 0x5c409a3d - } cdlconfigurationbody_cookie; - - // The constructor can only be invoked via the make() and load() - // members. Other constructors and the assignment operator are - // illegal. - CdlConfigurationBody(); - CdlConfigurationBody(const CdlConfigurationBody&); - CdlConfigurationBody& operator=(const CdlConfigurationBody&); - -}; - -//}}} -//{{{ CdlPackage class - -// ---------------------------------------------------------------------------- -// Packages inherit from most of the base classes. - -class CdlPackageBody : public virtual CdlNodeBody, - public virtual CdlContainerBody, - public virtual CdlUserVisibleBody, - public virtual CdlValuableBody, - public virtual CdlParentableBody, - public virtual CdlBuildableBody, - public virtual CdlDefinableBody, - public virtual CdlLoadableBody, - public virtual CdlBuildLoadableBody, - public virtual CdlDefineLoadableBody -{ - friend class CdlTest; - - // Packages should not be created by application code, but - // the CdlConfiguration class must be able to do so inside - // load_package(); - friend class CdlConfigurationBody; - - public: - - ~CdlPackageBody(); - - static int parse_package(CdlInterpreter, int, const char*[]); - static int parse_hardware(CdlInterpreter, int, const char*[]); - static int parse_install_proc(CdlInterpreter, int, const char*[]); - static int parse_license_proc(CdlInterpreter, int, const char*[]); - - // Override the CdlDefineLoadable member. Hardware packages always - // send their configuration options to hardware.h - virtual std::string get_config_header() const; - - bool is_hardware_package() const; - bool has_install_proc() const; - const cdl_tcl_code& get_install_proc() const; - bool has_license_proc() const; - const cdl_tcl_code& get_license_proc() const; - - // Propagation support. Because of multiple virtual inheritance - // it is necessary to invoke the container and valuable - // update members. - virtual void update(CdlTransaction, CdlUpdate); - - // Persistence support. - virtual void save(CdlInterpreter, Tcl_Channel, int, bool); - static void initialize_savefile_support(CdlToplevel); - static int savefile_package_command(CdlInterpreter, int, const char*[]); - - // Was this package loaded because of a template or hardware setting? - bool belongs_to_template() const; - bool belongs_to_hardware() const; - - virtual std::string get_class_name() const; - bool check_this(cyg_assert_class_zeal = cyg_quick) const; - CYGDBG_DECLARE_MEMLEAK_COUNTER(); - - private: - - // The only valid constructor requires a number of fields - CdlPackageBody(std::string /* name */, CdlConfiguration, std::string /* repository */, std::string /* directory */); - - // Other constructors are illegal - CdlPackageBody(); - CdlPackageBody(const CdlPackageBody&); - CdlPackageBody& operator=(const CdlPackageBody&); - - bool loaded_for_template; - bool loaded_for_hardware; - - enum { - CdlPackageBody_Invalid = 0, - CdlPackageBody_Magic = 0x1d7c0d43 - } cdlpackagebody_cookie; -}; - -//}}} -//{{{ CdlComponent class - -// ---------------------------------------------------------------------------- -// Similarly components just inherit from the appropriate base classes. - -class CdlComponentBody : public virtual CdlNodeBody, - public virtual CdlContainerBody, - public virtual CdlUserVisibleBody, - public virtual CdlValuableBody, - public virtual CdlParentableBody, - public virtual CdlBuildableBody, - public virtual CdlDefinableBody -{ - friend class CdlTest; - - public: - - ~CdlComponentBody(); - static int parse_component(CdlInterpreter, int, const char*[]); - static int parse_script(CdlInterpreter, int, const char*[]); - - // Propagation support. Because of multiple virtual inheritance - // it is necessary to invoke the container and valuable - // update members. - virtual void update(CdlTransaction, CdlUpdate); - - // Persistence support. - virtual void save(CdlInterpreter, Tcl_Channel, int, bool); - static void initialize_savefile_support(CdlToplevel); - static int savefile_component_command(CdlInterpreter, int, const char*[]); - - virtual std::string get_class_name() const; - bool check_this(cyg_assert_class_zeal = cyg_quick) const; - CYGDBG_DECLARE_MEMLEAK_COUNTER(); - - private: - - // The only valid constructor requires a name. - CdlComponentBody(std::string); - - enum { - CdlComponentBody_Invalid = 0, - CdlComponentBody_Magic = 0x6359d9a7 - } cdlcomponentbody_cookie; - - // Other constructors are illegal - CdlComponentBody(); - CdlComponentBody(const CdlComponentBody&); - CdlComponentBody& operator=(const CdlComponentBody&); -}; - -//}}} -//{{{ CdlOption class - -// ---------------------------------------------------------------------------- -// Again options just inherit their functionality from the base classes. - -class CdlOptionBody : public virtual CdlNodeBody, - public virtual CdlUserVisibleBody, - public virtual CdlValuableBody, - public virtual CdlParentableBody, - public virtual CdlBuildableBody, - public virtual CdlDefinableBody -{ - friend class CdlTest; - - public: - ~CdlOptionBody(); - - static int parse_option(CdlInterpreter, int, const char*[]); - - // Persistence support. - virtual void save(CdlInterpreter, Tcl_Channel, int, bool); - static void initialize_savefile_support(CdlToplevel); - static int savefile_option_command(CdlInterpreter, int, const char*[]); - - virtual std::string get_class_name() const; - bool check_this(cyg_assert_class_zeal = cyg_quick) const; - CYGDBG_DECLARE_MEMLEAK_COUNTER(); - - private: - CdlOptionBody(std::string); - - enum { - CdlOptionBody_Invalid = 0, - CdlOptionBody_Magic = 0x1c1162d1 - } cdloptionbody_cookie; - - CdlOptionBody(); - CdlOptionBody(const CdlOptionBody&); - CdlOptionBody& operator=(const CdlOptionBody&); -}; - -//}}} - -#endif /* !__CDL_HXX */ -// EOF cdl.hxx diff --git a/host/libcdl/cdlcore.hxx b/host/libcdl/cdlcore.hxx deleted file mode 100644 --- a/host/libcdl/cdlcore.hxx +++ /dev/null @@ -1,5758 +0,0 @@ -#ifndef __CDLCORE_HXX -# define __CDLCORE_HXX - -//{{{ Banner - -//========================================================================== -// -// cdlcore.hxx -// -// The core parts of the library. This header defines aspects of -// CDL that are shared between software cdl, hcdl, scdl, and any -// future languages based on the same core technology. -// -//========================================================================== -//####COPYRIGHTBEGIN#### -// -// ---------------------------------------------------------------------------- -// Copyright (C) 2002, 2003 Bart Veer -// Copyright (C) 1999, 2000, 2001 Red Hat, Inc. -// -// This file is part of the eCos host tools. -// -// This program is free software; you can redistribute it and/or modify it -// under the terms of the GNU General Public License as published by the Free -// Software Foundation; either version 2 of the License, or (at your option) -// any later version. -// -// This program is distributed in the hope that it will be useful, but WITHOUT -// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for -// more details. -// -// You should have received a copy of the GNU General Public License along with -// this program; if not, write to the Free Software Foundation, Inc., -// 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -// -// ---------------------------------------------------------------------------- -// -//####COPYRIGHTEND#### -//========================================================================== -//#####DESCRIPTIONBEGIN#### -// -// Author(s): bartv -// Contributors: bartv -// Date: 1999-04-15 -// -//####DESCRIPTIONEND#### -//========================================================================== - -//}}} -//{{{ Platform dependencies - -// ---------------------------------------------------------------------------- -// Visual C++ has the delightful feature that the source browser will generate -// warnings if there are any identifiers of length >= 256 characters, while at -// the same time use of templates in the standard C++ library can easily -// generate functions that long. It appears that the only way to disable the -// warnings is by use of a %$#@(%*&%! #pragma. -// -// Similarly, VC++ gives spurious warnings when it comes to multiple virtual -// inheritance. -#ifdef _MSC_VER -# pragma warning( disable: 4786 ) -# pragma warning( disable: 4250 ) -#endif - -//}}} -//{{{ nested #include's - -// ---------------------------------------------------------------------------- -// The libcdl API is defined using parts of the standard C++ library, -// including strings and various bits of STL. Therefore these headers must -// be #include'd here for the header file to work. -#include -#include -#include -#include -#include -#include -#include -#include - -// is needed in various places in the implementation. -// This #include should be moved to an implementation-specific -// header. -#include - -// Now for some eCos host-side infrastructure headers. -// -// Get the cyg_int64 data type and CYG_UNUSED_PARAM() macro. -#include - -// Some of the classes need to reference the cyg_assert_class_zeal enum. -// Also inline functions may perform assertions. -#include - -// This header file also depends on having a suitable Tcl installation -// Unfortunately does some ugly things in the interests of -// portability, including defining symbols such as EXTERN when -// necessary, and this has to be patched up here as cleanly as possible. -#ifndef CONST -# define __CDL_CONST_UNDEFINED -#endif -#ifndef EXTERN -# define __CDL_EXTERN_UNDEFINED -#endif -#ifndef VOID -# define __CDL_VOID_UNDEFINED -#endif -#ifndef CHAR -# define __CDL_CHAR_UNDEFINED -#endif -#ifndef SHORT -# define __CDL_SHORT_UNDEFINED -#endif -#ifndef LONG -# define __CDL_LONG_UNDEFINED -#endif - -extern "C" { -#include -} - -#ifdef __CDL_CONST_UNDEFINED -# undef CONST -# undef __CDL_CONST_UNDEFINED -#endif -#ifdef __CDL_EXTERN_UNDEFINED -# undef EXTERN -# undef __CDL_EXTERN_UNDEFINED -#endif -#ifdef __CDL_VOID_UNDEFINED -# undef VOID -# undef __CDL_VOID_UNDEFINED -#endif -#ifdef __CDL_CHAR_UNDEFINED -# undef CHAR -# undef __CDL_CHAR_UNDEFINED -#endif -#ifdef __CDL_SHORT_UNDEFINED -# undef SHORT -# undef __CDL_SHORT_UNDEFINED -#endif -#ifdef __CDL_LONG_UNDEFINED -# undef LONG -# undef __CDL_LONG_UNDEFINED -#endif - -//}}} - -//{{{ Primitive types, constants:, enums, etc. - -// ---------------------------------------------------------------------------- -// The CDL languages are defined in terms of arbitrary precision -// arithmetic. This is necessary to allow e.g. pointers to be -// manipulated at the CDL level on 64 bit target processors. -// -// Temporarily it is not necessary to provide this precision, so it is -// convenient to stick to 64 bit integers as provided by the -// underlying infrastructure. However the API is defined in terms of -// the type cdl_int, so that it will be easier in future to make the -// change to the correct datatype. At that point cdl_int can be -// redefined to be a class which supports the appropriate operators. - -typedef cyg_int64 cdl_int; - -// --------------------------------------------------------------------------- -// A common concept in the CDL language is a small amount of TCL code. -// This is currently stored as a simple string. Conceivably it could -// be byte-compiled and stored accordingly. - -typedef std::string cdl_tcl_code; - -// ---------------------------------------------------------------------------- -// CDL values. -// -// CDL is a declarative programming language. It does involve the -// manipulation of values, but such values do not necessarily -// correspond to hardware-level entities such as integers or double -// precision numbers. Hence the term "type" is avoided, "flavor" -// is used instead. CDL understands four different flavors. -// -// None | Bool -// --------+-------- -// Data |BoolData -// -// -// The flavor "none" is used for entities that serve only as -// placeholders in the hierarchy, allowing other entities to be -// grouped more easily. -// -// Boolean entities can be either enabled or disabled. This is the -// most common flavor for software configuration options, the user can -// either enable or disable some unit of functionality. For software -// packages implemented in C or C++ the implementation is obvious: iff -// the entity is enabled then there will be a #define, and code will -// check the setting using e.g. #ifdef. -// -// The flavor "data" implies some arbitrary data. Internally this will -// be held as a string. Other properties such as legal_values, -// check_proc and entry_proc can be used to constrain the -// actual values, for example to an integer value within a certain -// range. -// -// The flavor "booldata" combines the previous two: it means that -// the option can be either enabled or disabled, and if it is -// enabled then it must have a value as per legal_values etc. -// One example of this is a software package: this may be either -// enabled or disabled, and if it is enabled then it has a value -// corresponding to the version string. Another example is a hardware -// pin: this may or may not be connected, and if it is connected -// then its value identifies some other pin. -// -// An entity's flavor is not always sufficient by itself to specify -// how the user can manipulate it in a graphical tool. Obviously an -// entity of flavor "none" cannot be manipulated at all. Flavor "bool" -// normally implies a checkbutton, but occasionally a radiobutton will -// be more appropriate. "Data" says very little about the user -// interaction, it will be necessary to examine other properties such -// as legal_values to determine a sensible representation. The same -// goes for "BoolData", with the additional possibility that the -// entity may be disabled. -// -// It can be argued that three of the flavors are redundant: both Bool -// and BoolData could be implemented as cases of "Data" with a special -// legal value "disabled" (or false, or whatever); "None" could be -// implemented as constant "Data"; effectively CDL would manipulate -// all data as strings, just like e.g. all variables in Tcl, or just -// like all scalars in Perl. This approach is certainly tempting and -// might well make it easier to document the language, but in practice -// it would result in more verbose CDL: boolean entities really are a -// different beast from data entities. -// -// It can also be argued that there should be more flavors. For -// example there could be separate flavors for integer data, floating -// point data, string data, and so on. There are a number of good -// reasons for not doing so: -// -// 1) applying separate constraints such as legal_values allows much -// finer control over the actual values, for example numbers within a -// given range. As likely as not, a value will be constrained to -// something smaller than the range MININT to MAXINT (whatever those -// happen to be for the current target). -// -// 2) where do you stop? Do you provide separate flavors for signed -// vs. unsigned? Char, wchar_t, short, int, long, long long? How about -// the eCos data types cyg_ucount8, cyg_uint8, ... Is there support -// for enums? Arrays? Bitfields? Structures? Unions? C++ classes? -// How about other programming languages such as Ada or Java? -// -// Any attempt to implement a grand union of all data types in CDL -// is doomed to failure and should not be attempted. Treating -// everything as a string instead has proven successful in a number -// of languages, including Tcl and Perl. -// -// 3) for some variants of CDL, for example hardware CDL, it may not -// make much sense to display a value directly and allow it to be -// manipulated directly. The value associated with a pin entity -// identifies the pin to which it is connected, and typically -// this value will be manipulated by drag and drop rather than by -// typing some characters. Such a value certainly does not correspond -// to any machine data type. -// -// Another reason for extending the number of flavors is to provide -// more information. For example there could be a specialized version -// of the boolean flavor called "radio". This would imply a specific -// representation in the user interface, and it would also impose -// a constraint that it implicitly precludes any other radio entities -// within the same group. However the same information can be specified -// by other more general means such as requires statements. - -enum CdlValueFlavor { - CdlValueFlavor_Invalid = 0, - CdlValueFlavor_None = 1, - CdlValueFlavor_Bool = 2, - CdlValueFlavor_BoolData = 3, - CdlValueFlavor_Data = 4 -}; - - -// Another important aspect of a value is where it came from. There -// are a number of possible sources: the default value, calculated -// from a default_value property; a value inferred by the inference -// engine; a value set by a wizard; and a value set explicitly by -// the user. These sources have different priorities, so for example -// the inference engine can safely replace a calculated default -// value without prompting the user, but changing a user-set value -// automatically is undesirable. -// -// Wizard-generated values are considered more valuable than default -// or inferred values (there is some user input involved), but less -// valuable than values set explicitly by the user: the idea is that -// a wizard asks fairly generic questions and makes a best guess at -// the correct values, which may not be precise enough for the -// user's needs. -// -// Arguably dialogs provide a level between wizards and users, in that -// a dialog can theoretically manipulate several entities in one go so -// it is a less precise way of setting values. At this stage it does -// not seem worthwhile to add this distinction. -// -// The library actually maintains separate values for each source, -// as well as the current source which is what actually gets used. -// In theory it is possible for the user interface code to let -// the user switch between these. It is not yet clear whether this -// makes sense from an end user's perspective. - -enum CdlValueSource { - CdlValueSource_Invalid = -1, // 0 is needed for array indexing - CdlValueSource_Default = 0, - CdlValueSource_Inferred = 1, - CdlValueSource_Wizard = 2, - CdlValueSource_User = 3, - CdlValueSource_Current = 4 -}; - -// ---------------------------------------------------------------------------- -// Update support. -// -// When there is a change to a node and there are references to that node, -// the referencing properties will want to be informed about this. There -// are various different kinds of changes, not all of which are always -// relevant. For example, if a CDL entity gets destroyed or unloaded then -// all referencing entities are likely to want to know about this, but -// if a container's value changes then this has no effect on a reference -// in e.g. a "parent" property. In some cases it is also useful to apply -// updates to nodes rather than properties, e.g. when a node becomes -// active or inactive. -// -// The generic update code is also used for initialization and finalization, -// i.e. when the source object itself has just been loaded or is -// being unloaded. -// -// For any particular update at most one bit set, but it is often -// appropriate to treat several different kinds of update with -// common code. Hence the enum values can be or'ed and and'ed. - -enum CdlUpdate { - CdlUpdate_Loaded = 0x0001, // The source has just been loaded - CdlUpdate_Init = 0x0002, // Second-phase of a load operation - CdlUpdate_Unloading = 0x0004, // The source is being unloaded - CdlUpdate_Created = 0x0008, // The destination has just been created - CdlUpdate_Destroyed = 0x0010, // The destination is being destroyed - CdlUpdate_ValueChange = 0x0020, // The destination's value has changed. - // This gets applied to nodes as well - CdlUpdate_ActiveChange = 0x0040 // The node has become active or inactive -}; - -// ---------------------------------------------------------------------------- -// Inference engine callback. -// -// During a transaction there may be one or more invocations of the inference -// engine, followed by a callback which should display the current transaction -// status to the user and allow one or more recommended fixes to be accepted. -// The callback's return code indicates what should happen next. "Cancel" -// is pretty obvious. "Continue" may result in a commit, or it may result in -// another iteration. - -enum CdlInferenceCallbackResult { - CdlInferenceCallbackResult_Continue = 0x01, - CdlInferenceCallbackResult_Cancel = 0x02 -}; - -// ---------------------------------------------------------------------------- -// Widget hints. -// -// The library can provide a hint to the GUI code as to a sensible -// widget to use for displaying a particular valuable. There are separate -// hints for the bool and data parts. - -enum CdlBoolWidget { - CdlBoolWidget_None = 0, // The boolean part is not applicable - CdlBoolWidget_CustomDialog = 1, // There is a valid custom dialog property - CdlBoolWidget_CheckButton = 2, // For simple booleans - CdlBoolWidget_Radio = 3, // For several mutual exclusive options, - // the data structure will provide a string identifier -}; - -enum CdlValueWidget { - CdlValueWidget_None = 0, // The value part is not applicable - CdlValueWidget_CustomDialog = 1, // There is a valid custom dialog property - CdlValueWidget_Loadable = 2, // Use package/version dialog - CdlValueWidget_EntryBox = 3, // Fallback - CdlValueWidget_MultilineString = 4, // For complicated strings - CdlValueWidget_DecimalRange = 5, // e.g. 1 to 16 - // Could be implemented as scale, radio buttons, entry, pull-down menu, - // combo box, ... depending on GUI conventions and number of entries - CdlValueWidget_HexRange = 6, // e.g. 0x01 to 0x10 - CdlValueWidget_OctalRange = 7, // e.g. 01 to 020 - CdlValueWidget_DoubleRange = 8, // e.g. 0.1 to 0.2 - CdlValueWidget_NumericSet = 9, // e.g. 1 2 4 8 16 - // The exact nature of the numbers is irrelevant, they will only - // get displayed, not edited - // Could be implemented as radio buttons, entry widget, pull-down menu, - // combo box, ... depending on GUI conventions and number of entries - // Each entry can have its own representation - CdlValueWidget_StringSet = 10 // e.g. "ram", "rom" - - // More to be added, e.g. for compiler flag handling -}; - -// ---------------------------------------------------------------------------- -// Value formats. -// -// The CDL input data can accept numbers in a variety of formats, -// for example hexadecimal as well as decimal. It is desirable to try -// to keep track of this formatting information where possible, so -// that what the user sees and what ends up in header files corresponds -// more closely to what is in the raw CDL data. For example, it is -// much easier to understand 0x7fffffff than its decimal equivalent. -// -// The information kept here is very imprecise, it provides only -// minimal formatting information. It is not clear yet whether this -// will suffice or whether something more exact is going to be needed. -enum CdlValueFormat -{ - CdlValueFormat_Default = 0, - CdlValueFormat_Hex = 1, - CdlValueFormat_Octal = 2 -}; - -//}}} -//{{{ Exception classes - -// ---------------------------------------------------------------------------- -// Some parts of the library make use of C++ exception handling. A number -// of exception classes related to this library are useful. In addition -// just about every part of the library can throw std::bad_alloc, but this -// is not checked for explicitly anywhere. - -// This class is used for all exceptions where an error message should -// be displayed to the user. There is a single string message associated -// with the exception. - -class CdlStringException { - friend class CdlTest; - - public: - CdlStringException(std::string message_arg) { - message = message_arg; - } - CdlStringException(const CdlStringException& original) { - message = original.message; - } - CdlStringException& operator=(const CdlStringException& original) { - message = original.message; - return *this; - } - ~CdlStringException() { - message = ""; - } - const std::string& get_message() const { - return message; - } - private: - std::string message; - CdlStringException(); -}; - -// CdlInputOutputException: this gets thrown when something goes wrong during -// file I/O operations, e.g. a file exists but cannot be opened. The -// exception contains a simple string explaining the error. This string -// may contain multiple lines, it is intended to be written to stderr -// or displayed in either a text widget or a dialog box. -// -// A separate class rather than a typedef is used to avoid any possible -// error message confusion. Everything gets inlined so there should be -// no performance issues. - -class CdlInputOutputException : public CdlStringException { - friend class CdlTest; - public: - CdlInputOutputException(std::string message_arg) : - CdlStringException(message_arg) { - } - CdlInputOutputException(const CdlInputOutputException& original) : - CdlStringException(original) { - } - CdlInputOutputException& operator=(const CdlInputOutputException& original) { - (void) CdlStringException::operator=(original); - return *this; - } -}; - -// This class is used when any parsing happens at the C++ level rather -// than at the Tcl level. The exception should be caught before it -// propagates through the Tcl interpreter, or the latter will end up -// in an inconsistent state. - -class CdlParseException : public CdlStringException { - friend class CdlTest; - public: - CdlParseException(std::string message_arg) : - CdlStringException(message_arg) { - } - CdlParseException(const CdlParseException& original) : - CdlStringException(original) { - } - CdlParseException& operator=(const CdlParseException& original) { - (void) CdlStringException::operator=(original); - return *this; - } -}; - -// Evaluating an expression may fail for a variety of reasons, e.g. because -// some referenced entity has not been loaded into the configuration. -// This exception can be thrown in such cases. - -class CdlEvalException : public CdlStringException { - friend class CdlTest; - public: - CdlEvalException(std::string message_arg) : - CdlStringException(message_arg) { - } - CdlEvalException(const CdlEvalException& original) : - CdlStringException(original) { - } - CdlEvalException& operator=(const CdlEvalException& original) { - (void) CdlStringException::operator=(original); - return *this; - } -}; - -//}}} -//{{{ Forward declarations of the body classes - -// ---------------------------------------------------------------------------- -// This section provides forward declarations of the main classes in -// the core of the library. Each variant of CDL will define additional -// classes, e.g. cdl_option, but these will usually be derived from -// the core ones. - -// There are three types of expression in CDL: -// 1) ordinary expressions evaluate to a single value. The most common -// use is for the legal_values property. -// 2) list expressions evaluate to a range of values, e.g. 1 to 10, -// and the most common use is for the legal_values property. -// 3) goal expressions evaluate to either true or false and are used -// for e.g. requires and active_if properties. -class CdlExpressionBody; -class CdlListExpressionBody; -class CdlGoalExpressionBody; - -// There are also objects for simple values, values and list values. -// These are expanded classes, there are no associated pointer -// types. It is quite likely that values need to be copied around -// on the stack. -class CdlSimpleValue; -class CdlValue; -class CdlListValue; - -// Properties. The base class is CdlProperty, and there are a number -// of derived classes provided as standard. Additional derived classes -// may be added in future. -class CdlPropertyBody; -class CdlProperty_MinimalBody; -class CdlProperty_StringBody; -class CdlProperty_TclCodeBody; -class CdlProperty_ReferenceBody; -class CdlProperty_StringVectorBody; -class CdlProperty_ExpressionBody; -class CdlProperty_ListExpressionBody; -class CdlProperty_GoalExpressionBody; - -// Base classes. CDL entities such as options and components derive -// from one or more of these, using virtual inheritance. -// -// The lowest-level class is CdlNodeBody. -// -// 1) a node usually lives in a hierarchy, below a toplevel -// and with a container object as the parent. However nodes -// can live outside a container on a temporary basis, -// and toplevel objects have no parent. -// -// 2) a node has a name that is unique within the hierarchy. -// -// 3) a node has a vector of properties. Actually some entities -// will have an empty vector, e.g. the orphans container -// that is internal to the library. However it is too -// inconvenient to have separate base classes for these. -// -// 4) nodes can be referred to by properties in other nodes. -class CdlNodeBody; - -// A container is a node that can contain other nodes. -class CdlContainerBody; - -// A loadable object is a container whose data has come out of a CDL -// script of some sort. It also stores details about all entities that -// were loaded via this script (even if some of them were reparented) -// thus supporting unload operations. -class CdlLoadableBody; - -// A toplevel object is a container that acts as the toplevel of -// a hierarchy, in other words its parent is always 0. In addition -// a toplevel keeps track of all the names used in the hierarchy, -// thus facilitating navigation. -class CdlToplevelBody; - -// The remaining classes all add functionality to CdlNode, directly or -// indirectly. -// -// A user-visible object is likely to appear in the user interface. -// This means it may have an alias string, a description, a -// documentation URL, and a gui_hint field. -class CdlUserVisibleBody; - -// A valuable object has a value that can be retrieved but not -// necessarily modified by the user. For example the value of an -// interface is always calculated and users can never change it. -// Valuable objects have a whole bunch of associated properties -// including dependencies. -class CdlValuableBody; - -// A parentable object has the parent property, i.e. it can -// be reparented to anywhere in the hierarchy -class CdlParentableBody; - -// A buildable object is a valuable object that may result in -// something being built, typically a library in the case of -// software packages. -class CdlBuildableBody; - -// A loadable that contains buildables -class CdlBuildLoadableBody; - -// A definable object is a valuable object whose value can result -// in #define statements in a header file -class CdlDefinableBody; - -// A loadable which can contain definables -class CdlDefineLoadableBody; - -// TODO: add instantiation support - -// Custom dialogs and wizards are provided by the core. -class CdlDialogBody; -class CdlWizardBody; -class CdlInterfaceBody; - -// Support for Tcl interpreters is also in the core, since it is -// difficult to do anything CDL-related without at least one Tcl -// interpreter lying around. -class CdlInterpreterBody; - -// The basic conflict class is part of the core library, as are a -// number of common derived classes for specific types of conflict. -class CdlConflictBody; -class CdlConflict_UnresolvedBody; -class CdlConflict_IllegalValueBody; -class CdlConflict_EvalExceptionBody; -class CdlConflict_RequiresBody; -class CdlConflict_DataBody; - -// Many operations happen (or may happen) in the context of a -// transaction. This is necessary to keep track of the various -// changes that can happen: for example, changing a component's -// value may require other entities' default values to be -// recalculated; it may change some legal_values list expressions, -// causing current values to become invalid; it may affect -// "requires" properties, causing goals to become satisfied or -// not-satisfied; it may change the "active" state of everything -// below the component, not to mention any entity with an -// "active_if" properties, and when an entity becomes active or -// inactive that may in turn affect other entities. -// -// Keeping track of all of this via recursion is possible, but there -// are problems. If an entity is updated multiple times, no -// optimizations are possible. It becomes much more difficult to -// detect cycles. During an unload operation things can get very -// messy. There is no easy way to track all of the changes and report -// them to higher level code via a callback. There is no support -// for any kind of rollback. A transaction model potentially -// provides support for all of this, at the cost of a more -// complex API. -class CdlTransactionBody; - -// This class is used to pass information back to the application -// about what has actually changed in a transaction. -class CdlTransactionCallback; - - -// Build info class. This is always an expanded object, but is -// needed here to break a circular dependency. -class CdlBuildInfo; - -// ---------------------------------------------------------------------------- -// Typedefs for the pointers. There are separate typedefs to cope with -// const vs. non-const objects. Otherwise you end up with the problem -// that "const CdlNode x" means that the pointer is const, not the -// object pointed at. - -typedef CdlExpressionBody* CdlExpression; -typedef CdlListExpressionBody* CdlListExpression; -typedef CdlGoalExpressionBody* CdlGoalExpression; - -typedef CdlPropertyBody* CdlProperty; -typedef CdlProperty_MinimalBody* CdlProperty_Minimal; -typedef CdlProperty_StringBody* CdlProperty_String; -typedef CdlProperty_TclCodeBody* CdlProperty_TclCode; -typedef CdlProperty_ReferenceBody* CdlProperty_Reference; -typedef CdlProperty_StringVectorBody* CdlProperty_StringVector; -typedef CdlProperty_ExpressionBody* CdlProperty_Expression; -typedef CdlProperty_ListExpressionBody* CdlProperty_ListExpression; -typedef CdlProperty_GoalExpressionBody* CdlProperty_GoalExpression; - -typedef CdlNodeBody* CdlNode; -typedef CdlContainerBody* CdlContainer; -typedef CdlLoadableBody* CdlLoadable; -typedef CdlToplevelBody* CdlToplevel; -typedef CdlUserVisibleBody* CdlUserVisible; -typedef CdlValuableBody* CdlValuable; -typedef CdlParentableBody* CdlParentable; -typedef CdlBuildableBody* CdlBuildable; -typedef CdlBuildLoadableBody* CdlBuildLoadable; -typedef CdlDefinableBody* CdlDefinable; -typedef CdlDefineLoadableBody* CdlDefineLoadable; - -typedef CdlDialogBody* CdlDialog; -typedef CdlWizardBody* CdlWizard; -typedef CdlInterfaceBody* CdlInterface; - -typedef CdlInterpreterBody* CdlInterpreter; - -typedef CdlConflictBody* CdlConflict; -typedef CdlConflict_UnresolvedBody* CdlConflict_Unresolved; -typedef CdlConflict_IllegalValueBody* CdlConflict_IllegalValue; -typedef CdlConflict_EvalExceptionBody* CdlConflict_EvalException; -typedef CdlConflict_RequiresBody* CdlConflict_Requires; -typedef CdlConflict_DataBody* CdlConflict_Data; - -typedef CdlTransactionBody* CdlTransaction; - -// ---------------------------------------------------------------------------- - -typedef const CdlExpressionBody* CdlConstExpression; -typedef const CdlListExpressionBody* CdlConstListExpression; -typedef const CdlGoalExpressionBody* CdlConstGoalExpression; - -typedef const CdlPropertyBody* CdlConstProperty; -typedef const CdlProperty_MinimalBody* CdlConstProperty_Minimal; -typedef const CdlProperty_StringBody* CdlConstProperty_String; -typedef const CdlProperty_TclCodeBody* CdlConstProperty_TclCode; -typedef const CdlProperty_ReferenceBody* CdlConstProperty_Reference; -typedef const CdlProperty_StringVectorBody* CdlConstProperty_StringVector; -typedef const CdlProperty_ExpressionBody* CdlConstProperty_Expression; -typedef const CdlProperty_ListExpressionBody* CdlConstProperty_ListExpression; -typedef const CdlProperty_GoalExpressionBody* CdlConstProperty_GoalExpression; - -typedef const CdlNodeBody* CdlConstNode; -typedef const CdlContainerBody* CdlConstContainer; -typedef const CdlLoadableBody* CdlConstLoadable; -typedef const CdlToplevelBody* CdlConstToplevel; -typedef const CdlUserVisibleBody* CdlConstUserVisible; -typedef const CdlValuableBody* CdlConstValuable; -typedef const CdlParentableBody* CdlConstParentable; -typedef const CdlBuildableBody* CdlConstBuildable; -typedef const CdlBuildLoadableBody* CdlConstBuildLoadable; -typedef const CdlDefinableBody* CdlConstDefinable; -typedef const CdlDefineLoadableBody* CdlConstDefineLoadable; - -typedef const CdlDialogBody* CdlConstDialog; -typedef const CdlWizardBody* CdlConstWizard; -typedef const CdlInterfaceBody* CdlConstInterface; - -typedef const CdlInterpreterBody* CdlConstInterpreter; - -typedef const CdlConflictBody* CdlConstConflict; -typedef const CdlConflict_UnresolvedBody* CdlConstConflict_Unresolved; -typedef const CdlConflict_IllegalValueBody* CdlConstConflict_IllegalValue; -typedef const CdlConflict_EvalExceptionBody* CdlConstConflict_EvalException; -typedef const CdlConflict_RequiresBody* CdlConstConflict_Requires; -typedef const CdlConflict_DataBody* CdlConstConflict_Data; - -typedef const CdlTransactionBody* CdlConstTransaction; - -//}}} -//{{{ Miscellaneous types etc. - -// ---------------------------------------------------------------------------- -// This section is used for data types, function prototypes, etc. which could -// not be defined until after the main CDL classes and handles. - -// This typedef is used for error and warning reporting functions. -// Typically such a function pointer will be passed when the library -// is asked to perform any non-trivial parsing operation, e.g. loading -// a package. -// -// If the error is fatal then this callback function should raise -// a CdlParseException. -typedef void (*CdlDiagnosticFnPtr)(std::string); - -// ---------------------------------------------------------------------------- -// This function is used for update handler. Whenever there is a change -// to CDL entity (it has just been loaded, or its value has changed, or -// whatever) this can affect other CDL entities that reference it. -// All such references occur via properties, and there should be -// update handlers associated with those properties. -// -// Update handlers are also invoked for initialization and finalization -// operations, i.e. when the source object itself has just been loaded -// or is in the process of being unloaded. -// -// The arguments to an update handler are: -// 1) the transaction in which the operation takes place -// 2) the source object containing the reference -// 3) the source property containing the reference -// 4) the destination object. This may be 0 for some update -// operations. -// 5) an indication of the change that has happened. This should -// be a CdlUpdate value. -typedef void (*CdlUpdateHandler)(CdlTransaction, CdlNode, CdlProperty, CdlNode, CdlUpdate); - -// ---------------------------------------------------------------------------- -// This function is also used for transactions. Typically during a -// transaction there will be one or more invocations of the inference engine, -// with callbacks in between to allow one or more of the recommended -// changes to be undone. -typedef CdlInferenceCallbackResult (*CdlInferenceCallback)(CdlTransaction); - -// ---------------------------------------------------------------------------- -// The TCL API and C++ do not always mesh cleanly, for example a lot -// happens in terms of ClientData which is a void* pointer. To avoid -// too many casts all over the place libcdl provides a CdlInterpreter -// class and the following alternative to Tcl_CmdProc*. A single -// function will be used for the TCL command: its ClientData will be -// the CdlInterpreterCommand, and the CdlInterpreter is accessible via -// AssocData. This does result in some overheads, but none of these -// should be in performance-critical code. -typedef int (*CdlInterpreterCommand)(CdlInterpreter, int, const char*[]); - -// ---------------------------------------------------------------------------- -// In the libcdl world it is often convenient to swap whole sets of -// commands in and out. For example when executing the body of a -// cdl_component it is desirable to swap in commands for all the -// properties that make sense in a component and swap out all the -// commands that made sense in a higher level. It is assumed that none -// of the commands being swapped in or out are built-ins. Achieving -// this involves a vector of this simple utility structure. -class CdlInterpreterCommandEntry { - public: - std::string name; - CdlInterpreterCommand command; - - CdlInterpreterCommandEntry() : name(""), command(0) {} - CdlInterpreterCommandEntry(const char *name_arg, CdlInterpreterCommand command_arg) - : name(name_arg), command(command_arg) - { - } - CdlInterpreterCommandEntry(std::string name_arg, CdlInterpreterCommand command_arg) - : name(name_arg), command(command_arg) - { - } - ~CdlInterpreterCommandEntry() - { - name = ""; - command = 0; - } -}; - -// ---------------------------------------------------------------------------- -// Persistence support. -// Some applications want to be able to store additional information -// in savefiles, and essentially this involves extra commands that -// get executed when the savefile is executed. It is possible that -// the application reading back the savefile does not understand -// the same set of commands as the application that wrote back the -// data, so the library tries hard not to lose data. -// -// The CdlSaveCallback function typedef is used when installing -// an application-specific savefile command. The first argument -// indicates the node for which the callback is being invoked: -// this may be the entire toplevel, or just an option, or whatever. -// -// The CdlSavefileCommand structure keeps track of the command, -// the save callback if any (non-zero only for application-specific -// data, zero implies that the command is handled by the lirary). -// The load command is invoked when reading in a savefile and the -// appropriate command is executed: unrecognised commands will be -// processed by CdlToplevelBody::savefile_handle_unknown(). - -typedef void (*CdlSaveCallback)(CdlNode, CdlInterpreter, Tcl_Channel, int); - -struct CdlSavefileCommand { - std::string name; - CdlSaveCallback save_callback; - CdlInterpreterCommand load_command; -}; - -// ---------------------------------------------------------------------------- -// Widget hint. -// This structure provides widget hint information for a CdlValuable. -// There are separate hints for the bool and data parts, and possibly -// some additional data such as a string identifying the set of -// items in a radio button. -struct CdlWidgetHint { - CdlBoolWidget bool_widget; - CdlValueWidget value_widget; - std::string radio_button_interface; -}; - -//}}} -//{{{ Memory leak detection - -// ---------------------------------------------------------------------------- -// Provide some macros that are useful for detecting memory leaks. Basically -// there is a static counter for every class, which gets incremented by the -// constructor(s) and decremented by the destructor. Memory leak detection -// is currently enabled if tracing is enabled. It would be possible to use -// another configure-time option, but the overheads of tracing are likely -// to dwarf the overheads of memory leak detection. -// -// For now the memleak counters are always present, even in non-debug -// versions. The overhead is sufficiently small that it can be -// ignored.There is control over whether or not the counters get -// updated in the constructor or destructor. Otherwise there would be problems -// with whether or not there should be a semicolon at the end of the -// CYGDBG_DECLARE_MEMLEAK_COUNTER() macro definition. - -#define CYGDBG_DECLARE_MEMLEAK_COUNTER() static int memleak_counter -#define CYGDBG_DEFINE_MEMLEAK_COUNTER(class) int class::memleak_counter = 0 -#define CYGDBG_GET_MEMLEAK_COUNTER(class) class::memleak_counter - -#ifdef CYGDBG_USE_TRACING - -#define CYGDBG_MEMLEAK_CONSTRUCTOR() this->memleak_counter++; -#define CYGDBG_MEMLEAK_DESTRUCTOR() this->memleak_counter--; -#define CYGDBG_MEMLEAK_CHECKTHIS() if (this->memleak_counter < 0) { return false; } - -#else - -#define CYGDBG_MEMLEAK_CONSTRUCTOR() -#define CYGDBG_MEMLEAK_DESTRUCTOR() -#define CYGDBG_MEMLEAK_CHECKTHIS() - -#endif - -//}}} - -//{{{ Cdl class - -// --------------------------------------------------------------------------- -// The sole purpose of this class is to provide some utility functions with -// reasonable namespace protection, without requiring that the compiler -// implements namespaces. - -class Cdl { - - public: - - static bool is_valid_value_flavor(CdlValueFlavor); - static bool is_valid_value_source(CdlValueSource); - - static bool is_valid_cdl_name(const std::string&); - static bool is_valid_c_preprocessor_symbol(const std::string&); - - static bool string_to_integer(std::string, cdl_int&); - static bool string_to_double(std::string, double&); - static bool string_to_bool(std::string, bool&); - static void integer_to_string(cdl_int, std::string&, CdlValueFormat = CdlValueFormat_Default); - static std::string integer_to_string(cdl_int, CdlValueFormat = CdlValueFormat_Default); - static void double_to_string(double, std::string&, CdlValueFormat = CdlValueFormat_Default); - static std::string double_to_string(double, CdlValueFormat = CdlValueFormat_Default); - static void bool_to_string(bool, std::string&); - static std::string bool_to_string(bool); - static void integer_to_double(cdl_int, double&); - static double integer_to_double(cdl_int); - static bool double_to_integer(double, cdl_int&); - - static bool string_to_flavor(std::string, CdlValueFlavor&); - static bool flavor_to_string(CdlValueFlavor, std::string&); - static bool string_to_source(std::string, CdlValueSource&); - static bool source_to_string(CdlValueSource, std::string&); - - static std::string get_library_version(); - static void set_interactive(bool = true); - static bool is_interactive(); - - static bool truth() { return true; } - static bool falsehood() { return false; } - - // return values are -1,0,1 just like strcmp(). The most recent - // version is the smallest. - static int compare_versions(std::string, std::string); - - // Also provide an STL-friendly comparison class - class version_cmp { - public: - bool operator()(const std::string& v1, const std::string& v2) const { - return Cdl::compare_versions(v1,v2) < 0; - } - }; - - // Split a version string into major, minor and release numbers. - static void split_version_string(const std::string&, std::string& /* major */, - std::string& /* minor */, std::string& /* release */); - - // It is occasionally useful to take a full CDL name such as CYGPKG_KERNEL - // and turn it into a short form, i.e. kernel. - static std::string get_short_form(const std::string&); - - private: - static bool interactive; -}; - -//}}} -//{{{ CdlInterpreter class - -// ---------------------------------------------------------------------------- -// libcdl requires access to a Tcl interpreter. For now the standard -// interpreter is used. In the long run it may be better to use a -// custom parser in places, if only to improve the diagnostics messages -// that users see. -// -// Consider the case of software CDL (other CDL variants will have -// similar requirements). A Tcl interpreter is needed to read in the -// data for a given package. It will also be needed at various stages -// when the data is being manipulated, e.g. to display a custom dialog -// or to execute e.g. a check_proc or a define_proc. Each package -// should run in its own safe interpreter with limited capabilities: -// file I/O is limited to read-only, but read-write in the build and -// install trees; network I/O is out of the question, at least until -// appropriate security support is added to the CDL language itself. -// However the interpreter should be extended with additional commands -// like cdl_get and cdl_set to access the configuration data. -// -// For security and robustness reasons it is desirable to have -// separate interpreters for the various packages. This leads to the -// concept of a master interpreter for the entire configuration, and a -// group of slave interpreters, one per package. In this model it -// is convenient to have the configuration and package entities -// associated directly with the interpreter. Note that a single -// application may have several configurations loaded in memory, -// so there may be several master interpreters. -// -// Some applications will want to support the graphical side of CDL, -// i.e. custom dialogs and wizards. This means linking in Tk, not to -// mention X11 (or the Windows equivalents), and making some/all of -// the Tk commands available to the safe interpreter. Arguably -// commands like toplevel should always be disabled. Not all clients -// of libcdl will want the overheads of linking with Tk and X, so this -// has to be made optional. -// -// The approach taken is as follows: -// -// 1) there is a class CdlInterpreter which provides access to Tcl -// interpreters. Amongst other things it takes care of converting -// between C and C++ strings. -// -// 2) every toplevel needs its own CdlInterpreter. The application -// code should supply this interpreter itself when the toplevel -// is instantiated, allowing it to decide whether or not Tk should -// be available. -// -// 3) each loadable gets its own safe slave interpreter, derived from -// the toplevel's interpreter. -// NOTE: initially the slave interpreters are not actually safe. It -// is not clear in the long term to what extent per-loadable -// interpreters need to be sandboxes, there are issues such as -// doing the equivalent of autoconf tests. - -// Tcl 8.4 involved various incompatible API changes related to -// const vs. non-const data. #define'ing USE_NON_CONST or -// USE_COMPAT_CONST avoids some of the problems, but does not -// help much for C++. -#if (TCL_MAJOR_VERSION > 8) || ((TCL_MAJOR_VERSION == 8) && (TCL_MINOR_VERSION >= 4)) -# define CDL_TCL_CONST_CAST(type,var) (var) -#else -# define CDL_TCL_CONST_CAST(type,var) const_cast(var) -#endif - -class CdlInterpreterBody -{ - friend class CdlTest; - - public: - - CYGDBG_DECLARE_MEMLEAK_COUNTER(); - - // This is how a top-level (i.e. per-toplevel) interpreter - // should get created. - static CdlInterpreter make(Tcl_Interp* = 0); - - // Create a slave interpreter for reading in the data in e.g. a - // cdl_package - CdlInterpreter create_slave(CdlLoadable, bool /* safe */ = true); - - // Make the interpreter safe, a one-way operation. - void make_safe(); - - // The destructor is public. - virtual ~CdlInterpreterBody(); - - // Add or remove commands from an interpreter. This provides - // a more C++-friendly implementation of Tcl's - // CreateCommand() and DeleteCommand(). - void add_command(std::string, CdlInterpreterCommand); - void remove_command(std::string); - - // In the libcdl world it is also convenient to swap whole sets of - // commands in and out. This is achieved by push and pop operations. - // push returns the old set (0 at the toplevel). pop restores - // the old set. - std::vector* push_commands(std::vector&); - void pop_commands(std::vector*); - std::vector* get_pushed_commands() const; - - // Similarly, allow variables to be set, unset and queried - void set_variable(std::string, std::string); - void unset_variable(std::string); - std::string get_variable(std::string); - - // FIXME: add support for variable traces. These are needed - // for cdl_value and similar utilities. - - // Provide hooks into the AssocData() facilities associated with - // Tcl interpreters. This makes it possible to store arbitrary - // data with an interpreter, e.g. to keep track of current state. - void set_assoc_data(const char*, ClientData, Tcl_InterpDeleteProc* =0); - void delete_assoc_data(const char*); - ClientData get_assoc_data(const char*); - - // Evaluate a string as Tcl code. The return value comes from Tcl, e.g. - // TCL_OK or TCL_ERROR. There are variants depending on whether or not - // the result string is of interest. - int eval(std::string); - int eval(std::string, std::string&); - - // Ditto for any Tcl code that comes from CDL files - int eval_cdl_code(const cdl_tcl_code); - int eval_cdl_code(const cdl_tcl_code, std::string&); - - // And support for evaluating an entire file - int eval_file(std::string); - int eval_file(std::string, std::string&); - - // For use by commands implemented in C++, a way of setting the result - void set_result(std::string); - - // And a utility to get the result as well. - std::string get_result(); - - // Was the result set by the Tcl interpreter or by libcdl? - bool result_set_by_cdl(); - - // A utility to quote data that is going to end up in a TCL script. - static std::string quote(std::string); - - // Turn some multiline data into a comment. - static std::string multiline_comment(const std::string&, int, int = 0); - - // Add some data to a comment, allowing for newlines if necessary - static std::string extend_comment(const std::string&, int, int = 0); - - // Write some data to a savefile, throwing an exception on error - void write_data(Tcl_Channel, std::string); - - // File-related utilities. - void locate_subdirs(std::string, std::vector&); - void locate_all_subdirs(std::string, std::vector&); - void locate_files(std::string, std::vector&); - void locate_all_files(std::string, std::vector&); - bool is_directory(std::string); - bool is_file(std::string); - - // When parsing a CDL script it is convenient to keep track of - // a number of items: - // - // 1) the toplevel, e.g. the entire configuration - // 2) the loadable, e.g. the current package - // 3) the parent of whatever is being processed at the moment - // 4) the entity, i.e. the thingamajig that is being processed. - // 5) the current file - // 6) an error reporting function - // - // This gives the various commands embedded in the Tcl interpreter - // enough information to do their job. Additional information can - // be provided via assoc_data() - // - // There should be only one call to set_toplevel(), for the - // master interpreter. All slaves inherit this, and the toplevel - // cannot be changed again. - // - // The loadable field is filled in via make_slave() - // - // For some members push and pop functions are more appropriate - // than set. - CdlToplevel get_toplevel() const; - CdlLoadable get_loadable() const; - CdlContainer get_container() const; - CdlNode get_node() const; - std::string get_context() const; - CdlDiagnosticFnPtr get_error_fn_ptr() const; - CdlDiagnosticFnPtr get_warning_fn_ptr() const; - CdlTransaction get_transaction() const; - void set_toplevel(CdlToplevel); - void set_transaction(CdlTransaction); - CdlContainer push_container(CdlContainer); - void pop_container(CdlContainer); - CdlNode push_node(CdlNode); - void pop_node(CdlNode); - std::string push_context(std::string); - void pop_context(std::string); - CdlDiagnosticFnPtr push_error_fn_ptr(CdlDiagnosticFnPtr); - void pop_error_fn_ptr(CdlDiagnosticFnPtr); - CdlDiagnosticFnPtr push_warning_fn_ptr(CdlDiagnosticFnPtr); - void pop_warning_fn_ptr(CdlDiagnosticFnPtr); - - // Provide utility classes for common push/pop combinations. The - // push happens during the constructor, the pop during the - // destructor. This can simplify some code, especially when - // exceptions may get thrown. - class DiagSupport { - public: - DiagSupport(CdlInterpreter interp_arg, CdlDiagnosticFnPtr error_fn_arg, CdlDiagnosticFnPtr warn_fn_arg) { - interp = interp_arg; - saved_error_fn = interp->push_error_fn_ptr(error_fn_arg); - saved_warn_fn = interp->push_warning_fn_ptr(warn_fn_arg); - } - ~DiagSupport() { - interp->pop_error_fn_ptr(saved_error_fn); - interp->pop_warning_fn_ptr(saved_warn_fn); - } - private: - DiagSupport(); - - CdlInterpreter interp; - CdlDiagnosticFnPtr saved_error_fn; - CdlDiagnosticFnPtr saved_warn_fn; - }; - class ContextSupport { - public: - ContextSupport(CdlInterpreter interp_arg, std::string context) { - interp = interp_arg; - saved_context = interp->push_context(context); - } - ~ContextSupport() { - interp->pop_context(saved_context); - } - private: - ContextSupport(); - CdlInterpreter interp; - std::string saved_context; - }; - class ContainerSupport { - public: - ContainerSupport(CdlInterpreter interp_arg, CdlContainer container) { - interp = interp_arg; - saved_container = interp->push_container(container); - } - ~ContainerSupport() { - interp->pop_container(saved_container); - } - private: - ContainerSupport(); - CdlInterpreter interp; - CdlContainer saved_container; - }; - class NodeSupport { - public: - NodeSupport(CdlInterpreter interp_arg, CdlNode node) { - interp = interp_arg; - saved_node = interp->push_node(node); - } - ~NodeSupport() { - interp->pop_node(saved_node); - } - private: - NodeSupport(); - CdlInterpreter interp; - CdlNode saved_node; - }; - class CommandSupport { - public: - CommandSupport(CdlInterpreter interp_arg, std::vector& commands) { - interp = interp_arg; - saved_commands = interp->push_commands(commands); - } - CommandSupport(CdlInterpreter interp_arg, CdlInterpreterCommandEntry* commands) { - unsigned int i; - for (i = 0; 0 != commands[i].command; i++) { - new_commands.push_back(commands[i]); - } - interp = interp_arg; - saved_commands = interp->push_commands(new_commands); - } - ~CommandSupport() { - interp->pop_commands(saved_commands); - } - - private: - CommandSupport(); - CdlInterpreter interp; - std::vector* saved_commands; - std::vector new_commands; - }; - - // Similar utility classes for variables and assoc data. - class VariableSupport { - public: - VariableSupport(CdlInterpreter interp_arg, std::string varname_arg, std::string data) { - interp = interp_arg; - varname = varname_arg; - interp->set_variable(varname, data); - } - ~VariableSupport() { - interp->unset_variable(varname); - } - private: - VariableSupport(); - CdlInterpreter interp; - std::string varname; - }; - class AssocSupport { - public: - AssocSupport(CdlInterpreter interp_arg, const char* name_arg, ClientData data, Tcl_InterpDeleteProc* del_proc = 0) { - interp = interp_arg; - name = name_arg; - interp->set_assoc_data(name, data, del_proc); - } - ~AssocSupport() { - interp->delete_assoc_data(name); - } - private: - AssocSupport(); - CdlInterpreter interp; - const char* name; - }; - - // Some command implementations may want to access other Tcl library - // routines such as Tcl_SplitList(). This requires convenient access - // to the underlying Tcl interpreter. - Tcl_Interp* get_tcl_interpreter() const; - - // For use by the assertion macros. - bool check_this(cyg_assert_class_zeal = cyg_quick) const; - - private: - // This is the Tcl command proc that gets registered for all - // CdlInterpreterCommand instances. - static int tcl_command_proc(ClientData, Tcl_Interp*, int, const char*[]); - - // This key is used to access the CdlInterpreter assoc data. - static char* cdlinterpreter_assoc_data_key; - - // Do not allow static instances of a Cdl interpreter. There are too - // many possible failure conditions. Cdl interpreters can only be - // created dynamically via make(), which will invoke this. - CdlInterpreterBody(Tcl_Interp*); - - // Default constructor, copy constructor and assignment are illegal - CdlInterpreterBody(); - CdlInterpreterBody(const CdlInterpreterBody&); - CdlInterpreterBody& operator=(const CdlInterpreterBody&); - - - Tcl_Interp* tcl_interp; // The underlying Tcl interpreter - bool owns_interp; // Was the Tcl interpreter created by the library? - std::vector slaves; // All slave interpreters - CdlInterpreter parent; // Or else the parent - CdlToplevel toplevel; // Data that gets used during the parsing process - CdlTransaction transaction; - CdlLoadable loadable; - CdlContainer container; - CdlNode node; - std::string context; - CdlDiagnosticFnPtr error_fn_ptr; - CdlDiagnosticFnPtr warning_fn_ptr; - bool cdl_result; - - std::vector* current_commands; // for push() and pop() - - enum { - CdlInterpreterBody_Invalid = 0, - CdlInterpreterBody_Magic = 0x0be67689 - } cdlinterpreterbody_cookie; -}; - -//}}} -//{{{ CdlReference/Referrer classes - -// --------------------------------------------------------------------------- -// CDL objects are organised primarily in a tree hierarchy. For -// example a package contains components, components contain options, -// and so on. The tree hierarchy tends to change rather infrequently, -// so it makes sense to have a quick way of navigating between -// entities without continuously having to do hash-table lookups. In -// addition it is very desirable to make the connectivity -// bidirectional: if a "requires" property in option A references -// option B then it would be useful to have a link back to A from B; -// that way, if the value of B changes it is a lot easier to keep -// things up to date. -// -// Terminology: the entity which contains the reference, e.g. a -// "requires" property, is the source. The relevant property is the -// "source property". The entity pointed at is the destination. -// -// Unfortunately there may be connections between CDL entities outside -// the tree hierarchy. In particular any property can contain one or -// more references to packages, components, options, wizards, or -// whatever. Often these references will be to options etc. within the -// same package, but some references will go to other packages. There -// may even be references to other configurations: for example a board -// may contain both an ordinary processor and a DSP; these two need -// their own configurations; however a package running on the DSP may -// need to interact with a package running on the processor, and vice -// versa. -// -// Also, a reference may occur inside an object that is not in the -// hierarchy. For example CDL expressions may get evaluated inside Tcl -// code rather than as part of a property. Such expressions may still -// contain references to entities in the current configuration. -// -// References may not be resolved. When reading in a CDL script there -// may be forward references. A reference may involve another package -// that has not yet been loaded, which is a conflict. -// -// Using simple pointers to store these connections is a bad idea. It -// makes it a lot harder to figure out what is connected to what, and -// it introduces horrible consistency problems when packages get -// loaded and unloaded. Instead libCDL provides a CdlReference class. -// Whenever a CdlProperty contains a reference to some other CDL -// entity there should be a CdlReference object corresponding to this. -// The reverse direction is handled via a CdlReferrer object. -// -// A CdlReference object can be either bound or unbound. By default it -// is unbound, containing only a string. It can then be bound via a -// member function, examined, and unbound again as required. Creating -// a binding automatically creates a CdlReferrer entry in the target -// object, thus avoiding any risk of inconsistencies. -// -// The CdlReference class should not be used outside the hierarchy, -// since every bound reference must have a referrer object pointing -// back, and this link back can only be valid within the hierarchy. -// Temporary CdlReference objects are useful during the construction -// of properties. -// -// It is possible that a given property (e.g. a complicated "requires" -// expression) has multiple references to another entity. Each of -// these involves a separate CdlReference/CdlReferrer pair. - -// ---------------------------------------------------------------------------- -// The actual CdlReference class. - -class CdlReference { - - friend class CdlTest; - - // CdlReferrer must be a friend so that when a package gets unloaded - // it can clean up all references to it. - friend class CdlReferrer; - - public: - - // The default constructor should not normally be used, instead - // a string should be supplied. However there are vectors of - // reference objects... - CdlReference(); - - // The main constructor supplies the name of the referenced - // entity. The resulting object will be unbound. - CdlReference(const std::string); - - // The copy constructor is legal for unbound objects only. - CdlReference(const CdlReference&); - - // The assignment operator is needed for STL operations. - // Again it only makes sense of unbound objects. - CdlReference& operator=(const CdlReference&); - - // The destructor is only valid for unbound objects. All references - // should be unbound before an entity can be destroyed. - ~CdlReference(); - - // Access the various fields. - void set_destination_name(const std::string); - const std::string& get_destination_name() const; - CdlNode get_destination() const; - - // Binding a reference. Obviously this can only be used when the - // reference is still unbound. When doing the binding it is - // necessary to know: - // (1) the object containing the reference. - // (2) the specific property that contains the reference. - // (3) the object being referred to. - // Binding a reference results in a new referrer entry in the - // destination. - void bind(CdlNode, CdlProperty, CdlNode); - - // Unbinding a reference. Typically this only happens when the - // destination is unloaded. The arguments provide the source and - // the source property. - void unbind(CdlNode, CdlProperty); - - // This is used by the ASSERT_CLASS() and ASSERT_THIS() macros. - bool check_this(cyg_assert_class_zeal cyg_quick) const; - CYGDBG_DECLARE_MEMLEAK_COUNTER(); - - protected: - - private: - - // The data fields. The name is usually filled in by the - // constructor. The destination defaults to zero for an unbound - // object and gets filled in by the bind() operation. - std::string dest_name; - CdlNode dest; - - enum { - CdlReference_Invalid = 0, - CdlReference_Magic = 0x3f908608 - } cdlreference_cookie; -}; - -// ---------------------------------------------------------------------------- -// The CdlNode class (and hence just about everything) contains a -// vector of CdlReferrer objects. This keeps track of all entities -// that refer to this one, so if the value associated with this -// changes it is possible to work out the impact of this on all -// entities that rely on this value. -// -// Arguably this should work in terms of CdlValuable objects rather -// than CdlNode objects. However it is convenient to use references -// for the connection between e.g. an option and a dialog, where -// there is no value involved. The reverse connection is of little -// use in this circumstance. -// -// CdlReferrer objects are rarely accessed directly. Instead they will -// be filled in during a CdlReference::bind() operation and erased -// during a CdlReference::unbind() operation. The only operations that -// should be public allow access to the contained data. - -class CdlReferrer { - - friend class CdlTest; - - // CdlReference::bind() and unbind() have direct access to the - // members, since these two functions are really responsible for - // creating and destroying referrer objects. - friend class CdlReference; - - public: - - // The default constructor, copy constructor and assignment - // operator are all public to avoid problems with having vectors - // of referrer objects. Similarly the destructor is public. - // In practice updates actually happen as a consequence of - // CdlReference::bind() and CdlReference::unbind(). - CdlReferrer(); - CdlReferrer(const CdlReferrer&); - CdlReferrer& operator=(const CdlReferrer&); - ~CdlReferrer(); - - CdlNode get_source() const; - CdlProperty get_source_property() const; - void update(CdlTransaction, CdlNode, CdlUpdate); - bool check_this(cyg_assert_class_zeal=cyg_quick) const; - CYGDBG_DECLARE_MEMLEAK_COUNTER(); - - private: - - CdlNode source; - CdlProperty source_property; - - enum { - CdlReferrer_Invalid = 0, - CdlReferrer_Magic = 0x70e1fc37 - } cdlreferrer_cookie; -}; - -//}}} -//{{{ Value and Expression classes - -//{{{ CdlEvalContext - -// ---------------------------------------------------------------------------- -// Expression evaluation always happens within a certain context. -// This may involve a transaction. Usually it involves a node and -// a property within that node, although it is possible to evaluate -// expressions from inside Tcl code. -// -// To avoid passing too many arguments around the various -// evaluation-related routines, a utility class is provided. - -class CdlEvalContext { - - friend class CdlTest; - - public: - - CdlTransaction transaction; - CdlNode node; - CdlProperty property; - CdlToplevel toplevel; - - CdlEvalContext(CdlTransaction, CdlNode = 0, CdlProperty = 0, CdlToplevel = 0); - ~CdlEvalContext(); - - // Given a reference inside an expression, try to resolve this to either - // a node or, more specifically, a valuable. - CdlNode resolve_reference(CdlExpression, int); - CdlValuable resolve_valuable_reference(CdlExpression, int); - - bool check_this(cyg_assert_class_zeal = cyg_quick) const; - CYGDBG_DECLARE_MEMLEAK_COUNTER(); - - protected: - - private: - // Illegal operation, the three fields must always be supplied, - // although they may be zero. - CdlEvalContext(); - - enum { - CdlEvalContext_Invalid = 0, - CdlEvalContext_Magic = 0x03434be9 - } cdlevalcontext_cookie; - -}; - -//}}} -//{{{ CdlSimpleValue - -// ---------------------------------------------------------------------------- -// Expression evaluation happens in terms of CdlSimpleValue objects. -// In CDL all values are strings, but for the purposes of arithmetic -// these strings sometimes have to be interpreted as integers or as -// double precision numbers. Sometimes there is a choice, for example -// the equality operator == can mean numerical or string comparison. -// The basic rules that get applied are: -// -// 1) if the current value has an integer representation then -// use this by preference. This means that an expression -// of the form (CYGNUM_XXX != 0x100) will do a integer -// comparison if possible. -// -// 2) otherwise if the current value can be interpreted as a -// double precision number, use that representation. -// All integers can be interpreted as doubles (at the risk -// of some loss of precision), so the representation as -// a double should only be used if the integer representation -// is inappropriate. -// -// 3) otherwise interpret the value as a string. -// -// The default value is 0. - -class CdlSimpleValue { - - friend class CdlTest; - - public: - - CdlSimpleValue(); - CdlSimpleValue(std::string); - CdlSimpleValue(cdl_int); - CdlSimpleValue(double); - CdlSimpleValue(const CdlSimpleValue&); - CdlSimpleValue(bool); - ~CdlSimpleValue(); - - CdlSimpleValue& operator=(const CdlSimpleValue&); - CdlSimpleValue& operator=(std::string); - CdlSimpleValue& operator=(cdl_int); - CdlSimpleValue& operator=(double); - - CdlSimpleValue& operator=(bool); - - bool operator==(const CdlSimpleValue&) const; - bool operator!=(const CdlSimpleValue&) const; - bool operator==(std::string arg) const - { - CdlSimpleValue val(arg); - return *this == val; - } - bool operator==(cdl_int arg) const - { - CdlSimpleValue val(arg); - return *this == val; - } - bool operator==(double arg) const - { - CdlSimpleValue val(arg); - return *this == val; - } - bool operator!=(std::string arg) const - { - CdlSimpleValue val(arg); - return *this != val; - } - bool operator!=(cdl_int arg) const - { - CdlSimpleValue val(arg); - return *this != val; - } - bool operator!=(double arg) const - { - CdlSimpleValue val(arg); - return *this != val; - } - - void set_value(std::string, CdlValueFormat = CdlValueFormat_Default); - std::string get_value() const; - - bool has_integer_value() const; - void set_integer_value(cdl_int, CdlValueFormat = CdlValueFormat_Default); - cdl_int get_integer_value() const; - - bool has_double_value() const; - void set_double_value(double, CdlValueFormat = CdlValueFormat_Default); - double get_double_value() const; - - CdlValueFormat get_value_format() const; - void set_value_format(CdlValueFormat); - void set_value_format(CdlSimpleValue&); - void set_value_format(CdlSimpleValue&, CdlSimpleValue&); - - static void eval_valuable(CdlEvalContext&, CdlValuable, CdlSimpleValue&); - - // For expression evaluation, it is often convenient to get hold - // of a boolean as well. This may indicate a non-empty string - // or a non-zero value. - bool get_bool_value() const; - - // This class is too simple to warrant even a cookie validation. - bool check_this(cyg_assert_class_zeal zeal = cyg_quick) const { - return true; - } - - protected: - - private: - enum { - int_valid = 0x01, - double_valid = 0x02, - string_valid = 0x04, - int_invalid = 0x08, - double_invalid = 0x10 - }; - mutable int valid_flags; - mutable std::string value; - mutable cdl_int int_value; - mutable double double_value; - CdlValueFormat format; -}; - -//}}} -//{{{ CdlListValue - -// ---------------------------------------------------------------------------- -// Evaluating a list expression results in a set of possible values, but -// unlike the original list expression these values are now constant and -// can have no dependencies on CDL entities. As with list expressions the -// main operation on a list value is to detect membership, but using -// list values allows multiple potential members to be tested without -// repeated expression evaluation. The main use of list values is implicit -// in libcdl, each list expression contains a mutable cached list value. -// -// A list value contains five sets of data: -// -// 1) separate vectors of strings, integers, and floating point constants. -// Having separate vectors of integers and floating points avoids -// problems when numbers can be represented in different formats. -// 2) a vector of cdl_int pairs for ranges of integer data -// 3) a vector of double pairs for ranges of floating point data -// -// Any of these vectors may be empty, but at least one of the vectors should -// contain useful data. Possibly there should also be tables for cdl_int and -// double to avoid unnecessary string conversions. - -class CdlListValue { - - friend class CdlTest; - - // A list value will only be filled in when a list expression is evaluated. - // The members cannot be updated by other means. - friend class CdlListExpressionBody; - - public: - - CdlListValue(); - ~CdlListValue(); - CdlListValue(const CdlListValue&); - CdlListValue& operator=(const CdlListValue&); - - bool is_member(CdlSimpleValue&) const; - bool is_member(std::string, bool = true) const; - bool is_member(cdl_int, bool = true) const; - bool is_member(double, bool = true) const; - - // These provide access to the raw data, for example if it is - // necessary to suggest a legal value to the user. - const std::vector& get_table() const; - const std::vector >& get_integer_ranges() const; - const std::vector >& get_double_ranges() const; - - bool check_this(cyg_assert_class_zeal = cyg_quick) const; - CYGDBG_DECLARE_MEMLEAK_COUNTER(); - - private: - std::vector table; - std::vector > integer_ranges; - std::vector > double_ranges; - - enum { - CdlListValue_Invalid = 0, - CdlListValue_Magic = 0x2183a943 - } cdllistvalue_cookie; -}; - -//}}} -//{{{ CdlValue - -// ---------------------------------------------------------------------------- -// Values in CDL are non-trivial compared with some other languages. -// Even though CDL is not a fully-typed language, it does still have -// four different flavors to consider. There is also the problem that -// an entity may have up to four different values which should be -// stored (default, inferred, wizard, user), with the ability to -// switch between them. The CdlValue class provides support for this. -// -// CdlValue objects are not normally updated explicitly. Instead -// higher level code deals with CdlValuable objects, which inherit -// privately from CdlValue. Modifications to CdlValuables happen in -// the context of a transaction. -// -// The first concept to take into account is the flavor. There -// are four flavors, None, Bool, BoolData and Data. The member -// function get_flavor() can be used to obtain the current flavor. -// -// CdlValueFlavor CdlValue::get_flavor() const; -// -// Values may be enabled or disabled. Values of flavor None -// and Data are always enabled. Values of flavor Bool or BoolData -// may or may not be enabled, by default they are disabled. -// -// bool CdlValue::is_enabled(...) const; -// -// (The optional argument to is_enabled() is discussed later). -// -// Values of flavor BoolData and Data also have a string value, -// which can be interpreted as an integer or a double under -// the right circumstances. -// -// std::string CdlValue::get_value(...) const; -// bool CdlValue::has_integer_value(...) const; -// bool CdlValue::has_double_value(...) const; -// cdl_int CdlValue::get_integer_value(...) const; -// double CdlValue::get_double_value(...) const; -// -// This is equivalent to a CdlSimpleValue object, and in fact -// that is the internal representation. It is possible to -// get hold of the CdlSimpleValue object directly: -// -// CdlSimpleValue CdlValue::get_simple_value(...) const; -// -// The get_integer_value() and get_double_value() members should -// only be used if you are confident that the current value has -// an integer or double representation. Otherwise the result is -// undefined. -// -// The optional argument to these member functions represents -// the source. A value can be set from four different sources: -// the default value (usually either 0 or the result of -// evaluating a default_value property); an inferred value, -// determined by the inference engine; a wizard value, i.e. -// what a CDL wizard believes the correct value to be based -// on user input; and a user value, something explicitly -// set by the end user. These have different priorities: -// the inference engine can override default values but not -// user values. A CdlValue object keeps track of the current -// source. -// -// CdlValueSource CdlValue::get_source() const; -// -// If no argument is given to e.g. is_enabled() then the -// current source is used. Otherwise it is possible to find -// out whether or not the entity is enabled for each of the -// sources. -// -// The default source is always defined, the others may or -// may not be. It is possible to find out for each source -// whether or not a value has been set. -// -// bool CdlValue::has_source(CdlValueSource) const; -// -// -// Updating values normally happens in the CdlValuable class, -// but the member functions are the same. There is a member -// function to change the flavor: -// -// void CdlValue::set_flavor(CdlValueFlavor); -// -// However this member function is intended only for use by the -// library itself. An entity's flavor is normally defined by CDL data, -// and should not be updated explicitly by application code. -// -// There are two member functions to manipulate the value source: -// -// void CdlValue::set_source(CdlValueSource); -// void CdlValue::invalidate_source(CdlValueSource); -// -// The first function can be used if e.g. the user wants to -// change his or her mind and go back to the default value -// rather than a user value. The user value is not forgotten -// and can be reinstated. -// -// invalidate_source() can be used to completely cancel a -// value source. If that source happens to be the current one -// then the current source will be adjusted appropriately. -// It is illegal to attempt to invalidate the default source. -// -// For values with flavor Bool and BoolData, there are three -// member functions that can be used to control the enabled -// status: -// -// void CdlValue::set_enabled(bool, CdlValueSource); -// void CdlValue::enable(CdlValueSource); -// void CdlValue::disable(CdlValueSource); -// -// Note that when updating a CdlValue object the source should -// be known and must be specified. If the source has a higher -// priority than the current one then it will automatically -// become the new source. On the rare occasion that this is -// not desired, set_source() will have to be used afterwards -// to reset the current source. -// -// For values with flavor BoolData and Data the following -// member functions are available to change the value string: -// -// void CdlValue::set_value(std::string, CdlValueSource); -// void CdlValue::set_value(cdl_int, CdlValueSource); -// void CdlValue::set_value(double, CdlvalueSource); -// void CdlValue::set_value(CdlSimpleValue&, CdlValueSource); -// -// For values with flavor BoolData is is possible to -// combine updating the enabled flag and the string value: -// -// void CdlValue::set_enabled_and_value(bool, std::string, CdlValueSource); -// void CdlValue::set_enabled_and_value(bool, cdl_int, CdlValueSource); -// void CdlValue::set_enabled_and_value(bool, double, CdlValueSource); -// void CdlValue::set_enabled_and_value(bool, CdlSimpleValue&, CdlValueSource); -// void CdlValue::enable_and_set_value(std::string, CdlValueSource); -// void CdlValue::enable_and_set_value(cdl_int, CdlValueSource); -// void CdlValue::enable_and_set_value(double, CdlValueSource); -// void CdlValue::enable_and_set_value(CdlSimpleValue&, CdlValueSource); -// void CdlValue::disable_and_set_value(std::string, CdlValueSource); -// void CdlValue::disable_and_set_value(cdl_int, CdlValueSource); -// void CdlValue::disable_and_set_value(double, CdlValueSource); -// void CdlValue::disable_and_set_value(CdlSimpleValue&, CdlValueSource); -// -// Obviously many of these functions are just simple inlines. -// -// There is one final member function: -// -// void CdlValue::set(CdlSimpleValue, CdlValueSource); -// -// This member function is defined to do the right thing, -// whatever the flavor happens to be. - -class CdlValue { - - friend class CdlTest; - - public: - - CdlValue(CdlValueFlavor = CdlValueFlavor_Bool); - virtual ~CdlValue(); - CdlValue(const CdlValue&); - CdlValue& operator=(const CdlValue&); - - CdlValueFlavor get_flavor() const; - CdlValueSource get_source() const; - bool has_source(CdlValueSource) const; - - bool is_enabled(CdlValueSource = CdlValueSource_Current) const; - std::string get_value(CdlValueSource = CdlValueSource_Current) const; - bool has_integer_value(CdlValueSource = CdlValueSource_Current) const; - bool has_double_value(CdlValueSource = CdlValueSource_Current) const; - cdl_int get_integer_value(CdlValueSource = CdlValueSource_Current) const; - double get_double_value(CdlValueSource = CdlValueSource_Current) const; - CdlSimpleValue get_simple_value(CdlValueSource = CdlValueSource_Current) const; - - void set_source(CdlValueSource); - void invalidate_source(CdlValueSource); - - void set_enabled(bool, CdlValueSource); - void enable(CdlValueSource source) - { - set_enabled(true, source); - } - void disable(CdlValueSource source) - { - set_enabled(false, source); - } - - void set_value(CdlSimpleValue&, CdlValueSource); - void set_value(std::string data, CdlValueSource source) - { - CdlSimpleValue val(data); - set_value(val, source); - } - void set_integer_value(cdl_int data, CdlValueSource source) - { - CdlSimpleValue val(data); - set_value(val, source); - } - void set_double_value(double data, CdlValueSource source) - { - CdlSimpleValue val(data); - set_value(val, source); - } - void set_enabled_and_value(bool, CdlSimpleValue&, CdlValueSource); - void set_enabled_and_value(bool enabled, std::string data, CdlValueSource source) - { - CdlSimpleValue val(data); - set_enabled_and_value(enabled, val, source); - } - void set_enabled_and_value(bool enabled, cdl_int data, CdlValueSource source) - { - CdlSimpleValue val(data); - set_enabled_and_value(enabled, val, source); - } - void set_enabled_and_value(bool enabled, double data, CdlValueSource source) - { - CdlSimpleValue val(data); - set_enabled_and_value(enabled, val, source); - } - void enable_and_set_value(CdlSimpleValue& val, CdlValueSource source) - { - set_enabled_and_value(true, val, source); - } - void enable_and_set_value(std::string data, CdlValueSource source) - { - set_enabled_and_value(true, data, source); - } - void enable_and_set_value(cdl_int data, CdlValueSource source) - { - set_enabled_and_value(true, data, source); - } - void enable_and_set_value(double data, CdlValueSource source) - { - set_enabled_and_value(true, data, source); - } - void disable_and_set_value(CdlSimpleValue& val, CdlValueSource source) - { - set_enabled_and_value(false, val, source); - } - void disable_and_set_value(std::string data, CdlValueSource source) - { - set_enabled_and_value(false, data, source); - } - void disable_and_set_value(cdl_int data, CdlValueSource source) - { - set_enabled_and_value(false, data, source); - } - void disable_and_set_value(double data, CdlValueSource source) - { - set_enabled_and_value(false, data, source); - } - - void set(CdlSimpleValue&, CdlValueSource); - - bool check_this(cyg_assert_class_zeal = cyg_quick) const; - CYGDBG_DECLARE_MEMLEAK_COUNTER(); - - // This should only be used by the library itself. - void set_flavor(CdlValueFlavor); - - protected: - - private: - - CdlValueFlavor flavor; - CdlValueSource current_source; - - // FIXME: a static const member should be used for the array - // sizes, but VC++ does not support that part of the language. - // FIXME: std::bitset should be used here. Using lots of separate - // bools here is inefficient. - bool source_valid[4]; - bool enabled[4]; - CdlSimpleValue values[4]; - - enum { - CdlValue_Invalid = 0, - CdlValue_Magic = 0x41837960 - } cdlvalue_cookie; -}; - -//}}} -//{{{ CdlSubexpression - -// ---------------------------------------------------------------------------- -// Expressions come into existence primarily as the result of reading -// in certain properties like default_value in CDL data. It is also -// possible for expressions to be generated and evaluated on the fly -// inside Tcl code, but that is expected to be a comparatively rare -// events. Expression objects always live on the heap, usually only -// in derived classes. -// -// An ordinary expression evaluates to a single value. There are two -// other types of expression in the CDL language, goal expressions and -// list expression. A goal expression is essentially a set of ordinary -// expressions with implicit &&'s between them. A list expression -// is a set of expressions that can be evaluated to a constant vector, -// plus pairs of expressions that constitute ranges. Again goal and -// list expressions only live on the heap. -// -// Both parsing an evaluation involve tokens for the various -// operators. The inference engine, conflict reporting code, and -// other diagnostic code will also need to have ready access to -// this information. Hence it makes a bit more sense to have -// the enum outside the expression class. - -enum CdlExprOp { - CdlExprOp_Invalid = 0, - CdlExprOp_EOD = 1, // End of data reached - CdlEXprOp_Command = 2, // [tcl code] - CdlExprOp_Variable = 3, // $tcl_variable - CdlExprOp_StringConstant = 4, // "hello" - CdlExprOp_IntegerConstant = 5, // 123 - CdlExprOp_DoubleConstant = 6, // 3.1415 - CdlExprOp_Reference = 7, // CYGPKG_INFRA - CdlExprOp_Range = 8, // x to y - CdlExprOp_Negate = 9, // -x - CdlExprOp_Plus = 10, // +x - CdlExprOp_LogicalNot = 11, // !x - CdlExprOp_BitNot = 12, // ~x - CdlExprOp_Indirect = 13, // *x - CdlExprOp_Active = 14, // ?x - CdlExprOp_Function = 15, // sin(x) - CdlExprOp_Multiply = 16, // x * y - CdlExprOp_Divide = 17, // x / y - CdlExprOp_Remainder = 18, // x % y - CdlExprOp_Add = 19, // x + y - CdlExprOp_Subtract = 20, // x - y - CdlExprOp_LeftShift = 21, // x << y - CdlExprOp_RightShift = 22, // x >> y - CdlExprOp_LessThan = 23, // x < y - CdlExprOp_LessEqual = 24, // x <= y - CdlExprOp_GreaterThan = 25, // x > y - CdlExprOp_GreaterEqual = 26, // x >= y - CdlExprOp_Equal = 27, // x == y - CdlExprOp_NotEqual = 28, // x != y - CdlExprOp_BitAnd = 29, // x & y - CdlExprOp_BitXor = 30, // x ^ y - CdlExprOp_BitOr = 31, // x | y - CdlExprOp_And = 32, // x && y - CdlExprOp_Or = 33, // x || y - CdlExprOp_Cond = 34, // x ? a : b - CdlExprOp_StringConcat = 35, // x . y - CdlExprOp_Implies = 36, // x implies y - CdlExprOp_Xor = 37, // x xor y - CdlExprOp_Eqv = 38 // x eqv y -}; - -// ---------------------------------------------------------------------------- -// A subexpression consists of an operation, possibly some constant -// data, and possibly indices into the subexpression vector. -// Normally some unions would be used, but unions and objects such -// as std::string do not mix, and the amount of memory involved is -// not big enough to really worry about. - -#define CdlFunction_MaxArgs 3 -struct CdlSubexpression { - - CdlExprOp op; - CdlSimpleValue constants; // String, integer or double constant - int reference_index; // iff CdlExprOp_Reference - - int lhs_index; // for all non-constant operators - int rhs_index; // for binary and ternary operators only - int rrhs_index; // only for ternary operators. - - int func; // iff CdlExprOp_Function - int args[CdlFunction_MaxArgs]; -}; - -//}}} -//{{{ CdlFunction - -// ---------------------------------------------------------------------------- -// Generic support for function parsing, evaluation, and inference. The -// implementation is extensible so that functions can be added to the -// core via static constructors. - -class CdlFunction { - - friend class CdlTest; - - public: - CdlFunction(const char* /* name */, int /* no_args */, - void (*)(CdlExpression, const CdlSubexpression&), - void (*)(CdlEvalContext&, CdlExpression, const CdlSubexpression&, CdlSimpleValue&), - bool (*)(CdlTransaction, CdlExpression, unsigned int, bool, int), - bool (*)(CdlTransaction, CdlExpression, unsigned int, CdlSimpleValue&, int) - ); - ~CdlFunction(); - - static bool is_function(std::string, int&); - static std::string get_name(int); - static int get_args_count(int); - - static void check(CdlExpression, const CdlSubexpression&); - static void eval(CdlEvalContext&, CdlExpression, const CdlSubexpression&, CdlSimpleValue&); - static bool infer_bool(CdlTransaction, CdlExpression, unsigned int, bool, int); - static bool infer_value(CdlTransaction, CdlExpression, unsigned int, CdlSimpleValue&, int); - - static void (*null_check)(CdlExpression, const CdlSubexpression&); - static bool (*null_infer_bool)(CdlTransaction, CdlExpression, unsigned int, bool, int); - static bool (*null_infer_value)(CdlTransaction, CdlExpression, unsigned int, CdlSimpleValue&, int); - - protected: - - private: - // Keep track of all functions in the system - static std::vector all_functions; - - // Each function object is given a unique id during initialization - static int next_id; - int id; - - // Provided by the constructor - const char* name; - int number_args; - void (*check_fn)(CdlExpression, const CdlSubexpression&); - void (*eval_fn)(CdlEvalContext&, CdlExpression, const CdlSubexpression&, CdlSimpleValue&); - bool (*infer_bool_fn)(CdlTransaction, CdlExpression, unsigned int, bool, int); - bool (*infer_value_fn)(CdlTransaction, CdlExpression, unsigned int, CdlSimpleValue&, int); - - // The default constructor is illegal - CdlFunction(); -}; - -//}}} -//{{{ CdlExpression - -// ---------------------------------------------------------------------------- -// And now for the expression class itself. - -class CdlExpressionBody { - - friend class CdlTest; - - public: - - // The default constructor is basically a no-op, new expression - // objects only get created as a consequence of parsing. However - // it exists and is protected for the convenience of derived - // classes. The copy constructor is protected, allowing parsing - // code to first parse an expression and then copy the expression - // into a higher level object. The assignment operator is illegal. - // There is no reason to hide the destructor. - virtual ~CdlExpressionBody(); - - // An expression involves three pieces of data. There is a vector - // of subexpressions. It is also necessary to know where - // evaluation should being, in accordance with operator precedence - // rules. And there is a vector of CdlReference objects - this - // needs to be kept separate from the subexpression vector because - // CdlReference objects are comparatively tricky. - // - // All of this data is public and can be readily inspected by the - // inference engine, by conflict detection code, by diagnostic - // code, etc. - std::vector sub_expressions; - int first_subexpression; - std::vector references; - bool update(CdlTransaction, CdlNode, CdlProperty, CdlNode, CdlUpdate); - - // There are a number of parsing functions. The first one is - // used by higher-level code to parse a single expression. Its - // argument is a single string (which may be the result of - // concatenating several Tcl arguments), and at the end of the - // parse operation there should be no further data. The result - // will either be a new expression object or a parsing exception - // to be caught by higher level code. - static CdlExpression parse(std::string); - - // This is used when parsing list expressions, which involve a - // sequence of ordinary expressions and possibly range operators. - // The whole list expression lives in a single string, and it is - // necessary to provide an index indicating where in the string - // parsing should begin. It is also useful to return details of - // the token that caused parsing to terminate (EOD, Range, or - // the start of something else). - static CdlExpression parse(std::string, int&, CdlExprOp&, int&); - - // A goal expression is derived from an ordinary expression but - // has somewhat different rules for evaluating. Parsing a goal - // expression involves parsing a number of ordinary expressions - // with implicit && operators between them, and it requires - // a parsing function that can be used to extend an existing - // expression. - // - // NOTE: possibly this should should be a protected member, since - // its main use is in parsing goal expressions. - static void continue_parse(CdlExpression, std::string, int&, CdlExprOp&, int&); - - // Evaluating expressions. Note that this may fail at run-time - // because of errors that cannot be caught sensibly when the - // expression is read in, for example arithmetic overflow or - // division by zero. Because such failures are a possibility - // anyway no special action is taken to prevent an expression - // with e.g. an unresolved reference from being evaluated. - // - // eval() is the public interface, and manages - // CdlConflict_EvalException objects. eval_internal() is for use - // by list and goal expressions. - void eval(CdlEvalContext&, CdlSimpleValue&); - void eval_internal(CdlEvalContext&, CdlSimpleValue&); - void eval_subexpression(CdlEvalContext&, int, CdlSimpleValue&); - - // The full original expression is useful for diagnostics purposes - std::string get_original_string() const; - - bool check_this(cyg_assert_class_zeal cyg_quick) const; - CYGDBG_DECLARE_MEMLEAK_COUNTER(); - - protected: - - // The default constructor does very little, the main work - // is done by the various parsing functions. However it is - // available to derived classes, especially goal expressions. - CdlExpressionBody(); - - // The copy constructor has to be usable by derived classes, - // e.g. CdlExpressionProperty - CdlExpressionBody(const CdlExpressionBody&); - - private: - - - // The assignment operator is illegal. - CdlExpressionBody& operator=(const CdlExpressionBody&); - - // The string that was parsed originally - std::string expression_string; - - enum { - CdlExpressionBody_Invalid = 0, - CdlExpressionBody_Magic = 0x760293a3 - } cdlexpressionbody_cookie; -}; - -//}}} -//{{{ CdlListExpression - -// ---------------------------------------------------------------------------- -// The main use of list expressions is for the legal_values -// properties. Essentially a list expression is just a vector of -// ordinary expressions and ranges of expressions. - -class CdlListExpressionBody { - - friend class CdlTest; - - public: - - // Availability of constructors etc. is as per the ordinary - // expression class. - virtual ~CdlListExpressionBody(); - - // The data associated with a list expression is a vector of - // expressions, plus a vector of expression pairs constituting - // ranges. As with ordinary expressions the data is fully public - // and can be readily examined by e.g. the inference engine. - std::vector data; - std::vector > ranges; - - // Parsing. This involves taking a single string, typically from - // a CDL script, and parsing one or more ordinary expressions. - static CdlListExpression parse(std::string); - - // Evaluation support. A list expression evaluates to a list value. - void eval(CdlEvalContext&, CdlListValue&); - - // More commonly client code is going to be interested in whether - // or not a particular value is a legal member. The result - // cache ensures that it is possible to - bool is_member(CdlEvalContext&, CdlSimpleValue&); - bool is_member(CdlEvalContext&, std::string); - bool is_member(CdlEvalContext&, cdl_int); - bool is_member(CdlEvalContext&, double); - - // The full original expression is useful for diagnostics purposes - std::string get_original_string() const; - - bool check_this(cyg_assert_class_zeal = cyg_quick) const; - CYGDBG_DECLARE_MEMLEAK_COUNTER(); - - protected: - CdlListExpressionBody(const CdlListExpressionBody&); - bool update(CdlTransaction, CdlNode, CdlProperty, CdlNode, CdlUpdate); - - private: - - CdlListExpressionBody(); - CdlListExpressionBody& operator=(const CdlListExpressionBody&); - - void eval_internal(CdlEvalContext&, CdlListValue&); - std::string expression_string; - - enum { - CdlListExpressionBody_Invalid = 0, - CdlListExpressionBody_Magic = 0x7da4bcc2 - } cdllistexpressionbody_cookie; -}; - -//}}} -//{{{ CdlGoalExpression - -// ---------------------------------------------------------------------------- -// A goal expression inherits privately from ordinary expressions. Essentially -// a goal expression is simply a set of ordinary expressions separated by &&, -// but it can only be evaluated to a boolean. The parse() and eval() members -// of the base class should not be exposed. There is a member to get hold of -// the underlying ordinary expression, for use by e.g. the inference engine. - -class CdlGoalExpressionBody : private CdlExpressionBody { - - friend class CdlTest; - - typedef CdlExpressionBody inherited; - - public: - virtual ~CdlGoalExpressionBody(); - - static CdlGoalExpression parse(std::string); - - // A few variants of the eval() member, with a choice of returning - // by value or by reference. The latter provide consistency with the - // other expression classes. - bool eval(CdlEvalContext&); - void eval(CdlEvalContext&, bool&); - - // Provide public access to the underlying expression object, - // useful for the inference engine - CdlExpression get_expression(); - - // The full original expression is useful for diagnostics purposes - std::string get_original_string() const; - - bool check_this(cyg_assert_class_zeal = cyg_quick) const; - CYGDBG_DECLARE_MEMLEAK_COUNTER(); - - protected: - CdlGoalExpressionBody(const CdlGoalExpressionBody&); - - - private: - - CdlGoalExpressionBody(); - CdlGoalExpressionBody& operator=(const CdlGoalExpressionBody&); - void eval_internal(CdlEvalContext&, bool&); - - std::string expression_string; - - enum { - CdlGoalExpressionBody_Invalid = 0, - CdlGoalExpressionBody_Magic = 0x5a58bb24 - } cdlgoalexpressionbody_cookie; -}; - -//}}} -//{{{ CdlInfer - -// ---------------------------------------------------------------------------- -// A utility class related to inference. This exports the main functions -// needed, allowing e.g. per-function inference routines from func.cxx to -// interact with the main inference engine. - -class CdlInfer { - public: - static bool make_active(CdlTransaction, CdlNode, int /* level */); - static bool make_inactive(CdlTransaction, CdlNode, int /* level */); - static bool set_valuable_value(CdlTransaction, CdlValuable, CdlSimpleValue&, int /* level */); - static bool set_valuable_bool(CdlTransaction, CdlValuable, bool, int /* level */); - static bool subexpr_value(CdlTransaction, CdlExpression, unsigned int /* index */, CdlSimpleValue& goal, int /* level */); - static bool subexpr_bool(CdlTransaction, CdlExpression, unsigned int /* index */, bool, int /* level */); - - private: - CdlInfer(); -}; - -//}}} - -//}}} -//{{{ CdlConflict classes - -// ---------------------------------------------------------------------------- -// As a configuration is created and modified there will be times when -// things are not completely consistent. There may be a reference to -// some option that is not in any package in the current -// configuration. An option may have an invalid value, possibly as a -// side effect of a change to some other option. There may be a -// dependency that is not satisfied. There may be other types of -// conflict. -// -// The library provides a base class CdlConflict, and a number of -// derived classes for common types of conflict such as unresolved -// references. All conflicts are associated with a CdlNode and a -// property within that. It is possible to use dynamic_cast<> to find -// out the exact type of a conflict, or alternatively to use the -// virtual member function get_explanation(). -// -// Conflicts may be disabled by the user if they are not actually -// important as far as application code is concerned. In other words -// the end user is allowed to override the constraints specified in -// the CDL. This information is saved with the configuration data. -// Preferably the user should give an explanation for why the conflict -// is disabled, to serve as a reminder some months later when the -// configuration is reloaded. -// -// -// Conflicts have a fairly complicated life cycle. First it is -// necessary to distinguish between structural and normal conflicts. A -// structural conflict is typically caused by a reference to a -// non-existent valuable. These conflicts are generally created only -// when something is loaded, and only go away when something is -// unloaded. A normal conflict is typically related to a value, for -// example a value outside the legal range, or a "requires" property -// that is not satisfied. -// -// Conflicts are created and destroyed in the context of a -// transaction, which in turn operates in the context of a toplevel. -// If the transaction is committed then new conflicts get added to the -// appropriate toplevel list, and destroyed conflicts get removed from -// the toplevel list. The transaction field indicates whether the -// conflict is currently per-transaction or global. -// -// Transactions may get nested, i.e. a conflict may get created as -// part of a sub-transaction, and when that sub-transaction is committed -// the conflict is moved to the parent transaction. -// -// For each toplevel, libcdl keeps track of all conflicts. This only -// applies to committed conflicts, per-transaction conflicts are not -// accessible in this way. -// -// As part of a transaction, libcdl may attempt to find solutions for -// particular conflicts, and those solutions may get installed -// automatically. No attempt is made to keep track of solutions -// on a global basis, only on a per-transaction basis. - -class CdlConflictBody { - - friend class CdlTest; - - // Transactions and conflicts are closely connected - friend class CdlTransactionBody; - - public: - - // Creation happens only inside a derived class. - // Clearing a conflict only happens inside transactions. - // Destroying a conflict only happens from inside a - // per-transaction clear(), or during a transaction commit. - - // Is this conflict part of a transaction, or has it been committed to the toplevel. - CdlTransaction get_transaction() const; - - // Is inference implemented for this type of conflict? - virtual bool resolution_implemented() const; - - // Try to resolve an existing global conflict. A new transaction - // is created for this operation, the conflict is resolved within - // that transaction, and then CdlTransaction::body() is used to - // handle inference callbacks, commits, etc. See also - // CdlToplevel::resolve_conflicts() and - // CdlToplevel::resolve_all_conflicts(). The conflict may cease to - // exist as a side-effect of this call. - void resolve(); - - // Keep track of whether or not this conflict has a solution - // 1) a conflict may have a current solution. This gets invalidated - // whenever there is a change to a value that was referenced - // while identifying the solution. - // - // A current solution is indicated by a non-empty solution vector. - // - // 2) a conflict may not have a current solution. Again this gets - // invalidated whenever a referred value changes. There is a boolean - // to keep track of this. - // - // 3) a conflict may not have a current solution, but another run of - // the inference engine may find one. - bool has_known_solution() const; - bool has_no_solution() const; - const std::vector >& get_solution() const; - const std::set& get_solution_references() const; - void clear_solution(); - - // Provide a text message "explaining" the conflict. - // This only makes sense for derived classes. - virtual std::string get_explanation() const = 0; - - // Basic information access. - CdlNode get_node() const; - CdlProperty get_property() const; - bool is_structural() const; - - // Enabling and disabling conflicts currently happens outside the - // context of any transaction. - // FIXME: these are not currently implemented. It would be necessary - // to store the information in the savefile, which requires an - // unambiguous way of identifying a conflict that is likely to - // survice package version changes. - void disable(std::string); - void enable(); - bool is_enabled() const; - std::string get_disabled_reason() const; - - bool check_this(cyg_assert_class_zeal zeal = cyg_quick) const; - CYGDBG_DECLARE_MEMLEAK_COUNTER(); - - protected: - CdlConflictBody(CdlTransaction, CdlNode, CdlProperty, bool /* structural */); - - // The destructor gets accessed from inside the friend transaction class, - // either during a clear_conflict() or during a transaction commit. - virtual ~CdlConflictBody(); - - // All conflicts are associated with a node and a property. - // This information will be useful to derived classes' - // implementations of get_explanation() - CdlNode node; - CdlProperty property; - - private: - - // Attempt to resolve a conflict in a sub-transaction - // This is invoked from inside the transaction resolve code. - // There are additional exported interfaces inside and outside - // the transaction class. - virtual bool inner_resolve(CdlTransaction, int); - - // Keep track of the transaction in which this conflict was created. - // The field is cleared at the end of a transaction. - CdlTransaction transaction; - - // Usually the derived class will decide whether or not - // this conflict is structural in nature, but the data - // needs to be available at base constructor time so - // a virtual function is not appropriate. - bool structural; - - // Solution support - bool no_solution; - std::vector > solution; - std::set solution_references; - void update_solution_validity(CdlValuable); - - // Users may disable a conflict. Usually they will have to - // supply a reason for this. - bool enabled; - std::string reason; - - enum { - CdlConflictBody_Invalid = 0, - CdlConflictBody_Magic = 0x073e8853 - } cdlconflictbody_cookie; - - // Illegal operations. Conflicts always live on the heap. - CdlConflictBody(); - CdlConflictBody(const CdlConflictBody&); - CdlConflictBody& operator=(const CdlConflictBody&); -}; - -// ---------------------------------------------------------------------------- -// An unresolved conflict means that there is a reference in some -// property to an entity that is not yet in the current configuration. -// The class provides convenient access to the name of the unresolved -// entity. - -class CdlConflict_UnresolvedBody : public CdlConflictBody { - - friend class CdlTest; - public: - - static void make(CdlTransaction, CdlNode, CdlProperty, std::string); - - std::string get_target_name() const; - std::string get_explanation() const; - static bool test(CdlConflict); - bool check_this(cyg_assert_class_zeal = cyg_quick) const; - CYGDBG_DECLARE_MEMLEAK_COUNTER(); - - protected: - - private: - virtual ~CdlConflict_UnresolvedBody(); - CdlConflict_UnresolvedBody(CdlTransaction, CdlNode, CdlProperty, std::string); - std::string target_name; - enum { - CdlConflict_UnresolvedBody_Invalid = 0, - CdlConflict_UnresolvedBody_Magic = 0x1b24bb8a - } cdlconflict_unresolvedbody_cookie; - - CdlConflict_UnresolvedBody(); - CdlConflict_UnresolvedBody(const CdlConflict_UnresolvedBody&); - CdlConflict_UnresolvedBody& operator=(const CdlConflict_UnresolvedBody&); -}; - -// ---------------------------------------------------------------------------- -// An illegal value can be caused because of a number of properties: -// legal_values, check_proc, entry_proc, ... In the case of the latter -// the Tcl code should provide text explaining why the value is -// illegal. - -class CdlConflict_IllegalValueBody : public CdlConflictBody { - - friend class CdlTest; - - public: - - static void make(CdlTransaction, CdlNode, CdlProperty); - - bool resolution_implemented() const; - - std::string get_explanation() const; - void set_explanation(std::string); - static bool test(CdlConflict); - bool check_this(cyg_assert_class_zeal = cyg_quick) const; - CYGDBG_DECLARE_MEMLEAK_COUNTER(); - - protected: - - private: - virtual ~CdlConflict_IllegalValueBody(); - bool inner_resolve(CdlTransaction, int); - CdlConflict_IllegalValueBody(CdlTransaction, CdlNode, CdlProperty); - std::string explanation; - enum { - CdlConflict_IllegalValueBody_Invalid = 0, - CdlConflict_IllegalValueBody_Magic = 0x4fb27ed1 - } cdlconflict_illegalvaluebody_cookie; - - CdlConflict_IllegalValueBody(); - CdlConflict_IllegalValueBody(const CdlConflict_IllegalValueBody&); - CdlConflict_IllegalValueBody& operator=(const CdlConflict_IllegalValueBody&); -}; - -// ---------------------------------------------------------------------------- -// There are times when expression evaluation will fail, e.g. because of -// a division by zero. The explanation is supplied by the evaluation code. - -class CdlConflict_EvalExceptionBody : public CdlConflictBody { - - friend class CdlTest; - - public: - - static void make(CdlTransaction, CdlNode, CdlProperty, std::string); - - std::string get_explanation() const; - void set_explanation(std::string); // mainly for internal use - static bool test(CdlConflict); - bool check_this(cyg_assert_class_zeal = cyg_quick) const; - CYGDBG_DECLARE_MEMLEAK_COUNTER(); - - protected: - - private: - virtual ~CdlConflict_EvalExceptionBody(); - CdlConflict_EvalExceptionBody(CdlTransaction, CdlNode, CdlProperty, std::string); - std::string explanation; - enum { - CdlConflict_EvalExceptionBody_Invalid = 0, - CdlConflict_EvalExceptionBody_Magic = 0x7e64bc41 - } cdlconflict_evalexceptionbody_cookie; -}; - -// ---------------------------------------------------------------------------- -// A goal expression evaluates to false. Producing sensible diagnostics -// depends on a detailed understanding of goal expressions, which will -// have to wait until the inference engine comes along. - -class CdlConflict_RequiresBody : public CdlConflictBody { - - friend class CdlTest; - - public: - - static void make(CdlTransaction, CdlNode, CdlProperty); - bool resolution_implemented() const; - - std::string get_explanation() const; - static bool test(CdlConflict); - bool check_this(cyg_assert_class_zeal = cyg_quick) const; - CYGDBG_DECLARE_MEMLEAK_COUNTER(); - - protected: - - private: - virtual ~CdlConflict_RequiresBody(); - bool inner_resolve(CdlTransaction, int); - CdlConflict_RequiresBody(CdlTransaction, CdlNode, CdlProperty); - enum { - CdlConflict_RequiresBody_Invalid = 0, - CdlConflict_RequiresBody_Magic = 0x78436331 - } cdlconflict_requiresbody_cookie; -}; - -// ---------------------------------------------------------------------------- -// There is an unusual problem in the configuration data somewhere. -// For example, a parent property can be resolved but the target is -// not a container. There is not a lot that the user can do about -// problems like this, apart from complaining to the component vendor, -// but the problem should not be ignored either. - -class CdlConflict_DataBody : public CdlConflictBody { - - friend class CdlTest; - - public: - - static void make(CdlTransaction, CdlNode, CdlProperty, std::string); - - std::string get_explanation() const; - static bool test(CdlConflict); - bool check_this(cyg_assert_class_zeal = cyg_quick) const; - CYGDBG_DECLARE_MEMLEAK_COUNTER(); - - protected: - - private: - virtual ~CdlConflict_DataBody(); - CdlConflict_DataBody(CdlTransaction, CdlNode, CdlProperty, std::string); - std::string message; - enum { - CdlConflict_DataBody_Invalid = 0, - CdlConflict_DataBody_Magic = 0x2cec7ad8 - } cdlconflict_databody_cookie; -}; - -//}}} -//{{{ CdlProperty class and derived classes - -//{{{ Description - -// --------------------------------------------------------------------------- -// There are many different kinds of property. An alias property contains -// a simple string. A check_proc property contains a fragment of Tcl code -// which can be represented internally as a string, as bytecodes, or both. -// A requires property contains a goal expression. ... -// -// The implementation involves a base class CdlProperty and various -// derived classes such as CdlProperty_StringBody and -// CdlProperty_ExpressionBody. -// -// New CdlProperty objects get created only when reading in CDL scripts, -// while executing commands like alias and requires. These commands are -// implemented as C++ functions hooked into the TCL interpreter. The -// property arguments are available as an argc/argv pair. Each command -// will parse and validate the arguments and then invoke an appropriate -// constructor. - -//}}} -//{{{ CdlPropertyId_xxx - -// ---------------------------------------------------------------------------- -// Properties are identified by strings rather than by an enum or anything -// like that. A string-based approach allows new properties to be added at -// any time without invalidating an existing enum, complicating switch() -// statements, etc. There are some performance issues but these are -// manageable. -// -// A disadvantage of using strings is that there is a problem with -// typos. Mistyping something like CdlPropertyId_Compile will generally -// result in a compile-time failure. Mistyping "Complie" will cause -// strange behaviour at run-time and is hard to track down. -// -// A compromise solution is to have #define'd string constants. - -#define CdlPropertyId_ActiveIf "ActiveIf" -#define CdlPropertyId_BuildProc "BuildProc" -#define CdlPropertyId_Calculated "Calculated" -#define CdlPropertyId_CancelProc "CancelProc" -#define CdlPropertyId_CheckProc "CheckProc" -#define CdlPropertyId_Compile "Compile" -#define CdlPropertyId_ConfirmProc "ConfirmProc" -#define CdlPropertyId_DecorationProc "DecorationProc" -#define CdlPropertyId_DefaultValue "DefaultValue" -#define CdlPropertyId_Define "Define" -#define CdlPropertyId_DefineHeader "DefineHeader" -#define CdlPropertyId_DefineProc "DefineProc" -#define CdlPropertyId_Description "Description" -#define CdlPropertyId_Dialog "Dialog" -#define CdlPropertyId_Display "Display" -#define CdlPropertyId_DisplayProc "DisplayProc" -#define CdlPropertyId_Doc "Doc" -#define CdlPropertyId_EntryProc "EntryProc" -#define CdlPropertyId_Flavor "Flavor" -#define CdlPropertyId_DefineFormat "DefineFormat" -#define CdlPropertyId_Group "Group" -#define CdlPropertyId_Hardware "Hardware" -#define CdlPropertyId_IfDefine "IfDefine" -#define CdlPropertyId_Implements "Implements" -#define CdlPropertyId_IncludeDir "IncludeDir" -#define CdlPropertyId_IncludeFiles "IncludeFiles" -#define CdlPropertyId_InitProc "InitProc" -#define CdlPropertyId_InstallProc "InstallProc" -#define CdlPropertyId_LegalValues "LegalValues" -#define CdlPropertyId_Library "Library" -#define CdlPropertyId_LicenseProc "LicenseProc" -#define CdlPropertyId_Make "Make" -#define CdlPropertyId_Makefile "Makefile" -#define CdlPropertyId_MakeObject "MakeObject" -#define CdlPropertyId_NoDefine "NoDefine" -#define CdlPropertyId_Object "Object" -#define CdlPropertyId_Parent "Parent" -#define CdlPropertyId_Requires "Requires" -#define CdlPropertyId_Screen "Screen" -#define CdlPropertyId_Script "Script" -#define CdlPropertyId_UpdateProc "UpdateProc" -#define CdlPropertyId_Wizard "Wizard" - -//}}} -//{{{ Base class - -// ---------------------------------------------------------------------------- -// The base class is never used directly. Instead the appropriate derived -// objects are instantiated and when appropriate it will be necessary to -// do a dynamic cast from a CdlProperty to e.g. a CdlProperty_String. - -class CdlPropertyBody { - - friend class CdlTest; - - public: - // The destructor is public, to avoid possible problems with STL. - virtual ~CdlPropertyBody(); - - // These routines provide access to the basic data. - std::string get_property_name() const; - - // Get hold of the arguments that were present in the original data. - int get_argc() const; - bool has_option(std::string) const; - std::string get_option(std::string) const; - const std::vector& get_argv() const; - const std::vector >& get_options() const; - - // Resolve any references, or generate/update appropriate conflict - // objects. The default implementation is a no-op because not all - // properties involve references. - virtual void update(CdlTransaction, CdlNode /* source */, CdlNode /* dest */, CdlUpdate); - - bool check_this(cyg_assert_class_zeal = cyg_quick) const; - CYGDBG_DECLARE_MEMLEAK_COUNTER(); - - protected: - - // The legal constructor can only get invoked from a derived class - // constructor. The first argument identifies the property, e.g. - // CdlPropertyId_Doc (which is just #define'd to the string - // "doc"). - // - // The argc and argv fields provide access to the original - // data in the command that resulted in the property being - // constructed. Often but not always argv[0] will be the same as - // the property id. The argv information is stored mainly for - // diagnostics purposes, it may be removed in future to avoid - // wasting memory. - // - // The options field is the result of parsing options such - // as -library=libextras.a. It consists of a vector of - // pairs, and is usually obtained via - // CdlParse::parse_options(). - CdlPropertyBody(CdlNode, std::string, int argc, const char* argv[], std::vector >&); - - private: - // This string indicates the command used to define this property, - // e.g. "doc" or "define_proc". It is provided to the constructor. - std::string name; - - // All property data comes out of a file and gets rid via a - // Tcl interpreter. The raw file data is stored with the property, - // mainly for diagnostics purposes. - std::vector argv; - - std::vector > options; - - // The usual set of illegal operations. - CdlPropertyBody(); - CdlPropertyBody(const CdlPropertyBody&); - CdlPropertyBody& operator=(const CdlPropertyBody&); - - enum { - CdlPropertyBody_Invalid = 0, - CdlPropertyBody_Magic = 0x60dd58f4 - } cdlpropertybody_cookie; -}; - -//}}} -//{{{ CdlProperty_Minimal - -// ---------------------------------------------------------------------------- -// This class is used for properties that are simple flags, e.g. no_define. -// There should be no additional data associated with such properties. - -class CdlProperty_MinimalBody : public CdlPropertyBody { - - friend class CdlTest; - - public: - static CdlProperty_Minimal make(CdlNode, std::string, int, const char*[], std::vector >&); - virtual ~CdlProperty_MinimalBody( ); - bool check_this( cyg_assert_class_zeal = cyg_quick ) const; - CYGDBG_DECLARE_MEMLEAK_COUNTER(); - - protected: - - private: - typedef CdlPropertyBody inherited; - - CdlProperty_MinimalBody(CdlNode, std::string, int, const char*[], std::vector >&); - enum { - CdlProperty_MinimalBody_Invalid = 0, - CdlProperty_MinimalBody_Magic = 0x25625b8c - } cdlproperty_minimalbody_cookie; - - CdlProperty_MinimalBody(); - CdlProperty_MinimalBody(const CdlProperty_MinimalBody&); - CdlProperty_MinimalBody& operator=(const CdlProperty_MinimalBody&); -}; - -//}}} -//{{{ CdlProperty_String - -// ---------------------------------------------------------------------------- -// A string property contains a single piece of additional data in the form -// of a string. - -class CdlProperty_StringBody : public CdlPropertyBody { - - friend class CdlTest; - - public: - static CdlProperty_String make(CdlNode, std::string, std::string, int, const char*[], - std::vector >&); - virtual ~CdlProperty_StringBody(); - - std::string get_string(void) const; - bool check_this(cyg_assert_class_zeal = cyg_quick) const; - CYGDBG_DECLARE_MEMLEAK_COUNTER(); - - protected: - - private: - typedef CdlPropertyBody inherited; - - CdlProperty_StringBody(CdlNode, std::string /* id */, std::string /* data */, int, const char*[], - std::vector >&); - std::string data; - enum { - CdlProperty_StringBody_Invalid = 0, - CdlProperty_StringBody_Magic = 0x78d1ca94 - } cdlproperty_stringbody_cookie; - - // The only legal constructor supplies all the data. - CdlProperty_StringBody(); - CdlProperty_StringBody(const CdlProperty_StringBody&); - CdlProperty_StringBody& operator=(const CdlProperty_StringBody&); -}; - -//}}} -//{{{ CdlProperty_TclCode - -// ---------------------------------------------------------------------------- -// A TclCode property is currently equivalent to a string property. In -// future this may change to allow the byte-compiled versions of the -// script to be stored. -// -// One of the properties, "screen" inside a cdl_wizard, also takes -// an integer. Rather than create yet another class, this is handled -// by a separate constructor. - - -class CdlProperty_TclCodeBody : public CdlPropertyBody { - - friend class CdlTest; - - public: - static CdlProperty_TclCode make(CdlNode, std::string, cdl_tcl_code, int, const char*[], - std::vector >&); - static CdlProperty_TclCode make(CdlNode, std::string, cdl_int, cdl_tcl_code, int, const char*[], - std::vector >&); - virtual ~CdlProperty_TclCodeBody(); - - cdl_int get_number(void) const; - const cdl_tcl_code& get_code(void) const; - bool check_this(cyg_assert_class_zeal = cyg_quick) const; - CYGDBG_DECLARE_MEMLEAK_COUNTER(); - - private: - typedef CdlPropertyBody inherited; - - CdlProperty_TclCodeBody(CdlNode, std::string, cdl_int, cdl_tcl_code, int, const char*[], - std::vector >&); - - cdl_int number; - cdl_tcl_code code; - enum { - CdlProperty_TclCodeBody_Invalid = 0, - CdlProperty_TclCodeBody_Magic = 0x7b14d4e5 - } cdlproperty_tclcodebody_cookie; - - CdlProperty_TclCodeBody(); - CdlProperty_TclCodeBody(const CdlProperty_TclCodeBody&); - CdlProperty_TclCodeBody& operator=(const CdlProperty_TclCodeBody&); - -}; - -//}}} -//{{{ CdlProperty_StringVector - -// ---------------------------------------------------------------------------- -// This is used for multiple constant strings, as opposed to a list -// expression which requires evaluation. One example is a list -// of aliases. - -class CdlProperty_StringVectorBody : public CdlPropertyBody { - - friend class CdlTest; - - public: - static CdlProperty_StringVector make(CdlNode, std::string, const std::vector&, int, const char*[], - std::vector >&); - virtual ~CdlProperty_StringVectorBody(); - - const std::vector& get_strings() const; - std::string get_first_string() const; - unsigned int get_number_of_strings() const; - std::string get_string(unsigned int) const; - bool check_this(cyg_assert_class_zeal zeal = cyg_quick) const; - CYGDBG_DECLARE_MEMLEAK_COUNTER(); - - private: - typedef CdlPropertyBody inherited; - - CdlProperty_StringVectorBody(CdlNode, std::string, const std::vector&, int, const char*[], - std::vector >&); - - std::vector data; - enum { - CdlProperty_StringVectorBody_Invalid = 0, - CdlProperty_StringVectorBody_Magic = 0x4ed039f3 - } cdlproperty_stringvectorbody_cookie; - - CdlProperty_StringVectorBody(); - CdlProperty_StringVectorBody(const CdlProperty_StringVectorBody&); - CdlProperty_StringVectorBody& operator=(const CdlProperty_StringVectorBody&); -}; - -//}}} -//{{{ CdlProperty_Reference - -// ---------------------------------------------------------------------------- -// This is used for properties such as wizard and dialog, where the data -// identifies some other entity in the system. The class is both a property -// and a reference object. Most of the desired functionality is provided by -// inheritance from CdlReference. - -class CdlProperty_ReferenceBody : public CdlPropertyBody, public CdlReference { - - friend class CdlTest; - - public: - static CdlProperty_Reference make(CdlNode, std::string /* id */, std::string /* destination */, - CdlUpdateHandler, int, const char*[], - std::vector >&); - virtual ~CdlProperty_ReferenceBody(); - - void update(CdlTransaction, CdlNode, CdlNode, CdlUpdate); - - bool check_this(cyg_assert_class_zeal = cyg_quick) const; - CYGDBG_DECLARE_MEMLEAK_COUNTER(); - - private: - typedef CdlPropertyBody inherited_property; - typedef CdlReference inherited_reference; - - CdlUpdateHandler update_handler; - - CdlProperty_ReferenceBody(CdlNode, std::string /* id */, std::string /* destination */, CdlUpdateHandler, int, const char*[], - std::vector >&); - enum { - CdlProperty_ReferenceBody_Invalid = 0, - CdlProperty_ReferenceBody_Magic = 0x78100339 - } cdlproperty_referencebody_cookie; - - CdlProperty_ReferenceBody(); - CdlProperty_ReferenceBody(const CdlProperty_ReferenceBody&); - CdlProperty_ReferenceBody& operator=(const CdlProperty_Reference&); -}; - -//}}} -//{{{ CdlProperty_Expression - -// ---------------------------------------------------------------------------- -// An expression property simply inherits its functionality from the basic -// property class and from the expression class. - -class CdlProperty_ExpressionBody : public CdlPropertyBody, public CdlExpressionBody { - - friend class CdlTest; - - public: - static CdlProperty_Expression make(CdlNode, std::string, CdlExpression, CdlUpdateHandler, int, const char*[], - std::vector >&); - virtual ~CdlProperty_ExpressionBody(); - void update(CdlTransaction, CdlNode, CdlNode, CdlUpdate); - bool check_this(cyg_assert_class_zeal = cyg_quick) const; - CYGDBG_DECLARE_MEMLEAK_COUNTER(); - - private: - typedef CdlPropertyBody inherited_property; - typedef CdlExpressionBody inherited_expression; - - CdlProperty_ExpressionBody(CdlNode, std::string, CdlExpression, CdlUpdateHandler, int, const char*[], - std::vector >&); - - CdlUpdateHandler update_handler; - enum { - CdlProperty_ExpressionBody_Invalid = 0, - CdlProperty_ExpressionBody_Magic = 0x05fb4056 - } cdlproperty_expressionbody_cookie; - - CdlProperty_ExpressionBody(); - CdlProperty_ExpressionBody(const CdlProperty_ExpressionBody&); - CdlProperty_ExpressionBody& operator=(const CdlProperty_ExpressionBody&); -}; - -//}}} -//{{{ CdlProperty_ListExpression - -// ---------------------------------------------------------------------------- -// Similarly a list property simply inherits from property and from -// list expressions. - -class CdlProperty_ListExpressionBody : public CdlPropertyBody, public CdlListExpressionBody { - - friend class CdlTest; - - public: - static CdlProperty_ListExpression make(CdlNode, std::string, CdlListExpression, CdlUpdateHandler, int, const char*[], - std::vector >&); - virtual ~CdlProperty_ListExpressionBody(); - void update(CdlTransaction, CdlNode, CdlNode, CdlUpdate); - bool check_this(cyg_assert_class_zeal = cyg_quick) const; - CYGDBG_DECLARE_MEMLEAK_COUNTER(); - - private: - typedef CdlPropertyBody inherited_property; - typedef CdlListExpressionBody inherited_expression; - - CdlProperty_ListExpressionBody(CdlNode, std::string, CdlListExpression, CdlUpdateHandler, int, const char*[], - std::vector >&); - - CdlUpdateHandler update_handler; - enum { - CdlProperty_ListExpressionBody_Invalid = 0, - CdlProperty_ListExpressionBody_Magic = 0x6b0136f5 - } cdlproperty_listexpressionbody_cookie; - - CdlProperty_ListExpressionBody(); - CdlProperty_ListExpressionBody(const CdlProperty_ListExpressionBody&); - CdlProperty_ListExpressionBody& operator=(const CdlProperty_ListExpressionBody&); -}; - -//}}} -//{{{ CdlProperty_GoalExpression - -// ---------------------------------------------------------------------------- -// And a goal property inherits from property and from goal expressions. - -class CdlProperty_GoalExpressionBody : public CdlPropertyBody, public CdlGoalExpressionBody { - - friend class CdlTest; - - public: - static CdlProperty_GoalExpression make(CdlNode, std::string, CdlGoalExpression, CdlUpdateHandler, int, const char*[], - std::vector >&); - virtual ~CdlProperty_GoalExpressionBody(); - void update(CdlTransaction, CdlNode, CdlNode, CdlUpdate); - bool check_this(cyg_assert_class_zeal = cyg_quick) const; - CYGDBG_DECLARE_MEMLEAK_COUNTER(); - - private: - typedef CdlPropertyBody inherited_property; - typedef CdlGoalExpressionBody inherited_expression; - - CdlProperty_GoalExpressionBody(CdlNode, std::string, CdlGoalExpression, CdlUpdateHandler, int, const char*[], - std::vector >&); - - CdlUpdateHandler update_handler; - enum { - CdlProperty_GoalExpressionBody_Invalid = 0, - CdlProperty_GoalExpressionBody_Magic = 0x08b2b31e - } cdlproperty_goalexpressionbody_cookie; - - CdlProperty_GoalExpressionBody(); - CdlProperty_GoalExpressionBody(const CdlProperty_GoalExpressionBody&); - CdlProperty_GoalExpressionBody& operator=(const CdlProperty_GoalExpressionBody&); -}; - -//}}} - -//}}} -//{{{ CdlParse class - -// ---------------------------------------------------------------------------- -// This is another utility class for collecting together parsing-related -// functions. -// -// Note that this is only a utility class. When libcdl is used for parsing -// things not related to software configuration the new functionality -// does not have to reside inside the CdlParse class, but it may be -// possible to re-use some of the functionality in that class. - -class CdlParse { - - public: - // Utility routines. - static std::string get_tcl_cmd_name(std::string); - static std::string concatenate_argv(int, const char*[], int); - static int parse_options(CdlInterpreter, std::string /* diag_prefix */, char** /* options */, - int /* argc */, const char*[] /* argv */, int /* start_index */, - std::vector >& /* result */); - static std::string construct_diagnostic(CdlInterpreter, std::string /* classification */, - std::string /* sub-identifier */, std::string /* message */); - - static void report_error(CdlInterpreter, std::string /* sub-identifier */, std::string /* message */); - static void report_warning(CdlInterpreter, std::string /* sub-identifier */, std::string /* message */); - static void clear_error_count(CdlInterpreter); - static int get_error_count(CdlInterpreter); - static void incr_error_count(CdlInterpreter, int=1); - - static std::string get_expression_error_location(void); - - // Support for Tcl's "unknown" command - static int unknown_command(CdlInterpreter, int, const char*[]); - - // Property-related utilities - static void report_property_parse_error(CdlInterpreter, std::string, std::string); - static void report_property_parse_error(CdlInterpreter, CdlProperty, std::string); - static void report_property_parse_warning(CdlInterpreter, std::string, std::string); - static void report_property_parse_warning(CdlInterpreter, CdlProperty, std::string); - - // Utility parsing routines - static int parse_minimal_property(CdlInterpreter, int, const char*[], std::string, - char**, void (*)(CdlInterpreter, CdlProperty_Minimal)); - static int parse_string_property(CdlInterpreter, int, const char*[], std::string, - char**, void (*)(CdlInterpreter, CdlProperty_String)); - static int parse_tclcode_property(CdlInterpreter, int, const char*[], std::string, - char**, void (*)(CdlInterpreter, CdlProperty_TclCode)); - static int parse_stringvector_property(CdlInterpreter, int, const char*[], std::string, - char**, void (*)(CdlInterpreter, CdlProperty_StringVector), - bool /* allow_empty */ = false); - static int parse_reference_property(CdlInterpreter, int, const char*[], std::string, - char**, void (*)(CdlInterpreter, CdlProperty_Reference), - bool /* allow_empty */, - CdlUpdateHandler); - static int parse_expression_property(CdlInterpreter, int, const char*[], std::string, - char **, void (*)(CdlInterpreter, CdlProperty_Expression), - CdlUpdateHandler); - static int parse_listexpression_property(CdlInterpreter, int, const char*[], std::string, - char **, void (*)(CdlInterpreter, CdlProperty_ListExpression), - CdlUpdateHandler); - static int parse_goalexpression_property(CdlInterpreter, int, const char*[], std::string, - char **, void (*)(CdlInterpreter, CdlProperty_GoalExpression), - CdlUpdateHandler); -}; - -//}}} -//{{{ CdlNode - -// ---------------------------------------------------------------------------- -// A node object has a name and lives in a hierarchy. Each node keeps -// track of the toplevel and owner. The memory overheads are -// relatively small compared with the performance gains when such -// information is needed. -// -// A node object also has a vector of properties, and can be referred to -// by properties in other nodes. Some of the properties may result in -// conflicts. - -class CdlNodeBody { - - friend class CdlTest; - - // Adding and removing nodes from the hierarchy is done - // by CdlToplevel members. - friend class CdlToplevelBody; - - // CdlLoadable must be able to access the destructor - friend class CdlLoadableBody; - - // It is intended that CdlProperties will also add and remove themselves - friend class CdlPropertyBody; - - // CdlReference bind and unbind operations need access to - // the referrers vector. So does CdlTransaction::commit() - friend class CdlReference; - friend class CdlTransactionBody; - - public: - - // Basic information. - std::string get_name() const; - CdlContainer get_parent() const; - CdlLoadable get_owner() const; - CdlToplevel get_toplevel() const; - - // Propagation support. Some updates such as active/inactive changes - // get applied to nodes as well as to properties. Note that because - // of multiple inheritance this virtual call can get confusing. - virtual void update(CdlTransaction, CdlUpdate); - - // Is this node active or not? The is_active() call refers - // to the global state, things may be different inside a - // transaction. - bool is_active() const; - bool is_active(CdlTransaction transaction); - - // Generally nodes become active when the parent becomes - // active and enabled. Some derived classes may impose - // additional restrictions, for example because of - // active_if constraints. This routine can be used - // to check whether or not a node should become active. - virtual bool test_active(CdlTransaction); - - // Provide access to the various properties. Currently all this - // information is publicly available. - const std::vector& get_properties() const; - CdlProperty get_property(std::string) const; - void get_properties(std::string, std::vector&) const; - std::vector get_properties(std::string) const; - bool has_property(std::string) const; - int count_properties(std::string) const; - - // Provide access to the various global conflicts. More - // commonly conflicts are accessed on a per-transaction basis. - void get_conflicts(std::vector&) const; - void get_conflicts(bool (*)(CdlConflict), std::vector&) const; - void get_structural_conflicts(std::vector&) const; - void get_structural_conflicts(bool (*)(CdlConflict), std::vector&) const; - - // Provide access to all the referrers. This may not get used very - // much outside the library itself. - const std::vector& get_referrers() const; - - // Add property parsers and validation code appropriate for a - // node. Currently this is a no-op, there are no properties - // associated with every node, but this may change in future e.g. - // for diagnostics purposes. - static void add_property_parsers(std::vector& parsers); - void check_properties(CdlInterpreter); - - // Persistence support. The final classes such as cdl_option - // should provide implementations of these functions. The - // base function takes care of data that was present in an - // original save file but which was not recognised. - // - // Configuration save files are Tcl scripts, so it seems - // appropriate to handle the I/O via the Tcl library and - // to have a TCL interpreter available. - virtual void save(CdlInterpreter, Tcl_Channel, int, bool); - bool has_additional_savefile_information() const; - - // Mainly for diagnostics code, what is the actual name for this - // type of CDL object? This should be in terms of CDL data, e.g. - // "package" or "component", rather than in implementation terms - // such as "CdlPackageBody". - virtual std::string get_class_name() const; - - bool check_this(cyg_assert_class_zeal = cyg_quick) const; - CYGDBG_DECLARE_MEMLEAK_COUNTER(); - - protected: - - // CdlNodeBodies are only instantiated by derived classes. - // They must always have a name. They need not be placed - // in the hierarchy immediately, that can wait until - // later. - CdlNodeBody(std::string); - // A dummy constructor is needed because of the virtual - // inheritance. - CdlNodeBody(); - - // Nodes cannot be destroyed directly by application code, - // only by higher-level library functions such as unload_package() - virtual ~CdlNodeBody(); - - // Updating the name is rarely required, but is useful for savefiles. - void set_name(std::string); - - // Is the node currently active? This applies to the global state - // only, not per-transaction state. Some derived classes may want - // to override the default value - bool active; - - private: - - // The basic data. The name is known during construction. - // The other three fields get updated by e.g. CdlToplevel::add_node(); - std::string name; - CdlContainer parent; - CdlLoadable owner; - CdlToplevel toplevel; - - // This is used by remove_node_from_toplevel()/add_node_to_toplevel() - // to allow the latter to exactly reverse the former - int remove_node_container_position; - - // Properties normally only get added during the parsing process, - // and only get removed when the object itself is destroyed. - // A vector is the obvious implementation. - std::vector properties; - - // Currently a vector of referrers is used. This vector is subject - // to change when packages get loaded and unloaded, possibly a - // list would be better. - std::vector referrers; - - // Savefiles may contain information that is not recognised by the - // current library, especially because of savefile hooks which - // allow e.g. the configuration tool to store its own information - // in save files. This information must not be lost, even if you are - // e.g. mixing command line and GUI tools. This vector holds - // the savefile information so that it can be put in the next - // savefile. - std::vector unsupported_savefile_strings; - - enum { - CdlNodeBody_Invalid = 0, - CdlNodeBody_Magic = 0x309595b5 - } cdlnodebody_cookie; - - // Illegal operations - CdlNodeBody(const CdlNodeBody&); - CdlNodeBody& operator=(const CdlNodeBody&); -}; - -//}}} -//{{{ CdlContainer - -// ---------------------------------------------------------------------------- -// A container is a node that can contain other nodes. - -class CdlContainerBody : virtual public CdlNodeBody { - - friend class Cdltest; - - // Allow CdlNode::check_this() access to the internals - friend class CdlNodeBody; - - // Adding a node to the hierarchy is done by a CdlToplevel member. - // Ditto for removing. - friend class CdlToplevelBody; - - // Deleting a container can happen inside CdlToplevel and CdlLoadable - friend class CdlLoadableBody; - - public: - - const std::vector& get_contents() const; - bool contains(CdlConstNode, bool /* recurse */ = false) const; - bool contains(const std::string, bool /* recurse */ = false) const; - CdlNode find_node(const std::string, bool /* recurse */ = false) const; - - // Propagation support. Some updates such as active/inactive changes - // get applied to nodes as well as to properties. - virtual void update(CdlTransaction, CdlUpdate); - - // Persistence support. - virtual void save(CdlInterpreter, Tcl_Channel, int, bool); - - virtual std::string get_class_name() const; - bool check_this(cyg_assert_class_zeal = cyg_quick) const; - CYGDBG_DECLARE_MEMLEAK_COUNTER(); - - protected: - - // Containers cannot be destroyed explicitly, only via higher-level - // code such as unload_package(); - virtual ~CdlContainerBody(); - - CdlContainerBody(); - // Special constructor needed for internal use. - CdlContainerBody(std::string); - - // The CdlToplevel class needs access to its own contents. - std::vector contents; - - private: - enum { - CdlContainerBody_Invalid = 0, - CdlContainerBody_Magic = 0x543c5f1d - } cdlcontainerbody_cookie; - - // Illegal operations - CdlContainerBody(const CdlContainerBody&); - CdlContainerBody& operator=(const CdlContainerBody&); -}; - -//}}} -//{{{ CdlLoadable - -// ---------------------------------------------------------------------------- -// A loadable object is a container that gets loaded or unloaded -// atomically from a toplevel. The key difference is that a loadable -// keeps track of all nodes that were loaded as part of this -// operation, thus allowing unload operations to happen safely even if -// nodes get re-parented all over the hierarchy. In addition, there is -// a slave interpreter associated with every loadable. - -class CdlLoadableBody : virtual public CdlContainerBody { - - friend class CdlTest; - - // Allow CdlNode::check_this() access to the internals - friend class CdlNodeBody; - - // Adding nodes to the hierarchy is done by a toplevel member - friend class CdlToplevelBody; - - public: - virtual ~CdlLoadableBody(); - - - const std::vector& get_owned() const; - bool owns(CdlConstNode) const; - CdlInterpreter get_interpreter() const; - std::string get_repository() const; - std::string get_directory() const; - - // Some properties such as doc and compile reference filenames. - // A search facility is useful. - virtual std::string find_relative_file(std::string /* filename */, std::string /* directory */ = "") const; - virtual std::string find_absolute_file(std::string, std::string, bool /* allow_urls */ = false) const; - virtual bool has_subdirectory(std::string) const; - - // These support load/unload operations inside transactions - // They are static members because some of them will want - // to delete the loadable. - static void transaction_commit_load(CdlTransaction, CdlLoadable); - static void transaction_cancel_load(CdlTransaction, CdlLoadable); - static void transaction_commit_unload(CdlTransaction, CdlLoadable); - static void transaction_cancel_unload(CdlTransaction, CdlLoadable); - - // Binding and unbinding of properties. This involves processing - // the various properties, calculating default values, etc. - void bind(CdlTransaction); - void unbind(CdlTransaction); - - virtual std::string get_class_name() const; - bool check_this(cyg_assert_class_zeal = cyg_quick) const; - CYGDBG_DECLARE_MEMLEAK_COUNTER(); - - protected: - - CdlLoadableBody(CdlToplevel, std::string /* repository */, std::string /* directory */); - - // Needed by derived classes, but not actually used. - CdlLoadableBody(); - - private: - - std::vector owned; - CdlInterpreter interp; - std::string repository; - std::string directory; - - // Used by add/remove_node_from_toplevel() - int remove_node_loadables_position; - - enum { - CdlLoadableBody_Invalid = 0, - CdlLoadableBody_Magic = 0x488d6127 - } cdlloadablebody_cookie; - - // Invalid operations - CdlLoadableBody(const CdlLoadableBody&); - CdlLoadableBody& operator=(const CdlLoadableBody&); -}; - -//}}} -//{{{ CdlToplevel - -// ---------------------------------------------------------------------------- -// Toplevels are containers that live at the top of a hierarchy -// (surprise surprise). This means that they do not have a parent. -// In addition a toplevel object keeps track of all the names -// used, guaranteeing uniqueness and providing a quick lookup -// facility. -// -// Every container is also a node, so every toplevel is a node. -// Inheritance from CdlNode may seem wrong. However it achieves -// consistency, everything in the hierarchy including the toplevel -// is a node. The main disadvantage is that every toplevel now -// needs a name. - -class CdlToplevelBody : virtual public CdlContainerBody { - - friend class CdlTest; - - // Allow CdlNode::check_this() access to the internals - friend class CdlNodeBody; - - // The CdlTransaction class needs direct access to the lists - // of conflicts. - friend class CdlTransactionBody; - - public: - virtual ~CdlToplevelBody(); - - // Updating the hierarchy. This happens a node at a time. Adding a - // node involves updating the name->node map in the toplevel, - // setting the node's parent/owner/toplevel fields, and updating - // the parent and owner containers. The owner may be 0 for special - // nodes such as the orphans container. The parent must be known, - // although it may change later on during a change_parent() call. - // - // Removing a node is more complicated, and involves a two-stage - // process. First the node is removed from the toplevel, thus - // eliminating the name->node mapping. The owner and parent fields - // are preserved at this stage (except for the loadable itself), - // and the operation may be undone if the relevant transaction - // gets cancelled. If the transaction gets committed then the - // second remove operation handles the owner and parent fields, - // just prior to the node being deleted. For convenience there - // are also per-loadable variants for some of these. - // - // change_parent() is used to support parent-properties. - // A container of 0 indicates an orphan, i.e. a parent - // property that did not or does not correspond to a - // current container. - // - // There is also a clean-up call. This gets used for interfaces - // which may alternate between belonging to a loadable and - // being auto-created. - void add_node(CdlLoadable, CdlContainer, CdlNode); - void add_node_to_toplevel(CdlNode); - void remove_node_from_toplevel(CdlNode); - static void remove_node(CdlLoadable, CdlContainer, CdlNode); - void add_loadable_to_toplevel(CdlLoadable); - void remove_loadable_from_toplevel(CdlLoadable); - void change_parent(CdlLoadable, CdlContainer /* current */, CdlContainer /* new */, CdlNode, int /* pos */ = -1); - void cleanup_orphans(); - - // Toplevels keep track of all the loadables, in addition to - // inheriting tree behaviour from CdlContainer. This is convenient - // for some operations like determining build information - // which must operate on a per-loadable basis. - const std::vector& get_loadables() const; - - // Name uniqueness is guaranteed. It is convenient to have an STL - // map as a lookup service. - CdlNode lookup(const std::string) const; - - // There are two conflict lists associated with each toplevel. One - // is for "structural" conflicts, ones that can only be resolved - // by a fairly major change such as loading another package: a - // typical example is an unresolved parent reference. The other is - // for conflicts that can probably be resolved simply by changing - // some values. Both sets of conflicts are held as a simple list. - // - // The active vs. inactive state of a CDL entity affects the - // location of structural vs. non-structural conflicts. If an - // entity becomes inactive then structural conflicts are not - // affected, but non-structural conflicts are removed from the - // global list. If an entity's "requires" expression is not - // satisfied but the entity is inactive anyway then this is - // harmless. - const std::list& get_all_conflicts() const; - const std::list& get_all_structural_conflicts() const; - - // Try to resolve some or all conflicts. Typically a new transaction - // will be created for this. - void resolve_conflicts(const std::vector&); - void resolve_all_conflicts(); - - // Toplevels can have descriptions provided by the user. This is - // particularly important for pre-defined templates, target - // board descriptions, etc. where the user would like some - // extra information about the template before loading it in. - // The default value is an empty string. - std::string get_description() const; - void set_description(std::string); - - // Each toplevel must have an associated master Tcl interpreter. - CdlInterpreter get_interpreter() const; - - // Each toplevel may have a single active main transaction. - // For now there is no support for concurrent transactions - // operating on a single toplevel (although nested transactions - // are allowed) - CdlTransaction get_active_transaction() const; - - // Build and define operations are available for all toplevels, - // even if they are not always applicable - void get_build_info(CdlBuildInfo&); - void get_all_build_info(CdlBuildInfo&); - void generate_config_headers(std::string); - void get_config_headers(std::vector&); - void generate_build_tree(std::string, std::string = ""); - - // Values can be stored in limbo. This is useful when unloading - // and reloading packages, e.g. when changing a version the - // current settings can be preserved as much as possible. - void set_limbo_value(CdlValuable); - bool has_limbo_value(std::string) const; - CdlValue get_limbo_value(std::string) const; - CdlValue get_and_remove_limbo_value(std::string); - void clear_limbo(); - - // Persistence support. These are commented in the source code. - void initialize_savefile_support(); - static bool savefile_support_initialized(); - void add_savefile_command(std::string, CdlSaveCallback, CdlInterpreterCommand); - void add_savefile_subcommand(std::string, std::string, CdlSaveCallback, CdlInterpreterCommand); - void get_savefile_commands(std::vector&); - void get_savefile_subcommands(std::string, std::vector&); - void save_command_details(CdlInterpreter, Tcl_Channel, int, bool); - static int savefile_handle_command(CdlInterpreter, int, const char*[]); - static int savefile_handle_unsupported(CdlInterpreter, int, const char*[]); - static int savefile_handle_unknown(CdlInterpreter, int, const char*[]); - void save_unsupported_commands(CdlInterpreter, Tcl_Channel, int, bool); - static cdl_int get_library_savefile_version(); - static int savefile_handle_version(CdlInterpreter, int, const char*[]); - static cdl_int get_savefile_version(CdlInterpreter); - void save_conflicts(CdlInterpreter, Tcl_Channel, int, bool); - static void save_separator(CdlInterpreter, Tcl_Channel, std::string, bool); - - virtual std::string get_class_name() const; - bool check_this(cyg_assert_class_zeal = cyg_quick) const; - CYGDBG_DECLARE_MEMLEAK_COUNTER(); - - protected: - CdlToplevelBody(CdlInterpreter); - - private: - - std::map lookup_table; - std::vector loadables; - std::map limbo; - CdlInterpreter interp; - CdlContainer orphans; - std::string description; - std::list conflicts; - std::list structural_conflicts; - - // The savefile support corresponding to this application. - static cdl_int savefile_version; - static bool savefile_commands_initialized; - static std::vector savefile_commands; - static std::map > savefile_subcommands; - - // Per-toplevel support. A savefile may contain unrecognised - // commands at the toplevel of a file, as well as unrecognised - // commands in e.g. the body of a cdl_configuration command. - // The latter is handled via the CdlNode base class. - std::vector unsupported_savefile_toplevel_strings; - std::vector unsupported_savefile_commands; - std::map > unsupported_savefile_subcommands; - - // Keep track of the current active transaction for this toplevel (if any) - CdlTransaction transaction; - - enum { - CdlToplevelBody_Invalid = 0, - CdlToplevelBody_Magic = 0x0834666e - } cdltoplevelbody_cookie; - - // Invalid operations - CdlToplevelBody(const CdlToplevelBody&); - CdlToplevelBody& operator=(const CdlToplevelBody&); -}; - -//}}} -//{{{ CdlUserVisible - -// ---------------------------------------------------------------------------- -// A user-visible object is likely to have properties such as display, -// description and doc. Many user-visible objects will have values but -// not all, for example custom dialogs are likely to have a doc -// property but they do not have a value. - -class CdlUserVisibleBody : virtual public CdlNodeBody { - - friend class CdlTest; - - public: - virtual ~CdlUserVisibleBody(); - - std::string get_display() const; - std::string get_description() const; - std::string get_doc() const; - - // NOTE: this will only work for absolute doc strings or for doc - // strings that are relative to the package. - std::string get_doc_url() const; - - // Add property parsers and validation code appropriate for a - // user-visible object such as doc and description - static void add_property_parsers(std::vector& parsers); - void check_properties(CdlInterpreter); - static int parse_description(CdlInterpreter, int, const char*[]); - static int parse_display(CdlInterpreter, int, const char*[]); - static int parse_doc(CdlInterpreter, int, const char*[]); - - // Persistence support. The save code simply outputs some comments - // corresponding to the display, doc and description properties. - virtual void save(CdlInterpreter, Tcl_Channel, int, bool); - - virtual std::string get_class_name() const; - bool check_this(cyg_assert_class_zeal = cyg_quick) const; - CYGDBG_DECLARE_MEMLEAK_COUNTER(); - - protected: - CdlUserVisibleBody(); - - private: - - enum { - CdlUserVisibleBody_Invalid = 0, - CdlUserVisibleBody_Magic = 0x13bbc817 - } cdluservisiblebody_cookie; - - // Illegal operations - CdlUserVisibleBody(const CdlUserVisibleBody&); - CdlUserVisibleBody& operator=(const CdlUserVisibleBody&); -}; - -//}}} -//{{{ CdlParentable - -// ---------------------------------------------------------------------------- -// A parentable object may have the parent property, redefining its -// position in the hierarchy. - -class CdlParentableBody : virtual public CdlNodeBody { - - friend class CdlTest; - - public: - virtual ~CdlParentableBody(); - - static void add_property_parsers(std::vector& parsers); - void check_properties(CdlInterpreter); - static int parse_parent(CdlInterpreter, int, const char*[]); - static void update_handler(CdlTransaction, CdlNode, CdlProperty, CdlNode, CdlUpdate); - - virtual std::string get_class_name() const; - bool check_this(cyg_assert_class_zeal = cyg_quick) const; - CYGDBG_DECLARE_MEMLEAK_COUNTER(); - - protected: - CdlParentableBody(); - - private: - - // Unloads may be cancelled. To restore the previous state exactly - // it is necessary to keep track of the old position. - int change_parent_save_position; - - enum { - CdlParentableBody_Invalid = 0, - CdlParentableBody_Magic = 0x40c6a077 - } cdlparentablebody_cookie; - - // Illegal operations - CdlParentableBody(const CdlParentableBody&); - CdlParentableBody& operator=(const CdlParentableBody&); -}; - -//}}} -//{{{ CdlValuable - -// ---------------------------------------------------------------------------- -// A valuable body has a value. Many valuables can be modified but not all. -// Some properties make a valuable object read-only. In future there is -// likely to be support for locked values as well. There is a member function -// to check whether or not a valuable object is modifiable. -// -// Relevant properties for a valuable object are: -// -// 1) flavor - readily available via CdlValue::get_flavor() -// 2) default_value - an expression -// 3) legal_values - a list expression -// 4) entry_proc - for validation purposes, in addition to legal_values -// 5) check_proc - ditto -// 6) active_if - goal expression -// 7) requires - goal expression -// 8) dialog - a custom dialog for editing this value -// 9) calculated - non-modifiable -// 10) implements - for interfaces -// -// A CdlValuable does not inherit directly from CdlValue, since it should -// not be possible to modify a Valuable directly. Instead it contains a -// CdlValue member, and provides essentially the same functions as -// a CdlValue. - -class CdlValuableBody : virtual public CdlNodeBody { - - friend class CdlTest; - - // Transaction commit operations require direct access to the CdlValue - friend class CdlTransactionBody; - - private: - CdlValue value; - - public: - virtual ~CdlValuableBody(); - - // Accessing the current value. There are variants for the global state - // and for per-transaction operations. - const CdlValue& get_whole_value() const; - - CdlValueFlavor get_flavor() const; - CdlValueFlavor get_flavor(CdlTransaction transaction) const - { // The transaction is irrelevant, it cannot change the flavor - return this->get_flavor(); - } - - CdlValueSource get_source() const; - bool has_source( CdlValueSource) const; - bool is_enabled( CdlValueSource = CdlValueSource_Current) const; - std::string get_value( CdlValueSource = CdlValueSource_Current) const; - bool has_integer_value( CdlValueSource = CdlValueSource_Current) const; - cdl_int get_integer_value( CdlValueSource = CdlValueSource_Current) const; - bool has_double_value( CdlValueSource = CdlValueSource_Current) const; - double get_double_value( CdlValueSource = CdlValueSource_Current) const; - CdlSimpleValue get_simple_value( CdlValueSource = CdlValueSource_Current) const; - - CdlValueSource get_source(CdlTransaction) const; - bool has_source( CdlTransaction, CdlValueSource) const; - bool is_enabled( CdlTransaction, CdlValueSource = CdlValueSource_Current) const; - std::string get_value( CdlTransaction, CdlValueSource = CdlValueSource_Current) const; - bool has_integer_value( CdlTransaction, CdlValueSource = CdlValueSource_Current) const; - cdl_int get_integer_value( CdlTransaction, CdlValueSource = CdlValueSource_Current) const; - bool has_double_value( CdlTransaction, CdlValueSource = CdlValueSource_Current) const; - double get_double_value( CdlTransaction, CdlValueSource = CdlValueSource_Current) const; - CdlSimpleValue get_simple_value( CdlTransaction, CdlValueSource = CdlValueSource_Current) const; - - // ----------------------------------------------------------------- - // Modify access. There are two variants of all the functions: - // - // 1) no transaction argument. A transaction will be created, - // committed, and destroyed for the change in question. - // - // 2) a transaction argument. The existing transaction will be - // updated but not committed. This allows multiple changes - // to be grouped together. - // - // There are only a handful of exported functions, but lots - // of inline variants. - void set_source(CdlValueSource); - void invalidate_source(CdlValueSource); - void set_enabled(bool, CdlValueSource); - void set_value(CdlSimpleValue&, CdlValueSource); - void set_enabled_and_value(bool, CdlSimpleValue&, CdlValueSource); - void set(CdlSimpleValue&, CdlValueSource); - - void set_source(CdlTransaction, CdlValueSource); - void invalidate_source(CdlTransaction, CdlValueSource); - void set_enabled(CdlTransaction, bool, CdlValueSource); - void set_value(CdlTransaction, CdlSimpleValue&, CdlValueSource); - void set_enabled_and_value(CdlTransaction, bool, CdlSimpleValue&, CdlValueSource); - void set(CdlTransaction, CdlSimpleValue&, CdlValueSource); - void set(CdlTransaction, const CdlValue&); - - void enable(CdlValueSource source) - { - set_enabled(true, source); - } - void disable(CdlValueSource source) - { - set_enabled(false, source); - } - void set_value(std::string data, CdlValueSource source) - { - CdlSimpleValue val(data); - set_value(val, source); - } - void set_integer_value(cdl_int data, CdlValueSource source) - { - CdlSimpleValue val(data); - set_value(val, source); - } - void set_double_value(double data, CdlValueSource source) - { - CdlSimpleValue val(data); - set_value(val, source); - } - void set_enabled_and_value(bool enabled, std::string data, CdlValueSource source) - { - CdlSimpleValue val(data); - set_enabled_and_value(enabled, val, source); - } - void set_enabled_and_value(bool enabled, cdl_int data, CdlValueSource source) - { - CdlSimpleValue val(data); - set_enabled_and_value(enabled, val, source); - } - void set_enabled_and_value(bool enabled, double data, CdlValueSource source) - { - CdlSimpleValue val(data); - set_enabled_and_value(enabled, val, source); - } - void enable_and_set_value(CdlSimpleValue& val, CdlValueSource source) - { - set_enabled_and_value(true, val, source); - } - void enable_and_set_value(std::string data, CdlValueSource source) - { - set_enabled_and_value(true, data, source); - } - void enable_and_set_value(cdl_int data, CdlValueSource source) - { - set_enabled_and_value(true, data, source); - } - void enable_and_set_value(double data, CdlValueSource source) - { - set_enabled_and_value(true, data, source); - } - void disable_and_set_value(CdlSimpleValue& val, CdlValueSource source) - { - set_enabled_and_value(false, val, source); - } - void disable_and_set_value(std::string data, CdlValueSource source) - { - set_enabled_and_value(false, data, source); - } - void disable_and_set_value(cdl_int data, CdlValueSource source) - { - set_enabled_and_value(false, data, source); - } - void disable_and_set_value(double data, CdlValueSource source) - { - set_enabled_and_value(false, data, source); - } - void enable(CdlTransaction transaction, CdlValueSource source) - { - set_enabled(transaction, true, source); - } - void disable(CdlTransaction transaction, CdlValueSource source) - { - set_enabled(transaction, false, source); - } - void set_value(CdlTransaction transaction, std::string data, CdlValueSource source) - { - CdlSimpleValue val(data); - set_value(transaction, val, source); - } - void set_integer_value(CdlTransaction transaction, cdl_int data, CdlValueSource source) - { - CdlSimpleValue val(data); - set_value(transaction, val, source); - } - void set_double_value(CdlTransaction transaction, double data, CdlValueSource source) - { - CdlSimpleValue val(data); - set_value(transaction, val, source); - } - void set_enabled_and_value(CdlTransaction transaction, bool enabled, std::string data, CdlValueSource source) - { - CdlSimpleValue val(data); - set_enabled_and_value(transaction, enabled, val, source); - } - void set_enabled_and_value(CdlTransaction transaction, bool enabled, cdl_int data, CdlValueSource source) - { - CdlSimpleValue val(data); - set_enabled_and_value(transaction, enabled, val, source); - } - void set_enabled_and_value(CdlTransaction transaction, bool enabled, double data, CdlValueSource source) - { - CdlSimpleValue val(data); - set_enabled_and_value(transaction, enabled, val, source); - } - void enable_and_set_value(CdlTransaction transaction, CdlSimpleValue& val, CdlValueSource source) - { - set_enabled_and_value(transaction, true, val, source); - } - void enable_and_set_value(CdlTransaction transaction, std::string data, CdlValueSource source) - { - set_enabled_and_value(transaction, true, data, source); - } - void enable_and_set_value(CdlTransaction transaction, cdl_int data, CdlValueSource source) - { - set_enabled_and_value(transaction, true, data, source); - } - void enable_and_set_value(CdlTransaction transaction, double data, CdlValueSource source) - { - set_enabled_and_value(transaction, true, data, source); - } - void disable_and_set_value(CdlTransaction transaction, CdlSimpleValue& val, CdlValueSource source) - { - set_enabled_and_value(transaction, false, val, source); - } - void disable_and_set_value(CdlTransaction transaction, std::string data, CdlValueSource source) - { - set_enabled_and_value(transaction, false, data, source); - } - void disable_and_set_value(CdlTransaction transaction, cdl_int data, CdlValueSource source) - { - set_enabled_and_value(transaction, false, data, source); - } - void disable_and_set_value(CdlTransaction transaction, double data, CdlValueSource source) - { - set_enabled_and_value(transaction, false, data, source); - } - - // ----------------------------------------------------------------- - virtual bool is_modifiable() const; - void get_widget_hint(CdlWidgetHint&); - - // ----------------------------------------------------------------- - // Propagation support. If a valuable becomes active or inactive - // because e.g. its parent is disabled then this may affect - // requires conflicts etc. - virtual void update(CdlTransaction, CdlUpdate); - - virtual bool test_active(CdlTransaction); - - // ----------------------------------------------------------------- - // Property-related stuff. - bool has_calculated_expression() const; - bool has_default_value_expression() const; - bool has_legal_values() const; - bool has_entry_proc() const; - bool has_check_proc() const; - bool has_active_if_conditions() const; - bool has_requires_goals() const; - bool has_dialog() const; - bool has_wizard() const; - - CdlProperty_Expression get_calculated_expression() const; - CdlProperty_Expression get_default_value_expression() const; - CdlProperty_ListExpression get_legal_values() const; - cdl_tcl_code get_entry_proc() const; - cdl_tcl_code get_check_proc() const; - void get_active_if_conditions(std::vector&) const; - void get_requires_goals(std::vector&) const; - CdlDialog get_dialog() const; - CdlWizard get_wizard() const; - void get_implemented_interfaces(std::vector&) const; - - // Add property parsers and validation code appropriate for a - // valuable object such as default_value and legal_values - static void add_property_parsers(std::vector& parsers); - void check_properties(CdlInterpreter); - static int parse_active_if(CdlInterpreter, int, const char*[]); - static void active_if_update_handler(CdlTransaction, CdlNode, CdlProperty, CdlNode, CdlUpdate); - static int parse_calculated(CdlInterpreter, int, const char*[]); - static void calculated_update_handler(CdlTransaction, CdlNode, CdlProperty, CdlNode, CdlUpdate); - static int parse_check_proc(CdlInterpreter, int, const char*[]); - static int parse_default_value(CdlInterpreter, int, const char*[]); - static void default_value_update_handler(CdlTransaction, CdlNode, CdlProperty, CdlNode, CdlUpdate); - static int parse_dialog(CdlInterpreter, int, const char*[]); - static void dialog_update_handler(CdlTransaction, CdlNode, CdlProperty, CdlNode, CdlUpdate); - static int parse_entry_proc(CdlInterpreter, int, const char*[]); - static int parse_flavor(CdlInterpreter, int, const char*[]); - static int parse_group(CdlInterpreter, int, const char*[]); - static int parse_implements(CdlInterpreter, int, const char*[]); - static void implements_update_handler(CdlTransaction, CdlNode, CdlProperty, CdlNode, CdlUpdate); - static int parse_legal_values(CdlInterpreter, int, const char*[]); - static void legal_values_update_handler(CdlTransaction, CdlNode, CdlProperty, CdlNode, CdlUpdate); - static int parse_requires(CdlInterpreter, int, const char*[]); - static void requires_update_handler(CdlTransaction, CdlNode, CdlProperty, CdlNode, CdlUpdate); - static int parse_wizard(CdlInterpreter, int, const char*[]); - static void wizard_update_handler(CdlTransaction, CdlNode, CdlProperty, CdlNode, CdlUpdate); - - // Persistence suppot - void save(CdlInterpreter, Tcl_Channel, int, bool /* modifiable */, bool /* minimal */); - bool value_savefile_entry_needed() const; - static void initialize_savefile_support(CdlToplevel, std::string); - static int savefile_value_source_command(CdlInterpreter, int, const char*[]); - static int savefile_user_value_command(CdlInterpreter, int, const char*[]); - static int savefile_wizard_value_command(CdlInterpreter, int, const char*[]); - static int savefile_inferred_value_command(CdlInterpreter, int, const char*[]); - static int savefile_xxx_value_command(CdlInterpreter, int, const char*[], CdlValueSource); - - // Make sure that the current value is legal. This gets called automatically - // by all the members that modify values. It has to be a virtual function - // since some derived classes, e.g. hardware-related valuables, may impose - // constraints over and above legal_values etc. - virtual void check_value(CdlTransaction); - - // Similarly check the requires properties - void check_requires(CdlTransaction, CdlProperty_GoalExpression); - void check_requires(CdlTransaction); - - // Enabling or disabling a valuable may affect the active state of children - void check_children_active(CdlTransaction); - - virtual std::string get_class_name() const; - bool check_this(cyg_assert_class_zeal = cyg_quick) const; - CYGDBG_DECLARE_MEMLEAK_COUNTER(); - - protected: - CdlValuableBody(CdlValueFlavor = CdlValueFlavor_Bool); - - - private: - - - enum { - CdlValuableBody_Invalid = 0, - CdlValuableBody_Magic = 0x2b2acc03 - } cdlvaluablebody_cookie; - - // Illegal operations - CdlValuableBody(const CdlValuableBody&); - CdlValuableBody& operator=(const CdlValuableBody&); -}; - -//}}} -//{{{ CdlTransaction etc. - -//{{{ Description - -// ---------------------------------------------------------------------------- -// Transactions. These are used for all changes to a configuration. In some -// cases a transaction is implicit: -// -// valuable->set_value(...) -// -// The actual implementation of this is: -// -// valuable->set_value(...) -// transact = CdlTransactionBody::make(valuable->get_toplevel()) -// valuable->set_value(transact, ...) -// -// transact->commit() -// delete transact -// -// Alternatively the use of transactions may be explicit. For implicit -// uses the library will invoke an inference callback at the -// appropriate time. For explicit transactions this is not necessary. -// -// The commit() operation invokes a transaction callback which should -// not be confused with the inference callback. The former is intended -// for display updates, it specifies everything that has changed -// during the transaction. The latter is used for reporting new -// conflicts to the user, suggesting fixes, etc. -// -// A whole bunch of information is associated with a transaction, -// including: all value changes, details of new conflicts, and details -// of existing conflicts that have gone away. The commit operation -// takes care of updating the toplevel. Until the commit happens -// the toplevel itself remains unchanged. It is also possible to cancel -// a transaction. -// -// An important concept related to transactions is propagation. -// Changing a value may have various effects, for example it may -// change the result of a legal_values list expression, resulting in a -// conflict object having to be created or destroyed. Changing one -// value may result in other value changes, e.g. because of a -// default_value property. All this is "propagation", and may -// happen multiple times within a single transaction. -// -// Transaction objects are also used during load or unload operations, -// but those are a little bit special. In particular it is not possible -// to cancel such a transaction, there will have been updates to the -// toplevel. Using a transaction is convenient because there is a -// need for propagation. -// -// Currently a transaction should be deleted immediately after a -// commit or cancel. This may change in future, in that transaction -// objects can be used to hold undo information. -// -// -// The other big concept related to transactions is inference. -// Changing a value may result in one or more new conflicts being -// created. In some cases the library can figure out for itself how to -// resolve these conflicts, using an inference engine. There are -// parameters to control the operation of the inference engine, -// including whether it runs at all, what changes it is allowed -// to make automatically (usually default and inferred values can -// be updated, but not wizard or user values), and how much -// recursion will happen. -// -// Assuming a default setup in a GUI environment, a typical -// sequence of events would be: -// -// valuable->set_value(...) -// transact = CdlTransactionBody::make(valuable->get_toplevel()) -// valuable->set_value(transact, ...) -// transact->set_whole_value(valuable, ...) -// transact->propagate() -// while (!finished) -// transact->resolve() -// -// invoke inference callback -// transact->apply_solution() (1 or more times) -// transact->set_whole_value(valuable, ...) (1 or more times) -// transact->propagate() -// transact->commit() | transact->cancel() -// delete transact -// -// Note that the propagation steps have to be invoked explicitly, -// allowing multiple changes to be processed in one go. There is -// a utility function which combines the functionality from -// the first propagate() call up to but not including the -// transaction delete operator. -// -// -// The inference engine itself is a complicated beast. There are -// a number of interfaces, but at the end of the day it ends up -// creating a sub-transaction and trying to resolve a single -// conflict in that sub-transaction. The conflict may belong to -// the current transaction or it may be global. -// -// -// for each conflict of interest -// make sure that there is not already a valid solution -// check that the inference engine can handle it -// create a sub-transaction, associated with the conflict -// apply the conflict resolution code -// if the solution is ok -// install it -// else if the solution might e.g. overwrite a user value -// keep it, the user can decide during the inference callback -// -// The conflict resolution typically works by attempting to change -// one or more values in the sub-transaction, propagating them, -// and seeing what new conflicts get created. If no new conflicts -// get created and one or more existing conflicts go away, groovy. -// Otherwise recursion can be used to try to resolve the new -// conflicts, or other strategies can be explored. -// -// NOTE: what is really necessary is some way of keeping track of the -// "best" solution to date, and allow exploration of alternatives. -// Or possibly keep track of all solutions. That has to be left to -// a future version. - -//}}} -//{{{ CdlTransactionCommitCancelOp - -// ---------------------------------------------------------------------------- -// The CdlTransaction class has built-in knowledge of how to handle values, -// active state, and a few things like that. However there are also more -// complicated operations such as loading and unloading, instantiating -// items, etc. which also need to happen in the context of a transaction -// but which the transaction class does not necessarily know about -// itself - or at least, not in any detail. Since the libcdl core is -// intended to be useful in various contexts, some sort of extensibility -// is essential. -// -// This is achieved by an auxiliary class, CdlTransactionCommitCancelOp. -// Clients of the transaction class can have their own utility class -// which derives from this, and create suitable objects. The transaction -// class maintains a vector of the pending commit/cancel operations. -// -// Each CdlTransactionCommitCancelOp object has two member functions, -// one for when the transaction gets committed and one for when it -// gets cancelled. If a sub-transaction gets committed then its -// pending ops are transferred across to the parent, allowing the -// parent to be cancelled sensibly: the commit ops only get run for -// the toplevel transaction. If a sub-transaction gets cancelled then -// the pending ops are invoked immediately. -// -// There is an assumption that commit/cancel ops get executed strictly -// in FIFO order. Specifically, commit ops get run from first one to -// the last one, allowing later operations in the transaction to -// overwrite earlier ones. Cancel ops get run in reverse order. - -class CdlTransactionCommitCancelOp { - friend class CdlTest; - - public: - - CdlTransactionCommitCancelOp() { } - virtual ~CdlTransactionCommitCancelOp() { }; - - // The default implementations of both of these do nothing. - // Derived classes should override at least one of these - // functions. - virtual void commit(CdlTransaction transaction) { - CYG_UNUSED_PARAM(CdlTransaction, transaction); - } - virtual void cancel(CdlTransaction transaction) { - CYG_UNUSED_PARAM(CdlTransaction, transaction); - } - - protected: - - private: -}; - -//}}} -//{{{ CdlTransaction class - -class CdlTransactionBody { - - friend class CdlTest; - - friend class CdlConflictBody; - friend class CdlValuableBody; - - public: - - // Create a toplevel transaction - static CdlTransaction make(CdlToplevel); - virtual ~CdlTransactionBody(); - CdlToplevel get_toplevel() const; - - // Or a sub-transaction. Usually these are created in the context of - // a conflict that is being resolved. - CdlTransaction make(CdlConflict = 0); - CdlTransaction get_parent() const; - CdlConflict get_conflict() const; - - // Commit all the changes. Essentially this means transferring - // all of the per-transaction data to the toplevel, and then - // invoking the transaction callback. All propagation, inference, - // etc. should happen before the commit() - // This routine can also be used to transfer changes from a - // sub-transaction to the parent. - void commit(); - - // A variant of the commit() operation can be used to - // store a sub-transaction in a conflict's solution vector, - // rather than updating the parent transaction. This is useful - // for inferred solutions which cannot be applied without - // user confirmation - void save_solution(); - - // Can a solution held in a sub-transaction be applied without - // e.g. overwriting a user value with an inferred value? - bool user_confirmation_required() const; - - // If the user has explicitly changed a value in the current transaction - // then the inference engine should not undo this or suggest a solution - // that will undo the change. - bool changed_by_user(CdlValuable) const; - - // A variant which is used for checking the hierarchy when disabling - // a container - bool subnode_changed_by_user(CdlContainer) const; - - // Is one transaction preferable to another? - bool is_preferable_to(CdlTransaction) const; - - // Find out about per-transaction conflicts. This is particularly - // useful for the inference callback. The other containers can - // be accessed as well, for completeness. - const std::list& get_new_conflicts() const; - const std::list& get_new_structural_conflicts() const; - const std::vector& get_deleted_conflicts() const; - const std::vector& get_deleted_structural_conflicts() const; - const std::vector& get_resolved_conflicts() const ; - const std::list& get_global_conflicts_with_solutions() const; - const std::map& get_changes() const; - const std::set& get_activated() const; - const std::set& get_deactivated() const; - const std::set& get_legal_values_changes() const; - - // Manipulate the current set of conflicts, allowing for nested - // transactions and toplevel conflicts as well. - void clear_conflict(CdlConflict); - bool has_conflict_been_cleared(CdlConflict); - - bool has_conflict(CdlNode, bool (*)(CdlConflict)); - CdlConflict get_conflict(CdlNode, bool (*)(CdlConflict)); - void get_conflicts(CdlNode, bool (*)(CdlConflict), std::vector&); - void clear_conflicts(CdlNode, bool (*)(CdlConflict)); - bool has_conflict(CdlNode, CdlProperty, bool (*)(CdlConflict)); - CdlConflict get_conflict(CdlNode, CdlProperty, bool (*)(CdlConflict)); - void get_conflicts(CdlNode, CdlProperty, bool (*)(CdlConflict), std::vector&); - void clear_conflicts(CdlNode, CdlProperty, bool (*)(CdlConflict)); - - bool has_structural_conflict(CdlNode, bool (*)(CdlConflict)); - CdlConflict get_structural_conflict(CdlNode, bool (*)(CdlConflict)); - void get_structural_conflicts(CdlNode, bool (*)(CdlConflict), std::vector&); - void clear_structural_conflicts(CdlNode, bool (*)(CdlConflict)); - bool has_structural_conflict(CdlNode, CdlProperty, bool (*)(CdlConflict)); - CdlConflict get_structural_conflict(CdlNode, CdlProperty, bool (*)(CdlConflict)); - void get_structural_conflicts(CdlNode, CdlProperty, bool (*)(CdlConflict), std::vector&); - void clear_structural_conflicts(CdlNode, CdlProperty, bool (*)(CdlConflict)); - - // During the inference callback the user may decide to - // apply one or more of the solutions. - void apply_solution(CdlConflict); - void apply_solutions(const std::vector&); - void apply_all_solutions(); - - // Cancel all the changes done in this transaction. Essentially - // this just involves clearing out all the STL containers. - void cancel(); - - // Support for commit/cancel ops. These are used for - // e.g. load and unload operations. - void add_commit_cancel_op(CdlTransactionCommitCancelOp *); - void cancel_last_commit_cancel_op(); - CdlTransactionCommitCancelOp* get_last_commit_cancel_op() const; - const std::vector& get_commit_cancel_ops() const; - - // Propagation support - void add_active_change(CdlNode); - void add_legal_values_change(CdlValuable); - void propagate(); - bool is_propagation_required() const; - - // Inference engine support. - void resolve(int = 0); // Process the new conflicts raised by this transaction - void resolve(CdlConflict, int = 0); - void resolve(const std::vector&, int = 0); - - // An auxiliary function called by the inference engine to perform recursion - bool resolve_recursion(int); - - // This function combines propagation, inference, and commit - // in one easy-to-use package - void body(); - - // Changes. - // There is a call to get hold of a CdlValue reference. Modifications - // should happen via a sequence of the form: - // - // valuable->set_value(transact, ...) - // const CdlValue& old_value = transact->get_whole_value(CdlValuable); - // CdlValue new_value = old_value; - // - // transact->set_whole_value(CdlValuable, old_value, new_value); - // - // When appropriate the get_whole_value() call takes care of - // updating the current conflict's solution_references vector. The - // set_whole_value() call updated the per-transaction changes map, - // and also stores sufficient information to support propagation. - // set_whole_value() requires both the old and new values, so - // that propagation can be optimized. - const CdlValue& get_whole_value(CdlConstValuable) const; - void set_whole_value(CdlValuable, const CdlValue&, const CdlValue&); - - // Control over active vs. inactive also needs to happen inside - // transactions - bool is_active(CdlNode) const; - void set_active(CdlNode, bool); - - // Callback and parameter settings - static void (*get_callback_fn())(const CdlTransactionCallback&); - static void set_callback_fn(void (*)(const CdlTransactionCallback&)); - static void set_inference_callback_fn(CdlInferenceCallback); - static CdlInferenceCallback get_inference_callback_fn(); - static void enable_automatic_inference(); - static void disable_automatic_inference(); - static bool is_automatic_inference_enabled(); - static void set_inference_recursion_limit(int); - static int get_inference_recursion_limit(); - // The override indicates the highest level of value source that the - // library can overwrite without needing user confirmation. The - // default value is CdlValueSource_Inferred, indicating that the - // library can overwrite default and inferred values but not - // wizard or user values. - static void set_inference_override(CdlValueSource); - static CdlValueSource get_inference_override(); - - bool check_this(cyg_assert_class_zeal = cyg_quick) const; - CYGDBG_DECLARE_MEMLEAK_COUNTER(); - - protected: - - private: - - CdlTransactionBody(CdlToplevel, CdlTransaction, CdlConflict); - - // The associated toplevel and optionally the parent transaction - // and the conflict being worked on - CdlToplevel toplevel; - CdlTransaction parent; - CdlConflict conflict; - - // Per-transaction information. All value changes, new conflicts - // etc. first live in the context of a transaction. The global - // configuration only gets updated if the transaction is commited. - // There is also a vector of the pending commit/cancel ops. - std::vector commit_cancel_ops; - std::map changes; - std::list new_conflicts; - std::list new_structural_conflicts; - std::vector deleted_conflicts; // Existing global ones - std::vector deleted_structural_conflicts; - std::vector resolved_conflicts; // New ones already fixed by the inference engine - std::list global_conflicts_with_solutions; - std::set activated; - std::set deactivated; - std::set legal_values_changes; - bool dirty; - - // Change propagation. It is necessary to keep track of all - // pending value changes, active changes, and of things being - // loaded or unloaded. The set_value() call is used to update the - // value_changes container. - std::deque value_changes; - std::deque active_changes; - - - // Control over the inference engine etc. - static CdlInferenceCallback inference_callback; - static bool inference_enabled; - static int inference_recursion_limit; - static CdlValueSource inference_override; - static void (*callback_fn)(const CdlTransactionCallback&); - - enum { - CdlTransactionBody_Invalid = 0, - CdlTransactionBody_Magic = 0x3f91e4df - } cdltransactionbody_cookie; - - // Illegal operations - CdlTransactionBody(); - CdlTransactionBody(const CdlTransactionBody &); - CdlTransactionBody& operator=(const CdlTransactionBody&); -}; - -//}}} -//{{{ CdlTransactionCallback - -// ---------------------------------------------------------------------------- -// The callback class is used to inform applications about all the -// changes that are happening, including side effects. Application -// code can install a callback function which gets invoked at the -// end of every transaction. -// -// NOTE: this implementation is preliminary. In particular it is -// not extensible, it only deals with changes relevant to software -// configurations. - -class CdlTransactionCallback { - - friend class CdlTest; - friend class CdlTransactionBody; - - public: - ~CdlTransactionCallback(); - static void (*get_callback_fn())(const CdlTransactionCallback&); - static void set_callback_fn(void (*)(const CdlTransactionCallback&)); - - // Callback functions should be able to retrieve information - // about the current transaction and toplevel, to avoid the use - // of statics. - CdlTransaction get_transaction() const; - CdlToplevel get_toplevel() const; - - // active_changes and legal_values_changes get updated as the - // transaction proceeds, so a set implementation is more - // efficient. The others get filled in during a commit operation. - // A transaction may result in multiple conflicts for a given node - // being eliminated, so again a set is appropriate. For the others - // there is no possibility of duplicates so a vector is better. - std::vector value_changes; - std::vector active_changes; - std::vector legal_values_changes; - std::vector value_source_changes; - std::vector new_conflicts; - std::vector new_structural_conflicts; - std::vector nodes_with_resolved_conflicts; - std::vector nodes_with_resolved_structural_conflicts; - - bool check_this(cyg_assert_class_zeal = cyg_quick) const; - - protected: - - private: - CdlTransactionCallback(CdlTransaction); - CdlTransaction transact; - - // Illegal operation. - CdlTransactionCallback(); - - enum { - CdlTransactionCallback_Invalid = 0, - CdlTransactionCallback_Magic = 0x0cec3a95 - } cdltransactioncallback_cookie; -}; - -//}}} -//{{{ CdlLocalTransaction - -// ---------------------------------------------------------------------------- -// A utility class to create a per-function transaction object which gets -// cleaned up automatically should an exception happen. - -class CdlLocalTransaction { - - friend class CdlTrest; - - public: - CdlLocalTransaction(CdlToplevel toplevel) { - transaction = CdlTransactionBody::make(toplevel); - } - ~CdlLocalTransaction() { - // The destructor may get invoked during exception handling. - // It is assumed that cancelling the transaction would be a - // good thing when that happens. Normal operation should - // go through the body() or commit() members, which clear - // the transaction field. - // There is a slight consistency here. Normally after a - // transaction commit the transaction object is still - // around. Here the transaction object get deleted. This - // is unlikely to matter in practice. - if (0 != transaction) { - transaction->cancel(); - delete transaction; - } - } - CdlTransaction get() { - return transaction; - } - void body() { - transaction->body(); - delete transaction; - transaction = 0; - } - void commit() { - transaction->commit(); - delete transaction; - transaction = 0; - } - void propagate() { - transaction->propagate(); - } - void destroy() { - if (0 != transaction) { - transaction->cancel(); - delete transaction; - transaction = 0; - } - } - - private: - CdlTransaction transaction; - CdlLocalTransaction(); -}; - -//}}} - -//}}} -//{{{ Build and define information - -//{{{ Description - -// ---------------------------------------------------------------------------- -// There are two related concepts: buildable components, and -// definable components. The former typically refers to compiling -// sources files to produce libraries, although other types of build -// are possible. The latter refers to generating header files -// containing the current configuration data. Typically any loadable -// that is buildable is also definable, so that the source files can -// #include the appropriate generated headers and adapt to the -// configuration data that way. The inverse is not true: for example -// in HCDL it may be appropriate to generate a header file but there -// is nothing to be compiled, device drivers are software packages. -// -// The relevant base classes are as follows: -// -// 1) CdlBuildable - this object can have build-related properties. -// All buildables are also valuables. -// 2) CdlBuildLoadable - this is a base class for loadables, providing -// some extra properties that are relevant for -// loadables that can involve builds. -// 3) CdlDefinable - this object can result in #define's in a -// header file. All exportables are also -// valuables. -// 4) CdlDefineLoadable - this is a base class for any loadables that -// can contain buildables. -// -// Support for both buildable and exportable components is part of the -// core library for now. This may change in future, depending on how -// many CDL variants get implemented. -// -// There are various properties related to building. First, the -// ones applicable to the CdlBuildLoadable class. -// -// 1) library xyz. -// This specifies the default library for anything built in this -// loadable. If there is no library property then it defaults to -// libtarget.a (or rather to a class static that happens to be -// initialized to libtarget.a) -// -// 2) include_dir . -// This specifies where the loadable's exported header files should -// end up. The default value is the toplevel, but e.g. the eCos -// kernel specifies an include_dir of cyg/kernel. Note that fixed -// header files are associated with buildables, not definables, -// the latter deal with generated header files only. -// -// 3) include_files -// The recommended directory hierarchy for non-trivial packages -// involves separate subdirectories src, include, cdl, doc, and -// test. This is too heavyweight for very simple packages where it -// is better to keep everything in just one directory. However that -// introduces a potential conflict between public and private -// header files, which can be resolved by the include_files -// property. The actual rules are: -// -// a) if there an include_files property, that lists all the -// headers that should be exported. -// -// b) else if there is an include subdirectory, it is assumed that -// all files below that should be exported. -// -// c) otherwise all files matching a suitable glob pattern should -// be exported. The default pattern is *.h *.hxx *.inl, but can -// be overwritten. -// -// 4) makefile -// This allows component developers to provide a GNU makefile to be -// used for building, rather than specify the relevant information -// via properties. -// NOTE: this property is ignored for now. It is roughly -// equivalent to a custom build step where the command is -// "make -C -f ", but in addition it is necessary to -// worry about phony targets for default, clean, etc. -// -// A DefineLoadable adds the following property: -// -// 1) define_header -// This specifies the header file that will be generated. If this -// property is absent then the library will generate a default one -// based on the loadable's name, by discarding everything up to and -// including the first underscore, lowercasing the rest, and -// appending .h. For example, CYGPKG_KERNEL would result in a -// header file kernel.h. -// -// Hardware packages have an implicit "define_header hardware.h" -// property. -// -// A buildable has the following properties: -// -// 1) compile [-library xyz] ... -// This specifies one or more files that need to be compiled. -// By default the resulting object files will go into the -// current library (set via a higher-level library or -// defaulting to libtarget.a). -// -// Legitimate filename suffixes for compile statements are .c, .cxx -// and .S. Further suffixes may be supported in future. In the -// long term we will need some external data files defining how -// the various suffixes should be handled. -// -// Associated with every compilation are details of the compiler to -// be used and the compiler flags. For now no attempt is made -// to do anything interesting in this area, although there is -// sufficient information in the database for the needs of -// command line tools. -// -// Longer term there are complications. Packages may want some -// control over the compiler flags that should be used, e.g. -// "requires {!(flags ~= ".*-fno-rtti.*")}" to guarantee that the -// compiler flags do not include -fno-rtti, rather useful if the -// package's source code depends on that language feature. Mixed -// architecture systems (e.g. ARM/Thumb) will cause problems when -// it comes to selecting the compiler. The exact means by which -// all this will work is not yet clear. -// -// 2) object [-library xyz] ... -// This specifies one or more pre-built object files that should -// go into the appropriate library. -// -// The problem here is coping with different architectures, and for -// many architectures it will also be necessary to worry about -// multilibs. Third party component vendors are unlikely to supply -// separate object files for every supported architecture and every -// valid multilib within those architectures, so there are -// constraints on the multilib-related compiler flags used for -// building other packages and the application itself. -// -// NOTE: this property is ignored for now. -// -// 3) make_object [-library xyz] [-priority pri] -// -// For example: -// -// make_object toyslock.o { -// toyslock.o : toyslock.y -// yacc toyslock.y -// $(CC) $(CFLAGS) -o toyslock.o y.tab.c -// } -// -// This defines a custom build step for an object file that -// should go into a particular directory. A makefile syntax -// is used to define the rule simply because it is likely -// to be familiar to package developers, and does not -// imply that the builds will happen via a makefile. -// -// The optional priority field indicates at which stage during -// the build the rule should trigger. The default value is -// 100, which is the same as for all files specified in -// "compile" properties. A lower value means that the object -// will be generated earlier. Libraries are generated at -// priority 200, and "make" properties normally execute at -// priority 300. -// NOTE: it is not clear yet whether supporting priorities -// in this way is a good idea, or whether the dependencies -// information could be used instead. -// -// Unresolved issues: -// -// a) what commands can be used in the build rules? There -// should be a core set of supported commands, as per -// an eCos toolchain build. It should also be possible -// for packages to provide their own host tools. -// -// For sourceware folks, moving away from a single toolchain -// tarball and expecting them to download and install -// egcs, binutils and gdb separately is actually a bad -// idea in this regard, it makes it much more likely that -// some users will have an incomplete tools installation and -// hence that builds will fail. -// -// b) there is an obvious need for variable substitution in the -// rules, e.g. $(CC). At what stage do these variables get -// expanded, and where does the required information live? -// -// c) who is responsible for header file dependency analysis? -// Should the rules be modified automatically to do this, -// or do we leave this to the package developer? It may be -// very hard to do the former, but the latter will cause -// problems for IDE integration. -// -// d) in which directory will the rules get run? What prevents -// filename conflicts between different packages? -// -// NOTE: make_object is not actually required just yet, but the -// issues are much the same as for the "make" property which is -// required. -// -// 4) make [-priority pri] -// -// For example: -// -// make target.ld { -// target.ld : arm.ld -// $(CC) -E -P -xc $(CFLAGS) -o $@ $< -// } -// -// This defines a custom build step for a target that is not going -// to end up in a library. The main such targets at the moment are -// the linker script, vectors.o, and extras.o, but there may well -// be others in future. -// -// The default priority for "make" properties is 300, which means -// that the build rules trigger after all normal compilations and -// after the libraries are generated. It is possible to specify -// custom build steps that should run before any compilations -// using a priority < 100. -// -// Unresolved issues: -// -// a) what commands can be used? -// -// b) variable substitution? -// -// c) header file dependency analysis? -// -// d) directories and filenames? -// -// e) where should the resulting files end up? Currently they can -// all go into $(PREFIX)/lib, but in the long term we may -// need to be a bit more flexible. -// -// 5) build_proc -// -// This defines some Tcl code that should be run prior to any -// build, for example to generate a source file. It must run -// within the appropriate loadable's Tcl interpreter so that -// it can query the current configuration. -// -// NOTE: this property is not implemented yet. -// -// -// A definable has the following properties: -// -// 1) no_define -// Usually the library will generate either one or two #define's -// for every definable, inside the current header file. This can be -// suppressed by the no_define property, which is typically -// accompanied by some other #define-related property such as -// define_proc or define. -// -// 2) define [-file ] [-format ] symbol -// This will result in an additional #define for the specified -// symbol in the specified file. The only filenames that are valid -// are the loadable's current filename (as per define_header), and -// the global header file system.h. Use of the latter should be -// avoided. -// -// The optional format string behaves as per the define_format -// property below. -// -// 3) define_format -// This is only relevant for booldata or data flavors. By default -// two #define's will be generated (assuming the valuable is active -// and enabled): -// -// #define value -// #define _value -// -// The latter will only be generated if the resulting symbol is -// a valid C preprocessor symbol, and is intended to allow the -// use of #ifdef as well as #ifdef (useful if the value is -// non-numerical). -// -// The define_format property provides control over the first of -// these two #defines. The net result is that the #define will be -// generated by evaluating the following Tcl fragment: -// -// set result "#define [ ]" -// -// Command and variable substitution are available if desired, -// but for anything that complicated the define_proc property -// is normally more useful. -// -// define_format is only applicable to the default definition, -// so it cannot be used in conjunction with no_define. The -// define property supports a -format option. -// -// 4) define_proc -// This specifies some Tcl code that should be run when header -// file generation takes place, in addition to any #define's -// generated by default or courtesy of define properties. -// The define_proc property is commonly used in conjunction with -// no_define, but this is not required. -// -// There will be two channels already set up: cdl_header -// for the current loadable, and cdl_system_header for system.h. -// Writing data to system.h should be avoided. -// -// 5) if_define - -// This property provides direct support for a common programming -// paradigm. It allows direct generation of code like the -// following: -// -// #ifdef CYGSRC_TOYS_BLOCKS -// # define CYGDBG_INFRA_USE_PRECONDITIONS 1 -// #endif -// -// In this case CYGSRC_TOYS_BLOCKS is the condition and -// CYGDBG_INFRA_USE_PRECONDITIONS is the symbol. The -// #ifdef/#define sequence will be generated in addition to -// any other #define's resulting from the default behaviour, -// the define property, or the define_proc property. It is -// not affected by no_define. - -//}}} -//{{{ The build process - -// ---------------------------------------------------------------------------- -// For command-line operation the steps involved in doing a build are: -// -// 1) work out what needs to be built. -// -// 2) generate a build and install tree. This involves making sure that -// the various directories exist and are accessible. -// -// 3) generate or update the toplevel makefile. -// -// 4) generate the configuration header files. -// -// For operation in an IDE steps (2) and (3) will be handled by -// different code. -// -// There is a library call to get hold of all the build information: -// -// config->get_build_info(CdlBuildInfo &info); -// -// This erases anything previously present in the build-info argument -// and fills in the information appropriate to the current -// configuration, essentially by walking down the list of loadables -// and each loadable's list of nodes, checking for BuildLoadables -// and Buildables along the way. The BuildInfo class is defined -// further down. -// -// An alternative library call can be used to find out about all -// possible files that need to be compiled etc., irrespective of the -// current configuration settings. This could be useful when it -// comes to letting the user control compiler flags etc. -// -// config->get_all_build_info(CdlBuildInfo& info); -// -// There is another library call for step (4): -// -// config->generate_config_headers(std::string directory) -// -// This will create or update the header files appropriate to -// the current configuration. Temporary files will be generated, -// diff'ed with the current version, and existing files will -// only be modified if necessary. The directory argument -// indicates where the header files should go, i.e. it should -// be the equivalent of $(PREFIX)/include/pkgconf -// -// This library call does not delete any files it does not -// recognize, that is the responsibility of higher-level code. -// It is possible to get or update a list of the files that -// will be generated: -// -// config->get_config_headers(std::vector& headers) -// -// The argument will be cleared if necessary and then filled in with -// the current set of header files. Higher level code can compare the -// result with the current files in the directory and take or suggest -// remedial action. -// -// There is also a library call which combines all four stages: -// -// config->generate_build_tree(std::string build_tree, std::string prefix = $(BUILD)/install) -// -// -// The order in which the various build steps happen is important. -// -// 1) non-configuration headers must be copied from the component -// repository into $(PREFIX)/include. No compiles can happen -// before this. -// -// 2) all compile properties can happen in parallel. These have an -// effective priority of 100. -// -// 3) all make_object priorities can happen in parallel with -// compiles. These have a default priority of 100, but the -// priority can be modified. -// -// 4) the generated objects and any pre-built objects should be -// incorporated into the appropriate library. This happens -// at priority 200. -// -// 5) custom build steps associated with "make" properties should -// now run. These have a default priority of 300, but it is -// possible to override this. -// -// Usually all source files will come from the component repository, -// which means that they are read-only. Ideally it should also be -// possible for a source file to be copied into the build tree and -// edited there, and subsequent builds should pick up the copy rather -// than the original. The build data generated by libcdl will always -// be in the form of relative pathnames to facilitate this. - -//}}} -//{{{ CdlBuildInfo class - -// ---------------------------------------------------------------------------- -// Extracting the build information. -// -// libcdl.a defines the following classes related to build information. -// -// CdlBuildInfo -// CdlBuildInfo_Loadable -// CdlBuildInfo_Header -// CdlBuildInfo_Compile -// CdlBuildInfo_Object -// CdlBuildInfo_MakeObject -// CdlBuildInfo_Make -// -// The build information is organized on a per-loadable basis. -// Higher-level code may choose to flatten this or to keep the -// distinction. A CdlBuildInfo object is primarily a vector of -// CdlBuildInfo_Loadable objects. CdlBuildInfo objects can be created -// statically. -// -// In turn, each CdlBuildInfo_Loadable object is primarily a -// collection of five vectors, one each for Header, Compile, Object, -// MakeObject and Make. -// -// All pathnames in these data structures will use forward slashes as -// the directory separator, irrespective of the host platform. All -// pathnames will be relative. - -struct CdlBuildInfo_Header { - std::string source; /* include/cyg_ass.h */ - std::string destination; /* cyg/infra/cyg_ass.h */ -}; - -struct CdlBuildInfo_Compile { - std::string library; /* libtarget.a */ - std::string source; /* src/fancy.cxx */ - // Compiler and cflags data may be added in future. -}; - -struct CdlBuildInfo_Object { - std::string library; /* libtarget.a */ - std::string object; /* obj/hello.o */ -}; - -struct CdlBuildInfo_MakeObject { - cdl_int priority; /* 100 */ - std::string library; /* libtarget.a */ - std::string object; /* toyslock.o */ - std::string deps; /* toyslock.y */ - /* - It is not clear whether the deps field is actually useful in the - context of IDE integration, but see the note about arm.inc - above. - */ - std::string rules; - /* - A typical value for "rules" might be: - - yacc toyslock.y - $(CC) $(CFLAGS) -o toyslock.o y.tab.c - - Leading white space is not significant. Newlines are significant. - Backslash escapes in the text will not have been processed yet. - */ -}; - -struct CdlBuildInfo_Make { - cdl_int priority; /* 300 */ - std::string target; /* extras.o */ - std::string deps; /* libextras.a */ - std::string rules; - /* - Something like: - - $(CC) $(ARCHFLAGS) $(LDARCHFLAGS) -nostdlib -Wl,-r -Wl,--whole-archive $(PREFIX)/lib/libextras.a -o $(PREFIX)/lib/extras.o - - */ -}; - -class CdlBuildInfo_Loadable { - - friend class CdlTest; - - public: - std::string name; /* CYGPKG_INFRA */ - std::string repository; /* arbitrary path */ - std::string directory; /* infra/current */ - std::vector headers; - std::vector compiles; - std::vector objects; - std::vector make_objects; - std::vector makes; - - protected: - - private: -}; - -class CdlBuildInfo { - - friend class CdlTest; - - public: - - std::vector entries; - - protected: - - private: -}; - -//}}} -//{{{ CdlBuildLoadable - -// ---------------------------------------------------------------------------- -// BuildLoadables are derived from Loadables and are appropriate for -// any loadables that can contain build information. There are a -// number of properties applicable at this level: makefile, -// include_dir, include_files and library. The main interface of -// interest is update_build_info(). -// -// It is likely that all BuildLoadables are also Buildables, but this -// is not required. - -class CdlBuildLoadableBody : virtual public CdlLoadableBody -{ - friend class CdlTest; - - public: - virtual ~CdlBuildLoadableBody(); - - // This is the main way to extract information about what should - // get built. It takes into account the active and enabled states, - // as appropriate. - void update_build_info(CdlBuildInfo&) const; - - // An alternative which ignores the active and enabled states. - void update_all_build_info(CdlBuildInfo&) const; - - // Property parsers and validation code appropriate for a - // build-loadable object such as makefile - static void add_property_parsers(std::vector& parsers); - void check_properties(CdlInterpreter); - static int parse_library(CdlInterpreter, int, const char*[]); - static int parse_makefile(CdlInterpreter, int, const char*[]); - static int parse_include_dir(CdlInterpreter, int, const char*[]); - static int parse_include_files(CdlInterpreter, int, const char*[]); - - // By default any compiled files will go into libtarget.a, which - // is the default value for this variable. Individual applications may - // specify an alternative default library. - static char* default_library_name; - - // When filling in a build_info structure the library needs to know - // what constitutes a header file. A glob pattern can be used for this. - // NOTE: in the long term this should come out of a data file. - static char* default_headers_glob_pattern; - - virtual std::string get_class_name() const; - bool check_this(cyg_assert_class_zeal = cyg_quick) const; - CYGDBG_DECLARE_MEMLEAK_COUNTER(); - - protected: - CdlBuildLoadableBody(); - - private: - - enum { - CdlBuildLoadableBody_Invalid = 0, - CdlBuildLoadableBody_Magic = 0x55776643 - } cdlbuildloadablebody_cookie; - - // Illegal operations - CdlBuildLoadableBody(const CdlBuildLoadableBody&); - CdlBuildLoadableBody& operator=(const CdlBuildLoadableBody&); -}; - -//}}} -//{{{ CdlBuildable - -// ---------------------------------------------------------------------------- -// Buildable objects can have properties such as compile and -// make_object. These properties are not normally accessed -// directly. Instead there is a member function to update a -// CdlBuildInfo_Loadable object. -// -// The build properties for a given buildable have an effect iff -// that buildable is active, and in addition if the buildable is also -// a valuable then it must be enabled. - -class CdlBuildableBody : virtual public CdlNodeBody -{ - - friend class CdlTest; - - public: - virtual ~CdlBuildableBody(); - - // This is the main way to extract information about what should - // get built. It takes into account the active and enabled states, - // as appropriate. The second argument indicates the default - // library for the current loadable. - void update_build_info(CdlBuildInfo_Loadable&, std::string) const; - - // An alternative which ignores the active and enabled states. - void update_all_build_info(CdlBuildInfo_Loadable&, std::string) const; - - // Add property parsers and validation code appropriate for a - // buildable object such as compile and make_object - static void add_property_parsers(std::vector& parsers); - void check_properties(CdlInterpreter); - - static int parse_build_proc(CdlInterpreter, int, const char*[]); - static int parse_compile(CdlInterpreter, int, const char*[]); - static int parse_make(CdlInterpreter, int, const char*[]); - static int parse_make_object(CdlInterpreter, int, const char*[]); - static int parse_object(CdlInterpreter, int, const char*[]); - static bool split_custom_build_step(std::string /* data */, std::string& /* target */, std::string& /* deps */, - std::string& /* rules*/, std::string& /* error_msg */); - - virtual std::string get_class_name() const; - bool check_this(cyg_assert_class_zeal = cyg_quick) const; - CYGDBG_DECLARE_MEMLEAK_COUNTER(); - - protected: - CdlBuildableBody(); - - private: - - enum { - CdlBuildableBody_Invalid = 0, - CdlBuildableBody_Magic = 0x16eb1c04 - } cdlbuildablebody_cookie; - - // Illegal operations - CdlBuildableBody(const CdlBuildableBody&); - CdlBuildableBody& operator=(const CdlBuildableBody&); -}; - -//}}} -//{{{ CdlDefineLoadable - -// ---------------------------------------------------------------------------- -// DefineLoadables are derived from Loadables and are appropriate for -// any loadables that can result in generated header files containing -// configuration data. There is one applicable property, -// define_header. The main interface of interest is -// generate_config_headers(). - -class CdlDefineLoadableBody : virtual public CdlLoadableBody -{ - - friend class CdlTest; - - public: - virtual ~CdlDefineLoadableBody(); - - // Update the header file for this loadable. The first argument - // is a channel to the loadable-specific header file. The second - // argument is a channel to the global header file. - void generate_config_header(Tcl_Channel, Tcl_Channel) const; - - // What header file should be generated for this loadable? - virtual std::string get_config_header() const; - - // Add property parsers and validation code. - static void add_property_parsers(std::vector& parsers); - void check_properties(CdlInterpreter); - static int parse_define_header(CdlInterpreter, int, const char*[]); - - virtual std::string get_class_name() const; - bool check_this(cyg_assert_class_zeal = cyg_quick) const; - CYGDBG_DECLARE_MEMLEAK_COUNTER(); - - protected: - CdlDefineLoadableBody(); - - private: - - enum { - CdlDefineLoadableBody_Invalid = 0, - CdlDefineLoadableBody_Magic = 0x7e211709 - } cdldefineloadablebody_cookie; - - // Illegal operations - CdlDefineLoadableBody(const CdlDefineLoadableBody&); - CdlDefineLoadableBody& operator=(const CdlDefineLoadableBody&); -}; - -//}}} -//{{{ CdlDefinable - -// ---------------------------------------------------------------------------- -// Definables are derived from Valuables and provide support for -// outputting a configuration header file. - -class CdlDefinableBody : virtual public CdlValuableBody -{ - - friend class CdlTest; - - public: - virtual ~CdlDefinableBody(); - - // Update the header file for this definable. The loadable's Tcl - // interpreter will already have channels cdl_header and - // cdl_system_header set up appropriately. - void generate_config_header( Tcl_Channel, Tcl_Channel) const; - - // Add property parsers and validation code. - static void add_property_parsers(std::vector& parsers); - void check_properties(CdlInterpreter); - static int parse_define(CdlInterpreter, int, const char*[]); - static int parse_define_format(CdlInterpreter, int, const char*[]); - static int parse_define_proc(CdlInterpreter, int, const char*[]); - static int parse_if_define(CdlInterpreter, int, const char*[]); - static int parse_no_define(CdlInterpreter, int, const char*[]); - - virtual std::string get_class_name() const; - bool check_this(cyg_assert_class_zeal = cyg_quick) const; - CYGDBG_DECLARE_MEMLEAK_COUNTER(); - - protected: - CdlDefinableBody(); - - private: - - enum { - CdlDefinableBody_Invalid = 0, - CdlDefinableBody_Magic = 0x65a2c95a - } cdldefinablebody_cookie; - - // Illegal operations - CdlDefinableBody(const CdlDefinableBody&); - CdlDefinableBody& operator=(const CdlDefinableBody&); -}; - -//}}} - -//}}} -//{{{ CdlDialog - -// ---------------------------------------------------------------------------- -// A dialog simply inherits from CdlUserVisible and provides convenient -// access to several dialog-specific properties. - -class CdlDialogBody : - public virtual CdlUserVisibleBody, - public virtual CdlParentableBody -{ - friend class CdlTest; - - public: - - virtual ~CdlDialogBody(); - - // Dialogs may be enabled or disabled globally. This affects - // CdlValuable::get_widget_hint() if the valuable has an associated - // custom dialog. - static void disable_dialogs(); - static void enable_dialogs(); - static bool dialogs_are_enabled(); - - bool has_init_proc() const; - bool has_update_proc() const; - const cdl_tcl_code& get_init_proc() const; - const cdl_tcl_code& get_update_proc() const; - const cdl_tcl_code& get_display_proc() const; - const cdl_tcl_code& get_confirm_proc() const; - const cdl_tcl_code& get_cancel_proc() const; - - static int parse_dialog(CdlInterpreter, int, const char*[]); - static int parse_display_proc(CdlInterpreter, int, const char*[]); - static int parse_update_proc(CdlInterpreter, int, const char*[]); - - // Persistence support. Dialogs should just be ignored when it - // comes to saving and restoring files. - virtual void save(CdlInterpreter, Tcl_Channel, int, bool); - - virtual std::string get_class_name() const; - bool check_this(cyg_assert_class_zeal = cyg_quick) const; - CYGDBG_DECLARE_MEMLEAK_COUNTER(); - - private: - // The constructor only gets invoked from inside parse_dialog() - CdlDialogBody(std::string); - - static bool dialogs_enabled; - - enum { - CdlDialogBody_Invalid = 0, - CdlDialogBody_Magic = 0x3f4df391 - } cdldialogbody_cookie; - - // Illegal operations. The dialog name must be known at the time - // that the object is constructed. - CdlDialogBody(); - CdlDialogBody(const CdlDialogBody&); - CdlDialogBody& operator=(const CdlDialogBody&); -}; - -//}}} -//{{{ CdlWizard - -// ---------------------------------------------------------------------------- -// A wizard is very much like a dialog, just a different set of properties. - -class CdlWizardBody : - public virtual CdlUserVisibleBody, - public virtual CdlParentableBody -{ - friend class CdlTest; - - public: - - virtual ~CdlWizardBody(); - - bool has_init_proc() const; - bool has_decoration_proc() const; - const cdl_tcl_code& get_init_proc() const; - const cdl_tcl_code& get_decoration_proc() const; - const cdl_tcl_code& get_confirm_proc() const; - const cdl_tcl_code& get_cancel_proc() const; - bool has_screen(cdl_int) const; - cdl_int get_first_screen_number() const; - const cdl_tcl_code& get_first_screen() const; - const cdl_tcl_code& get_screen(cdl_int) const; - static int parse_wizard(CdlInterpreter, int, const char*[]); - static int parse_cancel_proc(CdlInterpreter, int, const char*[]); - static int parse_confirm_proc(CdlInterpreter, int, const char*[]); - static int parse_decoration_proc(CdlInterpreter, int, const char*[]); - static int parse_init_proc(CdlInterpreter, int, const char*[]); - static int parse_screen(CdlInterpreter, int, const char*[]); - - // Persistence support. Wizards should just be ignored when it - // comes to saving and restoring files. - virtual void save(CdlInterpreter, Tcl_Channel, int, bool); - - virtual std::string get_class_name() const; - bool check_this(cyg_assert_class_zeal = cyg_quick) const; - CYGDBG_DECLARE_MEMLEAK_COUNTER(); - - private: - // The constructor only gets invoked from inside parse_wizard(). - CdlWizardBody(std::string); - - // Illegal operations. - CdlWizardBody(); - CdlWizardBody(const CdlWizardBody&); - CdlWizardBody& operator=(const CdlWizardBody&); - - enum { - CdlWizardBody_Invalid = 0, - CdlWizardBody_Magic = 0x4ec1c39a - } cdlwizardbody_cookie; -}; - -//}}} -//{{{ CdlInterface class - -// ---------------------------------------------------------------------------- -// Similarly for interfaces. - -class CdlInterfaceBody : public virtual CdlNodeBody, - public virtual CdlUserVisibleBody, - public virtual CdlValuableBody, - public virtual CdlParentableBody, - public virtual CdlBuildableBody, - public virtual CdlDefinableBody -{ - friend class CdlTest; - - public: - - ~CdlInterfaceBody(); - - void get_implementers(std::vector&) const; - void recalculate(CdlTransaction); - - static int parse_interface(CdlInterpreter, int, const char*[]); - - // Persistence support. The interface data cannot sensibly be modified - // by users, it is all calculated. However it is useful to have the - // interface data present in the saved file so that users can examine - // dependencies etc. - virtual void save(CdlInterpreter, Tcl_Channel, int, bool); - static void initialize_savefile_support(CdlToplevel); - static int savefile_interface_command(CdlInterpreter, int, const char*[]); - - bool was_generated() const; - virtual bool is_modifiable() const; - virtual std::string get_class_name() const; - bool check_this(cyg_assert_class_zeal = cyg_quick) const; - CYGDBG_DECLARE_MEMLEAK_COUNTER(); - - private: - CdlInterfaceBody(std::string, bool /* generated */); - bool generated; - - enum { - CdlInterfaceBody_Invalid = 0, - CdlInterfaceBody_Magic = 0x67f7fbe5 - } cdlinterfacebody_cookie; - CdlInterfaceBody(); - CdlInterfaceBody(const CdlInterfaceBody&); - CdlInterfaceBody& operator=(const CdlInterfaceBody&); -}; - -//}}} - -#endif /* !__CDLCORE_HXX */ -// EOF cdlcore.hxx diff --git a/host/libcdl/cdlmisc.cxx b/host/libcdl/cdlmisc.cxx deleted file mode 100644 --- a/host/libcdl/cdlmisc.cxx +++ /dev/null @@ -1,1095 +0,0 @@ -//{{{ Banner - -//============================================================================ -// -// cdlmisc.cxx -// -// Implementation of the various CDL utility member functions. -// -//============================================================================ -//####COPYRIGHTBEGIN#### -// -// ---------------------------------------------------------------------------- -// Copyright (C) 1998, 1999, 2000 Red Hat, Inc. -// -// This file is part of the eCos host tools. -// -// This program is free software; you can redistribute it and/or modify it -// under the terms of the GNU General Public License as published by the Free -// Software Foundation; either version 2 of the License, or (at your option) -// any later version. -// -// This program is distributed in the hope that it will be useful, but WITHOUT -// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for -// more details. -// -// You should have received a copy of the GNU General Public License along with -// this program; if not, write to the Free Software Foundation, Inc., -// 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -// -// ---------------------------------------------------------------------------- -// -//####COPYRIGHTEND#### -//============================================================================ -//#####DESCRIPTIONBEGIN#### -// -// Author(s): bartv -// Contact(s): bartv -// Date: 1998/03/04 -// Version: 0.01 -// -//####DESCRIPTIONEND#### -//============================================================================ - -//}}} -//{{{ #include's - -// ---------------------------------------------------------------------------- -#include "cdlconfig.h" - -// Get the infrastructure types, assertions, tracing and similar -// facilities. -#include -#include - -// defines everything implemented in this module. -// It implicitly supplies , and because -// the class definitions rely on these headers. -#include - -// For access to the isdigit(), isupper(), tolower(), ... functions -#include - -// For access to sprintf(), specifically double to string conversions. -#include - -// For access to strtod() -#include - -// strtod() involves errno... -#include - -// For access to fmod() -#include - -// For access to DBL_DIG -#include - -//}}} - -//{{{ Cdl::is_valid_xxx() - -// --------------------------------------------------------------------------- - -bool -Cdl::is_valid_value_flavor(CdlValueFlavor data) -{ - bool result = false; - - switch(data) { - case CdlValueFlavor_None : - case CdlValueFlavor_Bool : - case CdlValueFlavor_BoolData : - case CdlValueFlavor_Data : - result = true; - break; - - default: - break; - } - - return result; -} - -bool -Cdl::is_valid_value_source(CdlValueSource data) -{ - bool result = false; - - switch(data) { - case CdlValueSource_Default : - case CdlValueSource_User : - case CdlValueSource_Wizard : - case CdlValueSource_Inferred : - result = true; - break; - - default: - break; - } - - return result; -} - -// ---------------------------------------------------------------------------- -// For now CDL names are restricted to what is acceptable to the C -// preprocessor. This may cause problems in future, e.g. i18n. - -bool -Cdl::is_valid_cdl_name(const std::string& name) -{ - CYG_REPORT_FUNCNAMETYPE("Cdl::is_valid_cdl_name", "result %d"); - - bool result = is_valid_c_preprocessor_symbol(name); - - CYG_REPORT_RETVAL(result); - return result; -} - -bool -Cdl::is_valid_c_preprocessor_symbol(const std::string& symbol) -{ - CYG_REPORT_FUNCNAMETYPE("Cdl::is_valid_c_preprocessor_symbol", "result %d"); - - bool result = true; - if ("" == symbol) { - result = false; - } else { - // A valid preprocessor symbol should begin with either an underscore - // or a letter. It should then be followed by some number of underscores, - // letters, or digits. - // - // In some locales isalpha() may succeed for characters which are not - // legal for C preprocessor symbols. Instead ASCII is assumed here. - if (('_' != symbol[0]) && - !(('a' <= symbol[0]) && (symbol[0] <= 'z')) && - !(('A' <= symbol[0]) && (symbol[0] <= 'Z'))) { - - result = false; - } else { - for (unsigned int i = 1; i < symbol.size(); i++) { - if (('_' != symbol[i]) && - !(('a' <= symbol[i]) && (symbol[i] <= 'z')) && - !(('A' <= symbol[i]) && (symbol[i] <= 'Z')) && - !(('0' <= symbol[i]) && (symbol[i] <= '9'))) { - - result = false; - break; - } - } - } - } - - CYG_REPORT_RETVAL(result); - return result; -} - -//}}} -//{{{ Cdl::xxx_to_yyy() - strings, ints, doubles, ... - -// --------------------------------------------------------------------------- -// Conversion routines between strings, integers, doubles, bools, ... -// -// Conversions to/from integers are complicated somewhat because the -// data type in question is cdl_int. In the initial implementation this -// is 64 bits. In the long term it will be arbitrary precision and -// the conversion routines will need to be reimplemented. -// -// ASCII rather than EBCDIC is assumed. -// -// Some of the routines may fail, e.g. string to integer conversions. -// Others are guaranteed to succeed. - -//{{{ string_to_integer() - -// ---------------------------------------------------------------------------- -bool -Cdl::string_to_integer(std::string data, cdl_int& target) -{ - CYG_REPORT_FUNCNAMETYPE("Cdl::string_to_integer", "success %d"); - - bool negative = false; - bool seen_plus = false; - bool seen_minus = false; - - // Life is a bit easier if I can check for '\0' - const char* ptr = data.c_str(); - - // Not essential but harmless. - while (isspace(*ptr)) - ptr++; - - if ('+' == *ptr) { - if (seen_plus) { - target = 0; - CYG_REPORT_RETVAL(false); - return false; - } - seen_plus = true; - ptr++; - } - - if ('-' == *ptr) { - if (seen_minus) { - target = 0; - CYG_REPORT_RETVAL(false); - return false; - } - seen_minus = true; - negative = true; - ptr++; - } - - cdl_int acc = 0; - if ('0' == *ptr) { - // This happens sufficiently often to be worth a special case. - if ('\0' == ptr[1]) { - target = 0; - CYG_REPORT_RETVAL(true); - return true; - } - // Hex is always worth supporting. - if (('x' == ptr[1]) || ('X' == ptr[1])) { - ptr++; ptr++; - if (!isxdigit(*ptr)) { - CYG_REPORT_RETVAL(false); - return false; - } - while (isxdigit(*ptr)) { - cdl_int new_acc = acc * 16; - if (isdigit(*ptr)) { - new_acc += (*ptr - '0'); - } else if (('a' <= *ptr) && (*ptr <= 'f')) { - new_acc += (*ptr + 10 - 'a'); - } else if (('A' <= *ptr) && (*ptr <= 'F')) { - new_acc += (*ptr + 10 - 'A'); - } else { - CYG_FAIL("this platform's implementation of isxdigit() is broken"); - } - if (new_acc < acc) { - CYG_REPORT_RETVAL(false); - return false; - } - acc = new_acc; - ptr++; - } - if ('\0' != *ptr) { - CYG_REPORT_RETVAL(false); - return false; - } - if (negative) { - cdl_int new_acc = 0 - acc; - if (new_acc > 0) { - CYG_REPORT_RETVAL(false); - return false; - } else { - acc = new_acc; - } - } - target = acc; - CYG_REPORT_RETVAL(true); - return true; - } - - // Octal? Oh well, might as well be complete. - if (('0' <= ptr[1]) && (ptr[1] <= '7')) { - ptr++; - do { - cdl_int new_acc = 8 * acc; - new_acc += (*ptr - '0'); - if (new_acc < acc) { - CYG_REPORT_RETVAL(false); - return false; - } - acc = new_acc; - ptr++; - } while (('0' <= *ptr) && (*ptr <= '7')); - if ('\0' != *ptr) { - CYG_REPORT_RETVAL(false); - return false; - } - if (negative) { - cdl_int new_acc = 0 - acc; - if (new_acc > 0) { - CYG_REPORT_RETVAL(false); - return false; - } - else { - acc = new_acc; - } - } - target = acc; - CYG_REPORT_RETVAL(true); - return true; - } - - // Drop through for the case of a decimal. - } - - while(isdigit(*ptr)) { - cdl_int new_acc = 10 * acc; - new_acc += (*ptr - '0'); - if (new_acc < acc) { - CYG_REPORT_RETVAL(false); - return false; - } - acc = new_acc; - ptr++; - } - if ('\0' != *ptr) { - CYG_REPORT_RETVAL(false); - return false; - } - if (negative) { - cdl_int new_acc = 0 - acc; - if (new_acc > 0) { - CYG_REPORT_RETVAL(false); - return false; - } else { - acc = new_acc; - } - } - target = acc; - CYG_REPORT_RETVAL(true); - return true; -} - -//}}} -//{{{ string_to_double() - -// ---------------------------------------------------------------------------- -// There is no point in doing this the hard way, just use standard -// library calls. -// -// There is an obvious question as to how much precision can get lost -// doing the conversion to a string. In practice this should not matter -// too much, since the expression handling code generally keeps the -// original double precision lying around to be re-used. However it may -// be desirable to keep the libcdl behaviour in synch with Tcl's -// tcl_precision variable. - -bool -Cdl::string_to_double(std::string value, double& target) -{ - CYG_REPORT_FUNCNAMETYPE("Cdl::string_to_double", "success %d"); - - bool result = true; - const char* start_ptr = value.c_str(); - char* end_ptr; - int old_errno = errno; - - errno = 0; - double conv = strtod(start_ptr, &end_ptr); - if (0 != errno) { - CYG_ASSERT(ERANGE == errno, "standard-compliant C library"); - result = false; - } else if ('\0' != *end_ptr) { - result = false; - } else { - target = conv; - result = true; - } - - errno = old_errno; - CYG_REPORT_RETVAL(result); - return result; -} - -//}}} -//{{{ string_to_bool() - -// ---------------------------------------------------------------------------- -// Conversions to and from bools. The only real issue here is exactly -// what strings should be accepted as synonyms for true and false. -// It is not actually clear that these functions are useful. -bool -Cdl::string_to_bool(std::string data, bool& target) -{ - CYG_REPORT_FUNCNAMETYPE("Cdl::string_to_bool", "success %d"); - - // Arguably there should be a precondition ( "" != data ) - bool result = false; - - // What is truth ? - if (( data == "1" ) || (data == "true") || - ( data == "True") || (data == "TRUE") ) { - result = true; - target = true; - } else if ((data == "0" ) || (data == "false") || - (data == "False") || (data == "FALSE") ) { - result = true; - target = false; - } - - CYG_REPORT_RETVAL(result); - return result; -} - -//}}} - -//{{{ integer_to_string() - -// ---------------------------------------------------------------------------- - -std::string -Cdl::integer_to_string(cdl_int value, CdlValueFormat format) -{ - std::string result; - Cdl::integer_to_string(value, result, format); - return result; -} - -void -Cdl::integer_to_string(cdl_int value, std::string& target, CdlValueFormat format) -{ - CYG_REPORT_FUNCNAME("Cdl::integer_to_string"); - CYG_REPORT_FUNCARG2XV((long) value, format); - - // Optimise this special case. - if (0 == value) { - if (CdlValueFormat_Hex == format) { - target = "0x0"; - } else { - target = "0"; - } - CYG_REPORT_RETVAL(true); - return; - } - - // A local buffer to construct partial strings. This avoids - // unnecessary std::string reallocation. - // 64 bits and three bits at a time for octal numbers gives 21 digits, - // plus spares for the leading '0' and the terminator. - char local_buf[24]; - char *local_ptr = &(local_buf[23]); - *local_ptr-- = '\0'; - - if (CdlValueFormat_Hex == format) { - - // Output the data as 0x... with either 8 or 16 digits, - // depending on the size. - int i; - for (i = 0; i < 8; i++) { - int tmp = (int) (value & 0x0F); - value = value >> 4; - if (tmp < 10) { - *local_ptr-- = '0' + tmp; - } else { - *local_ptr-- = 'A' + (tmp - 10); - } - } - // Beware of right shifts that preserve the sign bit. - { - int tmp1 = (value & 0x0FFFF); - int tmp2 = ((value >> 16) & 0x0FFFF); - value = (tmp2 << 16) + tmp1; - } - if (value != 0) { - for (i = 0; i < 8; i++) { - int tmp = (int) (value & 0x0F); - value = value >> 4; - if (tmp < 10) { - *local_ptr-- = '0' + tmp; - } else { - *local_ptr-- = 'A' + (tmp - 10); - } - } - } - *local_ptr-- = 'x'; - *local_ptr = '0'; - target = std::string(local_ptr); - - } else if (CdlValueFormat_Octal == format) { - - // Simply output the data three bits at a time, do not worry about any - // particular width restrictions. However it is necessary to worry - // about masking. - cdl_int mask = 0x1FFFFFFF; - mask = (mask << 16) | 0x0FFFF; - mask = (mask << 16) | 0x0FFFF; - - target = ""; - while (value > 0) { - int tmp = value & 0x07; - value = (value >> 3) & mask; - *local_ptr-- = '0' + tmp; - } - *local_ptr = '0'; - target = std::string(local_ptr); - - } else { - // A simple decimal number - // Switch to positive arithmetic. - bool negative = false; - if (value < 0) { - negative = true; - value = 0 - value; - // Only MININT cannot be converted using the above line - if (value < 0) { - target = "-9223372036854775808"; - CYG_REPORT_RETVAL(true); - return; - } - } - - while (value > 0) { - int rem = (int) (value % 10); - value = value / 10; - *local_ptr-- = '0' + rem; - } - if (negative) { - *local_ptr-- = '-'; - } - local_ptr++; - target = std::string(local_ptr); - } - - CYG_REPORT_RETURN(); - return; -} - -//}}} -//{{{ double_to_string() - -// ---------------------------------------------------------------------------- - -std::string -Cdl::double_to_string(double value, CdlValueFormat format) -{ - std::string result; - Cdl::double_to_string(value, result, format); - return result; -} - -void -Cdl::double_to_string(double value, std::string& result, CdlValueFormat format) -{ - CYG_REPORT_FUNCNAME("Cdl::double_to_String"); - - char buf[256]; // This should be plenty :-) - sprintf(buf, "%.*G", DBL_DIG, value); - result = buf; - - CYG_UNUSED_PARAM(CdlValueFormat, format); - CYG_REPORT_RETURN(); -} - -//}}} -//{{{ bool_to_string() - -// ---------------------------------------------------------------------------- -// Should the string results be 1/0 or true/false? Not that -// it really matters. The testcase in cdl1.cxx expects 1/0. -std::string -Cdl::bool_to_string(bool value) -{ - std::string result; - Cdl::bool_to_string(value, result); - return result; -} - -void -Cdl::bool_to_string(bool value, std::string& target) -{ - CYG_REPORT_FUNCNAME("Cdl::bool_to_string"); - CYG_REPORT_FUNCARG1( "value arg %ld", (long) value); - - if (value) - target = "1"; - else - target = "0"; - - CYG_REPORT_RETURN(); -} - -//}}} - -//{{{ integer_to_double() - -// ---------------------------------------------------------------------------- -// Currently integer to double cannot fail, although there may well be loss -// of accurary. Eventually cdl_int may be an arbitrary precision integer -// in which case conversion to double is not guaranteed. -double -Cdl::integer_to_double(cdl_int value) -{ - CYG_REPORT_FUNCNAME("Cdl::integer_to_double"); - - double result = (double) value; - - CYG_REPORT_RETURN(); - return result; -} - -void -Cdl::integer_to_double(cdl_int value, double& target) -{ - CYG_REPORT_FUNCNAME("Cdl::integer_to_double"); - - target = (double) value; - - CYG_REPORT_RETURN(); -} - -//}}} -//{{{ double_to_integer() - -// Conversion from double to integer is only allowed if there is no loss -// of data. modf() is useful here -bool -Cdl::double_to_integer(double value, cdl_int& target) -{ - CYG_REPORT_FUNCNAMETYPE("Cdl::double_to_integer", "result %d"); - - bool result = false; - - double integral; - double frac; - - frac = modf(value, &integral); - if (0.0 == frac) { - // Looking good, but integral may still be too big. - cdl_int tmp = (cdl_int) integral; - if (tmp == value) { - // No fraction, no loss of data, everything looking good - target = tmp; - result = true; - } - } - - CYG_REPORT_RETVAL(result); - return result; -} - -//}}} - -//}}} -//{{{ Cdl::xxx_to_yyy() - CDL-specific data types - -// ---------------------------------------------------------------------------- -// Conversions between strings and flavors. - -static struct { - char* name; - CdlValueFlavor flavor; -} valid_flavors[] = { - { "none", CdlValueFlavor_None }, - { "bool", CdlValueFlavor_Bool }, - { "booldata", CdlValueFlavor_BoolData }, - { "data", CdlValueFlavor_Data }, - { 0, CdlValueFlavor_Invalid } -}; - -bool -Cdl::string_to_flavor(std::string name, CdlValueFlavor& target) -{ - CYG_REPORT_FUNCNAMETYPE("Cdl::string_to_flavor", "success %d"); - - bool result = false; - - // First convert the argument to lower case. Arguably this is incorrect, - // Tcl is a case-sensitive language, but the conversion is unlikely ever - // to be harmfull. - for (std::string::iterator str_i = name.begin(); str_i != name.end(); str_i++) { - if (isupper(*str_i)) { - *str_i = tolower(*str_i); - } - } - - // Now look for a match in the table. - int match = -1; - int i; - const char* c_str = name.c_str(); - int len = strlen(c_str); - - for (i = 0; 0 != valid_flavors[i].name; i++) { - if (0 == strncmp(c_str, valid_flavors[i].name, len)) { - // Check for an ambiguous string match. - // This cannot actually happen with the current flavor names. - if ( -1 != match) { - break; - } - match = i; - } - - } - if (-1 != match) { - target = valid_flavors[match].flavor; - result = true; - } - CYG_REPORT_RETVAL(result); - return result; -} - -bool -Cdl::flavor_to_string(CdlValueFlavor flavor, std::string& target) -{ - CYG_REPORT_FUNCNAMETYPE("Cdl::flavor_to_string", "success %d"); - - bool result = false; - - for (int i = 0; 0 != valid_flavors[i].name; i++) { - if (flavor == valid_flavors[i].flavor) { - target = valid_flavors[i].name; - result = true; - break; - } - } - - CYG_REPORT_RETVAL(result); - return result; -} - -// ---------------------------------------------------------------------------- -// Similar support for value sources. - -static struct { - char* name; - CdlValueSource source; -} valid_sources[] = { - { "default", CdlValueSource_Default }, - { "inferred", CdlValueSource_Inferred }, - { "wizard", CdlValueSource_Wizard }, - { "user", CdlValueSource_User }, - { 0, CdlValueSource_Invalid } -}; - -bool -Cdl::string_to_source(std::string name, CdlValueSource& target) -{ - CYG_REPORT_FUNCNAMETYPE("Cdl::string_to_source", "success %d"); - - bool result = false; - - // First convert the argument to lower case. Arguably this is incorrect, - // Tcl is a case-sensitive language, but the conversion is unlikely ever - // to be harmfull. - for (std::string::iterator str_i = name.begin(); str_i != name.end(); str_i++) { - if (isupper(*str_i)) { - *str_i = tolower(*str_i); - } - } - - // Now look for a match in the table. - int match = -1; - int i; - const char* c_str = name.c_str(); - int len = strlen(c_str); - - for (i = 0; 0 != valid_sources[i].name; i++) { - if (0 == strncmp(c_str, valid_sources[i].name, len)) { - // Check for an ambiguous string match. - // This cannot actually happen with the current source names. - if ( -1 != match) { - break; - } - match = i; - } - - } - if (-1 != match) { - target = valid_sources[match].source; - result = true; - } - CYG_REPORT_RETVAL(result); - return result; -} - -bool -Cdl::source_to_string(CdlValueSource source, std::string& target) -{ - CYG_REPORT_FUNCNAMETYPE("Cdl::source_to_string", "success %d"); - - bool result = false; - - for (int i = 0; 0 != valid_sources[i].name; i++) { - if (source == valid_sources[i].source) { - target = valid_sources[i].name; - result = true; - break; - } - } - - CYG_REPORT_RETVAL(result); - return result; -} - -//}}} -//{{{ Cdl::get_library_version() - -// ---------------------------------------------------------------------------- -// The version of the library actually lives inside configure.in. It gets -// exported into cdlconfig.h -std::string -Cdl::get_library_version(void) -{ - return std::string(CYGNUM_LIBCDL_VERSION); -} - -//}}} -//{{{ Cdl::set_interactive() - -// ---------------------------------------------------------------------------- -// Some CDL scripts and some bits of the library may want to adapt depending -// on whether or not the application is running fully interactively or in -// batch mode. The primary distinction is that a batch program should never -// attempt to obtain user input, whether via Tk widgets or by other means. - -bool Cdl::interactive = false; - -void -Cdl::set_interactive(bool value) -{ - CYG_REPORT_FUNCNAME("Cdl::set_interactive"); - CYG_REPORT_FUNCARG1D(value); - - interactive = value; -} - -bool -Cdl::is_interactive(void) -{ - CYG_REPORT_FUNCNAMETYPE("Cdl::is_interactive", "interactive %d"); - CYG_REPORT_RETVAL(interactive); - return interactive; -} - -//}}} -//{{{ version support() - -// ---------------------------------------------------------------------------- -// Packages may need to impose constraints on which versions of other -// packages they can coexist with. This requires some way of achieving -// a partial ordering of version numbers. Unfortunately there are many -// different ways of specifying a version number, and we cannot impose -// a single model on all third party package developers. Instead this -// routine performs some semi-intelligent comparisons of two version -// strings which should work in the vast majority of cases. -// -// The return value is as per strcmp(), -1 if the first entry is -// smaller (i.e. the more recent and hence hopefully the first in -// a list), +1 if the second entry is smaller, 0 if the two are -// identical. -// -// There is a big ambiguity between "derived" versions and "experimental" -// versions. Something like v0.3beta is experimental, i.e. it is older -// than the full release v0.3. On the other hand v0.3.p1 is a patched -// version of v0.3 and hence newer. This code uses the presence or otherwise -// of a separator to decide between the two cases. - -// A utility routine which checks whether or not a character counts -// as a separator. Currently the characters . - and _ are all accepted -// as field separators. -// -// Arguably - should not be accepted as a separator. Instead if it preceeds -// a digit it could be interpreted as part of a prerelease number. - -static bool -is_separator(int ch) -{ - return ('.' == ch) || ('-' == ch) || ('_' == ch); -} - -int -Cdl::compare_versions(std::string arg1, std::string arg2) -{ - CYG_REPORT_FUNCNAMETYPE("Cdl::compare_versions", "result %d"); - - if (arg1 == arg2) { - CYG_REPORT_RETVAL(0); - return 0; - } - - // The version number "current" is special, it always indicates the most - // recent version e.g. as checked out from a CVS repository. - if ("current" == arg1) { - CYG_REPORT_RETVAL(-1); - return -1; - } - if ("current" == arg2) { - CYG_REPORT_RETVAL(1); - return 1; - } - - const char* ptr1 = arg1.c_str(); - const char* ptr2 = arg2.c_str(); - int num1 = 0; - int num2 = 0; - - // If both strings start with 'v' or 'V', skip this. A minor variation in - // case at the start of a string should be ignored. - if ((('v' == *ptr1) || ('V' == *ptr1)) && - (('v' == *ptr2) || ('V' == *ptr2))) { - ptr1++; - ptr2++; - } - - // Now process the rest of the version string, one unit at a time. - while (1) { - - if (('\0' == *ptr1) && ('\0' == *ptr2)) { - // Both strings have terminated at the same time. There - // may have been some spurious leading zeroes in numbers, - // or irrelevant differences in the separators. - CYG_REPORT_RETVAL(0); - return 0; - } - - if ('\0' == *ptr1) { - // The first string has ended first. If the second string currently - // points at a separator then arg2 is a derived version, e.g. - // v0.3.p1, and hence newer. Otherwise arg2 is an experimental - // version v0.3beta and hence older. - if (is_separator(*ptr2)) { - CYG_REPORT_RETVAL(1); - return 1; - } else { - CYG_REPORT_RETVAL(-1); - return -1; - } - } - - if ('\0' == *ptr2) { - // As per the previous test. - if (is_separator(*ptr1)) { - CYG_REPORT_RETVAL(-1); - return -1; - } else { - CYG_REPORT_RETVAL(1); - return 1; - } - } - - // If both strings currently point at numerical data, do a conversion and - // a numerical comparison. - if (isdigit(*ptr1) && isdigit(*ptr2)) { - num1 = 0; - num2 = 0; - // Strictly speaking there should be some overflow tests here, but it - // is not worth the trouble. - do { - num1 = (10 * num1) + (*ptr1++ - '0'); - } while(isdigit(*ptr1)); - do { - num2 = (10 * num2) + (*ptr2++ - '0'); - } while(isdigit(*ptr2)); - // v2.0 is newer than v1.0 - if (num1 < num2) { - CYG_REPORT_RETVAL(1); - return 1; - } else if (num1 > num2) { - CYG_REPORT_RETVAL(-1); - return -1; - } else { - continue; - } - } - - // Non-numerical data. If the two characters are the same then - // move on. Note: this has to happen after numerical conversions - // to distinguish v10.0 and v1.0 - if (*ptr1 == *ptr2) { - ptr1++; ptr2++; - continue; - } - - // If both strings are currently at a separator then move on. All - // separators can be used interchangeably. - if (is_separator(*ptr1) && is_separator(*ptr2)) { - ptr1++; ptr2++; - continue; - } - - // If only one string is at a separator, special action - // is needed. v1.1alpha is interpreted as earlier than - // v1.1, but v1.1.3 is a later release. - if (is_separator(*ptr1)) { - return -1; - } else if (is_separator(*ptr2)) { - return 1; - } - - // Two different characters, e.g. v1.0alpha vs. v1.0beta - if (*ptr1 < *ptr2) { - CYG_REPORT_RETVAL(1); - return 1; - } else { - CYG_REPORT_RETVAL(-1); - return -1; - } - } - - // Not reachable. -} - -// ---------------------------------------------------------------------------- -// Given a version string, extract major, minor and release numbers. -// Some or all of these may be absent. Basically the code just -// iterates through the string looking for sequences of numbers. - -static void -version_extract_number(const std::string& version, unsigned int& index, std::string& result) -{ - CYG_REPORT_FUNCNAME("version_extract_number"); - - // The calling code is expected to supply a sensible default. - // Search for a digit - for ( ; index < version.size(); index++) { - if (isdigit(version[index])) { - break; - } - } - if (index != version.size()) { - result = ""; - if ((index > 0) && ('-' == version[index-1])) { - result = "-"; - } - do { - result += version[index++]; - } while ((index < version.size()) && isdigit(version[index])); - } - - CYG_REPORT_RETURN(); -} - -void -Cdl::split_version_string(const std::string& version, std::string& major, std::string& minor, std::string& release) -{ - CYG_REPORT_FUNCNAME("CdlMisc::split_version_string"); - - unsigned int index = 0; - version_extract_number(version, index, major); - version_extract_number(version, index, minor); - version_extract_number(version, index, release); - - CYG_REPORT_RETURN(); -} - -//}}} -//{{{ Cdl::get_short_form() - -// ---------------------------------------------------------------------------- -// It is occasionally useful to take a full CDL name such as CYgpkg_KERNEL -// and turn it into a short form such as "kernel". This involves discarding -// everything up to and including the first underscore, then lowercasing -// all subsequent characters. -std::string -Cdl::get_short_form(const std::string& original) -{ - CYG_REPORT_FUNCNAME("CdlMisc::get_short_form"); - - std::string result = ""; - unsigned int size = original.size(); - unsigned int i; - for (i = 0; i < size; i++) { - if ('_' == original[i]) { - i++; - break; - } - } - - // Either at end of string, or just past the first underscore - for ( ; i < size; i++) { - if (isupper(original[i])) { - result += tolower(original[i]); - } else { - result += original[i]; - } - } - - CYG_REPORT_RETURN(); - return result; -} - -//}}} diff --git a/host/libcdl/component.cxx b/host/libcdl/component.cxx deleted file mode 100644 --- a/host/libcdl/component.cxx +++ /dev/null @@ -1,502 +0,0 @@ -//{{{ Banner - -//============================================================================ -// -// component.cxx -// -// Implementation of the CdlComponent class -// -//============================================================================ -//####COPYRIGHTBEGIN#### -// -// ---------------------------------------------------------------------------- -// Copyright (C) 2002 Bart Veer -// Copyright (C) 1999, 2000 Red Hat, Inc. -// -// This file is part of the eCos host tools. -// -// This program is free software; you can redistribute it and/or modify it -// under the terms of the GNU General Public License as published by the Free -// Software Foundation; either version 2 of the License, or (at your option) -// any later version. -// -// This program is distributed in the hope that it will be useful, but WITHOUT -// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for -// more details. -// -// You should have received a copy of the GNU General Public License along with -// this program; if not, write to the Free Software Foundation, Inc., -// 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -// -// ---------------------------------------------------------------------------- -// -//####COPYRIGHTEND#### -//============================================================================ -//#####DESCRIPTIONBEGIN#### -// -// Author(s): bartv -// Contact(s): bartv -// Date: 1999/03/01 -// Version: 0.02 -// -//####DESCRIPTIONEND#### -//============================================================================ - -//}}} -//{{{ #include's - -// ---------------------------------------------------------------------------- -#include "cdlconfig.h" - -// Get the infrastructure types, assertions, tracing and similar -// facilities. -#include -#include - -// defines everything implemented in this module. -// It implicitly supplies , and because -// the class definitions rely on these headers. -#include - -//}}} - -//{{{ Statics - -// ---------------------------------------------------------------------------- -CYGDBG_DEFINE_MEMLEAK_COUNTER(CdlComponentBody); - -//}}} -//{{{ Constructor - -// ---------------------------------------------------------------------------- -CdlComponentBody::CdlComponentBody(std::string name_arg) - : CdlNodeBody(name_arg), - CdlContainerBody(), - CdlUserVisibleBody(), - CdlValuableBody(), - CdlParentableBody(), - CdlBuildableBody(), - CdlDefinableBody() -{ - CYG_REPORT_FUNCNAME("CdlComponentBody:: constructor"); - CYG_REPORT_FUNCARG1XV(this); - - cdlcomponentbody_cookie = CdlComponentBody_Magic; - CYGDBG_MEMLEAK_CONSTRUCTOR(); - - CYG_POSTCONDITION_THISC(); - CYG_REPORT_RETURN(); -} - -//}}} -//{{{ Destructor - -// ---------------------------------------------------------------------------- - -CdlComponentBody::~CdlComponentBody() -{ - CYG_REPORT_FUNCNAME("CdlComponentBody:: destructor"); - CYG_REPORT_FUNCARG1XV(this); - CYG_PRECONDITION_THISC(); - - cdlcomponentbody_cookie = CdlComponentBody_Invalid; - CYGDBG_MEMLEAK_DESTRUCTOR(); - - CYG_REPORT_RETURN(); -} - -//}}} -//{{{ parse_component() - -// ---------------------------------------------------------------------------- -// Parsing a component definition. This routine gets invoked directly from the -// Tcl interpreter. - -int -CdlComponentBody::parse_component(CdlInterpreter interp, int argc, const char* argv[]) -{ - CYG_REPORT_FUNCNAMETYPE("CdlComponentBody::parse_component", "result %d"); - CYG_REPORT_FUNCARG1("argc %d", argc); - CYG_PRECONDITION_CLASSC(interp); - - std::string diag_argv0 = CdlParse::get_tcl_cmd_name(argv[0]); - - CdlLoadable loadable = interp->get_loadable(); - CdlPackage package = dynamic_cast(loadable); - CdlContainer parent = interp->get_container(); - CdlToplevel toplevel = interp->get_toplevel(); - CYG_ASSERT_CLASSC(loadable); // There should always be a loadable during parsing - CYG_ASSERT_CLASSC(package); // And packages are the only loadable for software CDL. - CYG_ASSERT_CLASSC(parent); - CYG_ASSERT_CLASSC(toplevel); - - // The new component should be created and added to the package - // early on. If there is a parsing error it will get cleaned up - // automatically as a consequence of the package destructor. - // However it is necessary to validate the name first. Errors - // should be reported via CdlParse::report_error(), - // which may result in an exception. - CdlComponent new_component = 0; - bool ok = true; - int result = TCL_OK; - try { - - // Currently there are no options. This may change in future. - if (3 != argc) { - CdlParse::report_error(interp, "", - std::string("Incorrect number of arguments to `") + diag_argv0 + - "'\nExpecting name and properties list."); - ok = false; - goto done; - } - if (!Tcl_CommandComplete(CDL_TCL_CONST_CAST(char*, argv[2]))) { - CdlParse::report_error(interp, "", - std::string("Invalid property list for cdl_component `") + argv[1] + "'."); - ok = false; - goto done; - } - - if (0 != toplevel->lookup(argv[1])) { - CdlParse::report_error(interp, "", - std::string("Component `") + argv[1] + - "' cannot be loaded.\nThe name is already in use."); - ok = false; - } else { - new_component = new CdlComponentBody(argv[1]); - toplevel->add_node(package, parent, new_component); - } - - done: - if (!ok) { - // Just because this component cannot be created, that is no - // reason to abort the whole parsing process. - CYG_REPORT_RETVAL(TCL_OK); - return TCL_OK; - } - } catch(std::bad_alloc e) { - interp->set_result(CdlParse::construct_diagnostic(interp, "internal error", "", "Out of memory")); - result = TCL_ERROR; - } catch(CdlParseException e) { - interp->set_result(e.get_message()); - result = TCL_ERROR; - } catch(...) { - interp->set_result(CdlParse::construct_diagnostic(interp, "internal error", "", "Unexpected C++ exception")); - result = TCL_ERROR; - } - if (TCL_OK != result) { - CYG_REPORT_RETVAL(result); - return result; - } - - // At this stage new_component has been created and added to the hierarchy. - // The main work now is to add the properties. - - // Push the component as the current node early on. This aids - // diagnostics. Also make it the new container. - CdlNode old_node = interp->push_node(new_component); - CdlContainer old_container = interp->push_container(new_component); - std::string old_context; - CYG_ASSERTC(parent == old_container); - - // Declare these outside the scope of the try statement, to allow - // goto calls for the error handling. - std::string tcl_result; - std::vector new_commands; - std::vector* old_commands = 0; - static CdlInterpreterCommandEntry commands[] = - { - CdlInterpreterCommandEntry("script", &CdlComponentBody::parse_script ), - CdlInterpreterCommandEntry("cdl_component", &CdlComponentBody::parse_component ), - CdlInterpreterCommandEntry("cdl_option", &CdlOptionBody::parse_option ), - CdlInterpreterCommandEntry("cdl_interface", &CdlInterfaceBody::parse_interface ), - CdlInterpreterCommandEntry("cdl_dialog", &CdlDialogBody::parse_dialog ), - CdlInterpreterCommandEntry("cdl_wizard", &CdlWizardBody::parse_wizard ), - CdlInterpreterCommandEntry("", 0 ) - }; - static CdlInterpreterCommandEntry script_commands[] = - { - CdlInterpreterCommandEntry("cdl_component", &CdlComponentBody::parse_component ), - CdlInterpreterCommandEntry("cdl_option", &CdlOptionBody::parse_option ), - CdlInterpreterCommandEntry("cdl_interface", &CdlInterfaceBody::parse_interface ), - CdlInterpreterCommandEntry("cdl_dialog", &CdlDialogBody::parse_dialog ), - CdlInterpreterCommandEntry("cdl_wizard", &CdlWizardBody::parse_wizard ), - CdlInterpreterCommandEntry("", 0 ), - }; - int i; - - // All parsing errors may result in an exception, under the control of - // application code. This exception must not pass through the Tcl interpreter. - try { - - for (i = 0; 0 != commands[i].command; i++) { - new_commands.push_back(commands[i]); - } - CdlBuildableBody::add_property_parsers(new_commands); - CdlDefinableBody::add_property_parsers(new_commands); - CdlParentableBody::add_property_parsers(new_commands); - CdlValuableBody::add_property_parsers(new_commands); - CdlUserVisibleBody::add_property_parsers(new_commands); - CdlNodeBody::add_property_parsers(new_commands); - - // Now evaluate the body. If an error occurs then typically - // this will be reported via CdlParse::report_error(), - // but any exceptions will have been intercepted and - // turned into a Tcl error. - old_commands = interp->push_commands(new_commands); - result = interp->eval(argv[2], tcl_result); - interp->pop_commands(old_commands); - - if (TCL_OK != result) { - // No point in taking any further action, just go with the flow - goto done2; - } - - // Even if there were errors, they were not fatal. There may - // now be a number of properties for this component, and some - // validation should take place. Start with the base classes. - new_component->CdlNodeBody::check_properties(interp); - new_component->CdlUserVisibleBody::check_properties(interp); - new_component->CdlValuableBody::check_properties(interp); - new_component->CdlParentableBody::check_properties(interp); - new_component->CdlBuildableBody::check_properties(interp); - new_component->CdlDefinableBody::check_properties(interp); - - // There should be at most one each of wizard and script. - if (new_component->count_properties(CdlPropertyId_Wizard) > 1) { - CdlParse::report_error(interp, "", "A component should have at most one `wizard' property."); - } - if (new_component->count_properties(CdlPropertyId_Script) > 1) { - CdlParse::report_error(interp, "", "A component should have at most one `script' property."); - } - - // If there is a script property, life gets more interesting. - if (new_component->has_property(CdlPropertyId_Script)) { - CdlProperty_String prop = dynamic_cast(new_component->get_property(CdlPropertyId_Script)); - CYG_PRECONDITION_CLASSC(prop); - std::string script_name = prop->get_string(); - - // Try to locate this script. - std::string script_filename = package->find_absolute_file(script_name, "cdl", false); - if ("" == script_filename) { - CdlParse::report_error(interp, "", "Unable to find script `" + script_name + "'."); - } else { - // The script exists, so we need to try and execute it. - // The current container is still set correctly, but we need - // to change the filename and install a different set - // of commands. - old_context = interp->push_context(script_filename); - new_commands.clear(); - for (i = 0; 0 != script_commands[i].command; i++) { - new_commands.push_back(script_commands[i]); - } - old_commands = interp->push_commands(new_commands); - result = interp->eval_file(script_filename, tcl_result); - interp->pop_commands(old_commands); - interp->pop_context(old_context); - } - } - - done2: - // Dummy command just to keep the compiler happy - old_context = ""; - - } catch (std::bad_alloc e) { - // Errors at this stage should be reported via Tcl, not via C++. - // However there is no point in continuing with the parsing operation, - // just give up. - interp->set_result(CdlParse::construct_diagnostic(interp, "internal error", "", "Out of memory")); - result = TCL_ERROR; - } catch (CdlParseException e) { - interp->set_result(e.get_message()); - result = TCL_ERROR; - } catch(...) { - interp->set_result(CdlParse::construct_diagnostic(interp, "internal error", "", "Unexpected C++ exception")); - result = TCL_ERROR; - } - - // Restore the interpreter to its prior state. - interp->pop_node(old_node); - interp->pop_container(old_container); - if (0 != old_commands) { - interp->pop_commands(old_commands); - } - - CYG_REPORT_RETVAL(result); - return result; -} - - -// ---------------------------------------------------------------------------- -// Syntax: script -int -CdlComponentBody::parse_script(CdlInterpreter interp, int argc, const char* argv[]) -{ - CYG_REPORT_FUNCNAMETYPE("parse_script", "result %d"); - - int result = CdlParse::parse_string_property(interp, argc, argv, CdlPropertyId_Script, 0, 0); - - CYG_REPORT_RETVAL(result); - return result; -} - -//}}} -//{{{ Propagation support - -// ---------------------------------------------------------------------------- -void -CdlComponentBody::update(CdlTransaction transaction, CdlUpdate update) -{ - CYG_REPORT_FUNCNAME("CdlComponent::update"); - - this->CdlValuableBody::update(transaction, update); - this->CdlContainerBody::update(transaction, update); - - CYG_REPORT_RETURN(); -} - -//}}} -//{{{ Persistence support - -// ---------------------------------------------------------------------------- -void -CdlComponentBody::initialize_savefile_support(CdlToplevel toplevel) -{ - CYG_REPORT_FUNCNAME("CdlComponent::initialize_savefile_support"); - - toplevel->add_savefile_command("cdl_component", 0, &savefile_component_command); - CdlValuableBody::initialize_savefile_support(toplevel, "cdl_component"); - - CYG_REPORT_RETURN(); -} - -void -CdlComponentBody::save(CdlInterpreter interp, Tcl_Channel chan, int indentation, bool minimal) -{ - CYG_REPORT_FUNCNAME("CdlComponent::save"); - CYG_REPORT_FUNCARG5XV(this, interp, chan, indentation, minimal); - CYG_PRECONDITION_THISC(); - CYG_PRECONDITION_CLASSC(interp); - - if (!minimal || this->has_additional_savefile_information() || this->value_savefile_entry_needed()) { - // Start with the UserVisible data, which will result in a suitable set - // of comments before the package definition itself. - this->CdlUserVisibleBody::save(interp, chan, indentation, minimal); - - // Now output the line "cdl_component {" - // The name is guaranteed to be a valid C preprocessor symbol, so it - // is not going to need any quoting. - std::string data = std::string(indentation, ' ') + "cdl_component " + get_name() + " {\n"; - interp->write_data(chan, data); - - // Deal with the value - bool modifiable = !(CdlValueFlavor_None == this->get_flavor()) && - !this->has_property(CdlPropertyId_Calculated); - this->CdlValuableBody::save(interp, chan, indentation + 4, modifiable, minimal); - - // And with any unrecognised data - this->CdlNodeBody::save(interp, chan, indentation + 4, minimal); - - // Close the cdl_component body. A blank line is added here. - interp->write_data(chan, "};\n\n"); - } - - // Packages are containers, so dump the contents as well. - this->CdlContainerBody::save(interp, chan, indentation, minimal); - - CYG_REPORT_RETURN(); -} - -int -CdlComponentBody::savefile_component_command(CdlInterpreter interp, int argc, const char* argv[]) -{ - CYG_REPORT_FUNCNAMETYPE("CdlComponent::savefile_component_command", "result %d"); - CYG_PRECONDITION_CLASSC(interp); - - int result = TCL_OK; - CdlToplevel toplevel = interp->get_toplevel(); - CYG_ASSERT_CLASSC(toplevel); - CdlConfiguration config = dynamic_cast(toplevel); - CYG_ASSERT_CLASSC(config); - - std::vector subcommands; - std::vector* toplevel_commands = 0; - CdlNode old_node = 0; - - try { - - if (3 != argc) { - CdlParse::report_error(interp, "", "Invalid cdl_component command in savefile, expecting two arguments."); - } else { - - CdlNode current_node = config->lookup(argv[1]); - if (0 == current_node) { - // FIXME: save value in limbo - CdlParse::report_error(interp, "", - std::string("The savefile contains a cdl_component command for an unknown component `") - + argv[1] + "'"); - } else { - config->get_savefile_subcommands("cdl_component", subcommands); - toplevel_commands = interp->push_commands(subcommands); - old_node = interp->push_node(current_node); - - std::string tcl_result; - result = interp->eval(argv[2], tcl_result); - - interp->pop_commands(toplevel_commands); - toplevel_commands = 0; - interp->pop_node(old_node); - old_node = 0; - } - } - } catch(...) { - if (0 != old_node) { - interp->pop_node(old_node); - } - if (0 != toplevel_commands) { - interp->pop_commands(toplevel_commands); - } - throw; - } - - CYG_REPORT_RETVAL(result); - return result; -} - -//}}} -//{{{ check_this() - -// ---------------------------------------------------------------------------- - -bool -CdlComponentBody::check_this(cyg_assert_class_zeal zeal) const -{ - if (CdlComponentBody_Magic != cdlcomponentbody_cookie) { - return false; - } - CYGDBG_MEMLEAK_CHECKTHIS(); - - return CdlNodeBody::check_this(zeal) && - CdlContainerBody::check_this(zeal) && - CdlUserVisibleBody::check_this(zeal) && - CdlParentableBody::check_this(zeal) && - CdlValuableBody::check_this(zeal) && - CdlBuildableBody::check_this(zeal) && - CdlDefinableBody::check_this(zeal); -} - -//}}} -//{{{ Misc - -// ---------------------------------------------------------------------------- - -std::string -CdlComponentBody::get_class_name() const -{ - CYG_REPORT_FUNCNAME("CdlComponent::get_class_name"); - CYG_PRECONDITION_THISC(); - CYG_REPORT_RETURN(); - return "component"; -} - -//}}} diff --git a/host/libcdl/config.cxx b/host/libcdl/config.cxx deleted file mode 100644 --- a/host/libcdl/config.cxx +++ /dev/null @@ -1,1864 +0,0 @@ -//{{{ Banner - -//============================================================================ -// -// config.cxx -// -// Implementation of the CdlConfiguration class -// -//============================================================================ -//####COPYRIGHTBEGIN#### -// -// ---------------------------------------------------------------------------- -// Copyright (C) 2002, 2003 Bart Veer -// Copyright (C) 1999, 2000 Red Hat, Inc. -// -// This file is part of the eCos host tools. -// -// This program is free software; you can redistribute it and/or modify it -// under the terms of the GNU General Public License as published by the Free -// Software Foundation; either version 2 of the License, or (at your option) -// any later version. -// -// This program is distributed in the hope that it will be useful, but WITHOUT -// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for -// more details. -// -// You should have received a copy of the GNU General Public License along with -// this program; if not, write to the Free Software Foundation, Inc., -// 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -// -// ---------------------------------------------------------------------------- -// -//####COPYRIGHTEND#### -//============================================================================ -//#####DESCRIPTIONBEGIN#### -// -// Author(s): bartv -// Contact(s): bartv -// Date: 1999/03/06 -// Version: 0.02 -// -//####DESCRIPTIONEND#### -//============================================================================ - -//}}} -//{{{ #include's - -// ---------------------------------------------------------------------------- -#include "cdlconfig.h" - -// Get the infrastructure types, assertions, tracing and similar -// facilities. -#include -#include - -// defines everything implemented in this module. -// It implicitly supplies , and because -// the class definitions rely on these headers. -#include - -//}}} - -//{{{ CdlConfiguration constants and statics - -// ---------------------------------------------------------------------------- -CYGDBG_DEFINE_MEMLEAK_COUNTER(CdlConfigurationBody); - -//}}} -//{{{ CdlConfiguration:: creation - -// ---------------------------------------------------------------------------- -// The toplevel class will take care of just about everything. - -CdlConfigurationBody::CdlConfigurationBody(std::string name, CdlPackagesDatabase db, CdlInterpreter interp) - : CdlNodeBody(name), - CdlToplevelBody(interp) -{ - CYG_REPORT_FUNCNAME("CdlConfiguration:: constructor"); - CYG_REPORT_FUNCARG1XV(this); - - current_hardware = ""; - current_template = ""; - database = db; - save_file = ""; - description = ""; - - cdlconfigurationbody_cookie = CdlConfigurationBody_Magic; - CYGDBG_MEMLEAK_CONSTRUCTOR(); - - CYG_POSTCONDITION_THISC(); - CYG_REPORT_RETURN(); -} - -// ---------------------------------------------------------------------------- -// The exported interface - -CdlConfiguration -CdlConfigurationBody::make(std::string name, CdlPackagesDatabase db, CdlInterpreter interp) -{ - CYG_REPORT_FUNCNAMETYPE("CdlConfiguration::make", "result %p"); - CYG_REPORT_FUNCARG2XV(db, interp); - CYG_PRECONDITIONC("" != name); - CYG_PRECONDITION_CLASSC(db); - CYG_PRECONDITION_CLASSC(interp); - - CdlConfiguration result = new CdlConfigurationBody(name, db, interp); - CYG_REPORT_RETVAL(result); - return result; -} - -//}}} -//{{{ CdlConfiguration:: destructor - -// ---------------------------------------------------------------------------- -CdlConfigurationBody::~CdlConfigurationBody() -{ - CYG_REPORT_FUNCNAME("CdlConfiguration:: default destructor"); - CYG_REPORT_FUNCARG1("this %p", this); - CYG_PRECONDITION_THISC(); - - // Removing all the packages has to happen here, and in the - // context of a transaction. The main reason is the extensive - // use of dynamic casts, after this destructor returns - // any dynamic casts for this configuration will fail. - // - // Arguably some of the unloads should happen by clearing - // the hardware and template (assuming those are currently - // set). In practice that would not really gain anything. - // - // Unloading the individual packages is a bit more expensive - // than it should be, since lots of care is taken to keep - // remaining packages consistent and then those get unloaded - // as well. However it is the safe approach. - CdlLocalTransaction transaction(this); - const std::vector& loadables = this->get_loadables(); - for (int i = loadables.size() - 1; i >= 0; i--) { - CdlPackage pkg = dynamic_cast(loadables[i]); - if (0 != pkg) { - this->unload_package(transaction.get(), pkg); - } - } - transaction.propagate(); - transaction.commit(); - - cdlconfigurationbody_cookie = CdlConfigurationBody_Invalid; - current_hardware = ""; - current_template = ""; - database = 0; - save_file = ""; - - CYGDBG_MEMLEAK_DESTRUCTOR(); - - CYG_REPORT_RETURN(); -} - -//}}} -//{{{ CdlConfiguration::check_this() - -// ---------------------------------------------------------------------------- -// There is very little information associated with a configuration. - -bool -CdlConfigurationBody::check_this(cyg_assert_class_zeal zeal) const -{ - if (CdlConfigurationBody_Magic != cdlconfigurationbody_cookie) { - return false; - } - CYGDBG_MEMLEAK_CHECKTHIS(); - - switch(zeal) { - case cyg_system_test : - case cyg_extreme : - if ((0 == database) || !database->check_this(cyg_quick)) { - return false; - } - case cyg_thorough : - if (("" != current_hardware) && !database->is_known_target(current_hardware)) { - return false; - } - if (("" != current_template) && !database->is_known_template(current_template)) { - return false; - } - case cyg_quick : - if (0 == database) { - return false; - } - case cyg_trivial : - case cyg_none : - default : - break; - } - - return CdlNodeBody::check_this(zeal) && CdlContainerBody::check_this(zeal) && CdlToplevelBody::check_this(zeal); -} - -//}}} -//{{{ CdlConfiguration:: basic info - -// ---------------------------------------------------------------------------- -// Provide ready access to configuration-specific data. - -CdlPackagesDatabase -CdlConfigurationBody::get_database() const -{ - CYG_REPORT_FUNCNAMETYPE("CdlConfiguration::get_database", "result %p"); - CYG_REPORT_FUNCARG1XV(this); - CYG_PRECONDITION_THISC(); - - CYG_REPORT_RETVAL(database); - return database; -} - -std::string -CdlConfigurationBody::get_hardware() const -{ - CYG_REPORT_FUNCNAME("CdlConfiguration::get_hardware"); - CYG_REPORT_FUNCARG1XV(this); - CYG_PRECONDITION_THISC(); - - CYG_REPORT_RETURN(); - return current_hardware; -} - -void -CdlConfigurationBody::set_hardware_name(std::string new_name) -{ - CYG_REPORT_FUNCNAME("CdlConfiguration::set_hardware_name"); - CYG_REPORT_FUNCARG1XV(this); - CYG_PRECONDITION_THISC(); - - current_hardware = new_name; - - CYG_REPORT_RETURN(); -} - -std::string -CdlConfigurationBody::get_template() const -{ - CYG_REPORT_FUNCNAME("CdlConfiguration::get_template"); - CYG_REPORT_FUNCARG1XV(this); - CYG_PRECONDITION_THISC(); - - CYG_REPORT_RETURN(); - return current_template; -} - -void -CdlConfigurationBody::set_template_name(std::string new_name) -{ - CYG_REPORT_FUNCNAME("CdlConfiguration::set_template_name"); - CYG_REPORT_FUNCARG1XV(this); - CYG_PRECONDITION_THISC(); - - current_template = new_name; - - CYG_REPORT_RETURN(); -} - -std::string -CdlConfigurationBody::get_save_file() const -{ - CYG_REPORT_FUNCNAME("CdlConfiguration::get_save_file"); - CYG_REPORT_FUNCARG1XV(this); - CYG_PRECONDITION_THISC(); - - CYG_REPORT_RETURN(); - return save_file; -} - -// ---------------------------------------------------------------------------- - -std::string -CdlConfigurationBody::get_class_name() const -{ - CYG_REPORT_FUNCNAME("CdlConfiguration::get_class_name"); - CYG_PRECONDITION_THISC(); - CYG_REPORT_RETURN(); - return "CdlConfiguration"; -} - -//}}} -//{{{ Load and unload operations - wrappers - -// ---------------------------------------------------------------------------- -// These members are basically wrappers for the functions that do the -// real work. They do things like running the real functions inside -// a newly created transaction. - -void -CdlConfigurationBody::load_package(std::string name, std::string version, - CdlDiagnosticFnPtr error_fn, CdlDiagnosticFnPtr warn_fn, bool limbo) -{ - CYG_REPORT_FUNCNAME("CdlConfiguration::load_package"); - CYG_REPORT_FUNCARG1XV(this); - CYG_PRECONDITION_THISC(); - - CdlLocalTransaction transaction(this); - this->load_package(transaction.get(), name, version, error_fn, warn_fn, limbo); - transaction.body(); - - CYG_REPORT_RETURN(); -} - -void -CdlConfigurationBody::unload_package(std::string name, bool limbo) -{ - CYG_REPORT_FUNCNAME("CdlConfiguration::unload_package"); - CYG_REPORT_FUNCARG1XV(this); - CYG_PRECONDITION_THISC(); - - CdlLocalTransaction transaction(this); - this->unload_package(transaction.get(), name, limbo); - transaction.body(); - - CYG_REPORT_RETURN(); -} - -void -CdlConfigurationBody::unload_package(CdlPackage package, bool limbo) -{ - CYG_REPORT_FUNCNAME("CdlConfiguration::unload_package"); - CYG_REPORT_FUNCARG1XV(this); - - CdlLocalTransaction transaction(this); - this->unload_package(transaction.get(), package, limbo); - transaction.body(); - - CYG_REPORT_RETURN(); -} - -void -CdlConfigurationBody::unload_package(CdlTransaction transaction, std::string name, bool limbo) -{ - CYG_REPORT_FUNCNAME("CdlConfiguration::unload_package"); - CYG_REPORT_FUNCARG3XV(this, transaction, limbo); - CYG_INVARIANT_THISC(CdlConfigurationBody); - CYG_PRECONDITION_CLASSC(transaction); - - CdlNode node = lookup(name); - CYG_ASSERTC(0 != node); - CdlPackage package = dynamic_cast(node); - CYG_ASSERTC(0 != package); - - this->unload_package(transaction, package, limbo); - - CYG_REPORT_RETURN(); -} - -void -CdlConfigurationBody::change_package_version(std::string name, std::string version, - CdlDiagnosticFnPtr error_fn, CdlDiagnosticFnPtr warn_fn, bool limbo) -{ - CYG_REPORT_FUNCNAME("CdlConfiguration::change_package_version"); - CYG_REPORT_FUNCARG1XV(this); - - CdlLocalTransaction transaction(this); - this->change_package_version(transaction.get(), name, version, error_fn, warn_fn, limbo); - transaction.body(); - - CYG_REPORT_RETURN(); -} - -void -CdlConfigurationBody::change_package_version(CdlPackage package, std::string version, - CdlDiagnosticFnPtr error_fn, CdlDiagnosticFnPtr warn_fn, bool limbo) -{ - CYG_REPORT_FUNCNAME("CdlConfiguration::change_package_version"); - CYG_REPORT_FUNCARG1XV(this); - - CdlLocalTransaction transaction(this); - this->change_package_version(transaction.get(), package, version, error_fn, warn_fn, limbo); - transaction.body(); - - CYG_REPORT_RETURN(); -} - -void -CdlConfigurationBody::change_package_version(CdlTransaction transaction, std::string name, std::string new_version, - CdlDiagnosticFnPtr error_fn, CdlDiagnosticFnPtr warn_fn, bool limbo) -{ - CYG_REPORT_FUNCNAME("CdlConfiguration::change_package_version"); - CYG_REPORT_FUNCARG2XV(this, transaction); - CYG_PRECONDITION_THISC(); - CYG_PRECONDITION_CLASSC(transaction); - CYG_PRECONDITIONC("" != name); - - CdlPackage package = 0; - CdlNode node = this->lookup(name); - if (0 != node) { - package = dynamic_cast(node); - } - // For now it is illegal to change the version of package that has - // not been loaded yet - if (0 == package) { - throw CdlInputOutputException(std::string("Cannot change version of \"") + name + "\" , this package is not loaded"); - } - CYG_ASSERT_CLASSC(package); - - this->change_package_version(transaction, package, new_version, error_fn, warn_fn, limbo); - - CYG_REPORT_RETURN(); -} - -void -CdlConfigurationBody::add(std::string filename, - CdlDiagnosticFnPtr error_fn, CdlDiagnosticFnPtr warn_fn) -{ - CYG_REPORT_FUNCNAME("CdlConfiguration::add"); - CYG_REPORT_FUNCARG1XV(this); - - CdlLocalTransaction transaction(this); - this->add(transaction.get(), filename, error_fn, warn_fn); - transaction.body(); - - CYG_REPORT_RETURN(); -} - -void -CdlConfigurationBody::set_template(std::string name, std::string version, - CdlDiagnosticFnPtr error_fn, CdlDiagnosticFnPtr warn_fn, bool limbo) -{ - CYG_REPORT_FUNCNAME("CdlConfiguration::set_template"); - CYG_REPORT_FUNCARG1XV(this); - - CdlLocalTransaction transaction(this); - this->set_template(transaction.get(), name, version, error_fn, warn_fn, limbo); - transaction.body(); - - CYG_REPORT_RETURN(); -} - -void -CdlConfigurationBody::set_template_file(std::string filename, - CdlDiagnosticFnPtr error_fn, CdlDiagnosticFnPtr warn_fn, bool limbo) -{ - CYG_REPORT_FUNCNAME("CdlConfiguration::set_template_file"); - CYG_REPORT_FUNCARG1XV(this); - - CdlLocalTransaction transaction(this); - this->set_template_file(transaction.get(), filename, error_fn, warn_fn, limbo); - transaction.body(); - - CYG_REPORT_RETURN(); -} - -void -CdlConfigurationBody::set_template(CdlTransaction transaction, std::string template_name, std::string version, - CdlDiagnosticFnPtr error_fn, CdlDiagnosticFnPtr warn_fn, bool limbo) -{ - CYG_REPORT_FUNCNAME("CdlConfiguration::set_template"); - CYG_REPORT_FUNCARG2XV(this, transaction); - - // Some consistency checks before doing anything damaging - if (!this->database->is_known_template(template_name)) { - throw CdlInputOutputException("Unknown template " + template_name); - } - std::string template_filename = this->database->get_template_filename(template_name, version); - if ("" == template_filename) { - if ("" == version) { - throw CdlInputOutputException("There is no template file corresponding to " + template_name); - } else { - throw CdlInputOutputException("There is no temmplate file corresponding to version " - + version + " of " + template_name); - } - } - - // Now use set_template_file() to do the hard work. - this->set_template_file(transaction, template_filename, error_fn, warn_fn, limbo); - current_template = template_name; - - CYG_REPORT_RETURN(); -} - -void -CdlConfigurationBody::unload_template(bool limbo) -{ - CYG_REPORT_FUNCNAME("CdlConfiguration::unload_template"); - CYG_REPORT_FUNCARG1XV(this); - - CdlLocalTransaction transaction(this); - this->unload_template(transaction.get(), limbo); - transaction.body(); - - CYG_REPORT_RETURN(); -} - -void -CdlConfigurationBody::set_hardware(std::string name, - CdlDiagnosticFnPtr error_fn, CdlDiagnosticFnPtr warn_fn, bool limbo) -{ - CYG_REPORT_FUNCNAME("CdlConfiguration::set_hardware"); - CYG_REPORT_FUNCARG1XV(this); - - CdlLocalTransaction transaction(this); - this->set_hardware(transaction.get(), name, error_fn, warn_fn, limbo); - transaction.body(); - - CYG_REPORT_RETURN(); -} - -void -CdlConfigurationBody::unload_hardware(bool limbo) -{ - CYG_REPORT_FUNCNAME("CdlConfiguration::unload_hardware"); - CYG_REPORT_FUNCARG1XV(this); - - CdlLocalTransaction transaction(this); - this->unload_hardware(transaction.get(), limbo); - transaction.body(); - - CYG_REPORT_RETURN(); -} - -//}}} -//{{{ Load and unload - transaction support - -// ---------------------------------------------------------------------------- -// A number of commit/cancel auxiliary classes are needed to allow the -// load/unload code to integrate properly with the transaction code. - -class CdlConfiguration_CommitCancelLoad : - public CdlTransactionCommitCancelOp -{ - friend class CdlTest; - - public: - - CdlConfiguration_CommitCancelLoad(CdlPackage package_arg) - : CdlTransactionCommitCancelOp() - { - CYG_ASSERT_CLASSC(package_arg); - package = package_arg; - } - ~CdlConfiguration_CommitCancelLoad() - { - package = 0; - } - void commit(CdlTransaction transaction) - { - CYG_ASSERT_CLASSC(package); - CdlLoadableBody::transaction_commit_load(transaction, package); - package = 0; - } - void cancel(CdlTransaction transaction) - { - CYG_ASSERT_CLASSC(package); - CdlLoadableBody::transaction_cancel_load(transaction, package); - package = 0; - } - - protected: - - private: - CdlConfiguration_CommitCancelLoad() - { - } - CdlPackage package; -}; - -class CdlConfiguration_CommitCancelUnload : - public CdlTransactionCommitCancelOp -{ - friend class CdlTest; - - public: - CdlConfiguration_CommitCancelUnload(CdlPackage package_arg) - : CdlTransactionCommitCancelOp() - { - CYG_ASSERT_CLASSC(package_arg); - package = package_arg; - } - ~CdlConfiguration_CommitCancelUnload() - { - package = 0; - } - void commit(CdlTransaction transaction) - { - CYG_PRECONDITION_CLASSC(package); - CdlLoadableBody::transaction_commit_unload(transaction, package); - package = 0; - } - void cancel(CdlTransaction transaction) - { - CYG_PRECONDITION_CLASSC(package); - CdlLoadableBody::transaction_cancel_unload(transaction, package); - package = 0; - } - - protected: - - private: - CdlConfiguration_CommitCancelUnload() - { - } - CdlPackage package; -}; - -// These utility classes can be used to control the hardware and -// template names. If the transaction is cancelled the previous -// name gets re-installed -class CdlConfiguration_CommitCancelHardwareName : - public CdlTransactionCommitCancelOp -{ - friend class CdlTest; - - public: - CdlConfiguration_CommitCancelHardwareName(std::string old_name_arg) - : CdlTransactionCommitCancelOp() - { - old_name = old_name_arg; - } - ~CdlConfiguration_CommitCancelHardwareName() - { - old_name = ""; - } - void commit(CdlTransaction transaction) - { - // The new name is already installed, nothing more needs to happen. - CYG_UNUSED_PARAM(CdlTransaction, transaction); - } - void cancel(CdlTransaction transaction) - { - // Restore the old name - CdlToplevel toplevel = transaction->get_toplevel(); - CYG_ASSERTC(0 != toplevel); - CdlConfiguration configuration = dynamic_cast(toplevel); - CYG_ASSERT_CLASSC(configuration); - - configuration->set_hardware_name(old_name); - CYG_UNUSED_PARAM(CdlTransaction, transaction); - } - - protected: - - private: - CdlConfiguration_CommitCancelHardwareName() - { - } - std::string old_name; -}; - -class CdlConfiguration_CommitCancelTemplateName : - public CdlTransactionCommitCancelOp -{ - friend class CdlTest; - - public: - CdlConfiguration_CommitCancelTemplateName(std::string old_name_arg) - : CdlTransactionCommitCancelOp() - { - old_name = old_name_arg; - } - ~CdlConfiguration_CommitCancelTemplateName() - { - old_name = ""; - } - void commit(CdlTransaction transaction) - { - // The new name is already installed, nothing more needs to happen. - CYG_UNUSED_PARAM(CdlTransaction, transaction); - } - void cancel(CdlTransaction transaction) - { - // Restore the old name - CdlToplevel toplevel = transaction->get_toplevel(); - CYG_ASSERTC(0 != toplevel); - CdlConfiguration configuration = dynamic_cast(toplevel); - CYG_ASSERT_CLASSC(configuration); - - configuration->set_template_name(old_name); - CYG_UNUSED_PARAM(CdlTransaction, transaction); - } - - protected: - - private: - CdlConfiguration_CommitCancelTemplateName() - { - } - std::string old_name; -}; - -//}}} -//{{{ CdlConfiguration::load_package() - -// ---------------------------------------------------------------------------- -// Loading a package into the current level. This involves the following -// stages. -// -// 1) check that the specified package name and version is valid, by -// comparing it with the database. When the database was created there -// will have been checks to make sure that the initial CDL script was -// present, but more checks can be done here. -// -// 2) before allocating any resources, check that there is no name conflict -// for the package itself. -// -// 3) create the package object, and add it to the toplevel of the current -// configuration. It may get reparented later on. Part of the creation -// process is to allocate a new slave interpreter, which can be updated -// with various bits of information. -// -// 4) evaluate the toplevel script. Subsidiary component scripts will -// get evaluated as a side effect. The various nodes will be added -// to the hierarchy as they are created, but no property binding -// happens yet. -// -// Any failure up to this point should result in the entire package -// being removed from the hierarchy and then destroyed, thus leaving -// the configuration in its original state. -// -// 5) now property binding needs to take place. This can have lots -// of side effects, e.g. default values may get calculated, the -// hierarchy may change because of parent properties, etc. -// The work is done inside CdlLoadable::bind() which will undo -// everything on failure - although bad_alloc is the only -// failure that should occur. -// -// 6) load operations can get cancelled, so a suitable commit/cancel -// operation needs to allocated and added to the transaction. -// -// 7) if limbo is enabled, previous values should be extracted from -// limbo if at all possible. In addition the package's value can -// be set to its version. - -void -CdlConfigurationBody::load_package(CdlTransaction transaction, std::string name, std::string version, - CdlDiagnosticFnPtr error_fn, CdlDiagnosticFnPtr warn_fn, bool limbo) -{ - CYG_REPORT_FUNCNAME("CdlConfiguration::load_package"); - CYG_REPORT_FUNCARG1XV(this); - CYG_PRECONDITION_THISC(); - CYG_PRECONDITION_CLASSC(transaction); - CYG_PRECONDITIONC("" != name); - - // Locate the database entry. Also check the version (filling it in if necessary). - // Get hold of the package directory and the initial script. - if (!database->is_known_package(name)) { - throw CdlInputOutputException("Unknown package " + name); - } - const std::vector& versions = database->get_package_versions(name); - if ("" == version) { - version = *(versions.begin()); - } else { - if (std::find(versions.begin(), versions.end(), version) == versions.end()) { - throw CdlInputOutputException("Package " + name + " does not have an installed version `" + version + "'."); - } - } - std::string repository = database->get_package_repository(name, version); - std::string directory = database->get_package_directory(name); - std::string script = database->get_package_script(name); - CYG_ASSERTC(("" != directory) && ("" != script)); - - // Check that the directory actually exists. For this the configuration's own - // interpreter can be used. - CdlInterpreter interp = get_interpreter(); - CYG_ASSERT_CLASSC(interp); - - std::string tcl_cmd = "regsub -all -- {\\\\} [file join " + directory + " " + version + "] / result; return $result"; - std::string tcl_result; - if (TCL_OK != interp->eval(tcl_cmd, tcl_result)) { - throw CdlInputOutputException("Cannot load package `" + name + "', internal error constructing pathname."); - } - directory = tcl_result; - - tcl_cmd = "file isdirectory [file join \"" + repository + "\" " + directory + "]"; - if ((TCL_OK != interp->eval(tcl_cmd, tcl_result)) || ("1" != tcl_result)) { - throw CdlInputOutputException("Cannot load package `" + name + "', there is no directory `" + directory + "'."); - } - - // Make sure that there is no name conflict. No resources have been allocated - // yet, so this is a good time. - CdlNode node = lookup(name); - if (0 != node) { - if (0 != dynamic_cast(node)) { - throw CdlInputOutputException("Package `" + name + "' is already loaded."); - } else { - - std::string msg = "Name clash for package `" + name + "',there is a `" + - node->get_class_name() + " " + name + "' already loaded"; - CdlLoadable owner_pkg = node->get_owner(); - if (0 != owner_pkg) { - msg += " in package " + owner_pkg->get_name(); - } - throw CdlInputOutputException(msg); - } - } - - // Now create the package object itself. - CdlPackage package = 0; - bool bound = false; - CdlConfiguration_CommitCancelLoad* load_op = 0; - - try { - package = new CdlPackageBody(name, this, repository, directory); - - // The package should be added to the hierarchy immediately. - // All nodes will get added to the hierarchy as they are - // created, an operation that has to be undone during - // failure. - this->add_node(package, this, package); - - // Load the package data. The various nodes will all end up - // in a hierarchy below the package, but without any checks - // for name conflicts etc and ignoring any re-parenting. - CdlInterpreter interp = package->get_interpreter(); - CYG_ASSERT_CLASSC(interp); - - interp->add_command("unknown", &CdlParse::unknown_command); - CdlInterpreterBody::DiagSupport diag_support(interp, error_fn, warn_fn); - - // Next figure out the script name, and make sure that it exists. - std::string actual_script = package->find_absolute_file(script, "cdl"); - if ("" == actual_script) { - throw CdlInputOutputException("Package " + name + ", unable to find initial script " + script); - } - tcl_cmd = "file isfile \"" + actual_script + "\""; - if ((TCL_OK != interp->eval(tcl_cmd, tcl_result)) || ("1" != tcl_result)) { - throw CdlInputOutputException("Package " + name + ", " + actual_script + " is not a CDL script"); - } - - // The script is valid. Set up the interpreter appropriately. - CdlParse::clear_error_count(interp); - static CdlInterpreterCommandEntry commands[] = - { - CdlInterpreterCommandEntry("cdl_package", &CdlPackageBody::parse_package ), - CdlInterpreterCommandEntry("cdl_component", &CdlComponentBody::parse_component ), - CdlInterpreterCommandEntry("cdl_option", &CdlOptionBody::parse_option ), - CdlInterpreterCommandEntry("cdl_interface", &CdlInterfaceBody::parse_interface ), - CdlInterpreterCommandEntry("cdl_dialog", &CdlDialogBody::parse_dialog ), - CdlInterpreterCommandEntry("cdl_wizard", &CdlWizardBody::parse_wizard ), - CdlInterpreterCommandEntry("", 0 ) - }; - CdlInterpreterBody::CommandSupport interp_cmds(interp, commands); - CdlInterpreterBody::ContainerSupport interp_container(interp, package); - CdlInterpreterBody::ContextSupport interp_context(interp, actual_script); - - // The interpreter is now ready. - (void) interp->eval_file(actual_script); - - // Clean out the commands etc. This interpreter may get used again - // in future, and it should not be possible to define new options - // etc. in that invocation. - interp->remove_command("unknown"); - - // All the data has been read in without generating an - // exception. However there may have been errors reported via - // the parse_error_fn, and any errors at all should result - // in an exception. - int error_count = CdlParse::get_error_count(interp); - if (error_count > 0) { - std::string tmp; - Cdl::integer_to_string(error_count, tmp); - throw CdlParseException("Package " + name + ", " + tmp + " error" + - ((error_count > 1) ? "s" : "") + - " occurred while reading in the CDL data."); - } - - // All the data has been read in, implying that there are no - // fatal problems with the data. Now try to bind all - // references to and from this loadable. - package->bind(transaction); - bound = true; - - // Finally, create a suitable transaction commit/cancel object - // and add it to the transaction. - load_op = new CdlConfiguration_CommitCancelLoad(package); - transaction->add_commit_cancel_op(load_op); - - } catch (...) { - - // Something went wrong during the create or load. It is necessary - // to delete the package. Undo all the operations above, in - // reverse order. The add_commit_cancel_op() was the last step, - // so need not be undone here. - if (0 != load_op) { - delete load_op; - } - - if (0 != package) { - // Note: no attempt is made to recover from errors here - if (bound) { - package->unbind(transaction); - } - this->remove_loadable_from_toplevel(package); - delete package; - } - throw; - } - - // FIXME: implement limbo support - - // We also have a sensible value for the package as a whole. - // Use this value for both default and user - after all the - // user has selected the package. - package->enable_and_set_value(transaction, version, CdlValueSource_Default); - package->enable_and_set_value(transaction, version, CdlValueSource_User); - - CYG_REPORT_RETURN(); -} - -//}}} -//{{{ CdlConfiguration::unload_package() - -// ---------------------------------------------------------------------------- -// Unloading a package is very simple. If requested, save all current -// values to limbo: there is no point in saving default values, these -// will get recalculated from the default_value property anyway; -// inferred values should be saved, there is no guarantee that the exact -// same value will be calculated again, and if the inferred value is no -// longer correct then the inference engine can freely update it. -// -// Next, unbind the package and remove it from the hierarchy. These -// operations are reversible if the transaction gets cancelled. -// A suitable transaction commit/cancel object is created and -// added to the transaction. -void -CdlConfigurationBody::unload_package(CdlTransaction transaction, CdlPackage package, bool limbo) -{ - CYG_REPORT_FUNCNAME("CdlConfiguration::unload_package"); - CYG_REPORT_FUNCARG4XV(this, transaction, package, limbo); - CYG_INVARIANT_THISC(CdlConfigurationBody); - CYG_INVARIANT_CLASSC(CdlTransactionBody, transaction); - CYG_PRECONDITION_CLASSC(package); - - if (limbo) { - const std::vector& pkg_contents = package->get_owned(); - std::vector::const_iterator node_i; - - for (node_i = pkg_contents.begin(); node_i != pkg_contents.end(); node_i++) { - CdlValuable valuable = dynamic_cast(*node_i); - if (0 != valuable) { - if (valuable->has_source(CdlValueSource_Inferred) || - valuable->has_source(CdlValueSource_Wizard) || - valuable->has_source(CdlValueSource_User)) { - - set_limbo_value(valuable); - } - } - } - } - - bool unbound = false; - bool removed = false; - CdlConfiguration_CommitCancelUnload* unload_op = 0; - try { - - package->unbind(transaction); - unbound = true; - this->remove_loadable_from_toplevel(package); - removed = true; - unload_op = new CdlConfiguration_CommitCancelUnload(package); - transaction->add_commit_cancel_op(unload_op); - - } catch(...) { - if (0 != unload_op) { - delete unload_op; - } - if (removed) { - this->add_loadable_to_toplevel(package); - } - if (unbound) { - package->bind(transaction); - } - throw; - } - - CYG_REPORT_RETURN(); -} - -//}}} -//{{{ CdlConfiguration::change_package_version() - -// ---------------------------------------------------------------------------- -// Changing a package version is just a case of unloading the old version -// and then loading in the new version. Because this all happens in the -// context of a transaction it is possible to undo the unload on -// failure, and the whole transaction can be cancelled at a higher level. - -void -CdlConfigurationBody::change_package_version(CdlTransaction transaction, CdlPackage package, std::string new_version, - CdlDiagnosticFnPtr error_fn, CdlDiagnosticFnPtr warn_fn, bool limbo) -{ - CYG_REPORT_FUNCNAME("CdlConfiguration::change_package_version"); - CYG_REPORT_FUNCARG3XV(this, transaction, package); - CYG_PRECONDITION_THISC(); - CYG_INVARIANT_CLASSC(CdlTransactionBody, transaction); - CYG_PRECONDITION_CLASSC(package); - // "" is valid for the version, it indicates the default - - // Since the package is already loaded it must be in the database, - // but it is possible that the desired version does not exist. - std::string name = package->get_name(); - const std::vector& pkg_versions = database->get_package_versions(name); - if ("" == new_version) { - new_version = *(pkg_versions.begin()); - } else if (std::find(pkg_versions.begin(), pkg_versions.end(), new_version) == pkg_versions.end()) { - throw CdlInputOutputException("Version " + new_version + " of package " + name + " is not installed."); - } - - bool unloaded = false; - try { - this->unload_package(transaction, package, limbo); - unloaded = true; - this->load_package(transaction, name, new_version, error_fn, warn_fn, limbo); - } catch(...) { - if (unloaded) { - // There should be a commit/cancel op for the unload package step. - // This can be undone. - CdlTransactionCommitCancelOp* unload_op = transaction->get_last_commit_cancel_op(); - CYG_ASSERTC(0 != unload_op); - CYG_ASSERTC(0 != dynamic_cast(unload_op)); - transaction->cancel_last_commit_cancel_op(); - CYG_UNUSED_PARAM(CdlTransactionCommitCancelOp*, unload_op); - } - throw; - } - - CYG_REPORT_RETURN(); -} - -//}}} -//{{{ CdlConfiguration::set_hardware() etc. - -// ---------------------------------------------------------------------------- -// Setting the hardware involves unloading the old hardware, if any, and -// then loading in the new one. Obviously this should only happen if -// the new hardware name is valid. It would be possible to optimise for -// the case where the old and new hardware are the same, subject -// to dynamic database reload support. - -void -CdlConfigurationBody::set_hardware(CdlTransaction transaction, std::string target_name, - CdlDiagnosticFnPtr error_fn, CdlDiagnosticFnPtr warn_fn, bool limbo) -{ - CYG_REPORT_FUNCNAME("CdlConfiguration::set_hardware"); - CYG_REPORT_FUNCARG2XV(this, transaction); - CYG_PRECONDITION_THISC(); - CYG_PRECONDITION_CLASSC(transaction); - - // Minimal consistency check before attempting anything complicated. - if (!database->is_known_target(target_name)) { - throw CdlInputOutputException("Unknown target " + target_name); - } - - CdlInterpreter interp = this->get_interpreter(); - CdlInterpreterBody::DiagSupport diag_support(interp, error_fn, warn_fn); - CdlInterpreterBody::ContextSupport context_support(interp, "Hardware selection"); - - CdlConfiguration_CommitCancelHardwareName* rename_op = new CdlConfiguration_CommitCancelHardwareName(current_hardware); - try { - transaction->add_commit_cancel_op(rename_op); - const std::vector& loadables = this->get_loadables(); - int i; - for (i = (int) loadables.size() - 1; i >= 0; i--) { - CdlPackage package = dynamic_cast(loadables[i]); - if ((0 != package) && package->belongs_to_hardware()) { - this->unload_package(transaction, package, limbo); - } - } - current_hardware = ""; - - if ("" != target_name) { - - const std::vector& packages = database->get_target_packages(target_name); - std::vector::const_iterator name_i; - for (name_i = packages.begin(); name_i != packages.end(); name_i++) { - // Target specifications may refer to packages that are not - // installed. This is useful in e.g. an anoncvs environment. - if (database->is_known_package(*name_i)) { - // It is possible for a hardware package to have been - // loaded separately, in which case there is no point in - // loading it again. - if (0 == this->lookup(*name_i)) { - this->load_package(transaction, *name_i, "", - error_fn, warn_fn, limbo); - CdlPackage package = dynamic_cast(this->lookup(*name_i)); - CYG_LOOP_INVARIANT_CLASSC(package); - package->loaded_for_hardware = true; - } - } else { - CdlParse::report_warning(interp, "", - std::string("The target specification lists a package `") + *name_i + - "' which is not present in the component repository."); - } - } - } - current_hardware = target_name; - - } catch(...) { - // Cancel all operations up to and including the rename_op - CdlTransactionCommitCancelOp* cancel_op = 0; - do { - cancel_op = transaction->get_last_commit_cancel_op(); - CYG_LOOP_INVARIANTC(0 != cancel_op); - transaction->cancel_last_commit_cancel_op(); - } while(cancel_op != rename_op); - throw; - } - - // There may have been enables/disables and value data for that target - // FIXME: any problems get ignored quietly. There should at least - // be some warnings. - if ("" != target_name) { - const std::vector& enables = database->get_target_enables(target_name); - const std::vector& disables = database->get_target_disables(target_name); - const std::vector >& set_values = database->get_target_set_values(target_name); - - if ((0 != enables.size()) || (0 != disables.size()) || (0 != set_values.size())) { - std::vector::const_iterator opt_i; - CdlNode node; - CdlValuable valuable; - CdlValueFlavor flavor; - - for (opt_i = enables.begin(); opt_i != enables.end(); opt_i++) { - valuable = 0; - node = this->lookup(*opt_i); - if (0 != node) { - valuable = dynamic_cast(node); - if (0 != valuable) { - } - } - if (0 != valuable) { - flavor = valuable->get_flavor(); - if ((CdlValueFlavor_Bool == flavor) || (CdlValueFlavor_BoolData == flavor)) { - valuable->enable(transaction, CdlValueSource_User); - } else { - CdlParse::report_warning(interp, std::string("target `") + target_name + "'", - std::string("The option `") + *opt_i + - "' is supposed to be enabled for this target.\n" + - "However the option does not have a bool or booldata flavors."); - } - } else { - CdlParse::report_warning(interp, std::string("target `") + target_name + "'", - std::string("The option `") + *opt_i + - "' is supposed to be enabled for this target.\n" + - "However this option is not in the current configuration."); - } - } - for (opt_i = disables.begin(); opt_i != disables.end(); opt_i++) { - valuable = 0; - node = this->lookup(*opt_i); - if (0 != node) { - valuable = dynamic_cast(node); - } - if (0 != valuable) { - flavor = valuable->get_flavor(); - if ((CdlValueFlavor_Bool == flavor) || (CdlValueFlavor_BoolData == flavor)) { - valuable->disable(transaction, CdlValueSource_User); - } else { - CdlParse::report_warning(interp, std::string("target `") + target_name + "'", - std::string("The option `") + *opt_i + - "' is supposed to be disabled for this target.\n" + - "However the option does not have a bool or booldata flavors."); - } - } else { - CdlParse::report_warning(interp, std::string("target `") + target_name + "'", - std::string("The option `") + *opt_i + - "' is supposed to be disabled for this target.\n" + - "However this option is not in the current configuration."); - } - } - std::vector >::const_iterator value_i; - for (value_i = set_values.begin(); value_i != set_values.end(); value_i++) { - valuable = 0; - node = this->lookup(value_i->first); - if (0 != node) { - valuable = dynamic_cast(node); - } - if (0 != valuable) { - flavor = valuable->get_flavor(); - if ((CdlValueFlavor_BoolData == flavor) || (CdlValueFlavor_Data == flavor)) { - valuable->set_value(transaction, value_i->second, CdlValueSource_User); - } else { - CdlParse::report_warning(interp, std::string("target `") + target_name + "'", - std::string("The option `") + *opt_i + - "' is supposed to be given the value `" + value_i->second + - "' for this target.\n" + - "However the option does not have a data or booldata flavor."); - } - } else { - CdlParse::report_warning(interp, std::string("target `") + target_name + "'", - std::string("The option `") + *opt_i + - "' is supposed to be given the value `" + value_i->second + - "' for this target.\n" + - "However this option is not in the current configuration."); - } - } - } - } - - CYG_REPORT_RETURN(); -} - -void -CdlConfigurationBody::unload_hardware(CdlTransaction transaction, bool limbo) -{ - CYG_REPORT_FUNCNAME("CdlConfiguration::unload_hardware"); - CYG_REPORT_FUNCARG3XV(this, transaction, limbo); - CYG_PRECONDITION_THISC(); - - CdlConfiguration_CommitCancelHardwareName* rename_op = new CdlConfiguration_CommitCancelHardwareName(current_hardware); - try { - transaction->add_commit_cancel_op(rename_op); - } catch(...) { - delete rename_op; - throw; - } - current_hardware = ""; - - try { - const std::vector& loadables = this->get_loadables(); - for (int i = (int) loadables.size() - 1; i >= 0; i--) { - CdlPackage package = dynamic_cast(loadables[i]); - if ((0 != package) && package->belongs_to_hardware()) { - this->unload_package(transaction, package, limbo); - } - } - } catch(...) { - CdlTransactionCommitCancelOp* cancel_op = 0; - do { - cancel_op = transaction->get_last_commit_cancel_op(); - CYG_LOOP_INVARIANTC(0 != cancel_op); - transaction->cancel_last_commit_cancel_op(); - } while(cancel_op != rename_op); - throw; - } - - CYG_REPORT_RETURN(); -} - -//}}} -//{{{ CdlConfiguration::set_template() etc - -// ---------------------------------------------------------------------------- -void -CdlConfigurationBody::set_template_file(CdlTransaction transaction, std::string filename, - CdlDiagnosticFnPtr error_fn, CdlDiagnosticFnPtr warn_fn, bool limbo) -{ - CYG_REPORT_FUNCNAME("CdlConfiguration::set_template_file"); - CYG_REPORT_FUNCARG3XV(this, transaction, limbo); - CYG_PRECONDITION_THISC(); - - int i; - CdlConfiguration_CommitCancelTemplateName* rename_op = new CdlConfiguration_CommitCancelTemplateName(current_template); - - // The hard work is done by add(), which loads in a partial savefile. - // This can have undesirable side effects: changing the name, - // description, or hardware settings. It must be possible to undo - // these. - std::string saved_name = this->get_name(); - std::string saved_description = this->get_description(); - std::string saved_hardware = this->get_hardware(); - - // New packages will end up at the end of the loadables vector. - // Each new package needs to be registered as a template one. - // NOTE: this may break if we start doing more interesting things - // with savefiles. - - try { - transaction->add_commit_cancel_op(rename_op); - const std::vector& loadables = this->get_loadables(); - unsigned int load_i; - for (i = (int) loadables.size() - 1; i >= 0; i--) { - CdlPackage package = dynamic_cast(loadables[i]); - if ((0 != package) && package->belongs_to_template()) { - this->unload_package(transaction, package, limbo); - } - } - current_template = ""; - load_i = loadables.size(); - - this->add(transaction, filename, error_fn, warn_fn); - this->current_template = filename; - this->set_name(saved_name); - this->description = saved_description; - this->current_hardware = saved_hardware; - - for ( ; load_i < loadables.size(); load_i++) { - CdlPackage pkg = dynamic_cast(loadables[load_i]); - CYG_ASSERT_CLASSC(pkg); - pkg->loaded_for_template = true; - } - - } catch(...) { - - this->set_name(saved_name); - this->description = saved_description; - this->current_hardware = saved_hardware; - - // Cancel all operations up to and including the rename_op - CdlTransactionCommitCancelOp* cancel_op = 0; - do { - cancel_op = transaction->get_last_commit_cancel_op(); - CYG_LOOP_INVARIANTC(0 != cancel_op); - transaction->cancel_last_commit_cancel_op(); - } while(cancel_op != rename_op); - throw; - } - - - CYG_REPORT_RETURN(); -} - -void -CdlConfigurationBody::unload_template(CdlTransaction transaction, bool limbo) -{ - CYG_REPORT_FUNCNAME("CdlConfiguration::unload_template"); - CYG_REPORT_FUNCARG2XV(this, transaction); - CYG_PRECONDITION_THISC(); - CYG_PRECONDITION_CLASSC(transaction); - - CdlConfiguration_CommitCancelTemplateName* rename_op = new CdlConfiguration_CommitCancelTemplateName(current_template); - try { - transaction->add_commit_cancel_op(rename_op); - } catch(...) { - delete rename_op; - throw; - } - current_template = ""; - - try { - const std::vector& loadables = this->get_loadables(); - for (int i = (int) loadables.size() - 1; i >= 0; i--) { - CdlPackage package = dynamic_cast(loadables[i]); - if ((0 != package) && package->belongs_to_template()) { - this->unload_package(transaction, package, limbo); - } - } - } catch(...) { - CdlTransactionCommitCancelOp* cancel_op = 0; - do { - cancel_op = transaction->get_last_commit_cancel_op(); - CYG_LOOP_INVARIANTC(0 != cancel_op); - transaction->cancel_last_commit_cancel_op(); - } while(cancel_op != rename_op); - throw; - } - - CYG_REPORT_RETURN(); -} - -//}}} -//{{{ Persistence support - -//{{{ initialize_savefile_support() - -// ---------------------------------------------------------------------------- -// Initialization. The purpose of this code is to determine all the -// commands that can end up in a particular savefile. This includes -// the cdl_configuration command, commands relevant to packages, -// options, and components, the generic library commands, and -// application-specific commands. -// -// This is a virtual function, it may get invoked indirectly from -// e.g. CdlToplevel::add_savefile_command(). - -void -CdlConfigurationBody::initialize_savefile_support() -{ - CYG_REPORT_FUNCNAME("CdlConfiguration::initialize_savefile_support"); - CYG_REPORT_FUNCARG1XV(this); - CYG_PRECONDITION_THISC(); - - // Start with the generic stuff such as cdl_savefile_version and - // cdl_command. - this->CdlToplevelBody::initialize_savefile_support(); - - // Now add in the cdl_configuration command and its subcommands. - this->add_savefile_command("cdl_configuration", 0, &savefile_configuration_command); - this->add_savefile_subcommand("cdl_configuration", "description", 0, &savefile_description_command); - this->add_savefile_subcommand("cdl_configuration", "hardware", 0, &savefile_hardware_command); - this->add_savefile_subcommand("cdl_configuration", "template", 0, &savefile_template_command); - this->add_savefile_subcommand("cdl_configuration", "package", 0, &savefile_package_command); - - CdlPackageBody::initialize_savefile_support(this); - CdlComponentBody::initialize_savefile_support(this); - CdlOptionBody::initialize_savefile_support(this); - CdlInterfaceBody::initialize_savefile_support(this); -} - -//}}} -//{{{ CdlConfiguration::save() - internal - -// ---------------------------------------------------------------------------- -// The exported interface is CdlConfiguration::save(). This takes a single -// argument, a filename. It opens the file, and then invokes various -// functions that output the relevants bits of the file. -// -// This member function is responsible for outputting a cdl_configuration -// command. - -void -CdlConfigurationBody::save(CdlInterpreter interp, Tcl_Channel chan, int indentation, bool minimal) -{ - CYG_REPORT_FUNCNAME("CdlConfiguration::save"); - CYG_REPORT_FUNCARG5XV(this, interp, chan, indentation, minimal); - CYG_PRECONDITION_THISC(); - CYG_PRECONDITION_CLASSC(interp); - CYG_PRECONDITIONC(0 == indentation); - - std::string text = ""; - if (!minimal) { - text = -"# This section defines the toplevel configuration object. The only\n\ -# values that can be changed are the name of the configuration and\n\ -# the description field. It is not possible to modify the target,\n\ -# the template or the set of packages simply by editing the lines\n\ -# below because these changes have wide-ranging effects. Instead\n\ -# the appropriate tools should be used to make such modifications.\n\ -\n"; - } - - text += "cdl_configuration " + CdlInterpreterBody::quote(this->get_name()) + " {\n"; - - std::string config_data = this->get_description(); - if (!minimal || ("" != text)) { - text += " description " + CdlInterpreterBody::quote(config_data) + " ;\n"; - } - - // Repeat the warning. - if (!minimal) { - text += "\n # These fields should not be modified.\n"; - } - config_data = this->get_hardware(); - if ("" != config_data) { - text += " hardware " + CdlInterpreterBody::quote(config_data) + " ;\n"; - } - config_data = this->get_template(); - if ("" != config_data) { - text += " template " + CdlInterpreterBody::quote(config_data) + " ;\n"; - } - std::vector::const_iterator load_i; - const std::vector& packages = get_loadables(); - for (load_i = packages.begin(); load_i != packages.end(); load_i++) { - CdlPackage pkg = dynamic_cast(*load_i); - CYG_ASSERT_CLASSC(pkg); - text += " package "; - if (pkg->belongs_to_template()) { - text += "-template "; - } - if (pkg->belongs_to_hardware()) { - text += "-hardware "; - } - text += CdlInterpreterBody::quote(pkg->get_name()) + " " + CdlInterpreterBody::quote(pkg->get_value()) + " ;\n"; - } - - interp->write_data(chan, text); - - // If the package was loaded from a file then there may be additional - // data associated with the configuration that is not currently - // recognised. This call preserves that data. - this->CdlNodeBody::save(interp, chan, indentation + 4, minimal); - - interp->write_data(chan, "};\n\n"); - - CYG_REPORT_RETURN(); -} - -//}}} -//{{{ CdlConfiguration::save() - exported interface - -// ---------------------------------------------------------------------------- -// This is the exported interface for saving a configuration. The specified -// file is opened via the appropriate Tcl library routines, and then the -// relevant member functions are invoked to output the actual configuration -// date. - -void -CdlConfigurationBody::save(std::string filename, bool minimal) -{ - CYG_REPORT_FUNCNAME("CdlConfiguration::save"); - CYG_REPORT_FUNCARG2XV(this, minimal); - CYG_PRECONDITION_THISC(); - CYG_PRECONDITIONC("" != filename); - - // Make sure that the savefile support is properly initialized. - // This happens during the first save or load operation, or when - // the application starts to register its own savefile extensions. - if (!CdlToplevelBody::savefile_support_initialized()) { - this->initialize_savefile_support(); - } - - // A Tcl interpreter is needed for the call to OpenFileChannel(), - // and will also be passed to the individual save functions. - CdlInterpreter interp = this->get_interpreter(); - CYG_ASSERT_CLASSC(interp); - - // Do not worry about forward vs. backward slashes, since the filename - // is not manipulated in any way. Instead just pass it to Tcl. - Tcl_Channel chan = Tcl_OpenFileChannel(interp->get_tcl_interpreter(), const_cast(filename.c_str()), "w", 0666); - if (0 == chan) { - throw CdlInputOutputException("Unable to open file " + filename + "\n" + interp->get_result()); - } - - // The channel may end up being registered in various different - // interpreters, so Tcl_Close() is not the right way to close down - // the channel. Instead Tcl_RegisterChannel() should be used here - // to provide reference counting semantics. - Tcl_RegisterChannel(0, chan); - - // A try/catch body is needed here to make sure that the file gets - // properly cleaned up. - std::string tmp; - try { - - if (!minimal) { - interp->write_data(chan, "# eCos saved configuration\n\n"); - } - - CdlToplevelBody::save_separator(interp, chan, "commands", minimal); - this->CdlToplevelBody::save_command_details(interp, chan, 0, minimal); - CdlToplevelBody::save_separator(interp, chan, "toplevel", minimal); - this->save(interp, chan, 0, minimal); - CdlToplevelBody::save_separator(interp, chan, "conflicts", minimal); - this->CdlToplevelBody::save_conflicts(interp, chan, 0, minimal); - CdlToplevelBody::save_separator(interp, chan, "contents", minimal); - this->CdlContainerBody::save(interp, chan, 0, minimal); - this->save_unsupported_commands(interp, chan, 0, minimal); - - } catch(...) { - Tcl_UnregisterChannel(0, chan); - // NOTE: deleting the file is necessary, it is a bad idea to - // end up with incomplete save files. It would be even better - // to write to a temporary file and only overwrite the old - // savefile on success. - // - // Tcl does not provide direct access to the file delete - // facility, so it is necessary to evaluate a script. This - // introduces quoting and security problems, since the - // filename might contain spaces, square brackets, braces... - // To avoid these problems a variable is used. - interp->set_variable("__cdlconfig_filename", filename); - interp->eval("file delete $__cdlconfig_filename", tmp); - interp->unset_variable("__cdlconfig_filename"); - - throw; - } - - // This call will perform the appropriate close. - Tcl_UnregisterChannel(0, chan); -} - -//}}} -//{{{ CdlConfiguration::load() and add() - -// ---------------------------------------------------------------------------- -// Most of the work is done in add(). load() simply creates a new configuration -// and then invokes add(). -CdlConfiguration -CdlConfigurationBody::load(std::string filename, CdlPackagesDatabase db, CdlInterpreter interp, - CdlDiagnosticFnPtr error_fn, CdlDiagnosticFnPtr warn_fn) -{ - CYG_REPORT_FUNCNAMETYPE("CdlConfiguration::load", "result %p"); - CYG_REPORT_FUNCARG4XV(db, interp, error_fn, warn_fn); - CYG_PRECONDITION_CLASSC(db); - CYG_PRECONDITION_CLASSC(interp); - - CdlConfiguration result = CdlConfigurationBody::make("eCos", db, interp); - if (0 == result) { - CYG_REPORT_RETVAL(result); - return result; - } - - try { - result->add(filename, error_fn, warn_fn); - result->save_file = filename; - } catch(...) { - delete result; - throw; - } - - CYG_REPORT_RETVAL(result); - return result; -} - -// ---------------------------------------------------------------------------- -void -CdlConfigurationBody::add(CdlTransaction transaction, std::string filename, - CdlDiagnosticFnPtr error_fn, CdlDiagnosticFnPtr warn_fn) -{ - CYG_REPORT_FUNCNAME("CdlConfiguration::add"); - CYG_REPORT_FUNCARG3XV(this, error_fn, warn_fn); - CYG_PRECONDITION_THISC(); - - // Initialize the savefile support, so that it is known what - // commands can occur in a savefile. - if (!CdlToplevelBody::savefile_support_initialized()) { - this->initialize_savefile_support(); - } - - // The interpreter should not have any left-over junk. - CdlInterpreter interp = this->get_interpreter(); - CYG_PRECONDITION_CLASSC(interp); - CYG_ASSERTC(0 == interp->get_loadable()); - CYG_ASSERTC(0 == interp->get_container()); - CYG_ASSERTC(0 == interp->get_node()); - CYG_ASSERTC(0 == interp->get_transaction()); - - // Keep track of enough information to undo all the changes. - CdlParse::clear_error_count(interp); - CdlInterpreterBody::DiagSupport diag_support(interp, error_fn, warn_fn); - CdlInterpreterBody::ContextSupport context_support(interp, filename); - - try { - interp->set_transaction(transaction); - - std::vector commands; - this->get_savefile_commands(commands); - CdlInterpreterBody::CommandSupport interp_cmds(interp, commands); - - interp->eval_file(filename); - - // All the data has been read in without generating an - // exception. However there may have been errors reported via - // the error_fn handling, and any errors at all should result - // in an exception. - int error_count = CdlParse::get_error_count(interp); - if (error_count > 0) { - std::string tmp; - Cdl::integer_to_string(error_count, tmp); - throw CdlInputOutputException("Invalid savefile \"" + filename + "\".\n" + - tmp + " error" + ((error_count > 1) ? "s" : "") + - " occurred while reading in the savefile data."); - } - - } catch(...) { - interp->set_transaction(0); - throw; - } - - interp->set_transaction(0); - - CYG_REPORT_RETURN(); -} - -//}}} -//{{{ savefile commands - -// ---------------------------------------------------------------------------- -// A cdl_configuration command does not actually do very much. It acts as -// a container for subcommands, and it can be used to change the name. -// -// The command could also check that the current configuration is empty. -// This is not done, to allow multiple savefiles to be loaded into -// a single configuration in future. -int -CdlConfigurationBody::savefile_configuration_command(CdlInterpreter interp, int argc, const char* argv[]) -{ - CYG_REPORT_FUNCNAMETYPE("CdlConfiguration::savefile_configuration_command", "result %d"); - CYG_PRECONDITION_CLASSC(interp); - - int result = TCL_OK; - CdlToplevel toplevel = interp->get_toplevel(); - CYG_ASSERT_CLASSC(toplevel); - CdlConfiguration config = dynamic_cast(toplevel); - CYG_ASSERT_CLASSC(config); - - std::vector subcommands; - std::vector* toplevel_commands = 0; - - try { - std::vector > options; - int data_index = CdlParse::parse_options(interp, "cdl_configuration command", 0, argc, argv, 1, options); - - // A broken cdl_configuration command is pretty fatal, chances are - // that the entire load is going to fail. - if (data_index != (argc - 2)) { - CdlParse::report_error(interp, "", "Invalid cdl_configuration command in savefile, expecting two arguments."); - } else { - config->set_name(argv[1]); - config->get_savefile_subcommands("cdl_configuration", subcommands); - toplevel_commands = interp->push_commands(subcommands); - - std::string tcl_result; - result = interp->eval(argv[2], tcl_result); - - interp->pop_commands(toplevel_commands); - toplevel_commands = 0; - } - - } catch(...) { - if (0 != toplevel_commands) { - interp->pop_commands(toplevel_commands); - } - throw; - } - - CYG_REPORT_RETVAL(result); - return result; -} - -// ---------------------------------------------------------------------------- -int -CdlConfigurationBody::savefile_description_command(CdlInterpreter interp, int argc, const char* argv[]) -{ - CYG_REPORT_FUNCNAME("CdlConfiguration::savefile_description_command"); - CYG_PRECONDITION_CLASSC(interp); - - CdlToplevel toplevel = interp->get_toplevel(); - CYG_ASSERT_CLASSC(toplevel); - CdlConfiguration config = dynamic_cast(toplevel); - CYG_ASSERT_CLASSC(config); - - std::vector > options; - int data_index = CdlParse::parse_options(interp, "cdl_configuration/description command", 0, argc, argv, 1, options); - - if (data_index != (argc - 1)) { - CdlParse::report_warning(interp, "", - "Ignoring invalid configuration description command, expecting a single argument."); - } else { - config->description = argv[1]; - } - return TCL_OK; -} - -// ---------------------------------------------------------------------------- -int -CdlConfigurationBody::savefile_hardware_command(CdlInterpreter interp, int argc, const char* argv[]) -{ - CYG_REPORT_FUNCNAME("CdlConfiguration::savefile_hardware_command"); - CYG_PRECONDITION_CLASSC(interp); - - CdlToplevel toplevel = interp->get_toplevel(); - CYG_ASSERT_CLASSC(toplevel); - CdlConfiguration config = dynamic_cast(toplevel); - CYG_ASSERT_CLASSC(config); - - std::vector > options; - int data_index = CdlParse::parse_options(interp, "cdl_configuration/hardware command", 0, argc, argv, 1, options); - - if (data_index != (argc - 1)) { - CdlParse::report_warning(interp, "", "Ignoring invalid configuration hardware command, expecting a single argument."); - } else { - config->current_hardware = argv[1]; - } - - return TCL_OK; -} - -// ---------------------------------------------------------------------------- -int -CdlConfigurationBody::savefile_template_command(CdlInterpreter interp, int argc, const char* argv[]) -{ - CYG_REPORT_FUNCNAME("CdlConfiguration::savefile_template_command"); - CYG_PRECONDITION_CLASSC(interp); - - CdlToplevel toplevel = interp->get_toplevel(); - CYG_ASSERT_CLASSC(toplevel); - CdlConfiguration config = dynamic_cast(toplevel); - CYG_ASSERT_CLASSC(config); - - std::vector > options; - int data_index = CdlParse::parse_options(interp, "cdl_configuration/template command", 0, argc, argv, 1, options); - - if (data_index != (argc - 1)) { - CdlParse::report_warning(interp, "", "Ignoring invalid configuration template command, expecting a single argument."); - } else { - config->current_template = argv[1]; - } - - return TCL_OK; -} - -// ---------------------------------------------------------------------------- -int -CdlConfigurationBody::savefile_package_command(CdlInterpreter interp, int argc, const char* argv[]) -{ - CYG_REPORT_FUNCNAME("CdlConfiguration::savefile_package_command"); - CYG_PRECONDITION_CLASSC(interp); - - CdlToplevel toplevel = interp->get_toplevel(); - CYG_ASSERT_CLASSC(toplevel); - CdlConfiguration config = dynamic_cast(toplevel); - CYG_ASSERT_CLASSC(config); - CdlPackagesDatabase db = config->get_database(); - CYG_ASSERT_CLASSC(db); - - std::string pkgname; - std::string pkgversion; - CdlPackage pkg = 0; - - std::vector > options; - static char* optlist[] = { - "template:f", - "hardware:f", - 0 - }; - int data_index = CdlParse::parse_options(interp, "cdl_configuration/package command", optlist, argc, argv, 1, options); - - if (data_index == (argc - 1)) { - // If no version is specified, silently default to the most recent. - pkgname = argv[argc - 1]; - pkgversion = ""; - } else if (data_index == (argc - 2)) { - pkgname = argv[argc - 2]; - pkgversion = argv[argc - 1]; - } else { - // If we cannot load all the packages then much of the - // savefile is likely to be problematical. - CdlParse::report_error(interp, "", "Invalid cdl_configuration/package command, expecting name and version"); - CYG_REPORT_RETURN(); - return TCL_OK; - } - - if (0 != config->lookup(pkgname)) { - // If the package was already loaded, check the version string. If the versions - // are identical then we do not need to worry any further. Otherwise a mismatch - // warning is appropriate. - CdlNode node = config->lookup(pkgname); - CYG_ASSERT_CLASSC(node); - pkg = dynamic_cast(node); - if (0 == pkg) { - // The name is in use, but it is not a package - CdlParse::report_error(interp, "", - std::string("Unable to load package `") + pkgname + "', the name is already in use."); - } else if (pkgversion != pkg->get_value()) { - CdlParse::report_warning(interp, "", - std::string("Cannot load version `") + pkgversion + "' of package `" + - pkgname + "', version `" + pkg->get_value() + "' is already loaded."); - } - } else if (!db->is_known_package(pkgname)) { - CdlParse::report_error(interp, "", - std::string("Attempt to load an unknown package `") + pkgname + "'."); - } else { - if ("" != pkgversion) { - const std::vector& versions = db->get_package_versions(pkgname); - if (versions.end() == std::find(versions.begin(), versions.end(), pkgversion)) { - CdlParse::report_warning(interp, "", - std::string("The savefile specifies version `") + pkgversion + - "' for package `" + pkgname + "'\nThis version is not available.\n" + - "Using the most recent version instead."); - pkgversion = ""; - } - } - CdlDiagnosticFnPtr error_fn = interp->get_error_fn_ptr(); - CdlDiagnosticFnPtr warn_fn = interp->get_warning_fn_ptr(); - CdlTransaction transaction = interp->get_transaction(); - config->load_package(transaction, pkgname, pkgversion, error_fn, warn_fn, false); - CdlNode pkg_node = config->lookup(pkgname); - CYG_ASSERTC(0 != pkg_node); - pkg = dynamic_cast(pkg_node); - CYG_ASSERT_CLASSC(pkg); - } - - if ((0 != pkg) && (0 != options.size())) { - std::vector >::const_iterator opt_i; - for (opt_i = options.begin(); opt_i != options.end(); opt_i++) { - if (opt_i->first == "template") { - pkg->loaded_for_template = true; - } else if (opt_i->first == "hardware") { - pkg->loaded_for_hardware = true; - } - } - } - - return TCL_OK; -} - -//}}} - -//}}} - diff --git a/host/libcdl/config.h.in b/host/libcdl/config.h.in deleted file mode 100644 --- a/host/libcdl/config.h.in +++ /dev/null @@ -1,21 +0,0 @@ -/* config.h.in. Generated automatically from configure.in by autoheader. */ - -#undef PACKAGE -#undef VERSION -#undef CYGNUM_LIBCDL_VERSION - -#undef CYGDBG_USE_ASSERTS -#undef CYGDBG_INFRA_DEBUG_PRECONDITIONS -#undef CYGDBG_INFRA_DEBUG_POSTCONDITIONS -#undef CYGDBG_INFRA_DEBUG_INVARIANTS -#undef CYGDBG_INFRA_DEBUG_LOOP_INVARIANTS - -#undef CYGDBG_USE_TRACING -#undef CYGDBG_INFRA_DEBUG_FUNCTION_REPORTS - -/* Name of package */ -#undef PACKAGE - -/* Version number of package */ -#undef VERSION - diff --git a/host/libcdl/configure b/host/libcdl/configure deleted file mode 100644 --- a/host/libcdl/configure +++ /dev/null @@ -1,2429 +0,0 @@ -#! /bin/sh - -# Guess values for system-dependent variables and create Makefiles. -# Generated automatically using autoconf version 2.13 -# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc. -# -# This configure script is free software; the Free Software Foundation -# gives unlimited permission to copy, distribute and modify it. - -# Defaults: -ac_help= -ac_default_prefix=/usr/local -# Any additions from configure.in: -ac_help="$ac_help - --enable-maintainer-mode enable make rules and dependencies not useful - (and sometimes confusing) to the casual installer" -ac_help="$ac_help - --enable-debug do a debug rather than a release build" -ac_help="$ac_help - --enable-ansi do an ANSI rather than a unicode build" -ac_help="$ac_help - --disable-asserts disable all assertions" -ac_help="$ac_help - --disable-preconditions disable a subset of the assertions" -ac_help="$ac_help - --disable-postconditions disable a subset of the assertions" -ac_help="$ac_help - --disable-invariants disable a subset of the assertions" -ac_help="$ac_help - --disable-loopinvariants disable a subset of the assertions" -ac_help="$ac_help - --disable-tracing disable tracing" -ac_help="$ac_help - --disable-fntracing disable function entry/exit tracing" -ac_help="$ac_help - --with-infra-header= location of eCos infrastructure headers" -ac_help="$ac_help - --with-infra-lib= location of eCos infrastructure library" -ac_help="$ac_help - --with-infra= location of eCos infrastructure installation" -ac_help="$ac_help - --with-tcl= location of Tcl header and libraries" -ac_help="$ac_help - --with-tcl-version= version of Tcl to be used" -ac_help="$ac_help - --with-tcl-header= location of Tcl header" -ac_help="$ac_help - --with-tcl-lib= location of Tcl libraries" - -# Initialize some variables set by options. -# The variables have the same names as the options, with -# dashes changed to underlines. -build=NONE -cache_file=./config.cache -exec_prefix=NONE -host=NONE -no_create= -nonopt=NONE -no_recursion= -prefix=NONE -program_prefix=NONE -program_suffix=NONE -program_transform_name=s,x,x, -silent= -site= -srcdir= -target=NONE -verbose= -x_includes=NONE -x_libraries=NONE -bindir='${exec_prefix}/bin' -sbindir='${exec_prefix}/sbin' -libexecdir='${exec_prefix}/libexec' -datadir='${prefix}/share' -sysconfdir='${prefix}/etc' -sharedstatedir='${prefix}/com' -localstatedir='${prefix}/var' -libdir='${exec_prefix}/lib' -includedir='${prefix}/include' -oldincludedir='/usr/include' -infodir='${prefix}/info' -mandir='${prefix}/man' - -# Initialize some other variables. -subdirs= -MFLAGS= MAKEFLAGS= -SHELL=${CONFIG_SHELL-/bin/sh} -# Maximum number of lines to put in a shell here document. -ac_max_here_lines=12 - -ac_prev= -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=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;; - *) ac_optarg= ;; - esac - - # Accept the important Cygnus configure options, so we can diagnose typos. - - case "$ac_option" in - - -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 ;; - -build=* | --build=* | --buil=* | --bui=* | --bu=*) - build="$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" ;; - - -datadir | --datadir | --datadi | --datad | --data | --dat | --da) - ac_prev=datadir ;; - -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ - | --da=*) - datadir="$ac_optarg" ;; - - -disable-* | --disable-*) - ac_feature=`echo $ac_option|sed -e 's/-*disable-//'` - # Reject names that are not valid shell variable names. - if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then - { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } - fi - ac_feature=`echo $ac_feature| sed 's/-/_/g'` - eval "enable_${ac_feature}=no" ;; - - -enable-* | --enable-*) - ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'` - # Reject names that are not valid shell variable names. - if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then - { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } - fi - ac_feature=`echo $ac_feature| sed 's/-/_/g'` - case "$ac_option" in - *=*) ;; - *) ac_optarg=yes ;; - esac - eval "enable_${ac_feature}='$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) - # 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 << EOF -Usage: configure [options] [host] -Options: [defaults in brackets after descriptions] -Configuration: - --cache-file=FILE cache test results in FILE - --help print this message - --no-create do not create output files - --quiet, --silent do not print \`checking...' messages - --version print the version of autoconf that created configure -Directory and file names: - --prefix=PREFIX install architecture-independent files in PREFIX - [$ac_default_prefix] - --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX - [same as prefix] - --bindir=DIR user executables in DIR [EPREFIX/bin] - --sbindir=DIR system admin executables in DIR [EPREFIX/sbin] - --libexecdir=DIR program executables in DIR [EPREFIX/libexec] - --datadir=DIR read-only architecture-independent data in DIR - [PREFIX/share] - --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc] - --sharedstatedir=DIR modifiable architecture-independent data in DIR - [PREFIX/com] - --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var] - --libdir=DIR object code libraries in DIR [EPREFIX/lib] - --includedir=DIR C header files in DIR [PREFIX/include] - --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include] - --infodir=DIR info documentation in DIR [PREFIX/info] - --mandir=DIR man documentation in DIR [PREFIX/man] - --srcdir=DIR find the sources in DIR [configure dir or ..] - --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 -EOF - cat << EOF -Host type: - --build=BUILD configure for building on BUILD [BUILD=HOST] - --host=HOST configure for HOST [guessed] - --target=TARGET configure for TARGET [TARGET=HOST] -Features and packages: - --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) - --enable-FEATURE[=ARG] include FEATURE [ARG=yes] - --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] - --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) - --x-includes=DIR X include files are in DIR - --x-libraries=DIR X library files are in DIR -EOF - if test -n "$ac_help"; then - echo "--enable and --with options recognized:$ac_help" - fi - exit 0 ;; - - -host | --host | --hos | --ho) - ac_prev=host ;; - -host=* | --host=* | --hos=* | --ho=*) - host="$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" ;; - - -localstatedir | --localstatedir | --localstatedi | --localstated \ - | --localstate | --localstat | --localsta | --localst \ - | --locals | --local | --loca | --loc | --lo) - ac_prev=localstatedir ;; - -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ - | --localstate=* | --localstat=* | --localsta=* | --localst=* \ - | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) - 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) - 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" ;; - - -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 ;; - -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) - target="$ac_optarg" ;; - - -v | -verbose | --verbose | --verbos | --verbo | --verb) - verbose=yes ;; - - -version | --version | --versio | --versi | --vers) - echo "configure generated by autoconf version 2.13" - exit 0 ;; - - -with-* | --with-*) - ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'` - # Reject names that are not valid shell variable names. - if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then - { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } - fi - ac_package=`echo $ac_package| sed 's/-/_/g'` - case "$ac_option" in - *=*) ;; - *) ac_optarg=yes ;; - esac - eval "with_${ac_package}='$ac_optarg'" ;; - - -without-* | --without-*) - ac_package=`echo $ac_option|sed -e 's/-*without-//'` - # Reject names that are not valid shell variable names. - if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then - { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } - fi - ac_package=`echo $ac_package| sed 's/-/_/g'` - eval "with_${ac_package}=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" ;; - - -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; } - ;; - - *) - if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then - echo "configure: warning: $ac_option: invalid host type" 1>&2 - fi - if test "x$nonopt" != xNONE; then - { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } - fi - nonopt="$ac_option" - ;; - - esac -done - -if test -n "$ac_prev"; then - { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; } -fi - -trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 - -# File descriptor usage: -# 0 standard input -# 1 file creation -# 2 errors and warnings -# 3 some systems may open it to /dev/tty -# 4 used on the Kubota Titan -# 6 checking for... messages and results -# 5 compiler messages saved in config.log -if test "$silent" = yes; then - exec 6>/dev/null -else - exec 6>&1 -fi -exec 5>./config.log - -echo "\ -This file contains any messages produced by compilers while -running configure, to aid debugging if configure makes a mistake. -" 1>&5 - -# Strip out --no-create and --no-recursion so they do not pile up. -# Also quote any args containing shell metacharacters. -ac_configure_args= -for ac_arg -do - case "$ac_arg" in - -no-create | --no-create | --no-creat | --no-crea | --no-cre \ - | --no-cr | --no-c) ;; - -no-recursion | --no-recursion | --no-recursio | --no-recursi \ - | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;; - *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*) - ac_configure_args="$ac_configure_args '$ac_arg'" ;; - *) ac_configure_args="$ac_configure_args $ac_arg" ;; - esac -done - -# NLS nuisances. -# Only set these to C if already set. These must not be set unconditionally -# because not all systems understand e.g. LANG=C (notably SCO). -# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'! -# Non-C LC_CTYPE values break the ctype check. -if test "${LANG+set}" = set; then LANG=C; export LANG; fi -if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi -if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi -if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi - -# confdefs.h avoids OS command line length limits that DEFS can exceed. -rm -rf conftest* confdefs.h -# AIX cpp loses on an empty file, so make sure it contains at least a newline. -echo > confdefs.h - -# A filename unique to this package, relative to the directory that -# configure is in, which we can look for to find out if srcdir is correct. -ac_unique_file=cdlcore.hxx - -# 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 its parent. - ac_prog=$0 - ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'` - test "x$ac_confdir" = "x$ac_prog" && ac_confdir=. - 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 - if test "$ac_srcdir_defaulted" = yes; then - { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; } - else - { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; } - fi -fi -srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'` - -# Prefer explicitly selected file to automatically selected ones. -if test -z "$CONFIG_SITE"; then - if test "x$prefix" != xNONE; then - CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" - else - CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" - fi -fi -for ac_site_file in $CONFIG_SITE; do - if test -r "$ac_site_file"; then - echo "loading site script $ac_site_file" - . "$ac_site_file" - fi -done - -if test -r "$cache_file"; then - echo "loading cache $cache_file" - . $cache_file -else - echo "creating cache $cache_file" - > $cache_file -fi - -ac_ext=c -# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. -ac_cpp='$CPP $CPPFLAGS' -ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' -ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' -cross_compiling=$ac_cv_prog_cc_cross - -ac_exeext= -ac_objext=o -if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then - # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu. - if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then - ac_n= ac_c=' -' ac_t=' ' - else - ac_n=-n ac_c= ac_t= - fi -else - ac_n= ac_c='\c' ac_t= -fi - - - -ac_aux_dir= -for ac_dir in ../../acsupport $srcdir/../../acsupport; 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 - fi -done -if test -z "$ac_aux_dir"; then - { echo "configure: error: can not find install-sh or install.sh in ../../acsupport $srcdir/../../acsupport" 1>&2; exit 1; } -fi -ac_config_guess=$ac_aux_dir/config.guess -ac_config_sub=$ac_aux_dir/config.sub -ac_configure=$ac_aux_dir/configure # This should be Cygnus configure. - - - - echo $ac_n "checking that a separate build tree is being used""... $ac_c" 1>&6 -echo "configure:583: checking that a separate build tree is being used" >&5 - ecos_cwd=`/bin/pwd` - if test "${srcdir}" = "." ; then - srcdir=${ecos_cwd} - fi - if test "${ecos_cwd}" = "${srcdir}" ; then - echo "$ac_t""no" 1>&6 - { echo "configure: error: This configure script should not be run inside the source tree. Instead please use a separate build tree" 1>&2; exit 1; } - else - echo "$ac_t""yes" 1>&6 - fi - - -# Make sure we can run config.sub. -if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then : -else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; } -fi - -echo $ac_n "checking host system type""... $ac_c" 1>&6 -echo "configure:602: checking host system type" >&5 - -host_alias=$host -case "$host_alias" in -NONE) - case $nonopt in - NONE) - if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then : - else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; } - fi ;; - *) host_alias=$nonopt ;; - esac ;; -esac - -host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias` -host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` -host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` -host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` -echo "$ac_t""$host" 1>&6 - -# 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 -# 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" -# ./install, which can be erroneously created by make from ./install.sh. -echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 -echo "configure:634: checking for a BSD compatible install" >&5 -if test -z "$INSTALL"; then -if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":" - for ac_dir in $PATH; do - # Account for people who put trailing slashes in PATH elements. - case "$ac_dir/" in - /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/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 - if test -f $ac_dir/$ac_prog; then - if test $ac_prog = install && - grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then - # AIX install. It has an incompatible calling convention. - : - else - ac_cv_path_install="$ac_dir/$ac_prog -c" - break 2 - fi - fi - done - ;; - esac - done - IFS="$ac_save_IFS" - -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. We don't cache a - # path for INSTALL within a source directory, because that will - # break other packages using the cache if that directory is - # removed, or if the path is relative. - INSTALL="$ac_install_sh" - fi -fi -echo "$ac_t""$INSTALL" 1>&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_PROGRAM}' - -test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' - -echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6 -echo "configure:687: checking whether build environment is sane" >&5 -# Just in case -sleep 1 -echo timestamp > conftestfile -# 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 conftestfile 2> /dev/null` - if test "$*" = "X"; then - # -L didn't work. - set X `ls -t $srcdir/configure conftestfile` - fi - if test "$*" != "X $srcdir/configure conftestfile" \ - && test "$*" != "X conftestfile $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". - { echo "configure: error: ls -t appears to fail. Make sure there is not a broken -alias in your environment" 1>&2; exit 1; } - fi - - test "$2" = conftestfile - ) -then - # Ok. - : -else - { echo "configure: error: newly created file is older than distributed files! -Check your system clock" 1>&2; exit 1; } -fi -rm -f conftest* -echo "$ac_t""yes" 1>&6 -if test "$program_transform_name" = s,x,x,; then - program_transform_name= -else - # Double any \ or $. echo might interpret backslashes. - cat <<\EOF_SED > conftestsed -s,\\,\\\\,g; s,\$,$$,g -EOF_SED - program_transform_name="`echo $program_transform_name|sed -f conftestsed`" - rm -f conftestsed -fi -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" - -# sed with no file args requires a program. -test "$program_transform_name" = "" && program_transform_name="s,x,x," - -echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 -echo "configure:744: checking whether ${MAKE-make} sets \${MAKE}" >&5 -set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftestmake <<\EOF -all: - @echo 'ac_maketemp="${MAKE}"' -EOF -# GNU make sometimes prints "make[1]: Entering...", which would confuse us. -eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=` -if test -n "$ac_maketemp"; then - eval ac_cv_prog_make_${ac_make}_set=yes -else - eval ac_cv_prog_make_${ac_make}_set=no -fi -rm -f conftestmake -fi -if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then - echo "$ac_t""yes" 1>&6 - SET_MAKE= -else - echo "$ac_t""no" 1>&6 - SET_MAKE="MAKE=${MAKE-make}" -fi - - -PACKAGE=libcdl - -VERSION=0.2 - -if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then - { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; } -fi -cat >> confdefs.h <> confdefs.h <&6 -echo "configure:790: checking for working aclocal" >&5 -# Run test in a subshell; some versions of sh will print an error if -# an executable is not found, even if stderr is redirected. -# Redirect stdin to placate older versions of autoconf. Sigh. -if (aclocal --version) < /dev/null > /dev/null 2>&1; then - ACLOCAL=aclocal - echo "$ac_t""found" 1>&6 -else - ACLOCAL="$missing_dir/missing aclocal" - echo "$ac_t""missing" 1>&6 -fi - -echo $ac_n "checking for working autoconf""... $ac_c" 1>&6 -echo "configure:803: checking for working autoconf" >&5 -# Run test in a subshell; some versions of sh will print an error if -# an executable is not found, even if stderr is redirected. -# Redirect stdin to placate older versions of autoconf. Sigh. -if (autoconf --version) < /dev/null > /dev/null 2>&1; then - AUTOCONF=autoconf - echo "$ac_t""found" 1>&6 -else - AUTOCONF="$missing_dir/missing autoconf" - echo "$ac_t""missing" 1>&6 -fi - -echo $ac_n "checking for working automake""... $ac_c" 1>&6 -echo "configure:816: checking for working automake" >&5 -# Run test in a subshell; some versions of sh will print an error if -# an executable is not found, even if stderr is redirected. -# Redirect stdin to placate older versions of autoconf. Sigh. -if (automake --version) < /dev/null > /dev/null 2>&1; then - AUTOMAKE=automake - echo "$ac_t""found" 1>&6 -else - AUTOMAKE="$missing_dir/missing automake" - echo "$ac_t""missing" 1>&6 -fi - -echo $ac_n "checking for working autoheader""... $ac_c" 1>&6 -echo "configure:829: checking for working autoheader" >&5 -# Run test in a subshell; some versions of sh will print an error if -# an executable is not found, even if stderr is redirected. -# Redirect stdin to placate older versions of autoconf. Sigh. -if (autoheader --version) < /dev/null > /dev/null 2>&1; then - AUTOHEADER=autoheader - echo "$ac_t""found" 1>&6 -else - AUTOHEADER="$missing_dir/missing autoheader" - echo "$ac_t""missing" 1>&6 -fi - -echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6 -echo "configure:842: checking for working makeinfo" >&5 -# Run test in a subshell; some versions of sh will print an error if -# an executable is not found, even if stderr is redirected. -# Redirect stdin to placate older versions of autoconf. Sigh. -if (makeinfo --version) < /dev/null > /dev/null 2>&1; then - MAKEINFO=makeinfo - echo "$ac_t""found" 1>&6 -else - MAKEINFO="$missing_dir/missing makeinfo" - echo "$ac_t""missing" 1>&6 -fi - - - - - - cat >> confdefs.h <&6 -echo "configure:864: checking whether to enable maintainer-specific portions of Makefiles" >&5 - # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given. -if test "${enable_maintainer_mode+set}" = set; then - enableval="$enable_maintainer_mode" - USE_MAINTAINER_MODE=$enableval -else - USE_MAINTAINER_MODE=no -fi - - echo "$ac_t""$USE_MAINTAINER_MODE" 1>&6 - - -if test $USE_MAINTAINER_MODE = yes; then - MAINTAINER_MODE_TRUE= - MAINTAINER_MODE_FALSE='#' -else - MAINTAINER_MODE_TRUE='#' - MAINTAINER_MODE_FALSE= -fi - MAINT=$MAINTAINER_MODE_TRUE - - - -# Extract the first word of "gcc", so it can be a program name with args. -set dummy gcc; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:890: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_CC="gcc" - break - fi - done - IFS="$ac_save_ifs" -fi -fi -CC="$ac_cv_prog_CC" -if test -n "$CC"; then - echo "$ac_t""$CC" 1>&6 -else - echo "$ac_t""no" 1>&6 -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 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:920: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_prog_rejected=no - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then - ac_prog_rejected=yes - continue - fi - ac_cv_prog_CC="cc" - break - fi - done - IFS="$ac_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 $# -gt 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 - set dummy "$ac_dir/$ac_word" "$@" - shift - ac_cv_prog_CC="$@" - fi -fi -fi -fi -CC="$ac_cv_prog_CC" -if test -n "$CC"; then - echo "$ac_t""$CC" 1>&6 -else - echo "$ac_t""no" 1>&6 -fi - - if test -z "$CC"; then - case "`uname -s`" in - *win32* | *WIN32*) - # Extract the first word of "cl", so it can be a program name with args. -set dummy cl; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:971: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_CC="cl" - break - fi - done - IFS="$ac_save_ifs" -fi -fi -CC="$ac_cv_prog_CC" -if test -n "$CC"; then - echo "$ac_t""$CC" 1>&6 -else - echo "$ac_t""no" 1>&6 -fi - ;; - esac - fi - test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; } -fi - -echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:1003: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 - -ac_ext=c -# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. -ac_cpp='$CPP $CPPFLAGS' -ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' -ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' -cross_compiling=$ac_cv_prog_cc_cross - -cat > conftest.$ac_ext << EOF - -#line 1014 "configure" -#include "confdefs.h" - -main(){return(0);} -EOF -if { (eval echo configure:1019: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - ac_cv_prog_cc_works=yes - # If we can't run a trivial program, we are probably using a cross compiler. - if (./conftest; exit) 2>/dev/null; then - ac_cv_prog_cc_cross=no - else - ac_cv_prog_cc_cross=yes - fi -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - ac_cv_prog_cc_works=no -fi -rm -fr conftest* -ac_ext=c -# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. -ac_cpp='$CPP $CPPFLAGS' -ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' -ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' -cross_compiling=$ac_cv_prog_cc_cross - -echo "$ac_t""$ac_cv_prog_cc_works" 1>&6 -if test $ac_cv_prog_cc_works = no; then - { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } -fi -echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 -echo "configure:1045: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 -echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 -cross_compiling=$ac_cv_prog_cc_cross - -echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 -echo "configure:1050: checking whether we are using GNU C" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.c <&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then - ac_cv_prog_gcc=yes -else - ac_cv_prog_gcc=no -fi -fi - -echo "$ac_t""$ac_cv_prog_gcc" 1>&6 - -if test $ac_cv_prog_gcc = yes; then - GCC=yes -else - GCC= -fi - -ac_test_CFLAGS="${CFLAGS+set}" -ac_save_CFLAGS="$CFLAGS" -CFLAGS= -echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 -echo "configure:1078: checking whether ${CC-cc} accepts -g" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - echo 'void f(){}' > conftest.c -if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then - ac_cv_prog_cc_g=yes -else - ac_cv_prog_cc_g=no -fi -rm -f conftest* - -fi - -echo "$ac_t""$ac_cv_prog_cc_g" 1>&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 - -for ac_prog in $CCC c++ g++ gcc CC cxx cc++ cl -do -# Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1114: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_CXX'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - if test -n "$CXX"; then - ac_cv_prog_CXX="$CXX" # Let the user override the test. -else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_CXX="$ac_prog" - break - fi - done - IFS="$ac_save_ifs" -fi -fi -CXX="$ac_cv_prog_CXX" -if test -n "$CXX"; then - echo "$ac_t""$CXX" 1>&6 -else - echo "$ac_t""no" 1>&6 -fi - -test -n "$CXX" && break -done -test -n "$CXX" || CXX="gcc" - - -echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:1146: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works" >&5 - -ac_ext=C -# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' -ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' -cross_compiling=$ac_cv_prog_cxx_cross - -cat > conftest.$ac_ext << EOF - -#line 1157 "configure" -#include "confdefs.h" - -int main(){return(0);} -EOF -if { (eval echo configure:1162: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - ac_cv_prog_cxx_works=yes - # If we can't run a trivial program, we are probably using a cross compiler. - if (./conftest; exit) 2>/dev/null; then - ac_cv_prog_cxx_cross=no - else - ac_cv_prog_cxx_cross=yes - fi -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - ac_cv_prog_cxx_works=no -fi -rm -fr conftest* -ac_ext=c -# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. -ac_cpp='$CPP $CPPFLAGS' -ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' -ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' -cross_compiling=$ac_cv_prog_cc_cross - -echo "$ac_t""$ac_cv_prog_cxx_works" 1>&6 -if test $ac_cv_prog_cxx_works = no; then - { echo "configure: error: installation or configuration problem: C++ compiler cannot create executables." 1>&2; exit 1; } -fi -echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 -echo "configure:1188: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler" >&5 -echo "$ac_t""$ac_cv_prog_cxx_cross" 1>&6 -cross_compiling=$ac_cv_prog_cxx_cross - -echo $ac_n "checking whether we are using GNU C++""... $ac_c" 1>&6 -echo "configure:1193: checking whether we are using GNU C++" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_gxx'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.C <&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then - ac_cv_prog_gxx=yes -else - ac_cv_prog_gxx=no -fi -fi - -echo "$ac_t""$ac_cv_prog_gxx" 1>&6 - -if test $ac_cv_prog_gxx = yes; then - GXX=yes -else - GXX= -fi - -ac_test_CXXFLAGS="${CXXFLAGS+set}" -ac_save_CXXFLAGS="$CXXFLAGS" -CXXFLAGS= -echo $ac_n "checking whether ${CXX-g++} accepts -g""... $ac_c" 1>&6 -echo "configure:1221: checking whether ${CXX-g++} accepts -g" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_cxx_g'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - echo 'void f(){}' > conftest.cc -if test -z "`${CXX-g++} -g -c conftest.cc 2>&1`"; then - ac_cv_prog_cxx_g=yes -else - ac_cv_prog_cxx_g=no -fi -rm -f conftest* - -fi - -echo "$ac_t""$ac_cv_prog_cxx_g" 1>&6 -if test "$ac_test_CXXFLAGS" = set; then - CXXFLAGS="$ac_save_CXXFLAGS" -elif test $ac_cv_prog_cxx_g = yes; then - if test "$GXX" = yes; then - CXXFLAGS="-g -O2" - else - CXXFLAGS="-g" - fi -else - if test "$GXX" = yes; then - CXXFLAGS="-O2" - else - CXXFLAGS= - fi -fi - -for ac_declaration in \ - ''\ - '#include ' \ - 'extern "C" void std::exit (int) throw (); using std::exit;' \ - 'extern "C" void std::exit (int); using std::exit;' \ - 'extern "C" void exit (int) throw ();' \ - 'extern "C" void exit (int);' \ - 'void exit (int);' -do - cat > conftest.$ac_ext < -$ac_declaration -int main() { -exit (42); -; return 0; } -EOF -if { (eval echo configure:1270: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - : -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - continue -fi -rm -f conftest* - cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* - break -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 -fi -rm -f conftest* -done -if test -n "$ac_declaration"; then - echo '#ifdef __cplusplus' >>confdefs.h - echo $ac_declaration >>confdefs.h - echo '#endif' >>confdefs.h -fi - - -# Extract the first word of "ranlib", so it can be a program name with args. -set dummy ranlib; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1306: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - if test -n "$RANLIB"; then - ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. -else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_RANLIB="ranlib" - break - fi - done - IFS="$ac_save_ifs" - test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":" -fi -fi -RANLIB="$ac_cv_prog_RANLIB" -if test -n "$RANLIB"; then - echo "$ac_t""$RANLIB" 1>&6 -else - echo "$ac_t""no" 1>&6 -fi - -echo $ac_n "checking for object suffix""... $ac_c" 1>&6 -echo "configure:1334: checking for object suffix" >&5 -if eval "test \"`echo '$''{'ac_cv_objext'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - rm -f conftest* -echo 'int i = 1;' > conftest.$ac_ext -if { (eval echo configure:1340: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - for ac_file in conftest.*; do - case $ac_file in - *.c) ;; - *) ac_cv_objext=`echo $ac_file | sed -e s/conftest.//` ;; - esac - done -else - { echo "configure: error: installation or configuration problem; compiler does not work" 1>&2; exit 1; } -fi -rm -f conftest* -fi - -echo "$ac_t""$ac_cv_objext" 1>&6 -OBJEXT=$ac_cv_objext -ac_objext=$ac_cv_objext - -echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6 -echo "configure:1358: checking for Cygwin environment" >&5 -if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* - ac_cv_cygwin=yes -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - ac_cv_cygwin=no -fi -rm -f conftest* -rm -f conftest* -fi - -echo "$ac_t""$ac_cv_cygwin" 1>&6 -CYGWIN= -test "$ac_cv_cygwin" = yes && CYGWIN=yes -echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6 -echo "configure:1391: checking for mingw32 environment" >&5 -if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* - ac_cv_mingw32=yes -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - ac_cv_mingw32=no -fi -rm -f conftest* -rm -f conftest* -fi - -echo "$ac_t""$ac_cv_mingw32" 1>&6 -MINGW32= -test "$ac_cv_mingw32" = yes && MINGW32=yes - - -echo $ac_n "checking for executable suffix""... $ac_c" 1>&6 -echo "configure:1422: checking for executable suffix" >&5 -if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - if test "$CYGWIN" = yes || test "$MINGW32" = yes; then - ac_cv_exeext=.exe -else - rm -f conftest* - echo 'int main () { return 0; }' > conftest.$ac_ext - ac_cv_exeext= - if { (eval echo configure:1432: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then - for file in conftest.*; do - case $file in - *.c | *.o | *.obj) ;; - *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;; - esac - done - else - { echo "configure: error: installation or configuration problem: compiler cannot create executables." 1>&2; exit 1; } - fi - rm -f conftest* - test x"${ac_cv_exeext}" = x && ac_cv_exeext=no -fi -fi - -EXEEXT="" -test x"${ac_cv_exeext}" != xno && EXEEXT=${ac_cv_exeext} -echo "$ac_t""${ac_cv_exeext}" 1>&6 -ac_exeext=$EXEEXT - - - ecos_CFLAGS="" - ecos_CXXFLAGS="" - ecos_LDADD="" - ecos_INCLUDES="" - ecos_LIBS="" - - - - - - - - - - - - echo $ac_n "checking "for Visual C++"""... $ac_c" 1>&6 -echo "configure:1470: checking "for Visual C++"" >&5 - MSVC="no"; - if test "${CC}" = "cl" ; then - MSVC="yes" - CXX="cl" - MSVC_SRCDIR=${srcdir} - - - - if test "${MSVC}" = "yes" ; then - MSVC_SRCDIR=`cygpath -w ${MSVC_SRCDIR} | tr \\\\\\\\ /` - fi - - - ecos_INCLUDES="${ecos_INCLUDES} \"-I${MSVC_SRCDIR}\"" - ecos_LDADD="-link" - ecos_LIBS="advapi32.lib" - fi - - -if test "${MSVC}" = "yes"; then - MSVC_TRUE= - MSVC_FALSE='#' -else - MSVC_TRUE='#' - MSVC_FALSE= -fi - if test "${MSVC}" = "yes" ; then - echo "$ac_t""unfortunately yes" 1>&6 - else - echo "$ac_t""no" 1>&6 - fi - - - - - - - - echo $ac_n "checking "the default compiler flags"""... $ac_c" 1>&6 -echo "configure:1510: checking "the default compiler flags"" >&5 - - ecosflags_enable_debug="no" - # Check whether --enable-debug or --disable-debug was given. -if test "${enable_debug+set}" = set; then - enableval="$enable_debug" - case "${enableval}" in - yes) ecosflags_enable_debug="yes" ;; - *) ecosflags_enable_debug="no" ;; - esac -fi - - - ecosflags_enable_ansi="no" - if test "${MSVC}" = "yes" ; then - # Check whether --enable-ansi or --disable-ansi was given. -if test "${enable_ansi+set}" = set; then - enableval="$enable_ansi" - case "${enableval}" in - yes) ecosflags_enable_ansi="yes" ;; - *) ecosflags_enable_ansi="no" ;; - esac -fi - - fi - - if test "${GCC}" = "yes" ; then - ecos_CFLAGS="${ecos_CFLAGS} -pipe -Wall -Wpointer-arith -Wbad-function-cast -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs" - ecos_CXXFLAGS="${ecos_CXXFLAGS} -pipe -Wall -Wpointer-arith -Wbad-function-cast -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Woverloaded-virtual" - elif test "${MSVC}" = "yes" ; then - ecos_CFLAGS="${ecos_CFLAGS} -nologo -W3" - ecos_CXXFLAGS="${ecos_CXXFLAGS} -nologo -W3 -GR -GX" - else - { echo "configure: error: "default flags for ${CC} are not known"" 1>&2; exit 1; } - fi - - if test "${ecosflags_enable_debug}" = "yes" ; then - if test "${GCC}" = "yes" ; then - ecos_CFLAGS="${ecos_CFLAGS} -g -O0" - ecos_CXXFLAGS="${ecos_CXXFLAGS} -g -O0" - elif test "${MSVC}" = "yes" ; then - ecos_CFLAGS="${ecos_CFLAGS} -MDd -Zi" - ecos_CXXFLAGS="${ecos_CXXFLAGS} -MDd -Zi" - fi - else - if test "${GCC}" = "yes" ; then - ecos_CFLAGS="${ecos_CFLAGS} -O0" - ecos_CXXFLAGS="${ecos_CXXFLAGS} -O0" - elif test "${MSVC}" = "yes" ; then - ecos_CFLAGS="${ecos_CFLAGS} -MD -O2" - ecos_CXXFLAGS="${ecos_CXXFLAGS} -MD -O2" - fi - fi - - CFLAGS="${ac_save_CFLAGS}" - CXXFLAGS="${ac_save_CXXFLAGS}" - - echo "$ac_t""done" 1>&6 - - - - - - if test "${ecosflags_enable_debug}" = "yes" ; then - ecosinfra_asserts="yes" - ecosinfra_preconditions="yes" - ecosinfra_postconditions="yes" - ecosinfra_invariants="yes" - ecosinfra_loopinvariants="yes" - ecosinfra_tracing="yes" - ecosinfra_fntracing="yes" - else - ecosinfra_asserts="no" - ecosinfra_preconditions="no" - ecosinfra_postconditions="no" - ecosinfra_invariants="no" - ecosinfra_loopinvariants="no" - ecosinfra_tracing="no" - ecosinfra_fntracing="no" - fi - - # Check whether --enable-asserts or --disable-asserts was given. -if test "${enable_asserts+set}" = set; then - enableval="$enable_asserts" - case "${enableval}" in - yes) ecosinfra_asserts="yes" ;; - no) ecosinfra_asserts="no" ;; - *) { echo "configure: error: bad value ${enableval} for disable-asserts option" 1>&2; exit 1; } ;; - esac -fi - - if test "${ecosinfra_asserts}" = "yes"; then - cat >> confdefs.h <<\EOF -#define CYGDBG_USE_ASSERTS 1 -EOF - - fi - - # Check whether --enable-preconditions or --disable-preconditions was given. -if test "${enable_preconditions+set}" = set; then - enableval="$enable_preconditions" - case "${enableval}" in - yes) ecosinfra_preconditions="yes" ;; - no) ecosinfra_preconditions="no" ;; - *) { echo "configure: error: bad value ${enableval} for disable-preconditions option" 1>&2; exit 1; } ;; - esac -fi - - if test "${ecosinfra_preconditions}" = "yes"; then - cat >> confdefs.h <<\EOF -#define CYGDBG_INFRA_DEBUG_PRECONDITIONS 1 -EOF - - fi - - # Check whether --enable-postconditions or --disable-postconditions was given. -if test "${enable_postconditions+set}" = set; then - enableval="$enable_postconditions" - case "${enableval}" in - yes) ecosinfra_postconditions="yes" ;; - no) ecosinfra_postconditions="no" ;; - *) { echo "configure: error: bad value ${enableval} for disable-postconditions option" 1>&2; exit 1; } ;; - esac -fi - - if test "${ecosinfra_postconditions}" = "yes"; then - cat >> confdefs.h <<\EOF -#define CYGDBG_INFRA_DEBUG_POSTCONDITIONS 1 -EOF - - fi - - # Check whether --enable-invariants or --disable-invariants was given. -if test "${enable_invariants+set}" = set; then - enableval="$enable_invariants" - case "${enableval}" in - yes) ecosinfra_invariants="yes" ;; - no) ecosinfra_invariants="no" ;; - *) { echo "configure: error: bad value ${enableval} for disable-invariants option" 1>&2; exit 1; } ;; - esac -fi - - if test "${ecosinfra_invariants}" = "yes"; then - cat >> confdefs.h <<\EOF -#define CYGDBG_INFRA_DEBUG_INVARIANTS 1 -EOF - - fi - - # Check whether --enable-loopinvariants or --disable-loopinvariants was given. -if test "${enable_loopinvariants+set}" = set; then - enableval="$enable_loopinvariants" - case "${enableval}" in - yes) ecosinfra_loopinvariants="yes" ;; - no) ecosinfra_loopinvariants="no" ;; - *) { echo "configure: error: bad value ${enableval} for disable-loopinvariants option" 1>&2; exit 1; } ;; - esac -fi - - if test "${ecosinfra_loopinvariants}" = "yes"; then - cat >> confdefs.h <<\EOF -#define CYGDBG_INFRA_DEBUG_LOOP_INVARIANTS 1 -EOF - - fi - - # Check whether --enable-tracing or --disable-tracing was given. -if test "${enable_tracing+set}" = set; then - enableval="$enable_tracing" - case "${enableval}" in - yes) ecosinfra_tracing="yes" ;; - no) ecosinfra_tracing="no" ;; - *) { echo "configure: error: bad value ${enableval} for disable-tracing option" 1>&2; exit 1; } ;; - esac -fi - - if test "${ecosinfra_tracing}" = "yes"; then - cat >> confdefs.h <<\EOF -#define CYGDBG_USE_TRACING 1 -EOF - - fi - - # Check whether --enable-fntracing or --disable-fntracing was given. -if test "${enable_fntracing+set}" = set; then - enableval="$enable_fntracing" - case "${enableval}" in - yes) ecosinfra_fntracing="yes" ;; - no) ecosinfra_fntracing=no ;; - *) { echo "configure: error: bad value ${enableval} for disable-fntracing option" 1>&2; exit 1; } ;; - esac -fi - - if test "${ecosinfra_fntracing}" = "yes"; then - cat >> confdefs.h <<\EOF -#define CYGDBG_INFRA_DEBUG_FUNCTION_REPORTS 1 -EOF - - fi - - - echo $ac_n "checking for eCos host-side infrastructure""... $ac_c" 1>&6 -echo "configure:1712: checking for eCos host-side infrastructure" >&5 - - infra_builddir="" - possibles=".. ../.. ../../.. ../../../.. ../../../../.." - - infra_builddir="" - for i in ${possibles}; do - if test -d "$i/"infra""; then - infra_builddir=$i - break - fi - done - - if test "${infra_builddir}" = "" ; then - possibles="../host ../../host ../../../host ../../../../host ../../../../../host ../../../../../../host" - - infra_builddir="" - for i in ${possibles}; do - if test -d "$i/"infra""; then - infra_builddir=$i - break - fi - done - - fi - if test "${infra_builddir}" != "" ; then - infra_builddir="${infra_builddir}/infra" - infra_builddir=`cd ${infra_builddir} && /bin/pwd` - fi - - ecos_infra_incdir="" - ecos_infra_libdir="" - ecos_infra_libs="" - - # Check whether --with-infra-header or --without-infra-header was given. -if test "${with_infra_header+set}" = set; then - withval="$with_infra_header" - : -fi - - # Check whether --with-infra-lib or --without-infra-lib was given. -if test "${with_infra_lib+set}" = set; then - withval="$with_infra_lib" - : -fi - - # Check whether --with-infra or --without-infra was given. -if test "${with_infra+set}" = set; then - withval="$with_infra" - : -fi - - - if test "${with_infra_header+set}" = "set"; then - ecos_infra_incdir="${with_infra_header}" - elif test "${with_infra+set}" = "set"; then - ecos_infra_incdir="${with_infra}/include" - elif test "${infra_builddir}" != "" ; then - ecos_infra_incdir="${infra_builddir}" - else - { echo "configure: error: infrastructure headers not found" 1>&2; exit 1; } - fi - if test "${MSVC}" = "yes" ; then - ecos_msvc_infra_incdir=${ecos_infra_incdir} - - - - if test "${MSVC}" = "yes" ; then - ecos_msvc_infra_incdir=`cygpath -w ${ecos_msvc_infra_incdir} | tr \\\\\\\\ /` - fi - - ecos_INCLUDES="${ecos_INCLUDES} \"-I${ecos_msvc_infra_incdir}\"" - else - ecos_INCLUDES="${ecos_INCLUDES} -I${ecos_infra_incdir}" - fi - - if test "${with_infra_lib+set}" = "set"; then - ecos_infra_libdir="${with_infra_lib}" - elif test "${with_infra+set}" = "set"; then - ecos_infra_libdir="${with_infra}/lib" - elif test "${infra_builddir}" != "" ; then - ecos_infra_libdir="${infra_builddir}" - else - { echo "configure: error: infrastructure library not found" 1>&2; exit 1; } - fi - if test "${MSVC}" = "yes" ; then - ecos_msvc_infra_libdir=${ecos_infra_libdir} - - - - if test "${MSVC}" = "yes" ; then - ecos_msvc_infra_libdir=`cygpath -w ${ecos_msvc_infra_libdir} | tr \\\\\\\\ /` - fi - - ecos_LIBS="${ecos_LIBS} cyginfra.lib" - ecos_LDADD="${ecos_LDADD} \"-libpath=${ecos_msvc_infra_libdir}\"" - else - ecos_LIBS="${ecos_LIBS} -lcyginfra" - ecos_LDADD="${ecos_LDADD} -L${ecos_infra_libdir}" - fi - - - - echo "$ac_t""-I${ecos_infra_incdir} -L${ecos_infra_libdir}" 1>&6 - - - - - - - ecos_tk_libs="" - ecos_tk_libdir="" - - echo $ac_n "checking for Tcl installation""... $ac_c" 1>&6 -echo "configure:1826: checking for Tcl installation" >&5 - # Check whether --with-tcl or --without-tcl was given. -if test "${with_tcl+set}" = set; then - withval="$with_tcl" - : -fi - - # Check whether --with-tcl-version or --without-tcl-version was given. -if test "${with_tcl_version+set}" = set; then - withval="$with_tcl_version" - : -fi - - - if test "${MSVC}" = "yes" ; then - # Check whether --with-tcl-header or --without-tcl-header was given. -if test "${with_tcl_header+set}" = set; then - withval="$with_tcl_header" - : -fi - - # Check whether --with-tcl-lib or --without-tcl-lib was given. -if test "${with_tcl_lib+set}" = set; then - withval="$with_tcl_lib" - : -fi - - ecos_tcl_incdir="" - ecos_tcl_libdir="" - if test "${with_tcl_version+set}" != set ; then - { echo "configure: error: You must specify a Tcl version using --with-tcl-version=" 1>&2; exit 1; } - fi - if test "${with_tcl_header+set}" = set ; then - ecos_tcl_incdir=${with_tcl_header} - elif test "${with_tcl+set}" = set ; then - ecos_tcl_incdir="${with_tcl}/include" - else - { echo "configure: error: You must specify a Tcl installation with either --with-tcl= or --with-tcl-header=" 1>&2; exit 1; } - fi - if test "${with_tcl_lib+set}" = set; then - ecos_tcl_libdir=${with_tcl_lib} - elif test "${with_tcl+set}" = set; then - ecos_tcl_libdir="${with_tcl}/lib" - else - { echo "configure: error: You must specify a Tcl installation with either --with-tcl= or --with-tcl-lib=" 1>&2; exit 1; } - fi - - if test \! -r "${ecos_tcl_incdir}/tcl.h" ; then - { echo "configure: error: unable to locate Tcl header file tcl.h" 1>&2; exit 1; } - fi - - - - - if test "${MSVC}" = "yes" ; then - ecos_tcl_incdir=`cygpath -w ${ecos_tcl_incdir} | tr \\\\\\\\ /` - fi - - - - - if test "${MSVC}" = "yes" ; then - ecos_tcl_libdir=`cygpath -w ${ecos_tcl_libdir} | tr \\\\\\\\ /` - fi - - ecos_INCLUDES="${ecos_INCLUDES} \"-I${ecos_tcl_incdir}\"" - ecos_LIBS="${ecos_LIBS} tcl${with_tcl_version}.lib" - ecos_LDADD="${ecos_LDADD} \"-libpath=${ecos_tcl_libdir}\"" - - ecos_tk_libs="" - - else - possibles="" - if test "${with_tcl+set}" = set ; then - possibles="${with_tcl}/lib" - if test "${with_tcl_version+set}" = set ; then - possibles="${possibles} ${with_tcl}/lib/tcl${with_tcl_version}" - fi - fi - possibles="${possibles} ${prefix}/lib" - if test "${with_tcl_version+set}" = set ; then - possibles="${possibles} ${prefix}/lib/tcl${with_tcl_version}" - fi - possibles="${possibles} /usr/lib" - if test "${with_tcl_version+set}" = set ; then - possibles="${possibles} /usr/lib/tcl${with_tcl_version}" - fi - - tclconfig="" - for i in ${possibles}; do - if test -r "$i/"tclConfig.sh""; then - tclconfig=$i - break - fi - done - - if test \! -r "${tclconfig}/tclConfig.sh" ; then - { echo "configure: error: unable to locate Tcl configuration file tclConfig.sh" 1>&2; exit 1; } - else - . ${tclconfig}/tclConfig.sh - - if test -z "${TCL_INC_DIR}" ; then - ecos_tcl_incdir="${TCL_PREFIX}/include" - else - ecos_tcl_incdir="${TCL_INC_DIR}" - fi - if test \! -r "${ecos_tcl_incdir}/tcl.h" ; then - { echo "configure: error: unable to locate Tcl header file tcl.h" 1>&2; exit 1; } - else - if test "${ecos_tcl_incdir}" != "/usr/include" ; then - ecos_INCLUDES="${ecos_INCLUDES} -I${ecos_tcl_incdir}" - fi - fi - - if test -z "${TCL_LIB_SPEC}" -a "${with_tcl_version+set}" = set ; then - - libtcl="" - for i in ${possibles}; do - if test -r "$i/"libtcl${with_tcl_version}.a""; then - libtcl=$i - break - fi - done - - if test -r "${libtcl}/libtcl${with_tcl_version}.a" ; then - TCL_LIB_SPEC="-L${libtcl} -ltcl${with_tcl_version}" - fi - fi - if test -z "${TCL_LIB_SPEC}" ; then - - libtcl="" - for i in ${possibles}; do - if test -r "$i/"libtcl.a""; then - libtcl=$i - break - fi - done - - if test -r "${libtcl}/libtcl.a" ; then - TCL_LIB_SPEC="-L${libtcl} -ltcl" - fi - fi - if test -z "${TCL_LIB_SPEC}" ; then - { echo "configure: error: ${tclconfig}/tclConfig.sh does not define TCL_LIB_SPEC" 1>&2; exit 1; } - fi - ecos_LIBS="${ecos_LIBS} ${TCL_LIB_SPEC}" - - possibles=`echo ${possibles} | sed -e 's,tcl,tk,g'` - - tkconfig="" - for i in ${possibles}; do - if test -r "$i/"tkConfig.sh""; then - tkconfig=$i - break - fi - done - - if test \! -r "${tkconfig}/tkConfig.sh" ; then - { echo "configure: error: unable to locate Tk config file tkConfig.sh" 1>&2; exit 1; } - else - . ${tkconfig}/tkConfig.sh - if test -z "${TK_INC_DIR}" ; then - if test "${TK_PREFIX}" = "/usr" ; then - ecos_tk_includes="${TK_XINCLUDES}" - else - ecos_tk_includes="-I${TK_PREFIX}/include ${TK_XINCLUDES}" - fi - else - ecos_tk_includes="-I${TK_INC_DIR} ${TK_XINCLUDES}" - fi - - if test -z "${TK_LIB_SPEC}" -a "${with_tcl_version+set}" = set ; then - - libtk="" - for i in ${possibles}; do - if test -r "$i/"libtk${with_tcl_version}.a""; then - libtk=$i - break - fi - done - - if test -r "${libtk}/libtk${with_tcl_version}.a" ; then - TK_LIB_SPEC="-L${libtk} -ltk${with_tcl_version}" - fi - fi - if test -z "${TK_LIB_SPEC}" ; then - - libtk="" - for i in ${possibles}; do - if test -r "$i/"libtk.a""; then - libtk=$i - break - fi - done - - if test -r "${libtk}/libtk.a" ; then - TK_LIB_SPEC="-L${libtk} -ltk" - fi - fi - if test -z "${TK_LIB_SPEC}" ; then - { echo "configure: error: ${tkconfig}/tkConfig.sh does not define TK_LIB_SPEC" 1>&2; exit 1; } - fi - ecos_tk_libs="${TK_LIB_SPEC} ${TK_LIBS}" - fi - fi - fi - - echo "$ac_t""-I${ecos_tcl_incdir} ${TCL_LIB_SPEC}" 1>&6 - - - - - - - -trap '' 1 2 15 -cat > confcache <<\EOF -# 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. It is not useful on other systems. -# If it contains results you don't want to keep, you may remove or edit it. -# -# By default, configure uses ./config.cache as the cache file, -# creating it if it does not exist already. You can give configure -# the --cache-file=FILE option to use a different cache file; that is -# what configure does when it calls configure scripts in -# subdirectories, so they share the cache. -# Giving --cache-file=/dev/null disables caching, for debugging configure. -# config.status only pays attention to the cache file if you give it the -# --recheck option to rerun configure. -# -EOF -# The following way of writing the cache mishandles newlines in values, -# but we know of no workaround that is simple, portable, and efficient. -# So, don't put newlines in cache variables' values. -# 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. -(set) 2>&1 | - case `(ac_space=' '; set | grep ac_space) 2>&1` in - *ac_space=\ *) - # `set' does not quote correctly, so add quotes (double-quote substitution - # turns \\\\ into \\, and sed turns \\ into \). - sed -n \ - -e "s/'/'\\\\''/g" \ - -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p" - ;; - *) - # `set' quotes correctly as required by POSIX, so do not add quotes. - sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p' - ;; - esac >> confcache -if cmp -s $cache_file confcache; then - : -else - if test -w $cache_file; then - echo "updating cache $cache_file" - cat confcache > $cache_file - else - echo "not updating unwritable cache $cache_file" - fi -fi -rm -f confcache - -trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 - -test "x$prefix" = xNONE && prefix=$ac_default_prefix -# Let make expand exec_prefix. -test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' - -# Any assignment to VPATH causes Sun make to only execute -# the first set of double-colon rules, so remove it if not needed. -# If there is a colon in the path, we need to keep it. -if test "x$srcdir" = x.; then - ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d' -fi - -trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15 - -DEFS=-DHAVE_CONFIG_H - -# Without the "./", some shells look in PATH for config.status. -: ${CONFIG_STATUS=./config.status} - -echo creating $CONFIG_STATUS -rm -f $CONFIG_STATUS -cat > $CONFIG_STATUS </dev/null | sed 1q`: -# -# $0 $ac_configure_args -# -# Compiler output produced by configure, useful for debugging -# configure, is in ./config.log if it exists. - -ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]" -for ac_option -do - case "\$ac_option" in - -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) - echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion" - exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;; - -version | --version | --versio | --versi | --vers | --ver | --ve | --v) - echo "$CONFIG_STATUS generated by autoconf version 2.13" - exit 0 ;; - -help | --help | --hel | --he | --h) - echo "\$ac_cs_usage"; exit 0 ;; - *) echo "\$ac_cs_usage"; exit 1 ;; - esac -done - -ac_given_srcdir=$srcdir -ac_given_INSTALL="$INSTALL" - -trap 'rm -fr `echo "Makefile:Makefile.in testsuite/Makefile:testsuite/Makefile.in cdlconfig.h:config.h.in" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 -EOF -cat >> $CONFIG_STATUS < conftest.subs <<\\CEOF -$ac_vpsub -$extrasub -s%@SHELL@%$SHELL%g -s%@CFLAGS@%$CFLAGS%g -s%@CPPFLAGS@%$CPPFLAGS%g -s%@CXXFLAGS@%$CXXFLAGS%g -s%@FFLAGS@%$FFLAGS%g -s%@DEFS@%$DEFS%g -s%@LDFLAGS@%$LDFLAGS%g -s%@LIBS@%$LIBS%g -s%@exec_prefix@%$exec_prefix%g -s%@prefix@%$prefix%g -s%@program_transform_name@%$program_transform_name%g -s%@bindir@%$bindir%g -s%@sbindir@%$sbindir%g -s%@libexecdir@%$libexecdir%g -s%@datadir@%$datadir%g -s%@sysconfdir@%$sysconfdir%g -s%@sharedstatedir@%$sharedstatedir%g -s%@localstatedir@%$localstatedir%g -s%@libdir@%$libdir%g -s%@includedir@%$includedir%g -s%@oldincludedir@%$oldincludedir%g -s%@infodir@%$infodir%g -s%@mandir@%$mandir%g -s%@host@%$host%g -s%@host_alias@%$host_alias%g -s%@host_cpu@%$host_cpu%g -s%@host_vendor@%$host_vendor%g -s%@host_os@%$host_os%g -s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g -s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g -s%@INSTALL_DATA@%$INSTALL_DATA%g -s%@PACKAGE@%$PACKAGE%g -s%@VERSION@%$VERSION%g -s%@ACLOCAL@%$ACLOCAL%g -s%@AUTOCONF@%$AUTOCONF%g -s%@AUTOMAKE@%$AUTOMAKE%g -s%@AUTOHEADER@%$AUTOHEADER%g -s%@MAKEINFO@%$MAKEINFO%g -s%@SET_MAKE@%$SET_MAKE%g -s%@MAINTAINER_MODE_TRUE@%$MAINTAINER_MODE_TRUE%g -s%@MAINTAINER_MODE_FALSE@%$MAINTAINER_MODE_FALSE%g -s%@MAINT@%$MAINT%g -s%@CC@%$CC%g -s%@CXX@%$CXX%g -s%@RANLIB@%$RANLIB%g -s%@OBJEXT@%$OBJEXT%g -s%@EXEEXT@%$EXEEXT%g -s%@ecos_CFLAGS@%$ecos_CFLAGS%g -s%@ecos_CXXFLAGS@%$ecos_CXXFLAGS%g -s%@ecos_LDADD@%$ecos_LDADD%g -s%@ecos_INCLUDES@%$ecos_INCLUDES%g -s%@ecos_LIBS@%$ecos_LIBS%g -s%@MSVC_SRCDIR@%$MSVC_SRCDIR%g -s%@MSVC_TRUE@%$MSVC_TRUE%g -s%@MSVC_FALSE@%$MSVC_FALSE%g -s%@ecos_infra_incdir@%$ecos_infra_incdir%g -s%@ecos_infra_libdir@%$ecos_infra_libdir%g -s%@ecos_tk_includes@%$ecos_tk_includes%g -s%@ecos_tk_libs@%$ecos_tk_libs%g - -CEOF -EOF - -cat >> $CONFIG_STATUS <<\EOF - -# Split the substitutions into bite-sized pieces for seds with -# small command number limits, like on Digital OSF/1 and HP-UX. -ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script. -ac_file=1 # Number of current file. -ac_beg=1 # First line for current file. -ac_end=$ac_max_sed_cmds # Line after last line for current file. -ac_more_lines=: -ac_sed_cmds="" -while $ac_more_lines; do - if test $ac_beg -gt 1; then - sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file - else - sed "${ac_end}q" conftest.subs > conftest.s$ac_file - fi - if test ! -s conftest.s$ac_file; then - ac_more_lines=false - rm -f conftest.s$ac_file - else - if test -z "$ac_sed_cmds"; then - ac_sed_cmds="sed -f conftest.s$ac_file" - else - ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file" - fi - ac_file=`expr $ac_file + 1` - ac_beg=$ac_end - ac_end=`expr $ac_end + $ac_max_sed_cmds` - fi -done -if test -z "$ac_sed_cmds"; then - ac_sed_cmds=cat -fi -EOF - -cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF -for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then - # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". - case "$ac_file" in - *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` - ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; - *) ac_file_in="${ac_file}.in" ;; - esac - - # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories. - - # Remove last slash and all that follows it. Not all systems have dirname. - ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` - if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then - # The file is in a subdirectory. - test ! -d "$ac_dir" && mkdir "$ac_dir" - ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`" - # A "../" for each directory in $ac_dir_suffix. - ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'` - else - ac_dir_suffix= ac_dots= - fi - - case "$ac_given_srcdir" in - .) srcdir=. - if test -z "$ac_dots"; then top_srcdir=. - else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;; - /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;; - *) # Relative path. - srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix" - top_srcdir="$ac_dots$ac_given_srcdir" ;; - esac - - case "$ac_given_INSTALL" in - [/$]*) INSTALL="$ac_given_INSTALL" ;; - *) INSTALL="$ac_dots$ac_given_INSTALL" ;; - esac - - echo creating "$ac_file" - rm -f "$ac_file" - configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure." - case "$ac_file" in - *Makefile*) ac_comsub="1i\\ -# $configure_input" ;; - *) ac_comsub= ;; - esac - - ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` - sed -e "$ac_comsub -s%@configure_input@%$configure_input%g -s%@srcdir@%$srcdir%g -s%@top_srcdir@%$top_srcdir%g -s%@INSTALL@%$INSTALL%g -" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file -fi; done -rm -f conftest.s* - -# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where -# NAME is the cpp macro being defined and VALUE is the value it is being given. -# -# ac_d sets the value in "#define NAME VALUE" lines. -ac_dA='s%^\([ ]*\)#\([ ]*define[ ][ ]*\)' -ac_dB='\([ ][ ]*\)[^ ]*%\1#\2' -ac_dC='\3' -ac_dD='%g' -# ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE". -ac_uA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' -ac_uB='\([ ]\)%\1#\2define\3' -ac_uC=' ' -ac_uD='\4%g' -# ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE". -ac_eA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' -ac_eB='$%\1#\2define\3' -ac_eC=' ' -ac_eD='%g' - -if test "${CONFIG_HEADERS+set}" != set; then -EOF -cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF -fi -for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then - # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". - case "$ac_file" in - *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` - ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; - *) ac_file_in="${ac_file}.in" ;; - esac - - echo creating $ac_file - - rm -f conftest.frag conftest.in conftest.out - ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` - cat $ac_file_inputs > conftest.in - -EOF - -# Transform confdefs.h into a sed script conftest.vals that substitutes -# the proper values into config.h.in to produce config.h. And first: -# Protect against being on the right side of a sed subst in config.status. -# Protect against being in an unquoted here document in config.status. -rm -f conftest.vals -cat > conftest.hdr <<\EOF -s/[\\&%]/\\&/g -s%[\\$`]%\\&%g -s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp -s%ac_d%ac_u%gp -s%ac_u%ac_e%gp -EOF -sed -n -f conftest.hdr confdefs.h > conftest.vals -rm -f conftest.hdr - -# This sed command replaces #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. -cat >> conftest.vals <<\EOF -s%^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */% -EOF - -# Break up conftest.vals because some shells have a limit on -# the size of here documents, and old seds have small limits too. - -rm -f conftest.tail -while : -do - ac_lines=`grep -c . conftest.vals` - # grep -c gives empty output for an empty file on some AIX systems. - if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi - # Write a limited-size here document to conftest.frag. - echo ' cat > conftest.frag <> $CONFIG_STATUS - sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS - echo 'CEOF - sed -f conftest.frag conftest.in > conftest.out - rm -f conftest.in - mv conftest.out conftest.in -' >> $CONFIG_STATUS - sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail - rm -f conftest.vals - mv conftest.tail conftest.vals -done -rm -f conftest.vals - -cat >> $CONFIG_STATUS <<\EOF - rm -f conftest.frag conftest.h - echo "/* $ac_file. Generated automatically by configure. */" > conftest.h - cat conftest.in >> conftest.h - rm -f conftest.in - if cmp -s $ac_file conftest.h 2>/dev/null; then - echo "$ac_file is unchanged" - rm -f conftest.h - else - # Remove last slash and all that follows it. Not all systems have dirname. - ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` - if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then - # The file is in a subdirectory. - test ! -d "$ac_dir" && mkdir "$ac_dir" - fi - rm -f $ac_file - mv conftest.h $ac_file - fi -fi; done - -EOF -cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF -test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h - -exit 0 -EOF -chmod +x $CONFIG_STATUS -rm -fr confdefs* $ac_clean_files -test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1 - diff --git a/host/libcdl/configure.in b/host/libcdl/configure.in deleted file mode 100644 --- a/host/libcdl/configure.in +++ /dev/null @@ -1,70 +0,0 @@ -dnl Process this file with autoconf to produce a configure script. -dnl ==================================================================== -dnl -dnl configure.in -dnl -dnl libcdl.a -dnl -dnl ==================================================================== -dnl ####ECOSHOSTGPLCOPYRIGHTBEGIN#### -dnl ---------------------------------------------------------------------------- -dnl Copyright (C) 2002 Bart Veer -dnl Copyright (C) 1998, 1999, 2000, 2001 Red Hat, Inc. -dnl -dnl This file is part of the eCos host tools. -dnl -dnl This program is free software; you can redistribute it and/or modify it -dnl under the terms of the GNU General Public License as published by the Free -dnl Software Foundation; either version 2 of the License, or (at your option) -dnl any later version. -dnl -dnl This program is distributed in the hope that it will be useful, but WITHOUT -dnl ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -dnl FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for -dnl more details. -dnl -dnl You should have received a copy of the GNU General Public License along with -dnl this program; if not, write to the Free Software Foundation, Inc., -dnl 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -dnl -dnl ---------------------------------------------------------------------------- -dnl ####ECOSHOSTGPLCOPYRIGHTEND#### -dnl ==================================================================== -dnl#####DESCRIPTIONBEGIN#### -dnl -dnl Author(s): bartv -dnl Contact(s): bartv -dnl Date: 1998/12/16 -dnl Version: 0.01 -dnl -dnl####DESCRIPTIONEND#### -dnl ==================================================================== - -dnl The core header file had better be present. -AC_INIT(cdlcore.hxx) - -dnl Pick up the support files from the top-level acsupport directory. -AC_CONFIG_AUX_DIR(../../acsupport) - -ECOS_CHECK_BUILD_ne_SRC -AC_CANONICAL_HOST -AM_INIT_AUTOMAKE(libcdl, 0.2) -ECOS_SUBST_VERSION(CYGNUM_LIBCDL_VERSION) -AM_MAINTAINER_MODE - -dnl The package contains a library implemented in C++. It has to be -dnl buildable under NT. Only a static version of the library is -dnl of interest at the moment. -AC_PROG_CC -AC_PROG_CXX -AC_PROG_RANLIB -AC_OBJEXT -AC_EXEEXT -ECOS_PROG_MSVC -ECOS_PROG_STANDARD_COMPILER_FLAGS -ECOS_ARG_INFRASTRUCTURE -ECOS_PATH_INFRA -ECOS_PATH_TCL - -AM_CONFIG_HEADER(cdlconfig.h:config.h.in) -AC_OUTPUT(Makefile:Makefile.in testsuite/Makefile:testsuite/Makefile.in) diff --git a/host/libcdl/conflict.cxx b/host/libcdl/conflict.cxx deleted file mode 100644 --- a/host/libcdl/conflict.cxx +++ /dev/null @@ -1,1039 +0,0 @@ -//{{{ Banner - -//============================================================================ -// -// conflict.cxx -// -// The CdlConflict class -// -//============================================================================ -//####COPYRIGHTBEGIN#### -// -// ---------------------------------------------------------------------------- -// Copyright (C) 1999, 2000 Red Hat, Inc. -// -// This file is part of the eCos host tools. -// -// This program is free software; you can redistribute it and/or modify it -// under the terms of the GNU General Public License as published by the Free -// Software Foundation; either version 2 of the License, or (at your option) -// any later version. -// -// This program is distributed in the hope that it will be useful, but WITHOUT -// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for -// more details. -// -// You should have received a copy of the GNU General Public License along with -// this program; if not, write to the Free Software Foundation, Inc., -// 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -// -// ---------------------------------------------------------------------------- -// -//####COPYRIGHTEND#### -//============================================================================ -//#####DESCRIPTIONBEGIN#### -// -// Author(s): bartv -// Contact(s): bartv -// Date: 1999/01/28 -// Version: 0.02 -// -//####DESCRIPTIONEND#### -//============================================================================ - -//}}} -//{{{ #include's - -// ---------------------------------------------------------------------------- -#include "cdlconfig.h" - -// Get the infrastructure types, assertions, tracing and similar -// facilities. -#include -#include - -// defines everything implemented in this module. -// It implicitly supplies , and because -// the class definitions rely on these headers. It also brings -// in -#include - -//}}} - -//{{{ Statics - -// ---------------------------------------------------------------------------- -CYGDBG_DEFINE_MEMLEAK_COUNTER(CdlConflictBody); -CYGDBG_DEFINE_MEMLEAK_COUNTER(CdlConflict_UnresolvedBody); -CYGDBG_DEFINE_MEMLEAK_COUNTER(CdlConflict_IllegalValueBody); -CYGDBG_DEFINE_MEMLEAK_COUNTER(CdlConflict_EvalExceptionBody); -CYGDBG_DEFINE_MEMLEAK_COUNTER(CdlConflict_RequiresBody); -CYGDBG_DEFINE_MEMLEAK_COUNTER(CdlConflict_DataBody); - -//}}} -//{{{ CdlConflict - -//{{{ Creation and destruction - -// ---------------------------------------------------------------------------- -// The basic conflicts. Conflicts are created in the context of a transaction. -// If the transaction gets committed then they are transferred to a toplevel. -// If the transaction gets cancelled then they just disappear. -// -// A conflict that is only part of a transaction may go away as that -// transaction proceeds, in which case it can be deleted immediately. -// A conflict that is already part of the toplevel cannot be -// destroyed, instead it gets marked in the transaction object. Only -// when the transaction is committed does the object get deleted. -// In addition within the context of a transaction old conflicts -// may hang around for a while. -// - -CdlConflictBody::CdlConflictBody(CdlTransaction trans_arg, CdlNode node_arg, CdlProperty property_arg, bool structural_arg) -{ - CYG_REPORT_FUNCNAME("CdlConflict:: constructor"); - CYG_REPORT_FUNCARG4XV(this, trans_arg, node_arg, property_arg); - CYG_PRECONDITION_CLASSC(trans_arg); - CYG_PRECONDITION_CLASSC(node_arg); - CYG_PRECONDITION_CLASSC(property_arg); - - node = node_arg; - property = property_arg; - transaction = trans_arg; - structural = structural_arg; - no_solution = false; - // The vectors take care of themselves - enabled = true; - reason = ""; - - transaction->dirty = true; - if (structural_arg) { - transaction->new_structural_conflicts.push_back(this); - } else { - transaction->new_conflicts.push_back(this); - } - - cdlconflictbody_cookie = CdlConflictBody_Magic; - CYGDBG_MEMLEAK_CONSTRUCTOR(); - - CYG_POSTCONDITION_THISC(); - CYG_REPORT_RETURN(); -} - - -// ---------------------------------------------------------------------------- -// The destructor can get invoked during a transaction commit, in the -// case of a global conflict, or from inside clear() for a per-transaction -// conflict. In all cases the calling code is responsible for removing -// the conflict from any STL containers. - -CdlConflictBody::~CdlConflictBody() -{ - CYG_REPORT_FUNCNAME("CdlConflict:: destructor"); - CYG_REPORT_FUNCARG1XV(this); - CYG_PRECONDITION_THISC(); - - cdlconflictbody_cookie = CdlConflictBody_Invalid; - reason = ""; - enabled = false; - no_solution = false; - solution.clear(); - solution_references.clear(); - structural = false; - transaction = 0; - property = 0; - node = 0; - CYGDBG_MEMLEAK_DESTRUCTOR(); - - CYG_REPORT_RETURN(); -} - -//}}} -//{{{ Solution support - -// ---------------------------------------------------------------------------- -bool -CdlConflictBody::has_known_solution() const -{ - CYG_REPORT_FUNCNAMETYPE("CdlConflict::has_solution", "result %d"); - CYG_REPORT_FUNCARG1XV(this); - CYG_PRECONDITION_THISC(); - - bool result = (0 != solution.size()); - - CYG_REPORT_RETVAL(result); - return result; -} - -bool -CdlConflictBody::has_no_solution() const -{ - CYG_REPORT_FUNCNAMETYPE("CdlConflict::has_no_solution", "result %d"); - CYG_REPORT_FUNCARG1XV(this); - CYG_PRECONDITION_THISC(); - - bool result = no_solution; - - CYG_REPORT_RETVAL(result); - return result; -} - -const std::vector >& -CdlConflictBody::get_solution() const -{ - CYG_REPORT_FUNCNAME("CdlConflict::get_solution"); - CYG_REPORT_FUNCARG1XV(this); - CYG_PRECONDITION_THISC(); - - CYG_REPORT_RETURN(); - return solution; -} - -const std::set& -CdlConflictBody::get_solution_references() const -{ - CYG_REPORT_FUNCNAME("CdlConflict::get_solution_references"); - CYG_REPORT_FUNCARG1XV(this); - CYG_PRECONDITION_THISC(); - - CYG_REPORT_RETURN(); - return solution_references; -} - -// ---------------------------------------------------------------------------- -// Try to resolve a conflict. If the conflict was created in a transaction, -// use that transaction. More commonly the conflict will be global and -// a new transaction will have to be created specially for it. Either -// way the conflict may cease to exist. -void -CdlConflictBody::resolve() -{ - CYG_REPORT_FUNCNAME("CdlConflict::resolve"); - CYG_REPORT_FUNCARG1XV(this); - CYG_PRECONDITION_THISC(); - CYG_PRECONDITIONC(0 == transaction); - - if (this->resolution_implemented()) { - CdlTransaction transact = CdlTransactionBody::make(this->get_node()->get_toplevel()); - transact->resolve(this); - transact->body(); - delete transact; - } - - CYG_REPORT_RETURN(); -} - -// ---------------------------------------------------------------------------- -// A valuable has just been changed. If this value was relevant to the -// current solution (or lack thereof) then an update is necessary. -void -CdlConflictBody::update_solution_validity(CdlValuable valuable) -{ - CYG_REPORT_FUNCNAME("CdlConflict::update_solution_validity"); - CYG_REPORT_FUNCARG2XV(this, valuable); - CYG_PRECONDITION_THISC(); - - if (solution_references.find(valuable) != solution_references.end()) { - no_solution = false; - solution.clear(); - solution_references.clear(); - } - - CYG_REPORT_RETURN(); -} - -// ---------------------------------------------------------------------------- -// Default implementations of the inference engine do not do a lot... -bool -CdlConflictBody::inner_resolve(CdlTransaction trans_arg, int level) -{ - CYG_REPORT_FUNCNAMETYPE("CdlConflict::inner_resolve", "result false"); - CYG_REPORT_FUNCARG3XV(this, trans_arg, level); - CYG_PRECONDITION_THISC(); - CYG_PRECONDITION_CLASSC(trans_arg); - - // Setting the no_solution flag while keeping a clear - // solution_accessed vector means that the no_solution flag should - // always remain set, and hence no further inference attempts will be made. - no_solution = true; - - CYG_REPORT_RETURN(); - return false; -} - -bool -CdlConflictBody::resolution_implemented() const -{ - CYG_REPORT_FUNCNAMETYPE("CdlConflict::resolution_implemented", "result %d"); - CYG_REPORT_FUNCARG1XV(this); - CYG_PRECONDITION_THISC(); - - CYG_REPORT_RETVAL(false); - return false; -} - -// ---------------------------------------------------------------------------- -// Clearing a solution. This is needed if the inference engine has -// failed to find a complete solution, because in attempting this the -// solution_references vector will have been filled in anyway. It may -// have some other uses as well. -void -CdlConflictBody::clear_solution() -{ - CYG_REPORT_FUNCNAME("CdlConflict::clear_solution"); - CYG_REPORT_FUNCARG1XV(this); - CYG_PRECONDITION_THISC(); - - no_solution = false; - solution.clear(); - solution_references.clear(); - - CYG_REPORT_RETURN(); -} - -//}}} -//{{{ Basics - -// ---------------------------------------------------------------------------- - -CdlNode -CdlConflictBody::get_node() const -{ - CYG_REPORT_FUNCNAMETYPE("CdlConflict::get_node", "result %p"); - CYG_REPORT_FUNCARG1XV(this); - CYG_PRECONDITION_THISC(); - - CdlNode result = node; - CYG_REPORT_RETVAL(result); - return result; -} - -CdlProperty -CdlConflictBody::get_property() const -{ - CYG_REPORT_FUNCNAMETYPE("CdlConflict::get_property", "result %p"); - CYG_REPORT_FUNCARG1XV(this); - CYG_PRECONDITION_THISC(); - - CdlProperty result = property; - CYG_REPORT_RETVAL(result); - return result; -} - -bool -CdlConflictBody::is_structural() const -{ - CYG_REPORT_FUNCNAMETYPE("CdlConflict::is_structural", "result %d"); - CYG_REPORT_FUNCARG1XV(this); - CYG_PRECONDITION_THISC(); - - bool result = structural; - CYG_REPORT_RETVAL(result); - return result; -} - -CdlTransaction -CdlConflictBody::get_transaction() const -{ - CYG_REPORT_FUNCNAMETYPE("CdlConflict::get_transaction", "result %p"); - CYG_REPORT_FUNCARG1XV(this); - CYG_PRECONDITION_THISC(); - - CdlTransaction result = transaction; - CYG_REPORT_RETVAL(result); - return result; -} - -// FIXME: these are not currently implemented. It would be necessary -// to store the information in the savefile, which requires an -// unambiguous way of identifying a conflict that is likely to -// survice package version changes. - -bool -CdlConflictBody::is_enabled() const -{ - CYG_REPORT_FUNCNAMETYPE("CdlConflict::is_enabled", "result %d"); - CYG_REPORT_FUNCARG1XV(this); - CYG_PRECONDITION_THISC(); - - bool result = enabled; - CYG_REPORT_RETVAL(result); - return result; -} - -std::string -CdlConflictBody::get_disabled_reason() const -{ - CYG_REPORT_FUNCNAME("CdlConflict::get_disabled_reason"); - CYG_REPORT_FUNCARG1XV(this); - CYG_PRECONDITION_THISC(); - - // Possibly there should be a check that the conflict is currently - // disabled, but it might be useful. - CYG_REPORT_RETURN(); - return reason; -} - -void -CdlConflictBody::disable(std::string reason_arg) -{ - CYG_REPORT_FUNCNAME("CdlConflict::disable"); - CYG_REPORT_FUNCARG1XV(this); - CYG_PRECONDITION_THISC(); - - reason = reason_arg; - enabled = false; - - CYG_REPORT_RETURN(); -} - -void -CdlConflictBody::enable() -{ - CYG_REPORT_FUNCNAME("CdlConflict::enable"); - CYG_REPORT_FUNCARG1XV(this); - CYG_PRECONDITION_THISC(); - - enabled = true; - // Leave "reason" alone, it may still be useful - - CYG_REPORT_RETURN(); -} - -//}}} -//{{{ check_this() - -// ---------------------------------------------------------------------------- -bool -CdlConflictBody::check_this(cyg_assert_class_zeal zeal) const -{ - if (CdlConflictBody_Magic != cdlconflictbody_cookie) { - return false; - } - CYGDBG_MEMLEAK_CHECKTHIS(); - if ((0 == node) || (0 == property)) { - return false; - } - switch(zeal) { - case cyg_system_test : - case cyg_extreme : - { - if (!node->check_this(cyg_quick)) { - return false; - } - // Accessing the properties would involve a function call. - - if (0 != transaction) { - if (!transaction->check_this(cyg_quick)) { - return false; - } - if (structural) { - // The conflict should exist in the new_structural_conflicts vector - // deleted_structural_conflicts is for toplevel ones. - if (std::find(transaction->new_structural_conflicts.begin(), - transaction->new_structural_conflicts.end(), this) == - transaction->new_structural_conflicts.end()) { - return false; - } - } else { - // The conflict may appear on the new_conflicts list - // or in the resolved_conflicts vector. - if (std::find(transaction->new_conflicts.begin(), transaction->new_conflicts.end(), this) == - transaction->new_conflicts.end()) { - - if (std::find(transaction->resolved_conflicts.begin(), transaction->resolved_conflicts.end(), this) == - transaction->resolved_conflicts.end()) { - - return false; - } - } - } - } - // Checking the toplevel lists would be good, but involves a - // further function call and hence nested assertions. - } - case cyg_thorough : - { - if (!node->check_this(cyg_quick)) { - return false; - } - if (!property->check_this(cyg_quick)) { - return false; - } - } - case cyg_quick : - { - if (no_solution && (0 != solution.size())) { - return false; - } - } - case cyg_trivial : - case cyg_none : - default: - break; - } - - return true; -} - -//}}} - -//}}} -//{{{ CdlConflict_Unresolved - -// ---------------------------------------------------------------------------- -// Unresolved references. Usually unresolved references occur inside -// expressions, but other properties that may be affected are parent, -// dialog and wizard. -// -// It is possible for a single expression to have multiple unresolved -// references, each of which will result in a separate conflict -// object. It is also possible for an expression to refer to the same -// unknown entity twice or more, in which case there would also be -// separate conflict objects. Unresolved references may also result in -// eval exceptions and in failed requires statements. Trying to cope -// with the various combinations as a single conflict seems too -// error-prone. - -void -CdlConflict_UnresolvedBody::make(CdlTransaction trans, CdlNode node_arg, CdlProperty prop_arg, std::string name_arg) -{ - CdlConflict_Unresolved tmp = new CdlConflict_UnresolvedBody(trans, node_arg, prop_arg, name_arg); - CYG_UNUSED_PARAM(CdlConflict_Unresolved, tmp); -} - -CdlConflict_UnresolvedBody::CdlConflict_UnresolvedBody(CdlTransaction trans_arg, CdlNode node_arg, CdlProperty prop_arg, - std::string target_name_arg) - : CdlConflictBody(trans_arg, node_arg, prop_arg, true) -{ - CYG_REPORT_FUNCNAME("CdlConflict_Unresolved:: constructor"); - CYG_REPORT_FUNCARG1XV(this); - CYG_PRECONDITIONC("" != target_name_arg); - - target_name = target_name_arg; - cdlconflict_unresolvedbody_cookie = CdlConflict_UnresolvedBody_Magic; - CYGDBG_MEMLEAK_CONSTRUCTOR(); - - CYG_POSTCONDITION_THISC(); - CYG_REPORT_RETURN(); -} - -CdlConflict_UnresolvedBody::~CdlConflict_UnresolvedBody() -{ - CYG_REPORT_FUNCNAME("CdlConflict_Unresolved:: destructor"); - CYG_REPORT_FUNCARG1XV(this); - CYG_PRECONDITION_THISC(); - - cdlconflict_unresolvedbody_cookie = CdlConflict_UnresolvedBody_Invalid; - target_name = ""; - CYGDBG_MEMLEAK_DESTRUCTOR(); - - CYG_REPORT_RETURN(); -} - -std::string -CdlConflict_UnresolvedBody::get_target_name() const -{ - CYG_REPORT_FUNCNAME("CdlConflict_Unresolved::get_target_name"); - CYG_REPORT_FUNCARG1XV(this); - CYG_PRECONDITION_THISC(); - - CYG_REPORT_RETURN(); - return target_name; -} - -// For now, just report the node and property name, a brief text, and the -// entity being referenced. -// -// Eventually we can do clever things like looking up the name in a -// database. - -std::string -CdlConflict_UnresolvedBody::get_explanation() const -{ - CYG_REPORT_FUNCNAME("CdlConflict_Unresolved::get_explanation"); - CYG_REPORT_FUNCARG1XV(this); - CYG_PRECONDITION_THISC(); - - std::string result; - result = node->get_name() + ", property " + property->get_property_name() + - ":\nReference to unknown object " + target_name; - - CYG_REPORT_RETURN(); - return result; -} - -bool -CdlConflict_UnresolvedBody::check_this(cyg_assert_class_zeal zeal) const -{ - if (CdlConflict_UnresolvedBody_Magic != cdlconflict_unresolvedbody_cookie) { - return false; - } - CYGDBG_MEMLEAK_CHECKTHIS(); - - // There is not a lot of checking that can be done on the name. - - return CdlConflictBody::check_this(zeal); -} - -bool -CdlConflict_UnresolvedBody::test(CdlConflict conf) -{ - CYG_REPORT_FUNCNAMETYPE("CdlConflict_Unresolved::test", "result %d"); - CYG_REPORT_FUNCARG1XV(conf); - CYG_PRECONDITION_CLASSC(conf); - - bool result = false; - CdlConflict_Unresolved tmp = dynamic_cast(conf); - if (0 != tmp) { - result = true; - } - - CYG_REPORT_RETVAL(result); - return result; -} - -//}}} -//{{{ CdlConflict_IllegalValue - -// ---------------------------------------------------------------------------- -// A valuable object has an illegal value. This can happen because the -// current value is not within the legal_values list, or because of a -// failure of check_proc or entry_proc. In the latter two cases the -// Tcl code should supply an explanation as to why the value is illegal. -// -// Note: if future variants of CDL implement some concept of a value -// that does not match the CdlValuable class then that will need a -// separate CdlConflict derived class. - -void -CdlConflict_IllegalValueBody::make(CdlTransaction trans, CdlNode node_arg, CdlProperty prop_arg) -{ - CdlConflict_IllegalValue tmp = new CdlConflict_IllegalValueBody(trans, node_arg, prop_arg); - CYG_UNUSED_PARAM(CdlConflict_IllegalValue, tmp); -} - -CdlConflict_IllegalValueBody::CdlConflict_IllegalValueBody(CdlTransaction trans, CdlNode node_arg, CdlProperty prop_arg) - : CdlConflictBody(trans, node_arg, prop_arg, false) -{ - CYG_REPORT_FUNCNAME("CdlConflict_IllegalValue:: constructor"); - CYG_REPORT_FUNCARG1XV(this); - CYG_PRECONDITIONC(0 != dynamic_cast(node_arg)); - - explanation = ""; - cdlconflict_illegalvaluebody_cookie = CdlConflict_IllegalValueBody_Magic; - CYGDBG_MEMLEAK_CONSTRUCTOR(); - - CYG_POSTCONDITION_THISC(); - CYG_REPORT_RETURN(); -} - -CdlConflict_IllegalValueBody::~CdlConflict_IllegalValueBody() -{ - CYG_REPORT_FUNCNAME("CdlConflict_IllegalValue:: destructor"); - CYG_REPORT_FUNCARG1XV(this); - CYG_PRECONDITION_THISC(); - - cdlconflict_illegalvaluebody_cookie = CdlConflict_IllegalValueBody_Invalid; - explanation = ""; - CYGDBG_MEMLEAK_DESTRUCTOR(); - - CYG_REPORT_RETURN(); -} - -// ---------------------------------------------------------------------------- -// If the property is legal_values then it should be a list expression -// property. Display the current value and the original expression. -// -// If the property is check_proc or entry_proc, the Tcl code should -// have produced an explanation string and stored it in the conflict -// object. -std::string -CdlConflict_IllegalValueBody::get_explanation() const -{ - CYG_REPORT_FUNCNAME("CdlConflict_IllegalValue::get_explanation()"); - CYG_REPORT_FUNCARG1XV(this); - CYG_PRECONDITION_THISC(); - - CdlConstValuable valuable = dynamic_cast(node); - CYG_ASSERTC(0 != valuable); - - std::string result = ""; - - // FIXME: analyse the current value and flavor a bit more - result += "Illegal current value " + valuable->get_value() + "\n"; - - if (CdlPropertyId_LegalValues == property->get_property_name()) { - - CdlConstProperty_ListExpression expr = dynamic_cast(property); - CYG_ASSERTC(0 != expr); - result += "Legal values are: " + expr->get_original_string(); - - } else if (explanation != "") { - - result += explanation; - } else { - - CYG_FAIL("Inexplicable illegal value"); - } - - CYG_REPORT_RETURN(); - return result; -} - -void -CdlConflict_IllegalValueBody::set_explanation(std::string explanation_arg) -{ - CYG_REPORT_FUNCNAME("CdlConflict_IllegalValue::set_explanation"); - CYG_REPORT_FUNCARG1XV(this); - CYG_PRECONDITION_THISC(); - - explanation = explanation_arg; - - CYG_REPORT_RETURN(); -} - -// ---------------------------------------------------------------------------- -// Inference is implemented. The actual inference code is in infer.cxx -bool -CdlConflict_IllegalValueBody::resolution_implemented() const -{ - CYG_REPORT_FUNCNAME("CdlConflict_IllegalValue::resolution_implemented"); - CYG_REPORT_FUNCARG1XV(this); - CYG_PRECONDITION_THISC(); - - CYG_REPORT_RETURN(); - return true; -} - -// ---------------------------------------------------------------------------- -bool -CdlConflict_IllegalValueBody::check_this(cyg_assert_class_zeal zeal) const -{ - if (CdlConflict_IllegalValueBody_Magic != cdlconflict_illegalvaluebody_cookie) { - return false; - } - CYGDBG_MEMLEAK_CHECKTHIS(); - - return CdlConflictBody::check_this(zeal); -} - -bool -CdlConflict_IllegalValueBody::test(CdlConflict conf) -{ - CYG_REPORT_FUNCNAMETYPE("CdlConflict_IllegalValue::test", "result %d"); - CYG_REPORT_FUNCARG1XV(conf); - CYG_PRECONDITION_CLASSC(conf); - - bool result = false; - CdlConflict_IllegalValue tmp = dynamic_cast(conf); - if (0 != tmp) { - result = true; - } - - CYG_REPORT_RETVAL(result); - return result; -} - -//}}} -//{{{ CdlConflict_EvalException - -// ---------------------------------------------------------------------------- -// Run-time expression failures are possible because of division by -// zero, if for no other reason. The evaluation code should have -// stored a suitable diagnostic with the conflict. This is not part -// of the constructor, allowing the conflict object to be re-used -// if the detailed reason changes - -void -CdlConflict_EvalExceptionBody::make(CdlTransaction trans, CdlNode node_arg, CdlProperty prop_arg, std::string msg_arg) -{ - CdlConflict_EvalException tmp = new CdlConflict_EvalExceptionBody(trans, node_arg, prop_arg, msg_arg); - CYG_UNUSED_PARAM(CdlConflict_EvalException, tmp); -} - -CdlConflict_EvalExceptionBody::CdlConflict_EvalExceptionBody(CdlTransaction trans, CdlNode node_arg, CdlProperty prop_arg, - std::string msg_arg) - : CdlConflictBody(trans, node_arg, prop_arg, false) -{ - CYG_REPORT_FUNCNAME("CdlConflict_EvalException"); - CYG_REPORT_FUNCARG1XV(this); - - explanation = msg_arg; - cdlconflict_evalexceptionbody_cookie = CdlConflict_EvalExceptionBody_Magic; - CYGDBG_MEMLEAK_CONSTRUCTOR(); - - CYG_POSTCONDITION_THISC(); - CYG_REPORT_RETURN(); -} - -CdlConflict_EvalExceptionBody::~CdlConflict_EvalExceptionBody() -{ - CYG_REPORT_FUNCNAME("CdlConflict_EvalException"); - CYG_REPORT_FUNCARG1XV(this); - CYG_PRECONDITION_THISC(); - - cdlconflict_evalexceptionbody_cookie = CdlConflict_EvalExceptionBody_Invalid; - explanation = ""; - CYGDBG_MEMLEAK_DESTRUCTOR(); - - CYG_REPORT_RETURN(); -} - -// If there has been an eval exception then the property must be an -// ordinary expression, a list expression, or a goal expression -std::string -CdlConflict_EvalExceptionBody::get_explanation() const -{ - CYG_REPORT_FUNCNAME("CdlConflict_EvalException::get_explanation"); - CYG_REPORT_FUNCARG1XV(this); - CYG_PRECONDITION_THISC(); - - std::string result = node->get_name() + ", property " + property->get_property_name() + "\n"; - result += "Error while evaluation expression: "; - if ("" != explanation) { - result += explanation; - } - result += "\n"; - - if (CdlConstProperty_Expression expr = dynamic_cast(property)) { - - result += "Expression: " + expr->get_original_string(); - - } else if (CdlConstProperty_ListExpression lexpr = dynamic_cast(property)) { - - result += "List expression: " + lexpr->get_original_string(); - - } else if (CdlConstProperty_GoalExpression gexpr = dynamic_cast(property)) { - - result += "Goal expression: " + gexpr->get_original_string(); - - } else { - CYG_FAIL("Unknown expression type"); - } - - CYG_REPORT_RETURN(); - return result; -} - -void -CdlConflict_EvalExceptionBody::set_explanation(std::string explanation_arg) -{ - CYG_REPORT_FUNCNAME("CdlConflict_EvalException::set_explanation"); - CYG_REPORT_FUNCARG1XV(this); - CYG_PRECONDITION_THISC(); - - explanation = explanation_arg; - - CYG_REPORT_RETURN(); -} - -bool -CdlConflict_EvalExceptionBody::check_this(cyg_assert_class_zeal zeal) const -{ - if (CdlConflict_EvalExceptionBody_Magic != cdlconflict_evalexceptionbody_cookie) { - return false; - } - CYGDBG_MEMLEAK_CHECKTHIS(); - return CdlConflictBody::check_this(zeal); -} - -bool -CdlConflict_EvalExceptionBody::test(CdlConflict conf) -{ - CYG_REPORT_FUNCNAMETYPE("CdlConflict_EvalException::test", "result %d"); - CYG_REPORT_FUNCARG1XV(conf); - CYG_PRECONDITION_CLASSC(conf); - - bool result = false; - CdlConflict_EvalException tmp = dynamic_cast(conf); - if (0 != tmp) { - result = true; - } - - CYG_REPORT_RETVAL(result); - return result; -} - -//}}} -//{{{ CdlConflict_Requires - -// ---------------------------------------------------------------------------- -// A requires constraint is not satisfied. Producing a decent diagnostic -// here requires a detailed understanding of goal expressions. For now -// there is no extra data associated with goal expressions. - -void -CdlConflict_RequiresBody::make(CdlTransaction trans, CdlNode node_arg, CdlProperty prop_arg) -{ - CdlConflict_Requires tmp = new CdlConflict_RequiresBody(trans, node_arg, prop_arg); - CYG_UNUSED_PARAM(CdlConflict_Requires, tmp); -} - -CdlConflict_RequiresBody::CdlConflict_RequiresBody(CdlTransaction trans, CdlNode node_arg, CdlProperty prop_arg) - : CdlConflictBody(trans, node_arg, prop_arg, false) -{ - CYG_REPORT_FUNCNAME("CdlConflict_Requires:: constructor"); - CYG_REPORT_FUNCARG1XV(this); - CYG_PRECONDITIONC(0 != dynamic_cast(prop_arg)); - - cdlconflict_requiresbody_cookie = CdlConflict_RequiresBody_Magic; - CYGDBG_MEMLEAK_CONSTRUCTOR(); - - CYG_POSTCONDITION_THISC(); - CYG_REPORT_RETURN(); -} - -CdlConflict_RequiresBody::~CdlConflict_RequiresBody() -{ - CYG_REPORT_FUNCNAME("CdlConflict_Requires:: destructor"); - CYG_REPORT_FUNCARG1XV(this); - CYG_PRECONDITION_THISC(); - - cdlconflict_requiresbody_cookie = CdlConflict_RequiresBody_Invalid; - CYGDBG_MEMLEAK_DESTRUCTOR(); - - CYG_REPORT_RETURN(); -} - -// FIXME: implement properly -std::string -CdlConflict_RequiresBody::get_explanation() const -{ - CYG_REPORT_FUNCNAME("CdlConflict::get_explanation"); - CYG_REPORT_FUNCARG1XV(this); - CYG_PRECONDITION_THISC(); - - CdlConstProperty_GoalExpression gexpr = dynamic_cast(property); - CYG_ASSERTC(0 != gexpr); - - std::string result = ""; - result += "\"requires\" constraint not satisfied: " + gexpr->get_original_string(); - - CYG_REPORT_RETURN(); - return result; -} - -// Inference is implemented, see infer.cxx -bool -CdlConflict_RequiresBody::resolution_implemented() const -{ - CYG_REPORT_FUNCNAME("CdlConflict_Requires"); - CYG_REPORT_FUNCARG1XV(this); - CYG_PRECONDITION_THISC(); - - CYG_REPORT_RETURN(); - return true; -} - -bool -CdlConflict_RequiresBody::check_this(cyg_assert_class_zeal zeal) const -{ - if (CdlConflict_RequiresBody_Magic != cdlconflict_requiresbody_cookie) { - return false; - } - CYGDBG_MEMLEAK_CHECKTHIS(); - return CdlConflictBody::check_this(zeal); -} - -bool -CdlConflict_RequiresBody::test(CdlConflict conf) -{ - CYG_REPORT_FUNCNAMETYPE("CdlConflict_Requires::test", "result %d"); - CYG_REPORT_FUNCARG1XV(conf); - CYG_PRECONDITION_CLASSC(conf); - - bool result = false; - CdlConflict_Requires tmp = dynamic_cast(conf); - if (0 != tmp) { - result = true; - } - - CYG_REPORT_RETVAL(result); - return result; -} - -//}}} -//{{{ CdlConflict_Data - -// ---------------------------------------------------------------------------- -// There is some strange problem in the configuration data, for example -// a parent property that is resolved but the target is not a container. - -void -CdlConflict_DataBody::make(CdlTransaction trans, CdlNode node_arg, CdlProperty prop_arg, std::string message_arg) -{ - CdlConflict_Data tmp = new CdlConflict_DataBody(trans, node_arg, prop_arg, message_arg); - CYG_UNUSED_PARAM(CdlConflict_Data, tmp); -} - -CdlConflict_DataBody::CdlConflict_DataBody(CdlTransaction trans, CdlNode node_arg, CdlProperty prop_arg, - std::string message_arg) - : CdlConflictBody(trans, node_arg, prop_arg, true) -{ - CYG_REPORT_FUNCNAME("CdlConflict_Data:: constructor"); - CYG_REPORT_FUNCARG1XV(this); - CYG_PRECONDITIONC("" != message_arg); - - message = message_arg; - cdlconflict_databody_cookie = CdlConflict_DataBody_Magic; - CYGDBG_MEMLEAK_CONSTRUCTOR(); - - CYG_POSTCONDITION_THISC(); - CYG_REPORT_RETURN(); -} - -CdlConflict_DataBody::~CdlConflict_DataBody() -{ - CYG_REPORT_FUNCNAME("CdlConflict_ata: destructor"); - CYG_REPORT_FUNCARG1XV(this); - CYG_PRECONDITION_THISC(); - - cdlconflict_databody_cookie = CdlConflict_DataBody_Invalid; - CYGDBG_MEMLEAK_DESTRUCTOR(); - - CYG_REPORT_RETURN(); -} - -std::string -CdlConflict_DataBody::get_explanation() const -{ - CYG_REPORT_FUNCNAME("CdlConflict_Data::get_explanation"); - CYG_REPORT_FUNCARG1XV(this); - CYG_PRECONDITION_THISC(); - - std::string result = message; - - CYG_REPORT_RETURN(); - return result; -} - -bool -CdlConflict_DataBody::check_this(cyg_assert_class_zeal zeal) const -{ - if (CdlConflict_DataBody_Magic != cdlconflict_databody_cookie) { - return false; - } - CYGDBG_MEMLEAK_CHECKTHIS(); - return CdlConflictBody::check_this(zeal); -} - -bool -CdlConflict_DataBody::test(CdlConflict conf) -{ - CYG_REPORT_FUNCNAMETYPE("CdlConflict_Data::test", "result %d"); - CYG_REPORT_FUNCARG1XV(conf); - CYG_PRECONDITION_CLASSC(conf); - - bool result = false; - CdlConflict_Data tmp = dynamic_cast(conf); - if (0 != tmp) { - result = true; - } - - CYG_REPORT_RETVAL(result); - return result; -} - -//}}} diff --git a/host/libcdl/database.cxx b/host/libcdl/database.cxx deleted file mode 100644 --- a/host/libcdl/database.cxx +++ /dev/null @@ -1,1707 +0,0 @@ -//{{{ Banner - -//============================================================================ -// -// database.cxx -// -// Temporary implementation of the CdlPackagesDatabase class -// Implementations of the temporary CdlTargetsDatabase and -// CdlTemplatesDatabase classes. -// -//============================================================================ -//####COPYRIGHTBEGIN#### -// -// ---------------------------------------------------------------------------- -// Copyright (C) 2002, 2003 Bart Veer -// Copyright (C) 1999, 2000, 2001 Red Hat, Inc. -// -// This file is part of the eCos host tools. -// -// This program is free software; you can redistribute it and/or modify it -// under the terms of the GNU General Public License as published by the Free -// Software Foundation; either version 2 of the License, or (at your option) -// any later version. -// -// This program is distributed in the hope that it will be useful, but WITHOUT -// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for -// more details. -// -// You should have received a copy of the GNU General Public License along with -// this program; if not, write to the Free Software Foundation, Inc., -// 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -// -// ---------------------------------------------------------------------------- -// -//####COPYRIGHTEND#### -//============================================================================ -//#####DESCRIPTIONBEGIN#### -// -// Author(s): bartv -// Contact(s): bartv -// Date: 1999/01/21 -// Version: 0.02 -// -//####DESCRIPTIONEND#### -//============================================================================ - -//}}} -//{{{ #include's - -// ---------------------------------------------------------------------------- -#include "cdlconfig.h" - -// Get the infrastructure types, assertions, tracing and similar -// facilities. -#include -#include - -// defines everything implemented in this module. -// It implicitly supplies , and because -// the class definitions rely on these headers. -#include - -// strcmp() is useful when dealing with Tcl strings. -#include - -//}}} - -//{{{ Statics - -// ---------------------------------------------------------------------------- -// Some test cases may want to read in a file other than -// "ecos.db", e.g. to facilitate testing the error conditions. -char* -CdlPackagesDatabaseBody::database_name = "ecos.db"; - -// Should warnings be issued for minor database inconsistencies? -bool CdlPackagesDatabaseBody::verbose_mode = false; - -// The new_package etc. commands need to store the name of the -// current package so that subsequent commands can do the right thing. -// Using constant strings as the key avoids typo problems. -const char* dbparser_pkgname = "::dbparser_pkgname"; -const char* dbparser_pkgdata = "__cdl_dbparser_pkgdata"; -const char* dbparser_targetname = "::dbparser_targetname"; -const char* dbparser_targetdata = "__cdl_dbparser_targetdata"; -const char* dbparser_component_repository = "::component_repository"; -const char* dbparser_database_key = "__dbparser_key"; // for assoc data -const char* template_description_key = "__cdl_extract_template_description"; // ditto -const char* template_packages_key = "__cdl_extract_template_packages"; - -// These are useful for generating diagnostics. -static std::string diag_package = std::string("package "); -static std::string diag_target = std::string("target "); - -CYGDBG_DEFINE_MEMLEAK_COUNTER(CdlPackagesDatabaseBody); - -//}}} -//{{{ Tcl commands for the parser - -//{{{ CdlDbParser class - -// ---------------------------------------------------------------------------- -// Commands that get invoked from inside the Tcl interpreter. These -// need access to the internals of the database objects, which can be -// achieved by making them static members of a CdlDbParser class. - -class CdlDbParser { - public: - static int new_package(CdlInterpreter, int, const char*[]); - static int package_description(CdlInterpreter, int, const char*[]); - static int package_alias(CdlInterpreter, int, const char*[]); - static int package_directory(CdlInterpreter, int, const char*[]); - static int package_script(CdlInterpreter, int, const char*[]); - static int package_hardware(CdlInterpreter, int, const char*[]); - - static int new_target(CdlInterpreter, int, const char*[]); - static int target_description(CdlInterpreter, int, const char*[]); - static int target_alias(CdlInterpreter, int, const char*[]); - static int target_packages(CdlInterpreter, int, const char*[]); - static int target_enable(CdlInterpreter, int, const char*[]); - static int target_disable(CdlInterpreter, int, const char*[]); - static int target_set_value(CdlInterpreter, int, const char*[]); -}; - -//}}} -//{{{ CdlDbParser::package-related - -// ---------------------------------------------------------------------------- -// package - -int -CdlDbParser::new_package(CdlInterpreter interp, int argc, const char* argv[]) -{ - CYG_REPORT_FUNCNAMETYPE("CdlDbParser::new_package", "result %d"); - CYG_REPORT_FUNCARG1XV(argc); - CYG_PRECONDITION_CLASSC(interp); - - CdlPackagesDatabase db = static_cast(interp->get_assoc_data(dbparser_database_key)); - CYG_INVARIANT_CLASSC(CdlPackagesDatabaseBody, db); - - if (3 != argc) { - if (argc < 2) { - CdlParse::report_error(interp, "", "Invalid package command, missing name and contents."); - } else if (argc == 2) { - CdlParse::report_error(interp, diag_package + argv[1], "Invalid package command, missing body."); - } else { - CdlParse::report_error(interp, diag_package + argv[1], - "Invalid package command, expecting just name and body."); - } - CYG_REPORT_RETVAL(TCL_OK); - return TCL_OK; - } - std::string pkg_name = argv[1]; - - // The package data is constructed locally. It only gets added to - // the database in the absence of errors. - bool package_ok = true; - int old_error_count = CdlParse::get_error_count(interp); - - CdlPackagesDatabaseBody::package_data package; - package.description = ""; - package.directory = ""; - package.script = ""; - package.hardware = false; - - // aliases and versions are vectors and will take care of themselves - // And the name had better be valid as well. - if (!Cdl::is_valid_cdl_name(pkg_name)) { - CdlParse::report_error(interp, diag_package + pkg_name, "This is not a valid CDL name."); - } - - // Sort out the commands, then invoke the script in argv[2]. There is - // no need to worry about error recovery here, any errors will be - // fatal anyway. - CdlInterpreterCommandEntry commands[] = { - CdlInterpreterCommandEntry("description", &CdlDbParser::package_description ), - CdlInterpreterCommandEntry("alias", &CdlDbParser::package_alias ), - CdlInterpreterCommandEntry("directory", &CdlDbParser::package_directory ), - CdlInterpreterCommandEntry("script", &CdlDbParser::package_script ), - CdlInterpreterCommandEntry("hardware", &CdlDbParser::package_hardware ), - CdlInterpreterCommandEntry("", 0 ) - }; - CdlInterpreterBody::CommandSupport cmds(interp, commands); - CdlInterpreterBody::VariableSupport interp_name(interp, dbparser_pkgname, pkg_name); - CdlInterpreterBody::AssocSupport interp_data(interp, dbparser_pkgdata, static_cast(&package)); - int result = interp->eval(argv[2]); - if (TCL_OK == result) { - - // The body has been parsed OK. Check that it is valid. - if ("" == package.directory) { - CdlParse::report_error(interp, diag_package + pkg_name, "Missing directory specification."); - } - if ("" == package.script) { - CdlParse::report_error(interp, diag_package + pkg_name, "Missing script specification."); - } - if (0 == package.aliases.size()) { - CdlParse::report_error(interp, diag_package + pkg_name, "At least one alias should be supplied."); - } - - // Additional checks. Is the package directory actually present? - // Note that there are scenarios where a package may be listed - // in the database but not installed, e.g. an anoncvs checkout - // of selected modules. - if ("" != package.directory) { - std::string repo = interp->get_variable(dbparser_component_repository); - CYG_ASSERTC("" != repo); - - std::string pkgdir = repo + "/" + package.directory; - if (!interp->is_directory(pkgdir)) { - if (CdlPackagesDatabaseBody::verbose_mode) { - CdlParse::report_warning(interp, diag_package + pkg_name, - std::string("This package is not present in the component repository.\n" - "There is no directory `") + pkgdir + "'."); - } - package_ok = false; - } else { - - // Now look for version subdirectories. There should be at least one. - std::vector subdirs; - unsigned int i; - interp->locate_subdirs(pkgdir, subdirs); - for (i = 0; i < subdirs.size(); i++) { - if (("CVS" == subdirs[i]) || ("cvs" == subdirs[i])) { - continue; - } - if ("" != package.script) { - if (!(interp->is_file(pkgdir + "/" + subdirs[i] + "/cdl/" + package.script) || - interp->is_file(pkgdir + "/" + subdirs[i] + "/" + package.script))) { - CdlParse::report_warning(interp, diag_package + pkg_name, - std::string("Version subdirectory `") + subdirs[i] + - "' does not have a CDL script `" + package.script + "'."); - continue; - } - } - package.versions.push_back(subdirs[i]); - package.repositories[subdirs[i]] = repo; - } - if (0 == package.versions.size()) { - CdlParse::report_warning(interp, diag_package + pkg_name, - "This package does not have any valid version subdirectories."); - package_ok = false; - } - } - } - } - - // If the package is still ok, now is the time to add it to the database. - // It may be a new package, or there may already be an entry from a previous - // repository. - if (package_ok && (old_error_count == CdlParse::get_error_count(interp))) { - if ( std::find(db->package_names.begin(), db->package_names.end(), pkg_name) == db->package_names.end()) { - db->package_names.push_back(pkg_name); - db->packages[pkg_name] = package; - } else { - // Only add versions which are not already present. - std::vector::const_iterator version_i; - for (version_i = package.versions.begin(); version_i != package.versions.end(); version_i++) { - if (std::find(db->packages[pkg_name].versions.begin(), db->packages[pkg_name].versions.end(), - *version_i) == db->packages[pkg_name].versions.end()) { - db->packages[pkg_name].versions.push_back(*version_i); - db->packages[pkg_name].repositories[*version_i] = package.repositories[*version_i]; - } - } - } - } - - CYG_REPORT_RETVAL(result); - return result; -} - -// Syntax: description -int -CdlDbParser::package_description(CdlInterpreter interp, int argc, const char* argv[]) -{ - CYG_REPORT_FUNCNAMETYPE("CdlDbParser::package_description", "result %d"); - CYG_REPORT_FUNCARG1XV(argc); - CYG_PRECONDITION_CLASSC(interp); - - std::string name = interp->get_variable(dbparser_pkgname); - CYG_ASSERTC("" != name); - CdlPackagesDatabaseBody::package_data* package = - static_cast(interp->get_assoc_data(dbparser_pkgdata)); - - if (2 != argc) { - CdlParse::report_error(interp, diag_package + name, "Invalid description, expecting a single string."); - } else if ("" != package->description) { - CdlParse::report_warning(interp, diag_package + name, "A package should have only one description."); - } else { - package->description = argv[1]; - } - - CYG_REPORT_RETVAL(TCL_OK); - return TCL_OK; -} - -// Syntax: alias -// For example: alias { "This is an alias" another_alias dummy_name } -int -CdlDbParser::package_alias(CdlInterpreter interp, int argc, const char* argv[]) -{ - CYG_REPORT_FUNCNAMETYPE("CdlDbParser::package_alias", "result %d"); - CYG_REPORT_FUNCARG1XV(argc); - CYG_PRECONDITION_CLASSC(interp); - - std::string name = interp->get_variable(dbparser_pkgname); - CYG_ASSERTC("" != name); - CdlPackagesDatabaseBody::package_data* package = - static_cast(interp->get_assoc_data(dbparser_pkgdata)); - - // There should be one argument, a list of valid packages. - // Also, the alias command should be used only once - if (2 != argc) { - CdlParse::report_error(interp, diag_package + name, - "The alias command should be followed by a list of known aliases."); - } else if (0 < package->aliases.size()) { - CdlParse::report_warning(interp, diag_package + name, "There should be only one list of aliases."); - } else { - int list_count = 0; - const char** list_entries = 0; - Tcl_Interp* tcl_interp = interp->get_tcl_interpreter(); - if (TCL_OK != Tcl_SplitList(tcl_interp, CDL_TCL_CONST_CAST(char*, argv[1]), &list_count, CDL_TCL_CONST_CAST(char***, &list_entries))) { - CdlParse::report_error(interp, diag_package + name, Tcl_GetStringResult(tcl_interp)); - } else { - if (0 == list_count) { - CdlParse::report_error(interp, diag_package + name, "At least one alias should be supplied."); - } else { - for (int i = 0; i < list_count; i++) { - package->aliases.push_back(list_entries[i]); - } - } - Tcl_Free((char*)list_entries); - } - } - - CYG_REPORT_RETVAL(TCL_OK); - return TCL_OK; -} - -// Syntax: directory -// The path is of course relative to the component repository. -int -CdlDbParser::package_directory(CdlInterpreter interp, int argc, const char* argv[]) -{ - CYG_REPORT_FUNCNAMETYPE("CdlDbParser::package_directory", "result %d"); - CYG_REPORT_FUNCARG1XV(argc); - CYG_PRECONDITION_CLASSC(interp); - - std::string name = interp->get_variable(dbparser_pkgname); - CYG_ASSERTC("" != name); - CdlPackagesDatabaseBody::package_data* package = - static_cast(interp->get_assoc_data(dbparser_pkgdata)); - - // There should be exactly one argument, and the directory command - // should be used only once. - if (2 != argc) { - CdlParse::report_error(interp, diag_package + name, "Only one directory can be specified."); - } else if ("" != package->directory) { - CdlParse::report_warning(interp, diag_package + name, "A package can be located in only one directory."); - } else { - package->directory = argv[1]; - } - CYG_REPORT_RETVAL(TCL_OK); - return TCL_OK; -} - -// Syntax: hardware -// There are no arguments. -int -CdlDbParser::package_hardware(CdlInterpreter interp, int argc, const char* argv[]) -{ - CYG_REPORT_FUNCNAMETYPE("CdlDbParser::package_hardware", "result %d"); - CYG_REPORT_FUNCARG1XV(argc); - CYG_PRECONDITION_CLASSC(interp); - - std::string name = interp->get_variable(dbparser_pkgname); - CYG_ASSERTC("" != name); - CdlPackagesDatabaseBody::package_data* package = - static_cast(interp->get_assoc_data(dbparser_pkgdata)); - - if (1 != argc) { - CdlParse::report_error(interp, diag_package + name, "There should be no further data after hardware."); - } else if (package->hardware) { - CdlParse::report_warning(interp, diag_package + name, "The hardware property should be specified only once"); - } else { - package->hardware = true; - } - - CYG_REPORT_RETVAL(TCL_OK); - return TCL_OK; -} - -// Syntax: script -int -CdlDbParser::package_script(CdlInterpreter interp, int argc, const char* argv[]) -{ - CYG_REPORT_FUNCNAMETYPE("CdlDbParser::package_script", "result %d"); - CYG_REPORT_FUNCARG1XV(argc); - CYG_PRECONDITION_CLASSC(interp); - - std::string name = interp->get_variable(dbparser_pkgname); - CYG_ASSERTC("" != name); - CdlPackagesDatabaseBody::package_data* package = - static_cast(interp->get_assoc_data(dbparser_pkgdata)); - - // There should be exactly one argument, and the script command - // should be used only once - if (2 != argc) { - CdlParse::report_error(interp, diag_package + name, "Only one CDL script can be specified."); - } else if ("" != package->script) { - CdlParse::report_warning(interp, diag_package + name, "A package can have only one starting CDL script."); - } else { - package->script = argv[1]; - } - - CYG_REPORT_RETVAL(TCL_OK); - return TCL_OK; -} - -//}}} -//{{{ CdlDbParser::target-related - -// ---------------------------------------------------------------------------- -// target - -int -CdlDbParser::new_target(CdlInterpreter interp, int argc, const char* argv[]) -{ - CYG_REPORT_FUNCNAMETYPE("CdlDbParser::new_target", "result %d"); - CYG_REPORT_FUNCARG1XV(argc); - CYG_PRECONDITION_CLASSC(interp); - - CdlPackagesDatabase db = static_cast(interp->get_assoc_data(dbparser_database_key)); - CYG_INVARIANT_CLASSC(CdlPackagesDatabaseBody, db); - - if (3 != argc) { - if (argc < 2) { - CdlParse::report_error(interp, "", "Invalid target command, missing name and contents."); - } else if (argc == 2) { - CdlParse::report_error(interp, diag_target + argv[1], "Invalid target command, missing body."); - } else { - CdlParse::report_error(interp, diag_target + argv[1], "Invalid target command, expecting just name and body."); - } - CYG_REPORT_RETVAL(TCL_OK); - return TCL_OK; - } - - std::string target_name = argv[1]; - - // This may be a duplicate definition if the target was defined in an - // earlier repository - if (std::find(db->target_names.begin(), db->target_names.end(), target_name) != db->target_names.end()) { - CYG_REPORT_RETVAL(TCL_OK); - return TCL_OK; - } - - // The target data is constructed locally. It only gets added to the - // database in the absence of errors. - bool target_ok = true; - int old_error_count = CdlParse::get_error_count(interp); - - CdlPackagesDatabaseBody::target_data target; - target.description = ""; - // aliases, packages and compiler_flags are vectors and will take care of themselves - - // Sort out the commands, then invoke the script in argv[2]. There is - // no need to worry about error recovery here, any errors will be - // fatal anyway. - CdlInterpreterCommandEntry commands[] = { - CdlInterpreterCommandEntry("description", &CdlDbParser::target_description ), - CdlInterpreterCommandEntry("alias", &CdlDbParser::target_alias ), - CdlInterpreterCommandEntry("packages", &CdlDbParser::target_packages ), - CdlInterpreterCommandEntry("enable", &CdlDbParser::target_enable ), - CdlInterpreterCommandEntry("disable", &CdlDbParser::target_disable ), - CdlInterpreterCommandEntry("set_value", &CdlDbParser::target_set_value ), - CdlInterpreterCommandEntry("", 0 ) - }; - CdlInterpreterBody::CommandSupport interp_cmds(interp, commands); - CdlInterpreterBody::VariableSupport interp_name(interp, dbparser_targetname, target_name); - CdlInterpreterBody::AssocSupport interp_data(interp, dbparser_targetdata, static_cast(&target)); - int result = interp->eval(argv[2]); - if (TCL_OK == result) { - - if (0 == target.aliases.size()) { - CdlParse::report_error(interp, diag_target + target_name, "At least one alias should be supplied."); - } - - // There is no check for > 0 hardware packages. This is an unlikely - // scenario but should be allowed for. - // Add this target to the list. - } - - if (target_ok && (old_error_count == CdlParse::get_error_count(interp))) { - db->target_names.push_back(target_name); - db->targets[target_name] = target; - } - - CYG_REPORT_RETVAL(result); - return result; -} - -// Syntax: description -int -CdlDbParser::target_description(CdlInterpreter interp, int argc, const char* argv[]) -{ - CYG_REPORT_FUNCNAMETYPE("CdlDbParser::target_description", "result %d"); - CYG_REPORT_FUNCARG1XV(argc); - CYG_PRECONDITION_CLASSC(interp); - - std::string name = interp->get_variable(dbparser_targetname); - CYG_ASSERTC("" != name); - CdlPackagesDatabaseBody::target_data* target = - static_cast(interp->get_assoc_data(dbparser_targetdata)); - - if (2 != argc) { - CdlParse::report_error(interp, diag_target + name, "The target description should be a single string."); - } else if ("" != target->description) { - CdlParse::report_warning(interp, diag_target + name, "A target should have only one description."); - } else { - target->description = argv[1]; - } - - CYG_REPORT_RETVAL(TCL_OK); - return TCL_OK; -} - -// Syntax: alias -// For example: alias { "This is an alias" another_alias dummy_name } -int -CdlDbParser::target_alias(CdlInterpreter interp, int argc, const char* argv[]) -{ - CYG_REPORT_FUNCNAMETYPE("CdlDbParser::target_alias", "result %d"); - CYG_REPORT_FUNCARG1XV(argc); - CYG_PRECONDITION_CLASSC(interp); - - std::string name = interp->get_variable(dbparser_targetname); - CYG_ASSERTC("" != name); - CdlPackagesDatabaseBody::target_data* target = - static_cast(interp->get_assoc_data(dbparser_targetdata)); - - // There should be one argument, a list of valid aliases - // The alias command should be used only once - if (2 != argc) { - CdlParse::report_error(interp, diag_target + name, "The alias command should be followed by a list of known aliases"); - } else if (0 < target->aliases.size()) { - CdlParse::report_warning(interp, diag_target + name, "There should be only one list of aliases."); - } else { - int list_count = 0; - const char** list_entries = 0; - Tcl_Interp* tcl_interp = interp->get_tcl_interpreter(); - if (TCL_OK != Tcl_SplitList(tcl_interp, CDL_TCL_CONST_CAST(char*, argv[1]), &list_count, CDL_TCL_CONST_CAST(char***, &list_entries))) { - CdlParse::report_error(interp, diag_target + name, Tcl_GetStringResult(tcl_interp)); - } else { - if (0 == list_count) { - CdlParse::report_error(interp, diag_target + name, "At least one alias should be supplied."); - } else { - for (int i = 0; i < list_count; i++) { - target->aliases.push_back(list_entries[i]); - } - } - Tcl_Free((char*)list_entries); - } - } - - CYG_REPORT_RETVAL(TCL_OK); - return TCL_OK; -} - -// Syntax: packages ... -// For example: packages { CYGPKG_HAL_XXX CYGPKG_HAL_YYY } -int -CdlDbParser::target_packages(CdlInterpreter interp, int argc, const char* argv[]) -{ - CYG_REPORT_FUNCNAMETYPE("CdlDbParser::target_packages", "result %d"); - CYG_REPORT_FUNCARG1XV(argc); - CYG_PRECONDITION_CLASSC(interp); - - std::string name = interp->get_variable(dbparser_targetname); - CYG_ASSERTC("" != name); - CdlPackagesDatabaseBody::target_data* target = - static_cast(interp->get_assoc_data(dbparser_targetdata)); - - // There should be one argument, a list of valid packages. - // The packages command should be used only once - if (2 != argc) { - CdlParse::report_error(interp, diag_target + name, "`packages' should be followed by a list of known packages."); - } else if (0 < target->packages.size()) { - CdlParse::report_warning(interp, diag_target + name, "There should be only one list of packages."); - } else { - int list_count = 0; - const char** list_entries = 0; - Tcl_Interp* tcl_interp = interp->get_tcl_interpreter(); - if (TCL_OK != Tcl_SplitList(tcl_interp, CDL_TCL_CONST_CAST(char*, argv[1]), &list_count, CDL_TCL_CONST_CAST(char***, &list_entries))) { - CdlParse::report_error(interp, diag_target + name, Tcl_GetStringResult(tcl_interp)); - } else { - // Allow for a dummy target spec, just in case it proves useful. - if (0 != list_count) { - for (int i = 0; i < list_count; i++) { - target->packages.push_back(list_entries[i]); - } - } - Tcl_Free((char*)list_entries); - } - } - - CYG_REPORT_RETVAL(TCL_OK); - return TCL_OK; -} - -// Syntax: enable { opt1 opt2 ... } -// For example: enable { CYGPKG_HAL_ARM_CL7xxx_7211 } -int -CdlDbParser::target_enable(CdlInterpreter interp, int argc, const char* argv[]) -{ - CYG_REPORT_FUNCNAMETYPE("CdlDbParser::target_enable", "result %d"); - CYG_REPORT_FUNCARG1XV(argc); - CYG_PRECONDITION_CLASSC(interp); - - std::string name = interp->get_variable(dbparser_targetname); - CYG_ASSERTC("" != name); - CdlPackagesDatabaseBody::target_data* target = - static_cast(interp->get_assoc_data(dbparser_targetdata)); - - // There should be one argument, a list of valid flags. - if (2 != argc) { - CdlParse::report_error(interp, diag_target + name, "`enable' should be followed by a list of CDL options."); - } else { - int list_count = 0; - const char** list_entries = 0; - Tcl_Interp* tcl_interp = interp->get_tcl_interpreter(); - if (TCL_OK != Tcl_SplitList(tcl_interp, CDL_TCL_CONST_CAST(char*, argv[1]), &list_count, CDL_TCL_CONST_CAST(char***, &list_entries))) { - CdlParse::report_error(interp, diag_target + name, Tcl_GetStringResult(tcl_interp)); - } else { - for (int i = 0; i < list_count; i++) { - target->enable.push_back(list_entries[i]); - } - Tcl_Free((char *) list_entries); - } - } - - CYG_REPORT_RETVAL(TCL_OK); - return TCL_OK; -} - - -// Syntax: disable { opt1 opt2 ... } -// For example: disable { CYGPKG_HAL_ARM_CL7xxx_7111 } -int -CdlDbParser::target_disable(CdlInterpreter interp, int argc, const char* argv[]) -{ - CYG_REPORT_FUNCNAMETYPE("CdlDbParser::target_disable", "result %d"); - CYG_REPORT_FUNCARG1XV(argc); - CYG_PRECONDITION_CLASSC(interp); - - std::string name = interp->get_variable(dbparser_targetname); - CYG_ASSERTC("" != name); - CdlPackagesDatabaseBody::target_data* target = - static_cast(interp->get_assoc_data(dbparser_targetdata)); - - // There should be one argument, a list of valid flags. - if (2 != argc) { - CdlParse::report_error(interp, diag_target + name, "`disable' should be followed by a list of CDL options."); - } else { - int list_count = 0; - const char** list_entries = 0; - Tcl_Interp* tcl_interp = interp->get_tcl_interpreter(); - if (TCL_OK != Tcl_SplitList(tcl_interp, CDL_TCL_CONST_CAST(char*, argv[1]), &list_count, CDL_TCL_CONST_CAST(char***, &list_entries))) { - CdlParse::report_error(interp, diag_target + name, Tcl_GetStringResult(tcl_interp)); - } else { - for (int i = 0; i < list_count; i++) { - target->disable.push_back(list_entries[i]); - } - Tcl_Free((char *) list_entries); - } - } - - CYG_REPORT_RETVAL(TCL_OK); - return TCL_OK; -} - -// Syntax: set_value