diff --git a/documentation/Makefile.am b/documentation/Makefile.am new file mode 100644 index 00000000..e46eef53 --- /dev/null +++ b/documentation/Makefile.am @@ -0,0 +1,38 @@ +## $Id$ +## Process this file with automake to produce Makefile.in + +## 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 + +# HTML is not supported by Automake yet, so we have to do some stuff +# ourselves for now.. + +targets = server-architecture.html \ +the_chaos_programming_reference_manual.html coding-standards.html \ +filesystem-hierarchy.html a_new_file_system.html + +all-local: $(targets) + +# SGML files generate multiple output files, so we just clean out +# every HTML file in this directory. + +clean-local: + rm -f *.html *~ + +%.html: %.texi + makeinfo --html $< + +%.html: %.sgml + sgmltools $< \ No newline at end of file diff --git a/documentation/Makefile.in b/documentation/Makefile.in new file mode 100644 index 00000000..5585c10b --- /dev/null +++ b/documentation/Makefile.in @@ -0,0 +1,236 @@ +# Makefile.in generated automatically by automake 1.4-p6 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. + +# HTML is not supported by Automake yet, so we have to do some stuff +# ourselves for now.. + + +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 = : +CC = @CC@ +CPP = @CPP@ +MAKEINFO = @MAKEINFO@ +PACKAGE = @PACKAGE@ +VERSION = @VERSION@ +makeinfo = @makeinfo@ +sgml2html = @sgml2html@ + +targets = server-architecture.html the_chaos_programming_reference_manual.html coding-standards.html filesystem-hierarchy.html a_new_file_system.html + +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_CLEAN_FILES = +DIST_COMMON = Makefile.am Makefile.in aclocal.m4 configure configure.in \ +install-sh missing mkinstalldirs + + +DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) + +TAR = tar +GZIP_ENV = --best +all: all-redirect +.SUFFIXES: +$(srcdir)/Makefile.in: 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): configure.in + cd $(srcdir) && $(ACLOCAL) + +config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + $(SHELL) ./config.status --recheck +$(srcdir)/configure: $(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES) + cd $(srcdir) && $(AUTOCONF) +tags: TAGS +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 +info-am: +info: info-am +dvi-am: +dvi: dvi-am +check-am: all-am +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-local +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-local + +clean: clean-am + +distclean-am: distclean-generic clean-am + +distclean: distclean-am + -rm -f config.status + +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 + -rm -f config.status + +.PHONY: 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-local all-redirect all-am all installdirs mostlyclean-generic \ +distclean-generic clean-generic maintainer-clean-generic clean \ +mostlyclean distclean maintainer-clean + + +all-local: $(targets) + +# SGML files generate multiple output files, so we just clean out +# every HTML file in this directory. + +clean-local: + rm -f *.html *~ + +%.html: %.texi + makeinfo --html $< + +%.html: %.sgml + sgmltools $< + +# 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/documentation/a_new_file_system.db-sgml b/documentation/a_new_file_system.db-sgml new file mode 100644 index 00000000..30eab9b0 --- /dev/null +++ b/documentation/a_new_file_system.db-sgml @@ -0,0 +1,211 @@ + + +
+ + + +A New File System + +chaos development, staff@chaosdev.org, with lots of help from Mats +Giefvert. + +$Id$ + + + + +Differences vs. present-day file systems + + +Present-day file systems are stone-age systems, developed and +introduced with Unix, that have served their purpose well for a long +time, but need to be replaced with a new file system that possesses a +certain number of advantages. + + + +Some of the design issues where this new file system differs compared +to the old one are these: + + + + + + +* File extensions are replaced with objec type ID's. Microsoft Word documents +are no longer identified by their .doc ending, but rather with a unique type ID. +Applications registers as type ID handlers. +* The differences between files and directories are skipped. These old concepts +are replaced with objects. Objects can contain data, and can also be a container +of other objects. +* Applications are self-contained objects that register and unregister +automatically in a computer system. +* A hierarchical attribute structure can be applied to objects, allowing an +efficient document storage and retrieval system. + +Each of the differences is explained in detail below. + +Object type ID:s + +The file extension is skipped. They can be retained if desired to, but +have no system-wide meaning. Applications or executables are no longer +marked .exe or with a +x attribute, but rather with an application +object type which the system knows and treats like +executables. Documents are identified by their type ID as well; +applications become handlers of the type ID:s. Whenever a user wished +to interact with a document, the system starts the registered document +handler knonw by its type ID. + +Objects and containers + +Instead of having a sharp distinction between directories and files, +they are both merged into the concept of objects. Objects contain +data, other objects, or a combination of both. They can represent +directories, and they can represent files as well. A directory becomes +an object with no internal data - a "pure container". A file becomes +an object that contains no other objects. There can also be +combinations, where a file contains both internal data and other +objects as well. + +This can be illustrated by the followin practical examples. + +A user creates a directory called "Documents". He sees the directory +as any old operating system would represent it; but behind the scenes, +what happens is that an object is created with a special type ID +recognized by the system, called Folder. The system is the handler for +objects of that type, and knows that folders should not contain any +data in themselves; they are pure containers and only contain other +objects. Should the system desire so, however, it will be able to +place internal data in the object. This allows the system with a +convenient place to store folder-specific information, like +appearance, sorting, icons etc. + +In this Document folder, he creates a Microsoft Word document. He sees +it as a plain old document, but the system has behind the scenes +created yet another document, this time with the Microsoft Word +Document type ID. This object, like any other object, has the +capability to contain both data and other objects. It has, therefore, +the functionality of both a file and a directory. When the user +double-clicks on the file, Microsoft Word, which is the registered +document handler, fires up and displays the document on the +screen. When the user subsequentyl writes text into the document, it +is stored inside the internal object data. If the user at this time +wished to drag-and-rop an Excel sheet into the document, the Word +application would do that happily without any thought about it. Behind +the scenes, the object would start acting like a directory as well, +placing either the Excel sheet within the Word object, or a link to +the Excel sheet, much like you would have placed that document/link +inside a directory. You would therefore be able to take that object, +embedded in the Word document, and from the file system viewer itself +remove it from the Word document and place it as a self-contained +sheet in the Documents folder without any problem whatsoever. + +Let's also look at the concept of an application. An application is +also an object, completely self-contained, in that all its dependent +"files" reside inside the application as sub-objects. Therefore, it is +extremely easy to move an application from one place to another; all +that the user would have to do is to move the object to a new +location. The executable code is stored within the object itself; it's +needed files are stored as embedded objects in that container. Shared +files, like Dynamic Link Libraries, or Shared Libraries, can be +represented as links inside of the application object. Instead of +storing a library as an embedded object file (still fully visible with +the file system viewer), it could store a link to the library. This +would allow th euser in no time to decide wether all the required +libraries were installed on his computer or not. The user would also, +if such functionality were to be built into the system, be able to +replace a library inside an application, embedded or linked +(i.e. static versus shared), at will, and would be able to make an +application fully self-contained without shared libraries at all. + +It is worth noting that links in this content should be a special +case; not objects, but pointer to objects, much like symbolic links in +Unix They should be freely movable, and should be able to point to +nonexisting objects - required in the case where an application +contains a link to a shared library and the library does not exist; +but if the user installs the library the link should automatically +work, since both the library is installed, and the link points to a +predefined location. + +Self-registering applications + +The operating system should know automatically which applications are +installed and thus automatically determine the relationship between +applications and document ID:s. Suppose, for instance, that a user has +an object of the Microsoft Project1] type, but unfortunately, he +doesn't have Microsoft Project installed. He knows, however, that his +co-worker's computer at the office has Microsoft Project installed. At +this point, this analogy starts breeaking copyright laws, but let's +ignore that for the sake for the argument, and if you see any BSA +agents, please warn me quickly. He goes into his friend's computer, +and drags the Microsoft Project application object over to his +Applications folder. As soon as it is copied, the operating system +realizes that it is, indeed, an application object, and since the +Applications folder is a place where the system knows active +applications are stored (this functionaly could be built into the +Applications folder object's type handler), the system scans the +Microsoft Project application object and automatically registers it as +an object type handler for the type ID:s found in the application. The +user can now, without any further action, use his Microsoft Project +document object by double-clicking on it. When the BSA sues the +company a few days later, the system administrator drags the Microsoft +Project application object into the trashbin, and the operating system +automatically removes Microsoft Project as the type ID handler for the +previously installed type ID:s. +Hierarchical attribute lists +The normal organization of user documents into directories function +well, but is sometimes not good enough. The ability to assign a number +of organizational attributes to a document enables the user to quickly +store a document and just as quickly locate it a again. +Let's suppose that the user has a very important document that is +related to a meeting about a project called "Internet Banking". He +wishes the document to possess the two attributes Internet Banking and +Very Important. He couldn't store it in a directory called important +because it belongs to the Internet Banking project; likewise, he +couldn't just store it without cretain problems in a directory named +after the project; because how would he know that that particular +document was very important? If he wanted a list over very important +documents, he'd have to go through the entire file system and review +every document to know it's importance. and what if he simply wanted a +list over every document that was business-related? All those +questions rely hevaily on the organization of the directories +involved; if the directory structure is insufficient, it has to be +remade later on, with all the hassle it might produce. If the +situation evolves to include multiple users, the problems have only +begun. +The assignment of attributes solves this. Individual files can be +marked with certain attributes, in order to let the system search for +them and find them efficiently. The attribbutes themselves would be +organized hierarchically; that is, the attribute Internet Bankning +would be located as a sub-attribute of the more general attribute +Projects, or Business. A simple search for, say, Business, would then +reveal all documents marked with the attribute Business, or any of +it's sub-attributes, for instance Internet Banking. The search could +of course be expaneded; the user might want to search for all Word +document written in the last five days, that belong to any of the +business-related projects, except all documents of low importance or +documents written by Todd, a person at the office which everybody +hates. +Additional features... +There is much to be said about additional features, like roaming +profiles over networks, private user viewspace, collaboration issues +with attribute trees and access control lists on all levels. But we +leave those as an excercise to the reader. +[1] At this point I must comment on all the Microsoft objects so +far. I am not endorsing Microsoft products, nor will I ever do so, I'm +just noticing that there are a lot of Microsoft docuemtns around and I +figure that they are the most likely document object to be dealt with. + + + + + + + +
diff --git a/documentation/a_new_file_system.sgml b/documentation/a_new_file_system.sgml new file mode 100644 index 00000000..32713c22 --- /dev/null +++ b/documentation/a_new_file_system.sgml @@ -0,0 +1,269 @@ + + +
+ + + +A New File System + + Mats + Giefvert + +$Id$ + + + + +Differences vs. present-day file systems + + +Present-day file systems are stone-age systems, developed and +introduced with Unix, that have served their purpose well for a long +time, but need to be replaced with a new file system that possesses a +certain number of advantages. + + + +Some of the design issues where this new file system differs compared +to the old one are these: + + + + + + + + +File extensions are replaced with object type +ID's. Microsoft Word documents are no longer identified by their .doc +ending, but rather with a unique type ID. Applications registers as +type ID handlers. + + + + + +The differences between files and directories are +skipped. These old concepts are replaced with objects. Objects can +contain data, and can also be a container of other objects. + + + + + +Applications are self-contained objects that register and +unregister automatically in a computer system. + + + + + +A hierarchical attribute structure can be applied to +objects, allowing an efficient document storage and retrieval +system. + + + + + + + +Each of the differences is explained in detail below. + + + + +Object type ID:s + + +The file extension is skipped. They can be retained if desired to, but +have no system-wide meaning. Applications or executables are no longer +marked .exe or with a +x attribute, but rather with an application +object type which the system knows and treats like +executables. Documents are identified by their type ID as well; +applications become handlers of the type ID:s. Whenever a user wished +to interact with a document, the system starts the registered document +handler knonw by its type ID. + + + + +Objects and containers + + +Instead of having a sharp distinction between directories and files, +they are both merged into the concept of objects. Objects contain +data, other objects, or a combination of both. They can represent +directories, and they can represent files as well. A directory becomes +an object with no internal data - a "pure container". A file becomes +an object that contains no other objects. There can also be +combinations, where a file contains both internal data and other +objects as well. + + + +This can be illustrated by the following practical examples. + + + +A user creates a directory called "Documents". He sees the directory +as any old operating system would represent it; but behind the scenes, +what happens is that an object is created with a special type ID +recognized by the system, called Folder. The system is the handler for +objects of that type, and knows that folders should not contain any +data in themselves; they are pure containers and only contain other +objects. Should the system desire so, however, it will be able to +place internal data in the object. This allows the system with a +convenient place to store folder-specific information, like +appearance, sorting, icons etc. + + + +In this Document folder, he creates a Microsoft Word document. He sees +it as a plain old document, but the system has behind the scenes +created yet another document, this time with the Microsoft Word +Document type ID. This object, like any other object, has the +capability to contain both data and other objects. It has, therefore, +the functionality of both a file and a directory. When the user +double-clicks on the file, Microsoft Word, which is the registered +document handler, fires up and displays the document on the +screen. When the user subsequentyl writes text into the document, it +is stored inside the internal object data. If the user at this time +wished to drag-and-rop an Excel sheet into the document, the Word +application would do that happily without any thought about it. Behind +the scenes, the object would start acting like a directory as well, +placing either the Excel sheet within the Word object, or a link to +the Excel sheet, much like you would have placed that document/link +inside a directory. You would therefore be able to take that object, +embedded in the Word document, and from the file system viewer itself +remove it from the Word document and place it as a self-contained +sheet in the Documents folder without any problem whatsoever. + + + +Let's also look at the concept of an application. An application is +also an object, completely self-contained, in that all its dependent +"files" reside inside the application as sub-objects. Therefore, it is +extremely easy to move an application from one place to another; all +that the user would have to do is to move the object to a new +location. The executable code is stored within the object itself; it's +needed files are stored as embedded objects in that container. Shared +files, like Dynamic Link Libraries, or Shared Libraries, can be +represented as links inside of the application object. Instead of +storing a library as an embedded object file (still fully visible with +the file system viewer), it could store a link to the library. This +would allow th euser in no time to decide wether all the required +libraries were installed on his computer or not. The user would also, +if such functionality were to be built into the system, be able to +replace a library inside an application, embedded or linked +(i.e. static versus shared), at will, and would be able to make an +application fully self-contained without shared libraries at all. + + + +It is worth noting that links in this content should be a special +case; not objects, but pointer to objects, much like symbolic links in +Unix They should be freely movable, and should be able to point to +nonexisting objects - required in the case where an application +contains a link to a shared library and the library does not exist; +but if the user installs the library the link should automatically +work, since both the library is installed, and the link points to a +predefined location. + + + + +Self-registering applications + + +The operating system should know automatically which applications are +installed and thus automatically determine the relationship between +applications and document ID:s. Suppose, for instance, that a user has +an object of the Microsoft Project[1] type, but unfortunately, he +doesn't have Microsoft Project installed. He knows, however, that his +co-worker's computer at the office has Microsoft Project installed. At +this point, this analogy starts breeaking copyright laws, but let's +ignore that for the sake for the argument, and if you see any BSA +agents, please warn me quickly. He goes into his friend's computer, +and drags the Microsoft Project application object over to his +Applications folder. As soon as it is copied, the operating system +realizes that it is, indeed, an application object, and since the +Applications folder is a place where the system knows active +applications are stored (this functionaly could be built into the +Applications folder object's type handler), the system scans the +Microsoft Project application object and automatically registers it as +an object type handler for the type ID:s found in the application. The +user can now, without any further action, use his Microsoft Project +document object by double-clicking on it. When the BSA sues the +company a few days later, the system administrator drags the Microsoft +Project application object into the trashbin, and the operating system +automatically removes Microsoft Project as the type ID handler for the +previously installed type ID:s. + + + + +Hierarchical attribute lists + + +The normal organization of user documents into directories function +well, but is sometimes not good enough. The ability to assign a number +of organizational attributes to a document enables the user to quickly +store a document and just as quickly locate it a again. + + + +Let's suppose that the user has a very important document that is +related to a meeting about a project called "Internet Banking". He +wishes the document to possess the two attributes Internet Banking and +Very Important. He couldn't store it in a directory called important +because it belongs to the Internet Banking project; likewise, he +couldn't just store it without cretain problems in a directory named +after the project; because how would he know that that particular +document was very important? If he wanted a list over very important +documents, he'd have to go through the entire file system and review +every document to know it's importance. and what if he simply wanted a +list over every document that was business-related? All those +questions rely hevaily on the organization of the directories +involved; if the directory structure is insufficient, it has to be +remade later on, with all the hassle it might produce. If the +situation evolves to include multiple users, the problems have only +begun. + + + +The assignment of attributes solves this. Individual files can be +marked with certain attributes, in order to let the system search for +them and find them efficiently. The attribbutes themselves would be +organized hierarchically; that is, the attribute Internet Bankning +would be located as a sub-attribute of the more general attribute +Projects, or Business. A simple search for, say, Business, would then +reveal all documents marked with the attribute Business, or any of +it's sub-attributes, for instance Internet Banking. The search could +of course be expaneded; the user might want to search for all Word +document written in the last five days, that belong to any of the +business-related projects, except all documents of low importance or +documents written by Todd, a person at the office which everybody +hates. + + + + +Additional features... + + +There is much to be said about additional features, like roaming +profiles over networks, private user viewspace, collaboration issues +with attribute trees and access control lists on all levels. But we +leave those as an excercise to the reader. + + + +[1] At this point I must comment on all the Microsoft objects so +far. I am not endorsing Microsoft products, nor will I ever do so, I'm +just noticing that there are a lot of Microsoft docuemtns around and I +figure that they are the most likely document object to be dealt with. + + + +
\ No newline at end of file diff --git a/documentation/aclocal.m4 b/documentation/aclocal.m4 new file mode 100644 index 00000000..272381a3 --- /dev/null +++ b/documentation/aclocal.m4 @@ -0,0 +1,1062 @@ +dnl aclocal.m4 generated automatically by aclocal 1.4-p6 + +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. + +# lib-prefix.m4 serial 5 (gettext-0.15) +dnl Copyright (C) 2001-2005 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 From Bruno Haible. + +dnl AC_LIB_ARG_WITH is synonymous to AC_ARG_WITH in autoconf-2.13, and +dnl similar to AC_ARG_WITH in autoconf 2.52...2.57 except that is doesn't +dnl require excessive bracketing. +ifdef([AC_HELP_STRING], +[AC_DEFUN([AC_LIB_ARG_WITH], [AC_ARG_WITH([$1],[[$2]],[$3],[$4])])], +[AC_DEFUN([AC_][LIB_ARG_WITH], [AC_ARG_WITH([$1],[$2],[$3],[$4])])]) + +dnl AC_LIB_PREFIX adds to the CPPFLAGS and LDFLAGS the flags that are needed +dnl to access previously installed libraries. The basic assumption is that +dnl a user will want packages to use other packages he previously installed +dnl with the same --prefix option. +dnl This macro is not needed if only AC_LIB_LINKFLAGS is used to locate +dnl libraries, but is otherwise very convenient. +AC_DEFUN([AC_LIB_PREFIX], +[ + AC_BEFORE([$0], [AC_LIB_LINKFLAGS]) + AC_REQUIRE([AC_PROG_CC]) + AC_REQUIRE([AC_CANONICAL_HOST]) + AC_REQUIRE([AC_LIB_PREPARE_MULTILIB]) + AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) + dnl By default, look in $includedir and $libdir. + use_additional=yes + AC_LIB_WITH_FINAL_PREFIX([ + eval additional_includedir=\"$includedir\" + eval additional_libdir=\"$libdir\" + ]) + AC_LIB_ARG_WITH([lib-prefix], +[ --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib + --without-lib-prefix don't search for libraries in includedir and libdir], +[ + if test "X$withval" = "Xno"; then + use_additional=no + else + if test "X$withval" = "X"; then + AC_LIB_WITH_FINAL_PREFIX([ + eval additional_includedir=\"$includedir\" + eval additional_libdir=\"$libdir\" + ]) + else + additional_includedir="$withval/include" + additional_libdir="$withval/$acl_libdirstem" + fi + fi +]) + if test $use_additional = yes; then + dnl Potentially add $additional_includedir to $CPPFLAGS. + dnl But don't add it + dnl 1. if it's the standard /usr/include, + dnl 2. if it's already present in $CPPFLAGS, + dnl 3. if it's /usr/local/include and we are using GCC on Linux, + dnl 4. if it doesn't exist as a directory. + if test "X$additional_includedir" != "X/usr/include"; then + haveit= + for x in $CPPFLAGS; do + AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) + if test "X$x" = "X-I$additional_includedir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test "X$additional_includedir" = "X/usr/local/include"; then + if test -n "$GCC"; then + case $host_os in + linux* | gnu* | k*bsd*-gnu) haveit=yes;; + esac + fi + fi + if test -z "$haveit"; then + if test -d "$additional_includedir"; then + dnl Really add $additional_includedir to $CPPFLAGS. + CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }-I$additional_includedir" + fi + fi + fi + fi + dnl Potentially add $additional_libdir to $LDFLAGS. + dnl But don't add it + dnl 1. if it's the standard /usr/lib, + dnl 2. if it's already present in $LDFLAGS, + dnl 3. if it's /usr/local/lib and we are using GCC on Linux, + dnl 4. if it doesn't exist as a directory. + if test "X$additional_libdir" != "X/usr/$acl_libdirstem"; then + haveit= + for x in $LDFLAGS; do + AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) + if test "X$x" = "X-L$additional_libdir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem"; then + if test -n "$GCC"; then + case $host_os in + linux*) haveit=yes;; + esac + fi + fi + if test -z "$haveit"; then + if test -d "$additional_libdir"; then + dnl Really add $additional_libdir to $LDFLAGS. + LDFLAGS="${LDFLAGS}${LDFLAGS:+ }-L$additional_libdir" + fi + fi + fi + fi + fi +]) + +dnl AC_LIB_PREPARE_PREFIX creates variables acl_final_prefix, +dnl acl_final_exec_prefix, containing the values to which $prefix and +dnl $exec_prefix will expand at the end of the configure script. +AC_DEFUN([AC_LIB_PREPARE_PREFIX], +[ + dnl Unfortunately, prefix and exec_prefix get only finally determined + dnl at the end of configure. + if test "X$prefix" = "XNONE"; then + acl_final_prefix="$ac_default_prefix" + else + acl_final_prefix="$prefix" + fi + if test "X$exec_prefix" = "XNONE"; then + acl_final_exec_prefix='${prefix}' + else + acl_final_exec_prefix="$exec_prefix" + fi + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + eval acl_final_exec_prefix=\"$acl_final_exec_prefix\" + prefix="$acl_save_prefix" +]) + +dnl AC_LIB_WITH_FINAL_PREFIX([statement]) evaluates statement, with the +dnl variables prefix and exec_prefix bound to the values they will have +dnl at the end of the configure script. +AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX], +[ + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + $1 + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" +]) + +dnl AC_LIB_PREPARE_MULTILIB creates a variable acl_libdirstem, containing +dnl the basename of the libdir, either "lib" or "lib64". +AC_DEFUN([AC_LIB_PREPARE_MULTILIB], +[ + dnl There is no formal standard regarding lib and lib64. The current + dnl practice is that on a system supporting 32-bit and 64-bit instruction + dnl sets or ABIs, 64-bit libraries go under $prefix/lib64 and 32-bit + dnl libraries go under $prefix/lib. We determine the compiler's default + dnl mode by looking at the compiler's library search path. If at least + dnl of its elements ends in /lib64 or points to a directory whose absolute + dnl pathname ends in /lib64, we assume a 64-bit ABI. Otherwise we use the + dnl default, namely "lib". + acl_libdirstem=lib + searchpath=`(LC_ALL=C $CC -print-search-dirs) 2>/dev/null | sed -n -e 's,^libraries: ,,p' | sed -e 's,^=,,'` + if test -n "$searchpath"; then + acl_save_IFS="${IFS= }"; IFS=":" + for searchdir in $searchpath; do + if test -d "$searchdir"; then + case "$searchdir" in + */lib64/ | */lib64 ) acl_libdirstem=lib64 ;; + *) searchdir=`cd "$searchdir" && pwd` + case "$searchdir" in + */lib64 ) acl_libdirstem=lib64 ;; + esac ;; + esac + fi + done + IFS="$acl_save_IFS" + fi +]) + +# lib-link.m4 serial 8 (gettext-0.15) +dnl Copyright (C) 2001-2006 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 From Bruno Haible. + +AC_PREREQ(2.50) + +dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and +dnl the libraries corresponding to explicit and implicit dependencies. +dnl Sets and AC_SUBSTs the LIB${NAME} and LTLIB${NAME} variables and +dnl augments the CPPFLAGS variable. +AC_DEFUN([AC_LIB_LINKFLAGS], +[ + AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) + AC_REQUIRE([AC_LIB_RPATH]) + define([Name],[translit([$1],[./-], [___])]) + define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-], + [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) + AC_CACHE_CHECK([how to link with lib[]$1], [ac_cv_lib[]Name[]_libs], [ + AC_LIB_LINKFLAGS_BODY([$1], [$2]) + ac_cv_lib[]Name[]_libs="$LIB[]NAME" + ac_cv_lib[]Name[]_ltlibs="$LTLIB[]NAME" + ac_cv_lib[]Name[]_cppflags="$INC[]NAME" + ]) + LIB[]NAME="$ac_cv_lib[]Name[]_libs" + LTLIB[]NAME="$ac_cv_lib[]Name[]_ltlibs" + INC[]NAME="$ac_cv_lib[]Name[]_cppflags" + AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME) + AC_SUBST([LIB]NAME) + AC_SUBST([LTLIB]NAME) + dnl Also set HAVE_LIB[]NAME so that AC_LIB_HAVE_LINKFLAGS can reuse the + dnl results of this search when this library appears as a dependency. + HAVE_LIB[]NAME=yes + undefine([Name]) + undefine([NAME]) +]) + +dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode) +dnl searches for libname and the libraries corresponding to explicit and +dnl implicit dependencies, together with the specified include files and +dnl the ability to compile and link the specified testcode. If found, it +dnl sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME} and +dnl LTLIB${NAME} variables and augments the CPPFLAGS variable, and +dnl #defines HAVE_LIB${NAME} to 1. Otherwise, it sets and AC_SUBSTs +dnl HAVE_LIB${NAME}=no and LIB${NAME} and LTLIB${NAME} to empty. +AC_DEFUN([AC_LIB_HAVE_LINKFLAGS], +[ + AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) + AC_REQUIRE([AC_LIB_RPATH]) + define([Name],[translit([$1],[./-], [___])]) + define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-], + [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) + + dnl Search for lib[]Name and define LIB[]NAME, LTLIB[]NAME and INC[]NAME + dnl accordingly. + AC_LIB_LINKFLAGS_BODY([$1], [$2]) + + dnl Add $INC[]NAME to CPPFLAGS before performing the following checks, + dnl because if the user has installed lib[]Name and not disabled its use + dnl via --without-lib[]Name-prefix, he wants to use it. + ac_save_CPPFLAGS="$CPPFLAGS" + AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME) + + AC_CACHE_CHECK([for lib[]$1], [ac_cv_lib[]Name], [ + ac_save_LIBS="$LIBS" + LIBS="$LIBS $LIB[]NAME" + AC_TRY_LINK([$3], [$4], [ac_cv_lib[]Name=yes], [ac_cv_lib[]Name=no]) + LIBS="$ac_save_LIBS" + ]) + if test "$ac_cv_lib[]Name" = yes; then + HAVE_LIB[]NAME=yes + AC_DEFINE([HAVE_LIB]NAME, 1, [Define if you have the $1 library.]) + AC_MSG_CHECKING([how to link with lib[]$1]) + AC_MSG_RESULT([$LIB[]NAME]) + else + HAVE_LIB[]NAME=no + dnl If $LIB[]NAME didn't lead to a usable library, we don't need + dnl $INC[]NAME either. + CPPFLAGS="$ac_save_CPPFLAGS" + LIB[]NAME= + LTLIB[]NAME= + fi + AC_SUBST([HAVE_LIB]NAME) + AC_SUBST([LIB]NAME) + AC_SUBST([LTLIB]NAME) + undefine([Name]) + undefine([NAME]) +]) + +dnl Determine the platform dependent parameters needed to use rpath: +dnl libext, shlibext, hardcode_libdir_flag_spec, hardcode_libdir_separator, +dnl hardcode_direct, hardcode_minus_L. +AC_DEFUN([AC_LIB_RPATH], +[ + dnl Tell automake >= 1.10 to complain if config.rpath is missing. + m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([config.rpath])]) + AC_REQUIRE([AC_PROG_CC]) dnl we use $CC, $GCC, $LDFLAGS + AC_REQUIRE([AC_LIB_PROG_LD]) dnl we use $LD, $with_gnu_ld + AC_REQUIRE([AC_CANONICAL_HOST]) dnl we use $host + AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT]) dnl we use $ac_aux_dir + AC_CACHE_CHECK([for shared library run path origin], acl_cv_rpath, [ + CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \ + ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh + . ./conftest.sh + rm -f ./conftest.sh + acl_cv_rpath=done + ]) + wl="$acl_cv_wl" + libext="$acl_cv_libext" + shlibext="$acl_cv_shlibext" + hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec" + hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator" + hardcode_direct="$acl_cv_hardcode_direct" + hardcode_minus_L="$acl_cv_hardcode_minus_L" + dnl Determine whether the user wants rpath handling at all. + AC_ARG_ENABLE(rpath, + [ --disable-rpath do not hardcode runtime library paths], + :, enable_rpath=yes) +]) + +dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and +dnl the libraries corresponding to explicit and implicit dependencies. +dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables. +AC_DEFUN([AC_LIB_LINKFLAGS_BODY], +[ + AC_REQUIRE([AC_LIB_PREPARE_MULTILIB]) + define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-], + [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) + dnl By default, look in $includedir and $libdir. + use_additional=yes + AC_LIB_WITH_FINAL_PREFIX([ + eval additional_includedir=\"$includedir\" + eval additional_libdir=\"$libdir\" + ]) + AC_LIB_ARG_WITH([lib$1-prefix], +[ --with-lib$1-prefix[=DIR] search for lib$1 in DIR/include and DIR/lib + --without-lib$1-prefix don't search for lib$1 in includedir and libdir], +[ + if test "X$withval" = "Xno"; then + use_additional=no + else + if test "X$withval" = "X"; then + AC_LIB_WITH_FINAL_PREFIX([ + eval additional_includedir=\"$includedir\" + eval additional_libdir=\"$libdir\" + ]) + else + additional_includedir="$withval/include" + additional_libdir="$withval/$acl_libdirstem" + fi + fi +]) + dnl Search the library and its dependencies in $additional_libdir and + dnl $LDFLAGS. Using breadth-first-seach. + LIB[]NAME= + LTLIB[]NAME= + INC[]NAME= + rpathdirs= + ltrpathdirs= + names_already_handled= + names_next_round='$1 $2' + while test -n "$names_next_round"; do + names_this_round="$names_next_round" + names_next_round= + for name in $names_this_round; do + already_handled= + for n in $names_already_handled; do + if test "$n" = "$name"; then + already_handled=yes + break + fi + done + if test -z "$already_handled"; then + names_already_handled="$names_already_handled $name" + dnl See if it was already located by an earlier AC_LIB_LINKFLAGS + dnl or AC_LIB_HAVE_LINKFLAGS call. + uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'` + eval value=\"\$HAVE_LIB$uppername\" + if test -n "$value"; then + if test "$value" = yes; then + eval value=\"\$LIB$uppername\" + test -z "$value" || LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$value" + eval value=\"\$LTLIB$uppername\" + test -z "$value" || LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$value" + else + dnl An earlier call to AC_LIB_HAVE_LINKFLAGS has determined + dnl that this library doesn't exist. So just drop it. + : + fi + else + dnl Search the library lib$name in $additional_libdir and $LDFLAGS + dnl and the already constructed $LIBNAME/$LTLIBNAME. + found_dir= + found_la= + found_so= + found_a= + if test $use_additional = yes; then + if test -n "$shlibext" && test -f "$additional_libdir/lib$name.$shlibext"; then + found_dir="$additional_libdir" + found_so="$additional_libdir/lib$name.$shlibext" + if test -f "$additional_libdir/lib$name.la"; then + found_la="$additional_libdir/lib$name.la" + fi + else + if test -f "$additional_libdir/lib$name.$libext"; then + found_dir="$additional_libdir" + found_a="$additional_libdir/lib$name.$libext" + if test -f "$additional_libdir/lib$name.la"; then + found_la="$additional_libdir/lib$name.la" + fi + fi + fi + fi + if test "X$found_dir" = "X"; then + for x in $LDFLAGS $LTLIB[]NAME; do + AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) + case "$x" in + -L*) + dir=`echo "X$x" | sed -e 's/^X-L//'` + if test -n "$shlibext" && test -f "$dir/lib$name.$shlibext"; then + found_dir="$dir" + found_so="$dir/lib$name.$shlibext" + if test -f "$dir/lib$name.la"; then + found_la="$dir/lib$name.la" + fi + else + if test -f "$dir/lib$name.$libext"; then + found_dir="$dir" + found_a="$dir/lib$name.$libext" + if test -f "$dir/lib$name.la"; then + found_la="$dir/lib$name.la" + fi + fi + fi + ;; + esac + if test "X$found_dir" != "X"; then + break + fi + done + fi + if test "X$found_dir" != "X"; then + dnl Found the library. + LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$found_dir -l$name" + if test "X$found_so" != "X"; then + dnl Linking with a shared library. We attempt to hardcode its + dnl directory into the executable's runpath, unless it's the + dnl standard /usr/lib. + if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/$acl_libdirstem"; then + dnl No hardcoding is needed. + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" + else + dnl Use an explicit option to hardcode DIR into the resulting + dnl binary. + dnl Potentially add DIR to ltrpathdirs. + dnl The ltrpathdirs will be appended to $LTLIBNAME at the end. + haveit= + for x in $ltrpathdirs; do + if test "X$x" = "X$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + ltrpathdirs="$ltrpathdirs $found_dir" + fi + dnl The hardcoding into $LIBNAME is system dependent. + if test "$hardcode_direct" = yes; then + dnl Using DIR/libNAME.so during linking hardcodes DIR into the + dnl resulting binary. + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" + else + if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then + dnl Use an explicit option to hardcode DIR into the resulting + dnl binary. + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" + dnl Potentially add DIR to rpathdirs. + dnl The rpathdirs will be appended to $LIBNAME at the end. + haveit= + for x in $rpathdirs; do + if test "X$x" = "X$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + rpathdirs="$rpathdirs $found_dir" + fi + else + dnl Rely on "-L$found_dir". + dnl But don't add it if it's already contained in the LDFLAGS + dnl or the already constructed $LIBNAME + haveit= + for x in $LDFLAGS $LIB[]NAME; do + AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) + if test "X$x" = "X-L$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir" + fi + if test "$hardcode_minus_L" != no; then + dnl FIXME: Not sure whether we should use + dnl "-L$found_dir -l$name" or "-L$found_dir $found_so" + dnl here. + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" + else + dnl We cannot use $hardcode_runpath_var and LD_RUN_PATH + dnl here, because this doesn't fit in flags passed to the + dnl compiler. So give up. No hardcoding. This affects only + dnl very old systems. + dnl FIXME: Not sure whether we should use + dnl "-L$found_dir -l$name" or "-L$found_dir $found_so" + dnl here. + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name" + fi + fi + fi + fi + else + if test "X$found_a" != "X"; then + dnl Linking with a static library. + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_a" + else + dnl We shouldn't come here, but anyway it's good to have a + dnl fallback. + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir -l$name" + fi + fi + dnl Assume the include files are nearby. + additional_includedir= + case "$found_dir" in + */$acl_libdirstem | */$acl_libdirstem/) + basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'` + additional_includedir="$basedir/include" + ;; + esac + if test "X$additional_includedir" != "X"; then + dnl Potentially add $additional_includedir to $INCNAME. + dnl But don't add it + dnl 1. if it's the standard /usr/include, + dnl 2. if it's /usr/local/include and we are using GCC on Linux, + dnl 3. if it's already present in $CPPFLAGS or the already + dnl constructed $INCNAME, + dnl 4. if it doesn't exist as a directory. + if test "X$additional_includedir" != "X/usr/include"; then + haveit= + if test "X$additional_includedir" = "X/usr/local/include"; then + if test -n "$GCC"; then + case $host_os in + linux* | gnu* | k*bsd*-gnu) haveit=yes;; + esac + fi + fi + if test -z "$haveit"; then + for x in $CPPFLAGS $INC[]NAME; do + AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) + if test "X$x" = "X-I$additional_includedir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_includedir"; then + dnl Really add $additional_includedir to $INCNAME. + INC[]NAME="${INC[]NAME}${INC[]NAME:+ }-I$additional_includedir" + fi + fi + fi + fi + fi + dnl Look for dependencies. + if test -n "$found_la"; then + dnl Read the .la file. It defines the variables + dnl dlname, library_names, old_library, dependency_libs, current, + dnl age, revision, installed, dlopen, dlpreopen, libdir. + save_libdir="$libdir" + case "$found_la" in + */* | *\\*) . "$found_la" ;; + *) . "./$found_la" ;; + esac + libdir="$save_libdir" + dnl We use only dependency_libs. + for dep in $dependency_libs; do + case "$dep" in + -L*) + additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'` + dnl Potentially add $additional_libdir to $LIBNAME and $LTLIBNAME. + dnl But don't add it + dnl 1. if it's the standard /usr/lib, + dnl 2. if it's /usr/local/lib and we are using GCC on Linux, + dnl 3. if it's already present in $LDFLAGS or the already + dnl constructed $LIBNAME, + dnl 4. if it doesn't exist as a directory. + if test "X$additional_libdir" != "X/usr/$acl_libdirstem"; then + haveit= + if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem"; then + if test -n "$GCC"; then + case $host_os in + linux* | gnu* | k*bsd*-gnu) haveit=yes;; + esac + fi + fi + if test -z "$haveit"; then + haveit= + for x in $LDFLAGS $LIB[]NAME; do + AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) + if test "X$x" = "X-L$additional_libdir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_libdir"; then + dnl Really add $additional_libdir to $LIBNAME. + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$additional_libdir" + fi + fi + haveit= + for x in $LDFLAGS $LTLIB[]NAME; do + AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) + if test "X$x" = "X-L$additional_libdir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_libdir"; then + dnl Really add $additional_libdir to $LTLIBNAME. + LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$additional_libdir" + fi + fi + fi + fi + ;; + -R*) + dir=`echo "X$dep" | sed -e 's/^X-R//'` + if test "$enable_rpath" != no; then + dnl Potentially add DIR to rpathdirs. + dnl The rpathdirs will be appended to $LIBNAME at the end. + haveit= + for x in $rpathdirs; do + if test "X$x" = "X$dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + rpathdirs="$rpathdirs $dir" + fi + dnl Potentially add DIR to ltrpathdirs. + dnl The ltrpathdirs will be appended to $LTLIBNAME at the end. + haveit= + for x in $ltrpathdirs; do + if test "X$x" = "X$dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + ltrpathdirs="$ltrpathdirs $dir" + fi + fi + ;; + -l*) + dnl Handle this in the next round. + names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'` + ;; + *.la) + dnl Handle this in the next round. Throw away the .la's + dnl directory; it is already contained in a preceding -L + dnl option. + names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'` + ;; + *) + dnl Most likely an immediate library name. + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$dep" + LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$dep" + ;; + esac + done + fi + else + dnl Didn't find the library; assume it is in the system directories + dnl known to the linker and runtime loader. (All the system + dnl directories known to the linker should also be known to the + dnl runtime loader, otherwise the system is severely misconfigured.) + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name" + LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-l$name" + fi + fi + fi + done + done + if test "X$rpathdirs" != "X"; then + if test -n "$hardcode_libdir_separator"; then + dnl Weird platform: only the last -rpath option counts, the user must + dnl pass all path elements in one option. We can arrange that for a + dnl single library, but not when more than one $LIBNAMEs are used. + alldirs= + for found_dir in $rpathdirs; do + alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$found_dir" + done + dnl Note: hardcode_libdir_flag_spec uses $libdir and $wl. + acl_save_libdir="$libdir" + libdir="$alldirs" + eval flag=\"$hardcode_libdir_flag_spec\" + libdir="$acl_save_libdir" + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag" + else + dnl The -rpath options are cumulative. + for found_dir in $rpathdirs; do + acl_save_libdir="$libdir" + libdir="$found_dir" + eval flag=\"$hardcode_libdir_flag_spec\" + libdir="$acl_save_libdir" + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag" + done + fi + fi + if test "X$ltrpathdirs" != "X"; then + dnl When using libtool, the option that works for both libraries and + dnl executables is -R. The -R options are cumulative. + for found_dir in $ltrpathdirs; do + LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir" + done + fi +]) + +dnl AC_LIB_APPENDTOVAR(VAR, CONTENTS) appends the elements of CONTENTS to VAR, +dnl unless already present in VAR. +dnl Works only for CPPFLAGS, not for LIB* variables because that sometimes +dnl contains two or three consecutive elements that belong together. +AC_DEFUN([AC_LIB_APPENDTOVAR], +[ + for element in [$2]; do + haveit= + for x in $[$1]; do + AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) + if test "X$x" = "X$element"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + [$1]="${[$1]}${[$1]:+ }$element" + fi + done +]) + +dnl For those cases where a variable contains several -L and -l options +dnl referring to unknown libraries and directories, this macro determines the +dnl necessary additional linker options for the runtime path. +dnl AC_LIB_LINKFLAGS_FROM_LIBS([LDADDVAR], [LIBSVALUE], [USE-LIBTOOL]) +dnl sets LDADDVAR to linker options needed together with LIBSVALUE. +dnl If USE-LIBTOOL evaluates to non-empty, linking with libtool is assumed, +dnl otherwise linking without libtool is assumed. +AC_DEFUN([AC_LIB_LINKFLAGS_FROM_LIBS], +[ + AC_REQUIRE([AC_LIB_RPATH]) + AC_REQUIRE([AC_LIB_PREPARE_MULTILIB]) + $1= + if test "$enable_rpath" != no; then + if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then + dnl Use an explicit option to hardcode directories into the resulting + dnl binary. + rpathdirs= + next= + for opt in $2; do + if test -n "$next"; then + dir="$next" + dnl No need to hardcode the standard /usr/lib. + if test "X$dir" != "X/usr/$acl_libdirstem"; then + rpathdirs="$rpathdirs $dir" + fi + next= + else + case $opt in + -L) next=yes ;; + -L*) dir=`echo "X$opt" | sed -e 's,^X-L,,'` + dnl No need to hardcode the standard /usr/lib. + if test "X$dir" != "X/usr/$acl_libdirstem"; then + rpathdirs="$rpathdirs $dir" + fi + next= ;; + *) next= ;; + esac + fi + done + if test "X$rpathdirs" != "X"; then + if test -n ""$3""; then + dnl libtool is used for linking. Use -R options. + for dir in $rpathdirs; do + $1="${$1}${$1:+ }-R$dir" + done + else + dnl The linker is used for linking directly. + if test -n "$hardcode_libdir_separator"; then + dnl Weird platform: only the last -rpath option counts, the user + dnl must pass all path elements in one option. + alldirs= + for dir in $rpathdirs; do + alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$dir" + done + acl_save_libdir="$libdir" + libdir="$alldirs" + eval flag=\"$hardcode_libdir_flag_spec\" + libdir="$acl_save_libdir" + $1="$flag" + else + dnl The -rpath options are cumulative. + for dir in $rpathdirs; do + acl_save_libdir="$libdir" + libdir="$dir" + eval flag=\"$hardcode_libdir_flag_spec\" + libdir="$acl_save_libdir" + $1="${$1}${$1:+ }$flag" + done + fi + fi + fi + fi + fi + AC_SUBST([$1]) +]) + +# lib-ld.m4 serial 3 (gettext-0.13) +dnl Copyright (C) 1996-2003 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 Subroutines of libtool.m4, +dnl with replacements s/AC_/AC_LIB/ and s/lt_cv/acl_cv/ to avoid collision +dnl with libtool.m4. + +dnl From libtool-1.4. Sets the variable with_gnu_ld to yes or no. +AC_DEFUN([AC_LIB_PROG_LD_GNU], +[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], acl_cv_prog_gnu_ld, +[# I'd rather use --version here, but apparently some GNU ld's only accept -v. +case `$LD -v 2>&1 conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' + else + PATH_SEPARATOR=: + fi + rm -f conf$$.sh +fi +ac_prog=ld +if test "$GCC" = yes; then + # Check if gcc -print-prog-name=ld gives a path. + AC_MSG_CHECKING([for ld used by GCC]) + case $host in + *-*-mingw*) + # gcc leaves a trailing carriage return which upsets mingw + ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; + *) + ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; + esac + 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 aren't 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 + AC_MSG_CHECKING([for GNU ld]) +else + AC_MSG_CHECKING([for non-GNU ld]) +fi +AC_CACHE_VAL(acl_cv_path_LD, +[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" || test -f "$ac_dir/$ac_prog$ac_exeext"; then + acl_cv_path_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. + case `"$acl_cv_path_LD" -v 2>&1 < /dev/null` in + *GNU* | *'with BFD'*) + test "$with_gnu_ld" != no && break ;; + *) + test "$with_gnu_ld" != yes && break ;; + esac + fi + done + IFS="$ac_save_ifs" +else + acl_cv_path_LD="$LD" # Let the user override the test with a path. +fi]) +LD="$acl_cv_path_LD" +if test -n "$LD"; then + AC_MSG_RESULT($LD) +else + AC_MSG_RESULT(no) +fi +test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH]) +AC_LIB_PROG_LD_GNU +]) + +# 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([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl +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-${am__api_version}, $missing_dir) +AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir) +AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}, $missing_dir) +AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir) +AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir) +AC_REQUIRE([AC_PROG_MAKE_SET])]) + +# Copyright 2002 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA + +# AM_AUTOMAKE_VERSION(VERSION) +# ---------------------------- +# Automake X.Y traces this macro to ensure aclocal.m4 has been +# generated from the m4 files accompanying Automake X.Y. +AC_DEFUN([AM_AUTOMAKE_VERSION],[am__api_version="1.4"]) + +# AM_SET_CURRENT_AUTOMAKE_VERSION +# ------------------------------- +# Call AM_AUTOMAKE_VERSION so it can be traced. +# This function is AC_REQUIREd by AC_INIT_AUTOMAKE. +AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], + [AM_AUTOMAKE_VERSION([1.4-p6])]) + +# +# 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)]) + diff --git a/documentation/ccf-proposal b/documentation/ccf-proposal new file mode 100644 index 00000000..a67fc8dc --- /dev/null +++ b/documentation/ccf-proposal @@ -0,0 +1,124 @@ + + proposal for the chaos configuration utility + copyright 1999 chaos development +----------------------------------- + + +the chaos configuration utility shall be used by every program running under +chaos and is dependant on a configuration file. each program has to supply it's +own template file. the chaos configuration utility uses this file to present +to the user, a friendly, graphical interface to set and change the +configuration of the program. the program may supply a configuration file as +well, but that will not be neccessary as it can easily be created from the +template file. every program-package MUST create a +/config//template file. the configuration utility checks on +startup all the directories in the /config directory and presents the found +directories to the user to choose from, unless program-name was given as a +parameter. after this step, the configuration program reads the template file +and creates all the menus, buttons and textboxes needed. + + + the template format and datatypes +------------------------------------- + + +the main template-skeleton is built up by sections like this: + +section ("card settings") +{ + /* stuff here */ +} + +section ("ethernet firewalling") +{ + /* more stuff here */ +} + +the user first has to choose a section to edit. this is to add overview to the +configuration files and categorize all the options for the user. the program +stores two files, when using this template; card_settings and +ethernet_firewalling. they are both located in /config/ + +each section is then built up by various datatypes with names and possible +values: + +section ("card settings") +{ + integer io (0x280 to 0x360 step 0x10); + integer irq (3, 5, 9, 10, 11, 13); + check mac_assigned ("assign static ethernet address") + { + integer mac (0 to 0xFFFFFFFFFFFF); + } + select connection_type ("10baseT", "10Base2", "100baseTX"); + text my_story ("write about your life, pal"); +} + +section ("ethernet firewalling") +{ + check ethernet_firewalling ("enable ethernet-level firewalling") + { + group policy + { + select type ("reject", "deny") + { + case ("reject") + { + integer mac (0 to 0xFFFFFFFFFFFF); + choice log; + textbox return_text ("send this text in the icmp-reject package"); + } + case ("deny") + { + integer mac (0 to 0xFFFFFFFFFFFF); + choice log; + } + } + } + } +} + +in this example, in the first section (card settings) you will have nine io +addresses to choose from from a listbox, and similar with the irq. there will +also be a checkbox (which can either be "on" or "off") and if it is checked/on, +you will be able to fill in a textbox to assign a mac-address. this checkbox +will only accept numbers between 0 and 0xFFFFFFFFFFFF. there will be a textbox +for you to write about yourself too. this text has no limitations and can +contain almost anything. the following is an example of a configuration file +generated from this template: + +section ("card settings") +{ + io = 0x300; + irq = 10; + mac_assigned = TRUE; + mac = 0x4f035b8cd934; + connection_type = "10baseT"; + my_story = "i was born, then i became l33t and finally i became a quaker..."; +} + +section ("ethernet firewalling") +{ + ethernet_firewalling = TRUE; + policy + { + type = "reject"; + mac = 0x0472bd9c45ff; + log = FALSE; + } + policy + { + type = "reject"; + mac = 0xfbc67d8200b0; + log = TRUE; + } + policy + { + type = "deny"; + mac = 0x9c667bd3f67d; + log = FALSE; + return_text = "du suger!"; + } +} + +more datatypes will be added as there are needs for them... diff --git a/documentation/changelog b/documentation/changelog new file mode 100644 index 00000000..7524e83e --- /dev/null +++ b/documentation/changelog @@ -0,0 +1,238 @@ +1999-10-19 Per Lundberg + + * servers/debugshell/debugshell.c (command): Removed some erroneous + entries. + + * include/misc.h (delay): Added inline function used for doing delays + which is needed when accessing some ISA hardware.. + +1999-10-08 Per Lundberg + + * storm/i386/process.c (process_vm_range_reserve): Created + process_vm_range_reserve, with equal functionality as + page_range_reserve, except that it reserved linear instead of + physical pages. + + * storm/i386/elf.c (elf_execute): Now calls process_vm_range_reserve + to reserve it's memory space. + (elf_execute): Added a call to process_vm_init. + +1999-10-03 Per Lundberg + + * include/port.h: Rewrote all the functions in a new and better style + inspired by Zack Weinberg. + +1999-10-01 Per Lundberg + + * storm/i386/message.c: Documented the message support better. + * storm/i386/message.c: Started implemented queuing of messages. + +1999-09-30 Per Lundberg + + * Makefile.am: New target 'install' for copying the GRUB menu file, + the servers and the kernel to the place specified by the --prefix + parameter to the configure script. The reason I did this was because + I needed it for the new netboot feature of GNU GRUB. + +1999-09-26 Per Lundberg + + * Lots, and *LOTS* of changes. We've finally made the memory + management work so that new tasks can be created. Since we changed + almost 100% of the memory management code, some bugs may still persist. + +1999-09-05 Per Lundberg + + * I've implemented a buddy system for memory allocation. So far a + very limited implementation, but it will shortly support + deallocation and other nice stuff. :) + +1999-09-04 Per Lundberg + + * We haven't updated the changelog recently since we've been so + busy coding. Anyway, I've now created a little Perl script to + simplify management of the system calls. Now all files that are + dependant on the names and number of arguments of the system + calls are automatically created by this script (except for + syscall.h, since that would be quite difficult) + * Other things that has been done: MHz detection, PS/2 mouse support, + (non-working) serial support, a first development version of tornado + (pretty much just a joke right now) and probably some other stuff + I'm just forgetting about. + +1999-07-29 Per Lundberg + + * Me and eihrul (eihrul@chaosdev.org) has been doing a whole lot + lately. Not much concrete, but we've been discussing how thing should + and shouldn't work. As I'm writing, eihrul is implementing a first + attempt to a real IPC system (only events for now; see ipc.txt in + the documentation directory for the full specification). The full + IPC support will probably be done pretty soon. Crimson is coming + over to my place tomorrow for some major coding. + * We have also decided to move the VFS support into a server of it's + own, and to do some kind of exec server which will make using + different binary formats very easy. + +1999-07-16 Per Lundberg + + * Lot's of stuff has been fixed up, as usual. We've now got a fully + working VGA server, with support for 320x200x256, 80x50 and (broken? + It didn't work for me) 640x480x16 and 640x400x256 support. I've also + been redoing parts of the makefiles so that you can make a virtual + floppy even if your chaos source is located on an NFS drive. + +1999-06-25 Per Lundberg + + * We've now got a working printf() in the kernel, which makes the + source a whole lot easier to read. We also added an sprintf() call in + the server library. + * A server stub has been written to make writing of servers quite much + simpler, esp. if you're used to other systems. + +1999-06-18 Per Lundberg + + * We've had a little coding meeting to finish up stuff. The ELF support + is now much more complete and is able to load standard Linux linked + binaries. + * Process communication works perfectly now, so it's about time to + start code some servers and stuff. + * Interrupt handling is highly broken due to the paging implementation. + This is being worked on. + +1999-06-15 Henrik Hallin + + * Received the latest storm sourcecode from Plundis, who had been + rewriting parts of it to make the storm compatible with GRUB. + * storm now loads perfectly from GRUB and can also be gzipped. + * Servers are no longer held inside a kernelimage. They are instead + loaded with the module=xxx command from GRUB. The servers can also be + gzipped. + * Started finishing paging... + +1999-05-28 Henrik Hallin + + * Wrote a simple rr scheduler, allowing processes to be put to sleep + and waked up in a simple way. + * Added event timers, so a process can put itself to sleep for a given + number of milliseconds. + * Started rewriting the whole memory layout, both physical and virtual. + * Started writing the IPC. + +1999-05-01 Henrik Hallin + + * Started implementing support for paging in storm. I set up basic + paging structures for the kernel during initialisation. + * Bochs seems a little buggy so chaos won't run under it anymore. + * Added cpuid code, to be able to detect the presence of for example + MMX in the cpu. + * Fixed some cosmetic things regarding the server startup sequence. + * Removed some junk from the chaos directories. + * Made some new homepages, to replace the existing one. + * Started writing a little on a scheduler. + * Rearranged the physical memory layout, making place for a page + directory and one page table for the kernel. + +1999-04-18 Per Lundberg + + * The syscall for registering IRQ:s work almost perfectly now. For + some reason, the wrong data segment is being used, but I'm checking + it out right now and it'll probably work just fine later tonight. + The reason thing's are a little messy is the fact that we don't want + an interrupt handler to just go boom about everything and have + unlimited access to the computer; this is a basic design issue in + chaos (a program should not be able to crash the computer at all). + * syscall_register_port() works absolutely perfectly now. + +1999-04-10 Per Lundberg + + * Gameland is over and we've come home. During the party we looked + at the syscalls a little and started rewriting the keyboard support + as a true server. + * I've also moved the kernel stack from 0x53000 to 0x13000, so that + it's right before the kernel code instead of right after (guess why) + +1999-03-27 Per Lundberg + + * ELF support is now working just fine, when using our custom LD + script. Regular binaries won't work until we've got paging up and + running. + * All of the kernel has been rewritten to use a flat DS descriptor + instead of the old style (small DS only for kernel memory). This + makes the kernel extremely much easier to write and let us remove a lot + of junk (all of the memio.asm) + * Some unneccessary comments have been removed to make the kernel + source tinier.. + * Rewrote the old TODO file to changelog format, which is the + reason some of the older comments aren't really about what's done + but more about what's to be done. The reason I kept the old stuff + is (of course) for nostalgia. :) + +1999-03-15 Henrik Hallin + + * We have not done so many important things on the storm lately, just + planning and thinking. But almost everything has been changed a little + in some way. The storm is going to be something completely different + from the kernel we once started writing on. We think that the storm is + going to fit in 64k easily, because of its lack of any drivers. All + memory I/O and stuff like that originally planned to be contained in + the microkernel is going to be removed and replaced with servers. + * We have started writing on the ELF support in the microkernel so we + then can start writing the servers. + * The multitasking worked perfectly when we had the structures + statically set up. But now I have been rewriting the process functions + so that you can dynamically start and stop tasks. When the elf support + is finished we can combine these parts and the process support in the + kernel will be complete. + * Console functions are going to be removed, which will further reduce + the size of the storm. + * Added VESA videomode setup in the init code, so that you will be + able to run chaos in any VESA 2.0 compatible videomode. The idea is + that the init code will set up a video mode, using VBE 2.0 calls, for + example 1280x1024x16. This mode will then be used the whole time, with + no possibility to change the videomode later. The gui and the text + consoles will use the same mode all the time. + +1999-02-06 Henrik Hallin + + * The microkernel has been given a name: storm. + * The memory is slightly rearranged. + * IRQ / exception handling works well. + * Support for CPU halt/reboot. + * Loader works well and loads perfectly from a harddrive. + It should be rewritten though, to use int 0x13 extensions if + available. + * Physical memory page allocation almost works. + * Timer driven task switcher works, almost. :) + * Writing numbers doesn't seem to work at all. :( + * We have been thinking a *LOT* on the server architecture and storm + is going to be very small with a lot of servers running under it. + +1999-01-05 Per Lundberg + + * Reprogram the timer circuit + * Finish (oh, well..) the keyboard handler and make it translate + scancodes to ASCII + * Make %d in _printf work + +1999-01-04 Per Lundberg + + * Make interrupt and exception handling. + +1998-12-11 Per Lundberg + + * Make the loading of the microkernel work. ;) + +1998-12-03 Per Lundberg + + * Fix the PM initialization code to set things up correctly and + organize the memory in an elegant way. + * Actually switch to protected mode and do something to show that it + works out the way it should work. + * Continue writing the microkernel basic functionality (DMA, IRQ, + memory I/O and so on) + +1998-11-16 Per Lundberg + + * Re-write loader.asm to use BIOS calls for writing text. + * Make a proper list of how things ought to work and microkernel + structures. Document the system call features of the microkernel. + * Start working on the microkernel. diff --git a/documentation/chaos-both.dsssl b/documentation/chaos-both.dsssl new file mode 100644 index 00000000..2713e35f --- /dev/null +++ b/documentation/chaos-both.dsssl @@ -0,0 +1,113 @@ + + + +]]> + + +]]> +]> + + + + + + + + + +;; ==================== +;; customize the print stylesheet +;; ==================== + +;; make funcsynopsis look pretty +(define %funcsynopsis-decoration% + ;; Decorate elements of a FuncSynopsis? + #t) + +;; this is necessary because right now jadetex does not understand +;; symbolic entities, whereas things work well with numeric entities. +(declare-characteristic preserve-sdata? + "UNREGISTERED::James Clark//Characteristic::preserve-sdata?" + #f) +(define %two-side% #t) + +(define %section-autolabel% + ;; Are sections enumerated? + #t) +;; (define %title-font-family% +;; ;; The font family used in titles +;; "Ariel") +(define %visual-acuity% + ;; General measure of document text size + ;; "presbyopic" + ;; "large-type" + "presbyopic") + +(define %generate-part-toc% #t) + +;; (define %block-start-indent% 10pt) + +(define %graphic-default-extension% "eps") + + + + + + + + + +;; this is necessary because right now jadetex does not understand +;; symbolic entities, whereas things work well with numeric entities. +(declare-characteristic preserve-sdata? + "UNREGISTERED::James Clark//Characteristic::preserve-sdata?" + #f) + +;; put the legal notice in a separate file +(define %generate-legalnotice-link% + #t) + +(define %funcsynopsis-decoration% + ;; Decorate elements of a FuncSynopsis? + #t) + +(define %html-ext% ".html") +(define %body-attr% + ;; What attributes should be hung off of BODY? + '()) +;; (list +;; (list "BGCOLOR" "#FFFFFF") +;; (list "TEXT" "#000000"))) + +(define %generate-article-toc% + ;; Should a Table of Contents be produced for Articles? + ;; If true, a Table of Contents will be generated for each 'Article'. + #t) + +(define %generate-part-toc% #t) + +(define %shade-verbatim% + #t) + +(define %use-id-as-filename% + ;; Use ID attributes as name for component HTML files? + #t) + +(define %graphic-default-extension% "gif") + +(define %stylesheet% "/documentation.css") +(define %stylesheet-type% "text/css") + + + + + + + diff --git a/documentation/coding-standards.fot b/documentation/coding-standards.fot new file mode 100644 index 00000000..620895d2 --- /dev/null +++ b/documentation/coding-standards.fot @@ -0,0 +1,1056 @@ + + + + + +The chaos Coding Standards + + + +Per + +Lundberg + +$Id$ + + +Introduction + + This is The chaos Coding Standards. It is a guide in programming + + for the chaos operating system. If you intend to submit your + + code, please adhere to these standards. This will save both you + + and us some unnecessary work reformatting and rewriting the + + code. It is very important to keep the same quality on all + + code. + + + + The code formatting chapters in this publication is mostly + + C-related, but some of them can be used for other languages too. + + + + +Language choice + + Choosing the right language for a project is very important. If + + you make a bad choice, it may render the program unusable for + + some, or all, of its users. For example, if you choose a + + language where a free interpreter/compiler is not available, few + + people will be able to use it. So please, choose a language + + which is usable. Another important aspect is to choose a + + language as suitable for the project as possible. For example, + + storm, the chaos kernel, is written in a C and assembly + + combination. This is because those were the most suitable + + languages - C is quite low-level, which is good for a kernel, and + + assembly is almost necessary to use. But those considerations + + may vary depending on your project type. For example, the + + + +cAPS + (chaos Advanced Packaging System) system + + is written in a combination of C and Perl, since we found those + + languages to be most suitable. + + + + If you do not think you will be able to do the project all by + + yourself, try using a language that is widely accepted (C, C++ + + and Perl are three good examples). Avoid using "smaller" + + languages like Objective C or Haskell if possible. + + + + +License choice + + chaos is a free operating system, as defined by the FSF, and as + + such, all parts of it must be free. However, they do not have to + + be GPL, even though we encourage people to release their work + + under this license. This is the list of acceptable licenses for + + chaos: + + + + + + + + + +GNU GPL (General public license) + is + + our preferred license for all code we write + + + +except + for the system + + libraries. This is necessary to make licensing of chaos + + programs under other free licenses possible. Use this + + license if possible. + + + + + + +GNU LGPL (Lesser General Public + + License) + permits linkage between your work and + + proprietary (closed-source, non-free) programs. We only + + use this license for the system libraries. It is + + deprecated for everything else. + + + + + + +BSD + is the Berkeley Software + + Distribution license. We do not use it, but you may use it + + + +if +, and only if, you remove the + + advertising clause. We do not recommend using this license + + anyway, since it is not a copyleft and thus does not + + + protect your freedom in a way we prefer, but we will + + nevertheless accept if you decide to do so. + + + + + + +The Artistic license + is the license + + used by Perl. We do not encourage its usage except for + + Perl-related things; in such cases, please follow the Perl + + example and dual-license your code under both the Artistic + + license and the GNU GPL. + + + + + The GNU FDL (Free Documentation License) is a pretty new + + license from the Free Software Foundation. It is intended + + for documentation, and should be used for that. + + + + + + + You do not need to give over the rights to your code to + + us. Licensing it under one of those licenses is probably enough, + + but be careful if you have signed a contract with your employer + + stating they own everything you write. If so, you can not + + legally license the code under GPL yourself. You must get + + permission from your employer to do so. Please be careful with + + these issues so neither you or we get into legal trouble. + + + + +Compiler flags + + The chaos build system, autochaos, automatically uses our + + standard C flags, so there is little need to duplicate them + + here. What our flags do is try to eliminate the pitfalls of the + + C programming language (there are quite a few). The only really + + important flag is -Werror, which turns all warnings into + + errors. We believe this should have been the default in gcc. A + + warning is nothing to take lightly. And really, if you do not + + care about the warning, why don't you turn it off? + + + + +Symbol names + + All symbol names should be in lower-case only. The only + + exception to this is acronyms like VGA, GDT, IDT etc, where you + + could put the acronym in uppercase if you would like. Separate + + logic words with underscores, like this: screen_base_address. + + + + It is very important to be consequent when naming your + + functions, variables and such. Do not abbreviate names. It only + + makes it harder to figure out what a function or variable is + + used for. Symbol names must + +always + be + + descriptive. One-name variables are neat for the lazy, but is a + + no-no. Try to name your counter variables index (if you are + + operating on a one-dimensional list), x and y (if a + + two-dimensional structure), x, y and z, and so on. In short, try + + to be as descriptive as possible. It is tempting at times to + + call your variables i, j, k and such, but this just makes the + + program more difficult for other people to get into. + + + + All global symbols should have their file name prepended to + + them. Thus, all the symbols exported from the file + + + +port.c + should be named port_*. When doing a + + library, it is okay to split it up into smaller files and still + + have the functions named foo_bar. (if the library name is foo) + + + + +Functions + + The usage of functions is standard in all structured + + programming. You should try to keep your functions as long as + + suitable. We do not give a specific limit, but try to split your + + code in natural functions. For example, if your program is + + reading and processing lines from a file, and the +processing is + + more than a few statements of code, put it in a separate + + function. This is not really difficult when you get used to it. + + + + Always put a comment before the function declaration where you + + state what it does. It is also desirable that you document the + + input and return variables if it is not implicit. + + + + A typical function declaration can look like this: + + + + /* Initialise the page allocation system. */ + + + + void page_init (void) + + { + + [...] + + } + + + + As you see, we do not put the function name in the leftmost + + column. There is no reason to do so. It just makes the code look + + ugly. + + + + Also, if the function types and names do not fit on one line, + + write it like this: + + + + extern inline return_type system_call_thread_control + + (process_id_type process_id, u32 class, u32 parameter) + + + + +Comments + + Code without comments is like an operating system without + + applications -- it is not very usable. Try to comment your code + + as much as suitable to understand it for a reasonably + + experienced programmer. A good idea is to let someone else look + + at your code and see where she gets stuck. + + + + Always put comments on their own line, with a blank line above + + and below. Do not put comments at the end of the line, after the + + code; it just makes everything messy. + + + + When commenting a statement, put the comment above the + + statement, like this: + + + + /* Check if we are ready yet. */ + + + + if (finished ()) + + { + + return; + + } + + + + Some people like C++ comments. We prefer to only use them for + + temporary commenting away code, so that they can not get + + mistaken for being real comments. + + + + +Indentation + + The indentation level should be two spaces. Do not use + + tabs. When starting a new block, the braces should be on their own line + + at the same level of indentation as the previous line, like this: + + + + if (age > LEGAL_AGE) + + { + + print_age (age); + + } + + + + +Inline assembly + + Inline assembly is a twin-edged sword. It can make + + computing-intensive programs a lot speedier, at the cost of + + making the source more difficult to get into. Generally, only + + use it if the speed gain is significant, or in the kernel and + + other places where things might be impossible to do without + + it. In general user programs there is little need for it, but + + occasionally, it might be okay. The thumb rule is to start by + + optimising the algorithms. If that is not enough, try to profile + + your code and see where the most time is spent, and rewrite + + those parts in assembly. If the gain is more than a few percent, + + inline assembly is okay. + + + + If you for one reason or another have to use inline assembly, do + + it like this: + + + + asm volatile + + ("\ + + pushl %2 + + pushl %3 + + pushl %4 + + lcall %5, $0 + + " + + : "=a" (return_value), "=g" (*buffer) + + : "g" (buffer), "g" +(parameter), "g" (class), + + "n" (SYSTEM_CALL_KERNELFS_ENTRY_READ << 3)); + + + + Do not write long blocks of uncommented inline assembly, but + + keep it into functional blocks separated with blank lines and + + comments, so it is easier to get into the code. + + + + +Miscellaneous + + Here you will find stuff that did not fit into one of the + + previous chapters: + + + + + + + + When writing if-statements, always use braces to indicate + + a block, even for one-line statements where it is not + + required. Like this: + + + + if (age > LEGAL_AGE) + + { + + print_age (age); + + } + + else + + { + + return; + + } + + + + + When writing switch statements, always use braces in the + + case blocks. Like this: + + + + switch (key) + + { + + case ESCAPE: + + { + + return; + + } + + } + + + + + When writing conditional statements, never use the fact + + that non-zero is TRUE. You can only do this on + + booleans. If something is not a boolean, you must compare + + it with a number. Like this: + + + + if (get_age () != 0) + + { + + do_something (); + + } + + + + This makes things much clearer. The lack of real booleans + + in C is showing, but using this fact makes your programs + + very ugly. + + + + + When declaring external functions (in library header files + + and elsewhere), always write like this: + + + + extern my_function (void); + + + + The extern attribute is not mandatory in gcc, but use it + + anyway since it makes it very clear what we are talking about. + + + + + + + +Whitespace + + A lot of programmers tend to forget how important whitespace is + + to write good code. A good example of this can be found in the + + Linux source code, but unfortunately, the practice is rather + + common (especially in the Unix world). In chaos, we use as much + + whitespace as is practical. Always use whitespace between + + function names and parentheses, after commas, semicolons and + + other places. Separate blocks of code with blank lines and + + comments. + + + + +Documentation + + Documentation is essential for a program to succeed. All + + documentation should be written in English (but may also be + + translated to other languages if desirable). The standard format + + for documentation in chaos is SGML using the DocBook DTD. You + + can find more information about this DTD on + + the + +DocBook Web Site +. + + + + +Examples + + +A C example + +/* $Id$ */ + +/* Abstract: Semaphores for the kernel. */ + + + +/* Copyright 1999-2000 chaos development. */ + + + +/* 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 +< +storm/i386/error_numbers.h +> + + +#include +< +storm/i386/semaphore.h +> + + +#include +< +storm/i386/thread.h +> + + +#include +< +storm/i386/types.h +> + + +#include +< +storm/state.h +> + + + + +/* Semaphore lock variable. 1 if none is accessing the semaphores, 0 + + if someone is. */ + + + +static kernel_mutex_type semaphore_mutex = 1; + + + +error_type semaphore_wait (kernel_semaphore_type *semaphore) + +{ + + spin_lock (semaphore_mutex); + + + + if (*semaphore +< += 0) + + { + + spin_unlock (semaphore_mutex); + + thread_block_semaphore (STATE_SEMAPHORE, semaphore); + + return ERROR_UNKNOWN; + + } + + else + + { + + (*semaphore)--; + + spin_unlock (semaphore_mutex); + + } + + + + return ERROR_UNKNOWN; + +} + + + +/* Release the lock around the given semaphore. */ + + + +error_type semaphore_signal (kernel_semaphore_type *semaphore) + +{ + + spin_lock (semaphore_mutex); + + + + if (thread_unblock_semaphore (semaphore) == ERROR_NO_THREAD_UNBLOCKED) + + { + + (*semaphore)++; + + } + + + + spin_unlock (semaphore_mutex); + + + + return ERROR_UNKNOWN; + +} + + + + +A Perl example + +#!/usr/bin/perl -w + + + +# $Id$ + + + +# Abstract: Program for building chaos packages. + +# Author: Per Lundberg +< +plundis@chaosdev.org +> + + + + +use chaos::cAPS; + +use strict; + + + +my $CONFIGFILE; + + + +# Abstract: Clean things up. + + + +sub cleanup + +{ + + close (CONFIGFILE); + +} + + + +my $cAPS = new chaos::cAPS ('/mnt/chaos/system/caps'); + +my %config_keyword = $cAPS->config_keyword_get (); + +my %config; + + + +# All mandatory keywords are stored in this list. + + + +my @mandatory_keyword = ('name', 'type', 'version', 'description' ); + + + +open (CONFIGFILE, ' +< +chaos/config') or die "Couldn't open chaos/config.\n"; + + + +# This is the main config file parser loop. Neat, isn't it? :) This + +# used to be written in flex/bison, and was rather complex and + +# difficult to get into. But now... + + + +while ( +< +CONFIGFILE +> +) + +{ + + chop; + + ($_, my $dummy) = split ('#'); + + (my $key, my $value) = /^([\w\-]+)\s*=\s*\"([^\"]*)\"/; + + + + if (!$key || !$value) + + { + + print ("Syntax error in config file: $_.\n"); + + exit; + + } + + + + my $flag = 1; + + + + foreach my $config_key (keys %config_keyword) + + { + + if ($config_keyword{$config_key} eq $key) + + { + + $config{$key} = $value; + + $flag = 0; + + } + + } + + if ($flag == 1) + + { + + print ("Bad keyword '$key' in config file. Aborting.\n"); + + exit 1; + + } + +} + + + +# It's time to start some serious business. But first, we check that + +# all mandatory keywords have been specified. + + + +foreach my $keyword (@mandatory_keyword) + +{ + + if (!$config{$keyword}) + + { + + print ("Mandatory keyword $keyword missing from config file.\n"); + + exit 1; + + } + +} + + + +# All things clear? Great! Now we check if the package directory + +# exists. + + + +# ..chaos/$config{name} + + + +# Clean things up. + + + +cleanup (); + + + + +Emacs settings for chaos indentation + + This is our .emacs settings for chaos indentation style for C + + code. It makes writing compliant code much easier. + + + + + + ;; chaos indentation style + + + + (defconst chaos-c-style + + '( + + (c-basic-offset . 2) + + (c-comment-only-line-offset . (0 . 0)) + + (c-comment-continuation-stars . "") + + (c-hanging-comment-ender-p . t) + + (c-offsets-alist . ( + + (statement-block-intro . +) + + (knr-argdecl-intro . +) + + (substatement-open . 0) + + (label . 0) + + (statement-cont . +) + + (case-label . 2) + + ) + + ) + + ) + + "chaos" + + ) + + + + (defun chaos-c-mode-common-hook () + + + + ;; add my personal style and set it for the current buffer + + + + (c-add-style "chaos" chaos-c-style t) + + + + ;; this will make sure spaces are used instead of tabs + + + + (setq indent-tabs-mode nil)) + + + + (add-hook 'c-mode-common-hook 'chaos-c-mode-common-hook) + + + diff --git a/documentation/coding-standards.sgml b/documentation/coding-standards.sgml new file mode 100644 index 00000000..da7379b8 --- /dev/null +++ b/documentation/coding-standards.sgml @@ -0,0 +1,661 @@ + + + + + The chaos Coding Standards + + + Per + Lundberg + + + Henrik + Hallin + + + Anders + Öhrt + + + $Id$ + + + + Introduction + + + This is The chaos Coding Standards. It is a guide in programming + for the chaos operating system. If you intend to submit your + code, please adhere to these standards. This will save both you + and us some unnecessary work reformatting and rewriting the + code. It is very important to keep the same quality on all + code. + + + + The code formatting chapters in this publication is mostly + C-related, but some of them can be used for other languages too. + + + + + + Language choice + + + Choosing the right language for a project is very important. If + you make a bad choice, it may render the program unusable for + some, or all, of its users. For example, if you choose a + language where a free interpreter/compiler is not available, few + people will be able to use it. So please, choose a language + which is usable. Another important aspect is to choose a + language as suitable for the project as possible. For example, + storm, the chaos kernel, is written in a C and assembly + combination. This is because those were the most suitable + languages - C is quite low-level, which is good for a kernel, and + assembly is almost necessary to use. But those considerations + may vary depending on your project type. For example, the + cAPS (chaos Advanced Packaging System) system + is written in a combination of C and Perl, since we found those + languages to be most suitable. + + + + If you do not think you will be able to do the project all by + yourself, try using a language that is widely accepted (C, C++ + and Perl are three good examples). Avoid using "smaller" + languages like Objective C or Haskell if possible. + + + + + License choice + + + chaos is a free operating system, as defined by the FSF, and as + such, all parts of it must be free. However, they do not have to + be GPL, even though we encourage people to release their work + under this license. This is the list of acceptable licenses for + chaos: + + + + + GNU GPL (General public license) is + our preferred license for all code we write + except for the system + libraries. This is necessary to make licensing of chaos + programs under other free licenses possible. Use this + license if possible. + + + + + + GNU LGPL (Lesser General Public + License) permits linkage between your work and + proprietary (closed-source, non-free) programs. We only + use this license for the system libraries. It is + deprecated for everything else. + + + + + + BSD is the Berkeley Software + Distribution license. We do not use it, but you may use it + if, and only if, you remove the + advertising clause. We do not recommend using this license + anyway, since it is not a copyleft and thus does not + protect your freedom in a way we prefer, but we will + nevertheless accept if you decide to do so. + + + + + + The Artistic license is the license + used by Perl. We do not encourage its usage except for + Perl-related things; in such cases, please follow the Perl + example and dual-license your code under both the Artistic + license and the GNU GPL. + + + + + + The GNU FDL (Free Documentation License) is a pretty new + license from the Free Software Foundation. It is intended + for documentation, and should be used for that. + + + + + + + + You do not need to give over the rights to your code to + us. Licensing it under one of those licenses is probably enough, + but be careful if you have signed a contract with your employer + stating they own everything you write. If so, you can not + legally license the code under GPL yourself. You must get + permission from your employer to do so. Please be careful with + these issues so neither you or we get into legal trouble. + + + + + Compiler flags + + + The chaos build system, autochaos, automatically uses our + standard C flags, so there is little need to duplicate them + here. What our flags do is try to eliminate the pitfalls of the + C programming language (there are quite a few). The only really + important flag is -Werror, which turns all warnings into + errors. We believe this should have been the default in gcc. A + warning is nothing to take lightly. And really, if you do not + care about the warning, why don't you turn it off? + + + + + Symbol names + + + All symbol names should be in lower-case only. The only + exception to this is acronyms like VGA, GDT, IDT etc, where you + could put the acronym in uppercase if you would like. Separate + logic words with underscores, like this: screen_base_address. + + + + It is very important to be consequent when naming your + functions, variables and such. Do not abbreviate names. It only + makes it harder to figure out what a function or variable is + used for. Symbol names must always be + descriptive. One-name variables are neat for the lazy, but is a + no-no. Try to name your counter variables index (if you are + operating on a one-dimensional list), x and y (if a + two-dimensional structure), x, y and z, and so on. In short, try + to be as descriptive as possible. It is tempting at times to + call your variables i, j, k and such, but this just makes the + program more difficult for other people to get into. + + + + All global symbols should have their file name prepended to + them. Thus, all the symbols exported from the file + port.c should be named port_*. When doing a + library, it is okay to split it up into smaller files and still + have the functions named foo_bar. (if the library name is foo) + + + + + Functions + + + The usage of functions is standard in all structured + programming. You should try to keep your functions as long as + suitable. We do not give a specific limit, but try to split your + code in natural functions. For example, if your program is + reading and processing lines from a file, and the processing is + more than a few statements of code, put it in a separate + function. This is not really difficult when you get used to it. + + + + Always put a comment before the function declaration where you + state what it does. It is also desirable that you document the + input and return variables if it is not implicit. + + + + A typical function declaration can look like this: + + + + /* Initialise the page allocation system. */ + + void page_init (void) + { + [...] + } + + + + As you see, we do not put the function name in the leftmost + column. There is no reason to do so. It just makes the code look + ugly. + + + + Also, if the function types and names do not fit on one line, + write it like this: + + + + extern inline return_type system_call_thread_control + (process_id_type process_id, u32 class, u32 parameter) + + + + + Comments + + + Code without comments is like an operating system without + applications -- it is not very usable. Try to comment your code + as much as suitable to understand it for a reasonably + experienced programmer. A good idea is to let someone else look + at your code and see where she gets stuck. + + + + Always put comments on their own line, with a blank line above + and below. Do not put comments at the end of the line, after the + code; it just makes everything messy. + + + + When commenting a statement, put the comment above the + statement, like this: + + + + /* Check if we are ready yet. */ + + if (finished ()) + { + return; + } + + + + Some people like C++ comments. We prefer to only use them for + temporary commenting away code, so that they can not get + mistaken for being real comments. + + + + + + Indentation + + + The indentation level should be two spaces. Do not use + tabs. When starting a new block, the braces should be on their own line + at the same level of indentation as the previous line, like this: + + + + if (age > LEGAL_AGE) + { + print_age (age); + } + + + + + Inline assembly + + + Inline assembly is a twin-edged sword. It can make + computing-intensive programs a lot speedier, at the cost of + making the source more difficult to get into. Generally, only + use it if the speed gain is significant, or in the kernel and + other places where things might be impossible to do without + it. In general user programs there is little need for it, but + occasionally, it might be okay. The thumb rule is to start by + optimising the algorithms. If that is not enough, try to profile + your code and see where the most time is spent, and rewrite + those parts in assembly. If the gain is more than a few percent, + inline assembly is okay. + + + + If you for one reason or another have to use inline assembly, do + it like this: + + + + asm volatile + ("\ + pushl %2 + pushl %3 + pushl %4 + lcall %5, $0 + " + : "=a" (return_value), "=g" (*buffer) + : "g" (buffer), "g" (parameter), "g" (class), + "n" (SYSTEM_CALL_KERNELFS_ENTRY_READ << 3)); + + + + Do not write long blocks of uncommented inline assembly, but + keep it into functional blocks separated with blank lines and + comments, so it is easier to get into the code. + + + + + Miscellaneous + + + Here you will find stuff that did not fit into one of the + previous chapters: + + + + + When writing if-statements, always use braces to indicate + a block, even for one-line statements where it is not + required. Like this: + + + + if (age > LEGAL_AGE) + { + print_age (age); + } + else + { + return; + } + + + + + + When writing switch statements, always use braces in the + case blocks. Like this: + + + + switch (key) + { + case ESCAPE: + { + return; + } + } + + + + + + When writing conditional statements, never use the fact + that non-zero is TRUE. You can only do this on + booleans. If something is not a boolean, you must compare + it with a number. Like this: + + + + if (get_age () != 0) + { + do_something (); + } + + + + This makes things much clearer. The lack of real booleans + in C is showing, but using this fact makes your programs + very ugly. + + + + + + When declaring external functions (in library header files + and elsewhere), always write like this: + + + + extern my_function (void); + + + + The extern attribute is not mandatory in gcc, but use it + anyway since it makes it very clear what we are talking about. + + + + + + + + Whitespace + + + A lot of programmers tend to forget how important whitespace is + to write good code. A good example of this can be found in the + Linux source code, but unfortunately, the practice is rather + common (especially in the Unix world). In chaos, we use as much + whitespace as is practical. Always use whitespace between + function names and parentheses, after commas, semicolons and + other places. Separate blocks of code with blank lines and + comments. + + + + + Documentation + + + Documentation is essential for a program to succeed. All + documentation should be written in English (but may also be + translated to other languages if desirable). The standard format + for documentation in chaos is SGML using the DocBook DTD. You + can find more information about this DTD on + the DocBook Web Site. + + + + + Examples + + + A C example + +/* $Id$ */ +/* Abstract: Semaphores for the kernel. */ + +/* Copyright 1999-2000 chaos development. */ + +/* 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 <storm/i386/error_numbers.h> +#include <storm/i386/semaphore.h> +#include <storm/i386/thread.h> +#include <storm/i386/types.h> +#include <storm/state.h> + +/* Semaphore lock variable. 1 if none is accessing the semaphores, 0 + if someone is. */ + +static kernel_mutex_type semaphore_mutex = 1; + +error_type semaphore_wait (kernel_semaphore_type *semaphore) +{ + spin_lock (semaphore_mutex); + + if (*semaphore <= 0) + { + spin_unlock (semaphore_mutex); + thread_block_semaphore (STATE_SEMAPHORE, semaphore); + return ERROR_UNKNOWN; + } + else + { + (*semaphore)--; + spin_unlock (semaphore_mutex); + } + + return ERROR_UNKNOWN; +} + +/* Release the lock around the given semaphore. */ + +error_type semaphore_signal (kernel_semaphore_type *semaphore) +{ + spin_lock (semaphore_mutex); + + if (thread_unblock_semaphore (semaphore) == ERROR_NO_THREAD_UNBLOCKED) + { + (*semaphore)++; + } + + spin_unlock (semaphore_mutex); + + return ERROR_UNKNOWN; +} + + + + + A Perl example + +#!/usr/bin/perl -w + +# $Id$ + +# Abstract: Program for building chaos packages. +# Author: Per Lundberg <plundis@chaosdev.org> + +use chaos::cAPS; +use strict; + +my $CONFIGFILE; + +# Abstract: Clean things up. + +sub cleanup +{ + close (CONFIGFILE); +} + +my $cAPS = new chaos::cAPS ('/mnt/chaos/system/caps'); +my %config_keyword = $cAPS->config_keyword_get (); +my %config; + +# All mandatory keywords are stored in this list. + +my @mandatory_keyword = ('name', 'type', 'version', 'description' ); + +open (CONFIGFILE, '<chaos/config') or die "Couldn't open chaos/config.\n"; + +# This is the main config file parser loop. Neat, isn't it? :) This +# used to be written in flex/bison, and was rather complex and +# difficult to get into. But now... + +while (<CONFIGFILE>) +{ + chop; + ($_, my $dummy) = split ('#'); + (my $key, my $value) = /^([\w\-]+)\s*=\s*\"([^\"]*)\"/; + + if (!$key || !$value) + { + print ("Syntax error in config file: $_.\n"); + exit; + } + + my $flag = 1; + + foreach my $config_key (keys %config_keyword) + { + if ($config_keyword{$config_key} eq $key) + { + $config{$key} = $value; + $flag = 0; + } + } + if ($flag == 1) + { + print ("Bad keyword '$key' in config file. Aborting.\n"); + exit 1; + } +} + +# It's time to start some serious business. But first, we check that +# all mandatory keywords have been specified. + +foreach my $keyword (@mandatory_keyword) +{ + if (!$config{$keyword}) + { + print ("Mandatory keyword $keyword missing from config file.\n"); + exit 1; + } +} + +# All things clear? Great! Now we check if the package directory +# exists. + +# ..chaos/$config{name} + +# Clean things up. + +cleanup (); + + + + + Emacs settings for chaos indentation + + + This is our .emacs settings for chaos indentation style for C + code. It makes writing compliant code much easier. + + + + + ;; chaos indentation style + + (defconst chaos-c-style + '( + (c-basic-offset . 2) + (c-comment-only-line-offset . (0 . 0)) + (c-comment-continuation-stars . "") + (c-hanging-comment-ender-p . t) + (c-offsets-alist . ( + (statement-block-intro . +) + (knr-argdecl-intro . +) + (substatement-open . 0) + (label . 0) + (statement-cont . +) + (case-label . 2) + ) + ) + ) + "chaos" + ) + + (defun chaos-c-mode-common-hook () + + ;; add my personal style and set it for the current buffer + + (c-add-style "chaos" chaos-c-style t) + + ;; this will make sure spaces are used instead of tabs + + (setq indent-tabs-mode nil)) + + (add-hook 'c-mode-common-hook 'chaos-c-mode-common-hook) + + + diff --git a/documentation/coding-standards.xml b/documentation/coding-standards.xml new file mode 100644 index 00000000..10cb8e4b --- /dev/null +++ b/documentation/coding-standards.xml @@ -0,0 +1,534 @@ + +The chaos Coding StandardsPerLundberg$Id$Introduction This is The chaos Coding Standards. It is a guide in programming + for the chaos operating system. If you intend to submit your + code, please adhere to these standards. This will save both you + and us some unnecessary work reformatting and rewriting the + code. It is very important to keep the same quality on all + code. + The code formatting chapters in this publication is mostly + C-related, but some of them can be used for other languages too. + Language choice Choosing the right language for a project is very important. If + you make a bad choice, it may render the program unusable for + some, or all, of its users. For example, if you choose a + language where a free interpreter/compiler is not available, few + people will be able to use it. So please, choose a language + which is usable. Another important aspect is to choose a + language as suitable for the project as possible. For example, + storm, the chaos kernel, is written in a C and assembly + combination. This is because those were the most suitable + languages - C is quite low-level, which is good for a kernel, and + assembly is almost necessary to use. But those considerations + may vary depending on your project type. For example, the + cAPS (chaos Advanced Packaging System) system + is written in a combination of C and Perl, since we found those + languages to be most suitable. + If you do not think you will be able to do the project all by + yourself, try using a language that is widely accepted (C, C++ + and Perl are three good examples). Avoid using "smaller" + languages like Objective C or Haskell if possible. + License choice chaos is a free operating system, as defined by the FSF, and as + such, all parts of it must be free. However, they do not have to + be GPL, even though we encourage people to release their work + under this license. This is the list of acceptable licenses for + chaos: + + GNU GPL (General public license) is + our preferred license for all code we write + except for the system + libraries. This is necessary to make licensing of chaos + programs under other free licenses possible. Use this + license if possible. + GNU LGPL (Lesser General Public + License) permits linkage between your work and + proprietary (closed-source, non-free) programs. We only + use this license for the system libraries. It is + deprecated for everything else. + BSD is the Berkeley Software + Distribution license. We do not use it, but you may use it + if, and only if, you remove the + advertising clause. We do not recommend using this license + anyway, since it is not a copyleft and thus does not + protect your freedom in a way we prefer, but we will + nevertheless accept if you decide to do so. + The Artistic license is the license + used by Perl. We do not encourage its usage except for + Perl-related things; in such cases, please follow the Perl + example and dual-license your code under both the Artistic + license and the GNU GPL. + The GNU FDL (Free Documentation License) is a pretty new + license from the Free Software Foundation. It is intended + for documentation, and should be used for that. + + You do not need to give over the rights to your code to + us. Licensing it under one of those licenses is probably enough, + but be careful if you have signed a contract with your employer + stating they own everything you write. If so, you can not + legally license the code under GPL yourself. You must get + permission from your employer to do so. Please be careful with + these issues so neither you or we get into legal trouble. + Compiler flags The chaos build system, autochaos, automatically uses our + standard C flags, so there is little need to duplicate them + here. What our flags do is try to eliminate the pitfalls of the + C programming language (there are quite a few). The only really + important flag is -Werror, which turns all warnings into + errors. We believe this should have been the default in gcc. A + warning is nothing to take lightly. And really, if you do not + care about the warning, why don't you turn it off? + Symbol names All symbol names should be in lower-case only. The only + exception to this is acronyms like VGA, GDT, IDT etc, where you + could put the acronym in uppercase if you would like. Separate + logic words with underscores, like this: screen_base_address. + It is very important to be consequent when naming your + functions, variables and such. Do not abbreviate names. It only + makes it harder to figure out what a function or variable is + used for. Symbol names must always be + descriptive. One-name variables are neat for the lazy, but is a + no-no. Try to name your counter variables index (if you are + operating on a one-dimensional list), x and y (if a + two-dimensional structure), x, y and z, and so on. In short, try + to be as descriptive as possible. It is tempting at times to + call your variables i, j, k and such, but this just makes the + program more difficult for other people to get into. + All global symbols should have their file name prepended to + them. Thus, all the symbols exported from the file + port.c should be named port_*. When doing a + library, it is okay to split it up into smaller files and still + have the functions named foo_bar. (if the library name is foo) + Functions The usage of functions is standard in all structured + programming. You should try to keep your functions as long as + suitable. We do not give a specific limit, but try to split your + code in natural functions. For example, if your program is + reading and processing lines from a file, and the processing is + more than a few statements of code, put it in a separate + function. This is not really difficult when you get used to it. + Always put a comment before the function declaration where you + state what it does. It is also desirable that you document the + input and return variables if it is not implicit. + A typical function declaration can look like this: + /* Initialise the page allocation system. */ + + void page_init (void) + { + [...] + } + As you see, we do not put the function name in the leftmost + column. There is no reason to do so. It just makes the code look + ugly. + Also, if the function types and names do not fit on one line, + write it like this: + extern inline return_type system_call_thread_control + (process_id_type process_id, u32 class, u32 parameter) + Comments Code without comments is like an operating system without + applications -- it is not very usable. Try to comment your code + as much as suitable to understand it for a reasonably + experienced programmer. A good idea is to let someone else look + at your code and see where she gets stuck. + Always put comments on their own line, with a blank line above + and below. Do not put comments at the end of the line, after the + code; it just makes everything messy. + When commenting a statement, put the comment above the + statement, like this: + /* Check if we are ready yet. */ + + if (finished ()) + { + return; + } + Some people like C++ comments. We prefer to only use them for + temporary commenting away code, so that they can not get + mistaken for being real comments. + Indentation The indentation level should be two spaces. Do not use + tabs. When starting a new block, the braces should be on their own line + at the same level of indentation as the previous line, like this: + if (age > LEGAL_AGE) + { + print_age (age); + } + Inline assembly Inline assembly is a twin-edged sword. It can make + computing-intensive programs a lot speedier, at the cost of + making the source more difficult to get into. Generally, only + use it if the speed gain is significant, or in the kernel and + other places where things might be impossible to do without + it. In general user programs there is little need for it, but + occasionally, it might be okay. The thumb rule is to start by + optimising the algorithms. If that is not enough, try to profile + your code and see where the most time is spent, and rewrite + those parts in assembly. If the gain is more than a few percent, + inline assembly is okay. + If you for one reason or another have to use inline assembly, do + it like this: + asm volatile + ("\ + pushl %2 + pushl %3 + pushl %4 + lcall %5, $0 + " + : "=a" (return_value), "=g" (*buffer) + : "g" (buffer), "g" (parameter), "g" (class), + "n" (SYSTEM_CALL_KERNELFS_ENTRY_READ << 3)); + Do not write long blocks of uncommented inline assembly, but + keep it into functional blocks separated with blank lines and + comments, so it is easier to get into the code. + Miscellaneous Here you will find stuff that did not fit into one of the + previous chapters: + + When writing if-statements, always use braces to indicate + a block, even for one-line statements where it is not + required. Like this: + if (age > LEGAL_AGE) + { + print_age (age); + } + else + { + return; + } + When writing switch statements, always use braces in the + case blocks. Like this: + switch (key) + { + case ESCAPE: + { + return; + } + } + When writing conditional statements, never use the fact + that non-zero is TRUE. You can only do this on + booleans. If something is not a boolean, you must compare + it with a number. Like this: + if (get_age () != 0) + { + do_something (); + } + This makes things much clearer. The lack of real booleans + in C is showing, but using this fact makes your programs + very ugly. + When declaring external functions (in library header files + and elsewhere), always write like this: + extern my_function (void); + The extern attribute is not mandatory in gcc, but use it + anyway since it makes it very clear what we are talking about. + + Whitespace A lot of programmers tend to forget how important whitespace is + to write good code. A good example of this can be found in the + Linux source code, but unfortunately, the practice is rather + common (especially in the Unix world). In chaos, we use as much + whitespace as is practical. Always use whitespace between + function names and parentheses, after commas, semicolons and + other places. Separate blocks of code with blank lines and + comments. + Documentation Documentation is essential for a program to succeed. All + documentation should be written in English (but may also be + translated to other languages if desirable). The standard format + for documentation in chaos is SGML using the DocBook DTD. You + can find more information about this DTD on + the DocBook Web Site. + ExamplesA C example/* $Id$ */ +/* Abstract: Semaphores for the kernel. */ + +/* Copyright 1999-2000 chaos development. */ + +/* 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 <storm/i386/error_numbers.h> +#include <storm/i386/semaphore.h> +#include <storm/i386/thread.h> +#include <storm/i386/types.h> +#include <storm/state.h> + +/* Semaphore lock variable. 1 if none is accessing the semaphores, 0 + if someone is. */ + +static kernel_mutex_type semaphore_mutex = 1; + +error_type semaphore_wait (kernel_semaphore_type *semaphore) +{ + spin_lock (semaphore_mutex); + + if (*semaphore <= 0) + { + spin_unlock (semaphore_mutex); + thread_block_semaphore (STATE_SEMAPHORE, semaphore); + return ERROR_UNKNOWN; + } + else + { + (*semaphore)--; + spin_unlock (semaphore_mutex); + } + + return ERROR_UNKNOWN; +} + +/* Release the lock around the given semaphore. */ + +error_type semaphore_signal (kernel_semaphore_type *semaphore) +{ + spin_lock (semaphore_mutex); + + if (thread_unblock_semaphore (semaphore) == ERROR_NO_THREAD_UNBLOCKED) + { + (*semaphore)++; + } + + spin_unlock (semaphore_mutex); + + return ERROR_UNKNOWN; +} + A Perl example#!/usr/bin/perl -w + +# $Id$ + +# Abstract: Program for building chaos packages. +# Author: Per Lundberg <plundis@chaosdev.org> + +use chaos::cAPS; +use strict; + +my $CONFIGFILE; + +# Abstract: Clean things up. + +sub cleanup +{ + close (CONFIGFILE); +} + +my $cAPS = new chaos::cAPS ('/mnt/chaos/system/caps'); +my %config_keyword = $cAPS->config_keyword_get (); +my %config; + +# All mandatory keywords are stored in this list. + +my @mandatory_keyword = ('name', 'type', 'version', 'description' ); + +open (CONFIGFILE, '<chaos/config') or die "Couldn't open chaos/config.\n"; + +# This is the main config file parser loop. Neat, isn't it? :) This +# used to be written in flex/bison, and was rather complex and +# difficult to get into. But now... + +while (<CONFIGFILE>) +{ + chop; + ($_, my $dummy) = split ('#'); + (my $key, my $value) = /^([\w\-]+)\s*=\s*\"([^\"]*)\"/; + + if (!$key || !$value) + { + print ("Syntax error in config file: $_.\n"); + exit; + } + + my $flag = 1; + + foreach my $config_key (keys %config_keyword) + { + if ($config_keyword{$config_key} eq $key) + { + $config{$key} = $value; + $flag = 0; + } + } + if ($flag == 1) + { + print ("Bad keyword '$key' in config file. Aborting.\n"); + exit 1; + } +} + +# It's time to start some serious business. But first, we check that +# all mandatory keywords have been specified. + +foreach my $keyword (@mandatory_keyword) +{ + if (!$config{$keyword}) + { + print ("Mandatory keyword $keyword missing from config file.\n"); + exit 1; + } +} + +# All things clear? Great! Now we check if the package directory +# exists. + +# ..chaos/$config{name} + +# Clean things up. + +cleanup (); + Emacs settings for chaos indentation This is our .emacs settings for chaos indentation style for C + code. It makes writing compliant code much easier. + + ;; chaos indentation style + + (defconst chaos-c-style + '( + (c-basic-offset . 2) + (c-comment-only-line-offset . (0 . 0)) + (c-comment-continuation-stars . "") + (c-hanging-comment-ender-p . t) + (c-offsets-alist . ( + (statement-block-intro . +) + (knr-argdecl-intro . +) + (substatement-open . 0) + (label . 0) + (statement-cont . +) + (case-label . 2) + ) + ) + ) + "chaos" + ) + + (defun chaos-c-mode-common-hook () + + ;; add my personal style and set it for the current buffer + + (c-add-style "chaos" chaos-c-style t) + + ;; this will make sure spaces are used instead of tabs + + (setq indent-tabs-mode nil)) + + (add-hook 'c-mode-common-hook 'chaos-c-mode-common-hook) + diff --git a/documentation/config.cache b/documentation/config.cache new file mode 100644 index 00000000..c99a2a4e --- /dev/null +++ b/documentation/config.cache @@ -0,0 +1,24 @@ +# 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. +# +ac_cv_path_install=${ac_cv_path_install='/usr/bin/install -c'} +ac_cv_prog_CC=${ac_cv_prog_CC=gcc} +ac_cv_prog_CPP=${ac_cv_prog_CPP='gcc -E'} +ac_cv_prog_cc_cross=${ac_cv_prog_cc_cross=no} +ac_cv_prog_cc_g=${ac_cv_prog_cc_g=yes} +ac_cv_prog_cc_works=${ac_cv_prog_cc_works=yes} +ac_cv_prog_gcc=${ac_cv_prog_gcc=yes} +ac_cv_prog_make_make_set=${ac_cv_prog_make_make_set=yes} +ac_cv_prog_makeinfo=${ac_cv_prog_makeinfo=makeinfo} +ac_cv_prog_sgml2html=${ac_cv_prog_sgml2html=sgml2html} diff --git a/documentation/configure b/documentation/configure new file mode 100755 index 00000000..b0cf2c0b --- /dev/null +++ b/documentation/configure @@ -0,0 +1,4334 @@ +#! /bin/sh +# Guess values for system-dependent variables and create Makefiles. +# Generated by GNU Autoconf 2.60. +# +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, +# 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. +# This configure script is free software; the Free Software Foundation +# gives unlimited permission to copy, distribute and modify it. +## --------------------- ## +## M4sh Initialization. ## +## --------------------- ## + +# Be Bourne compatible +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac +fi +BIN_SH=xpg4; export BIN_SH # for Tru64 +DUALCASE=1; export DUALCASE # for MKS sh + + +# PATH needs CR +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + echo "#! /bin/sh" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' + else + PATH_SEPARATOR=: + fi + rm -f conf$$.sh +fi + +# Support unset when possible. +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then + as_unset=unset +else + as_unset=false +fi + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +as_nl=' +' +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +case $0 in + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break +done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + { (exit 1); exit 1; } +fi + +# Work around bugs in pre-3.0 UWIN ksh. +for as_var in ENV MAIL MAILPATH +do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +for as_var in \ + LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ + LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ + LC_TELEPHONE LC_TIME +do + if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then + eval $as_var=C; export $as_var + else + ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var + fi +done + +# Required to use basename. +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + + +# Name of the executable. +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# CDPATH. +$as_unset CDPATH + + +if test "x$CONFIG_SHELL" = x; then + if (eval ":") 2>/dev/null; then + as_have_required=yes +else + as_have_required=no +fi + + if test $as_have_required = yes && (eval ": +(as_func_return () { + (exit \$1) +} +as_func_success () { + as_func_return 0 +} +as_func_failure () { + as_func_return 1 +} +as_func_ret_success () { + return 0 +} +as_func_ret_failure () { + return 1 +} + +exitcode=0 +if as_func_success; then + : +else + exitcode=1 + echo as_func_success failed. +fi + +if as_func_failure; then + exitcode=1 + echo as_func_failure succeeded. +fi + +if as_func_ret_success; then + : +else + exitcode=1 + echo as_func_ret_success failed. +fi + +if as_func_ret_failure; then + exitcode=1 + echo as_func_ret_failure succeeded. +fi + +if ( set x; as_func_ret_success y && test x = \"\$1\" ); then + : +else + exitcode=1 + echo positional parameters were not saved. +fi + +test \$exitcode = 0) || { (exit 1); exit 1; } + +( + as_lineno_1=\$LINENO + as_lineno_2=\$LINENO + test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" && + test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; } +") 2> /dev/null; then + : +else + as_candidate_shells= + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in /usr/bin/posix$PATH_SEPARATOR/bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + case $as_dir in + /*) + for as_base in sh bash ksh sh5; do + as_candidate_shells="$as_candidate_shells $as_dir/$as_base" + done;; + esac +done +IFS=$as_save_IFS + + + for as_shell in $as_candidate_shells $SHELL; do + # Try only shells that exist, to save several forks. + if { test -f "$as_shell" || test -f "$as_shell.exe"; } && + { ("$as_shell") 2> /dev/null <<\_ASEOF +# Be Bourne compatible +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac +fi +BIN_SH=xpg4; export BIN_SH # for Tru64 +DUALCASE=1; export DUALCASE # for MKS sh + +: +_ASEOF +}; then + CONFIG_SHELL=$as_shell + as_have_required=yes + if { "$as_shell" 2> /dev/null <<\_ASEOF +# Be Bourne compatible +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac +fi +BIN_SH=xpg4; export BIN_SH # for Tru64 +DUALCASE=1; export DUALCASE # for MKS sh + +: +(as_func_return () { + (exit $1) +} +as_func_success () { + as_func_return 0 +} +as_func_failure () { + as_func_return 1 +} +as_func_ret_success () { + return 0 +} +as_func_ret_failure () { + return 1 +} + +exitcode=0 +if as_func_success; then + : +else + exitcode=1 + echo as_func_success failed. +fi + +if as_func_failure; then + exitcode=1 + echo as_func_failure succeeded. +fi + +if as_func_ret_success; then + : +else + exitcode=1 + echo as_func_ret_success failed. +fi + +if as_func_ret_failure; then + exitcode=1 + echo as_func_ret_failure succeeded. +fi + +if ( set x; as_func_ret_success y && test x = "$1" ); then + : +else + exitcode=1 + echo positional parameters were not saved. +fi + +test $exitcode = 0) || { (exit 1); exit 1; } + +( + as_lineno_1=$LINENO + as_lineno_2=$LINENO + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; } + +_ASEOF +}; then + break +fi + +fi + + done + + if test "x$CONFIG_SHELL" != x; then + for as_var in BASH_ENV ENV + do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var + done + export CONFIG_SHELL + exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} +fi + + + if test $as_have_required = no; then + echo This script requires a shell more modern than all the + echo shells that I found on your system. Please install a + echo modern shell, or manually run the script under such a + echo shell if you do have one. + { (exit 1); exit 1; } +fi + + +fi + +fi + + + +(eval "as_func_return () { + (exit \$1) +} +as_func_success () { + as_func_return 0 +} +as_func_failure () { + as_func_return 1 +} +as_func_ret_success () { + return 0 +} +as_func_ret_failure () { + return 1 +} + +exitcode=0 +if as_func_success; then + : +else + exitcode=1 + echo as_func_success failed. +fi + +if as_func_failure; then + exitcode=1 + echo as_func_failure succeeded. +fi + +if as_func_ret_success; then + : +else + exitcode=1 + echo as_func_ret_success failed. +fi + +if as_func_ret_failure; then + exitcode=1 + echo as_func_ret_failure succeeded. +fi + +if ( set x; as_func_ret_success y && test x = \"\$1\" ); then + : +else + exitcode=1 + echo positional parameters were not saved. +fi + +test \$exitcode = 0") || { + echo No shell found that supports shell functions. + echo Please tell autoconf@gnu.org about your system, + echo including any error possibly output before this + echo message +} + + + + as_lineno_1=$LINENO + as_lineno_2=$LINENO + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { + + # Create $as_me.lineno as a copy of $as_myself, but with $LINENO + # uniformly replaced by the line number. The first 'sed' inserts a + # line-number line after each line using $LINENO; the second 'sed' + # does the real work. The second script uses 'N' to pair each + # line-number line with the line containing $LINENO, and appends + # trailing '-' during substitution so that $LINENO is not a special + # case at line end. + # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the + # scripts with optimization help from Paolo Bonzini. Blame Lee + # E. McMahon (1931-1989) for sed's syntax. :-) + sed -n ' + p + /[$]LINENO/= + ' <$as_myself | + sed ' + s/[$]LINENO.*/&-/ + t lineno + b + :lineno + N + :loop + s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ + t loop + s/-\n.*// + ' >$as_me.lineno && + chmod +x "$as_me.lineno" || + { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 + { (exit 1); exit 1; }; } + + # Don't try to exec as it changes $[0], causing all sort of problems + # (the dirname of $[0] is not the place where we might find the + # original and so on. Autoconf is especially sensitive to this). + . "./$as_me.lineno" + # Exit status is that of the last command. + exit +} + + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in +-n*) + case `echo 'x\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + *) ECHO_C='\c';; + esac;; +*) + ECHO_N='-n';; +esac + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir +fi +echo >conf$$.file +if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -p'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -p' +elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln +else + as_ln_s='cp -p' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + +if mkdir -p . 2>/dev/null; then + as_mkdir_p=: +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +# Find out whether ``test -x'' works. Don't use a zero-byte file, as +# systems may use methods other than mode bits to determine executability. +cat >conf$$.file <<_ASEOF +#! /bin/sh +exit 0 +_ASEOF +chmod +x conf$$.file +if test -x conf$$.file >/dev/null 2>&1; then + as_executable_p="test -x" +else + as_executable_p=: +fi +rm -f conf$$.file + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + + +exec 7<&0 &1 + +# Name of the host. +# hostname on some systems (SVR3.2, Linux) returns a bogus exit status, +# so uname gets run too. +ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` + +# +# Initializations. +# +ac_default_prefix=/usr/local +ac_clean_files= +ac_config_libobj_dir=. +LIBOBJS= +cross_compiling=no +subdirs= +MFLAGS= +MAKEFLAGS= +SHELL=${CONFIG_SHELL-/bin/sh} + +# Identity of this package. +PACKAGE_NAME= +PACKAGE_TARNAME= +PACKAGE_VERSION= +PACKAGE_STRING= +PACKAGE_BUGREPORT= + +ac_unique_file="coding-standards.sgml" +ac_default_prefix=/mnt/chaos +ac_subst_vars='SHELL +PATH_SEPARATOR +PACKAGE_NAME +PACKAGE_TARNAME +PACKAGE_VERSION +PACKAGE_STRING +PACKAGE_BUGREPORT +exec_prefix +prefix +program_transform_name +bindir +sbindir +libexecdir +datarootdir +datadir +sysconfdir +sharedstatedir +localstatedir +includedir +oldincludedir +docdir +infodir +htmldir +dvidir +pdfdir +psdir +libdir +localedir +mandir +DEFS +ECHO_C +ECHO_N +ECHO_T +LIBS +build_alias +host_alias +target_alias +INSTALL_PROGRAM +INSTALL_SCRIPT +INSTALL_DATA +PACKAGE +VERSION +ACLOCAL +AUTOCONF +AUTOMAKE +AUTOHEADER +MAKEINFO +SET_MAKE +CC +CFLAGS +LDFLAGS +CPPFLAGS +ac_ct_CC +EXEEXT +OBJEXT +CPP +makeinfo +sgml2html +LIBOBJS +LTLIBOBJS' +ac_subst_files='' + ac_precious_vars='build_alias +host_alias +target_alias +CC +CFLAGS +LDFLAGS +CPPFLAGS +CPP' + + +# Initialize some variables set by options. +ac_init_help= +ac_init_version=false +# The variables have the same names as the options, with +# dashes changed to underlines. +cache_file=/dev/null +exec_prefix=NONE +no_create= +no_recursion= +prefix=NONE +program_prefix=NONE +program_suffix=NONE +program_transform_name=s,x,x, +silent= +site= +srcdir= +verbose= +x_includes=NONE +x_libraries=NONE + +# Installation directory options. +# These are left unexpanded so users can "make install exec_prefix=/foo" +# and all the variables that are supposed to be based on exec_prefix +# by default will actually change. +# Use braces instead of parens because sh, perl, etc. also accept them. +# (The list follows the same order as the GNU Coding Standards.) +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datarootdir='${prefix}/share' +datadir='${datarootdir}' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +includedir='${prefix}/include' +oldincludedir='/usr/include' +docdir='${datarootdir}/doc/${PACKAGE}' +infodir='${datarootdir}/info' +htmldir='${docdir}' +dvidir='${docdir}' +pdfdir='${docdir}' +psdir='${docdir}' +libdir='${exec_prefix}/lib' +localedir='${datarootdir}/locale' +mandir='${datarootdir}/man' + +ac_prev= +ac_dashdash= +for ac_option +do + # If the previous option needs an argument, assign it. + if test -n "$ac_prev"; then + eval $ac_prev=\$ac_option + ac_prev= + continue + fi + + case $ac_option in + *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; + *) ac_optarg=yes ;; + esac + + # Accept the important Cygnus configure options, so we can diagnose typos. + + case $ac_dashdash$ac_option in + --) + ac_dashdash=yes ;; + + -bindir | --bindir | --bindi | --bind | --bin | --bi) + ac_prev=bindir ;; + -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) + bindir=$ac_optarg ;; + + -build | --build | --buil | --bui | --bu) + ac_prev=build_alias ;; + -build=* | --build=* | --buil=* | --bui=* | --bu=*) + build_alias=$ac_optarg ;; + + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) + cache_file=$ac_optarg ;; + + --config-cache | -C) + cache_file=config.cache ;; + + -datadir | --datadir | --datadi | --datad) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=*) + datadir=$ac_optarg ;; + + -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ + | --dataroo | --dataro | --datar) + ac_prev=datarootdir ;; + -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ + | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) + datarootdir=$ac_optarg ;; + + -disable-* | --disable-*) + ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid feature name: $ac_feature" >&2 + { (exit 1); exit 1; }; } + ac_feature=`echo $ac_feature | sed 's/-/_/g'` + eval enable_$ac_feature=no ;; + + -docdir | --docdir | --docdi | --doc | --do) + ac_prev=docdir ;; + -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) + docdir=$ac_optarg ;; + + -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) + ac_prev=dvidir ;; + -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) + dvidir=$ac_optarg ;; + + -enable-* | --enable-*) + ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid feature name: $ac_feature" >&2 + { (exit 1); exit 1; }; } + ac_feature=`echo $ac_feature | sed 's/-/_/g'` + 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 | -h) + ac_init_help=long ;; + -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) + ac_init_help=recursive ;; + -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) + ac_init_help=short ;; + + -host | --host | --hos | --ho) + ac_prev=host_alias ;; + -host=* | --host=* | --hos=* | --ho=*) + host_alias=$ac_optarg ;; + + -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) + ac_prev=htmldir ;; + -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ + | --ht=*) + htmldir=$ac_optarg ;; + + -includedir | --includedir | --includedi | --included | --include \ + | --includ | --inclu | --incl | --inc) + ac_prev=includedir ;; + -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ + | --includ=* | --inclu=* | --incl=* | --inc=*) + includedir=$ac_optarg ;; + + -infodir | --infodir | --infodi | --infod | --info | --inf) + ac_prev=infodir ;; + -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) + infodir=$ac_optarg ;; + + -libdir | --libdir | --libdi | --libd) + ac_prev=libdir ;; + -libdir=* | --libdir=* | --libdi=* | --libd=*) + libdir=$ac_optarg ;; + + -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ + | --libexe | --libex | --libe) + ac_prev=libexecdir ;; + -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ + | --libexe=* | --libex=* | --libe=*) + libexecdir=$ac_optarg ;; + + -localedir | --localedir | --localedi | --localed | --locale) + ac_prev=localedir ;; + -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) + localedir=$ac_optarg ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst | --locals) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) + localstatedir=$ac_optarg ;; + + -mandir | --mandir | --mandi | --mand | --man | --ma | --m) + ac_prev=mandir ;; + -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) + mandir=$ac_optarg ;; + + -nfp | --nfp | --nf) + # Obsolete; use --without-fp. + with_fp=no ;; + + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c | -n) + no_create=yes ;; + + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) + no_recursion=yes ;; + + -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ + | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ + | --oldin | --oldi | --old | --ol | --o) + ac_prev=oldincludedir ;; + -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ + | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ + | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) + oldincludedir=$ac_optarg ;; + + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) + ac_prev=prefix ;; + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) + prefix=$ac_optarg ;; + + -program-prefix | --program-prefix | --program-prefi | --program-pref \ + | --program-pre | --program-pr | --program-p) + ac_prev=program_prefix ;; + -program-prefix=* | --program-prefix=* | --program-prefi=* \ + | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) + program_prefix=$ac_optarg ;; + + -program-suffix | --program-suffix | --program-suffi | --program-suff \ + | --program-suf | --program-su | --program-s) + ac_prev=program_suffix ;; + -program-suffix=* | --program-suffix=* | --program-suffi=* \ + | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) + program_suffix=$ac_optarg ;; + + -program-transform-name | --program-transform-name \ + | --program-transform-nam | --program-transform-na \ + | --program-transform-n | --program-transform- \ + | --program-transform | --program-transfor \ + | --program-transfo | --program-transf \ + | --program-trans | --program-tran \ + | --progr-tra | --program-tr | --program-t) + ac_prev=program_transform_name ;; + -program-transform-name=* | --program-transform-name=* \ + | --program-transform-nam=* | --program-transform-na=* \ + | --program-transform-n=* | --program-transform-=* \ + | --program-transform=* | --program-transfor=* \ + | --program-transfo=* | --program-transf=* \ + | --program-trans=* | --program-tran=* \ + | --progr-tra=* | --program-tr=* | --program-t=*) + program_transform_name=$ac_optarg ;; + + -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) + ac_prev=pdfdir ;; + -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) + pdfdir=$ac_optarg ;; + + -psdir | --psdir | --psdi | --psd | --ps) + ac_prev=psdir ;; + -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) + psdir=$ac_optarg ;; + + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + silent=yes ;; + + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) + ac_prev=sbindir ;; + -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ + | --sbi=* | --sb=*) + sbindir=$ac_optarg ;; + + -sharedstatedir | --sharedstatedir | --sharedstatedi \ + | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ + | --sharedst | --shareds | --shared | --share | --shar \ + | --sha | --sh) + ac_prev=sharedstatedir ;; + -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ + | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ + | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ + | --sha=* | --sh=*) + sharedstatedir=$ac_optarg ;; + + -site | --site | --sit) + ac_prev=site ;; + -site=* | --site=* | --sit=*) + site=$ac_optarg ;; + + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + srcdir=$ac_optarg ;; + + -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ + | --syscon | --sysco | --sysc | --sys | --sy) + ac_prev=sysconfdir ;; + -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ + | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) + sysconfdir=$ac_optarg ;; + + -target | --target | --targe | --targ | --tar | --ta | --t) + ac_prev=target_alias ;; + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) + target_alias=$ac_optarg ;; + + -v | -verbose | --verbose | --verbos | --verbo | --verb) + verbose=yes ;; + + -version | --version | --versio | --versi | --vers | -V) + ac_init_version=: ;; + + -with-* | --with-*) + ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid package name: $ac_package" >&2 + { (exit 1); exit 1; }; } + ac_package=`echo $ac_package| sed 's/-/_/g'` + eval with_$ac_package=\$ac_optarg ;; + + -without-* | --without-*) + ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid package name: $ac_package" >&2 + { (exit 1); exit 1; }; } + 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 "$as_me: error: unrecognized option: $ac_option +Try \`$0 --help' for more information." >&2 + { (exit 1); exit 1; }; } + ;; + + *=*) + ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` + # Reject names that are not valid shell variable names. + expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 + { (exit 1); exit 1; }; } + eval $ac_envvar=\$ac_optarg + export $ac_envvar ;; + + *) + # FIXME: should be removed in autoconf 3.0. + echo "$as_me: WARNING: you should use --build, --host, --target" >&2 + expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && + echo "$as_me: WARNING: invalid host type: $ac_option" >&2 + : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} + ;; + + esac +done + +if test -n "$ac_prev"; then + ac_option=--`echo $ac_prev | sed 's/_/-/g'` + { echo "$as_me: error: missing argument to $ac_option" >&2 + { (exit 1); exit 1; }; } +fi + +# Be sure to have absolute directory names. +for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ + datadir sysconfdir sharedstatedir localstatedir includedir \ + oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ + libdir localedir mandir +do + eval ac_val=\$$ac_var + case $ac_val in + [\\/$]* | ?:[\\/]* ) continue;; + NONE | '' ) case $ac_var in *prefix ) continue;; esac;; + esac + { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 + { (exit 1); exit 1; }; } +done + +# There might be people who depend on the old broken behavior: `$host' +# used to hold the argument of --host etc. +# FIXME: To remove some day. +build=$build_alias +host=$host_alias +target=$target_alias + +# FIXME: To remove some day. +if test "x$host_alias" != x; then + if test "x$build_alias" = x; then + cross_compiling=maybe + echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. + If a cross compiler is detected then cross compile mode will be used." >&2 + elif test "x$build_alias" != "x$host_alias"; then + cross_compiling=yes + fi +fi + +ac_tool_prefix= +test -n "$host_alias" && ac_tool_prefix=$host_alias- + +test "$silent" = yes && exec 6>/dev/null + + +ac_pwd=`pwd` && test -n "$ac_pwd" && +ac_ls_di=`ls -di .` && +ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || + { echo "$as_me: error: Working directory cannot be determined" >&2 + { (exit 1); exit 1; }; } +test "X$ac_ls_di" = "X$ac_pwd_ls_di" || + { echo "$as_me: error: pwd does not report name of working directory" >&2 + { (exit 1); exit 1; }; } + + +# Find the source files, if location was not specified. +if test -z "$srcdir"; then + ac_srcdir_defaulted=yes + # Try the directory containing this script, then the parent directory. + ac_confdir=`$as_dirname -- "$0" || +$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$0" : 'X\(//\)[^/]' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +echo X"$0" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + srcdir=$ac_confdir + if test ! -r "$srcdir/$ac_unique_file"; then + srcdir=.. + fi +else + ac_srcdir_defaulted=no +fi +if test ! -r "$srcdir/$ac_unique_file"; then + test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." + { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 + { (exit 1); exit 1; }; } +fi +ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" +ac_abs_confdir=`( + cd "$srcdir" && test -r "./$ac_unique_file" || { echo "$as_me: error: $ac_msg" >&2 + { (exit 1); exit 1; }; } + pwd)` +# When building in place, set srcdir=. +if test "$ac_abs_confdir" = "$ac_pwd"; then + srcdir=. +fi +# Remove unnecessary trailing slashes from srcdir. +# Double slashes in file names in object file debugging info +# mess up M-x gdb in Emacs. +case $srcdir in +*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; +esac +for ac_var in $ac_precious_vars; do + eval ac_env_${ac_var}_set=\${${ac_var}+set} + eval ac_env_${ac_var}_value=\$${ac_var} + eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} + eval ac_cv_env_${ac_var}_value=\$${ac_var} +done + +# +# Report the --help message. +# +if test "$ac_init_help" = "long"; then + # Omit some internal or obsolete options to make the list less imposing. + # This message is too long to be a string in the A/UX 3.1 sh. + cat <<_ACEOF +\`configure' configures this package to adapt to many kinds of systems. + +Usage: $0 [OPTION]... [VAR=VALUE]... + +To assign environment variables (e.g., CC, CFLAGS...), specify them as +VAR=VALUE. See below for descriptions of some of the useful variables. + +Defaults for the options are specified in brackets. + +Configuration: + -h, --help display this help and exit + --help=short display options specific to this package + --help=recursive display the short help of all the included packages + -V, --version display version information and exit + -q, --quiet, --silent do not print \`checking...' messages + --cache-file=FILE cache test results in FILE [disabled] + -C, --config-cache alias for \`--cache-file=config.cache' + -n, --no-create do not create output files + --srcdir=DIR find the sources in DIR [configure dir or \`..'] + +Installation directories: + --prefix=PREFIX install architecture-independent files in PREFIX + [$ac_default_prefix] + --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX + [PREFIX] + +By default, \`make install' will install all the files in +\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify +an installation prefix other than \`$ac_default_prefix' using \`--prefix', +for instance \`--prefix=\$HOME'. + +For better control, use the options below. + +Fine tuning of the installation directories: + --bindir=DIR user executables [EPREFIX/bin] + --sbindir=DIR system admin executables [EPREFIX/sbin] + --libexecdir=DIR program executables [EPREFIX/libexec] + --sysconfdir=DIR read-only single-machine data [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] + --localstatedir=DIR modifiable single-machine data [PREFIX/var] + --libdir=DIR object code libraries [EPREFIX/lib] + --includedir=DIR C header files [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc [/usr/include] + --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] + --datadir=DIR read-only architecture-independent data [DATAROOTDIR] + --infodir=DIR info documentation [DATAROOTDIR/info] + --localedir=DIR locale-dependent data [DATAROOTDIR/locale] + --mandir=DIR man documentation [DATAROOTDIR/man] + --docdir=DIR documentation root [DATAROOTDIR/doc/PACKAGE] + --htmldir=DIR html documentation [DOCDIR] + --dvidir=DIR dvi documentation [DOCDIR] + --pdfdir=DIR pdf documentation [DOCDIR] + --psdir=DIR ps documentation [DOCDIR] +_ACEOF + + cat <<\_ACEOF + +Program names: + --program-prefix=PREFIX prepend PREFIX to installed program names + --program-suffix=SUFFIX append SUFFIX to installed program names + --program-transform-name=PROGRAM run sed PROGRAM on installed program names +_ACEOF +fi + +if test -n "$ac_init_help"; then + + cat <<\_ACEOF + +Some influential environment variables: + CC C compiler command + CFLAGS C compiler flags + LDFLAGS linker flags, e.g. -L if you have libraries in a + nonstandard directory + CPPFLAGS C/C++/Objective C preprocessor flags, e.g. -I if + you have headers in a nonstandard directory + CPP C preprocessor + +Use these variables to override the choices made by `configure' or to help +it to find libraries and programs with nonstandard names/locations. + +_ACEOF +ac_status=$? +fi + +if test "$ac_init_help" = "recursive"; then + # If there are subdirs, report their specific --help. + for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue + test -d "$ac_dir" || continue + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + cd "$ac_dir" || { ac_status=$?; continue; } + # Check for guested configure. + if test -f "$ac_srcdir/configure.gnu"; then + echo && + $SHELL "$ac_srcdir/configure.gnu" --help=recursive + elif test -f "$ac_srcdir/configure"; then + echo && + $SHELL "$ac_srcdir/configure" --help=recursive + else + echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 + fi || ac_status=$? + cd "$ac_pwd" || { ac_status=$?; break; } + done +fi + +test -n "$ac_init_help" && exit $ac_status +if $ac_init_version; then + cat <<\_ACEOF +configure +generated by GNU Autoconf 2.60 + +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, +2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. +This configure script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it. +_ACEOF + exit +fi +cat >config.log <<_ACEOF +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. + +It was created by $as_me, which was +generated by GNU Autoconf 2.60. Invocation command line was + + $ $0 $@ + +_ACEOF +exec 5>>config.log +{ +cat <<_ASUNAME +## --------- ## +## Platform. ## +## --------- ## + +hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` + +/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` +/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` +/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` +/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` + +_ASUNAME + +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + echo "PATH: $as_dir" +done +IFS=$as_save_IFS + +} >&5 + +cat >&5 <<_ACEOF + + +## ----------- ## +## Core tests. ## +## ----------- ## + +_ACEOF + + +# Keep a trace of the command line. +# Strip out --no-create and --no-recursion so they do not pile up. +# Strip out --silent because we don't want to record it for future runs. +# Also quote any args containing shell meta-characters. +# Make two passes to allow for proper duplicate-argument suppression. +ac_configure_args= +ac_configure_args0= +ac_configure_args1= +ac_must_keep_next=false +for ac_pass in 1 2 +do + for ac_arg + do + case $ac_arg in + -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + continue ;; + *\'*) + ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + case $ac_pass in + 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; + 2) + ac_configure_args1="$ac_configure_args1 '$ac_arg'" + if test $ac_must_keep_next = true; then + ac_must_keep_next=false # Got value, back to normal. + else + case $ac_arg in + *=* | --config-cache | -C | -disable-* | --disable-* \ + | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ + | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ + | -with-* | --with-* | -without-* | --without-* | --x) + case "$ac_configure_args0 " in + "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; + esac + ;; + -* ) ac_must_keep_next=true ;; + esac + fi + ac_configure_args="$ac_configure_args '$ac_arg'" + ;; + esac + done +done +$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } +$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; } + +# When interrupted or exit'd, cleanup temporary files, and complete +# config.log. We remove comments because anyway the quotes in there +# would cause problems or look ugly. +# WARNING: Use '\'' to represent an apostrophe within the trap. +# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. +trap 'exit_status=$? + # Save into config.log some information that might help in debugging. + { + echo + + cat <<\_ASBOX +## ---------------- ## +## Cache variables. ## +## ---------------- ## +_ASBOX + echo + # The following way of writing the cache mishandles newlines in values, +( + for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 +echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + *) $as_unset $ac_var ;; + esac ;; + esac + done + (set) 2>&1 | + case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + sed -n \ + "s/'\''/'\''\\\\'\'''\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" + ;; #( + *) + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) + echo + + cat <<\_ASBOX +## ----------------- ## +## Output variables. ## +## ----------------- ## +_ASBOX + echo + for ac_var in $ac_subst_vars + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + echo "$ac_var='\''$ac_val'\''" + done | sort + echo + + if test -n "$ac_subst_files"; then + cat <<\_ASBOX +## ------------------- ## +## File substitutions. ## +## ------------------- ## +_ASBOX + echo + for ac_var in $ac_subst_files + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + echo "$ac_var='\''$ac_val'\''" + done | sort + echo + fi + + if test -s confdefs.h; then + cat <<\_ASBOX +## ----------- ## +## confdefs.h. ## +## ----------- ## +_ASBOX + echo + cat confdefs.h + echo + fi + test "$ac_signal" != 0 && + echo "$as_me: caught signal $ac_signal" + echo "$as_me: exit $exit_status" + } >&5 + rm -f core *.core core.conftest.* && + rm -f -r conftest* confdefs* conf$$* $ac_clean_files && + exit $exit_status +' 0 +for ac_signal in 1 2 13 15; do + trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal +done +ac_signal=0 + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -f -r conftest* confdefs.h + +# Predefined preprocessor variables. + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_NAME "$PACKAGE_NAME" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_TARNAME "$PACKAGE_TARNAME" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_VERSION "$PACKAGE_VERSION" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_STRING "$PACKAGE_STRING" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" +_ACEOF + + +# Let the site file select an alternate cache file if it wants to. +# Prefer explicitly selected file to automatically selected ones. +if test -n "$CONFIG_SITE"; then + set x "$CONFIG_SITE" +elif test "x$prefix" != xNONE; then + set x "$prefix/share/config.site" "$prefix/etc/config.site" +else + set x "$ac_default_prefix/share/config.site" \ + "$ac_default_prefix/etc/config.site" +fi +shift +for ac_site_file +do + if test -r "$ac_site_file"; then + { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 +echo "$as_me: loading site script $ac_site_file" >&6;} + sed 's/^/| /' "$ac_site_file" >&5 + . "$ac_site_file" + fi +done + +if test -r "$cache_file"; then + # Some versions of bash will fail to source /dev/null (special + # files actually), so we avoid doing that. + if test -f "$cache_file"; then + { echo "$as_me:$LINENO: loading cache $cache_file" >&5 +echo "$as_me: loading cache $cache_file" >&6;} + case $cache_file in + [\\/]* | ?:[\\/]* ) . "$cache_file";; + *) . "./$cache_file";; + esac + fi +else + { echo "$as_me:$LINENO: creating cache $cache_file" >&5 +echo "$as_me: creating cache $cache_file" >&6;} + >$cache_file +fi + +# Check that the precious variables saved in the cache have kept the same +# value. +ac_cache_corrupted=false +for ac_var in $ac_precious_vars; do + eval ac_old_set=\$ac_cv_env_${ac_var}_set + eval ac_new_set=\$ac_env_${ac_var}_set + eval ac_old_val=\$ac_cv_env_${ac_var}_value + eval ac_new_val=\$ac_env_${ac_var}_value + case $ac_old_set,$ac_new_set in + set,) + { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 +echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,set) + { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 +echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,);; + *) + if test "x$ac_old_val" != "x$ac_new_val"; then + { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 +echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 +echo "$as_me: former value: $ac_old_val" >&2;} + { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 +echo "$as_me: current value: $ac_new_val" >&2;} + ac_cache_corrupted=: + fi;; + esac + # Pass precious variables to config.status. + if test "$ac_new_set" = set; then + case $ac_new_val in + *\'*) ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; + *) ac_arg=$ac_var=$ac_new_val ;; + esac + case " $ac_configure_args " in + *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. + *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; + esac + fi +done +if $ac_cache_corrupted; then + { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 +echo "$as_me: error: changes in the environment can compromise the build" >&2;} + { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 +echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} + { (exit 1); exit 1; }; } +fi + + + + + + + + + + + + + + + + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + +am__api_version="1.4" +ac_aux_dir= +for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do + if test -f "$ac_dir/install-sh"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install-sh -c" + break + elif test -f "$ac_dir/install.sh"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install.sh -c" + break + elif test -f "$ac_dir/shtool"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/shtool install -c" + break + fi +done +if test -z "$ac_aux_dir"; then + { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&5 +echo "$as_me: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&2;} + { (exit 1); exit 1; }; } +fi + +# These three variables are undocumented and unsupported, +# and are intended to be withdrawn in a future Autoconf release. +# They can cause serious problems if a builder's source tree is in a directory +# whose full name contains unusual characters. +ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. +ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. +ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. + + +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AmigaOS /C/install, which installs bootblocks on floppy discs +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# OS/2's system install, which has a completely different semantic +# ./install, which can be erroneously created by make from ./install.sh. +{ echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 +echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6; } +if test -z "$INSTALL"; then +if test "${ac_cv_path_install+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + # Account for people who put trailing slashes in PATH elements. +case $as_dir/ in + ./ | .// | /cC/* | \ + /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ + ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \ + /usr/ucb/* ) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; }; then + if test $ac_prog = install && + grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + elif test $ac_prog = install && + grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # program-specific install script used by HP pwplus--don't use. + : + else + ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" + break 3 + fi + fi + done + done + ;; +esac +done +IFS=$as_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. Don't cache a + # value for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the value is a relative name. + INSTALL=$ac_install_sh + fi +fi +{ echo "$as_me:$LINENO: result: $INSTALL" >&5 +echo "${ECHO_T}$INSTALL" >&6; } + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + +{ echo "$as_me:$LINENO: checking whether build environment is sane" >&5 +echo $ECHO_N "checking whether build environment is sane... $ECHO_C" >&6; } +# 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 "$as_me:$LINENO: error: ls -t appears to fail. Make sure there is not a broken +alias in your environment" >&5 +echo "$as_me: error: ls -t appears to fail. Make sure there is not a broken +alias in your environment" >&2;} + { (exit 1); exit 1; }; } + fi + + test "$2" = conftestfile + ) +then + # Ok. + : +else + { { echo "$as_me:$LINENO: error: newly created file is older than distributed files! +Check your system clock" >&5 +echo "$as_me: error: newly created file is older than distributed files! +Check your system clock" >&2;} + { (exit 1); exit 1; }; } +fi +rm -f conftest* +{ echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } +test "$program_prefix" != NONE && + program_transform_name="s&^&$program_prefix&;$program_transform_name" +# Use a double $ so make ignores it. +test "$program_suffix" != NONE && + program_transform_name="s&\$&$program_suffix&;$program_transform_name" +# Double any \ or $. echo might interpret backslashes. +# By default was `s,x,x', remove it if useless. +cat <<\_ACEOF >conftest.sed +s/[\\$]/&&/g;s/;s,x,x,$// +_ACEOF +program_transform_name=`echo $program_transform_name | sed -f conftest.sed` +rm -f conftest.sed + +{ echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6; } +set x ${MAKE-make}; ac_make=`echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` +if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.make <<\_ACEOF +SHELL = /bin/sh +all: + @echo '@@@%%%=$(MAKE)=@@@%%%' +_ACEOF +# GNU make sometimes prints "make[1]: Entering...", which would confuse us. +case `${MAKE-make} -f conftest.make 2>/dev/null` in + *@@@%%%=?*=@@@%%%*) + eval ac_cv_prog_make_${ac_make}_set=yes;; + *) + eval ac_cv_prog_make_${ac_make}_set=no;; +esac +rm -f conftest.make +fi +if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } + SET_MAKE= +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } + SET_MAKE="MAKE=${MAKE-make}" +fi + + +PACKAGE=documentation + +VERSION=0.0.0 + +if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then + { { echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5 +echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;} + { (exit 1); exit 1; }; } +fi + +cat >>confdefs.h <<_ACEOF +#define PACKAGE "$PACKAGE" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define VERSION "$VERSION" +_ACEOF + + + +missing_dir=`cd $ac_aux_dir && pwd` +{ echo "$as_me:$LINENO: checking for working aclocal-${am__api_version}" >&5 +echo $ECHO_N "checking for working aclocal-${am__api_version}... $ECHO_C" >&6; } +# 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-${am__api_version} --version) < /dev/null > /dev/null 2>&1; then + ACLOCAL=aclocal-${am__api_version} + { echo "$as_me:$LINENO: result: found" >&5 +echo "${ECHO_T}found" >&6; } +else + ACLOCAL="$missing_dir/missing aclocal-${am__api_version}" + { echo "$as_me:$LINENO: result: missing" >&5 +echo "${ECHO_T}missing" >&6; } +fi + +{ echo "$as_me:$LINENO: checking for working autoconf" >&5 +echo $ECHO_N "checking for working autoconf... $ECHO_C" >&6; } +# 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 "$as_me:$LINENO: result: found" >&5 +echo "${ECHO_T}found" >&6; } +else + AUTOCONF="$missing_dir/missing autoconf" + { echo "$as_me:$LINENO: result: missing" >&5 +echo "${ECHO_T}missing" >&6; } +fi + +{ echo "$as_me:$LINENO: checking for working automake-${am__api_version}" >&5 +echo $ECHO_N "checking for working automake-${am__api_version}... $ECHO_C" >&6; } +# 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-${am__api_version} --version) < /dev/null > /dev/null 2>&1; then + AUTOMAKE=automake-${am__api_version} + { echo "$as_me:$LINENO: result: found" >&5 +echo "${ECHO_T}found" >&6; } +else + AUTOMAKE="$missing_dir/missing automake-${am__api_version}" + { echo "$as_me:$LINENO: result: missing" >&5 +echo "${ECHO_T}missing" >&6; } +fi + +{ echo "$as_me:$LINENO: checking for working autoheader" >&5 +echo $ECHO_N "checking for working autoheader... $ECHO_C" >&6; } +# 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 "$as_me:$LINENO: result: found" >&5 +echo "${ECHO_T}found" >&6; } +else + AUTOHEADER="$missing_dir/missing autoheader" + { echo "$as_me:$LINENO: result: missing" >&5 +echo "${ECHO_T}missing" >&6; } +fi + +{ echo "$as_me:$LINENO: checking for working makeinfo" >&5 +echo $ECHO_N "checking for working makeinfo... $ECHO_C" >&6; } +# 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 "$as_me:$LINENO: result: found" >&5 +echo "${ECHO_T}found" >&6; } +else + MAKEINFO="$missing_dir/missing makeinfo" + { echo "$as_me:$LINENO: result: missing" >&5 +echo "${ECHO_T}missing" >&6; } +fi + + + + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. +set dummy ${ac_tool_prefix}gcc; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_CC="${ac_tool_prefix}gcc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_CC="gcc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&5 +echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +else + CC="$ac_cv_prog_CC" +fi + +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. +set dummy ${ac_tool_prefix}cc; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_CC="${ac_tool_prefix}cc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + + fi +fi +if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + ac_prog_rejected=no +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then + if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $# != 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" + fi +fi +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + for ac_prog in cl.exe + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_CC="$ac_tool_prefix$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + + test -n "$CC" && break + done +fi +if test -z "$CC"; then + ac_ct_CC=$CC + for ac_prog in cl.exe +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_CC="$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + + test -n "$ac_ct_CC" && break +done + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&5 +echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +fi + +fi + + +test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH +See \`config.log' for more details." >&5 +echo "$as_me: error: no acceptable C compiler found in \$PATH +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } + +# Provide some information about the compiler. +echo "$as_me:$LINENO: checking for C compiler version" >&5 +ac_compiler=`set X $ac_compile; echo $2` +{ (ac_try="$ac_compiler --version >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compiler --version >&5") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (ac_try="$ac_compiler -v >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compiler -v >&5") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (ac_try="$ac_compiler -V >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compiler -V >&5") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files a.out a.exe b.out" +# Try to create an executable without -o first, disregard a.out. +# It will help us diagnose broken compilers, and finding out an intuition +# of exeext. +{ echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 +echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6; } +ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` +# +# List of possible output files, starting from the most likely. +# The algorithm is not robust to junk in `.', hence go to wildcards (a.*) +# only as a last resort. b.out is created by i960 compilers. +ac_files='a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out' +# +# The IRIX 6 linker writes into existing files which may not be +# executable, retaining their permissions. Remove them first so a +# subsequent execution test works. +ac_rmfiles= +for ac_file in $ac_files +do + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; + * ) ac_rmfiles="$ac_rmfiles $ac_file";; + esac +done +rm -f $ac_rmfiles + +if { (ac_try="$ac_link_default" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link_default") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. +# So ignore a value of `no', otherwise this would lead to `EXEEXT = no' +# in a Makefile. We should not override ac_cv_exeext if it was cached, +# so that the user can short-circuit this test for compilers unknown to +# Autoconf. +for ac_file in $ac_files +do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) + ;; + [ab].out ) + # We found the default executable, but exeext='' is most + # certainly right. + break;; + *.* ) + if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; + then :; else + ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + fi + # We set ac_cv_exeext here because the later test for it is not + # safe: cross compilers may not add the suffix if given an `-o' + # argument, so we may need to know it at that point already. + # Even if this section looks crufty: it has the advantage of + # actually working. + break;; + * ) + break;; + esac +done +test "$ac_cv_exeext" = no && ac_cv_exeext= + +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { echo "$as_me:$LINENO: error: C compiler cannot create executables +See \`config.log' for more details." >&5 +echo "$as_me: error: C compiler cannot create executables +See \`config.log' for more details." >&2;} + { (exit 77); exit 77; }; } +fi + +ac_exeext=$ac_cv_exeext +{ echo "$as_me:$LINENO: result: $ac_file" >&5 +echo "${ECHO_T}$ac_file" >&6; } + +# Check that the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +{ echo "$as_me:$LINENO: checking whether the C compiler works" >&5 +echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6; } +# FIXME: These cross compiler hacks should be removed for Autoconf 3.0 +# If not cross compiling, check that we can run a simple program. +if test "$cross_compiling" != yes; then + if { ac_try='./$ac_file' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + cross_compiling=no + else + if test "$cross_compiling" = maybe; then + cross_compiling=yes + else + { { echo "$as_me:$LINENO: error: cannot run C compiled programs. +If you meant to cross compile, use \`--host'. +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot run C compiled programs. +If you meant to cross compile, use \`--host'. +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } + fi + fi +fi +{ echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } + +rm -f a.out a.exe conftest$ac_cv_exeext b.out +ac_clean_files=$ac_clean_files_save +# Check that the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +{ echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 +echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6; } +{ echo "$as_me:$LINENO: result: $cross_compiling" >&5 +echo "${ECHO_T}$cross_compiling" >&6; } + +{ echo "$as_me:$LINENO: checking for suffix of executables" >&5 +echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6; } +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + # If both `conftest.exe' and `conftest' are `present' (well, observable) +# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will +# work properly (i.e., refer to `conftest.exe'), while it won't with +# `rm'. +for ac_file in conftest.exe conftest conftest.*; do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; + *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + break;; + * ) break;; + esac +done +else + { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +fi + +rm -f conftest$ac_cv_exeext +{ echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 +echo "${ECHO_T}$ac_cv_exeext" >&6; } + +rm -f conftest.$ac_ext +EXEEXT=$ac_cv_exeext +ac_exeext=$EXEEXT +{ echo "$as_me:$LINENO: checking for suffix of object files" >&5 +echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6; } +if test "${ac_cv_objext+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.o conftest.obj +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + for ac_file in conftest.o conftest.obj conftest.*; do + test -f "$ac_file" || continue; + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf ) ;; + *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` + break;; + esac +done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute suffix of object files: cannot compile +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +fi + +rm -f conftest.$ac_cv_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 +echo "${ECHO_T}$ac_cv_objext" >&6; } +OBJEXT=$ac_cv_objext +ac_objext=$OBJEXT +{ echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 +echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6; } +if test "${ac_cv_c_compiler_gnu+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_compiler_gnu=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_compiler_gnu=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_c_compiler_gnu=$ac_compiler_gnu + +fi +{ echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 +echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6; } +GCC=`test $ac_compiler_gnu = yes && echo yes` +ac_test_CFLAGS=${CFLAGS+set} +ac_save_CFLAGS=$CFLAGS +{ echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 +echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6; } +if test "${ac_cv_prog_cc_g+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_save_c_werror_flag=$ac_c_werror_flag + ac_c_werror_flag=yes + ac_cv_prog_cc_g=no + CFLAGS="-g" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_prog_cc_g=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + CFLAGS="" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + : +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_c_werror_flag=$ac_save_c_werror_flag + CFLAGS="-g" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_prog_cc_g=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_c_werror_flag=$ac_save_c_werror_flag +fi +{ echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_g" >&6; } +if test "$ac_test_CFLAGS" = set; then + CFLAGS=$ac_save_CFLAGS +elif test $ac_cv_prog_cc_g = yes; then + if test "$GCC" = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-g" + fi +else + if test "$GCC" = yes; then + CFLAGS="-O2" + else + CFLAGS= + fi +fi +{ echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5 +echo $ECHO_N "checking for $CC option to accept ISO C89... $ECHO_C" >&6; } +if test "${ac_cv_prog_cc_c89+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_prog_cc_c89=no +ac_save_CC=$CC +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include +#include +#include +/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ +struct buf { int x; }; +FILE * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (p, i) + char **p; + int i; +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; +} + +/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has + function prototypes and stuff, but not '\xHH' hex character constants. + These don't provoke an error unfortunately, instead are silently treated + as 'x'. The following induces an error, until -std is added to get + proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an + array size at least. It's necessary to write '\x00'==0 to get something + that's true only with -std. */ +int osf4_cc_array ['\x00' == 0 ? 1 : -1]; + +/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters + inside strings and character constants. */ +#define FOO(x) 'x' +int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; + +int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); +int argc; +char **argv; +int +main () +{ +return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; + ; + return 0; +} +_ACEOF +for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ + -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_prog_cc_c89=$ac_arg +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext + test "x$ac_cv_prog_cc_c89" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC + +fi +# AC_CACHE_VAL +case "x$ac_cv_prog_cc_c89" in + x) + { echo "$as_me:$LINENO: result: none needed" >&5 +echo "${ECHO_T}none needed" >&6; } ;; + xno) + { echo "$as_me:$LINENO: result: unsupported" >&5 +echo "${ECHO_T}unsupported" >&6; } ;; + *) + CC="$CC $ac_cv_prog_cc_c89" + { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_c89" >&6; } ;; +esac + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +{ echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 +echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6; } +# On Suns, sometimes $CPP names a directory. +if test -n "$CPP" && test -d "$CPP"; then + CPP= +fi +if test -z "$CPP"; then + if test "${ac_cv_prog_CPP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + # Double quotes because CPP needs to be expanded + for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" + do + ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + : +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Broken: fails on valid input. +continue +fi + +rm -f conftest.err conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + # Broken: success on invalid input. +continue +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Passes both tests. +ac_preproc_ok=: +break +fi + +rm -f conftest.err conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.err conftest.$ac_ext +if $ac_preproc_ok; then + break +fi + + done + ac_cv_prog_CPP=$CPP + +fi + CPP=$ac_cv_prog_CPP +else + ac_cv_prog_CPP=$CPP +fi +{ echo "$as_me:$LINENO: result: $CPP" >&5 +echo "${ECHO_T}$CPP" >&6; } +ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + : +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Broken: fails on valid input. +continue +fi + +rm -f conftest.err conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + # Broken: success on invalid input. +continue +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Passes both tests. +ac_preproc_ok=: +break +fi + +rm -f conftest.err conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.err conftest.$ac_ext +if $ac_preproc_ok; then + : +else + { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details." >&5 +echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +{ echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6; } +set x ${MAKE-make}; ac_make=`echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` +if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.make <<\_ACEOF +SHELL = /bin/sh +all: + @echo '@@@%%%=$(MAKE)=@@@%%%' +_ACEOF +# GNU make sometimes prints "make[1]: Entering...", which would confuse us. +case `${MAKE-make} -f conftest.make 2>/dev/null` in + *@@@%%%=?*=@@@%%%*) + eval ac_cv_prog_make_${ac_make}_set=yes;; + *) + eval ac_cv_prog_make_${ac_make}_set=no;; +esac +rm -f conftest.make +fi +if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } + SET_MAKE= +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } + SET_MAKE="MAKE=${MAKE-make}" +fi + + +# Extract the first word of "makeinfo", so it can be a program name with args. +set dummy makeinfo; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_makeinfo+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$makeinfo"; then + ac_cv_prog_makeinfo="$makeinfo" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_makeinfo="makeinfo" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +makeinfo=$ac_cv_prog_makeinfo +if test -n "$makeinfo"; then + { echo "$as_me:$LINENO: result: $makeinfo" >&5 +echo "${ECHO_T}$makeinfo" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + + + +if [ x$makeinfo != xmakeinfo ]; then + echo -e "\nError: You must have makeinfo to compile the documentation. It can be found" + echo -e "at your favourite GNU mirror.\n" + exit 1 +fi + + +# Extract the first word of "sgml2html", so it can be a program name with args. +set dummy sgml2html; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_sgml2html+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$sgml2html"; then + ac_cv_prog_sgml2html="$sgml2html" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_sgml2html="sgml2html" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +sgml2html=$ac_cv_prog_sgml2html +if test -n "$sgml2html"; then + { echo "$as_me:$LINENO: result: $sgml2html" >&5 +echo "${ECHO_T}$sgml2html" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + + + +if [ x$sgml2html != xsgml2html ]; then + echo -e "\nError: You must have sgml-tools to compile the documentation. It can be found" + echo -e "at http://pobox.com/~cg/sgmltools.\n" + exit 1 +fi + + + +ac_config_files="$ac_config_files Makefile" + +cat >confcache <<\_ACEOF +# This file is a shell script that caches the results of configure +# tests run on this system so they can be shared between configure +# scripts and configure runs, see configure's option --config-cache. +# It is not useful on other systems. If it contains results you don't +# want to keep, you may remove or edit it. +# +# config.status only pays attention to the cache file if you give it +# the --recheck option to rerun configure. +# +# `ac_cv_env_foo' variables (set or unset) will be overridden when +# loading this file, other *unset* `ac_cv_foo' will be assigned the +# following values. + +_ACEOF + +# The following way of writing the cache mishandles newlines in values, +# but we know of no workaround that is simple, portable, and efficient. +# So, we kill variables containing newlines. +# Ultrix sh set writes to stderr and can't be redirected directly, +# and sets the high bit in the cache file unless we assign to the vars. +( + for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 +echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + *) $as_unset $ac_var ;; + esac ;; + esac + done + + (set) 2>&1 | + case $as_nl`(ac_space=' '; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + # `set' does not quote correctly, so add quotes (double-quote + # substitution turns \\\\ into \\, and sed turns \\ into \). + sed -n \ + "s/'/'\\\\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" + ;; #( + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) | + sed ' + /^ac_cv_env_/b end + t clear + :clear + s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ + t end + s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ + :end' >>confcache +if diff "$cache_file" confcache >/dev/null 2>&1; then :; else + if test -w "$cache_file"; then + test "x$cache_file" != "x/dev/null" && + { echo "$as_me:$LINENO: updating cache $cache_file" >&5 +echo "$as_me: updating cache $cache_file" >&6;} + cat confcache >$cache_file + else + { echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 +echo "$as_me: not updating unwritable cache $cache_file" >&6;} + fi +fi +rm -f confcache + +test "x$prefix" = xNONE && prefix=$ac_default_prefix +# Let make expand exec_prefix. +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + +# Transform confdefs.h into DEFS. +# Protect against shell expansion while executing Makefile rules. +# Protect against Makefile macro expansion. +# +# If the first sed substitution is executed (which looks for macros that +# take arguments), then branch to the quote section. Otherwise, +# look for a macro that doesn't take arguments. +ac_script=' +t clear +:clear +s/^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\)/-D\1=\2/g +t quote +s/^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)/-D\1=\2/g +t quote +b any +:quote +s/[ `~#$^&*(){}\\|;'\''"<>?]/\\&/g +s/\[/\\&/g +s/\]/\\&/g +s/\$/$$/g +H +:any +${ + g + s/^\n// + s/\n/ /g + p +} +' +DEFS=`sed -n "$ac_script" confdefs.h` + + +ac_libobjs= +ac_ltlibobjs= +for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue + # 1. Remove the extension, and $U if already installed. + ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' + ac_i=`echo "$ac_i" | sed "$ac_script"` + # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR + # will be set to the directory where LIBOBJS objects are built. + ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext" + ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo' +done +LIBOBJS=$ac_libobjs + +LTLIBOBJS=$ac_ltlibobjs + + + +: ${CONFIG_STATUS=./config.status} +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files $CONFIG_STATUS" +{ echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 +echo "$as_me: creating $CONFIG_STATUS" >&6;} +cat >$CONFIG_STATUS <<_ACEOF +#! $SHELL +# Generated by $as_me. +# Run this file to recreate the current configuration. +# Compiler output produced by configure, useful for debugging +# configure, is in config.log if it exists. + +debug=false +ac_cs_recheck=false +ac_cs_silent=false +SHELL=\${CONFIG_SHELL-$SHELL} +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF +## --------------------- ## +## M4sh Initialization. ## +## --------------------- ## + +# Be Bourne compatible +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac +fi +BIN_SH=xpg4; export BIN_SH # for Tru64 +DUALCASE=1; export DUALCASE # for MKS sh + + +# PATH needs CR +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + echo "#! /bin/sh" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' + else + PATH_SEPARATOR=: + fi + rm -f conf$$.sh +fi + +# Support unset when possible. +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then + as_unset=unset +else + as_unset=false +fi + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +as_nl=' +' +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +case $0 in + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break +done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + { (exit 1); exit 1; } +fi + +# Work around bugs in pre-3.0 UWIN ksh. +for as_var in ENV MAIL MAILPATH +do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +for as_var in \ + LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ + LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ + LC_TELEPHONE LC_TIME +do + if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then + eval $as_var=C; export $as_var + else + ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var + fi +done + +# Required to use basename. +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + + +# Name of the executable. +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# CDPATH. +$as_unset CDPATH + + + + as_lineno_1=$LINENO + as_lineno_2=$LINENO + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { + + # Create $as_me.lineno as a copy of $as_myself, but with $LINENO + # uniformly replaced by the line number. The first 'sed' inserts a + # line-number line after each line using $LINENO; the second 'sed' + # does the real work. The second script uses 'N' to pair each + # line-number line with the line containing $LINENO, and appends + # trailing '-' during substitution so that $LINENO is not a special + # case at line end. + # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the + # scripts with optimization help from Paolo Bonzini. Blame Lee + # E. McMahon (1931-1989) for sed's syntax. :-) + sed -n ' + p + /[$]LINENO/= + ' <$as_myself | + sed ' + s/[$]LINENO.*/&-/ + t lineno + b + :lineno + N + :loop + s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ + t loop + s/-\n.*// + ' >$as_me.lineno && + chmod +x "$as_me.lineno" || + { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 + { (exit 1); exit 1; }; } + + # Don't try to exec as it changes $[0], causing all sort of problems + # (the dirname of $[0] is not the place where we might find the + # original and so on. Autoconf is especially sensitive to this). + . "./$as_me.lineno" + # Exit status is that of the last command. + exit +} + + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in +-n*) + case `echo 'x\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + *) ECHO_C='\c';; + esac;; +*) + ECHO_N='-n';; +esac + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir +fi +echo >conf$$.file +if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -p'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -p' +elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln +else + as_ln_s='cp -p' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + +if mkdir -p . 2>/dev/null; then + as_mkdir_p=: +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +# Find out whether ``test -x'' works. Don't use a zero-byte file, as +# systems may use methods other than mode bits to determine executability. +cat >conf$$.file <<_ASEOF +#! /bin/sh +exit 0 +_ASEOF +chmod +x conf$$.file +if test -x conf$$.file >/dev/null 2>&1; then + as_executable_p="test -x" +else + as_executable_p=: +fi +rm -f conf$$.file + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + +exec 6>&1 + +# Save the log message, to keep $[0] and so on meaningful, and to +# report actual input values of CONFIG_FILES etc. instead of their +# values after options handling. +ac_log=" +This file was extended by $as_me, which was +generated by GNU Autoconf 2.60. Invocation command line was + + CONFIG_FILES = $CONFIG_FILES + CONFIG_HEADERS = $CONFIG_HEADERS + CONFIG_LINKS = $CONFIG_LINKS + CONFIG_COMMANDS = $CONFIG_COMMANDS + $ $0 $@ + +on `(hostname || uname -n) 2>/dev/null | sed 1q` +" + +_ACEOF + +cat >>$CONFIG_STATUS <<_ACEOF +# Files that config.status was made for. +config_files="$ac_config_files" + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF +ac_cs_usage="\ +\`$as_me' instantiates files from templates according to the +current configuration. + +Usage: $0 [OPTIONS] [FILE]... + + -h, --help print this help, then exit + -V, --version print version number, then exit + -q, --quiet do not print progress messages + -d, --debug don't remove temporary files + --recheck update $as_me by reconfiguring in the same conditions + --file=FILE[:TEMPLATE] + instantiate the configuration file FILE + +Configuration files: +$config_files + +Report bugs to ." + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF +ac_cs_version="\\ +config.status +configured by $0, generated by GNU Autoconf 2.60, + with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" + +Copyright (C) 2006 Free Software Foundation, Inc. +This config.status script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it." + +ac_pwd='$ac_pwd' +srcdir='$srcdir' +INSTALL='$INSTALL' +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF +# If no file are specified by the user, then we need to provide default +# value. By we need to know if files were specified by the user. +ac_need_defaults=: +while test $# != 0 +do + case $1 in + --*=*) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` + ac_shift=: + ;; + *) + ac_option=$1 + ac_optarg=$2 + ac_shift=shift + ;; + esac + + case $ac_option in + # Handling of the options. + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + ac_cs_recheck=: ;; + --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) + echo "$ac_cs_version"; exit ;; + --debug | --debu | --deb | --de | --d | -d ) + debug=: ;; + --file | --fil | --fi | --f ) + $ac_shift + CONFIG_FILES="$CONFIG_FILES $ac_optarg" + ac_need_defaults=false;; + --he | --h | --help | --hel | -h ) + echo "$ac_cs_usage"; exit ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil | --si | --s) + ac_cs_silent=: ;; + + # This is an error. + -*) { echo "$as_me: error: unrecognized option: $1 +Try \`$0 --help' for more information." >&2 + { (exit 1); exit 1; }; } ;; + + *) ac_config_targets="$ac_config_targets $1" + ac_need_defaults=false ;; + + esac + shift +done + +ac_configure_extra_args= + +if $ac_cs_silent; then + exec 6>/dev/null + ac_configure_extra_args="$ac_configure_extra_args --silent" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF +if \$ac_cs_recheck; then + echo "running CONFIG_SHELL=$SHELL $SHELL $0 "$ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 + CONFIG_SHELL=$SHELL + export CONFIG_SHELL + exec $SHELL "$0"$ac_configure_args \$ac_configure_extra_args --no-create --no-recursion +fi + +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF +exec 5>>config.log +{ + echo + sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX +## Running $as_me. ## +_ASBOX + echo "$ac_log" +} >&5 + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF + +# Handling of arguments. +for ac_config_target in $ac_config_targets +do + case $ac_config_target in + "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; + + *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 +echo "$as_me: error: invalid argument: $ac_config_target" >&2;} + { (exit 1); exit 1; }; };; + esac +done + + +# If the user did not use the arguments to specify the items to instantiate, +# then the envvar interface is used. Set only those that are not. +# We use the long form for the default assignment because of an extremely +# bizarre bug on SunOS 4.1.3. +if $ac_need_defaults; then + test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files +fi + +# Have a temporary directory for convenience. Make it in the build tree +# simply because there is no reason against having it here, and in addition, +# creating and moving files from /tmp can sometimes cause problems. +# Hook for its removal unless debugging. +# Note that there is a small window in which the directory will not be cleaned: +# after its creation but before its name has been assigned to `$tmp'. +$debug || +{ + tmp= + trap 'exit_status=$? + { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status +' 0 + trap '{ (exit 1); exit 1; }' 1 2 13 15 +} +# Create a (secure) tmp directory for tmp files. + +{ + tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && + test -n "$tmp" && test -d "$tmp" +} || +{ + tmp=./conf$$-$RANDOM + (umask 077 && mkdir "$tmp") +} || +{ + echo "$me: cannot create a temporary directory in ." >&2 + { (exit 1); exit 1; } +} + +# +# Set up the sed scripts for CONFIG_FILES section. +# + +# No need to generate the scripts if there are no CONFIG_FILES. +# This happens for instance when ./config.status config.h +if test -n "$CONFIG_FILES"; then + +_ACEOF + + + +ac_delim='%!_!# ' +for ac_last_try in false false false false false :; do + cat >conf$$subs.sed <<_ACEOF +SHELL!$SHELL$ac_delim +PATH_SEPARATOR!$PATH_SEPARATOR$ac_delim +PACKAGE_NAME!$PACKAGE_NAME$ac_delim +PACKAGE_TARNAME!$PACKAGE_TARNAME$ac_delim +PACKAGE_VERSION!$PACKAGE_VERSION$ac_delim +PACKAGE_STRING!$PACKAGE_STRING$ac_delim +PACKAGE_BUGREPORT!$PACKAGE_BUGREPORT$ac_delim +exec_prefix!$exec_prefix$ac_delim +prefix!$prefix$ac_delim +program_transform_name!$program_transform_name$ac_delim +bindir!$bindir$ac_delim +sbindir!$sbindir$ac_delim +libexecdir!$libexecdir$ac_delim +datarootdir!$datarootdir$ac_delim +datadir!$datadir$ac_delim +sysconfdir!$sysconfdir$ac_delim +sharedstatedir!$sharedstatedir$ac_delim +localstatedir!$localstatedir$ac_delim +includedir!$includedir$ac_delim +oldincludedir!$oldincludedir$ac_delim +docdir!$docdir$ac_delim +infodir!$infodir$ac_delim +htmldir!$htmldir$ac_delim +dvidir!$dvidir$ac_delim +pdfdir!$pdfdir$ac_delim +psdir!$psdir$ac_delim +libdir!$libdir$ac_delim +localedir!$localedir$ac_delim +mandir!$mandir$ac_delim +DEFS!$DEFS$ac_delim +ECHO_C!$ECHO_C$ac_delim +ECHO_N!$ECHO_N$ac_delim +ECHO_T!$ECHO_T$ac_delim +LIBS!$LIBS$ac_delim +build_alias!$build_alias$ac_delim +host_alias!$host_alias$ac_delim +target_alias!$target_alias$ac_delim +INSTALL_PROGRAM!$INSTALL_PROGRAM$ac_delim +INSTALL_SCRIPT!$INSTALL_SCRIPT$ac_delim +INSTALL_DATA!$INSTALL_DATA$ac_delim +PACKAGE!$PACKAGE$ac_delim +VERSION!$VERSION$ac_delim +ACLOCAL!$ACLOCAL$ac_delim +AUTOCONF!$AUTOCONF$ac_delim +AUTOMAKE!$AUTOMAKE$ac_delim +AUTOHEADER!$AUTOHEADER$ac_delim +MAKEINFO!$MAKEINFO$ac_delim +SET_MAKE!$SET_MAKE$ac_delim +CC!$CC$ac_delim +CFLAGS!$CFLAGS$ac_delim +LDFLAGS!$LDFLAGS$ac_delim +CPPFLAGS!$CPPFLAGS$ac_delim +ac_ct_CC!$ac_ct_CC$ac_delim +EXEEXT!$EXEEXT$ac_delim +OBJEXT!$OBJEXT$ac_delim +CPP!$CPP$ac_delim +makeinfo!$makeinfo$ac_delim +sgml2html!$sgml2html$ac_delim +LIBOBJS!$LIBOBJS$ac_delim +LTLIBOBJS!$LTLIBOBJS$ac_delim +_ACEOF + + if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 60; then + break + elif $ac_last_try; then + { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 +echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} + { (exit 1); exit 1; }; } + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done + +ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed` +if test -n "$ac_eof"; then + ac_eof=`echo "$ac_eof" | sort -nru | sed 1q` + ac_eof=`expr $ac_eof + 1` +fi + +cat >>$CONFIG_STATUS <<_ACEOF +cat >"\$tmp/subs-1.sed" <<\CEOF$ac_eof +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b end +_ACEOF +sed ' +s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g +s/^/s,@/; s/!/@,|#_!!_#|/ +:n +t n +s/'"$ac_delim"'$/,g/; t +s/$/\\/; p +N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n +' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF +:end +s/|#_!!_#|//g +CEOF$ac_eof +_ACEOF + + +# VPATH may cause trouble with some makes, so we remove $(srcdir), +# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and +# trailing colons and then remove the whole line if VPATH becomes empty +# (actually we leave an empty line to preserve line numbers). +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=/{ +s/:*\$(srcdir):*/:/ +s/:*\${srcdir}:*/:/ +s/:*@srcdir@:*/:/ +s/^\([^=]*=[ ]*\):*/\1/ +s/:*$// +s/^[^=]*=[ ]*$// +}' +fi + +cat >>$CONFIG_STATUS <<\_ACEOF +fi # test -n "$CONFIG_FILES" + + +for ac_tag in :F $CONFIG_FILES +do + case $ac_tag in + :[FHLC]) ac_mode=$ac_tag; continue;; + esac + case $ac_mode$ac_tag in + :[FHL]*:*);; + :L* | :C*:*) { { echo "$as_me:$LINENO: error: Invalid tag $ac_tag." >&5 +echo "$as_me: error: Invalid tag $ac_tag." >&2;} + { (exit 1); exit 1; }; };; + :[FH]-) ac_tag=-:-;; + :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; + esac + ac_save_IFS=$IFS + IFS=: + set x $ac_tag + IFS=$ac_save_IFS + shift + ac_file=$1 + shift + + case $ac_mode in + :L) ac_source=$1;; + :[FH]) + ac_file_inputs= + for ac_f + do + case $ac_f in + -) ac_f="$tmp/stdin";; + *) # Look for the file first in the build tree, then in the source tree + # (if the path is not absolute). The absolute path cannot be DOS-style, + # because $ac_f cannot contain `:'. + test -f "$ac_f" || + case $ac_f in + [\\/$]*) false;; + *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; + esac || + { { echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5 +echo "$as_me: error: cannot find input file: $ac_f" >&2;} + { (exit 1); exit 1; }; };; + esac + ac_file_inputs="$ac_file_inputs $ac_f" + done + + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated by config.status. */ + configure_input="Generated from "`IFS=: + echo $* | sed 's|^[^:]*/||;s|:[^:]*/|, |g'`" by configure." + if test x"$ac_file" != x-; then + configure_input="$ac_file. $configure_input" + { echo "$as_me:$LINENO: creating $ac_file" >&5 +echo "$as_me: creating $ac_file" >&6;} + fi + + case $ac_tag in + *:-:* | *:-) cat >"$tmp/stdin";; + esac + ;; + esac + + ac_dir=`$as_dirname -- "$ac_file" || +$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || +echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + { as_dir="$ac_dir" + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 +echo "$as_me: error: cannot create directory $as_dir" >&2;} + { (exit 1); exit 1; }; }; } + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + + case $ac_mode in + :F) + # + # CONFIG_FILE + # + + case $INSTALL in + [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; + *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; + esac +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF +# If the template does not know about datarootdir, expand it. +# FIXME: This hack should be removed a few years after 2.60. +ac_datarootdir_hack=; ac_datarootdir_seen= + +case `sed -n '/datarootdir/ { + p + q +} +/@datadir@/p +/@docdir@/p +/@infodir@/p +/@localedir@/p +/@mandir@/p +' $ac_file_inputs` in +*datarootdir*) ac_datarootdir_seen=yes;; +*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) + { echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 +echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF + ac_datarootdir_hack=' + s&@datadir@&$datadir&g + s&@docdir@&$docdir&g + s&@infodir@&$infodir&g + s&@localedir@&$localedir&g + s&@mandir@&$mandir&g + s&\\\${datarootdir}&$datarootdir&g' ;; +esac +_ACEOF + +# Neutralize VPATH when `$srcdir' = `.'. +# Shell code in configure.ac might set extrasub. +# FIXME: do we really want to maintain this feature? +cat >>$CONFIG_STATUS <<_ACEOF + sed "$ac_vpsub +$extrasub +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF +:t +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b +s&@configure_input@&$configure_input&;t t +s&@top_builddir@&$ac_top_builddir_sub&;t t +s&@srcdir@&$ac_srcdir&;t t +s&@abs_srcdir@&$ac_abs_srcdir&;t t +s&@top_srcdir@&$ac_top_srcdir&;t t +s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t +s&@builddir@&$ac_builddir&;t t +s&@abs_builddir@&$ac_abs_builddir&;t t +s&@abs_top_builddir@&$ac_abs_top_builddir&;t t +s&@INSTALL@&$ac_INSTALL&;t t +$ac_datarootdir_hack +" $ac_file_inputs | sed -f "$tmp/subs-1.sed" >$tmp/out + +test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && + { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && + { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && + { echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined." >&5 +echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined." >&2;} + + rm -f "$tmp/stdin" + case $ac_file in + -) cat "$tmp/out"; rm -f "$tmp/out";; + *) rm -f "$ac_file"; mv "$tmp/out" $ac_file;; + esac + ;; + + + + esac + +done # for ac_tag + + +{ (exit 0); exit 0; } +_ACEOF +chmod +x $CONFIG_STATUS +ac_clean_files=$ac_clean_files_save + + +# configure is writing to config.log, and then calls config.status. +# config.status does its own redirection, appending to config.log. +# Unfortunately, on DOS this fails, as config.log is still kept open +# by configure, so config.status won't be able to write to it; its +# output is simply discarded. So we exec the FD to /dev/null, +# effectively closing config.log, so it can be properly (re)opened and +# appended to by config.status. When coming back to configure, we +# need to make the FD available again. +if test "$no_create" != yes; then + ac_cs_success=: + ac_config_status_args= + test "$silent" = yes && + ac_config_status_args="$ac_config_status_args --quiet" + exec 5>/dev/null + $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false + exec 5>>config.log + # Use ||, not &&, to avoid exiting from the if with $? = 1, which + # would make configure fail if this is the last instruction. + $ac_cs_success || { (exit 1); exit 1; } +fi + + + diff --git a/documentation/configure.in b/documentation/configure.in new file mode 100644 index 00000000..ebf59667 --- /dev/null +++ b/documentation/configure.in @@ -0,0 +1,56 @@ +dnl $Id$ +dnl Autoconf script for the documentation. + +dnl Copyright 1999 chaos development. +dnl Author: Per Lundberg . + +dnl This program is free software; you can redistribute it and/or modify +dnl it under the terms of the GNU General Public License as published by +dnl the Free Software Foundation; either version 2 of the License, or +dnl (at your option) any later version. + +dnl This program is distributed in the hope that it will be useful, +dnl but WITHOUT ANY WARRANTY; without even the implied warranty of +dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +dnl GNU General Public License for more details. + +dnl You should have received a copy of the GNU General Public License +dnl along with this program; if not, write to the Free Software +dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +AC_INIT +AC_CONFIG_SRCDIR([coding-standards.sgml]) +AM_INIT_AUTOMAKE(documentation, 0.0.0) +AC_PREFIX_DEFAULT(/mnt/chaos) + +dnl Check for the programs we need. + +AC_PROG_CC +AC_PROG_CPP +AC_PROG_MAKE_SET + +AC_CHECK_PROG(makeinfo, makeinfo, makeinfo) + +[ +if [ x$makeinfo != xmakeinfo ]; then + echo -e "\nError: You must have makeinfo to compile the documentation. It can be found" + echo -e "at your favourite GNU mirror.\n" + exit 1 +fi +] + +AC_CHECK_PROG(sgml2html, sgml2html, sgml2html) + +[ +if [ x$sgml2html != xsgml2html ]; then + echo -e "\nError: You must have sgml-tools to compile the documentation. It can be found" + echo -e "at http://pobox.com/~cg/sgmltools.\n" + exit 1 +fi +] + + +AC_CONFIG_FILES([Makefile]) +AC_OUTPUT + + diff --git a/documentation/dataarea.txt b/documentation/dataarea.txt new file mode 100644 index 00000000..20b20606 --- /dev/null +++ b/documentation/dataarea.txt @@ -0,0 +1,19 @@ + +The storm data area is used to hold information collected in real mode to be +used in protected mode later. This is the layout of the storm data area: + + +(bytes) + + offset | length | purpose +-----------+------------+----------------------------------------------------- + 0 | 4 | linear pointer to the multiboot data area + 132 | 1 | type of display used (0 = text, 1 = graphic). + 133 | 2 | vertical resoultion (characters if display type = 0, + | | or else pixels). + 135 | 2 | the same thing, but horizontal resoulution. + 137 | 512 | vesa info buffer (standard vesa supervga information + | | buffer). + +The kernel data area is located at linear address 0x3000 and is one page big +(4096 bytes). diff --git a/documentation/docbook2html b/documentation/docbook2html new file mode 100755 index 00000000..1db8cbba --- /dev/null +++ b/documentation/docbook2html @@ -0,0 +1,77 @@ +#! /bin/sh + +CATALOG=/etc/sgml.catalog +DB_STYLESHEET=chaos-both.dsssl + +output=db2html-dir +TMPDIR=DBTOHTML_OUTPUT_DIR$$ + +echo TMPDIR is $TMPDIR + +# Dave Mason's option to specify a different stylesheet +case $1 in + -d) DB_STYLESHEET=$2 + shift 2 + ;; +esac + +echo "Using stylesheet: \"${DB_STYLESHEET}\"" + +if [ $# -gt 2 ] +then + echo "Usage: `basename $0` [filename.sgml]" >&2 + exit 1 +fi + +if [ $# -eq 1 ] +then + if [ ! -r $1 ] + then + echo Cannot read \"$1\". Exiting. >&2 + exit 1 + fi + if echo $1 | egrep -i '\.sgml$|\.sgm$' >/dev/null 2>&1 + then + # now make sure that the output directory is always a subdirectory + # of hte current directory + echo + input_file=`basename $1` + output="`echo $input_file | sed 's,\.sgml$,,;s,\.sgm$,,'`" + echo "input file was called $input_file -- output will be in $output" + echo + fi +fi + +# we used to generate a single file, but with the modular DB_STYLESHEETs +# it's best to make a new directory with several html files in it +#cat $* | jade -d $DB_STYLESHEET -t sgml -V nochunks > $TMPFN + +mkdir $TMPDIR +SAVE_PWD=`pwd` +if [ $1 = `basename $1` ]; then + echo "working on ../$1" + (cd $TMPDIR; jade -c $CATALOG -t sgml -ihtml -d ${DB_STYLESHEET}\#html ../$1; cd $SAVE_PWD) +else + echo "working on $1" + (cd $TMPDIR; jade -c $CATALOG -t sgml -ihtml -d ${DB_STYLESHEET}\#html $1; cd $SAVE_PWD) +fi + +if [ $# -eq 1 ] +then + if [ -d ${output}.junk ] + then + /bin/rm -rf ${output}.junk + fi + if [ -d ${output} ] + then + mv $output ${output}.junk + fi + echo "about to rename temporary directory to $output" + mv ${TMPDIR} $output +else + cat $TMPDIR/* +fi + +rm -rf $TMPDIR + +exit 0 diff --git a/documentation/filesystem-hierarchy.sgml b/documentation/filesystem-hierarchy.sgml new file mode 100644 index 00000000..5fdefd5a --- /dev/null +++ b/documentation/filesystem-hierarchy.sgml @@ -0,0 +1,161 @@ + + +
+chaos Filesystem Hierarchy Standard +<author>chaos development, <tt/staff@chaosdev.org/ +<date>$Id$ + +<abstract> +This is the chaos Filesystem Hierarchy Standard. In here, we try to +document the filsystem hierarchy used by the chaos Operating +System. See the <ref id="prologue" name="Prologue"> section for more +information about this. + +<toc> + +<sect>Prologue<label id="prologue"> +<p> +This file contains the FHS for the chaos operating system. It should +be noted that this is <em/not/ the only way to structure things in a +chaos system, but it is the preferred and programs that want to call +themselves 'Designed for chaos' must obey to these standards. More +specifically, a program that meets our criterias must also have no +hard-coded paths at all; all references to those directories must use +our defined paths, which are defined in the include file 'chaos.h' in +the standard chaos library. (More about this in the chaos Programming +Reference Manual) +</p> + +<p> +This standard does not try to be like everything else. The regular way +of doing things does not necessarily have to be the best. In many +cases, you'll see this in that we have chosen a totally different +approach than everything else. Remember that chaos is not just another +boring UNIX clone; this is something totally different. Something <em/new/. +</p> + +<p> +If you feel something is wrong or missing, please contact us at one of +the mail addresses listed at our <url url="http://www.chaosdev.org" +name="web site">. Flames go directly to /devices/character/null. :-) +</p> + +<sect>The FHS +<p> +<descrip> +<tag>Directory /config</> + +This is where all the configuration files are stored. It does not +contain any files, only directories. System configuration files are +stored in /config/chaos. A program designed for chaos should put its +system wide configuration files in '/config/PROGRAM', where PROGRAM is +the name of the program. (I.e., if program foo wants to store +configuration about bar, it should create the directory '/config/foo' +and put the information in '/config/foo/bar') General preferences for +a program should be put in a file called "preferences" in the +program's configuration directory. As a general rule, never put the +program's name in the name of the configuration file. + +<tag>Directory /config/chaos</> + +This is where all the system configuration files are stored. An +example of such a file is 'config/chaos/servers' that contains a list +of all the servers that should be started at boot time. (Servers +started from the Multiboot bootloader (usually GRUB) does not have to +be listed in this file) + +<tag>Directory /libraries</> + +This is where all libraries (only shared; static are placed elsewhere) +are stored. A library should generally have the name '<name>-x.y.z', +so the foo library of version 1.2.3 would be called +'foo-1.2.3'. (There's no need to indicate in the filename that this is +a library since it is implicated by the path name) + +<tag>Directory /modules</> + +Here, loadable modules used by some programs and libraries will be +found (in appropriate subdirectories, of course). This is used to +support, for example, data types (the ability for a program to +read/write to data formats without knowing how they are stored). + +<tag>Directory /clients</> + +This is where all the binaries of the programs you have installed. For +example, the binary for the program 'cluido' is located at +'/clients/cluido/cluido'. + +<tag>Directory /system</> + +This is where operating system files are stored (except for +configuration files). There should be no files in this directory; only +subdirectories. + +<tag>Directory /system/servers</> + +Here, all the servers installed are stored. They are usually +compressed with GNU zip. Most servers doesn't have a configuration +file, so the binary is just about it. (except for the documentation) + +<tag>Directory /system/kernel</> + +This is where the kernel image should be stored. A normal gzipped +storm kernel image is called /system/kernel/storm-xx.yy.zz.gz, for +example. + +<tag>Directory /data</> + +Here, the programs store can store arbitrary data. For example, the +program "Quake" could store its data in the directory +'/data/quake'. Another example is '/data/programming/c/headers', where +C header files is stored. (Yes, we know this is very different from +what most of you are used to. This is on purpose. A non-programmer +shouldn't need to have any header files installed.) + +<tag>Directory /temp</> + +This is where temporary files should be stored, for example +information that a program doesn't need for the moment. This directory +is cleared at system startup. + +<tag>Directory /users</> + +Here, the users' home directories are stored. The home directory for +user "foo" is located at '/users/foo'. + +</descrip> +</p> + +<sect>Virtual Directories + +<p> +<descrip> +<tag>Directory /devices</> + +When a server is launched, it can create an entry in this directory +if, and only if, it serves a block or character device. This entry can +then be used for accessing the device the server manages (for example, +the server 'keyboard' creates the entry '/devices/keyboard' here, +where it will put an entry for each keyboard found. Thus, +'/devices/keyboard/0' can be used to access the first keyboard, and so +on. + +<tag>Directory /services</> + +Servers that don't do hardware but more abstract things may want to +create entries here. For example, the IP server might create +'/services/network/protocol/ipv4'. This virtual file can then be +IOCTL:d (TODO: how should this work?) to get the PID of this process, +so that a program that wants to do IP knows which PID to send the +message to + +<tag>Directory /kernelfs</> + +This is the kernel virtual file system. In here, you can find some +information about the status of the system; for example, process +information (CPU usage, memory load, etc). + +</descrip> +</p> + +</article> diff --git a/documentation/gdt.txt b/documentation/gdt.txt new file mode 100644 index 00000000..d08896fd --- /dev/null +++ b/documentation/gdt.txt @@ -0,0 +1,30 @@ + + Layout Of The GDT In storm +--------------------------------------- + +0 NULL descriptor +1 Flat data (DS in the kernel) +2 Kernel code (CS in the kernel) +3 Kernel stack (SS in the kernel) +4 Kernel TSS +5-n Syscalls +n TSS of first task +n+1 LDT of first task +... + + + NEW LAYOUT +--------------------------------------- + +0 NULL descriptor +1 Kernel data (ds in the kernel) +2 Kernel code (cs in the kernel) +3 Reserved +4 Linear code segment (used for processes) +5 Linear data segment (used for processes) +6 Reserved +7 Process TSS1 +8 Process TSS2 +9-15 Reserved +16-47 Exception task gates +48-n Syscall call gates diff --git a/documentation/install-sh b/documentation/install-sh new file mode 100755 index 00000000..e9de2384 --- /dev/null +++ b/documentation/install-sh @@ -0,0 +1,251 @@ +#!/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/documentation/installation.sgml b/documentation/installation.sgml new file mode 100644 index 00000000..08fbe543 --- /dev/null +++ b/documentation/installation.sgml @@ -0,0 +1,280 @@ +<!DOCTYPE Book PUBLIC "-//OASIS//DTD DocBook V3.1//EN"> + +<book> + <bookinfo> + + <title>Installation of chaos + + + Per + Lundberg + + + $Id$ + + + + Introduction + + + chaos is, as you probably know, an operating system written + totally from scratch by a bunch of Swedish (and others) + hackers. Right now, we have not come as far as to write an + installation program, so getting chaos onto your computer is not + as straightforward as it could be. In this paper, you will be + able to get some information about the different methods of + setting things up. Hopefully, after reading this, you will find + setting chaos up pretty trivial. In any way, please do not + hesitate to mail staff@chaosdev.org if this information is wrong + in any way. + + + + Now, as you will see, there are several methods of trying out + chaos. They have one chapter each, and are listed in order of + complexity. + + + + + + Installing a floppy image + + + Using a floppy image to try out chaos is very easy. All you have + to do is to download the floppy image (from our download page on + http://www.chaosdev.org, or via anonymous FTP from + ftp://ftp.chaosdev.org/chaos). Now, gunzip it if your web + browser did not do it auto-magically (Netscape Navigator does + that, and possible others too). If you do not have a program for + decompressing gz files, get one from + ftp://ftp.gnu.org/pub/gnu/gzip. + + + + When you have decompressed the floppy image, get it onto a 1.44 + 3,5" floppy. If you are using DOS or Windows, get the + rawrite2.exe program from ftp://ftp.chaosdev.org/dosutils. Write + like this: + + + + rawrite2 -f floppy.img -d a: + + + + (Give the floppy image a letter within the 8.3 range to avoid + problems; rawrite is a DOS program with no support for long file + names.) + + + + If you are using some kind of Unix (most probably Linux or some + of the BSD systems. Anything else is probably out of the scope + of this document, and if you are using such a system, you should + be skilled enough to do such things anyway), do like this: + + + + dd if=floppy.image of=/dev/fd0 + + + + If using BSD-derived systems, you will need to use /dev/fd0c + instead. Anyway, that is all! Now, boot a computer with this + floppy, and something magic will (hopefully) appear. Much joy! + + + + + Compiling the source + + + Do you feel tired of waiting for us to update the floppy images, + or do you feel to do some chaos hacking? If so, compiling the + source is probably of interest. It is really not very + difficult. First, get the sources, and decompress them. Do + something like this: + + + + tar xvIf chaos_snapshot-20001224.tar.bz2 + + + + (You must have a pretty recent GNU tar and a working bzip2 for + this to work. If you are using an older version of tar, you + might have to decompress the file manually first. Read the man + pages for your bzip2 and tar programs for more information.) + + + + Now, go to the newly created chaos directory, and read the file + README.Linux. It will contain up-to-date instructions for + building the system. + + + + If everything works out fine, your chaos root (/mnt/chaos is the + only possible choice right now -- sorry about that) will be + filled with new, fresh stuff. It is not really more difficult + than this. + + + + + Net-booting + + + The absolutely most elegant way to boot chaos, especially when + developing the system, is to use the net-boot feature of GNU + GRUB, our boot loader. It is a little tricky to get up, so we + provide some information for your pleasure. + + + + This chapter will tell you how to get GNU GRUB with net-boot + installed on a floppy, but you should be able to do the same if + you want to install GNU GRUB on your hard drive. The reason we + are primarily focusing on doing a floppy is because it is + easier, and it will make most people happy. In the future, it is + very likely that we will extend this appendix to include + information about installating onto hard drives. + + + + First, you must choose which method you want to use to configure + the IP address of the system you want to net-boot on (hereafter + referred to as the client). This is used to select which + software to install on the machine you want to boot from + (hereafter called the server). The methods available in GNU GRUB + right now are rarpd, bootp and DHCP. They all work pretty + similarly, so if you are unsure of which one to choose, just + pick anyone. If you happen to be on a network where a DHCP or + bootp server already exists, you can be a little tricky and + install a rarpd server, without risk of interfering with the + other server. (You can find all the software you need for this + at http://www.freshmeat.net/) + + + + When you have got the IP configuration server up and running, it + is time to install a TFTP server. TFTP is an acronym for Trivial + File Transfer Protocol and is used by GNU GRUB to transfer the + kernel and servers from the boot server. You can find TFTP + servers at the same place as the rest of the software. + + + + (I will not go into detail about how to configure the software + here, but I will just mention one thing I would like you to + avoid: GNU GRUB does not support "IP ranges" in the DHCP server + configuration. You must have a host entry for the machine in + question). + + + + Okay, so you might have succeeded in getting rarpd/bootpd/dhcpd + and tftpd installed, but where do we go from here? This is + where it starts getting interesting. Unpack the GNU GRUB source, + change to the newly created directory and write like this: + + + + ./configure --help | less + + + + Now, make sure your network adapter is supported by GRUB. If it + is, run configure again, with the correct parameter. For + example, like this: + + + + ./configure --enable-rtl8139 + + + + Now, run the 'make', which will compile the GRUB stage1 and + stage2 files. For information about how to install the created + files, check the GNU GRUB documentation. Basically, format the + floppy (FAT or ext2 is just fine) and copy the stage1 and stage2 + files there. Now, run the GRUB shell and write something like + this: + + + + install (fd0)/stage1 (fd0) (fd0)/stage2 (fd0)/menu + + + + Now, create a file on the floppy, called menu. It should look + like this: + + + + timeout = 1 + title = Netboot + dhcp + configfile (nd)/mnt/chaos/config/grub/menu + + + + Substitute dhcp with bootp or rarp if you like. Now, boot with + this floppy, and it will (hopefully) configure its IP address + and load the second configuration file from the server. + + + + + Example GNU GRUB menu file + + This is what I use on my net-boot server: + + + +timeout = 2 + +title Net-chaos +root (nd) +kernel /mnt/chaos/system/kernel/storm +module /mnt/chaos/system/servers/keyboard +module /mnt/chaos/system/servers/vga +module /mnt/chaos/system/servers/console +module /mnt/chaos/system/servers/log +module /mnt/chaos/system/servers/cluido +module /mnt/chaos/system/servers/cluido +module /mnt/chaos/system/servers/cluido +module /mnt/chaos/system/servers/cluido +module /mnt/chaos/system/servers/initial_ramdisk +module /mnt/chaos/system/servers/fat +module /mnt/chaos/system/servers/virtual_file_system +module /mnt/chaos/system/servers/pci +module /mnt/chaos/system/servers/serial +module /mnt/chaos/system/servers/boot +module /mnt/chaos/system/servers/tornado + + + + This is what I use when booting chaos locally: + + + +title chaos +root (hd0,2) +kernel /mnt/chaos/system/kernel/storm +module /mnt/chaos/system/servers/keyboard +module /mnt/chaos/system/servers/console +module /mnt/chaos/system/servers/vga +module /mnt/chaos/system/servers/cluido +module /mnt/chaos/system/servers/log +module /mnt/chaos/system/servers/idle +module /mnt/chaos/system/servers/fat +module /mnt/chaos/system/servers/initial_ramdisk +module /mnt/chaos/system/servers/virtual_file_system +module /mnt/chaos/system/servers/ipv4 +module /mnt/chaos/system/servers/3c509 +module /mnt/chaos/system/servers/boot + + + \ No newline at end of file diff --git a/documentation/installation.txt b/documentation/installation.txt new file mode 100644 index 00000000..00a0e2fe --- /dev/null +++ b/documentation/installation.txt @@ -0,0 +1,195 @@ + +Installation of chaos + +Per Lundberg + _________________________________________________________________ + + Table of Contents + Introduction + 1. Installing a floppy image + 2. Compiling the source + A. Net-booting + B. Example GNU GRUB menu file + _________________________________________________________________ + +Introduction + + chaos is, as you probably know, an operating system written totally + from scratch by a bunch of Swedish (and others) hackers. Right now, we + have not come as far as to write an installation program, so getting + chaos onto your computer is not as straightforward as it could be. In + this paper, you will be able to get some information about the + different methods of setting things up. Hopefully, after reading this, + you will find setting chaos up pretty trivial. In any way, please do + not hesitate to mail staff@chaosdev.org if this information is wrong + in any way. + + Now, as you will see, there are several methods of trying out chaos. + They have one chapter each, and are listed in order of complexity. + _________________________________________________________________ + +Chapter 1. Installing a floppy image + + Using a floppy image to try out chaos is very easy. All you have to do + is download the floppy image (from our download page on + http://www.chaosdev.org, or via anonymous FTP to + ftp://ftp.chaosdev.org/chaos). Now, gunzip it if your web browser did + not do it auto-magically (Netscape Navigator does that, and possible + others too). If you do not have a program for decompressing gz files, + get one from ftp://ftp.gnu.org/pub/gnu/gzip. + + When you have decompressed the floppy image, get it onto a 1.44 3,5" + floppy. If you are using DOS or Windows, get the rawrite2.exe program + from ftp://ftp.chaosdev.org/dosutils. Write like this: + rawrite2 -f floppy.img -d a: + + + (Give the floppy image a letter within the 8.3 range to avoid + problems; rawrite is a DOS program with no support for long file + names) + + If you are using some kind of Unix (most probably Linux or some of the + BSD:s. Anything else is probably out of the scope of this document, + and if you are using such a system, you should be skilled enough to do + such things anyway), do like this: + dd if=floppy.image of=/dev/fd0 + + + And that is all! Now, boot a computer with this floppy, and something + magic will (hopefully) appear. Much joy! + _________________________________________________________________ + +Chapter 2. Compiling the source + + Do you feel tired of waiting for us to update the floppy images, or do + you feel to do some chaos hacking? If so, compiling the source is + probably of interest. It is really not very difficult. First, get the + sources, and decompress them. Do something like this: + tar xvIf chaos_snapshot-20001224.tar.bz2 + + + (You must have a pretty recent tar and a working bzip2 for this to + work. If you are using and older version of tar, you might have to + decompress the file manually first) + + Now, go to the newly created chaos directory, and read the file + README.Linux. It will contain up-to-date instructions for building the + system. + + If everything works out fine, your chaos root (/mnt/chaos is the only + possible choice right now -- sorry about that) will be filled with + new, fresh stuff. It is not really more difficult than this. + _________________________________________________________________ + +Appendix A. Net-booting + + The absolutely most elegant way to boot chaos, especially when + developing the system, is to use the net-boot feature of GNU GRUB, our + boot loader. It is a little tricky to get up, so we provide some + information for your pleasure. + + This chapter will tell you how to get GNU GRUB with net-boot installed + on a floppy, but you should be able to do the same if you want to + install GNU GRUB on your hard drive. The reason we are primarily + focusing on doing a floppy is because it is easier, and it will make + most people happy. In the future, it is very likely that we will + extend this chapter to include this information. + + First, you must choose which method you want to use to configure the + IP address of the system you want to net-boot on (hereafter referred + to as the client). This is used to select which software to install on + the machine you want to boot from (hereafter called the server). The + methods available in GNU GRUB right now are rarpd, bootp and DHCP. + They all work pretty similarly, so if you are unsure of which one to + choose, just pick anyone. If you happen to be on a network where a + DHCP or bootp server already exists, you can be a little tricky and + install a rarpd server, without risk of interfering with the other + server. (You can find all the software you need for this at + http://www.freshmeat.net/) + + When you have got the IP configuration server up and running, it is + time to install a TFTP server. TFTP is an acronym for Trivial File + Transfer Protocol and is used by GNU GRUB to transfer the kernel and + servers from the boot server. You can find TFTP servers at the same + place as the rest of the software. + + (I will not go into detail about how to configure the software here, + but I will just mention one thing I would like you to avoid: GNU GRUB + does not support "IP ranges" in the DHCP server configuration. You + must have a host entry for the machine in question). + + Okay, so you might have succeeded in getting rarpd/bootpd/dhcpd and + tftpd installed, but where do we go from there? This is where it + starts getting interesting. Unpack the GNU GRUB source, change to the + newly created directory and write like this: + ./configure --help | less + + + Now, make sure your network adapter is supported by GRUB. If it is, + run configure again, with the correct parameter. For example, like + this: + ./configure --enable-rtl8139 + + + Now, run the 'make', which will compile the GRUB stage1 and stage2 + files. For information about how to install the created files, check + the GNU GRUB documentation. Basically, format the floppy (FAT or ext2 + is just fine) and copy the stage1 and stage2 files there. Now, run the + GRUB shell and write something like this: + install (fd0)/stage1 (fd0) (fd0)/stage2 (fd0)/menu + + + Now, create a file on the floppy, called menu. It should look like + this: + timeout = 1 + title = Netboot + dhcp + configfile (nd)/mnt/chaos/config/grub/menu + + + Substitute dhcp with bootp or rarp if you like. Now, boot with this + floppy, and it will (hopefully) configure its IP address and load the + second configuration file from the server. + _________________________________________________________________ + +Appendix B. Example GNU GRUB menu file + + This is what I use on my net-boot server: +timeout = 2 + +title Net-chaos +root (nd) +kernel /mnt/chaos/system/kernel/storm +module /mnt/chaos/system/servers/keyboard +module /mnt/chaos/system/servers/vga +module /mnt/chaos/system/servers/console +module /mnt/chaos/system/servers/log +module /mnt/chaos/system/servers/cluido +module /mnt/chaos/system/servers/cluido +module /mnt/chaos/system/servers/cluido +module /mnt/chaos/system/servers/cluido +module /mnt/chaos/system/servers/initial_ramdisk +module /mnt/chaos/system/servers/fat +module /mnt/chaos/system/servers/virtual_file_system +module /mnt/chaos/system/servers/pci +module /mnt/chaos/system/servers/serial +module /mnt/chaos/system/servers/boot +module /mnt/chaos/system/servers/tornado + + + This is what I use when booting chaos locally: +title chaos +root (hd0,2) +kernel /mnt/chaos/system/kernel/storm +module /mnt/chaos/system/servers/keyboard +module /mnt/chaos/system/servers/console +module /mnt/chaos/system/servers/vga +module /mnt/chaos/system/servers/cluido +module /mnt/chaos/system/servers/log +module /mnt/chaos/system/servers/idle +module /mnt/chaos/system/servers/fat +module /mnt/chaos/system/servers/initial_ramdisk +module /mnt/chaos/system/servers/virtual_file_system +module /mnt/chaos/system/servers/ipv4 +module /mnt/chaos/system/servers/3c509 +module /mnt/chaos/system/servers/boot diff --git a/documentation/installation.xml b/documentation/installation.xml new file mode 100644 index 00000000..bffebfb8 --- /dev/null +++ b/documentation/installation.xml @@ -0,0 +1,282 @@ + + + + + + + Installation of chaos + + + Per + Lundberg + + + $Id$ + + + + Introduction + + + chaos is, as you probably know, an operating system written + totally from scratch by a bunch of Swedish (and others) + hackers. Right now, we have not come as far as to write an + installation program, so getting chaos onto your computer is not + as straightforward as it could be. In this paper, you will be + able to get some information about the different methods of + setting things up. Hopefully, after reading this, you will find + setting chaos up pretty trivial. In any way, please do not + hesitate to mail staff@chaosdev.org if this information is wrong + in any way. + + + + Now, as you will see, there are several methods of trying out + chaos. They have one chapter each, and are listed in order of + complexity. + + + + + + Installing a floppy image + + + Using a floppy image to try out chaos is very easy. All you have + to do is download the floppy image (from our download page on + http://www.chaosdev.org, or via anonymous FTP from + ftp://ftp.chaosdev.org/chaos). Now, gunzip it if your web browser did + not do it auto-magically (Netscape Navigator does that, and + possible others too). If you do not have a program for + decompressing gz files, get one from + ftp://ftp.gnu.org/pub/gnu/gzip. + + + + When you have decompressed the floppy image, get it onto a 1.44 + 3,5" floppy. If you are using DOS or Windows, get the + rawrite2.exe program from ftp://ftp.chaosdev.org/dosutils. Write + like this: + + + + rawrite2 -f floppy.img -d a: + + + + (Give the floppy image a letter within the 8.3 range to avoid + problems; rawrite is a DOS program with no support for long file + names.) + + + + If you are using some kind of Unix (most probably Linux or some + of the BSD systems. Anything else is probably out of the scope + of this document, and if you are using such a system, you should + be skilled enough to do such things anyway), do like this: + + + + dd if=floppy.image of=/dev/fd0 + + + + If using BSD-derived systems, you will need to use /dev/fd0c + instead. Anyway, that is all! Now, boot a computer with this + floppy, and something magic will (hopefully) appear. Much joy! + + + + + Compiling the source + + + Do you feel tired of waiting for us to update the floppy images, + or do you feel to do some chaos hacking? If so, compiling the + source is probably of interest. It is really not very + difficult. First, get the sources, and decompress them. Do + something like this: + + + + tar xvIf chaos_snapshot-20001224.tar.bz2 + + + + (You must have a pretty recent GNU tar and a working bzip2 for + this to work. If you are using an older version of tar, you + might have to decompress the file manually first. Read the man + pages for your bzip2 and tar programs for more information.) + + + + Now, go to the newly created chaos directory, and read the file + README.Linux. It will contain up-to-date instructions for + building the system. + + + + If everything works out fine, your chaos root (/mnt/chaos is the + only possible choice right now -- sorry about that) will be + filled with new, fresh stuff. It is not really more difficult + than this. + + + + + Net-booting + + + The absolutely most elegant way to boot chaos, especially when + developing the system, is to use the net-boot feature of GNU + GRUB, our boot loader. It is a little tricky to get up, so we + provide some information for your pleasure. + + + + This chapter will tell you how to get GNU GRUB with net-boot + installed on a floppy, but you should be able to do the same if + you want to install GNU GRUB on your hard drive. The reason we + are primarily focusing on doing a floppy is because it is + easier, and it will make most people happy. In the future, it is + very likely that we will extend this appendix to include + information about installating onto hard drives too. + + + + First, you must choose which method you want to use to configure + the IP address of the system you want to net-boot on (hereafter + referred to as the client). This is used to select which + software to install on the machine you want to boot from + (hereafter called the server). The methods available in GNU GRUB + right now are rarpd, bootp and DHCP. They all work pretty + similarly, so if you are unsure of which one to choose, just + pick anyone. If you happen to be on a network where a DHCP or + bootp server already exists, you can be a little tricky and + install a rarpd server, without risk of interfering with the + other server. (You can find all the software you need for this + at http://www.freshmeat.net/) + + + + When you have got the IP configuration server up and running, it + is time to install a TFTP server. TFTP is an acronym for Trivial + File Transfer Protocol and is used by GNU GRUB to transfer the + kernel and servers from the boot server. You can find TFTP + servers at the same place as the rest of the software. + + + + (I will not go into detail about how to configure the software + here, but I will just mention one thing I would like you to + avoid: GNU GRUB does not support "IP ranges" in the DHCP server + configuration. You must have a host entry for the machine in + question). + + + + Okay, so you might have succeeded in getting rarpd/bootpd/dhcpd + and tftpd installed, but where do we go from here? This is + where it starts getting interesting. Unpack the GNU GRUB source, + change to the newly created directory and write like this: + + + + ./configure --help | less + + + + Now, make sure your network adapter is supported by GRUB. If it + is, run configure again, with the correct parameter. For + example, like this: + + + + ./configure --enable-rtl8139 + + + + Now, run the 'make', which will compile the GRUB stage1 and + stage2 files. For information about how to install the created + files, check the GNU GRUB documentation. Basically, format the + floppy (FAT or ext2 is just fine) and copy the stage1 and stage2 + files there. Now, run the GRUB shell and write something like + this: + + + + install (fd0)/stage1 (fd0) (fd0)/stage2 (fd0)/menu + + + + Now, create a file on the floppy, called menu. It should look + like this: + + + + timeout = 1 + title = Netboot + dhcp + configfile (nd)/mnt/chaos/config/grub/menu + + + + Substitute dhcp with bootp or rarp if you like. Now, boot with + this floppy, and it will (hopefully) configure its IP address + and load the second configuration file from the server. + + + + + Example GNU GRUB menu file + + This is what I use on my net-boot server: + + + +timeout = 2 + +title Net-chaos +root (nd) +kernel /mnt/chaos/system/kernel/storm +module /mnt/chaos/system/servers/keyboard +module /mnt/chaos/system/servers/vga +module /mnt/chaos/system/servers/console +module /mnt/chaos/system/servers/log +module /mnt/chaos/system/servers/cluido +module /mnt/chaos/system/servers/cluido +module /mnt/chaos/system/servers/cluido +module /mnt/chaos/system/servers/cluido +module /mnt/chaos/system/servers/initial_ramdisk +module /mnt/chaos/system/servers/fat +module /mnt/chaos/system/servers/virtual_file_system +module /mnt/chaos/system/servers/pci +module /mnt/chaos/system/servers/serial +module /mnt/chaos/system/servers/boot +module /mnt/chaos/system/servers/tornado + + + + This is what I use when booting chaos locally: + + + +title chaos +root (hd0,2) +kernel /mnt/chaos/system/kernel/storm +module /mnt/chaos/system/servers/keyboard +module /mnt/chaos/system/servers/console +module /mnt/chaos/system/servers/vga +module /mnt/chaos/system/servers/cluido +module /mnt/chaos/system/servers/log +module /mnt/chaos/system/servers/idle +module /mnt/chaos/system/servers/fat +module /mnt/chaos/system/servers/initial_ramdisk +module /mnt/chaos/system/servers/virtual_file_system +module /mnt/chaos/system/servers/ipv4 +module /mnt/chaos/system/servers/3c509 +module /mnt/chaos/system/servers/boot + + + \ No newline at end of file diff --git a/documentation/ipc.txt b/documentation/ipc.txt new file mode 100644 index 00000000..f93dbc05 --- /dev/null +++ b/documentation/ipc.txt @@ -0,0 +1,111 @@ +I. IPC primitives + + The following proposed IPC mechanism supplies two different primitives: messages and events. +Both of the primitives conform to similar interfaces (they are sent and received) with the exception of +the semantics of how they are actually sent. The first part of this proposal describes the "send" and +"receive" semantics of messages followed by events and then continues to outline some useful or somewhat +necessary extensions to these concepts. + +II. Messages + + Messages are an unbuffered, synchronous form of IPC. At the interface level, they are strings +of data with associated lengths up to some fixed size. This data is copied directly from the sender's +message buffer to the receiver's buffer which imposes their synchronous restriction that both +the sender and receiver must be blocked until one acknowledges the other. The implementation would +possibly work as follows: + + * N + 1 page table entries would be reserved for IPC in each address space to accomodate + messages up to N pages long (the extra entry is to handle messages not aligned on pages). + These pages would always be marked supervisor and read-write. + + * The sender attempts to send a message to some arbitrary receiver. If the receiver is not + in a RECEIVE_BLOCKED state induced by attempting to receive a message, the sender enters + a SEND_BLOCKED state until the receiver actually tries to receive a message. + + * The receiver attempt to receive a message from some arbitrary sender. If there are no qualifying + senders in a SEND_BLOCKED state, the receiver enters a RECEIVE_BLOCKED state subject to the above + conditions until a message is sent from a qualifying sender. + + * Once either a receiver in a RECEIVE_BLOCKED state is sent a message from a qualifying sender + or a sender in a SEND_BLOCKED state has its message received by the specified sender, the receiver's + message buffer is mapped into the pages reserved for message IPC in the sender's address space. + The message is then read out of the sender's buffer and into the mapped pages, obeying + any length restrictions the receiver specified. A special optimization case exists for + messages <= 8 bytes of data where the message can be copied solely in 2 registers + and avoid this mapping completely. + + * Both receiver and sender are finally unblocked. + + What happens after the receiver and sender are unblocked is somewhat tricky. Various microkernels +such as QNX switch to the receiver process and allow it to process the request. However, QNX's +interface makes "send" a complex operation that first sends a message then receives a reply in addition +to its "receive" and "reply" operations. If the sender is allowed to continue instead, it can immediately +execute an appropriate receive operation which will give up it's control, therefor achieving the same +level of functionality without a third operation. This could have slight performance hindrances, but +I cannot see glaring ones at this time. This would take combining two simple system calls to achieve +the functionality of QNX's single third, but reduces the number of system calls exported as well +as possibly simplifying implementation. Yet, since mapped pages requires invalidating parts of the TLB, +it could be more speed economical to schedule the receiver upon completion, preventing needless +redumping. Such would require composite IPC operations to be supplied to prevent switching and +the complications of adding them would need to be assessed before considering scheduling +the receiver. + +III. Events + + Events are a buffered, asynchronous form of IPC. At the interface level, an event is simply two +double words - the first usually being the class of the event and the second being some other parameter. +This relation is not enforced in any manner and events can simply be used for buffered quad word messages +if desired. The implementation would possibly work as follows: + + * Every process would have a FIFO buffer storing a fixed number of events. Since events are only + 8 bytes (two dwords), this shouldn't be a problem, and buffers don't need to be extremely large. + Their length could even possibly be configurable in which case a buffer wouldn't be needed + unless events were used at all. + + * The sender attempts to send an event to some arbitrary receiver. If the receiver is not in + a RECEIVE_BLOCKED state induced by attempting to receive a message, the event is placed + into the FIFO buffer, otherwise the event is placed into the receiver's event buffer directly. + In either case, the sender is NOT blocked. + + * The receiver attempts to retrieve an event from some arbitrary sender. If there is no qualifying + event in the FIFO buffer, the receiver is RECEIVE_BLOCKED. As discussed above, the receiver is + unblocked when a qualifying event is sent. + + Deciding which thread is scheduled next is again tricky. Look to the previous discussion under "Messages" +for considerations. + +IV. Blocking + + As outlined above, a process can be in a RECEIVE_BLOCKED state with regard to events and in either a +RECEIVE_BLOCKED state or a SEND_BLOCKED state with regard to messages. Blocking indefinitely, however, +is not always appropriate. To remedy this, one can implement a system call interrupt timer on a per-call +basis or a per-thread basis. + In a per-call scheme, a timer is supplied or not supplied (to block indefinitely) as a parameter +to the IPC operation. The snag here is that every system call must process the timer argument that +wants to allow for blocked states to be interrupted. + In a per-thread scheme, a timer is maintained in every thread and is reset and enabled whenever a process +enters a blocked state as a result of a system call. A system call would be supplied to set the reset +value for this timer. The snag with this scheme is that a sequence of calls which vary widely +in timer values would require many calls to set the value of this timer and a set of IPC calls might +need to be supported which simply return failure (i.e. "try_send", "try_receive") instead of blocking if +the sender/receiver is not ready without resorting to an API call to set the timer reset value to 0. +Having a separate call to set the timer makes it more convenient for complex timer values of more than one +parameter, however. + Beyond message passing operations, two explicitly blocking operations are also required. Firstly, +a system call that blocks until either either an event or message is sent and returns some value +to determine which or error is needed. Lastly, there need be a call to block indefinitely which +can only be interrupted by a timer. The functionality of these could conceivably be combined into a +single call which blocks until any form of IPC is sent from a specified process. Then, a process +could simply wait for IPC from itself. + +V. Miscellaneous Considerations + + * Since messages are sent to processes and not individual threads, many threads within a process + can wait on many messages and many events at once. This could, however, prove hindering if a server + wants to fork off a thread to handle a request. In such cases, providing facilities for managing + IPC ports might be useful so that threads can share or not share ports as they please. Message ports + do, however, add some amount of complexity and are, most likely, not even needed. + + * Later performance requirements could demand composite IPC operations like 'call' and 'service' + that combine send and receive operations and vice versa. This remains to be seen, however. + diff --git a/documentation/makefile b/documentation/makefile new file mode 100644 index 00000000..c10ee7cd --- /dev/null +++ b/documentation/makefile @@ -0,0 +1,11 @@ +# $Id$ + +DSSSL_FILE = /usr/lib/sgml/stylesheet/dsssl/docbook/nwalsh/print/docbook.dsl +TARGETS = coding-standards.pdf filesystem-hierarchy.pdf installation.pdf + +all: $(TARGETS) + +%.pdf: %.sgml + jade -t tex -d $(DSSSL_FILE) $< + pdfjadetex $(*F).tex + rm $(*F).tex diff --git a/documentation/missing b/documentation/missing new file mode 100755 index 00000000..7789652e --- /dev/null +++ b/documentation/missing @@ -0,0 +1,190 @@ +#! /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` + test -z "$files" && files="config.h" + touch_files= + for f in $files; do + case "$f" in + *:*) touch_files="$touch_files "`echo "$f" | + sed -e 's/^[^:]*://' -e 's/:.*//'`;; + *) touch_files="$touch_files $f.in";; + esac + done + touch $touch_files + ;; + + automake) + echo 1>&2 "\ +WARNING: \`$1' is 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$/.in/' | + while read f; do touch "$f"; done + ;; + + 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/documentation/mkinstalldirs b/documentation/mkinstalldirs new file mode 100755 index 00000000..6b3b5fc5 --- /dev/null +++ b/documentation/mkinstalldirs @@ -0,0 +1,40 @@ +#! /bin/sh +# mkinstalldirs --- make directory hierarchy +# Author: Noah Friedman +# Created: 1993-05-16 +# Public domain + +# $Id$ + +errstatus=0 + +for file +do + set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'` + shift + + pathcomp= + for d + do + pathcomp="$pathcomp$d" + case "$pathcomp" in + -* ) pathcomp=./$pathcomp ;; + esac + + if test ! -d "$pathcomp"; then + echo "mkdir $pathcomp" + + mkdir "$pathcomp" || lasterr=$? + + if test ! -d "$pathcomp"; then + errstatus=$lasterr + fi + fi + + pathcomp="$pathcomp/" + done +done + +exit $errstatus + +# mkinstalldirs ends here diff --git a/documentation/physical-memory.txt b/documentation/physical-memory.txt new file mode 100644 index 00000000..6bfb3f90 --- /dev/null +++ b/documentation/physical-memory.txt @@ -0,0 +1,17 @@ +Physical Memory Map +=================== + +Offset | Length | Description +-------+--------+-------------------- + 0 | 4K | GDT/IDT + 4K | 4K | storm TSS + 8K | 8K | storm stack + 16K | 4K | Module names and parameters + 1M | ? | Kernel start + +Also, at 1.5 MB, the data structures for physical page allocation is +located. It consists of a list and a bitmap. Don't think about how +this works. This is the way the chaos operating system does it, and it +works. + +(Thanks to Microsoft for this wording. We owe you!) \ No newline at end of file diff --git a/documentation/protocols.texi b/documentation/protocols.texi new file mode 100644 index 00000000..0a9da31e --- /dev/null +++ b/documentation/protocols.texi @@ -0,0 +1,172 @@ +@settitle chaos Protocols +@node Top +@top Protocols + +$Id$ + + +@menu +* Introduction:: +* Basics:: +* VFS:: +* Keyboard:: +* Console:: +* Graphics:: +@end menu + + +@node Introduction +@chapter Introduction + +This file tries to document all the standard protocols used in a chaos system. Since +chaos evolves very quickly, it might at times be a little outdated. If you feel like there is so, +please notify us. Also, much information will be unfinished, but we'll try to always keep this +documention up to date, since developers of servers for chaos need the information contained +in this document to write servers. + + +@node Basics +@chapter Basics + +All communications between processes are done by sending blocks of dwords +containing the data via the kernel-functions for sending and receiving +messages. The first dword in a command block is always a signed dword +containing the command ID. If the protocol being used acknowledges the command +it should do this by placing the command ID in the first dword of the returned +message, or a negative value if there was an error. This is refered to as +"Standard return" in this file. All string in the command block are padded out +with zeroes to the next integral multiple of 4. + + +@node VFS +@chapter VFS + +All programs and servers in chaos accesses the filesystem hierarchy by +communicating with the VFS-server. This is done by a few simple protocols: + +@table @strong +@item Purpose +@emph{Get detailed information about an entry in the hierarchy.} + +@item Call +@table @strong +@item 0 +@emph{VFS_GET_ENTRY} +@item 1..n +@emph{Path string (length dword padded)} +@item n+1 +@emph{Entry number} +@end table + +@item Return +@table @strong +@item 0 +@emph{Standard return} +@item 1 +@emph{Length of filename in bytes} +@item 2..n +@emph{Filename string} +@item n+1 +@emph{Filesize in bytes} +@item n+2 +@emph{Type} +@end table +@end table + + +@node Keyboard +@chapter Keyboard + +If a program in chaos wants to take input from the keyboard, it sends a message +to the keyboard server registering itself as a receiver of keypresses. + + +@node Console +@chapter Console + +If a program (non-tornado-native) wants to output anything, it first needs to request +a virtual screen from the console-server. There is a few standard protocols for this: + +@table @strong +@item CONSOLE_SCREEN_OPEN - Open a new screen with a specified mode + +@item Call +@table @strong +@item dword 0 +@emph{CONSOLE_SCREEN_OPEN} +@item dword 1 +@emph{Mode (0 = text / 1 = graphic)} +@item dword 2 +@emph{Width of screen (characters / pixels)} +@item dword 3 +@emph{Height of screen (characters / pixels} +@item dword 4 +@emph{BPP (bits per pixel)} +@end table + +@item Return +@table @strong +@item dword 0 +@emph{Standard return} +@item dword 1 +@emph{Linear pointer where program is allowed to map screen buffer} +@item dword 2 +@emph{Physical pointer to screen buffer} +@end table + +@end table + + +@table @strong +@item CONSOLE_CHANGE - Change active console + +@item Call +@table @strong +@item dword 0 +@emph{CONSOLE_CHANGE} +@item dword 1 +@emph{Pid owning console to change to} +@end table + +@item Return +@table @strong +@item dword 0 +@emph{Standard return} +@end table + +@end table + + +@node Graphics +@chapter Graphics + +Although you'll have a server for each graphic-card, the will all use the same +standard protocol to communicate. Constants are defined in graphics.h in the +chaos-standard-headers package. + +@table @strong +@item GRAPHICS_MODE_CHANGE - Change current videmode + +@item Call +@table @strong +@item dword 0 +@emph{GRAPHICS_MODE_CHANGE} +@item dword 1 +@emph{Type of mode (0 = text / 1 = graphic) (textmode may not be supported on all cards / platforms)} +@item dword 2 +@emph{Width of screen (characters / pixels)} +@item dword 3 +@emph{Height of screen (characters / pixels)} +@item dword 4 +@emph{BPP (bits per pixel)} +@end table + +@item Return +@table @strong +@item dword 0 +@emph{Standard return} +@item dword 1 +@emph{Physical pointer to framebuffer} +@end table + +@end table diff --git a/documentation/server-architecture.texi b/documentation/server-architecture.texi new file mode 100644 index 00000000..42ba31b4 --- /dev/null +++ b/documentation/server-architecture.texi @@ -0,0 +1,114 @@ +@settitle The chaos Architecture +@node Top +@top The chaos Architecture + +The chaos Architecture + +$Id$ + +Copyright 1999 chaos development + +@menu +* Prologue:: +* The Microkernel:: +* Overview of the Server Architecture:: +* Client-Server Communication:: +@end menu + +@node Prologue +@chapter Prologue + +In this document, we (chaos development) describe how the chaos system will +work. All of this is not written yet, but most of the kernel is finished and +we're starting slowly to write some basic servers. If you feel you want to +help, please contact us. You will find contact information at our website, +@url{http://www.chaosdev.org/}. + +@node The Microkernel +@chapter The Microkernel + +chaos is a microkernelbased operating system. This means that as much as +possible has been removed from the kernel. This design has several advantages +to traditional monolithic systems (like Linux and *BSD). The most important +(in our opinion, of course) is that it is easier to separate drivers from each +other. If, for example, you suddenly feel like you need IPv6 support, support +for this protocol can easily be added without the need of rebooting or even +recompiling anything. Our opinion is that only programmers should need to have +a compiler installed. + +Our microkernel, called @emph{storm}, contains only the following:: + +@table @samp +@item IRQ management +@item Exception handling +@item Task switching (commonly called multitasking, but that is not true in non-SMP systems) +@item Process startup and stopping +@item Thread support +@item Advanced scheduler with support for priorities and threads +@item DMA support (this is not written yet, please contact us if you want to volunteer) +@item Interprocess communication (IPC) +@item Memory and I/O-port protection +@item Paging (virtual memory) +@end table + +As you can see, there are no hardware drivers, no networking, no graphics +code; hardly anything. This makes the kernel extremely small (~15K for the +moment, in compressed format), but still features the things necessary to +load other modules. + +@node Overview of the Server Architecture +@chapter Overview of the Server Architecture + +A @dfn{server} in chaos terminology is what most other operating systems refer +to as a @dfn{driver} or a @dfn{module}. The reason we call it @dfn{server} is +simply because this is what it is; it is not just a bunch of code. The +difference from most other systems is that a server isn't any more privileged +than a regular user process (well, actually, it is, but it's not at all as +privileged as the kernel, even though administratory rights are required to +start a server). This means that a server cannot just read and write from the +memory and/or I/O ports it wants as in traditional, older systems. In chaos, +you have to first @dfn{register} the I/O port(s) and/or IRQ(s) you want the +server to use, and @emph{then} you will be able to use it/them, +@emph{if, and only if} the I/O port(s) and/or IRQ(s) was not used by a +previously started server. This, in combination with the memory protection +mechanisms chaos uses to separate all processes, makes it virtually impossible +for a server to bring the computer down. This makes a chaos system stable and +robust. And what's best of it all: it doesn't make the system noticeably +slower than a regular, non-protected system! + +Technically speaking, this is accomplished by running all kernel code +(syscalls and bootup initialization) in privilige level (PL) zero, servers and +regular user processes in PL 3. This makes it impossible for an ordinary user +process to access the hardware, and still allows the servers to use the +port(s) and stuff it needs if it was able to allocate it. Several syscalls +that are not available for ordinary user processes are available for the +servers. The kernel separates servers from other processes by having an +internal flag for every process indicating the process' type. + +@node Client-Server Communication +@chapter Client-Server Communication + +All communication between servers and regular processes (referred to as +@dfn{clients} in this chapter) is done by means of the +syscall_message_send () and syscall_message_receive () system calls. The format +of the data is highly standardized and follows these simple rules: + +Structure for IPC + +@table @samp +@item 1 dword +Command ID. This is the command ID, and is specific for each server. This is +used by the server to decode the data passed. +@item 1 dword +Length of data in @emph{this} block. It should be noted that in one message, +multiple command blocks can be put together in a single packet. This ensures +high performance, since you do not have to do a system call for each +operation. The server may then split the operations contained in one message +and schedule the operations between processes in a fair way to prevent long +wait-times for processes. +@item data +This is individual for each command ID the server takes and it's length is +specified by the previous dword. +@item ... +Repeats until the length of the packet is reached. +@end table diff --git a/documentation/the_chaos_programming_reference_manual.texi b/documentation/the_chaos_programming_reference_manual.texi new file mode 100644 index 00000000..494b0546 --- /dev/null +++ b/documentation/the_chaos_programming_reference_manual.texi @@ -0,0 +1,274 @@ +@settitle The chaos Programming Reference Manual +@node Top +@top The chaos Programming Reference Manual + +$Id$ + +Copyright 1999 chaos development. This document can be used under the +terms of the GPL, version 2 or (at your option) any later version. But +please, please use a different name in derivative works. + +Version 0.0.1. Please note that this is work in progress; don't treat +this as a finished manual, for it is not. + +@menu +* Introduction:: What's all this about? +* Chapter 1:: The Kernel API +* Chapter 2:: The chaos Libraries +* Chapter 3:: Error numbers +@end menu + +@node Introduction +@chapter What's all this about? + +This is The chaos Programming Reference Manual. It describes how the +Kernel API and the chaos Libraries (will) work. It is not a programming +tutorial, but it will probably be pretty helpful for those of you who +have been programming for other systems earlier. Since chaos is pretty +different to what most of you likely are used to, we will focus on the +differences; hence, knowledge of programming for (for example) Linux or +other Unix systems will be desirable (but not required). + +This reference is split up into two parts: first, the kernel; then, the +user libraries. The kernel interface shouldn't be used by most programs, +but we felt like documenting it anyway, so that we won't forget how it +works. The user libraries are very unfinished yet (only the console +library has been written, actually). Please don't be afraid to help us +if you like to. + +@node Chapter 1 +@chapter The Kernel API + +First, a very important thing to note. Our inline function in +system/system_calls.h all push their input variables onto the +stack. Thus, if you use local variables and pass them into the system +calls, you must @emph{not} use -fomit-frame-pointer. It @emph{will} +generate invalid code. Trust me on this; we spent quite some time on +debugging this... + +The Kernel API consists of the following functions: + +@deffn Function dword syscall_read_timer (void) +Reads the number of ticks since the system last was rebooted. The number +of clock ticks... can not be determined right now. Wait for the +kernelfs. But OTOH, this system call will probably be removed and +replaced by an entry there... +@end deffn + +@deffn Function void syscall_log (char *s) +Prints a message to the logging facilities. Currently, it just prints it +to the screen (prepending the server name and appending a newline), but +a log server will be written shortly which will make this obsolete. +@end deffn + +@deffn Function dword syscall_register_irq (dword irq, void (*b)(void)) +Register an IRQ handler for the given IRQ. This can only be done by a +server. It will enable the interrupt in the interrupt controller, and +set up the interrupt as a separate task (it's like a hybrid-thread which +never gets scheduled). +@end deffn + +@deffn Function dword syscall_register_port (dword base, dword num) +Registers a port range for usage by the server (not available to regular +programs). Please note that by default, no port access is allowed, so if +a server needs to probe a region, it must firt allocate it (and perhaps +later deallocate it if neccessary) +@end deffn + +@deffn Function dword syscall_mmap (pid_type pid, dword linear_page, dword physical_page, dword pages) +This maps the physical pages specified at the linear page address given +for the given pid. Right now, no security checks are done @emph{at all}, +so please be careful when using this call. This will be fixed as soon as +we think it's neccessary. +@end deffn + +@deffn Function thread_type syscall_thread (void) +This creates a new thread for the current process. The returned value is +the number of the thread in the old thread, and zero in the new thread. +@end deffn + +@deffn Function error_type syscall_process_control (pid_type pid, dword class, dword parameter) +This changes the state of a process. The classes are defined in +process.h, and are as follows: +@end deffn + +@deffn Class PROCESS_TERMINATE +Tells the kernel to kill the process unconditionally. +@end deffn + +@deffn Class PROCESS_SUSPEND +Suspend a process until resumed by PROCESS_RESUME. +@end deffn + +@deffn Class PROCESS_RESUME +Resumes a process suspended with PROCESS_SUSPEND. +@end deffn + +@deffn Class PROCESS_SLEEP +Puts a process to sleep for a user specified amount of time. +@end deffn + +@deffn Function error_type syscall_set_name (char *name) +Sets the process name. This is used as a primitive form of name-space in +conjunction with the next function. +@end deffn + +@deffn Function pid_type syscall_get_pid_by_name (char *name) +Returns the pid number of the process with the given name. +@end deffn + +@node Chapter 2 +@chapter The chaos Libraries + +@menu +* Section 2.1:: Why not just POSIX? +* Section 2.1.5:: About return values +* Section 2.2:: The file library (library_file) +* Section 2.3:: The tornado library (library_tornado) +* Section 2.4:: The graphics library (library_graphics) +* Section 2.5:: The console I/O library (library_console) +* Section 2.6:: The network library (library_network) +* Section 2.7:: The memory library (library_memory) +* Appendix A:: ACL (Access Control Limits) +@end menu + +@node Section 2.1 +@section Why not just POSIX? + +First, POSIX is not freely available. Thus, supporting it without paying +money gets difficult. Second, POSIX doesn't really fit into the chaos +philosophy. We don't like abbreviations, for example. Therefore, we decided +to go our own way. However, to make porting of foreign programs easy in +the beginning, we will also port a regular C library (probably glibc). It +is to be clearly marked that using this library for new programs is strongly +discouraged. Only use it if your program must be portable. + +@node Section 2.1.5 +@section About return values. + +In the chaos libraries, we @emph{always} use return_type for functions, +except in the cases where the function can not fail. (Very seldom, but +'random' is such an example. It is not dependant on any external factors) + +We do not use the errno approach at all, since it is very poor. + +@node Section 2.2 +@section The file library (library_file) + +@deffn Function file_handle_type file_open (u8 *@var{file}) +Opens the given file name and associates it with a file handle (which is used +when communicating to the VFS server). If the file does not exist, an error +will be returned. +@end deffn + +@deffn Function error_type file_close (file_handle_type @var{file}) +Closes the given file handle. +@end deffn + +@deffn Function error_type file_write (file_handle_type @var{file}, void *@var{data}, dword @var{size}) +Writes @var{size} bytes of the data block located at @var{data} to the file +handle associated with @var{file}. +@end deffn + +@deffn Function error_type file_read (file_handle_type @var{file}, void *@var{data}, dword @var{size}) +Reads up to @var{size} bytes to @var{data} from the file handle associated with +@var{file}. +@end deffn + +@deffn Function error_type file_create (u8 *@var{name}) +Creates a file with @var{name} as its full name (including path). Per default, +the file will be unaccessible by everybody but the owner; this may later be +changed by the @code{file_permissions_*} group of functions described later. +@end deffn + +@deffn Function error_type file_permissions_delete_rule (u8 *@var{name}, acl_type @var{acl}) +Deletes an ACL rule to the given file. Returns an error if this can't be done. +@end deffn + +@deffn Function error_type file_permissions_add_rule (u8 *@var{name}, acl_type @var{acl}) +Adds an ACL rule to the given file. Returns an error if this can't be done. +@end deffn + +TODO: More ACL stuff, do error number stuff. + +@node Section 2.3 +@section The tornado library (library_tornado) + +@node Section 2.4 +@section The graphics library (library_graphics) + +@node Section 2.5 +@section The console I/O library (library_console) + +@deffn Function void console_print (u8 *@var{string}) +Prints @var{string} to the terminal owned by the program. +@end deffn + +@deffn Function error_type console_print_formatted (u8 *@var{format_string}, ...) +Prints @var{format_string}, replacing the type identifiers given +with the parameters added to the function call. The syntax is identical to +the ordinary ISO C @code{printf} function. +@end deffn + +@deffn Function error_type console_clear (void) +Clears the current console. +@end deffn + +@deffn Function error_type console_cursor_move (int @var{x}, int @var{y}) +Move the cursor to the given position. +@end deffn + +@deffn Function error_type console_cursor_get_position (int *@var{x}, int *@var{y}) +Get the current cursor position. +@end deffn + +@deffn Function key_type console_key_wait (void) +Waits for a keypress and returns its keycode. The key codes are in standard +BIOS format. (????) +@end deffn + +@deffn Function key_type console_key_check (void) +Checks if a keypress has been made. If so, the key code is returned. +Otherwise, KEY_ERROR is returned. +@end deffn + +@node Section 2.6 +@section The network library (library_network) + +@deffn Function socket_type network_open (protocol_type @var{protocol}, void *@var{parameters}) +Opens a network socket of type @var{protocol}. Some network protocols require +additional parameters; if so, those are passed in @var{parameters}. +@end deffn + +@deffn Function error_type network_close (socket_type @var{socket}) +Closes the socket associated with @var{socket}. +@end deffn + +@node Section 2.7 +@section The memory library (library_memory) + +@deffn Function void *memory_allocate (dword size) +Allocates @var{size} bytes of contigous memory. If, for some very strange +reason, no memory can be allocated, returns NULL. Otherwise, returns a +pointer to the memory area. +@end deffn + +@deffn Function error_type memory_deallocate (void *@var{block}) +Deallocates the memory block given in @var{block}. If the memory can't be +deallocated, returns the error code ERROR_NO_MEMORY. Otherwise, returns +SUCCESS. +@end deffn + +@node Appendix A +@section Access Control Limits + +TODO: Write about this. + +@node Chapter 3 +@chapter Error numbers + +@deffn Macro ERROR_NO_MEMORY +No memory available. The system cannot allocate more virtual memory because +its capacity is full. +@end deffn + diff --git a/documentation/tornado-proposal b/documentation/tornado-proposal new file mode 100644 index 00000000..05bedf0f --- /dev/null +++ b/documentation/tornado-proposal @@ -0,0 +1,86 @@ +tornado proposal version 0.2. copyright 1999 chaos development. + + introduction +-------------- + +tornado is an graphical user interface (gui) written for the operating +system chaos. it uses the mechanisms provided by the microkernel storm +for interprocess communication and threadhandling. it is/should be +developed with the keywords flexibility and modularity in mind. +tornado is a ordinary user process, not a server. + + + initialisation of tornado +--------------------------- + +* open the /config/tornado/configuration file. +* try to find the default videomode (many modes may be listed and switched + between later). could be overridden by a parameter. + XXX: create a protocol for the graphicsserver to allow it to return + all available modes. +* send a message to the console-server requesting a screen with the mode. +* find the mouse-device in the configuration-file. could be overridden by + a parameter. +* start a thread to handle the mouse. + XXX: this means telling the mouse server (determined by it's servicefile) + to send mouse updates to this thread. but how do we specify which + thread it is? +* start a thread to handle the keyboard. +* register tornado as a receiver of both mouse-events and keyboard-events to + the selected servers. +* start a thread that does the syscall_message_receive and handles messages on + arrival. these events can be from the programs running under tornado + or from other processes wanting to communicate for some + reason. signals are also + handled by this thread. +* execute the programs listed in /config/tornado/startup-programs. +* put one of the started programs in focus (determined from the configuration + file). +* kill the tornado main/startup thread. + + + libraries +----------- + +tornado is dynamically linked to shared libraries. these are, for +example: + +* window +* menu +* language +* button +* font +* etc... + +these libraries contains functions for drawing and managing windows, +dialog-boxes, menus and stuff like that. they are of course replacable +during runtime of tornado. + +all tornado programs will be linked to the library_tornado +library. this library is responsible for registering objects to +tornado in terms of sending a message to tornado. the tornado +mouse-handling thread checks these objects when receiving a +mouse-click or other action from the mouse. if it founds an object at +the current mouse-position, it sends the program a message containing +which object was clicked. all keypresses tornado receives is also sent +to the program in focus. some keypresses/combinations is interpreted +by tornado as described in the configuration. an example is for +example alt+tab which can be used to change program in focus. + + + objects +--------- + +tornado provides all necessary objects needed for all programs. These are: + +type (what is specified on registration) + +* button (name, size, position and text) +* textbox + + epilogue +---------- + +This is just a proposal, and nothing is decided yet. Lets keep up the +discussion and find problems, if they exist, before they prove to +exist the hard way. diff --git a/documentation/virtual-memory.txt b/documentation/virtual-memory.txt new file mode 100644 index 00000000..8aad5fd5 --- /dev/null +++ b/documentation/virtual-memory.txt @@ -0,0 +1,42 @@ +virtual-memory.txt ($Id$) +================== + +Layout of the linear address-space for a task +============================================= + + Start | Length | Description +-----------------+-------------+------------- + 4K | 4K | Process pagedirectory. + 8K | 4K | Exception TSS:es. + 32K | 8K | Temporary mapped data. + 40K | 4K | Kernel TSS. + 44K | 4K | GDT/IDT. + 1M | ? | Kernel code and data. + 3M | 1M | Process code and data. Used by process_create. + 4M | 28M | Process' low-level memory allocation + | | structures. + 32M | 4M | Process' pagetables. + 36M | 4M | Process data. Parameters and other info. + 40M | SIZE_GLOBAL | Global data area. Hifi-eslöf, ports, etc... + 40M+SIZE_GLOBAL | ? | Free (process data and code). + -64M | 64M | Stack (bottom page is PL0). + + +Format of the global memory space +================================= + + Offset | Length | Description +--------+-------------------+------------- + 0M | 40M | hifi-eslöf structures. + 40M | The rest | Kernel data. + + +Note +==== + +There is also shared memory, which is a window in a process' address +space mapping the same physical pages as mapped in another +process. Through this space, the processes can communicate. This is +used when large datastructures is to be transfered between +processes. An ordinary mailbox is often used to synchronize the +transfers. diff --git a/libraries/AUTHORS b/libraries/AUTHORS new file mode 100644 index 00000000..e90217cf --- /dev/null +++ b/libraries/AUTHORS @@ -0,0 +1,6 @@ +AUTHORS ($Id$) +======= + +* Per Lundberg +* Henrik Hallin +* Martin Alvarez diff --git a/libraries/COPYING b/libraries/COPYING new file mode 100644 index 00000000..c4792dd2 --- /dev/null +++ b/libraries/COPYING @@ -0,0 +1,515 @@ + + GNU LESSER GENERAL PUBLIC LICENSE + Version 2.1, February 1999 + + Copyright (C) 1991, 1999 Free Software Foundation, Inc. + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + +[This is the first released version of the Lesser GPL. It also counts + as the successor of the GNU Library Public License, version 2, hence + the version number 2.1.] + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +Licenses are intended to guarantee your freedom to share and change +free software--to make sure the software is free for all its users. + + This license, the Lesser General Public License, applies to some +specially designated software packages--typically libraries--of the +Free Software Foundation and other authors who decide to use it. You +can use it too, but we suggest you first think carefully about whether +this license or the ordinary General Public License is the better +strategy to use in any particular case, based on the explanations +below. + + When we speak of free software, we are referring to freedom of use, +not price. Our General Public Licenses are designed to make sure that +you have the freedom to distribute copies of free software (and charge +for this service if you wish); that you receive source code or can get +it if you want it; that you can change the software and use pieces of +it in new free programs; and that you are informed that you can do +these things. + + To protect your rights, we need to make restrictions that forbid +distributors to deny you these rights or to ask you to surrender these +rights. These restrictions translate to certain responsibilities for +you if you distribute copies of the library or if you modify it. + + For example, if you distribute copies of the library, whether gratis +or for a fee, you must give the recipients all the rights that we gave +you. You must make sure that they, too, receive or can get the source +code. If you link other code with the library, you must provide +complete object files to the recipients, so that they can relink them +with the library after making changes to the library and recompiling +it. And you must show them these terms so they know their rights. + + We protect your rights with a two-step method: (1) we copyright the +library, and (2) we offer you this license, which gives you legal +permission to copy, distribute and/or modify the library. + + To protect each distributor, we want to make it very clear that +there is no warranty for the free library. Also, if the library is +modified by someone else and passed on, the recipients should know +that what they have is not the original version, so that the original +author's reputation will not be affected by problems that might be +introduced by others. +^L + Finally, software patents pose a constant threat to the existence of +any free program. We wish to make sure that a company cannot +effectively restrict the users of a free program by obtaining a +restrictive license from a patent holder. Therefore, we insist that +any patent license obtained for a version of the library must be +consistent with the full freedom of use specified in this license. + + Most GNU software, including some libraries, is covered by the +ordinary GNU General Public License. This license, the GNU Lesser +General Public License, applies to certain designated libraries, and +is quite different from the ordinary General Public License. We use +this license for certain libraries in order to permit linking those +libraries into non-free programs. + + When a program is linked with a library, whether statically or using +a shared library, the combination of the two is legally speaking a +combined work, a derivative of the original library. The ordinary +General Public License therefore permits such linking only if the +entire combination fits its criteria of freedom. The Lesser General +Public License permits more lax criteria for linking other code with +the library. + + We call this license the "Lesser" General Public License because it +does Less to protect the user's freedom than the ordinary General +Public License. It also provides other free software developers Less +of an advantage over competing non-free programs. These disadvantages +are the reason we use the ordinary General Public License for many +libraries. However, the Lesser license provides advantages in certain +special circumstances. + + For example, on rare occasions, there may be a special need to +encourage the widest possible use of a certain library, so that it +becomes +a de-facto standard. To achieve this, non-free programs must be +allowed to use the library. A more frequent case is that a free +library does the same job as widely used non-free libraries. In this +case, there is little to gain by limiting the free library to free +software only, so we use the Lesser General Public License. + + In other cases, permission to use a particular library in non-free +programs enables a greater number of people to use a large body of +free software. For example, permission to use the GNU C Library in +non-free programs enables many more people to use the whole GNU +operating system, as well as its variant, the GNU/Linux operating +system. + + Although the Lesser General Public License is Less protective of the +users' freedom, it does ensure that the user of a program that is +linked with the Library has the freedom and the wherewithal to run +that program using a modified version of the Library. + + The precise terms and conditions for copying, distribution and +modification follow. Pay close attention to the difference between a +"work based on the library" and a "work that uses the library". The +former contains code derived from the library, whereas the latter must +be combined with the library in order to run. +^L + GNU LESSER GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License Agreement applies to any software library or other +program which contains a notice placed by the copyright holder or +other authorized party saying it may be distributed under the terms of +this Lesser General Public License (also called "this License"). +Each licensee is addressed as "you". + + A "library" means a collection of software functions and/or data +prepared so as to be conveniently linked with application programs +(which use some of those functions and data) to form executables. + + The "Library", below, refers to any such software library or work +which has been distributed under these terms. A "work based on the +Library" means either the Library or any derivative work under +copyright law: that is to say, a work containing the Library or a +portion of it, either verbatim or with modifications and/or translated +straightforwardly into another language. (Hereinafter, translation is +included without limitation in the term "modification".) + + "Source code" for a work means the preferred form of the work for +making modifications to it. For a library, complete source code means +all the source code for all modules it contains, plus any associated +interface definition files, plus the scripts used to control +compilation +and installation of the library. + + Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running a program using the Library is not restricted, and output from +such a program is covered only if its contents constitute a work based +on the Library (independent of the use of the Library in a tool for +writing it). Whether that is true depends on what the Library does +and what the program that uses the Library does. + + 1. You may copy and distribute verbatim copies of the Library's +complete source code as you receive it, in any medium, provided that +you conspicuously and appropriately publish on each copy an +appropriate copyright notice and disclaimer of warranty; keep intact +all the notices that refer to this License and to the absence of any +warranty; and distribute a copy of this License along with the +Library. + + You may charge a fee for the physical act of transferring a copy, +and you may at your option offer warranty protection in exchange for a +fee. + + 2. You may modify your copy or copies of the Library or any portion +of it, thus forming a work based on the Library, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) The modified work must itself be a software library. + + b) You must cause the files modified to carry prominent notices + stating that you changed the files and the date of any change. + + c) You must cause the whole of the work to be licensed at no + charge to all third parties under the terms of this License. + + d) If a facility in the modified Library refers to a function or a + table of data to be supplied by an application program that uses + the facility, other than as an argument passed when the facility + is invoked, then you must make a good faith effort to ensure that, + in the event an application does not supply such function or + table, the facility still operates, and performs whatever part of + its purpose remains meaningful. + + (For example, a function in a library to compute square roots has + a purpose that is entirely well-defined independent of the + application. Therefore, Subsection 2d requires that any + application-supplied function or table used by this function must + be optional: if the application does not supply it, the square + root function must still compute square roots.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Library, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Library, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote +it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Library. + +In addition, mere aggregation of another work not based on the Library +with the Library (or with a work based on the Library) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may opt to apply the terms of the ordinary GNU General Public +License instead of this License to a given copy of the Library. To do +this, you must alter all the notices that refer to this License, so +that they refer to the ordinary GNU General Public License, version 2, +instead of to this License. (If a newer version than version 2 of the +ordinary GNU General Public License has appeared, then you can specify +that version instead if you wish.) Do not make any other change in +these notices. +^L + Once this change is made in a given copy, it is irreversible for +that copy, so the ordinary GNU General Public License applies to all +subsequent copies and derivative works made from that copy. + + This option is useful when you wish to copy part of the code of +the Library into a program that is not a library. + + 4. You may copy and distribute the Library (or a portion or +derivative of it, under Section 2) in object code or executable form +under the terms of Sections 1 and 2 above provided that you accompany +it with the complete corresponding machine-readable source code, which +must be distributed under the terms of Sections 1 and 2 above on a +medium customarily used for software interchange. + + If distribution of object code is made by offering access to copy +from a designated place, then offering equivalent access to copy the +source code from the same place satisfies the requirement to +distribute the source code, even though third parties are not +compelled to copy the source along with the object code. + + 5. A program that contains no derivative of any portion of the +Library, but is designed to work with the Library by being compiled or +linked with it, is called a "work that uses the Library". Such a +work, in isolation, is not a derivative work of the Library, and +therefore falls outside the scope of this License. + + However, linking a "work that uses the Library" with the Library +creates an executable that is a derivative of the Library (because it +contains portions of the Library), rather than a "work that uses the +library". The executable is therefore covered by this License. +Section 6 states terms for distribution of such executables. + + When a "work that uses the Library" uses material from a header file +that is part of the Library, the object code for the work may be a +derivative work of the Library even though the source code is not. +Whether this is true is especially significant if the work can be +linked without the Library, or if the work is itself a library. The +threshold for this to be true is not precisely defined by law. + + If such an object file uses only numerical parameters, data +structure layouts and accessors, and small macros and small inline +functions (ten lines or less in length), then the use of the object +file is unrestricted, regardless of whether it is legally a derivative +work. (Executables containing this object code plus portions of the +Library will still fall under Section 6.) + + Otherwise, if the work is a derivative of the Library, you may +distribute the object code for the work under the terms of Section 6. +Any executables containing that work also fall under Section 6, +whether or not they are linked directly with the Library itself. +^L + 6. As an exception to the Sections above, you may also combine or +link a "work that uses the Library" with the Library to produce a +work containing portions of the Library, and distribute that work +under terms of your choice, provided that the terms permit +modification of the work for the customer's own use and reverse +engineering for debugging such modifications. + + You must give prominent notice with each copy of the work that the +Library is used in it and that the Library and its use are covered by +this License. You must supply a copy of this License. If the work +during execution displays copyright notices, you must include the +copyright notice for the Library among them, as well as a reference +directing the user to the copy of this License. Also, you must do one +of these things: + + a) Accompany the work with the complete corresponding + machine-readable source code for the Library including whatever + changes were used in the work (which must be distributed under + Sections 1 and 2 above); and, if the work is an executable linked + with the Library, with the complete machine-readable "work that + uses the Library", as object code and/or source code, so that the + user can modify the Library and then relink to produce a modified + executable containing the modified Library. (It is understood + that the user who changes the contents of definitions files in the + Library will not necessarily be able to recompile the application + to use the modified definitions.) + + b) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (1) uses at run time a + copy of the library already present on the user's computer system, + rather than copying library functions into the executable, and (2) + will operate properly with a modified version of the library, if + the user installs one, as long as the modified version is + interface-compatible with the version that the work was made with. + + c) Accompany the work with a written offer, valid for at + least three years, to give the same user the materials + specified in Subsection 6a, above, for a charge no more + than the cost of performing this distribution. + + d) If distribution of the work is made by offering access to copy + from a designated place, offer equivalent access to copy the above + specified materials from the same place. + + e) Verify that the user has already received a copy of these + materials or that you have already sent this user a copy. + + For an executable, the required form of the "work that uses the +Library" must include any data and utility programs needed for +reproducing the executable from it. However, as a special exception, +the materials to be distributed need not include anything that is +normally distributed (in either source or binary form) with the major +components (compiler, kernel, and so on) of the operating system on +which the executable runs, unless that component itself accompanies +the executable. + + It may happen that this requirement contradicts the license +restrictions of other proprietary libraries that do not normally +accompany the operating system. Such a contradiction means you cannot +use both them and the Library together in an executable that you +distribute. +^L + 7. You may place library facilities that are a work based on the +Library side-by-side in a single library together with other library +facilities not covered by this License, and distribute such a combined +library, provided that the separate distribution of the work based on +the Library and of the other library facilities is otherwise +permitted, and provided that you do these two things: + + a) Accompany the combined library with a copy of the same work + based on the Library, uncombined with any other library + facilities. This must be distributed under the terms of the + Sections above. + + b) Give prominent notice with the combined library of the fact + that part of it is a work based on the Library, and explaining + where to find the accompanying uncombined form of the same work. + + 8. You may not copy, modify, sublicense, link with, or distribute +the Library except as expressly provided under this License. Any +attempt otherwise to copy, modify, sublicense, link with, or +distribute the Library is void, and will automatically terminate your +rights under this License. However, parties who have received copies, +or rights, from you under this License will not have their licenses +terminated so long as such parties remain in full compliance. + + 9. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Library or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Library (or any work based on the +Library), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Library or works based on it. + + 10. Each time you redistribute the Library (or any work based on the +Library), the recipient automatically receives a license from the +original licensor to copy, distribute, link with or modify the Library +subject to these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties with +this License. +^L + 11. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Library at all. For example, if a patent +license would not permit royalty-free redistribution of the Library by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Library. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply, and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 12. If the distribution and/or use of the Library is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Library under this License +may add an explicit geographical distribution limitation excluding those +countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 13. The Free Software Foundation may publish revised and/or new +versions of the Lesser General Public License from time to time. +Such new versions will be similar in spirit to the present version, +but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Library +specifies a version number of this License which applies to it and +"any later version", you have the option of following the terms and +conditions either of that version or of any later version published by +the Free Software Foundation. If the Library does not specify a +license version number, you may choose any version ever published by +the Free Software Foundation. +^L + 14. If you wish to incorporate parts of the Library into other free +programs whose distribution conditions are incompatible with these, +write to the author to ask for permission. For software which is +copyrighted by the Free Software Foundation, write to the Free +Software Foundation; we sometimes make exceptions for this. Our +decision will be guided by the two goals of preserving the free status +of all derivatives of our free software and of promoting the sharing +and reuse of software generally. + + NO WARRANTY + + 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO +WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. +EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR +OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY +KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE +LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME +THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN +WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY +AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU +FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR +CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE +LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING +RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A +FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF +SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES. + + END OF TERMS AND CONDITIONS +^L + How to Apply These Terms to Your New Libraries + + If you develop a new library, and you want it to be of the greatest +possible use to the public, we recommend making it free software that +everyone can redistribute and change. You can do so by permitting +redistribution under these terms (or, alternatively, under the terms +of the ordinary General Public License). + + To apply these terms, attach the following notices to the library. +It is safest to attach them to the start of each source file to most +effectively convey the exclusion of warranty; and each file should +have at least the "copyright" line and a pointer to where the full +notice is found. + + + + Copyright (C) + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +Also add information on how to contact you by electronic and paper +mail. + +You should also get your employer (if you work as a programmer) or +your +school, if any, to sign a "copyright disclaimer" for the library, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the + library `Frob' (a library for tweaking knobs) written by James +Random Hacker. + + , 1 April 1990 + Ty Coon, President of Vice + +That's all there is to it! + + diff --git a/libraries/INSTALL b/libraries/INSTALL new file mode 100644 index 00000000..86cd094b --- /dev/null +++ b/libraries/INSTALL @@ -0,0 +1,21 @@ +INSTALL ($Id$) +======= + +Right now, setting up the chaos system is not very easy. We are well +aware of this, but we have been forced to oversee it for now -- if the +code does not work, it is not of much use to be able to install it. + +Still, you should be able to do something like this: + + make configure + make install + +(This will copy the compiled libraries to some different directories +under the path you've chosen as prefix) + +Well, that should be it. If everything works out fine, you should be +able to link chaos programs to those libraries. We hope to make the +process of setting up chaos a lot easier in the future. For now, happy +hacking! + +-- Per Lundberg Mon, 10 Apr 2000 08:50:54 +0200 \ No newline at end of file diff --git a/libraries/README b/libraries/README new file mode 100644 index 00000000..60b148fb --- /dev/null +++ b/libraries/README @@ -0,0 +1,18 @@ +README ($Id$) +====== + +This is the chaos libraries. They are required to compile the servers, +and eventually to compile virtually any chaos program. + +They are *not* licensed under the GPL, but under the Lesser General +Public License (LGPL), since we want people to be able to write +non-GPL:ed free software for chaos (for example, BSD-licensed +programs). This also makes it possible to develop proprietary software +for chaos, which we do not encourage people to do, but nevertheless +accept *if* they choose to do so. Please see the file COPYING for more +information about this. + +(You can read more about the licensing of chaos on +http://www.chaosdev.org/legal.shtml) + +-- Per Lundberg Fri, 21 Jul 2000 18:52:00 +0200 diff --git a/libraries/TODO b/libraries/TODO new file mode 100644 index 00000000..dc283ce0 --- /dev/null +++ b/libraries/TODO @@ -0,0 +1,7 @@ +TODO ($Id$) +==== + +* ipc: Support closing connections. network: Support for binding +* sockets, and also listening and sending data. pci: Make it +* work. Support finding of I/O ranges, etc, and also bus mastering + when we have shared memory proper in the kernel. diff --git a/libraries/chaos.ld b/libraries/chaos.ld new file mode 100644 index 00000000..8c4dc6ad --- /dev/null +++ b/libraries/chaos.ld @@ -0,0 +1,154 @@ +/* $Id$ */ +/* Abstract: chaos linker script. */ +/* Author: Per Lundberg */ + +/* Copyright 1999-2000 chaos development. */ + +/* This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public License + as published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + USA. */ + +OUTPUT_FORMAT("elf32-i386", "elf32-i386", + "elf32-i386") +OUTPUT_ARCH(i386) +ENTRY(startup) +SEARCH_DIR(/mnt/chaos/programming/libraries/static); + +SECTIONS +{ + /* Read-only sections, merged into text segment: */ + + . = 0x40000000 + SIZEOF_HEADERS; + .interp : { *(.interp) } + .hash : { *(.hash) } + .dynsym : { *(.dynsym) } + .dynstr : { *(.dynstr) } + .gnu.version : { *(.gnu.version) } + .gnu.version_d : { *(.gnu.version_d) } + .gnu.version_r : { *(.gnu.version_r) } + .rel.text : + { *(.rel.text) *(.rel.gnu.linkonce.t*) } + .rela.text : + { *(.rela.text) *(.rela.gnu.linkonce.t*) } + .rel.data : + { *(.rel.data) *(.rel.gnu.linkonce.d*) } + .rela.data : + { *(.rela.data) *(.rela.gnu.linkonce.d*) } + .rel.rodata : + { *(.rel.rodata) *(.rel.gnu.linkonce.r*) } + .rela.rodata : + { *(.rela.rodata) *(.rela.gnu.linkonce.r*) } + .rel.got : { *(.rel.got) } + .rela.got : { *(.rela.got) } + .rel.ctors : { *(.rel.ctors) } + .rela.ctors : { *(.rela.ctors) } + .rel.dtors : { *(.rel.dtors) } + .rela.dtors : { *(.rela.dtors) } + .rel.init : { *(.rel.init) } + .rela.init : { *(.rela.init) } + .rel.fini : { *(.rel.fini) } + .rela.fini : { *(.rela.fini) } + .rel.bss : { *(.rel.bss) } + .rela.bss : { *(.rela.bss) } + .rel.plt : { *(.rel.plt) } + .rela.plt : { *(.rela.plt) } + .init : { *(.init) } =0x9090 + .plt : { *(.plt) } + . = ALIGN(0x1000); + .text : + { + *(.text) + *(.stub) + + /* .gnu.warning sections are handled specially by elf32.em. */ + + *(.gnu.warning) + *(.gnu.linkonce.t*) + } =0x9090 + _etext = .; + PROVIDE (etext = .); + .fini : { *(.fini) } =0x9090 + .rodata1 : { *(.rodata1) } + + /* Adjust the address for the data segment. We want to page align it. */ + + . = ALIGN(0x1000); + .data : + { + *(.data) + *(.rodata) +/* *(.gnu.linkonce.d*) + CONSTRUCTORS */ + } + _edata = .; + PROVIDE (edata = .); + __bss_start = .; + .sbss : { *(.sbss) *(.scommon) } + .bss : + { + *(.dynbss) + *(.bss) + *(COMMON) + } + . = ALIGN(32 / 8); + _end = . ; + PROVIDE (end = .); + + /* Stabs debugging sections. */ + + .stab 0 : { *(.stab) } + .stabstr 0 : { *(.stabstr) } + .stab.excl 0 : { *(.stab.excl) } + .stab.exclstr 0 : { *(.stab.exclstr) } + .stab.index 0 : { *(.stab.index) } + .stab.indexstr 0 : { *(.stab.indexstr) } + .comment 0 : { *(.comment) } + + /* DWARF debug sections. + Symbols in the DWARF debugging sections are relative to the beginning + of the section so we begin them at 0. */ + /* DWARF 1 */ + + .debug 0 : { *(.debug) } + .line 0 : { *(.line) } + + /* GNU DWARF 1 extensions */ + + .debug_srcinfo 0 : { *(.debug_srcinfo) } + .debug_sfnames 0 : { *(.debug_sfnames) } + + /* DWARF 1.1 and DWARF 2 */ + + .debug_aranges 0 : { *(.debug_aranges) } + .debug_pubnames 0 : { *(.debug_pubnames) } + + /* DWARF 2 */ + + .debug_info 0 : { *(.debug_info) } + .debug_abbrev 0 : { *(.debug_abbrev) } + .debug_line 0 : { *(.debug_line) } + .debug_frame 0 : { *(.debug_frame) } + .debug_str 0 : { *(.debug_str) } + .debug_loc 0 : { *(.debug_loc) } + .debug_macinfo 0 : { *(.debug_macinfo) } + + /* SGI/MIPS DWARF 2 extensions */ + + .debug_weaknames 0 : { *(.debug_weaknames) } + .debug_funcnames 0 : { *(.debug_funcnames) } + .debug_typenames 0 : { *(.debug_typenames) } + .debug_varnames 0 : { *(.debug_varnames) } + + /* These must appear regardless of . */ +} diff --git a/libraries/checksum/autochaos.rules b/libraries/checksum/autochaos.rules new file mode 100644 index 00000000..6bff5720 --- /dev/null +++ b/libraries/checksum/autochaos.rules @@ -0,0 +1,27 @@ + + + + + + + makefile + .. + + + + crc32.c + md5.c +
checksum.h
+
defines.h
+
functions.h
+
types.h
+
+
+ + diff --git a/libraries/checksum/changelog b/libraries/checksum/changelog new file mode 100644 index 00000000..2313da43 --- /dev/null +++ b/libraries/checksum/changelog @@ -0,0 +1,12 @@ +2000-09-17 Per Lundberg + + * md5.c (checksum_md5): New function that does all the real work + in one sweep. + +2000-07-26 Per Lundberg + + * md5.c: New file, adopted from FreeBSD, which in turn adopted the + reference implementation from RFC 1321... + + * Started writing this change log. + diff --git a/libraries/checksum/checksum.h b/libraries/checksum/checksum.h new file mode 100644 index 00000000..32cd9f43 --- /dev/null +++ b/libraries/checksum/checksum.h @@ -0,0 +1,29 @@ +/* $Id$ */ +/* Abstract: Checksum library header file. */ +/* Author: Per Lundberg */ + +/* Copyright 2000 chaos development. */ + +/* This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public License + as published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + USA. */ + +#ifndef __LIBRARY_CHECKSUM_CHECKSUM_H__ +#define __LIBRARY_CHECKSUM_CHECKSUM_H__ + +#include +#include +#include + +#endif /* !__LIBRARY_CHECKSUM_CHECKSUM_H__ */ diff --git a/libraries/checksum/config.h b/libraries/checksum/config.h new file mode 100644 index 00000000..8009e22f --- /dev/null +++ b/libraries/checksum/config.h @@ -0,0 +1,11 @@ +/* Automatically generated by autochaos 0.2.1. Not intended to be + hand edited. */ + +#ifndef __CONFIG_H__ +#define __CONFIG_H__ + +#define PACKAGE_NAME "checksum" +#define PACKAGE_VERSION "0.0.1" + + +#endif /* !__CONFIG_H__ */ \ No newline at end of file diff --git a/libraries/checksum/configure b/libraries/checksum/configure new file mode 100755 index 00000000..c236c97d --- /dev/null +++ b/libraries/checksum/configure @@ -0,0 +1,423 @@ +#! /usr/bin/perl -w + +# Abstract: Script for configuring this package. + +# Copyright 2000 chaos development. This script is in the public domain. + +# Please note that this script was automatically generated by +# autochaos 0.2.1. It should not be modified. Do the changes you +# want in autochaos instead. + +use strict; +use POSIX; + +my $chaos_root = "/tftpboot/chaos"; +my @libraries = (); +my @headers = (); +my @sources = (); +my @objects = (); +my @deps = (); +my $MAKEFILE; +my $TEMPLATE; +my $root_dir = getcwd (); +my %options = +( +); + +my $install_prefix_flag = 0; + +foreach my $argument (@ARGV) +{ + if ($install_prefix_flag eq 1) + { + $chaos_root = $argument; + $install_prefix_flag = 0; + } + else + { + if ($argument eq '--install-prefix') + { + $install_prefix_flag = 1; + } + elsif ($argument =~ m/--enable-.*$/) + { + (my $option) = ($argument =~ m/--enable-(.*)$/); + + if ($options{$option}) + { + $options{$option} = 'TRUE'; + } + else + { + print "Unrecognised command line option.\n"; + exit 1; + } + } + elsif ($argument =~ m/--disable-.*$/) + { + (my $option) = ($argument =~ m/--disable-(.*)$/); + + if ($options{$option}) + { + $options{$option} = 'FALSE'; + } + else + { + print "Unrecognised command line option.\n"; + exit 1; + } + } + else + { + print "Unrecognised command line option.\n"; + exit 1; + } + } +} + +if ($install_prefix_flag eq 1) +{ + print "Malformed --install-prefix command option. Value missing.\n"; + exit 1; +} + +print "\n Configuring library: checksum...\n\n"; + +print ("Using chaos root... ($chaos_root)\n"); + + +my $all_arguments = ""; +foreach my $argument (@ARGV) +{ + $all_arguments .= $argument . " "; +} + +print ("Checking for autochaos... "); +my $autochaos = `autochaos --version 2> /dev/null`; + +my $has_autochaos; +unless ($autochaos) +{ + print ("not found.\n"); + $has_autochaos = undef; +} +else +{ + (my $version) = ($autochaos =~ m/ ([\d\.]+)$/); + print ("found (version $version).\n"); + $has_autochaos = $version; +} + + + +@headers = ( +'checksum.h', +'defines.h', +'functions.h', +'types.h', +); + +@sources = ( +'crc32.c', +'md5.c', +); +@objects = ('crc32.o', +'md5.o', +); +@deps = ('crc32.dep', +'md5.dep', +); + print "Writing ./makefile... +"; + open (MAKEFILE, '>' . "./makefile") or + die ("Could not write to ./makefile: $!\n"); + +# Write the default rules we want. + + print (MAKEFILE < 0) + { + print MAKEFILE "\n\nOBJECTS = "; + foreach my $object (@objects) + { + print MAKEFILE " \\\ +$object"; + } + print MAKEFILE "\ +"; + } + + if (scalar @headers > 0) + { + print MAKEFILE "\n\nHEADERS = "; + foreach my $header (@headers) + { + print MAKEFILE " \\\ +$header"; + } + print MAKEFILE "\ +"; + } + + if (scalar @sources > 0) + { + print MAKEFILE "\n\nSOURCES = "; + foreach my $source (@sources) + { + print MAKEFILE " \\\ +$source"; + } + print MAKEFILE "\ +"; + + } + + print (MAKEFILE < \$(*F).dep + +%.o: %.S + \@echo Compiling \$<... + \@\$(CC) -o \$(@) \$(CFLAGS) \$(INCLUDES) \$(DEFS) -c \$< + \@\$(CC) -M \$< \$(CFLAGS) \$(INCLUDES) \$(DEFS) > \$(*F).dep + +%.o: %.asm + \$(NASM) -o \$(@) \$< -f elf + +.PHONY: splash all clean install package-source package-check package + +STOP + + { + my $target = "library_checksum.a" if (scalar @objects); + + unless ($target) + { + $target = ""; + } + + print (MAKEFILE < 0) + { + print MAKEFILE " rm -f \$(OBJECTS) +"; + } + print (MAKEFILE < 0) + { + print (MAKEFILE < 0) + { + print (MAKEFILE < 0) + { + foreach my $dep (@deps) + { + print (MAKEFILE "-include $dep\n"); + } + } + + print (MAKEFILE "\n"); + + if (open (TEMPLATE, "." . "/makefile.template")) + { + while (